@ctc-front/components-ui-next 0.1.2 → 0.1.4
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/README.md +12 -5
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +32 -19
- package/dist/index.js +140 -116
- package/dist/style-with-element-plus.css +3 -0
- package/dist/style.css +1 -1
- package/package.json +19 -16
package/dist/index.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o, createVNode as s, defineComponent as c, h as l,
|
|
2
|
-
import { ElDialog as
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o, createVNode as s, defineComponent as c, h as l, inject as u, mergeProps as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toDisplayString as y, unref as b, useAttrs as x, useSlots as S, useTemplateRef as C, withCtx as w, withDirectives as T } from "vue";
|
|
2
|
+
import { ElDialog as E, ElDrawer as D, ElIcon as O, ElPagination as k, ElTable as A, ElTableColumn as j, vLoading as M } from "element-plus";
|
|
3
|
+
//#region src/config.ts
|
|
4
|
+
var N = Symbol("CtcComponentsUiConfig");
|
|
5
|
+
function P() {
|
|
6
|
+
return u(N, {});
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
3
9
|
//#region node_modules/.pnpm/@element-plus+icons-vue@2.3.2_vue@3.5.41_typescript@5.8.3_/node_modules/@element-plus/icons-vue/dist/index.js
|
|
4
|
-
var
|
|
10
|
+
var F = /* @__PURE__ */ c({
|
|
5
11
|
name: "Close",
|
|
6
12
|
__name: "close",
|
|
7
13
|
setup(e) {
|
|
8
|
-
return (e, t) => (
|
|
14
|
+
return (e, t) => (h(), i("svg", {
|
|
9
15
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10
16
|
viewBox: "0 0 1024 1024"
|
|
11
17
|
}, [a("path", {
|
|
@@ -13,11 +19,11 @@ var M = /* @__PURE__ */ c({
|
|
|
13
19
|
d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
|
|
14
20
|
})]));
|
|
15
21
|
}
|
|
16
|
-
}),
|
|
22
|
+
}), I = /* @__PURE__ */ c({
|
|
17
23
|
name: "FullScreen",
|
|
18
24
|
__name: "full-screen",
|
|
19
25
|
setup(e) {
|
|
20
|
-
return (e, t) => (
|
|
26
|
+
return (e, t) => (h(), i("svg", {
|
|
21
27
|
xmlns: "http://www.w3.org/2000/svg",
|
|
22
28
|
viewBox: "0 0 1024 1024"
|
|
23
29
|
}, [a("path", {
|
|
@@ -25,11 +31,11 @@ var M = /* @__PURE__ */ c({
|
|
|
25
31
|
d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"
|
|
26
32
|
})]));
|
|
27
33
|
}
|
|
28
|
-
}),
|
|
34
|
+
}), L = /* @__PURE__ */ c({
|
|
29
35
|
name: "Minus",
|
|
30
36
|
__name: "minus",
|
|
31
37
|
setup(e) {
|
|
32
|
-
return (e, t) => (
|
|
38
|
+
return (e, t) => (h(), i("svg", {
|
|
33
39
|
xmlns: "http://www.w3.org/2000/svg",
|
|
34
40
|
viewBox: "0 0 1024 1024"
|
|
35
41
|
}, [a("path", {
|
|
@@ -40,7 +46,7 @@ var M = /* @__PURE__ */ c({
|
|
|
40
46
|
});
|
|
41
47
|
//#endregion
|
|
42
48
|
//#region src/components/dialog/src/useFullscreen.ts
|
|
43
|
-
function
|
|
49
|
+
function R(e, n) {
|
|
44
50
|
let r = t(() => e.fullscreen ?? !1);
|
|
45
51
|
function i() {
|
|
46
52
|
n("update:fullscreen", !r.value);
|
|
@@ -52,11 +58,11 @@ function F(e, n) {
|
|
|
52
58
|
}
|
|
53
59
|
//#endregion
|
|
54
60
|
//#region src/components/dialog/src/useResizable.ts
|
|
55
|
-
function
|
|
61
|
+
function z(e, t, n) {
|
|
56
62
|
return Math.min(Math.max(e, t), n);
|
|
57
63
|
}
|
|
58
|
-
function
|
|
59
|
-
let n =
|
|
64
|
+
function ee(e, t) {
|
|
65
|
+
let n = g(!1), r = g({}), i = () => {};
|
|
60
66
|
function a() {
|
|
61
67
|
i(), i = () => {};
|
|
62
68
|
}
|
|
@@ -67,7 +73,7 @@ function L(e, t) {
|
|
|
67
73
|
o.preventDefault(), a();
|
|
68
74
|
let c = s.getBoundingClientRect(), l = e.minWidth ?? 400, u = e.minHeight ?? 240, d = Math.max(l, window.innerWidth - c.left - 32), f = Math.max(u, window.innerHeight - c.top - 32), p = o.clientX, m = o.clientY;
|
|
69
75
|
function h(e) {
|
|
70
|
-
let i = Math.round(
|
|
76
|
+
let i = Math.round(z(c.width + e.clientX - p, l, d)), a = Math.round(z(c.height + e.clientY - m, u, f));
|
|
71
77
|
n.value = !0, r.value = {
|
|
72
78
|
height: `${a}px`,
|
|
73
79
|
width: `${i}px`
|
|
@@ -83,7 +89,7 @@ function L(e, t) {
|
|
|
83
89
|
window.removeEventListener("pointermove", h), window.removeEventListener("pointerup", g);
|
|
84
90
|
};
|
|
85
91
|
}
|
|
86
|
-
return
|
|
92
|
+
return m(a), {
|
|
87
93
|
isResized: n,
|
|
88
94
|
resizeStyle: r,
|
|
89
95
|
startResize: o
|
|
@@ -91,7 +97,7 @@ function L(e, t) {
|
|
|
91
97
|
}
|
|
92
98
|
//#endregion
|
|
93
99
|
//#region src/components/dialog/src/index.vue?vue&type=script&setup=true&lang.ts
|
|
94
|
-
var
|
|
100
|
+
var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__title" }, ne = { class: "ctc-dialog__header-actions" }, re = ["aria-label", "title"], ie = { class: "ctc-dialog__content" }, V = /* @__PURE__ */ c({
|
|
95
101
|
name: "CtcDialog",
|
|
96
102
|
inheritAttrs: !1,
|
|
97
103
|
__name: "index",
|
|
@@ -138,7 +144,10 @@ var R = { class: "ctc-dialog__header-content" }, z = { class: "ctc-dialog__title
|
|
|
138
144
|
default: void 0
|
|
139
145
|
},
|
|
140
146
|
closeDelay: Number,
|
|
141
|
-
closeOnClickModal:
|
|
147
|
+
closeOnClickModal: {
|
|
148
|
+
type: Boolean,
|
|
149
|
+
default: void 0
|
|
150
|
+
},
|
|
142
151
|
closeOnPressEscape: Boolean,
|
|
143
152
|
contentFill: {
|
|
144
153
|
type: Boolean,
|
|
@@ -179,35 +188,35 @@ var R = { class: "ctc-dialog__header-content" }, z = { class: "ctc-dialog__title
|
|
|
179
188
|
"closed"
|
|
180
189
|
],
|
|
181
190
|
setup(e, { emit: c }) {
|
|
182
|
-
let l = e,
|
|
183
|
-
function
|
|
184
|
-
|
|
191
|
+
let l = e, u = c, f = x(), p = S(), m = P(), { isFullscreen: g, toggleFullscreen: _ } = R(l, u), { isResized: C, resizeStyle: T, startResize: D } = ee(l, u), k = t(() => g.value ? {} : T.value), A = t(() => C.value && !g.value), j = t(() => l.closeOnClickModal ?? m.dialog?.closeOnClickModal ?? !1);
|
|
192
|
+
function M(e) {
|
|
193
|
+
u("update:modelValue", e);
|
|
185
194
|
}
|
|
186
|
-
function
|
|
195
|
+
function N() {
|
|
187
196
|
if (l.beforeClose) {
|
|
188
197
|
l.beforeClose((e) => {
|
|
189
|
-
e ||
|
|
198
|
+
e || u("update:modelValue", !1);
|
|
190
199
|
});
|
|
191
200
|
return;
|
|
192
201
|
}
|
|
193
|
-
|
|
202
|
+
u("update:modelValue", !1);
|
|
194
203
|
}
|
|
195
|
-
return (t, c) => (
|
|
204
|
+
return (t, c) => (h(), n(b(E), d(b(f), {
|
|
196
205
|
class: ["ctc-dialog", {
|
|
197
206
|
"ctc-dialog--content-fill": e.contentFill,
|
|
198
207
|
"ctc-dialog--resizable": e.resizable,
|
|
199
|
-
"ctc-dialog--resized":
|
|
208
|
+
"ctc-dialog--resized": A.value
|
|
200
209
|
}],
|
|
201
|
-
style:
|
|
210
|
+
style: k.value,
|
|
202
211
|
"model-value": e.modelValue,
|
|
203
|
-
fullscreen:
|
|
212
|
+
fullscreen: b(g),
|
|
204
213
|
title: e.title,
|
|
205
214
|
width: e.width,
|
|
206
215
|
"align-center": e.alignCenter,
|
|
207
216
|
"append-to": e.appendTo,
|
|
208
217
|
"before-close": e.beforeClose,
|
|
209
218
|
"close-delay": e.closeDelay,
|
|
210
|
-
"close-on-click-modal":
|
|
219
|
+
"close-on-click-modal": j.value,
|
|
211
220
|
"close-on-press-escape": e.closeOnPressEscape,
|
|
212
221
|
"destroy-on-close": e.destroyOnClose,
|
|
213
222
|
draggable: e.draggable,
|
|
@@ -223,46 +232,46 @@ var R = { class: "ctc-dialog__header-content" }, z = { class: "ctc-dialog__title
|
|
|
223
232
|
"header-class": "ctc-dialog__header",
|
|
224
233
|
"body-class": "ctc-dialog__body",
|
|
225
234
|
"footer-class": "ctc-dialog__footer",
|
|
226
|
-
"onUpdate:modelValue":
|
|
227
|
-
onOpen: c[2] ||= (e) =>
|
|
228
|
-
onOpened: c[3] ||= (e) =>
|
|
229
|
-
onClose: c[4] ||= (e) =>
|
|
230
|
-
onClosed: c[5] ||= (e) =>
|
|
235
|
+
"onUpdate:modelValue": M,
|
|
236
|
+
onOpen: c[2] ||= (e) => u("open"),
|
|
237
|
+
onOpened: c[3] ||= (e) => u("opened"),
|
|
238
|
+
onClose: c[4] ||= (e) => u("close"),
|
|
239
|
+
onClosed: c[5] ||= (e) => u("closed")
|
|
231
240
|
}), o({
|
|
232
|
-
header:
|
|
241
|
+
header: w(() => [a("div", B, [v(t.$slots, "header", {}, () => [a("span", te, y(e.title), 1)])]), a("div", ne, [e.showFullscreen ? (h(), i("button", {
|
|
233
242
|
key: 0,
|
|
234
243
|
class: "ctc-dialog__fullscreen-toggle",
|
|
235
244
|
type: "button",
|
|
236
|
-
"aria-label":
|
|
237
|
-
title:
|
|
245
|
+
"aria-label": b(g) ? "退出全屏" : "全屏显示",
|
|
246
|
+
title: b(g) ? "退出全屏" : "全屏显示",
|
|
238
247
|
"data-ctc-fullscreen-toggle": "",
|
|
239
|
-
onClick: c[0] ||= (...e) =>
|
|
240
|
-
}, [s(
|
|
241
|
-
default:
|
|
248
|
+
onClick: c[0] ||= (...e) => b(_) && b(_)(...e)
|
|
249
|
+
}, [s(b(O), { "aria-hidden": "true" }, {
|
|
250
|
+
default: w(() => [b(g) ? (h(), n(b(L), { key: 0 })) : (h(), n(b(I), { key: 1 }))]),
|
|
242
251
|
_: 1
|
|
243
|
-
})], 8,
|
|
252
|
+
})], 8, re)) : r("", !0), e.showClose ? (h(), i("button", {
|
|
244
253
|
key: 1,
|
|
245
254
|
class: "ctc-dialog__close",
|
|
246
255
|
type: "button",
|
|
247
256
|
"aria-label": "关闭弹窗",
|
|
248
257
|
title: "关闭",
|
|
249
258
|
"data-ctc-close": "",
|
|
250
|
-
onClick:
|
|
251
|
-
}, [s(
|
|
252
|
-
default:
|
|
259
|
+
onClick: N
|
|
260
|
+
}, [s(b(O), { "aria-hidden": "true" }, {
|
|
261
|
+
default: w(() => [s(b(F))]),
|
|
253
262
|
_: 1
|
|
254
263
|
})])) : r("", !0)])]),
|
|
255
|
-
default:
|
|
264
|
+
default: w(() => [a("div", ie, [v(t.$slots, "default")]), e.resizable && !b(g) ? (h(), i("div", {
|
|
256
265
|
key: 0,
|
|
257
266
|
class: "ctc-dialog__resize-handle",
|
|
258
267
|
"aria-hidden": "true",
|
|
259
268
|
"data-ctc-resize-handle": "",
|
|
260
|
-
onPointerdown: c[1] ||= (...e) =>
|
|
269
|
+
onPointerdown: c[1] ||= (...e) => b(D) && b(D)(...e)
|
|
261
270
|
}, null, 32)) : r("", !0)]),
|
|
262
271
|
_: 2
|
|
263
|
-
}, [
|
|
272
|
+
}, [b(p).footer ? {
|
|
264
273
|
name: "footer",
|
|
265
|
-
fn:
|
|
274
|
+
fn: w(() => [v(t.$slots, "footer")]),
|
|
266
275
|
key: "0"
|
|
267
276
|
} : void 0]), 1040, [
|
|
268
277
|
"class",
|
|
@@ -289,10 +298,10 @@ var R = { class: "ctc-dialog__header-content" }, z = { class: "ctc-dialog__title
|
|
|
289
298
|
"z-index"
|
|
290
299
|
]));
|
|
291
300
|
}
|
|
292
|
-
}),
|
|
301
|
+
}), ae = { class: "ctc-drawer__header-content" }, oe = { class: "ctc-drawer__title" }, H = { class: "ctc-drawer__header-actions" }, U = ["aria-label", "title"], W = { class: "ctc-drawer__content" }, G = {
|
|
293
302
|
key: 0,
|
|
294
303
|
class: "ctc-drawer__footer"
|
|
295
|
-
},
|
|
304
|
+
}, K = /* @__PURE__ */ c({
|
|
296
305
|
name: "CtcDrawer",
|
|
297
306
|
inheritAttrs: !1,
|
|
298
307
|
__name: "index",
|
|
@@ -360,8 +369,8 @@ var R = { class: "ctc-dialog__header-content" }, z = { class: "ctc-dialog__title
|
|
|
360
369
|
"closed"
|
|
361
370
|
],
|
|
362
371
|
setup(e, { emit: o }) {
|
|
363
|
-
let c = e, l = o,
|
|
364
|
-
function
|
|
372
|
+
let c = e, l = o, u = x(), p = S(), { isFullscreen: m, toggleFullscreen: g } = R(c, l), _ = t(() => m.value ? "100%" : c.size);
|
|
373
|
+
function C(e) {
|
|
365
374
|
l("update:modelValue", e);
|
|
366
375
|
}
|
|
367
376
|
function T() {
|
|
@@ -373,8 +382,8 @@ var R = { class: "ctc-dialog__header-content" }, z = { class: "ctc-dialog__title
|
|
|
373
382
|
}
|
|
374
383
|
l("update:modelValue", !1);
|
|
375
384
|
}
|
|
376
|
-
return (t, o) => (
|
|
377
|
-
class: ["ctc-drawer", { "is-fullscreen":
|
|
385
|
+
return (t, o) => (h(), n(b(D), d(b(u), {
|
|
386
|
+
class: ["ctc-drawer", { "is-fullscreen": b(m) }],
|
|
378
387
|
"model-value": e.modelValue,
|
|
379
388
|
"append-to": e.appendTo,
|
|
380
389
|
"before-close": e.beforeClose,
|
|
@@ -386,28 +395,28 @@ var R = { class: "ctc-dialog__header-content" }, z = { class: "ctc-dialog__title
|
|
|
386
395
|
modal: e.modal,
|
|
387
396
|
"modal-class": e.modalClass,
|
|
388
397
|
"show-close": !1,
|
|
389
|
-
size:
|
|
398
|
+
size: _.value,
|
|
390
399
|
"z-index": e.zIndex,
|
|
391
400
|
"header-class": "ctc-drawer__header",
|
|
392
401
|
"body-class": "ctc-drawer__body",
|
|
393
|
-
"onUpdate:modelValue":
|
|
402
|
+
"onUpdate:modelValue": C,
|
|
394
403
|
onOpen: o[1] ||= (e) => l("open"),
|
|
395
404
|
onOpened: o[2] ||= (e) => l("opened"),
|
|
396
405
|
onClose: o[3] ||= (e) => l("close"),
|
|
397
406
|
onClosed: o[4] ||= (e) => l("closed")
|
|
398
407
|
}), {
|
|
399
|
-
header:
|
|
408
|
+
header: w(() => [a("div", ae, [v(t.$slots, "header", {}, () => [a("span", oe, y(e.title), 1)])]), a("div", H, [e.showFullscreen ? (h(), i("button", {
|
|
400
409
|
key: 0,
|
|
401
410
|
class: "ctc-drawer__fullscreen-toggle",
|
|
402
411
|
type: "button",
|
|
403
|
-
"aria-label":
|
|
404
|
-
title:
|
|
412
|
+
"aria-label": b(m) ? "退出全屏" : "全屏显示",
|
|
413
|
+
title: b(m) ? "退出全屏" : "全屏显示",
|
|
405
414
|
"data-ctc-fullscreen-toggle": "",
|
|
406
|
-
onClick: o[0] ||= (...e) =>
|
|
407
|
-
}, [s(
|
|
408
|
-
default:
|
|
415
|
+
onClick: o[0] ||= (...e) => b(g) && b(g)(...e)
|
|
416
|
+
}, [s(b(O), { "aria-hidden": "true" }, {
|
|
417
|
+
default: w(() => [b(m) ? (h(), n(b(L), { key: 0 })) : (h(), n(b(I), { key: 1 }))]),
|
|
409
418
|
_: 1
|
|
410
|
-
})], 8,
|
|
419
|
+
})], 8, U)) : r("", !0), e.showClose ? (h(), i("button", {
|
|
411
420
|
key: 1,
|
|
412
421
|
class: "ctc-drawer__close",
|
|
413
422
|
type: "button",
|
|
@@ -415,11 +424,11 @@ var R = { class: "ctc-dialog__header-content" }, z = { class: "ctc-dialog__title
|
|
|
415
424
|
title: "关闭",
|
|
416
425
|
"data-ctc-close": "",
|
|
417
426
|
onClick: T
|
|
418
|
-
}, [s(
|
|
419
|
-
default:
|
|
427
|
+
}, [s(b(O), { "aria-hidden": "true" }, {
|
|
428
|
+
default: w(() => [s(b(F))]),
|
|
420
429
|
_: 1
|
|
421
430
|
})])) : r("", !0)])]),
|
|
422
|
-
default:
|
|
431
|
+
default: w(() => [a("div", { class: f(["ctc-drawer__layout", { "has-footer": b(p).footer }]) }, [a("div", W, [v(t.$slots, "default")]), b(p).footer ? (h(), i("div", G, [v(t.$slots, "footer")])) : r("", !0)], 2)]),
|
|
423
432
|
_: 3
|
|
424
433
|
}, 16, [
|
|
425
434
|
"class",
|
|
@@ -437,7 +446,7 @@ var R = { class: "ctc-dialog__header-content" }, z = { class: "ctc-dialog__title
|
|
|
437
446
|
"z-index"
|
|
438
447
|
]));
|
|
439
448
|
}
|
|
440
|
-
}),
|
|
449
|
+
}), q = /* @__PURE__ */ c({
|
|
441
450
|
name: "CtcFlex",
|
|
442
451
|
__name: "index",
|
|
443
452
|
props: {
|
|
@@ -464,16 +473,16 @@ var R = { class: "ctc-dialog__header-content" }, z = { class: "ctc-dialog__title
|
|
|
464
473
|
};
|
|
465
474
|
return n.gap !== 0 && n.gap !== "" && (e.gap = typeof n.gap == "number" ? `${n.gap}px` : n.gap), n.fill && (e.flex = n.grow), n.direction === "column" ? e.minHeight = "0" : e.minWidth = "0", n.scroll === "x" ? (e.overflowX = "auto", e.overflowY = "hidden") : n.scroll === "y" ? (e.overflowX = "hidden", e.overflowY = "auto") : n.scroll && (e.overflow = "auto"), e;
|
|
466
475
|
});
|
|
467
|
-
return (e, t) => (
|
|
476
|
+
return (e, t) => (h(), i("div", {
|
|
468
477
|
class: "ctc-flex",
|
|
469
|
-
style:
|
|
470
|
-
}, [
|
|
478
|
+
style: p(r.value)
|
|
479
|
+
}, [v(e.$slots, "default")], 4));
|
|
471
480
|
}
|
|
472
|
-
}),
|
|
481
|
+
}), se = /* @__PURE__ */ new Set([
|
|
473
482
|
"selection",
|
|
474
483
|
"index",
|
|
475
484
|
"expand"
|
|
476
|
-
]),
|
|
485
|
+
]), J = /* @__PURE__ */ new Map(), Y = c({
|
|
477
486
|
name: "CtcTableColumn",
|
|
478
487
|
props: {
|
|
479
488
|
column: {
|
|
@@ -487,7 +496,9 @@ var R = { class: "ctc-dialog__header-content" }, z = { class: "ctc-dialog__title
|
|
|
487
496
|
},
|
|
488
497
|
setup(e) {
|
|
489
498
|
let t = (e) => e.slot ?? e.prop, n = (e, t) => {
|
|
490
|
-
if (t) return
|
|
499
|
+
if (!t) return;
|
|
500
|
+
let n = J.get(t);
|
|
501
|
+
return n || (n = t.replace(/\[(?:'([^']*)'|"([^"]*)"|([^\]]+))\]/g, ".$1$2$3").split(".").filter(Boolean), J.set(t, n)), n.reduce((e, t) => {
|
|
491
502
|
if (!(typeof e != "object" || !e)) return e[t];
|
|
492
503
|
}, e);
|
|
493
504
|
}, r = (r, i) => {
|
|
@@ -508,8 +519,8 @@ var R = { class: "ctc-dialog__header-content" }, z = { class: "ctc-dialog__title
|
|
|
508
519
|
config: t
|
|
509
520
|
}) : t.renderHeader?.(n);
|
|
510
521
|
}, a = (t) => {
|
|
511
|
-
let { children: n, slot: o, headerSlot: s, renderCell: c, renderHeader: u, formatter: d, ...f } = t, p = !!n?.length, m = o ?? t.prop, h = !!(m && e.slots[m] || c || d), g = !!(s && e.slots[s] || u), _ = t.type ?
|
|
512
|
-
return l(
|
|
522
|
+
let { children: n, slot: o, headerSlot: s, renderCell: c, renderHeader: u, formatter: d, ...f } = t, p = !!n?.length, m = o ?? t.prop, h = !!(m && e.slots[m] || c || d), g = !!(s && e.slots[s] || u), _ = t.type ? se.has(t.type) : !1;
|
|
523
|
+
return l(j, f, {
|
|
513
524
|
default: p ? () => n?.map(a) : h && !_ ? (e) => r(t, e) : void 0,
|
|
514
525
|
header: g ? (e) => i(t, e) : void 0
|
|
515
526
|
});
|
|
@@ -527,7 +538,7 @@ function X(e, t) {
|
|
|
527
538
|
function Z(e, t, n) {
|
|
528
539
|
return n.every((n) => Object.is(X(e, n), X(t, n)));
|
|
529
540
|
}
|
|
530
|
-
function
|
|
541
|
+
function ce(e, t) {
|
|
531
542
|
let n = new Map(t.filter((e) => e.prop && e.by.length > 0).map((e) => [e.prop, e]));
|
|
532
543
|
return ({ column: t, rowIndex: r }) => {
|
|
533
544
|
if (t.type === "selection" || t.type === "index" || t.type === "expand") return;
|
|
@@ -549,7 +560,7 @@ function ie(e, t) {
|
|
|
549
560
|
}
|
|
550
561
|
//#endregion
|
|
551
562
|
//#region src/components/table/src/index.vue?vue&type=script&setup=true&lang.ts
|
|
552
|
-
var
|
|
563
|
+
var le = {
|
|
553
564
|
key: 0,
|
|
554
565
|
class: "ctc-table__pagination"
|
|
555
566
|
}, Q = /* @__PURE__ */ c({
|
|
@@ -570,7 +581,7 @@ var ae = {
|
|
|
570
581
|
default: !1
|
|
571
582
|
},
|
|
572
583
|
merge: { default: () => [] },
|
|
573
|
-
pageSize: {
|
|
584
|
+
pageSize: {},
|
|
574
585
|
pagination: {
|
|
575
586
|
type: Boolean,
|
|
576
587
|
default: !1
|
|
@@ -588,56 +599,69 @@ var ae = {
|
|
|
588
599
|
"next-click"
|
|
589
600
|
],
|
|
590
601
|
setup(a, { expose: c, emit: l }) {
|
|
591
|
-
let
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
602
|
+
let u = a, p = l, m = x(), g = S(), y = P(), E = C("tableRef"), D = /* @__PURE__ */ new Set(/* @__PURE__ */ "currentPage.pageSize.total.layout.pageSizes.pagerCount.background.disabled.hideOnSinglePage.small.prevText.nextText.prevIcon.nextIcon.popperClass.popperStyle.teleported.appendSizeTo.pageCount.defaultCurrentPage.defaultPageSize.onUpdate:currentPage.onUpdate:pageSize.onCurrentChange.onSizeChange.onPrevClick.onNextClick".split(".")), O = t(() => {
|
|
603
|
+
let e = Object.fromEntries(Object.entries(m).filter(([e]) => !D.has(e) && e !== "height" && e !== "spanMethod")), t = {};
|
|
604
|
+
return !("border" in m) && y.table?.border !== void 0 && (t.border = y.table.border), !("stripe" in m) && y.table?.stripe !== void 0 && (t.stripe = y.table.stripe), {
|
|
605
|
+
...t,
|
|
606
|
+
...e
|
|
607
|
+
};
|
|
608
|
+
}), j = t(() => u.pageSize ?? y.table?.pageSize ?? 10), N = t(() => ({
|
|
609
|
+
...y.table?.paginationProps,
|
|
610
|
+
...u.paginationProps
|
|
611
|
+
})), F = t(() => {
|
|
612
|
+
if (typeof u.height == "string" || typeof u.height == "number") return u.height;
|
|
613
|
+
}), I = t(() => u.autoHeight && F.value === void 0), L = t(() => F.value ?? (I.value ? "100%" : void 0)), R = t(() => {
|
|
614
|
+
if (typeof m.spanMethod == "function") return m.spanMethod;
|
|
615
|
+
if (u.merge.length !== 0) return ce(u.data, u.merge);
|
|
596
616
|
});
|
|
597
|
-
function
|
|
617
|
+
function z(e, t) {
|
|
598
618
|
p("current-change", e, t);
|
|
599
619
|
}
|
|
600
620
|
return c({
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
621
|
+
elTableRef: E,
|
|
622
|
+
clearSelection: () => E.value?.clearSelection(),
|
|
623
|
+
toggleRowSelection: (e, t) => E.value?.toggleRowSelection(e, t),
|
|
624
|
+
toggleAllSelection: () => E.value?.toggleAllSelection(),
|
|
625
|
+
toggleRowExpansion: (e, t) => E.value?.toggleRowExpansion(e, t),
|
|
626
|
+
setCurrentRow: (e) => E.value?.setCurrentRow(e),
|
|
627
|
+
clearSort: () => E.value?.clearSort(),
|
|
628
|
+
clearFilter: (e) => E.value?.clearFilter(e),
|
|
629
|
+
doLayout: () => E.value?.doLayout(),
|
|
630
|
+
sort: (e, t) => E.value?.sort(e, t),
|
|
631
|
+
scrollTo: (e, t) => E.value?.scrollTo(e, t),
|
|
632
|
+
setScrollTop: (e) => E.value?.setScrollTop(e),
|
|
633
|
+
setScrollLeft: (e) => E.value?.setScrollLeft(e)
|
|
634
|
+
}), (t, a) => (h(), i("div", { class: f(["ctc-table", { "ctc-table--auto-height": I.value }]) }, [T((h(), n(b(A), d({
|
|
611
635
|
ref_key: "tableRef",
|
|
612
|
-
ref:
|
|
613
|
-
},
|
|
614
|
-
data:
|
|
615
|
-
height:
|
|
616
|
-
"span-method":
|
|
617
|
-
onCurrentChange:
|
|
636
|
+
ref: E
|
|
637
|
+
}, O.value, {
|
|
638
|
+
data: u.data,
|
|
639
|
+
height: L.value,
|
|
640
|
+
"span-method": R.value,
|
|
641
|
+
onCurrentChange: z
|
|
618
642
|
}), o({
|
|
619
|
-
default:
|
|
643
|
+
default: w(() => [(h(!0), i(e, null, _(u.columns, (e, t) => (h(), n(Y, {
|
|
620
644
|
key: e.prop ?? e.property ?? e.label ?? t,
|
|
621
645
|
column: e,
|
|
622
|
-
slots:
|
|
646
|
+
slots: b(g)
|
|
623
647
|
}, null, 8, ["column", "slots"]))), 128))]),
|
|
624
648
|
_: 2
|
|
625
|
-
}, [
|
|
649
|
+
}, [b(g).empty ? {
|
|
626
650
|
name: "empty",
|
|
627
|
-
fn:
|
|
651
|
+
fn: w(() => [v(t.$slots, "empty")]),
|
|
628
652
|
key: "0"
|
|
629
|
-
} : void 0,
|
|
653
|
+
} : void 0, b(g).append ? {
|
|
630
654
|
name: "append",
|
|
631
|
-
fn:
|
|
655
|
+
fn: w(() => [v(t.$slots, "append")]),
|
|
632
656
|
key: "1"
|
|
633
657
|
} : void 0]), 1040, [
|
|
634
658
|
"data",
|
|
635
659
|
"height",
|
|
636
660
|
"span-method"
|
|
637
|
-
])), [[
|
|
638
|
-
"current-page":
|
|
639
|
-
"page-size":
|
|
640
|
-
total:
|
|
661
|
+
])), [[b(M), u.loading]]), u.pagination ? (h(), i("div", le, [s(b(k), d(N.value, {
|
|
662
|
+
"current-page": u.currentPage,
|
|
663
|
+
"page-size": j.value,
|
|
664
|
+
total: u.total,
|
|
641
665
|
"onUpdate:currentPage": a[0] ||= (e) => p("update:currentPage", e),
|
|
642
666
|
"onUpdate:pageSize": a[1] ||= (e) => p("update:pageSize", e),
|
|
643
667
|
onCurrentChange: a[2] ||= (e) => p("page-change", e),
|
|
@@ -648,17 +672,17 @@ var ae = {
|
|
|
648
672
|
"current-page",
|
|
649
673
|
"page-size",
|
|
650
674
|
"total"
|
|
651
|
-
]),
|
|
675
|
+
]), v(t.$slots, "pagination")])) : r("", !0)], 2));
|
|
652
676
|
}
|
|
653
|
-
}),
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
677
|
+
}), ue = [
|
|
678
|
+
V,
|
|
679
|
+
K,
|
|
680
|
+
q,
|
|
657
681
|
Q
|
|
658
|
-
], $ = { install(e) {
|
|
659
|
-
|
|
682
|
+
], $ = { install(e, t = {}) {
|
|
683
|
+
e.provide(N, t), ue.forEach((t) => {
|
|
660
684
|
e.component(t.name ?? "", t);
|
|
661
685
|
});
|
|
662
686
|
} };
|
|
663
687
|
//#endregion
|
|
664
|
-
export { $ as CtcComponentsUi, $ as default,
|
|
688
|
+
export { $ as CtcComponentsUi, $ as default, V as CtcDialog, K as CtcDrawer, q as CtcFlex, Q as CtcTable };
|