@opengis/table 0.0.21 → 0.0.23
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/components/CodeTabs.vue.d.ts +14 -0
- package/dist/components/CodeTabs.vue.d.ts.map +1 -0
- package/dist/components/Column.vue.d.ts +16 -0
- package/dist/components/Column.vue.d.ts.map +1 -0
- package/dist/components/DataTable.vue.d.ts +73 -0
- package/dist/components/DataTable.vue.d.ts.map +1 -0
- package/dist/components/Pagination.vue.d.ts +18 -0
- package/dist/components/Pagination.vue.d.ts.map +1 -0
- package/dist/components/SelectionInfo.vue.d.ts +7 -0
- package/dist/components/SelectionInfo.vue.d.ts.map +1 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/formats/ArrayFormat.vue.d.ts +4 -0
- package/dist/formats/ArrayFormat.vue.d.ts.map +1 -0
- package/dist/formats/BadgeFormat.vue.d.ts +4 -0
- package/dist/formats/BadgeFormat.vue.d.ts.map +1 -0
- package/dist/formats/DateFormat.vue.d.ts +4 -0
- package/dist/formats/DateFormat.vue.d.ts.map +1 -0
- package/dist/formats/LinkFormat.vue.d.ts +13 -0
- package/dist/formats/LinkFormat.vue.d.ts.map +1 -0
- package/dist/formats/NumberFormat.vue.d.ts +4 -0
- package/dist/formats/NumberFormat.vue.d.ts.map +1 -0
- package/dist/formats/SelectFormat.vue.d.ts +4 -0
- package/dist/formats/SelectFormat.vue.d.ts.map +1 -0
- package/dist/formats/TextFormat.vue.d.ts +4 -0
- package/dist/formats/TextFormat.vue.d.ts.map +1 -0
- package/dist/formats/index.d.ts +16 -0
- package/dist/formats/index.d.ts.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +348 -377
- package/dist/index.umd.js +1 -1
- package/dist/types/index.d.ts +143 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +57 -59
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f.filter={},f.Vue))})(this,(function(f,e){"use strict";const O=e.defineComponent({name:"NumberFormat",__name:"NumberFormat",props:{value:{},row:{},column:{}},setup(u){const o=u,t=e.computed(()=>o.value===null||o.value===void 0?"":typeof o.value=="number"?o.value.toFixed(2):Intl.NumberFormat("uk-UA",{maximumFractionDigits:2}).format(Number(o.value)));return(c,n)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(t.value||"-"),1))}}),q=e.defineComponent({name:"DateFormat",__name:"DateFormat",props:{value:{},row:{},column:{}},setup(u){const o=u,t=e.computed(()=>{if(!o.value)return"";try{return new Date(o.value).toLocaleDateString()}catch{return o.value}});return(c,n)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(t.value||"-"),1))}}),J=e.defineComponent({name:"TextFormat",__name:"TextFormat",props:{value:{},row:{},column:{}},setup(u){const o=u,{value:t}=o,c=e.computed(()=>Array.isArray(t)?t.map(n=>n.text||n).join(","):t?.text||t);return(n,s)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(c.value||"-"),1))}}),G=((u,o)=>{const t=u.__vccOpts||u;for(const[c,n]of o)t[c]=n;return t})(e.defineComponent({name:"BadgeFormat",__name:"BadgeFormat",props:{value:{},row:{},column:{}},setup(u){const o=u,t=e.computed(()=>{const s=String(o.value||"").toLowerCase(),i="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium";return s.includes("success")||s.includes("active")||s.includes("completed")?`${i} bg-green-100 text-green-800`:s.includes("error")||s.includes("failed")||s.includes("inactive")?`${i} bg-red-100 text-red-800`:s.includes("warning")||s.includes("pending")?`${i} bg-yellow-100 text-yellow-800`:s.includes("info")||s.includes("processing")?`${i} bg-blue-100 text-blue-800`:o.value?.color&&!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(o.value.color)?`${i} bg-${o.value.color}-100 text-${o.value.color}-800`:`${i} bg-gray-100 text-gray-800`});function c(s,i=1){const h=parseInt(s.slice(1,3),16),x=parseInt(s.slice(3,5),16),C=parseInt(s.slice(5,7),16);return`rgba(${h}, ${x}, ${C}, ${i})`}const n=e.computed(()=>{const s={minWidth:"60px",textAlign:"center",display:"inline-block"};return/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(o.value?.color)?{...s,backgroundColor:c(o.value.color,.1),color:c(o.value.color,.8)}:s});return(s,i)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["badge",t.value]),style:e.normalizeStyle(n.value)},e.toDisplayString(s.value?.text||s.value||"-"),7))}}),[["__scopeId","data-v-f4b15092"]]),ce={class:"flex flex-wrap gap-1"},K=e.defineComponent({name:"ArrayFormat",__name:"ArrayFormat",props:{value:{},row:{},column:{}},setup(u){const o=u,t=e.computed(()=>o.value?Array.isArray(o.value)?o.value:[o.value]:[]),c=n=>n?typeof n=="object"&&n.name?n.name:typeof n=="string"||typeof n=="number"?String(n):JSON.stringify(n):"";return(n,s)=>(e.openBlock(),e.createElementBlock("div",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(i,h)=>(e.openBlock(),e.createElementBlock("span",{key:h,class:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800 hover:bg-blue-200 transition-colors"},e.toDisplayString(c(i)),1))),128))]))}}),de=["href","target"],Q=e.defineComponent({__name:"LinkFormat",props:{href:{default:""},target:{default:"_self"},onClick:{type:Function,default:void 0},value:{},row:{},column:{}},setup(u){const o=u,t=e.computed(()=>typeof o.value=="string"||typeof o.value=="number"?o.value:o.value?.text||o.value?.label||"Link"),c=e.computed(()=>o.href?o.href:typeof o.value=="object"&&o.value?.href?o.value.href:""),n=e.computed(()=>o.target?o.target:typeof o.value=="object"&&o.value?.target?o.value.target:"_self"),s=e.computed(()=>"text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300 underline cursor-pointer"),i=h=>{o.onClick&&o.row&&(h.preventDefault(),o.onClick(o.row,o.value))};return(h,x)=>c.value?(e.openBlock(),e.createElementBlock("a",{key:0,href:c.value,target:n.value,class:e.normalizeClass(s.value),onClick:i},e.toDisplayString(t.value),11,de)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(s.value),onClick:i},e.toDisplayString(t.value),3))}}),X=e.defineComponent({name:"TextFormat",__name:"SelectFormat",props:{value:{},row:{},column:{}},setup(u){const o=u,{value:t}=o,c=e.computed(()=>Array.isArray(t)?t.map(n=>n.text||n).filter((n,s)=>s<2).join(", ")+(t.length>2?` +${t.length-2}`:""):t?.text||t);return(n,s)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(c.value||"-"),1))}}),A={number:O,date:q,text:J,badge:G,array:K,select:X,link:Q},me={class:"flex items-center space-x-4"},pe={class:"font-medium"},ue={class:"font-medium"},ge={class:"font-medium"},fe={class:"flex items-center space-x-2"},ye=["disabled"],be={class:"flex items-center space-x-1"},he=["onClick"],ke=["disabled"],I=e.defineComponent({name:"Pagination",__name:"Pagination",props:{page:{},limit:{},total:{},theme:{default:"light"},size:{default:"medium"}},emits:["update:page"],setup(u,{emit:o}){const t=u,c=e.computed(()=>({small:{text:"text-xs",button:"px-2 h-7 text-xs min-w-[28px] flex items-center justify-center",icon:"w-3.5 h-3.5"},medium:{text:"text-sm",button:"px-3 h-9 text-sm min-w-[36px] flex items-center justify-center",icon:"w-4 h-4"},large:{text:"text-base",button:"px-4 h-11 text-base min-w-[44px] flex items-center justify-center",icon:"w-5 h-5"}})[t.size]),n=e.computed(()=>{const{theme:p}=t;return p==="dark"?{container:"bg-gray-900 border-gray-700",text:"text-gray-300",button:"text-gray-300 bg-gray-800 border-gray-600 hover:bg-gray-700",buttonDisabled:"text-gray-500 bg-gray-800",buttonActive:"bg-blue-600 text-white",ellipsis:"text-gray-400"}:p==="light"?{container:"bg-white border-gray-200",text:"text-gray-700",button:"text-gray-700 bg-white border-gray-300 hover:bg-gray-50",buttonDisabled:"text-gray-400 bg-gray-100",buttonActive:"bg-blue-600 text-white",ellipsis:"text-gray-500"}:{container:"bg-white dark:bg-gray-900 border-gray-200 dark:border-gray-700",text:"text-gray-700 dark:text-gray-300",button:"text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700",buttonDisabled:"text-gray-400 dark:text-gray-500 bg-gray-100 dark:bg-gray-800",buttonActive:"bg-blue-600 text-white",ellipsis:"text-gray-500 dark:text-gray-400"}}),s=o,i=e.computed(()=>Math.ceil(t.total/t.limit)),h=e.computed(()=>t.total===0?0:(t.page-1)*t.limit+1),x=e.computed(()=>Math.min(t.page*t.limit,t.total)),C=e.computed(()=>{const p=[];if(i.value<=7)for(let b=1;b<=i.value;b+=1)p.push(b);else{p.push(1),t.page>4&&p.push("...");const b=Math.max(2,t.page-1),_=Math.min(i.value-1,t.page+1);for(let w=b;w<=_;w+=1)w!==1&&w!==i.value&&p.push(w);t.page<i.value-3&&p.push("..."),i.value>1&&p.push(i.value)}return p}),B=p=>{p>=1&&p<=i.value&&p!==t.page&&s("update:page",p)};return(p,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex items-center justify-between py-3 border-t",n.value.container])},[e.createElementVNode("div",me,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center text-sm",n.value.text,c.value.text])},[e.createElementVNode("span",null,[g[2]||(g[2]=e.createTextVNode(" Показано ",-1)),e.createElementVNode("span",pe,e.toDisplayString(h.value),1),g[3]||(g[3]=e.createTextVNode(" до ",-1)),e.createElementVNode("span",ue,e.toDisplayString(x.value),1),g[4]||(g[4]=e.createTextVNode(" з ",-1)),e.createElementVNode("span",ge,e.toDisplayString(p.total),1),g[5]||(g[5]=e.createTextVNode(" результатів ",-1))])],2)]),e.createElementVNode("div",fe,[e.createElementVNode("button",{onClick:g[0]||(g[0]=b=>B(p.page-1)),disabled:p.page<=1,class:e.normalizeClass(["relative font-medium rounded-md",c.value.button,p.page<=1?n.value.buttonDisabled:n.value.button])},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(c.value.icon),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...g[6]||(g[6]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)])],2))],10,ye),e.createElementVNode("div",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,b=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:b},[b==="..."?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["font-medium",c.value.button,n.value.ellipsis])}," ... ",2)):(e.openBlock(),e.createElementBlock("button",{key:1,onClick:_=>B(b),class:e.normalizeClass(["relative font-medium rounded-md",c.value.button,b===p.page?n.value.buttonActive:n.value.button])},e.toDisplayString(b),11,he))],64))),128))]),e.createElementVNode("button",{onClick:g[1]||(g[1]=b=>B(p.page+1)),disabled:p.page>=i.value,class:e.normalizeClass(["relative font-medium rounded-md",c.value.button,p.page>=i.value?n.value.buttonDisabled:n.value.button])},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(c.value.icon),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...g[7]||(g[7]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2))],10,ke)])],2))}}),xe={key:0,class:"text-center py-8"},Ce={class:"inline-flex items-center space-x-2"},_e={key:2,class:"overflow-x-auto"},Be=["checked","indeterminate"],we=["onClick"],Ee={class:"flex items-center justify-between"},$e={key:0,class:"ml-1 text-xs"},Se=["onClick"],Ne=["checked","onChange"],Ve=["onClick"],De={key:1,class:"text-center"},N=e.defineComponent({name:"DataTable",__name:"DataTable",props:{rows:{default:()=>[]},columns:{default:()=>[]},api:{},router:{},tableStyle:{default:""},size:{default:"medium"},theme:{default:"light"},loading:{type:Boolean,default:!1},classWrapper:{default:""},classTable:{default:"min-w-full divide-y divide-gray-200 dark:divide-gray-700"},classTbody:{default:""},classTr:{default:""},classTd:{default:""},classTh:{default:""},classThead:{default:""},classLink:{default:""},selectable:{type:Boolean,default:!1},selectedRows:{default:()=>[]},limit:{default:10},page:{default:1},total:{default:0},showPagination:{type:Boolean,default:!0},sortable:{type:Boolean,default:!1},clickable:{type:Boolean,default:!1},getCellData:{type:Function,default:void 0}},emits:["update:page","update:selectedRows","row-click","sort"],setup(u,{emit:o}){const t=u,c=o,n=e.ref(t.selectedRows||[]),s=e.ref([]),i=e.ref([]),h=e.ref([]),x=e.ref(!1),C=e.ref(null),B=e.ref(t.router),p=e.useSlots(),g=e.computed(()=>p.action);function b(a){if(B.value){B.value.push(a);return}location.href=a}const _=e.computed(()=>{if(t.api)return i.value;if(t.sortable&&s.value.length>0){const a=[...t.rows];return a.sort((d,l)=>{for(const m of s.value){if(!m.direction)return 0;const r=d[m.field],y=l[m.field];if(r==null)return 1;if(y==null)return-1;let E=0;typeof r=="string"&&typeof y=="string"?E=r.localeCompare(y):r<y?E=-1:r>y?E=1:E=0;const F=m.direction==="desc"?-E:E;if(F!==0)return F}return 0}),a}return t.rows});e.watch(()=>t.selectedRows,a=>{n.value=a||[]});const w=a=>n.value.some(d=>d===a),te=a=>{const d=n.value.findIndex(l=>l===a);d>-1?n.value.splice(d,1):n.value.push(a),c("update:selectedRows",[...n.value])},L=e.computed(()=>_.value.length>0&&n.value.length===_.value.length),V=e.computed(()=>n.value.length>0&&n.value.length<_.value.length),j=()=>{L.value?n.value=[]:n.value=[..._.value],c("update:selectedRows",[...n.value])},Ue=a=>{if(!t.sortable)return;const d=s.value.findIndex(m=>m.field===a);if(d>=0){const m=s.value[d];m.direction==="asc"?m.direction="desc":m.direction==="desc"&&s.value.splice(d,1)}else s.value.unshift({field:a,direction:"asc"});const l=s.value.filter(m=>m.direction).map(m=>({name:m.field,asc:m.direction==="asc"}));c("sort",l),t.api&&z()},Oe=a=>s.value.find(l=>l.field===a)?.direction==="asc",qe=a=>{const d=s.value.find(l=>l.field===a);if(!d)return"↑↓";switch(d.direction){case"asc":return"↑";case"desc":return"↓";default:return"↕️"}},R=a=>t.sortable&&a.sortable!==!1,Je=a=>{t.clickable&&c("row-click",a)},$=(a,d)=>{const l=d[a.name];if(t.getCellData||a.getCellData){const m=a.getCellData||t.getCellData;if(m){const r={name:a.name,row:d,value:l};return m(r)}}return["_data","_text"].map(m=>{const r=`${a.name}${m}`;return d[r]?d[r]:null}).find(m=>m)||l},ae=a=>a.width?a.width==="w-full"?"w-full":typeof a.width=="string"?`w-[${a.width}px]`:typeof a.width=="number"?`w-[${a.width}px]`:"":"",P=e.ref(t.page),oe=e.ref(t.limit),M=e.ref(t.total),D=e.ref(1),H=e.ref(10),T=e.ref(0),le=e.computed(()=>t.api?D.value:P.value),ne=e.computed(()=>t.api?H.value:oe.value),re=e.computed(()=>t.api?T.value:M.value),k=e.computed(()=>{const{theme:a}=t;return a==="dark"?{container:"dark",loading:"text-gray-400",error:"text-red-400",thead:"bg-gray-800",th:"text-gray-300",thHover:"hover:bg-gray-700",tbody:"bg-gray-900 divide-gray-700",tr:"hover:bg-gray-800",td:"text-gray-300",empty:"text-gray-400",checkbox:"border-gray-600 bg-gray-700 text-blue-400"}:a==="light"?{container:"",loading:"text-gray-500",error:"text-red-500",thead:"bg-gray-50",th:"text-gray-500",thHover:"hover:bg-gray-100",tbody:"bg-white divide-gray-200",tr:"hover:bg-gray-50",td:"text-gray-900",empty:"text-gray-500",checkbox:"border-gray-300 bg-white text-blue-600"}:{container:"",loading:"text-gray-500 dark:text-gray-400",error:"text-red-500 dark:text-red-400",thead:"bg-gray-50 dark:bg-gray-800",th:"text-gray-500 dark:text-gray-300",thHover:"hover:bg-gray-100 dark:hover:bg-gray-700",tbody:"bg-white dark:bg-gray-900 divide-gray-200 dark:divide-gray-700",tr:"hover:bg-gray-50 dark:hover:bg-gray-800",td:"text-gray-900 dark:text-gray-300",empty:"text-gray-500 dark:text-gray-400",checkbox:"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-blue-600 dark:text-blue-400"}});e.watch(()=>t.page,a=>{P.value=a}),e.watch(()=>t.limit,a=>{oe.value=a}),e.watch(()=>t.total,a=>{M.value=a});async function z(){if(t.api){x.value=!0,C.value=null;try{const a=new URL(t.api,window.location.origin);if(a.searchParams.set("page",le.value.toString()),a.searchParams.set("limit",ne.value.toString()),s.value.length>0){const m=s.value.filter(r=>r.direction).map(r=>`${r.field}:${r.direction}`).join(",");m&&a.searchParams.set("sort",m)}const d=await fetch(a.toString());if(!d.ok)throw new Error(`HTTP error! status: ${d.status}`);const l=await d.json();l.rows&&Array.isArray(l.rows)&&(i.value=l.rows),l.columns&&Array.isArray(l.columns)&&(h.value=l.columns),l.total!==void 0&&(t.api?T.value=l.total:M.value=l.total)}catch(a){C.value=a instanceof Error?a.message:"Failed to fetch data",console.error("Error fetching data:",a)}finally{x.value=!1}}}const Ge=a=>{t.api?D.value=a:(P.value=a,c("update:page",a)),t.api&&z()},Ke=e.computed(()=>t.showPagination&&re.value>0),S=e.computed(()=>({small:{header:"px-3 py-2 text-xs",cell:"px-3 py-2 text-xs"},medium:{header:"px-6 py-3 text-xs",cell:"px-6 py-4 text-sm"},large:{header:"px-8 py-4 text-sm",cell:"px-8 py-6 text-base"}})[t.size]);e.onMounted(()=>{t.api&&(t.page&&(D.value=t.page),t.limit&&(H.value=t.limit),t.total&&(T.value=t.total),z())}),e.watch(()=>t.api,a=>{a&&(D.value=t.page||1,H.value=t.limit||10,T.value=t.total||0,z())});const Qe=e.computed(()=>t.api?h.value:t.columns),W=e.ref([]),v=e.ref({});e.provide("registerColumn",(a,d)=>{W.value.push(a),d&&a.slotName&&(v.value[a.name]=d)});const se=e.computed(()=>{const a=Qe.value||[],d=[],l=p.default?.();if(l){const m=l.filter(r=>r.type?.name==="Column"||r.type==="Column"||r.type&&typeof r.type=="object"&&r.type.name==="Column").map(r=>{const y=r.props||r.componentProps||{},E=y.field||y.name||"",F=y.header||y.label||"",ie=r.children&&r.children.body,U={name:E,ua:F,format:y.format||"text",slotName:ie?"body":void 0,...y};return ie&&U.name&&(v.value[U.name]=r.children.body),U});d.push(...m)}if(W.value.length>0&&d.push(...W.value),d.length>0){const m=[],r=new Set(d.map(y=>y.name));return a.forEach(y=>{r.has(y.name)||m.push(y)}),m.push(...d),console.log("Combined columns:",{default:a.length,custom:d.length,combined:m.length}),m}return a.length>0?(console.log("Using default columns:",a.length),a):[]}),Xe=(a="text")=>A[a.toLowerCase()]||A.text;return(a,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full",k.value.container])},[x.value||t.loading?(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",Ce,[d[0]||(d[0]=e.createElementVNode("div",{class:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600"},null,-1)),e.createElementVNode("span",{class:e.normalizeClass(k.value.loading)},"Loading...",2)])])):C.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["text-center py-8",k.value.error])},e.toDisplayString(C.value),3)):!t.loading&&_.value.length>0?(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("div",{class:e.normalizeClass(a.classWrapper?a.classWrapper:"relative w-full overflow-auto")},[e.createElementVNode("table",{class:e.normalizeClass(a.classTable),style:e.normalizeStyle(a.tableStyle)},[e.createElementVNode("thead",{class:e.normalizeClass(a.classThead||k.value.thead)},[e.createElementVNode("tr",null,[a.selectable?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(["text-left font-medium uppercase tracking-wider",k.value.th,S.value.header,t.classTh,"w-12"])},[e.createElementVNode("input",{type:"checkbox",checked:L.value,indeterminate:V.value,onChange:j,class:e.normalizeClass(["h-4 w-4 focus:ring-blue-500 rounded",k.value.checkbox])},null,42,Be)],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(se.value.filter(l=>!l.hidden),l=>(e.openBlock(),e.createElementBlock("th",{key:l.name,class:e.normalizeClass([l.align?`text-${l.align}`:"",R(l)?["cursor-pointer",k.value.thHover]:"",ae(l)].concat(t.classTh||["text-left font-medium uppercase tracking-wider",k.value.th,S.value.header])),onClick:m=>R(l)?Ue(l.name):void 0},[e.createElementVNode("div",Ee,[e.createElementVNode("span",null,e.toDisplayString(l.ua||l.header||l.name),1),R(l)?(e.openBlock(),e.createElementBlock("span",$e,[e.renderSlot(a.$slots,"sort",{asc:Oe(l.name)},()=>[e.createTextVNode(e.toDisplayString(qe(l.name)),1)])])):e.createCommentVNode("",!0)])],10,we))),128)),g.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:e.normalizeClass(["w-[100px]",t.classTh||["text-left font-medium uppercase tracking-wider",k.value.th,S.value.header]])},"Дії",2)):e.createCommentVNode("",!0)])],2),e.createElementVNode("tbody",{class:e.normalizeClass(a.classTbody||k.value.tbody)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(l,m)=>(e.openBlock(),e.createElementBlock("tr",{key:m,class:e.normalizeClass(t.classTr||[k.value.tr,t.clickable?"cursor-pointer":""]),onClick:r=>t.clickable?Je(l):void 0},[a.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["whitespace-nowrap",k.value.td,S.value.cell,t.classTd,"w-12"])},[e.createElementVNode("input",{type:"checkbox",checked:w(l),onChange:r=>te(l),class:e.normalizeClass(["h-4 w-4 focus:ring-blue-500 rounded",k.value.checkbox])},null,42,Ne)],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(se.value.filter(r=>!r.hidden),r=>(e.openBlock(),e.createElementBlock("td",{key:r.name,class:e.normalizeClass(t.classTd||["whitespace-nowrap",k.value.td,S.value.cell,r.align?`text-${r.align}`:"",ae(r)])},[r.action&&g.value?e.renderSlot(a.$slots,"action",{key:0,row:l}):e.unref(p).number&&r.format==="number"?e.renderSlot(a.$slots,"number",{key:1,row:l,value:$(r,l)}):e.unref(p).badge&&r.format==="badge"?e.renderSlot(a.$slots,"badge",{key:2,row:l,value:$(r,l)}):e.unref(p).array&&r.format==="array"?e.renderSlot(a.$slots,"array",{key:3,row:l,value:$(r,l)}):r.slotName&&v.value[r.name]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(v.value[r.name]),{key:4,data:l,value:$(r,l),row:l,column:r},null,8,["data","value","row","column"])):r.link?(e.openBlock(),e.createElementBlock("a",{key:5,class:e.normalizeClass(a.classLink||"hover:text-blue-900 cursor-pointer text-blue-700 hover:underline"),onClick:y=>b(r.link.replace("{id}",l.id))},e.toDisplayString($(r,l)),11,Ve)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Xe(r.format)),{key:6,value:$(r,l),row:l,column:r,href:r.link},null,8,["value","row","column","href"]))],2))),128)),g.value?(e.openBlock(),e.createElementBlock("td",De,[e.renderSlot(a.$slots,"action",{row:l})])):e.createCommentVNode("",!0)],10,Se))),128))],2)],6)],2)])):e.createCommentVNode("",!0),Ke.value&&!x.value&&!t.loading&&!C.value?(e.openBlock(),e.createBlock(I,{key:3,page:le.value,limit:ne.value,total:re.value,theme:t.theme,size:t.size,"onUpdate:page":Ge},null,8,["page","limit","total","theme","size"])):e.createCommentVNode("",!0),!x.value&&!t.loading&&!C.value&&_.value.length===0?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["text-center py-8",k.value.empty])}," Дані відсутні ",2)):e.createCommentVNode("",!0)],2))}}),Te={style:{display:"none"}},Y=e.defineComponent({name:"Column",__name:"Column",props:{field:{},name:{},header:{},label:{},format:{},hidden:{type:Boolean},sortable:{type:Boolean},width:{},align:{},slot:{},slotName:{},link:{},action:{type:Boolean},getCellData:{type:Function},suffix:{}},setup(u){const o=u,t=e.useSlots(),c=e.inject("registerColumn");return e.onMounted(()=>{if(c){const{field:n,name:s,header:i,label:h,format:x,slotName:C,link:B,action:p,getCellData:g,suffix:b,..._}=o,V={name:n||s||"",ua:i||h||"",format:x||"text",slotName:C||(t.body?"body":void 0),link:B,action:p,getCellData:g,suffix:b,..._};console.log("Registering column:",V);const j=t.body;c(V,j)}}),(n,s)=>(e.openBlock(),e.createElementBlock("div",Te,[e.renderSlot(n.$slots,"body",{data:{}})]))}}),ze={class:"mt-4"},ve={class:"text-sm text-gray-600 dark:text-gray-300"},Z=e.defineComponent({__name:"SelectionInfo",props:{selectedRows:{},totalCount:{}},setup(u){const o=u,t=e.computed(()=>o.selectedRows.length);return(c,n)=>(e.openBlock(),e.createElementBlock("div",ze,[e.createElementVNode("div",ve," Обрано: "+e.toDisplayString(t.value)+" з "+e.toDisplayString(c.totalCount)+" записів ",1)]))}}),Fe={class:"mt-4"},Ae={class:"border-b border-gray-200 dark:border-gray-700"},Ie={class:"-mb-px flex space-x-8"},Le=["onClick"],je={class:"mt-4"},Re={class:"bg-gray-900 rounded-lg overflow-hidden"},Pe={class:"flex items-center justify-between px-4 py-2 bg-gray-800 border-b border-gray-700"},Me={class:"text-sm text-gray-300"},He=["onClick"],We={class:"p-4 text-sm text-gray-100 overflow-x-auto"},ee=e.defineComponent({__name:"CodeTabs",props:{tabs:{},defaultTab:{default:void 0}},setup(u){const o=u,t=e.ref(o.defaultTab||o.tabs[0]?.id||""),c=async n=>{try{await navigator.clipboard.writeText(n),console.log("Код скопійовано!")}catch(s){console.error("Помилка копіювання:",s)}};return(n,s)=>(e.openBlock(),e.createElementBlock("div",Fe,[e.createElementVNode("div",Ae,[e.createElementVNode("nav",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tabs,i=>(e.openBlock(),e.createElementBlock("button",{key:i.id,onClick:h=>t.value=i.id,class:e.normalizeClass(["py-2 px-1 border-b-2 font-medium text-sm transition-colors",t.value===i.id?"border-blue-500 text-blue-600 dark:text-blue-400":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"])},e.toDisplayString(i.label),11,Le))),128))])]),e.createElementVNode("div",je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tabs,i=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:i.id},[e.createElementVNode("div",Re,[e.createElementVNode("div",Pe,[e.createElementVNode("span",Me,e.toDisplayString(i.label),1),e.createElementVNode("button",{onClick:h=>c(i.content),class:"text-gray-400 hover:text-white transition-colors",title:"Копіювати код"},[...s[0]||(s[0]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1)])],8,He)]),e.createElementVNode("pre",We,[e.createElementVNode("code",null,e.toDisplayString(i.content),1)])])])),[[e.vShow,t.value===i.id]])),128))])]))}});N.install=function(o){o.component("DataTable",N),o.component("Column",Y),o.component("Pagination",I),o.component("SelectionInfo",Z),o.component("CodeTabs",ee)},f.ArrayFormat=K,f.BadgeFormat=G,f.CodeTabs=ee,f.Column=Y,f.DataTable=N,f.DateFormat=q,f.LinkFormat=Q,f.NumberFormat=O,f.Pagination=I,f.SelectFormat=X,f.SelectionInfo=Z,f.TextFormat=J,f.default=N,f.formatComponents=A,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(y,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(y=typeof globalThis<"u"?globalThis:y||self,e(y.filter={},y.Vue))})(this,function(y,e){"use strict";const O=e.defineComponent({name:"NumberFormat",__name:"NumberFormat",props:{value:{},row:{},column:{}},setup(g){const s=g,t=e.computed(()=>s.value===null||s.value===void 0?"":typeof s.value=="number"?s.value.toFixed(2):Intl.NumberFormat("uk-UA",{maximumFractionDigits:2}).format(Number(s.value)));return(m,n)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(t.value||"-"),1))}}),q=e.defineComponent({name:"DateFormat",__name:"DateFormat",props:{value:{},row:{},column:{}},setup(g){const s=g,t=e.computed(()=>{if(!s.value)return"";try{return new Date(s.value).toLocaleDateString()}catch{return s.value}});return(m,n)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(t.value||"-"),1))}}),J=e.defineComponent({name:"TextFormat",__name:"TextFormat",props:{value:{},row:{},column:{}},setup(g){const s=g,{value:t}=s,m=e.computed(()=>Array.isArray(t)?t.map(n=>n.text||n).join(","):t?.text||t);return(n,r)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(m.value||"-"),1))}}),G=((g,s)=>{const t=g.__vccOpts||g;for(const[m,n]of s)t[m]=n;return t})(e.defineComponent({name:"BadgeFormat",__name:"BadgeFormat",props:{value:{},row:{},column:{}},setup(g){const s=g,t=e.computed(()=>{const r=String(s.value||"").toLowerCase(),i="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium";return r.includes("success")||r.includes("active")||r.includes("completed")?`${i} bg-green-100 text-green-800`:r.includes("error")||r.includes("failed")||r.includes("inactive")?`${i} bg-red-100 text-red-800`:r.includes("warning")||r.includes("pending")?`${i} bg-yellow-100 text-yellow-800`:r.includes("info")||r.includes("processing")?`${i} bg-blue-100 text-blue-800`:s.value?.color&&!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(s.value.color)?`${i} bg-${s.value.color}-100 text-${s.value.color}-800`:`${i} bg-gray-100 text-gray-800`});function m(r,i=1){const k=parseInt(r.slice(1,3),16),B=parseInt(r.slice(3,5),16),x=parseInt(r.slice(5,7),16);return`rgba(${k}, ${B}, ${x}, ${i})`}const n=e.computed(()=>{const r={minWidth:"60px",textAlign:"center",display:"inline-block"};return/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(s.value?.color)?{...r,backgroundColor:m(s.value.color,.1),color:m(s.value.color,.8)}:r});return(r,i)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["badge",t.value]),style:e.normalizeStyle(n.value)},e.toDisplayString(r.value?.text||r.value||"-"),7))}}),[["__scopeId","data-v-f4b15092"]]),ie={class:"flex flex-wrap gap-1"},K=e.defineComponent({name:"ArrayFormat",__name:"ArrayFormat",props:{value:{},row:{},column:{}},setup(g){const s=g,t=e.computed(()=>s.value?Array.isArray(s.value)?s.value:[s.value]:[]),m=n=>n?typeof n=="object"&&n.name?n.name:typeof n=="string"||typeof n=="number"?String(n):JSON.stringify(n):"";return(n,r)=>(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(i,k)=>(e.openBlock(),e.createElementBlock("span",{key:k,class:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800 hover:bg-blue-200 transition-colors"},e.toDisplayString(m(i)),1))),128))]))}}),Q=e.defineComponent({name:"TextFormat",__name:"SelectFormat",props:{value:{},row:{},column:{}},setup(g){const s=g,{value:t}=s,m=e.computed(()=>Array.isArray(t)?t.map(n=>n.text||n).filter((n,r)=>r<2).join(", ")+(t.length>2?` +${t.length-2}`:""):t?.text||t);return(n,r)=>(e.openBlock(),e.createElementBlock("span",null,e.toDisplayString(m.value||"-"),1))}}),A={number:O,date:q,text:J,badge:G,array:K,select:Q},ce={class:"flex items-center space-x-4"},de={class:"font-medium"},me={class:"font-medium"},pe={class:"font-medium"},ge={class:"flex items-center space-x-2"},ue=["disabled"],fe={class:"flex items-center space-x-1"},ye=["onClick"],be=["disabled"],I=e.defineComponent({name:"Pagination",__name:"Pagination",props:{page:{},limit:{},total:{},theme:{default:"light"},size:{default:"medium"}},emits:["update:page"],setup(g,{emit:s}){const t=g,m=e.computed(()=>({small:{text:"text-xs",button:"px-2 h-7 text-xs min-w-[28px] flex items-center justify-center",icon:"w-3.5 h-3.5"},medium:{text:"text-sm",button:"px-3 h-9 text-sm min-w-[36px] flex items-center justify-center",icon:"w-4 h-4"},large:{text:"text-base",button:"px-4 h-11 text-base min-w-[44px] flex items-center justify-center",icon:"w-5 h-5"}})[t.size]),n=e.computed(()=>{const{theme:p}=t;return p==="dark"?{container:"bg-gray-900 border-gray-700",text:"text-gray-300",button:"text-gray-300 bg-gray-800 border-gray-600 hover:bg-gray-700",buttonDisabled:"text-gray-500 bg-gray-800",buttonActive:"bg-blue-600 text-white",ellipsis:"text-gray-400"}:p==="light"?{container:"bg-white border-gray-200",text:"text-gray-700",button:"text-gray-700 bg-white border-gray-300 hover:bg-gray-50",buttonDisabled:"text-gray-400 bg-gray-100",buttonActive:"bg-blue-600 text-white",ellipsis:"text-gray-500"}:{container:"bg-white dark:bg-gray-900 border-gray-200 dark:border-gray-700",text:"text-gray-700 dark:text-gray-300",button:"text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700",buttonDisabled:"text-gray-400 dark:text-gray-500 bg-gray-100 dark:bg-gray-800",buttonActive:"bg-blue-600 text-white",ellipsis:"text-gray-500 dark:text-gray-400"}}),r=s,i=e.computed(()=>Math.ceil(t.total/t.limit)),k=e.computed(()=>t.total===0?0:(t.page-1)*t.limit+1),B=e.computed(()=>Math.min(t.page*t.limit,t.total)),x=e.computed(()=>{const p=[];if(i.value<=7)for(let b=1;b<=i.value;b+=1)p.push(b);else{p.push(1),t.page>4&&p.push("...");const b=Math.max(2,t.page-1),C=Math.min(i.value-1,t.page+1);for(let w=b;w<=C;w+=1)w!==1&&w!==i.value&&p.push(w);t.page<i.value-3&&p.push("..."),i.value>1&&p.push(i.value)}return p}),_=p=>{p>=1&&p<=i.value&&p!==t.page&&r("update:page",p)};return(p,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex items-center justify-between py-3 border-t",n.value.container])},[e.createElementVNode("div",ce,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center text-sm",n.value.text,m.value.text])},[e.createElementVNode("span",null,[u[2]||(u[2]=e.createTextVNode(" Показано ",-1)),e.createElementVNode("span",de,e.toDisplayString(k.value),1),u[3]||(u[3]=e.createTextVNode(" до ",-1)),e.createElementVNode("span",me,e.toDisplayString(B.value),1),u[4]||(u[4]=e.createTextVNode(" з ",-1)),e.createElementVNode("span",pe,e.toDisplayString(p.total),1),u[5]||(u[5]=e.createTextVNode(" результатів ",-1))])],2)]),e.createElementVNode("div",ge,[e.createElementVNode("button",{onClick:u[0]||(u[0]=b=>_(p.page-1)),disabled:p.page<=1,class:e.normalizeClass(["relative font-medium rounded-md",m.value.button,p.page<=1?n.value.buttonDisabled:n.value.button])},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(m.value.icon),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},u[6]||(u[6]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"},null,-1)]),2))],10,ue),e.createElementVNode("div",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,b=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:b},[b==="..."?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["font-medium",m.value.button,n.value.ellipsis])}," ... ",2)):(e.openBlock(),e.createElementBlock("button",{key:1,onClick:C=>_(b),class:e.normalizeClass(["relative font-medium rounded-md",m.value.button,b===p.page?n.value.buttonActive:n.value.button])},e.toDisplayString(b),11,ye))],64))),128))]),e.createElementVNode("button",{onClick:u[1]||(u[1]=b=>_(p.page+1)),disabled:p.page>=i.value,class:e.normalizeClass(["relative font-medium rounded-md",m.value.button,p.page>=i.value?n.value.buttonDisabled:n.value.button])},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(m.value.icon),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},u[7]||(u[7]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]),2))],10,be)])],2))}}),he={key:0,class:"text-center py-8"},ke={class:"inline-flex items-center space-x-2"},xe={key:2,class:"overflow-x-auto"},Ce=["checked","indeterminate"],Be=["onClick"],_e={class:"flex items-center justify-between"},we={key:0,class:"ml-1 text-xs"},Ee=["onClick"],$e=["checked","onChange"],Ne=["onClick"],Se={key:1,class:"text-center"},S=e.defineComponent({name:"DataTable",__name:"DataTable",props:{rows:{default:()=>[]},columns:{default:()=>[]},api:{},router:{},tableStyle:{default:""},size:{default:"medium"},theme:{default:"light"},loading:{type:Boolean,default:!1},classWrapper:{default:""},classTable:{default:"min-w-full divide-y divide-gray-200 dark:divide-gray-700"},classTbody:{default:""},classTr:{default:""},classTd:{default:""},classTh:{default:""},classThead:{default:""},classLink:{default:""},selectable:{type:Boolean,default:!1},selectedRows:{default:()=>[]},limit:{default:10},page:{default:1},total:{default:0},showPagination:{type:Boolean,default:!0},sortable:{type:Boolean,default:!1},clickable:{type:Boolean,default:!1},getCellData:{type:Function,default:void 0}},emits:["update:page","update:selectedRows","row-click","sort"],setup(g,{emit:s}){const t=g,m=s,n=e.ref(t.selectedRows||[]),r=e.ref([]),i=e.ref([]),k=e.ref([]),B=e.ref(!1),x=e.ref(null),_=e.ref(t.router),p=e.useSlots(),u=e.computed(()=>p.action);function b(a){if(_.value){_.value.push(a);return}location.href=a}const C=e.computed(()=>{if(t.api)return i.value;if(t.sortable&&r.value.length>0){const a=[...t.rows];return a.sort((c,o)=>{for(const d of r.value){if(!d.direction)return 0;const l=c[d.field],f=o[d.field];if(l==null)return 1;if(f==null)return-1;let E=0;typeof l=="string"&&typeof f=="string"?E=l.localeCompare(f):l<f?E=-1:l>f?E=1:E=0;const v=d.direction==="desc"?-E:E;if(v!==0)return v}return 0}),a}return t.rows});e.watch(()=>t.selectedRows,a=>{n.value=a||[]});const w=a=>n.value.some(c=>c===a),ee=a=>{const c=n.value.findIndex(o=>o===a);c>-1?n.value.splice(c,1):n.value.push(a),m("update:selectedRows",[...n.value])},j=e.computed(()=>C.value.length>0&&n.value.length===C.value.length),V=e.computed(()=>n.value.length>0&&n.value.length<C.value.length),L=()=>{j.value?n.value=[]:n.value=[...C.value],m("update:selectedRows",[...n.value])},He=a=>{if(!t.sortable)return;const c=r.value.findIndex(d=>d.field===a);if(c>=0){const d=r.value[c];d.direction==="asc"?d.direction="desc":d.direction==="desc"&&r.value.splice(c,1)}else r.value.unshift({field:a,direction:"asc"});const o=r.value.filter(d=>d.direction).map(d=>({name:d.field,asc:d.direction==="asc"}));m("sort",o),t.api&&z()},We=a=>r.value.find(o=>o.field===a)?.direction==="asc",Ue=a=>{const c=r.value.find(o=>o.field===a);if(!c)return"↑↓";switch(c.direction){case"asc":return"↑";case"desc":return"↓";default:return"↕️"}},R=a=>t.sortable&&a.sortable!==!1,Oe=a=>{t.clickable&&m("row-click",a)},$=(a,c)=>{const o=c[a.name];if(t.getCellData||a.getCellData){const d=a.getCellData||t.getCellData;if(d){const l={name:a.name,row:c,value:o};return d(l)}}return["_data","_text"].map(d=>{const l=`${a.name}${d}`;return c[l]?c[l]:null}).find(d=>d)||o},te=a=>a.width?a.width==="w-full"?"w-full":typeof a.width=="string"?`w-[${a.width}px]`:typeof a.width=="number"?`w-[${a.width}px]`:"":"",P=e.ref(t.page),ae=e.ref(t.limit),M=e.ref(t.total),T=e.ref(1),H=e.ref(10),D=e.ref(0),oe=e.computed(()=>t.api?T.value:P.value),le=e.computed(()=>t.api?H.value:ae.value),ne=e.computed(()=>t.api?D.value:M.value),h=e.computed(()=>{const{theme:a}=t;return a==="dark"?{container:"dark",loading:"text-gray-400",error:"text-red-400",thead:"bg-gray-800",th:"text-gray-300",thHover:"hover:bg-gray-700",tbody:"bg-gray-900 divide-gray-700",tr:"hover:bg-gray-800",td:"text-gray-300",empty:"text-gray-400",checkbox:"border-gray-600 bg-gray-700 text-blue-400"}:a==="light"?{container:"",loading:"text-gray-500",error:"text-red-500",thead:"bg-gray-50",th:"text-gray-500",thHover:"hover:bg-gray-100",tbody:"bg-white divide-gray-200",tr:"hover:bg-gray-50",td:"text-gray-900",empty:"text-gray-500",checkbox:"border-gray-300 bg-white text-blue-600"}:{container:"",loading:"text-gray-500 dark:text-gray-400",error:"text-red-500 dark:text-red-400",thead:"bg-gray-50 dark:bg-gray-800",th:"text-gray-500 dark:text-gray-300",thHover:"hover:bg-gray-100 dark:hover:bg-gray-700",tbody:"bg-white dark:bg-gray-900 divide-gray-200 dark:divide-gray-700",tr:"hover:bg-gray-50 dark:hover:bg-gray-800",td:"text-gray-900 dark:text-gray-300",empty:"text-gray-500 dark:text-gray-400",checkbox:"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-blue-600 dark:text-blue-400"}});e.watch(()=>t.page,a=>{P.value=a}),e.watch(()=>t.limit,a=>{ae.value=a}),e.watch(()=>t.total,a=>{M.value=a});async function z(){if(t.api){B.value=!0,x.value=null;try{const a=new URL(t.api,window.location.origin);if(a.searchParams.set("page",oe.value.toString()),a.searchParams.set("limit",le.value.toString()),r.value.length>0){const d=r.value.filter(l=>l.direction).map(l=>`${l.field}:${l.direction}`).join(",");d&&a.searchParams.set("sort",d)}const c=await fetch(a.toString());if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);const o=await c.json();o.rows&&Array.isArray(o.rows)&&(i.value=o.rows),o.columns&&Array.isArray(o.columns)&&(k.value=o.columns),o.total!==void 0&&(t.api?D.value=o.total:M.value=o.total)}catch(a){x.value=a instanceof Error?a.message:"Failed to fetch data",console.error("Error fetching data:",a)}finally{B.value=!1}}}const qe=a=>{t.api?T.value=a:(P.value=a,m("update:page",a)),t.api&&z()},Je=e.computed(()=>t.showPagination&&ne.value>0),N=e.computed(()=>({small:{header:"px-3 py-2 text-xs",cell:"px-3 py-2 text-xs"},medium:{header:"px-6 py-3 text-xs",cell:"px-6 py-4 text-sm"},large:{header:"px-8 py-4 text-sm",cell:"px-8 py-6 text-base"}})[t.size]);e.onMounted(()=>{t.api&&(t.page&&(T.value=t.page),t.limit&&(H.value=t.limit),t.total&&(D.value=t.total),z())}),e.watch(()=>t.api,a=>{a&&(T.value=t.page||1,H.value=t.limit||10,D.value=t.total||0,z())});const Ge=e.computed(()=>t.api?k.value:t.columns),W=e.ref([]),F=e.ref({});e.provide("registerColumn",(a,c)=>{W.value.push(a),c&&a.slotName&&(F.value[a.name]=c)});const re=e.computed(()=>{const a=Ge.value||[],c=[],o=p.default?.();if(o){const d=o.filter(l=>l.type?.name==="Column"||l.type==="Column"||l.type&&typeof l.type=="object"&&l.type.name==="Column").map(l=>{const f=l.props||l.componentProps||{},E=f.field||f.name||"",v=f.header||f.label||"",se=l.children&&l.children.body,U={name:E,ua:v,format:f.format||"text",slotName:se?"body":void 0,...f};return se&&U.name&&(F.value[U.name]=l.children.body),U});c.push(...d)}if(W.value.length>0&&c.push(...W.value),c.length>0){const d=[],l=new Set(c.map(f=>f.name));return a.forEach(f=>{l.has(f.name)||d.push(f)}),d.push(...c),console.log("Combined columns:",{default:a.length,custom:c.length,combined:d.length}),d}return a.length>0?(console.log("Using default columns:",a.length),a):[]}),Ke=(a="text")=>A[a.toLowerCase()]||A.text;return(a,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full",h.value.container])},[B.value||t.loading?(e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",ke,[c[0]||(c[0]=e.createElementVNode("div",{class:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600"},null,-1)),e.createElementVNode("span",{class:e.normalizeClass(h.value.loading)},"Loading...",2)])])):x.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["text-center py-8",h.value.error])},e.toDisplayString(x.value),3)):!t.loading&&C.value.length>0?(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",{class:e.normalizeClass(a.classWrapper?a.classWrapper:"relative w-full overflow-auto")},[e.createElementVNode("table",{class:e.normalizeClass(a.classTable),style:e.normalizeStyle(a.tableStyle)},[e.createElementVNode("thead",{class:e.normalizeClass(a.classThead||h.value.thead)},[e.createElementVNode("tr",null,[a.selectable?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(["text-left font-medium uppercase tracking-wider",h.value.th,N.value.header,t.classTh,"w-12"])},[e.createElementVNode("input",{type:"checkbox",checked:j.value,indeterminate:V.value,onChange:L,class:e.normalizeClass(["h-4 w-4 focus:ring-blue-500 rounded",h.value.checkbox])},null,42,Ce)],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value.filter(o=>!o.hidden),o=>(e.openBlock(),e.createElementBlock("th",{key:o.name,class:e.normalizeClass([o.align?`text-${o.align}`:"",R(o)?["cursor-pointer",h.value.thHover]:"",te(o)].concat(t.classTh||["text-left font-medium uppercase tracking-wider",h.value.th,N.value.header])),onClick:d=>R(o)?He(o.name):void 0},[e.createElementVNode("div",_e,[e.createElementVNode("span",null,e.toDisplayString(o.ua||o.header||o.name),1),R(o)?(e.openBlock(),e.createElementBlock("span",we,[e.renderSlot(a.$slots,"sort",{asc:We(o.name)},()=>[e.createTextVNode(e.toDisplayString(Ue(o.name)),1)])])):e.createCommentVNode("",!0)])],10,Be))),128)),u.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:e.normalizeClass(["w-[100px]",t.classTh||["text-left font-medium uppercase tracking-wider",h.value.th,N.value.header]])},"Дії",2)):e.createCommentVNode("",!0)])],2),e.createElementVNode("tbody",{class:e.normalizeClass(a.classTbody||h.value.tbody)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(o,d)=>(e.openBlock(),e.createElementBlock("tr",{key:d,class:e.normalizeClass(t.classTr||[h.value.tr,t.clickable?"cursor-pointer":""]),onClick:l=>t.clickable?Oe(o):void 0},[a.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["whitespace-nowrap",h.value.td,N.value.cell,t.classTd,"w-12"])},[e.createElementVNode("input",{type:"checkbox",checked:w(o),onChange:l=>ee(o),class:e.normalizeClass(["h-4 w-4 focus:ring-blue-500 rounded",h.value.checkbox])},null,42,$e)],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value.filter(l=>!l.hidden),l=>(e.openBlock(),e.createElementBlock("td",{key:l.name,class:e.normalizeClass(t.classTd||["whitespace-nowrap",h.value.td,N.value.cell,l.align?`text-${l.align}`:"",te(l)])},[l.action&&u.value?e.renderSlot(a.$slots,"action",{key:0,row:o}):e.unref(p).number&&l.format==="number"?e.renderSlot(a.$slots,"number",{key:1,row:o,value:$(l,o)}):e.unref(p).badge&&l.format==="badge"?e.renderSlot(a.$slots,"badge",{key:2,row:o,value:$(l,o)}):e.unref(p).array&&l.format==="array"?e.renderSlot(a.$slots,"array",{key:3,row:o,value:$(l,o)}):l.slotName&&F.value[l.name]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(F.value[l.name]),{key:4,data:o,value:$(l,o),row:o,column:l},null,8,["data","value","row","column"])):l.link?(e.openBlock(),e.createElementBlock("a",{key:5,class:e.normalizeClass(a.classLink||"hover:text-blue-900 cursor-pointer text-blue-700 hover:underline"),onClick:f=>b(l.link.replace("{id}",o.id))},e.toDisplayString($(l,o)),11,Ne)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(Ke(l.format)),{key:6,value:$(l,o),row:o,column:l,href:l.link},null,8,["value","row","column","href"]))],2))),128)),u.value?(e.openBlock(),e.createElementBlock("td",Se,[e.renderSlot(a.$slots,"action",{row:o})])):e.createCommentVNode("",!0)],10,Ee))),128))],2)],6)],2)])):e.createCommentVNode("",!0),Je.value&&!B.value&&!t.loading&&!x.value?(e.openBlock(),e.createBlock(I,{key:3,page:oe.value,limit:le.value,total:ne.value,theme:t.theme,size:t.size,"onUpdate:page":qe},null,8,["page","limit","total","theme","size"])):e.createCommentVNode("",!0),!B.value&&!t.loading&&!x.value&&C.value.length===0?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["text-center py-8",h.value.empty])}," Дані відсутні ",2)):e.createCommentVNode("",!0)],2))}}),Ve={style:{display:"none"}},X=e.defineComponent({name:"Column",__name:"Column",props:{field:{},name:{},header:{},label:{},format:{},hidden:{type:Boolean},sortable:{type:Boolean},width:{},align:{},slot:{},slotName:{},link:{},action:{type:Boolean},getCellData:{type:Function},suffix:{}},setup(g){const s=g,t=e.useSlots(),m=e.inject("registerColumn");return e.onMounted(()=>{if(m){const{field:n,name:r,header:i,label:k,format:B,slotName:x,link:_,action:p,getCellData:u,suffix:b,...C}=s,V={name:n||r||"",ua:i||k||"",format:B||"text",slotName:x||(t.body?"body":void 0),link:_,action:p,getCellData:u,suffix:b,...C};console.log("Registering column:",V);const L=t.body;m(V,L)}}),(n,r)=>(e.openBlock(),e.createElementBlock("div",Ve,[e.renderSlot(n.$slots,"body",{data:{}})]))}}),Te={class:"mt-4"},De={class:"text-sm text-gray-600 dark:text-gray-300"},Y=e.defineComponent({__name:"SelectionInfo",props:{selectedRows:{},totalCount:{}},setup(g){const s=g,t=e.computed(()=>s.selectedRows.length);return(m,n)=>(e.openBlock(),e.createElementBlock("div",Te,[e.createElementVNode("div",De," Обрано: "+e.toDisplayString(t.value)+" з "+e.toDisplayString(m.totalCount)+" записів ",1)]))}}),ze={class:"mt-4"},Fe={class:"border-b border-gray-200 dark:border-gray-700"},ve={class:"-mb-px flex space-x-8"},Ae=["onClick"],Ie={class:"mt-4"},je={class:"bg-gray-900 rounded-lg overflow-hidden"},Le={class:"flex items-center justify-between px-4 py-2 bg-gray-800 border-b border-gray-700"},Re={class:"text-sm text-gray-300"},Pe=["onClick"],Me={class:"p-4 text-sm text-gray-100 overflow-x-auto"},Z=e.defineComponent({__name:"CodeTabs",props:{tabs:{},defaultTab:{default:void 0}},setup(g){const s=g,t=e.ref(s.defaultTab||s.tabs[0]?.id||""),m=async n=>{try{await navigator.clipboard.writeText(n),console.log("Код скопійовано!")}catch(r){console.error("Помилка копіювання:",r)}};return(n,r)=>(e.openBlock(),e.createElementBlock("div",ze,[e.createElementVNode("div",Fe,[e.createElementVNode("nav",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tabs,i=>(e.openBlock(),e.createElementBlock("button",{key:i.id,onClick:k=>t.value=i.id,class:e.normalizeClass(["py-2 px-1 border-b-2 font-medium text-sm transition-colors",t.value===i.id?"border-blue-500 text-blue-600 dark:text-blue-400":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"])},e.toDisplayString(i.label),11,Ae))),128))])]),e.createElementVNode("div",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tabs,i=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:i.id},[e.createElementVNode("div",je,[e.createElementVNode("div",Le,[e.createElementVNode("span",Re,e.toDisplayString(i.label),1),e.createElementVNode("button",{onClick:k=>m(i.content),class:"text-gray-400 hover:text-white transition-colors",title:"Копіювати код"},r[0]||(r[0]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1)]),8,Pe)]),e.createElementVNode("pre",Me,[e.createElementVNode("code",null,e.toDisplayString(i.content),1)])])])),[[e.vShow,t.value===i.id]])),128))])]))}});S.install=function(s){s.component("DataTable",S),s.component("Column",X),s.component("Pagination",I),s.component("SelectionInfo",Y),s.component("CodeTabs",Z)},y.ArrayFormat=K,y.BadgeFormat=G,y.CodeTabs=Z,y.Column=X,y.DataTable=S,y.DateFormat=q,y.NumberFormat=O,y.Pagination=I,y.SelectFormat=Q,y.SelectionInfo=Y,y.TextFormat=J,y.default=S,y.formatComponents=A,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
export type FormatType = 'text' | 'number' | 'date' | 'badge' | 'array' | 'select' | 'custom' | 'link' | 'action';
|
|
3
|
+
export type TableSize = 'small' | 'medium' | 'large';
|
|
4
|
+
export type TableTheme = 'light' | 'dark' | 'auto';
|
|
5
|
+
export type SortDirection = 'asc' | 'desc' | null;
|
|
6
|
+
export interface SortConfig {
|
|
7
|
+
name: string;
|
|
8
|
+
asc: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface CellDataParams {
|
|
11
|
+
name: string;
|
|
12
|
+
row: any;
|
|
13
|
+
value: any;
|
|
14
|
+
}
|
|
15
|
+
export type GetCellDataHook = (params: CellDataParams) => any;
|
|
16
|
+
export interface Column {
|
|
17
|
+
ua: string;
|
|
18
|
+
hidden?: boolean;
|
|
19
|
+
data?: string;
|
|
20
|
+
format: FormatType;
|
|
21
|
+
name: string;
|
|
22
|
+
field?: string;
|
|
23
|
+
header?: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
sortable?: boolean;
|
|
26
|
+
width?: number | string;
|
|
27
|
+
align?: 'left' | 'right' | 'center';
|
|
28
|
+
slot?: string;
|
|
29
|
+
slotName?: string;
|
|
30
|
+
bodyTemplate?: any;
|
|
31
|
+
link?: string;
|
|
32
|
+
action?: boolean;
|
|
33
|
+
getCellData?: GetCellDataHook;
|
|
34
|
+
suffix?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface TableData {
|
|
37
|
+
rows: any[];
|
|
38
|
+
columns: Column[];
|
|
39
|
+
total: number;
|
|
40
|
+
}
|
|
41
|
+
export interface InternalDataTableProps {
|
|
42
|
+
rows?: any[];
|
|
43
|
+
columns?: Column[];
|
|
44
|
+
api?: string;
|
|
45
|
+
router?: any;
|
|
46
|
+
tableStyle?: string;
|
|
47
|
+
size?: TableSize;
|
|
48
|
+
theme?: TableTheme;
|
|
49
|
+
loading?: boolean;
|
|
50
|
+
classWrapper?: string;
|
|
51
|
+
classTable?: string;
|
|
52
|
+
classTbody?: string;
|
|
53
|
+
classTr?: string;
|
|
54
|
+
classTd?: string;
|
|
55
|
+
classTh?: string;
|
|
56
|
+
classThead?: string;
|
|
57
|
+
classLink?: string;
|
|
58
|
+
selectable?: boolean;
|
|
59
|
+
selectedRows?: any[];
|
|
60
|
+
limit?: number;
|
|
61
|
+
page?: number;
|
|
62
|
+
total?: number;
|
|
63
|
+
showPagination?: boolean;
|
|
64
|
+
sortable?: boolean;
|
|
65
|
+
clickable?: boolean;
|
|
66
|
+
getCellData?: GetCellDataHook;
|
|
67
|
+
}
|
|
68
|
+
export interface ColumnProps {
|
|
69
|
+
field?: string;
|
|
70
|
+
name?: string;
|
|
71
|
+
header?: string;
|
|
72
|
+
label?: string;
|
|
73
|
+
format?: FormatType;
|
|
74
|
+
hidden?: boolean;
|
|
75
|
+
sortable?: boolean;
|
|
76
|
+
width?: number | string;
|
|
77
|
+
align?: 'left' | 'right' | 'center';
|
|
78
|
+
slot?: string;
|
|
79
|
+
slotName?: string;
|
|
80
|
+
link?: string;
|
|
81
|
+
action?: boolean;
|
|
82
|
+
getCellData?: GetCellDataHook;
|
|
83
|
+
suffix?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface FormatComponentProps {
|
|
86
|
+
value: any;
|
|
87
|
+
row?: any;
|
|
88
|
+
column?: Column;
|
|
89
|
+
}
|
|
90
|
+
export interface ApiResponse {
|
|
91
|
+
rows: any[];
|
|
92
|
+
columns: Column[];
|
|
93
|
+
total?: number;
|
|
94
|
+
}
|
|
95
|
+
export interface VueDataTablePlugin {
|
|
96
|
+
install: (app: App) => void;
|
|
97
|
+
}
|
|
98
|
+
export interface ColumnConfig {
|
|
99
|
+
prop: string;
|
|
100
|
+
label: string;
|
|
101
|
+
sortable?: boolean;
|
|
102
|
+
filterable?: boolean;
|
|
103
|
+
width?: number | string;
|
|
104
|
+
type?: 'text' | 'number' | 'date' | 'badge' | 'select' | 'link' | 'action';
|
|
105
|
+
format?: string;
|
|
106
|
+
align?: 'left' | 'center' | 'right';
|
|
107
|
+
link?: {
|
|
108
|
+
href?: string;
|
|
109
|
+
target?: string;
|
|
110
|
+
onClick?: (row: any, value: any) => void;
|
|
111
|
+
};
|
|
112
|
+
action?: boolean;
|
|
113
|
+
getCellData?: GetCellDataHook;
|
|
114
|
+
suffix?: string;
|
|
115
|
+
}
|
|
116
|
+
export interface DataTableProps {
|
|
117
|
+
data: any[];
|
|
118
|
+
columns: ColumnConfig[];
|
|
119
|
+
loading?: boolean;
|
|
120
|
+
selectable?: boolean;
|
|
121
|
+
sortable?: boolean;
|
|
122
|
+
filterable?: boolean;
|
|
123
|
+
pagination?: boolean;
|
|
124
|
+
pageSize?: number;
|
|
125
|
+
pageSizes?: number[];
|
|
126
|
+
classTr?: string;
|
|
127
|
+
classTd?: string;
|
|
128
|
+
classTh?: string;
|
|
129
|
+
classLink?: string;
|
|
130
|
+
getCellData?: GetCellDataHook;
|
|
131
|
+
}
|
|
132
|
+
export interface PaginationProps {
|
|
133
|
+
currentPage: number;
|
|
134
|
+
totalPages: number;
|
|
135
|
+
pageSize: number;
|
|
136
|
+
totalItems: number;
|
|
137
|
+
pageSizes?: number[];
|
|
138
|
+
}
|
|
139
|
+
export interface SelectionInfoProps {
|
|
140
|
+
selectedCount: number;
|
|
141
|
+
totalCount: number;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAO/B,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OA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|
-
{
|
|
2
|
-
"name": "@opengis/table",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "A Vue 3 data table component with advanced features",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"@
|
|
24
|
-
"@
|
|
25
|
-
"@
|
|
26
|
-
"@vue/
|
|
27
|
-
"
|
|
28
|
-
"eslint
|
|
29
|
-
"eslint-
|
|
30
|
-
"eslint-plugin-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"vue
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"build:
|
|
42
|
-
"build
|
|
43
|
-
"
|
|
44
|
-
"preview": "vite preview",
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"docs:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
"author": "softpro",
|
|
59
|
-
"dependencies": {}
|
|
1
|
+
{
|
|
2
|
+
"name": "@opengis/table",
|
|
3
|
+
"version": "0.0.23",
|
|
4
|
+
"description": "A Vue 3 data table component with advanced features",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
|
+
"main": "./dist/index.mjs",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"vue",
|
|
12
|
+
"vue3",
|
|
13
|
+
"table",
|
|
14
|
+
"data-table",
|
|
15
|
+
"component",
|
|
16
|
+
"typescript"
|
|
17
|
+
],
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"vue": "^3.0.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@tsconfig/node22": "^22.0.2",
|
|
24
|
+
"@types/node": "^22.15.32",
|
|
25
|
+
"@vitejs/plugin-vue": "^6.0.0",
|
|
26
|
+
"@vue/eslint-config-typescript": "^12.0.0",
|
|
27
|
+
"@vue/tsconfig": "^0.7.0",
|
|
28
|
+
"eslint": "8.49.0",
|
|
29
|
+
"eslint-config-airbnb": "19.0.4",
|
|
30
|
+
"eslint-plugin-import": "^2.25.3",
|
|
31
|
+
"eslint-plugin-vue": "^9.17.0",
|
|
32
|
+
"typescript": "~5.8.0",
|
|
33
|
+
"vite": "^7.0.0",
|
|
34
|
+
"vue": "^3.5.17",
|
|
35
|
+
"vue-tsc": "^2.2.10"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"lint": "eslint src --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
39
|
+
"dev": "vite",
|
|
40
|
+
"type-check": "vue-tsc --noEmit -p tsconfig.app.json",
|
|
41
|
+
"build:types": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.app.json",
|
|
42
|
+
"build": "vue-tsc -b && vite build && npm run build:types",
|
|
43
|
+
"prepublishOnly": "bun run build",
|
|
44
|
+
"preview": "vite preview",
|
|
45
|
+
"docs:dev": "npm run --prefix ./docs docs:dev",
|
|
46
|
+
"docs:build": "npm run --prefix ./docs docs:build",
|
|
47
|
+
"docs:preview": "npm run --prefix ./docs docs:preview"
|
|
48
|
+
},
|
|
49
|
+
"directories": {
|
|
50
|
+
"example": "examples"
|
|
51
|
+
},
|
|
52
|
+
"repository": {
|
|
53
|
+
"type": "git",
|
|
54
|
+
"url": "https://git.softpro.ua/npm/table.git"
|
|
55
|
+
},
|
|
56
|
+
"author": "softpro",
|
|
57
|
+
"dependencies": {}
|
|
60
58
|
}
|