@kong-ui-public/table-data-grid 0.7.3 → 0.7.4-pr.3892.c83ecea95.0

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.
Files changed (34) hide show
  1. package/package.json +1 -1
  2. package/dist/style.css +0 -1
  3. package/dist/table-data-grid.es.js +0 -719
  4. package/dist/table-data-grid.umd.js +0 -1
  5. package/dist/types/components/TableDataGrid.vue.d.ts +0 -40
  6. package/dist/types/components/TableDataGrid.vue.d.ts.map +0 -1
  7. package/dist/types/components/TableDataGridCellRenderer.vue.d.ts +0 -25
  8. package/dist/types/components/TableDataGridCellRenderer.vue.d.ts.map +0 -1
  9. package/dist/types/composables/useEmitState.d.ts +0 -11
  10. package/dist/types/composables/useEmitState.d.ts.map +0 -1
  11. package/dist/types/composables/useFetchInfinite.d.ts +0 -53
  12. package/dist/types/composables/useFetchInfinite.d.ts.map +0 -1
  13. package/dist/types/composables/useFetchState.d.ts +0 -30
  14. package/dist/types/composables/useFetchState.d.ts.map +0 -1
  15. package/dist/types/composables/useI18n.d.ts +0 -9
  16. package/dist/types/composables/useI18n.d.ts.map +0 -1
  17. package/dist/types/composables/useTableDataGridColumnDefs.d.ts +0 -31
  18. package/dist/types/composables/useTableDataGridColumnDefs.d.ts.map +0 -1
  19. package/dist/types/composables/useTableDataGridConfig.d.ts +0 -38
  20. package/dist/types/composables/useTableDataGridConfig.d.ts.map +0 -1
  21. package/dist/types/composables/useTableDataGridInteractions.d.ts +0 -17
  22. package/dist/types/composables/useTableDataGridInteractions.d.ts.map +0 -1
  23. package/dist/types/composables/useTableDataGridSort.d.ts +0 -18
  24. package/dist/types/composables/useTableDataGridSort.d.ts.map +0 -1
  25. package/dist/types/index.d.ts +0 -4
  26. package/dist/types/index.d.ts.map +0 -1
  27. package/dist/types/types/index.d.ts +0 -105
  28. package/dist/types/types/index.d.ts.map +0 -1
  29. package/dist/types/utils/fetchers.d.ts +0 -42
  30. package/dist/types/utils/fetchers.d.ts.map +0 -1
  31. package/dist/types/utils/tableConfig.d.ts +0 -25
  32. package/dist/types/utils/tableConfig.d.ts.map +0 -1
  33. package/dist/types/utils/tableDataGridPresentation.d.ts +0 -87
  34. package/dist/types/utils/tableDataGridPresentation.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- (function(x,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("ag-grid-vue3"),require("ag-grid-community"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","ag-grid-vue3","ag-grid-community","@kong-ui-public/i18n"],e):(x=typeof globalThis<"u"?globalThis:x||self,e(x["kong-ui-public-table-data-grid"]={},x.Vue,x.AgGridVue,x.agGridCommunity,x["kong-ui-public-i18n"]))})(this,(function(x,e,Y,L,W){"use strict";var $=(t=>(t.PENDING="PENDING",t.LOADING="LOADING",t.SUCCESS="SUCCESS",t.ERROR="ERROR",t))($||{});const Z=t=>!!t?.length;function ee(t,a,o,n=Z){const l=e.computed(()=>n(t.value)),r=e.computed(()=>{const u=t.value!==void 0,s=a.value!==void 0&&a.value!==null;return o.value?"LOADING":l.value?"SUCCESS":s?"ERROR":u?"SUCCESS":"PENDING"});return{fetchState:$,hasData:l,state:r}}const te=({emitState:t,fetchLifecycleState:a,hasData:o})=>{e.watch(()=>({hasData:o.value,state:a.value}),({hasData:n,state:l})=>{if(l!==$.PENDING){if(l===$.LOADING){t({hasData:n,state:"loading"});return}if(l===$.ERROR){t({hasData:n,state:"error"});return}t({hasData:n,state:"success"})}})},oe=({startRow:t,endRow:a})=>{const o=a-t;return{blockIndex:o>0?Math.floor(t/o):0,pageSize:o}},ae=({startRow:t,rowsLength:a,pageSize:o,total:n,hasMore:l})=>{if(typeof n=="number")return n;if(l!==!0&&(l===!1||a<o))return t+a},le=({fetcher:t,resetKey:a,sort:o})=>{const n=new Map,l=new Map,r=e.ref(0),g=e.ref(0),u=e.shallowRef(),s=e.shallowRef(),p=e.shallowRef(),b=e.ref(0),w=e.ref(!1);let h,R,z=o?.value?.sortColumnKey,i=o?.value?.sortColumnOrder;const f=d=>d===r.value&&h===t.value&&R===a?.value,k=(d,m)=>f(d)&&m===g.value&&z===o?.value?.sortColumnKey&&i===o?.value?.sortColumnOrder,G=d=>{if(!o)return!0;const m=o.value;return!m?.sortColumnKey||!m.sortColumnOrder?d.length===0:d.length===1&&d[0].colId===m.sortColumnKey&&d[0].sort===m.sortColumnOrder},E=()=>{w.value=b.value>0},T=()=>{g.value+=1,z=o?.value?.sortColumnKey,i=o?.value?.sortColumnOrder;for(const d of l.values())d.resolve(!1);n.clear(),l.clear(),s.value=void 0,p.value=void 0,b.value=0,E()},B=()=>{p.value=void 0,b.value+=1,E()},V=()=>{b.value=Math.max(0,b.value-1),E()},K=d=>{const m=l.get(d);if(m)return m;let C;const y={promise:new Promise(S=>{C=S}),resolve:S=>C(S)};return l.set(d,y),y},D=(d,m)=>{m.resolve(!1),l.get(d)===m&&l.delete(d)},M=async({blockIndex:d,currentBlockCompletion:m,datasourceId:C,requestGeneration:y})=>{if(d===0)return"ready";const S=l.get(d-1);if(!S)return D(d,m),"failed";const I=await S.promise;return k(C,y)?I?"ready":(D(d,m),"failed"):(D(d,m),"stale")},v=({blockIndex:d,currentBlockCompletion:m,getRowsParams:C,pageSize:y,result:S})=>{S.cursor!==void 0&&n.set(d,S.cursor),C.successCallback(S.data,ae({startRow:C.startRow,rowsLength:S.data.length,pageSize:y,total:S.total,hasMore:S.hasMore})),C.startRow===0&&(s.value=S.data),m.resolve(!0)},O=({blockIndex:d,currentBlockCompletion:m,fetchError:C,getRowsParams:y})=>{p.value=C,y.failCallback(),D(d,m)},N=()=>{const d=t.value;if(!d)throw new Error("TableDataGrid requires a fetcher in infinite mode");h=d,R=a?.value;const m=r.value+1;return r.value=m,T(),{async getRows(C){if(!f(m)||!G(C.sortModel)){C.failCallback();return}const{blockIndex:y,pageSize:S}=oe({startRow:C.startRow,endRow:C.endRow});y===0&&l.has(0)&&T();const I=g.value,c=K(y);if(await M({blockIndex:y,currentBlockCompletion:c,datasourceId:m,requestGeneration:I})!=="ready"||!k(m,I)){C.failCallback(),D(y,c);return}B();try{const F=y>0?n.get(y-1):void 0,U=await d({mode:"infinite",pageSize:S,cursor:F,sort:o?.value});if(!k(m,I)){C.failCallback(),D(y,c);return}v({blockIndex:y,currentBlockCompletion:c,getRowsParams:C,pageSize:S,result:U})}catch(F){if(!k(m,I)){C.failCallback(),D(y,c);return}O({blockIndex:y,currentBlockCompletion:c,fetchError:F,getRowsParams:C})}finally{k(m,I)&&V()}}}},A=()=>{u.value=N()};return e.watch([t,()=>a?.value],()=>{A()},{immediate:!0}),e.watch([()=>o?.value?.sortColumnKey,()=>o?.value?.sortColumnOrder],()=>T()),{datasource:e.readonly(u),data:e.shallowReadonly(s),error:e.readonly(p),isFetching:e.readonly(w)}},ne={emptyState:{title:"No Data",message:"There is no data to display."},errorState:{title:"An error occurred",message:"Data cannot be displayed due to an error."}};function j(){const t=W.createI18n("en-us",ne);return{i18n:t,i18nT:W.i18nTComponent(t)}}const{i18n:re}=j(),H=(t,a)=>{const o=Reflect.get(a,t.key);return t.valueFormatter?t.valueFormatter(o,a):String(o??"")},q=t=>typeof t!="number"?null:Number.isFinite(t)?t:null,se=(t,a)=>t.reduce((o,n)=>{const l=q(Reflect.get(n,a.key));return l===null?o:{sum:o.sum+l,max:Math.max(o.max,l)}},{sum:0,max:0}),ie=(t,a)=>{const o=(a??[]).filter(r=>Number.isFinite(r.value)&&t>=r.value);if(!o.length)return;const n=Math.max(...o.map(r=>r.value));return o.filter(r=>r.value===n).some(r=>r.type==="error")?"error":"warning"},ce=(t,a,o)=>{if(t===null)return 0;const n=o==="relative"?a.sum:a.max;return n>0?Math.min(Math.max(t/n,0),1):0},ue=t=>{const a=o=>re.formatNumber(o,{maximumFractionDigits:2});return t>0&&t<.01?`< ${a(.01)} %`:`${a(t)} %`},Q=({value:t,stats:a,header:o})=>{if(t===null||a.sum<=0)return;const n=t/a.sum*100;return o.percentageFormatter?.(n)??ue(n)},J=(t,a)=>a!==void 0&&a.length>(t?.length??-1)?a:t,de=({rows:t,header:a,stats:o})=>t.reduce((n,l)=>({value:J(n.value,H(a,l))??"",relative:a.showPercentage?J(n.relative,Q({value:q(Reflect.get(l,a.key)),stats:o,header:a})):void 0}),{value:""}),me=["data-threshold"],fe={class:"table-data-grid-cell-label-track"},pe={class:"table-data-grid-cell-label"},Ce={key:0,class:"table-data-grid-cell-relative","data-testid":"table-data-grid-cell-relative"},ge={key:0,"aria-hidden":"true",class:"table-data-grid-cell-label table-data-grid-cell-label-sizer"},he=["data-text"],ve=["data-text"],ye=["data-threshold"],be=e.defineComponent({name:"TableDataGridCellRenderer",__name:"TableDataGridCellRenderer",props:{params:{}},setup(t,{expose:a}){const o=e.shallowRef(t.params),n=e.ref(null),l=e.ref(!1),r=e.computed(()=>o.value.headerDef??{key:"",label:""}),g=e.computed(()=>o.value.context?.presentation),u=e.computed(()=>o.value.context?.cells?.tooltipTarget?.value??"body"),s=e.computed(()=>o.value.valueFormatted??String(o.value.value??"")),p=e.computed(()=>o.value.value),b=e.computed(()=>q(p.value)),w=e.computed(()=>g.value?.stats[r.value.key]),h=e.computed(()=>r.value.showPercentage&&w.value?Q({value:b.value,stats:w.value,header:r.value}):void 0),R=e.computed(()=>!!r.value.bar&&!!w.value&&(b.value!==null||p.value===null||p.value===void 0)),z=e.computed(()=>R.value&&w.value?ce(b.value,w.value,r.value.bar)*100:0),i=e.computed(()=>R.value?g.value?.labelSizers[r.value.key]:void 0),f=e.computed(()=>r.value.thresholds?.length&&b.value!==null?ie(b.value,r.value.thresholds):void 0),k=e.computed(()=>({column:r.value,refreshCell:()=>{const v=o.value.node;v&&o.value.api.refreshCells({force:!0,rowNodes:[v]})},row:o.value.data??{},rowIndex:o.value.node?.rowIndex??0,rowValue:o.value.value,selected:o.value.node?.isSelected()??!1})),G=(v,{slots:O})=>{const N=o.value.colDef?.colId,A=o.value.context?.cells?.slots;return!N||N==="cell-icon"||!A?.[N]?O.default?.():e.h("span",{class:"table-data-grid-cell-slot-content"},e.renderSlot(A,N,k.value,()=>O.default?.()??[]))},E=()=>{const v=o.value.context?.cells?.slots;return v?.["cell-icon"]?e.renderSlot(v,"cell-icon",k.value):null};let T,B,V=!1;const K=()=>{const v=n.value;l.value=!!v&&v.scrollWidth>v.clientWidth},D=()=>{V||(B!==void 0&&cancelAnimationFrame(B),B=requestAnimationFrame(()=>{B=void 0,K()}))},M=v=>{if(T?.disconnect(),v){T?.observe(v);const O=v.closest(".ag-cell");O&&T?.observe(O)}D()};return e.onMounted(()=>{T=new ResizeObserver(D),M(n.value)}),e.watch(n,M),e.onUnmounted(()=>{V=!0,T?.disconnect(),B!==void 0&&cancelAnimationFrame(B)}),a({refresh(v){return o.value=v,e.nextTick(D),!0}}),(v,O)=>{const N=e.resolveComponent("KTooltip");return e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["table-data-grid-cell-renderer",{"table-data-grid-cell-renderer--bar":R.value,"table-data-grid-cell-renderer--percentage":!!h.value,[`table-data-grid-cell-renderer--text-${f.value}`]:!R.value&&!!f.value}]),"data-threshold":f.value},[e.createElementVNode("span",fe,[e.createElementVNode("span",pe,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E))),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(G),null,{default:e.withCtx(()=>[e.createVNode(N,{class:"table-data-grid-cell-tooltip",disabled:!l.value,"kpop-attributes":{popoverDelay:400},"max-width":"300",placement:"bottom-start",target:u.value,text:s.value},{default:e.withCtx(()=>[e.createElementVNode("span",{ref_key:"contentElement",ref:n,class:"table-data-grid-cell-content"},e.toDisplayString(s.value),513)]),_:1},8,["disabled","target","text"])]),_:1})),h.value?(e.openBlock(),e.createElementBlock("span",Ce,"("+e.toDisplayString(h.value)+")",1)):e.createCommentVNode("",!0)]),i.value?(e.openBlock(),e.createElementBlock("span",ge,[e.createElementVNode("span",{class:"table-data-grid-cell-sizer-value","data-text":i.value.value},null,8,he),i.value.relative?(e.openBlock(),e.createElementBlock("span",{key:0,class:"table-data-grid-cell-sizer-relative","data-text":`(${i.value.relative})`},null,8,ve)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),R.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"table-data-grid-cell-bar","data-testid":"table-data-grid-cell-bar","data-threshold":f.value},[e.createElementVNode("span",{class:"table-data-grid-cell-bar-fill","data-testid":"table-data-grid-cell-bar-fill",style:e.normalizeStyle({width:`${z.value}%`})},null,4)],8,ye)):e.createCommentVNode("",!0)],10,me)}}}),ke=({headers:t,slots:a,initialSort:o,mode:n,rows:l,tooltipTarget:r})=>{const g=n??"infinite",u=new Set,s=i=>!!(i.showPercentage||i.bar||i.thresholds?.length),p=()=>{t.value.forEach(i=>{if(!s(i))return;let f;if(g==="infinite"&&(i.showPercentage||i.bar)?f="percentage and bar presentation is only supported in unpaginated mode":g==="unpaginated"&&l?.value?.some(G=>{const E=Reflect.get(G,i.key);return E!=null&&q(E)===null})&&(f="contains non-finite or nonnumeric values; numeric presentation skips those values"),!f)return;const k=`${i.key}:${f}`;u.has(k)||(u.add(k),console.warn(`[TableDataGrid] Column "${i.key}" ${f}.`))})};e.watch([t,()=>l?.value],p,{immediate:!0});const b=e.computed(()=>{if(g!=="unpaginated")return{};const i=l?.value??[];return Object.fromEntries(t.value.filter(f=>f.showPercentage||f.bar).map(f=>[f.key,se(i,f)]))}),w=e.computed(()=>{if(g!=="unpaginated")return{};const i=l?.value??[];return Object.fromEntries(t.value.filter(f=>f.bar).map(f=>[f.key,de({rows:i,header:f,stats:b.value[f.key]})]))}),h=e.computed(()=>({cells:{slots:a,tooltipTarget:r},presentation:{stats:b.value,labelSizers:w.value}})),R=i=>{const f=o?.sortColumnKey===i.key;return{colId:i.key,flex:!i.width&&!i.maxWidth?1:void 0,headerName:i.label,maxWidth:i.maxWidth,minWidth:i.minWidth,sortable:i.sortable??!1,unSortIcon:i.showSortIcon,...f?{initialSort:o?.sortColumnOrder,initialSortIndex:0}:{},valueGetter:k=>k.data?.[i.key],valueFormatter:k=>k.data?H(i,k.data):String(k.value??""),width:i.width,cellRenderer:be,cellRendererParams:{headerDef:i}}};return{columnDefs:e.computed(()=>t.value.map(R)),gridContext:h}},P=({config:t,headers:a,pageSize:o})=>{const n=new Set(a.filter(r=>r.sortable).map(r=>r.key)),l=t?.sortColumnKey&&n.has(t.sortColumnKey)?t.sortColumnKey:void 0;return{sortColumnKey:l,sortColumnOrder:l?t?.sortColumnOrder:void 0,pageSize:t?.pageSize??o,...t?.fitToContent!==void 0?{fitToContent:t.fitToContent}:{}}},X=(t,a)=>t.sortColumnKey===a.sortColumnKey&&t.sortColumnOrder===a.sortColumnOrder&&t.pageSize===a.pageSize&&t.fitToContent===a.fitToContent,Se=({headers:t,pageSize:a,tableConfig:o,emitSort:n,emitTableConfigUpdate:l,onExternalConfigChange:r})=>{const g=e.computed(()=>o.value?P({config:o.value,headers:t.value,pageSize:a.value}):void 0),u=e.ref(g.value??P({config:void 0,headers:t.value,pageSize:a.value}));e.watch(g,w=>{w&&!X(w,u.value)&&(u.value=w,r?.(w))});const s=w=>{const h=P({config:{...u.value,...w},headers:t.value,pageSize:a.value});X(h,u.value)||((h.sortColumnKey!==u.value.sortColumnKey||h.sortColumnOrder!==u.value.sortColumnOrder)&&n({sortColumnKey:h.sortColumnKey,sortColumnOrder:h.sortColumnOrder}),u.value=h,l(h))};e.watch(t,()=>{o.value||s({})},{deep:!0});const p=e.computed(()=>({sortColumnKey:u.value.sortColumnKey,sortColumnOrder:u.value.sortColumnOrder})),b=e.computed(()=>o.value?.pageSize??a.value);return{activeTableConfig:e.readonly(u),activeSort:p,activePageSize:b,patchTableConfig:s}},we=({cellClick:t,headers:a,rowClick:o})=>{const n=e.computed(()=>new Set(a.value.filter(s=>s.disableRowClick).map(s=>s.key))),l=s=>{const p=s.event?.target;return p instanceof Element?p.closest(".ag-cell")?.getAttribute("col-id")??void 0:void 0},r=s=>{const p=l(s);return!!(p&&n.value.has(p))};return{onCellClick:s=>{const p=s.colDef.colId;!s.data||!p||t({columnKey:p,row:s.data,value:s.value})},onRowClick:s=>{s.data&&!r(s)&&o(s.data,s)}}},Re=({activeSort:t,patchTableConfig:a})=>{const o=(l,r)=>{l.applyColumnState({state:r.sortColumnKey?[{colId:r.sortColumnKey,sort:r.sortColumnOrder??null,sortIndex:0}]:[],defaultState:{sort:null,sortIndex:null}})};return{onSortChanged:l=>{const r=l.api.getColumnState().filter(s=>s.sort).sort((s,p)=>(s.sortIndex??0)-(p.sortIndex??0)),g=r[r.length-1],u=g?{sortColumnKey:g.colId,sortColumnOrder:g.sort}:{sortColumnKey:void 0,sortColumnOrder:void 0};(u.sortColumnKey!==t.value.sortColumnKey||u.sortColumnOrder!==t.value.sortColumnOrder)&&a(u),r.length>1&&o(l.api,u)},applySortToGrid:o}},De={key:0,class:"table-error-state","data-testid":"table-error-state"},Ee={key:1,class:"table-empty-state","data-testid":"table-empty-state"},Te=((t,a)=>{const o=t.__vccOpts||t;for(const[n,l]of a)o[n]=l;return o})(e.defineComponent({__name:"TableDataGrid",props:{headers:{},error:{type:Boolean,default:!1},tableConfig:{},fetcher:{type:Function},mode:{},pageSize:{default:25},refreshKey:{type:[String,Number,Boolean]},rows:{}},emits:["grid:ready","state","row:click","cell:click","sort","update:tableConfig"],setup(t,{emit:a}){L.ModuleRegistry.registerModules([L.AllCommunityModule,L.ClientSideRowModelModule,L.InfiniteRowModelModule]);const o=t.mode??"infinite",n=a,{i18n:l}=j(),{t:r}=l,g=e.useSlots(),u=e.shallowRef(),s=e.useTemplateRef("rootElement"),p=e.shallowRef("body"),b=()=>{const c=document.fullscreenElement;p.value=c instanceof HTMLElement&&c.contains(s.value??null)?c:"body"};e.onMounted(()=>{b(),document.addEventListener("fullscreenchange",b)}),e.onBeforeUnmount(()=>{document.removeEventListener("fullscreenchange",b)});const{activeTableConfig:w,activeSort:h,activePageSize:R,patchTableConfig:z}=Se({headers:e.toRef(()=>t.headers),pageSize:e.toRef(()=>t.pageSize),tableConfig:e.toRef(()=>t.tableConfig),emitSort:c=>n("sort",c),emitTableConfigUpdate:c=>n("update:tableConfig",c),onExternalConfigChange:c=>{u.value&&f(u.value,c)}}),{onSortChanged:i,applySortToGrid:f}=Re({activeSort:h,patchTableConfig:z}),k=e.computed(()=>o==="unpaginated"&&!!w.value.fitToContent),G=L.themeQuartz.withParams({autoHeightMinBodyHeight:0}),{onCellClick:E,onRowClick:T}=we({cellClick:c=>n("cell:click",c),headers:e.toRef(()=>t.headers),rowClick:(c,_)=>n("row:click",c,_)}),B={resizable:!1,sortable:!1,suppressMovable:!0},V=e.computed(()=>[R.value,t.refreshKey]),K=o==="infinite"?le({fetcher:e.toRef(()=>t.fetcher),resetKey:V,sort:h}):void 0,D=K?.datasource,M=e.computed(()=>K?K.data.value:t.rows),v=e.computed(()=>K?.isFetching.value??!1),O=e.computed(()=>t.rows?Array.from(t.rows):void 0),{columnDefs:N,gridContext:A}=ke({headers:e.toRef(()=>t.headers),mode:o,rows:O,slots:g,tooltipTarget:p,initialSort:h.value}),{fetchState:d,hasData:m,state:C}=ee(M,e.toRef(()=>K?.error.value),v),y=e.computed(()=>C.value===d.SUCCESS&&!m.value);K&&te({emitState:c=>n("state",c),fetchLifecycleState:C,hasData:m});const S=()=>{const c=u.value;if(!c||c.isDestroyed())return;const _=h.value,F=c.getColumnState().find(U=>U.sort);F?.colId===_.sortColumnKey&&(F?.sort??void 0)===_.sortColumnOrder||f(c,_)};e.watch([u,h],S);const I=c=>{u.value=c.api,n("grid:ready",c.api)};return(c,_)=>{const F=e.resolveComponent("KEmptyState");return e.openBlock(),e.createElementBlock("div",{ref_key:"rootElement",ref:s,class:e.normalizeClass(["kong-ui-public-table-data-grid",{"fit-to-content":k.value}]),"data-testid":"table-data-grid"},[t.error?(e.openBlock(),e.createElementBlock("div",De,[e.renderSlot(c.$slots,"error-state",{},()=>[e.createVNode(F,{"icon-variant":"error",message:e.unref(r)("errorState.message"),title:e.unref(r)("errorState.title")},null,8,["message","title"])],!0)])):y.value?(e.openBlock(),e.createElementBlock("div",Ee,[e.renderSlot(c.$slots,"empty-state",{},()=>[e.createVNode(F,{message:e.unref(r)("emptyState.message"),title:e.unref(r)("emptyState.title")},null,8,["message","title"])],!0)])):(e.openBlock(),e.createBlock(e.unref(Y.AgGridVue),{key:2,"cache-block-size":e.unref(o)==="infinite"?e.unref(R):void 0,class:"table-data-grid-grid","column-defs":e.unref(N),context:e.unref(A),datasource:e.unref(o)==="infinite"?e.unref(D):void 0,"default-col-def":B,"dom-layout":k.value?"autoHeight":"normal","infinite-initial-row-count":e.unref(o)==="infinite"?1:void 0,loading:v.value,"row-data":e.unref(o)==="unpaginated"?O.value:void 0,"row-model-type":e.unref(o)==="unpaginated"?"clientSide":"infinite","suppress-cell-focus":!0,"suppress-multi-sort":!0,theme:e.unref(G),onCellClicked:e.unref(E),onGridReady:I,onNewColumnsLoaded:S,onRowClicked:e.unref(T),onSortChanged:e.unref(i)},null,8,["cache-block-size","column-defs","context","datasource","dom-layout","infinite-initial-row-count","loading","row-data","row-model-type","theme","onCellClicked","onRowClicked","onSortChanged"]))],2)}}}),[["__scopeId","data-v-01cd8bcd"]]);x.TableDataGrid=Te,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})}));
@@ -1,40 +0,0 @@
1
- import type { TableDataGridCellClickPayload, TableDataGridCellSlotProps, TableDataGridConfig, TableDataGridProps, TableDataGridSort, TableDataGridStatePayload } from '../types';
2
- import type { GridApi, GridReadyEvent, RowClickedEvent } from 'ag-grid-community';
3
- declare const __VLS_export: <Row extends object>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
- props: import("vue").PublicProps & __VLS_PrettifyLocal<TableDataGridProps<Row> & {
5
- onState?: ((payload: TableDataGridStatePayload) => any) | undefined;
6
- onSort?: ((payload: TableDataGridSort) => any) | undefined;
7
- "onGrid:ready"?: ((api: GridApi<Row>) => any) | undefined;
8
- "onCell:click"?: ((payload: TableDataGridCellClickPayload<Row>) => any) | undefined;
9
- "onUpdate:tableConfig"?: ((payload: TableDataGridConfig) => any) | undefined;
10
- "onRow:click"?: ((row: Row, event: RowClickedEvent<Row, any>) => any) | undefined;
11
- }> & (typeof globalThis extends {
12
- __VLS_PROPS_FALLBACK: infer P;
13
- } ? P : {});
14
- expose: (exposed: {}) => void;
15
- attrs: any;
16
- slots: {
17
- [columnKey: string]: (props: TableDataGridCellSlotProps<Row>) => unknown;
18
- 'empty-state': () => unknown;
19
- 'error-state': () => unknown;
20
- 'cell-icon': (props: TableDataGridCellSlotProps<Row>) => unknown;
21
- };
22
- emit: {
23
- (e: "grid:ready", api: GridReadyEvent<Row>["api"]): void;
24
- (e: "state", payload: TableDataGridStatePayload): void;
25
- (e: "row:click", row: Row, event: RowClickedEvent<Row>): void;
26
- (e: "cell:click", payload: TableDataGridCellClickPayload<Row>): void;
27
- (e: "sort", payload: TableDataGridSort): void;
28
- (e: "update:tableConfig", payload: TableDataGridConfig): void;
29
- };
30
- }>) => import("vue").VNode & {
31
- __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
32
- };
33
- declare const _default: typeof __VLS_export;
34
- export default _default;
35
- type __VLS_PrettifyLocal<T> = (T extends any ? {
36
- [K in keyof T]: T[K];
37
- } : {
38
- [K in keyof T as K]: T[K];
39
- }) & {};
40
- //# sourceMappingURL=TableDataGrid.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TableDataGrid.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TableDataGrid.vue"],"names":[],"mappings":"AA4TA,OAAO,KAAK,EACV,6BAA6B,EAC7B,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EAC1B,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAEV,OAAO,EACP,cAAc,EACd,eAAe,EAChB,MAAM,mBAAmB,CAAA;AAmB1B,QAAA,MAAM,YAAY,GAAK,GAAG,SAAS,MAAM,EACxC,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,gBAAgB,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAClE;WAiWO,OAAO,KAAK,EAAE,WAAW,GAAG,mBAAmB,CAAC;;;;;;;KAAmC,CAAC,GAAG,CAAC,OAAO,UAAU,SAAS;QAAE,oBAAoB,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAC5J,CAAC,OAAO,EAAE,EAAE,KAAK,IAAI;WACtB,GAAG;;qCA7UoB,0BAA0B,CAAC,GAAG,CAAC,KAAK,OAAO;uBAHzD,MAAM,OAAO;uBACb,MAAM,OAAO;qBACf,CAAC,KAAK,EAAE,0BAA0B,CAAC,GAAG,CAAC,KAAK,OAAO;;;YAM5D,YAAY,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI;YACpD,OAAO,WAAW,yBAAyB,GAAG,IAAI;YAClD,WAAW,OAAO,GAAG,SAAS,eAAe,CAAC,GAAG,CAAC,GAAG,IAAI;YACzD,YAAY,WAAW,6BAA6B,CAAC,GAAG,CAAC,GAAG,IAAI;YAChE,MAAM,WAAW,iBAAiB,GAAG,IAAI;YACzC,oBAAoB,WAAW,mBAAmB,GAAG,IAAI;;EAuU3D,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAA;CAAI,CAAC;wBACpE,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
@@ -1,25 +0,0 @@
1
- import type { TableDataGridHeader } from '../types';
2
- import type { ICellRendererParams } from 'ag-grid-community';
3
- import type { Ref, Slots } from 'vue';
4
- import { type TableDataGridPresentationContext } from '../utils/tableDataGridPresentation';
5
- type CellRendererParams = ICellRendererParams<Record<string, unknown>> & {
6
- /** Set internally via `cellRendererParams` so the renderer can resolve the
7
- * host slot and build its payload without leaking AG Grid's own `column`. */
8
- headerDef?: TableDataGridHeader;
9
- context?: {
10
- cells?: {
11
- slots?: Slots;
12
- tooltipTarget?: Readonly<Ref<string | HTMLElement>>;
13
- };
14
- presentation?: TableDataGridPresentationContext;
15
- };
16
- };
17
- type __VLS_Props = {
18
- params: CellRendererParams;
19
- };
20
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
21
- refresh(nextParams: CellRendererParams): boolean;
22
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
- declare const _default: typeof __VLS_export;
24
- export default _default;
25
- //# sourceMappingURL=TableDataGridCellRenderer.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TableDataGridCellRenderer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TableDataGridCellRenderer.vue"],"names":[],"mappings":"AA2YA,OAAO,KAAK,EAEV,mBAAmB,EACpB,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,KAAK,EAAuB,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,CAAA;AAY1D,OAAO,EAKL,KAAK,gCAAgC,EACtC,MAAM,oCAAoC,CAAA;AAE3C,KAAK,kBAAkB,GAAG,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG;IACvE;iFAC6E;IAC7E,SAAS,CAAC,EAAE,mBAAmB,CAAA;IAC/B,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE;YAAE,KAAK,CAAC,EAAE,KAAK,CAAC;YAAC,aAAa,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC,CAAA;SAAE,CAAA;QAC9E,YAAY,CAAC,EAAE,gCAAgC,CAAA;KAChD,CAAA;CACF,CAAA;AAMD,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,kBAAkB,CAAA;CAC3B,CAAC;AA6SF,QAAA,MAAM,YAAY;wBA7JI,kBAAkB;oPAgKtC,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,11 +0,0 @@
1
- import type { TableDataGridStatePayload } from '../types';
2
- import type { Ref } from 'vue';
3
- import { fetchState } from './useFetchState';
4
- type UseEmitStateOptions = {
5
- emitState: (payload: TableDataGridStatePayload) => void;
6
- fetchLifecycleState: Readonly<Ref<fetchState>>;
7
- hasData: Readonly<Ref<boolean>>;
8
- };
9
- export declare const useEmitState: ({ emitState, fetchLifecycleState, hasData, }: UseEmitStateOptions) => void;
10
- export {};
11
- //# sourceMappingURL=useEmitState.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEmitState.d.ts","sourceRoot":"","sources":["../../../src/composables/useEmitState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AACzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,KAAK,mBAAmB,GAAG;IACzB,SAAS,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,IAAI,CAAA;IACvD,mBAAmB,EAAE,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAA;IAC9C,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,8CAI1B,mBAAmB,SAmCrB,CAAA"}
@@ -1,53 +0,0 @@
1
- import type { TableDataGridFetcher, TableDataGridRow, TableDataGridSort } from '../types';
2
- import type { IGetRowsParams } from 'ag-grid-community';
3
- import type { Ref } from 'vue';
4
- interface UseFetchInfiniteOptions<Row extends object = TableDataGridRow> {
5
- /**
6
- * Public row fetcher ref supplied by the host. The composable keeps AG Grid row
7
- * ranges internal and calls this with the cursor-first TableDataGrid contract.
8
- */
9
- fetcher: Readonly<Ref<TableDataGridFetcher<Row> | undefined>>;
10
- /**
11
- * Reactive invalidation input from the component layer. Any change rebuilds
12
- * the datasource and clears cursor/block state back to block 0.
13
- */
14
- resetKey?: Readonly<Ref<unknown>>;
15
- /**
16
- * Current resolved sort, forwarded to the fetcher.
17
- */
18
- sort?: Readonly<Ref<TableDataGridSort | undefined>>;
19
- }
20
- /**
21
- * Owns AG Grid infinite datasource creation and cursor-backed fetch
22
- * orchestration for TableDataGrid.
23
- *
24
- * Callers provide the public fetcher and an optional reset key, then observe
25
- * readonly fetch state and pass the returned datasource to AG Grid. Cursor maps,
26
- * block completion gates, pending counts, and stale request guards stay
27
- * private to this composable so component code cannot mutate fetch lifecycle
28
- * state directly.
29
- *
30
- * @param fetcher Host-supplied fetcher that uses TableDataGrid's cursor-first
31
- * infinite mode contract.
32
- * @param resetKey Optional reactive invalidation key that rebuilds the
33
- * datasource and restarts the cursor chain. Sort changes reset the chain
34
- * without replacing the datasource.
35
- * @returns Readonly datasource, first-block data, error, and fetching state
36
- * refs for the active AG Grid infinite datasource.
37
- */
38
- export declare const useFetchInfinite: <Row extends object = TableDataGridRow>({ fetcher, resetKey, sort, }: UseFetchInfiniteOptions<Row>) => {
39
- datasource: Readonly<Ref<{
40
- readonly rowCount?: number | undefined;
41
- readonly getRows: (params: IGetRowsParams) => void;
42
- readonly destroy?: (() => void) | undefined;
43
- } | undefined, {
44
- readonly rowCount?: number | undefined;
45
- readonly getRows: (params: IGetRowsParams) => void;
46
- readonly destroy?: (() => void) | undefined;
47
- } | undefined>>;
48
- data: Readonly<import("vue").ShallowRef<Row[] | undefined, Row[] | undefined>>;
49
- error: Readonly<Ref<Readonly<unknown>, Readonly<unknown>>>;
50
- isFetching: Readonly<Ref<boolean, boolean>>;
51
- };
52
- export {};
53
- //# sourceMappingURL=useFetchInfinite.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFetchInfinite.d.ts","sourceRoot":"","sources":["../../../src/composables/useFetchInfinite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EAEpB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAW9B,UAAU,uBAAuB,CAAC,GAAG,SAAS,MAAM,GAAG,gBAAgB;IACrE;;;OAGG;IACH,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,oBAAoB,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,CAAA;IAC7D;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC,CAAA;CACpD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,GAAI,GAAG,SAAS,MAAM,GAAG,gBAAgB,EAAE,8BAIrE,uBAAuB,CAAC,GAAG,CAAC;;;;;;;;;;;;;CAsY9B,CAAA"}
@@ -1,30 +0,0 @@
1
- import type { Ref } from 'vue';
2
- export declare enum fetchState {
3
- PENDING = "PENDING",
4
- LOADING = "LOADING",
5
- SUCCESS = "SUCCESS",
6
- ERROR = "ERROR"
7
- }
8
- type UseFetchStateResult = {
9
- fetchState: typeof fetchState;
10
- hasData: Readonly<Ref<boolean>>;
11
- state: Readonly<Ref<fetchState>>;
12
- };
13
- type FetchStateData<Row> = readonly Row[] | undefined;
14
- /**
15
- * Derives TableDataGrid fetch state from fetch lifecycle refs.
16
- *
17
- * `data`, `error`, and `isFetching` are owned by the fetch orchestration
18
- * composable. This helper only reads those refs and exposes a readonly derived
19
- * state without owning mutation or request lifecycle behavior.
20
- *
21
- * @param data Current rows from the active fetch chain, or `undefined` before
22
- * the first fetch result resolves.
23
- * @param error Current fetch error, if one exists.
24
- * @param isFetching Whether at least one fetch request is currently pending.
25
- * @param hasDataCallback Optional row detector for callers that need a custom
26
- * definition of meaningful data.
27
- */
28
- export default function useFetchState<Row>(data: Readonly<Ref<FetchStateData<Row>>>, error: Readonly<Ref<unknown>>, isFetching: Readonly<Ref<boolean>>, hasDataCallback?: (data: FetchStateData<Row>) => boolean): UseFetchStateResult;
29
- export {};
30
- //# sourceMappingURL=useFetchState.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFetchState.d.ts","sourceRoot":"","sources":["../../../src/composables/useFetchState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAG9B,oBAAY,UAAU;IACpB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB;AAED,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,OAAO,UAAU,CAAA;IAC7B,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;IAC/B,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAA;CACjC,CAAA;AAED,KAAK,cAAc,CAAC,GAAG,IAAI,SAAS,GAAG,EAAE,GAAG,SAAS,CAAA;AAMrD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,GAAG,EACvC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EACxC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAC7B,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAClC,eAAe,GAAE,CAAC,IAAI,EAAE,cAAc,CAAC,GAAG,CAAC,KAAK,OAAwB,GACvE,mBAAmB,CAgCrB"}
@@ -1,9 +0,0 @@
1
- import { createI18n, i18nTComponent } from '@kong-ui-public/i18n';
2
- import english from '../locales/en.json';
3
- interface UseI18nReturn {
4
- i18n: ReturnType<typeof createI18n<typeof english>>;
5
- i18nT: ReturnType<typeof i18nTComponent<typeof english>>;
6
- }
7
- export default function useI18n(): UseI18nReturn;
8
- export {};
9
- //# sourceMappingURL=useI18n.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../../src/composables/useI18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,OAAO,MAAM,oBAAoB,CAAA;AAExC,UAAU,aAAa;IACrB,IAAI,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC,CAAA;IACnD,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC,CAAA;CACzD;AAED,MAAM,CAAC,OAAO,UAAU,OAAO,IAAI,aAAa,CAO/C"}
@@ -1,31 +0,0 @@
1
- import type { TableDataGridHeader, TableDataGridRow, TableDataGridSort } from '../types';
2
- import type { ColDef } from 'ag-grid-community';
3
- import type { Ref, Slots } from 'vue';
4
- import { type TableDataGridColumnStats, type TableDataGridLabelSizer } from '../utils/tableDataGridPresentation';
5
- /**
6
- * Converts `headers` into what AG Grid needs to render the table's columns:
7
- * the column definitions themselves, and the shared grid `context`.
8
- */
9
- export declare const useTableDataGridColumnDefs: <Row extends object = TableDataGridRow>({ headers, slots, initialSort, mode, rows, tooltipTarget, }: {
10
- headers: Readonly<Ref<Array<TableDataGridHeader<Row>>>>;
11
- slots: Slots;
12
- initialSort?: TableDataGridSort;
13
- mode?: "infinite" | "unpaginated";
14
- rows?: Readonly<Ref<readonly Row[] | undefined>>;
15
- tooltipTarget?: Readonly<Ref<string | HTMLElement>>;
16
- }) => {
17
- columnDefs: import("vue").ComputedRef<ColDef<Row, any>[]>;
18
- gridContext: import("vue").ComputedRef<{
19
- cells: {
20
- slots: Readonly<{
21
- [name: string]: import("vue").Slot<any> | undefined;
22
- }>;
23
- tooltipTarget: Readonly<Ref<string | HTMLElement, string | HTMLElement>> | undefined;
24
- };
25
- presentation: {
26
- stats: Record<string, TableDataGridColumnStats>;
27
- labelSizers: Record<string, TableDataGridLabelSizer>;
28
- };
29
- }>;
30
- };
31
- //# sourceMappingURL=useTableDataGridColumnDefs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useTableDataGridColumnDefs.d.ts","sourceRoot":"","sources":["../../../src/composables/useTableDataGridColumnDefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACxF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,CAAA;AAGrC,OAAO,EAKL,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC7B,MAAM,oCAAoC,CAAA;AAE3C;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GAAI,GAAG,SAAS,MAAM,GAAG,gBAAgB,EAAE,6DAO/E;IACD,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,KAAK,EAAE,KAAK,CAAA;IACZ,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B,IAAI,CAAC,EAAE,UAAU,GAAG,aAAa,CAAA;IACjC,IAAI,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,SAAS,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC,CAAA;IAChD,aAAa,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC,CAAA;CACpD;;;;;;;;;;;;;;CAkHA,CAAA"}
@@ -1,38 +0,0 @@
1
- import type { TableDataGridConfig, TableDataGridHeader, TableDataGridRow, TableDataGridSort } from '../types';
2
- import type { Ref } from 'vue';
3
- /**
4
- * Owns `TableDataGrid`'s current `tableConfig` state, controlled or
5
- * uncontrolled, with `patchTableConfig` as the single write path for
6
- * grid-driven changes.
7
- *
8
- * @param headers Current column headers, used to validate the resolved sort key.
9
- * @param pageSize Reactive component-level page size default.
10
- * @param tableConfig Host-supplied `tableConfig` prop, or `undefined` when uncontrolled.
11
- * @param emitSort Called before a grid/header-driven change updates the current sort.
12
- * @param emitTableConfigUpdate Called with the resolved config whenever `patchTableConfig` changes it.
13
- * @param onExternalConfigChange Called when the host-supplied prop changes the resolved config.
14
- */
15
- export declare const useTableDataGridConfig: <Row extends object = TableDataGridRow>({ headers, pageSize, tableConfig: tableConfigProp, emitSort, emitTableConfigUpdate, onExternalConfigChange, }: {
16
- headers: Readonly<Ref<Array<TableDataGridHeader<Row>>>>;
17
- pageSize: Readonly<Ref<number>>;
18
- tableConfig: Readonly<Ref<TableDataGridConfig | undefined>>;
19
- emitSort: (sort: TableDataGridSort) => void;
20
- emitTableConfigUpdate: (config: TableDataGridConfig) => void;
21
- onExternalConfigChange?: (config: TableDataGridConfig) => void;
22
- }) => {
23
- activeTableConfig: Readonly<Ref<{
24
- readonly sortColumnKey?: string | undefined;
25
- readonly sortColumnOrder?: import("..").TableDataGridSortDirection | undefined;
26
- readonly pageSize?: number | undefined;
27
- readonly fitToContent?: boolean | undefined;
28
- }, {
29
- readonly sortColumnKey?: string | undefined;
30
- readonly sortColumnOrder?: import("..").TableDataGridSortDirection | undefined;
31
- readonly pageSize?: number | undefined;
32
- readonly fitToContent?: boolean | undefined;
33
- }>>;
34
- activeSort: import("vue").ComputedRef<TableDataGridSort>;
35
- activePageSize: import("vue").ComputedRef<number>;
36
- patchTableConfig: (patch: Partial<TableDataGridConfig>) => void;
37
- };
38
- //# sourceMappingURL=useTableDataGridConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useTableDataGridConfig.d.ts","sourceRoot":"","sources":["../../../src/composables/useTableDataGridConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC7G,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAI9B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,GAAI,GAAG,SAAS,MAAM,GAAG,gBAAgB,EAAE,+GAO3E;IACD,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;IAC/B,WAAW,EAAE,QAAQ,CAAC,GAAG,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAAC,CAAA;IAC3D,QAAQ,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAA;IAC3C,qBAAqB,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAA;IAC5D,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAA;CAC/D;;;;;;;;;;;;;;8BAsBkC,OAAO,CAAC,mBAAmB,CAAC;CA4C9D,CAAA"}
@@ -1,17 +0,0 @@
1
- import type { TableDataGridCellClickPayload, TableDataGridHeader, TableDataGridRow, TableDataGridRowClickPayload } from '../types';
2
- import type { CellClickedEvent, RowClickedEvent } from 'ag-grid-community';
3
- import type { Ref } from 'vue';
4
- /**
5
- * Converts AG Grid's row and cell click events into `TableDataGrid`'s own
6
- * row/cell interaction handlers, and governs how those interactions behave
7
- * (e.g. suppressing row clicks for columns marked `disableRowClick`).
8
- */
9
- export declare const useTableDataGridInteractions: <Row extends object = TableDataGridRow>({ cellClick, headers, rowClick, }: {
10
- cellClick: (payload: TableDataGridCellClickPayload<Row>) => void;
11
- headers: Readonly<Ref<Array<TableDataGridHeader<Row>>>>;
12
- rowClick: (row: TableDataGridRowClickPayload<Row>, event: RowClickedEvent<Row>) => void;
13
- }) => {
14
- onCellClick: (event: CellClickedEvent<Row>) => void;
15
- onRowClick: (event: RowClickedEvent<Row>) => void;
16
- };
17
- //# sourceMappingURL=useTableDataGridInteractions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useTableDataGridInteractions.d.ts","sourceRoot":"","sources":["../../../src/composables/useTableDataGridInteractions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAC7B,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAG9B;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,GAAI,GAAG,SAAS,MAAM,GAAG,gBAAgB,EAAE,mCAIjF;IACD,SAAS,EAAE,CAAC,OAAO,EAAE,6BAA6B,CAAC,GAAG,CAAC,KAAK,IAAI,CAAA;IAChE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,QAAQ,EAAE,CAAC,GAAG,EAAE,4BAA4B,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,GAAG,CAAC,KAAK,IAAI,CAAA;CACxF;yBA0B6B,gBAAgB,CAAC,GAAG,CAAC;wBANtB,eAAe,CAAC,GAAG,CAAC;CAwBhD,CAAA"}
@@ -1,18 +0,0 @@
1
- import type { TableDataGridRow, TableDataGridSort } from '../types';
2
- import type { GridApi, SortChangedEvent } from 'ag-grid-community';
3
- import type { Ref } from 'vue';
4
- /**
5
- * Translates AG Grid's `sortChanged` event into `TableDataGrid`'s `sort`
6
- * shape, and pushes a sort back onto the grid.
7
- *
8
- * @param activeSort Current resolved sort, read from `useTableDataGridConfig`.
9
- * @param patchTableConfig Writes the new sort into the current `tableConfig`.
10
- */
11
- export declare const useTableDataGridSort: <Row extends object = TableDataGridRow>({ activeSort, patchTableConfig, }: {
12
- activeSort: Readonly<Ref<TableDataGridSort>>;
13
- patchTableConfig: (patch: Partial<TableDataGridSort>) => void;
14
- }) => {
15
- onSortChanged: (event: SortChangedEvent<Row>) => void;
16
- applySortToGrid: (api: GridApi<Row>, sort: TableDataGridSort) => void;
17
- };
18
- //# sourceMappingURL=useTableDataGridSort.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useTableDataGridSort.d.ts","sourceRoot":"","sources":["../../../src/composables/useTableDataGridSort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAA8B,MAAM,UAAU,CAAA;AAC/F,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAI,GAAG,SAAS,MAAM,GAAG,gBAAgB,EAAE,mCAGzE;IACD,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAC5C,gBAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;CAC9D;2BAU+B,gBAAgB,CAAC,GAAG,CAAC;2BATrB,OAAO,CAAC,GAAG,CAAC,QAAQ,iBAAiB;CAkCpE,CAAA"}
@@ -1,4 +0,0 @@
1
- import TableDataGrid from './components/TableDataGrid.vue';
2
- export { TableDataGrid };
3
- export * from './types';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,gCAAgC,CAAA;AAE1D,OAAO,EAAE,aAAa,EAAE,CAAA;AAExB,cAAc,SAAS,CAAA"}
@@ -1,105 +0,0 @@
1
- import type { GridApi } from 'ag-grid-community';
2
- export type TableDataGridMode = 'infinite' | 'unpaginated';
3
- export type TableDataGridRow = Record<string, unknown>;
4
- export type TableDataGridState = 'loading' | 'success' | 'error';
5
- export type TableDataGridStatePayload = {
6
- state: TableDataGridState;
7
- hasData: boolean;
8
- };
9
- export type TableDataGridRowClickPayload<Row extends object = TableDataGridRow> = Row;
10
- export type TableDataGridCellClickPayload<Row extends object = TableDataGridRow> = {
11
- row: Row;
12
- columnKey: string;
13
- value: unknown;
14
- };
15
- export type TableDataGridCellSlotProps<Row extends object = TableDataGridRow> = {
16
- row: Row;
17
- rowValue: unknown;
18
- column: TableDataGridHeader<Row>;
19
- rowIndex: number;
20
- selected: boolean;
21
- /** Forces AG Grid to re-render this cell. */
22
- refreshCell: () => void;
23
- };
24
- export type TableDataGridThreshold = {
25
- value: number;
26
- type: 'warning' | 'error';
27
- };
28
- export type TableDataGridHeader<Row extends object = TableDataGridRow> = {
29
- key: Extract<keyof Row, string>;
30
- label: string;
31
- width?: number;
32
- minWidth?: number;
33
- maxWidth?: number;
34
- /**
35
- * Disables the `row:click` emit for clicks landing inside this column's
36
- * cells, e.g. an actions column with its own buttons. AG Grid's own
37
- * selection/click mechanics are unaffected.
38
- */
39
- disableRowClick?: boolean;
40
- /** Enables sorting on this column via AG Grid's built-in header sort control. */
41
- sortable?: boolean;
42
- /**
43
- * Shows the unsorted sort icon on this column's header even when it isn't
44
- * the active sort, instead of only on hover or once sorted. Only relevant
45
- * when `sortable` is true.
46
- */
47
- showSortIcon?: boolean;
48
- /** Formats the raw cell value for display. */
49
- valueFormatter?: (value: unknown, row: Row) => string;
50
- /** Shows the row's share of the full returned column total. */
51
- showPercentage?: boolean;
52
- /** Formats percentage points, e.g. 50 for a 50% share (not the 0–1 ratio). */
53
- percentageFormatter?: (percentage: number) => string;
54
- /** Renders a bar using the column total or maximum as its denominator. */
55
- bar?: 'relative' | 'absolute';
56
- /**
57
- * Colors the bar when rendered, or the value text otherwise.
58
- * Compares the raw numeric value with each threshold independently of `bar`
59
- * and works in both infinite and unpaginated modes.
60
- */
61
- thresholds?: TableDataGridThreshold[];
62
- };
63
- export type TableDataGridSortDirection = 'asc' | 'desc';
64
- export type TableDataGridSort = {
65
- sortColumnKey?: string;
66
- sortColumnOrder?: TableDataGridSortDirection;
67
- };
68
- export type TableDataGridConfig = TableDataGridSort & {
69
- pageSize?: number;
70
- /** Size to all returned rows in unpaginated mode. Ignored in infinite mode. */
71
- fitToContent?: boolean;
72
- };
73
- export type TableDataGridProps<Row extends object = TableDataGridRow> = {
74
- headers: Array<TableDataGridHeader<Row>>;
75
- error?: boolean;
76
- tableConfig?: TableDataGridConfig;
77
- } & ({
78
- fetcher: TableDataGridFetcher<Row>;
79
- mode?: 'infinite';
80
- pageSize?: number;
81
- refreshKey?: string | number | boolean;
82
- rows?: never;
83
- } | {
84
- /** Complete host-owned result rendered through AG Grid's client-side row model. */
85
- rows: Row[];
86
- mode: 'unpaginated';
87
- fetcher?: never;
88
- pageSize?: never;
89
- refreshKey?: never;
90
- });
91
- export interface TableDataGridInfiniteFetcherParams {
92
- mode: 'infinite';
93
- pageSize: number;
94
- cursor?: unknown;
95
- sort?: TableDataGridSort;
96
- }
97
- export type TableDataGridFetcherResult<Row extends object = TableDataGridRow> = {
98
- data: Row[];
99
- cursor?: unknown;
100
- total?: number;
101
- hasMore?: boolean;
102
- };
103
- export type TableDataGridFetcher<Row extends object = TableDataGridRow> = (params: TableDataGridInfiniteFetcherParams) => Promise<TableDataGridFetcherResult<Row>>;
104
- export type TableDataGridReadyPayload<Row extends object = TableDataGridRow> = GridApi<Row>;
105
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"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"}
@@ -1,42 +0,0 @@
1
- interface GridRowRange {
2
- startRow: number;
3
- endRow: number;
4
- }
5
- interface CursorBlock {
6
- blockIndex: number;
7
- pageSize: number;
8
- }
9
- /**
10
- * Resolves AG Grid's zero-based, half-open row range into a cursor block.
11
- *
12
- * AG Grid passes `startRow` as inclusive and `endRow` as exclusive. It does not
13
- * pass a block index directly, so derive it from the range before calling
14
- * TableDataGrid's cursor-based fetcher.
15
- *
16
- * @param startRow AG Grid's inclusive row start for the requested block.
17
- * @param endRow AG Grid's exclusive row end for the requested block.
18
- * @returns Cursor block index and page size derived from AG Grid's row range.
19
- */
20
- export declare const getCursorBlock: ({ startRow, endRow }: GridRowRange) => CursorBlock;
21
- /**
22
- * Translates TableDataGrid fetch metadata into AG Grid's `lastRow` signal.
23
- *
24
- * An undefined value tells AG Grid to keep requesting more blocks. A number
25
- * tells AG Grid the absolute row index where the dataset ends.
26
- *
27
- * @param startRow AG Grid's inclusive row start for the fetched block.
28
- * @param rowsLength Number of rows returned by the TableDataGrid fetcher.
29
- * @param pageSize Requested block size derived from AG Grid's row range.
30
- * @param total Optional known total row count from the backend.
31
- * @param hasMore Optional backend signal for whether another block exists.
32
- * @returns AG Grid `lastRow` value, or undefined when more blocks may exist.
33
- */
34
- export declare const resolveInfiniteLastRow: ({ startRow, rowsLength, pageSize, total, hasMore, }: {
35
- startRow: number;
36
- rowsLength: number;
37
- pageSize: number;
38
- total?: number;
39
- hasMore?: boolean;
40
- }) => number | undefined;
41
- export {};
42
- //# sourceMappingURL=fetchers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetchers.d.ts","sourceRoot":"","sources":["../../../src/utils/fetchers.ts"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,UAAU,WAAW;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAI,sBAAsB,YAAY,KAAG,WAOnE,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,GAAI,qDAMpC;IACD,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,KAAG,MAAM,GAAG,SAcZ,CAAA"}
@@ -1,25 +0,0 @@
1
- import type { TableDataGridConfig, TableDataGridHeader, TableDataGridRow } from '../types';
2
- /**
3
- * Resolves a host-supplied (or absent) `tableConfig` into a config the
4
- * component can trust: drops a `sortColumnKey` that no longer matches a
5
- * `sortable` header, and falls back `pageSize` to the component default.
6
- *
7
- * @param config Host-supplied table config, or `undefined` when uncontrolled.
8
- * @param headers Current column headers, used to validate the sort key.
9
- * @param pageSize Component-level page size default.
10
- * @returns A fully-resolved `TableDataGridConfig`.
11
- */
12
- export declare const resolveTableConfig: <Row extends object = TableDataGridRow>({ config, headers, pageSize, }: {
13
- config: TableDataGridConfig | undefined;
14
- headers: Array<TableDataGridHeader<Row>>;
15
- pageSize: number;
16
- }) => TableDataGridConfig;
17
- /**
18
- * Structural equality for two resolved `TableDataGridConfig` values.
19
- *
20
- * @param a First config to compare.
21
- * @param b Second config to compare.
22
- * @returns Whether every field matches, including `undefined` values.
23
- */
24
- export declare const tableConfigsEqual: (a: TableDataGridConfig, b: TableDataGridConfig) => boolean;
25
- //# sourceMappingURL=tableConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tableConfig.d.ts","sourceRoot":"","sources":["../../../src/utils/tableConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAE1F;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,GAAI,GAAG,SAAS,MAAM,GAAG,gBAAgB,EAAE,gCAIvE;IACD,MAAM,EAAE,mBAAmB,GAAG,SAAS,CAAA;IACvC,OAAO,EAAE,KAAK,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAA;IACxC,QAAQ,EAAE,MAAM,CAAA;CACjB,KAAG,mBAYH,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,GAAG,mBAAmB,EAAE,GAAG,mBAAmB,KAAG,OAKlF,CAAA"}