geekin-devtoys 0.4.3 → 0.5.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.
- package/lib/GDropdown/index.js +1 -1
- package/lib/GDropdown/index.mjs +210 -186
- package/lib/GDropdown/style.css +1 -1
- package/lib/GPagination/index.js +1 -0
- package/lib/GPagination/index.mjs +208 -0
- package/lib/GPagination.d.ts +1 -0
- package/lib/GTable/index.js +1 -1
- package/lib/GTable/index.mjs +279 -420
- package/lib/GTable/style.css +1 -1
- package/lib/assets/GPagination.css +1 -0
- package/lib/components/GDropdown/__tests__/index.test.d.ts +1 -0
- package/lib/components/GDropdown/__tests__/slots.tmp.test.d.ts +1 -0
- package/lib/components/GDropdown/index.d.ts +32 -6
- package/lib/components/GPagination/__tests__/index.test.d.ts +1 -0
- package/lib/components/GPagination/icons.d.ts +7 -0
- package/lib/components/GPagination/index.d.ts +30 -0
- package/lib/components/GPagination/types.d.ts +66 -0
- package/lib/components/GProgress/index.d.ts +1 -1
- package/lib/components/GRadio/index.d.ts +1 -1
- package/lib/components/GRing/index.d.ts +1 -1
- package/lib/components/GSegment/index.d.ts +3 -3
- package/lib/components/GSlider/index.d.ts +2 -2
- package/lib/components/GTable/__tests__/index.test.d.ts +1 -0
- package/lib/components/GTable/icons.d.ts +5 -0
- package/lib/components/GTable/index.d.ts +35 -18
- package/lib/components/GTable/types.d.ts +23 -0
- package/lib/components/GTree/index.d.ts +2 -4
- package/lib/index/index.js +1 -1
- package/lib/index/index.mjs +35 -32
- package/lib/index/style.css +2 -2
- package/lib/index.d.ts +3 -1
- package/package.json +17 -10
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { h as f, defineComponent as te, ref as b, computed as r, watch as K, onBeforeUnmount as ne, createElementBlock as l, createCommentVNode as u, openBlock as o, normalizeStyle as ie, normalizeClass as C, toDisplayString as h, createElementVNode as S, createVNode as k, createTextVNode as x, unref as w, Transition as le, withCtx as oe, Fragment as $, renderList as O, withDirectives as se, vModelText as re } from "vue";
|
|
2
|
+
import { _ as ue } from "../GBranched-vnLlYOl9.mjs";
|
|
3
|
+
const E = {
|
|
4
|
+
viewBox: "0 0 24 24",
|
|
5
|
+
fill: "none",
|
|
6
|
+
stroke: "currentColor",
|
|
7
|
+
"stroke-width": 2,
|
|
8
|
+
"stroke-linecap": "round",
|
|
9
|
+
"stroke-linejoin": "round",
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
width: "1em",
|
|
12
|
+
height: "1em"
|
|
13
|
+
}, de = () => f("svg", E, [f("path", { d: "m15 18-6-6 6-6" })]), ce = () => f("svg", E, [f("path", { d: "m9 18 6-6-6-6" })]), pe = () => f("svg", E, [f("path", { d: "m6 9 6 6 6-6" })]), ve = ["aria-disabled", "aria-label"], ge = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "g-pagination__total"
|
|
16
|
+
}, fe = ["disabled", "aria-expanded", "aria-label"], be = ["data-open"], me = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "g-pagination__menu",
|
|
19
|
+
role: "listbox"
|
|
20
|
+
}, _e = ["aria-selected", "onClick"], he = ["disabled"], ke = ["disabled", "aria-current", "aria-label", "onClick"], ye = ["disabled", "aria-label", "onClick"], ze = ["disabled"], Ce = {
|
|
21
|
+
key: 5,
|
|
22
|
+
class: "g-pagination__jump"
|
|
23
|
+
}, Se = ["disabled", "placeholder", "aria-label"], R = 5, xe = /* @__PURE__ */ te({
|
|
24
|
+
name: "GPagination",
|
|
25
|
+
__name: "index",
|
|
26
|
+
props: {
|
|
27
|
+
total: { default: 0 },
|
|
28
|
+
currentPage: { default: void 0 },
|
|
29
|
+
pageSize: { default: void 0 },
|
|
30
|
+
pageSizes: { default: () => [10, 20, 50, 100] },
|
|
31
|
+
layout: { default: "total, sizes, prev, pager, next, jumper" },
|
|
32
|
+
pageCount: { default: void 0 },
|
|
33
|
+
size: { default: "middle" },
|
|
34
|
+
hideOnSinglePage: { type: Boolean, default: !1 },
|
|
35
|
+
disabled: { type: Boolean, default: !1 },
|
|
36
|
+
className: { default: "" }
|
|
37
|
+
},
|
|
38
|
+
emits: ["update:current-page", "update:page-size", "current-change", "size-change", "prev-click", "next-click"],
|
|
39
|
+
setup(y, { emit: A }) {
|
|
40
|
+
const L = {
|
|
41
|
+
small: { height: 24, font: 12 },
|
|
42
|
+
middle: { height: 32, font: 14 },
|
|
43
|
+
large: { height: 40, font: 16 }
|
|
44
|
+
}, t = y, c = A, F = (e, n, a) => Math.min(a, Math.max(n, e)), N = b(1), B = b(10), i = r(() => t.currentPage !== void 0 ? t.currentPage : N.value), p = r(() => t.pageSize !== void 0 ? t.pageSize : B.value), d = r(() => {
|
|
45
|
+
if (t.pageCount) return Math.max(1, t.pageCount);
|
|
46
|
+
const e = Math.ceil(t.total / p.value);
|
|
47
|
+
return Math.max(1, Number.isFinite(e) ? e : 1);
|
|
48
|
+
}), G = r(() => {
|
|
49
|
+
const e = d.value, n = i.value;
|
|
50
|
+
return e <= 7 ? Array.from({ length: e }, (a, _) => _ + 1) : n <= 4 ? [1, 2, 3, 4, 5, "next", e] : n >= e - 3 ? [1, "prev", e - 4, e - 3, e - 2, e - 1, e] : [1, "prev", n - 1, n, n + 1, "next", e];
|
|
51
|
+
}), J = r(() => t.hideOnSinglePage && d.value <= 1), v = (e, n) => {
|
|
52
|
+
if (t.disabled) return;
|
|
53
|
+
const a = F(Math.floor(e) || 1, 1, d.value);
|
|
54
|
+
a !== i.value && (t.currentPage === void 0 && (N.value = a), c("update:current-page", a), c("current-change", a), n === "prev" && c("prev-click", a), n === "next" && c("next-click", a));
|
|
55
|
+
}, U = () => v(i.value - 1, "prev"), Z = () => v(i.value + 1, "next"), q = (e) => v(e === "prev" ? i.value - R : i.value + R);
|
|
56
|
+
K(d, (e) => {
|
|
57
|
+
i.value > e && v(e);
|
|
58
|
+
});
|
|
59
|
+
const s = b(!1), T = b(null), D = r(() => t.pageSizes.map((e) => ({ value: e, label: `${e} 条/页` }))), M = r(
|
|
60
|
+
() => D.value.find((e) => e.value === p.value)?.label ?? `${p.value} 条/页`
|
|
61
|
+
), H = () => {
|
|
62
|
+
t.disabled || (s.value = !s.value);
|
|
63
|
+
}, Q = (e) => {
|
|
64
|
+
s.value = !1, e !== p.value && (t.pageSize === void 0 && (B.value = e), c("update:page-size", e), c("size-change", e));
|
|
65
|
+
}, j = (e) => e.key?.toLowerCase() === "enter" || e.code === "Enter", W = (e) => e.key?.toLowerCase() === "escape", X = (e) => {
|
|
66
|
+
if (!t.disabled) {
|
|
67
|
+
if (W(e)) {
|
|
68
|
+
s.value = !1;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
!s.value && (j(e) || e.key === " " || e.key === "ArrowDown") && (e.preventDefault(), s.value = !0);
|
|
72
|
+
}
|
|
73
|
+
}, z = (e) => {
|
|
74
|
+
T.value?.contains(e.target) || (s.value = !1);
|
|
75
|
+
};
|
|
76
|
+
K(s, (e) => {
|
|
77
|
+
e ? document.addEventListener("pointerdown", z) : document.removeEventListener("pointerdown", z);
|
|
78
|
+
}), ne(() => document.removeEventListener("pointerdown", z));
|
|
79
|
+
const m = b(""), I = () => {
|
|
80
|
+
const e = parseInt(m.value, 10);
|
|
81
|
+
m.value = "", !Number.isNaN(e) && v(e);
|
|
82
|
+
}, Y = (e) => {
|
|
83
|
+
j(e) && (e.preventDefault(), I());
|
|
84
|
+
}, g = r(
|
|
85
|
+
() => t.layout.split(",").map((e) => e.trim()).filter(Boolean)
|
|
86
|
+
), V = r(() => L[t.size] || L.middle), ee = r(
|
|
87
|
+
() => ({
|
|
88
|
+
// 高度 / 字号消费全库尺寸变量,未引入 size.css 时回退到组件内常量
|
|
89
|
+
"--pg-h": `var(--g-size-${t.size}-height, ${V.value.height}px)`,
|
|
90
|
+
"--pg-font": `var(--g-size-${t.size}-font-size, ${V.value.font}px)`
|
|
91
|
+
})
|
|
92
|
+
);
|
|
93
|
+
return (e, n) => J.value ? u("", !0) : (o(), l("nav", {
|
|
94
|
+
key: 0,
|
|
95
|
+
class: C(["g-pagination", e.className]),
|
|
96
|
+
style: ie(ee.value),
|
|
97
|
+
"aria-disabled": e.disabled || void 0,
|
|
98
|
+
"aria-label": `Pagination, page ${i.value} of ${d.value}`,
|
|
99
|
+
role: "navigation"
|
|
100
|
+
}, [
|
|
101
|
+
g.value.includes("total") ? (o(), l("span", ge, " 共 " + h(e.total) + " 条 ", 1)) : u("", !0),
|
|
102
|
+
g.value.includes("sizes") ? (o(), l("div", {
|
|
103
|
+
key: 1,
|
|
104
|
+
ref_key: "sizesRef",
|
|
105
|
+
ref: T,
|
|
106
|
+
class: "g-pagination__sizes"
|
|
107
|
+
}, [
|
|
108
|
+
S("button", {
|
|
109
|
+
type: "button",
|
|
110
|
+
class: "g-pagination__cell g-pagination__select",
|
|
111
|
+
disabled: e.disabled,
|
|
112
|
+
"aria-expanded": s.value,
|
|
113
|
+
"aria-haspopup": "listbox",
|
|
114
|
+
"aria-label": `每页条数,当前 ${M.value}`,
|
|
115
|
+
onClick: H,
|
|
116
|
+
onKeydown: X
|
|
117
|
+
}, [
|
|
118
|
+
x(h(M.value) + " ", 1),
|
|
119
|
+
S("span", {
|
|
120
|
+
class: "g-pagination__select-icon",
|
|
121
|
+
"data-open": s.value || void 0
|
|
122
|
+
}, [
|
|
123
|
+
k(w(pe))
|
|
124
|
+
], 8, be)
|
|
125
|
+
], 40, fe),
|
|
126
|
+
k(le, { name: "g-pagination-pop" }, {
|
|
127
|
+
default: oe(() => [
|
|
128
|
+
s.value ? (o(), l("ul", me, [
|
|
129
|
+
(o(!0), l($, null, O(D.value, (a) => (o(), l("li", {
|
|
130
|
+
key: a.value,
|
|
131
|
+
role: "option",
|
|
132
|
+
"aria-selected": a.value === p.value,
|
|
133
|
+
class: C([{ "is-active": a.value === p.value }, "g-pagination__option"]),
|
|
134
|
+
tabindex: "-1",
|
|
135
|
+
onClick: (_) => Q(a.value)
|
|
136
|
+
}, h(a.label), 11, _e))), 128))
|
|
137
|
+
])) : u("", !0)
|
|
138
|
+
]),
|
|
139
|
+
_: 1
|
|
140
|
+
})
|
|
141
|
+
], 512)) : u("", !0),
|
|
142
|
+
g.value.includes("prev") ? (o(), l("button", {
|
|
143
|
+
key: 2,
|
|
144
|
+
type: "button",
|
|
145
|
+
class: "g-pagination__cell",
|
|
146
|
+
disabled: e.disabled || i.value <= 1,
|
|
147
|
+
"aria-label": "上一页",
|
|
148
|
+
onClick: U
|
|
149
|
+
}, [
|
|
150
|
+
k(w(de))
|
|
151
|
+
], 8, he)) : u("", !0),
|
|
152
|
+
g.value.includes("pager") ? (o(!0), l($, { key: 3 }, O(G.value, (a, _) => (o(), l($, {
|
|
153
|
+
key: `${a}-${_}`
|
|
154
|
+
}, [
|
|
155
|
+
typeof a == "number" ? (o(), l("button", {
|
|
156
|
+
key: 0,
|
|
157
|
+
type: "button",
|
|
158
|
+
class: C(["g-pagination__cell g-pagination__pager", { "is-active": a === i.value }]),
|
|
159
|
+
disabled: e.disabled,
|
|
160
|
+
"aria-current": a === i.value ? "page" : void 0,
|
|
161
|
+
"aria-label": `第 ${a} 页`,
|
|
162
|
+
onClick: (ae) => v(a)
|
|
163
|
+
}, h(a), 11, ke)) : (o(), l("button", {
|
|
164
|
+
key: 1,
|
|
165
|
+
type: "button",
|
|
166
|
+
class: "g-pagination__cell g-pagination__ellipsis",
|
|
167
|
+
disabled: e.disabled,
|
|
168
|
+
"aria-label": a === "prev" ? "向前 5 页" : "向后 5 页",
|
|
169
|
+
onClick: (ae) => q(a)
|
|
170
|
+
}, " ••• ", 8, ye))
|
|
171
|
+
], 64))), 128)) : u("", !0),
|
|
172
|
+
g.value.includes("next") ? (o(), l("button", {
|
|
173
|
+
key: 4,
|
|
174
|
+
type: "button",
|
|
175
|
+
class: "g-pagination__cell",
|
|
176
|
+
disabled: e.disabled || i.value >= d.value,
|
|
177
|
+
"aria-label": "下一页",
|
|
178
|
+
onClick: Z
|
|
179
|
+
}, [
|
|
180
|
+
k(w(ce))
|
|
181
|
+
], 8, ze)) : u("", !0),
|
|
182
|
+
g.value.includes("jumper") ? (o(), l("span", Ce, [
|
|
183
|
+
n[1] || (n[1] = x(" 前往 ")),
|
|
184
|
+
se(S("input", {
|
|
185
|
+
"onUpdate:modelValue": n[0] || (n[0] = (a) => m.value = a),
|
|
186
|
+
class: "g-pagination__input",
|
|
187
|
+
type: "text",
|
|
188
|
+
inputmode: "numeric",
|
|
189
|
+
disabled: e.disabled,
|
|
190
|
+
placeholder: String(i.value),
|
|
191
|
+
"aria-label": `跳转到指定页,共 ${d.value} 页`,
|
|
192
|
+
onKeydown: Y,
|
|
193
|
+
onBlur: I
|
|
194
|
+
}, null, 40, Se), [
|
|
195
|
+
[re, m.value]
|
|
196
|
+
]),
|
|
197
|
+
n[2] || (n[2] = x(" 页 "))
|
|
198
|
+
])) : u("", !0)
|
|
199
|
+
], 14, ve));
|
|
200
|
+
}
|
|
201
|
+
}), P = /* @__PURE__ */ ue(xe, [["__scopeId", "data-v-f8c5bc28"]]);
|
|
202
|
+
P.install = (y) => {
|
|
203
|
+
y.component(P.name, P);
|
|
204
|
+
};
|
|
205
|
+
export {
|
|
206
|
+
P as GPagination,
|
|
207
|
+
P as default
|
|
208
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/lib/GTable/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),H=require("../GDropdown/index.js"),U=require("../GPagination/index.js"),D=require("motion-v"),J=require("../GBranched-BtF7heMk.js"),_={viewBox:"0 0 1024 1024",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em"},Q=()=>e.h("svg",_,[e.h("circle",{cx:"384",cy:"256",r:"48"}),e.h("circle",{cx:"640",cy:"256",r:"48"}),e.h("circle",{cx:"384",cy:"512",r:"48"}),e.h("circle",{cx:"640",cy:"512",r:"48"}),e.h("circle",{cx:"384",cy:"768",r:"48"}),e.h("circle",{cx:"640",cy:"768",r:"48"})]),X=()=>e.h("svg",_,[e.h("path",{d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]),Y={class:"g-table"},Z={key:0,class:"g-table-action"},x={class:"g-table-scroll"},ee={class:"g-table-inner"},te={key:0,style:{width:"65px"}},oe={key:0,class:"g-table-th"},re={key:0},ae={key:0,class:"g-table-td"},le={class:"g-table-cell"},ne=["onMousedown"],se=["title"],ie={class:"g-table-cell"},ce={class:"g-dropdown-link"},de=["onClick"],ue={key:0,class:"g-table-empty"},me={key:1},ge=e.defineComponent({name:"GTable",__name:"index",props:{data:{default:()=>[]},columns:{default:()=>[]},rowKey:{},pagination:{type:Boolean,default:!1},operationLabel:{default:"操作"},operaWidth:{default:160},dragSort:{type:Boolean,default:!1},dragSortProps:{default:()=>[]},currentPage:{default:1},pageSize:{default:10},total:{default:0},pageSizes:{default:()=>[10,20,50,100]},layout:{default:"total, sizes, prev, pager, next"},size:{default:"default"}},emits:["update:currentPage","update:pageSize","sorted:data"],setup(k,{expose:$,emit:T}){const s=k,p=T,L=t=>{p("update:pageSize",t)},M=t=>{p("update:currentPage",t)},b=e.useSlots(),v=t=>!!b[t],C=(t,a)=>{const o=b[t];return o?P(o(a)):!1},P=t=>t==null?!1:(Array.isArray(t)?t.flat(1/0):[t]).some(o=>!!o&&typeof o=="object"&&"type"in o&&o.type!==e.Comment),f=e.computed(()=>s.columns??[]),B=(t,a)=>t.key??t.dataIndex??`__col_${a}`,y=e.computed(()=>v("operations")||v("more")),E=t=>typeof t=="number"?t:parseFloat(t)||0,I=t=>{const a=t.width??t.minWidth;if(a!=null)return{width:typeof a=="number"?`${a}px`:a}},A=e.computed(()=>{const t=f.value,a={},o={};let r=0;t.forEach((n,u)=>{n.fixed==="left"&&(a[u]=r);const m=n.width??n.minWidth;m!=null&&(r+=E(m))});let l=y.value?s.operaWidth:0;for(let n=t.length-1;n>=0;n--){const u=t[n];u.fixed==="right"&&(o[n]=l);const m=u.width??u.minWidth;m!=null&&(l+=E(m))}return{left:a,right:o}}),V=t=>t.fixed==="left"?"is-fixed-left":t.fixed==="right"?"is-fixed-right":"",z=(t,a)=>{const{left:o,right:r}=A.value;if(t.fixed==="left"&&o[a]!==void 0)return{position:"sticky",left:`${o[a]}px`};if(t.fixed==="right"&&r[a]!==void 0)return{position:"sticky",right:`${r[a]}px`}},N=t=>({position:"sticky",right:`${t}px`}),h=(t,a,o)=>{if(t.formatter){const l=t.formatter(a,o);return l==null?"":String(l)}if(t.dataIndex==null)return"";const r=a[t.dataIndex];return r==null?"":String(r)},F=t=>{const a=s.pagination?s.pageSize*(s.currentPage-1):0;return t+1+a},W=D.useReducedMotion(),G=e.computed(()=>!!s.dragSort&&!!s.rowKey&&!W.value),q={layout:{duration:.28,ease:[.32,.72,0,1]}},S=e.ref(-1),i=e.ref(-1),d=e.ref(-1),K=(t,a)=>{if(!s.dragSort){a.preventDefault();return}i.value=t,d.value=t,a.dataTransfer?.setData("text/plain",String(t)),a.dataTransfer&&(a.dataTransfer.effectAllowed="move")},O=t=>{i.value!==-1&&(d.value=t)},R=t=>{if(i.value===-1||i.value===t){c();return}w(i.value,t),c()},c=()=>{S.value=-1,i.value=-1,d.value=-1},w=(t,a)=>{if(t===a)return;const o=[...s.data],[r]=o.splice(t,1);r!==void 0&&(o.splice(a,0,r),j(o))},j=t=>{if(s.dragSortProps.length===0){p("sorted:data",t);return}const a=t.map(o=>{const r={};return s.dragSortProps.forEach(l=>{r[l]=o[l]}),r});p("sorted:data",a)};return e.onMounted(()=>{window.addEventListener("mouseup",c)}),e.onBeforeUnmount(()=>{window.removeEventListener("mouseup",c)}),$({reorderData:w}),(t,a)=>(e.openBlock(),e.createElementBlock("div",Y,[t.$slots.action?(e.openBlock(),e.createElementBlock("div",Z,[e.renderSlot(t.$slots,"action",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["g-table-main",`g-table-main--${t.size}`])},[e.createElementVNode("div",x,[e.createElementVNode("table",ee,[e.createElementVNode("colgroup",null,[t.dragSort?(e.openBlock(),e.createElementBlock("col",te)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(o,r)=>(e.openBlock(),e.createElementBlock("col",{key:B(o,r),style:e.normalizeStyle(I(o))},null,4))),128)),y.value?(e.openBlock(),e.createElementBlock("col",{key:1,style:e.normalizeStyle({width:`${t.operaWidth}px`})},null,4)):e.createCommentVNode("",!0)]),e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[t.dragSort?(e.openBlock(),e.createElementBlock("th",oe,"序号")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(o,r)=>(e.openBlock(),e.createElementBlock("th",{key:B(o,r),class:e.normalizeClass(["g-table-th",[`is-align-${o.align||"left"}`,V(o)]]),style:e.normalizeStyle(z(o,r))},[C("headerCell",{column:o,index:r})?e.renderSlot(t.$slots,"headerCell",{key:0,column:o,index:r},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(o.title),1)],64))],6))),128)),y.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"g-table-th is-operations",style:e.normalizeStyle(N(0))},e.toDisplayString(t.operationLabel||"操作"),5)):e.createCommentVNode("",!0)])]),t.data.length?(e.openBlock(),e.createElementBlock("tbody",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(o,r)=>(e.openBlock(),e.createBlock(e.unref(D.motion).tr,{key:t.rowKey?o[t.rowKey]:r,class:e.normalizeClass(["g-table-tr",{"is-dragging":i.value===r,"is-drop-before":d.value===r&&i.value>r,"is-drop-after":d.value===r&&i.value<r&&i.value!==-1}]),layout:G.value,transition:q,draggable:t.dragSort&&S.value===r,onDragstart:l=>K(r,l),onDragover:e.withModifiers(l=>O(r),["prevent"]),onDrop:e.withModifiers(l=>R(r),["prevent"]),onDragend:c},{default:e.withCtx(()=>[t.dragSort?(e.openBlock(),e.createElementBlock("td",ae,[e.createElementVNode("div",le,[e.createTextVNode(e.toDisplayString(F(r))+" ",1),e.createElementVNode("span",{class:"g-drag-icon",title:"拖动排序",onMousedown:l=>S.value=r,onMouseup:c},[e.createVNode(e.unref(Q),{class:"g-drag-icon-svg"})],40,ne)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,n)=>(e.openBlock(),e.createElementBlock("td",{key:B(l,n),class:e.normalizeClass(["g-table-td",[`is-align-${l.align||"left"}`,V(l),{"is-ellipsis":l.ellipsis}]]),style:e.normalizeStyle(z(l,n)),title:l.ellipsis?h(l,o,r):void 0},[C("bodyCell",{column:l,record:o,index:r,text:h(l,o,r)})?e.renderSlot(t.$slots,"bodyCell",{key:0,column:l,record:o,index:r,text:h(l,o,r)},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(h(l,o,r)),1)],64))],14,se))),128)),y.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"g-table-td is-operations",style:e.normalizeStyle(N(0))},[e.createElementVNode("div",ie,[e.renderSlot(t.$slots,"operations",{row:o,index:r},void 0,!0),v("more")?(e.openBlock(),e.createBlock(H.default,{key:0,class:"g-table-more",size:"sm",align:"right",teleported:"","aria-label":"更多操作","surface-color":"var(--el-bg-color-overlay)","highlight-color":"var(--el-color-primary-light-9)","text-color":"var(--el-text-color-primary)","accent-color":"var(--el-color-primary)",radius:6},{trigger:e.withCtx(()=>[e.createElementVNode("span",ce,[a[0]||(a[0]=e.createTextVNode(" 更多 ")),e.createVNode(e.unref(X),{class:"el-icon"})])]),menu:e.withCtx(({close:l})=>[e.createElementVNode("div",{class:"g-table-more-menu",onClick:n=>l()},[e.renderSlot(t.$slots,"more",{row:o,index:r},void 0,!0)],8,de)]),_:2},1024)):e.createCommentVNode("",!0)])],4)):e.createCommentVNode("",!0)]),_:2},1032,["layout","class","draggable","onDragstart","onDragover","onDrop"]))),128))])):e.createCommentVNode("",!0)]),t.data.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ue,[t.$slots.empty?e.renderSlot(t.$slots,"empty",{key:0},void 0,!0):(e.openBlock(),e.createElementBlock("span",me,"暂无数据"))]))])],2),t.pagination?(e.openBlock(),e.createBlock(U.default,{key:1,class:"g-pagination-contianer",size:"small","current-page":t.currentPage,"page-size":t.pageSize,total:t.total,"page-sizes":t.pageSizes,layout:t.layout,onSizeChange:L,onCurrentChange:M},null,8,["current-page","page-size","total","page-sizes","layout"])):e.createCommentVNode("",!0)]))}}),g=J._export_sfc(ge,[["__scopeId","data-v-9feda06a"]]);g.install=k=>{k.component(g.name,g)};exports.GTable=g;exports.default=g;
|