@ctc-front/components-ui-next 0.1.4 → 0.2.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/README.md +38 -7
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +60 -0
- package/dist/index.js +340 -129
- package/dist/style-with-element-plus.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +8 -5
package/dist/index.js
CHANGED
|
@@ -1,17 +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,
|
|
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, guardReactiveProps as l, h as u, inject as d, mergeProps as f, normalizeClass as p, normalizeProps as m, normalizeStyle as h, onBeforeUnmount as g, openBlock as _, ref as v, renderList as y, renderSlot as b, toDisplayString as x, unref as S, useAttrs as C, useSlots as w, useTemplateRef as T, withCtx as E, withDirectives as D } from "vue";
|
|
2
|
+
import { ElDialog as O, ElDrawer as k, ElIcon as A, ElPagination as j, ElTable as M, ElTableColumn as N, vLoading as P } from "element-plus";
|
|
3
3
|
//#region src/config.ts
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
return
|
|
4
|
+
var F = Symbol("CtcComponentsUiConfig");
|
|
5
|
+
function I() {
|
|
6
|
+
return d(F, {});
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
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
|
|
10
|
-
var
|
|
10
|
+
var L = /* @__PURE__ */ c({
|
|
11
11
|
name: "Close",
|
|
12
12
|
__name: "close",
|
|
13
13
|
setup(e) {
|
|
14
|
-
return (e, t) => (
|
|
14
|
+
return (e, t) => (_(), i("svg", {
|
|
15
15
|
xmlns: "http://www.w3.org/2000/svg",
|
|
16
16
|
viewBox: "0 0 1024 1024"
|
|
17
17
|
}, [a("path", {
|
|
@@ -19,11 +19,11 @@ var F = /* @__PURE__ */ c({
|
|
|
19
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"
|
|
20
20
|
})]));
|
|
21
21
|
}
|
|
22
|
-
}),
|
|
22
|
+
}), R = /* @__PURE__ */ c({
|
|
23
23
|
name: "FullScreen",
|
|
24
24
|
__name: "full-screen",
|
|
25
25
|
setup(e) {
|
|
26
|
-
return (e, t) => (
|
|
26
|
+
return (e, t) => (_(), i("svg", {
|
|
27
27
|
xmlns: "http://www.w3.org/2000/svg",
|
|
28
28
|
viewBox: "0 0 1024 1024"
|
|
29
29
|
}, [a("path", {
|
|
@@ -31,11 +31,11 @@ var F = /* @__PURE__ */ c({
|
|
|
31
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"
|
|
32
32
|
})]));
|
|
33
33
|
}
|
|
34
|
-
}),
|
|
34
|
+
}), z = /* @__PURE__ */ c({
|
|
35
35
|
name: "Minus",
|
|
36
36
|
__name: "minus",
|
|
37
37
|
setup(e) {
|
|
38
|
-
return (e, t) => (
|
|
38
|
+
return (e, t) => (_(), i("svg", {
|
|
39
39
|
xmlns: "http://www.w3.org/2000/svg",
|
|
40
40
|
viewBox: "0 0 1024 1024"
|
|
41
41
|
}, [a("path", {
|
|
@@ -45,8 +45,8 @@ var F = /* @__PURE__ */ c({
|
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
//#endregion
|
|
48
|
-
//#region src/
|
|
49
|
-
function
|
|
48
|
+
//#region src/composables/useFullscreen.ts
|
|
49
|
+
function B(e, n) {
|
|
50
50
|
let r = t(() => e.fullscreen ?? !1);
|
|
51
51
|
function i() {
|
|
52
52
|
n("update:fullscreen", !r.value);
|
|
@@ -58,11 +58,11 @@ function R(e, n) {
|
|
|
58
58
|
}
|
|
59
59
|
//#endregion
|
|
60
60
|
//#region src/components/dialog/src/useResizable.ts
|
|
61
|
-
function
|
|
61
|
+
function V(e, t, n) {
|
|
62
62
|
return Math.min(Math.max(e, t), n);
|
|
63
63
|
}
|
|
64
64
|
function ee(e, t) {
|
|
65
|
-
let n =
|
|
65
|
+
let n = v(!1), r = v({}), i = () => {};
|
|
66
66
|
function a() {
|
|
67
67
|
i(), i = () => {};
|
|
68
68
|
}
|
|
@@ -73,7 +73,7 @@ function ee(e, t) {
|
|
|
73
73
|
o.preventDefault(), a();
|
|
74
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;
|
|
75
75
|
function h(e) {
|
|
76
|
-
let i = Math.round(
|
|
76
|
+
let i = Math.round(V(c.width + e.clientX - p, l, d)), a = Math.round(V(c.height + e.clientY - m, u, f));
|
|
77
77
|
n.value = !0, r.value = {
|
|
78
78
|
height: `${a}px`,
|
|
79
79
|
width: `${i}px`
|
|
@@ -89,7 +89,7 @@ function ee(e, t) {
|
|
|
89
89
|
window.removeEventListener("pointermove", h), window.removeEventListener("pointerup", g);
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
return
|
|
92
|
+
return g(a), {
|
|
93
93
|
isResized: n,
|
|
94
94
|
resizeStyle: r,
|
|
95
95
|
startResize: o
|
|
@@ -97,7 +97,7 @@ function ee(e, t) {
|
|
|
97
97
|
}
|
|
98
98
|
//#endregion
|
|
99
99
|
//#region src/components/dialog/src/index.vue?vue&type=script&setup=true&lang.ts
|
|
100
|
-
var
|
|
100
|
+
var te = { class: "ctc-dialog__header-content" }, ne = { class: "ctc-dialog__title" }, re = { class: "ctc-dialog__header-actions" }, ie = ["aria-label", "title"], ae = { class: "ctc-dialog__content" }, H = /* @__PURE__ */ c({
|
|
101
101
|
name: "CtcDialog",
|
|
102
102
|
inheritAttrs: !1,
|
|
103
103
|
__name: "index",
|
|
@@ -188,7 +188,7 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
188
188
|
"closed"
|
|
189
189
|
],
|
|
190
190
|
setup(e, { emit: c }) {
|
|
191
|
-
let l = e, u = c,
|
|
191
|
+
let l = e, u = c, d = C(), p = w(), m = I(), { isFullscreen: h, toggleFullscreen: g } = B(l, u), { isResized: v, resizeStyle: y, startResize: T } = ee(l, u), D = t(() => h.value ? {} : y.value), k = t(() => v.value && !h.value), j = t(() => l.closeOnClickModal ?? m.dialog?.closeOnClickModal ?? !1);
|
|
192
192
|
function M(e) {
|
|
193
193
|
u("update:modelValue", e);
|
|
194
194
|
}
|
|
@@ -201,15 +201,15 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
201
201
|
}
|
|
202
202
|
u("update:modelValue", !1);
|
|
203
203
|
}
|
|
204
|
-
return (t, c) => (
|
|
204
|
+
return (t, c) => (_(), n(S(O), f(S(d), {
|
|
205
205
|
class: ["ctc-dialog", {
|
|
206
206
|
"ctc-dialog--content-fill": e.contentFill,
|
|
207
207
|
"ctc-dialog--resizable": e.resizable,
|
|
208
|
-
"ctc-dialog--resized":
|
|
208
|
+
"ctc-dialog--resized": k.value
|
|
209
209
|
}],
|
|
210
|
-
style:
|
|
210
|
+
style: D.value,
|
|
211
211
|
"model-value": e.modelValue,
|
|
212
|
-
fullscreen:
|
|
212
|
+
fullscreen: S(h),
|
|
213
213
|
title: e.title,
|
|
214
214
|
width: e.width,
|
|
215
215
|
"align-center": e.alignCenter,
|
|
@@ -238,18 +238,18 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
238
238
|
onClose: c[4] ||= (e) => u("close"),
|
|
239
239
|
onClosed: c[5] ||= (e) => u("closed")
|
|
240
240
|
}), o({
|
|
241
|
-
header:
|
|
241
|
+
header: E(() => [a("div", te, [b(t.$slots, "header", {}, () => [a("span", ne, x(e.title), 1)])]), a("div", re, [e.showFullscreen ? (_(), i("button", {
|
|
242
242
|
key: 0,
|
|
243
243
|
class: "ctc-dialog__fullscreen-toggle",
|
|
244
244
|
type: "button",
|
|
245
|
-
"aria-label":
|
|
246
|
-
title:
|
|
245
|
+
"aria-label": S(h) ? "退出全屏" : "全屏显示",
|
|
246
|
+
title: S(h) ? "退出全屏" : "全屏显示",
|
|
247
247
|
"data-ctc-fullscreen-toggle": "",
|
|
248
|
-
onClick: c[0] ||= (...e) =>
|
|
249
|
-
}, [s(
|
|
250
|
-
default:
|
|
248
|
+
onClick: c[0] ||= (...e) => S(g) && S(g)(...e)
|
|
249
|
+
}, [s(S(A), { "aria-hidden": "true" }, {
|
|
250
|
+
default: E(() => [S(h) ? (_(), n(S(z), { key: 0 })) : (_(), n(S(R), { key: 1 }))]),
|
|
251
251
|
_: 1
|
|
252
|
-
})], 8,
|
|
252
|
+
})], 8, ie)) : r("", !0), e.showClose ? (_(), i("button", {
|
|
253
253
|
key: 1,
|
|
254
254
|
class: "ctc-dialog__close",
|
|
255
255
|
type: "button",
|
|
@@ -257,21 +257,21 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
257
257
|
title: "关闭",
|
|
258
258
|
"data-ctc-close": "",
|
|
259
259
|
onClick: N
|
|
260
|
-
}, [s(
|
|
261
|
-
default:
|
|
260
|
+
}, [s(S(A), { "aria-hidden": "true" }, {
|
|
261
|
+
default: E(() => [s(S(L))]),
|
|
262
262
|
_: 1
|
|
263
263
|
})])) : r("", !0)])]),
|
|
264
|
-
default:
|
|
264
|
+
default: E(() => [a("div", ae, [b(t.$slots, "default")]), e.resizable && !S(h) ? (_(), i("div", {
|
|
265
265
|
key: 0,
|
|
266
266
|
class: "ctc-dialog__resize-handle",
|
|
267
267
|
"aria-hidden": "true",
|
|
268
268
|
"data-ctc-resize-handle": "",
|
|
269
|
-
onPointerdown: c[1] ||= (...e) =>
|
|
269
|
+
onPointerdown: c[1] ||= (...e) => S(T) && S(T)(...e)
|
|
270
270
|
}, null, 32)) : r("", !0)]),
|
|
271
271
|
_: 2
|
|
272
|
-
}, [
|
|
272
|
+
}, [S(p).footer ? {
|
|
273
273
|
name: "footer",
|
|
274
|
-
fn:
|
|
274
|
+
fn: E(() => [b(t.$slots, "footer")]),
|
|
275
275
|
key: "0"
|
|
276
276
|
} : void 0]), 1040, [
|
|
277
277
|
"class",
|
|
@@ -298,10 +298,10 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
298
298
|
"z-index"
|
|
299
299
|
]));
|
|
300
300
|
}
|
|
301
|
-
}),
|
|
301
|
+
}), oe = { class: "ctc-drawer__header-content" }, se = { class: "ctc-drawer__title" }, ce = { class: "ctc-drawer__header-actions" }, le = ["aria-label", "title"], U = { class: "ctc-drawer__content" }, ue = {
|
|
302
302
|
key: 0,
|
|
303
303
|
class: "ctc-drawer__footer"
|
|
304
|
-
},
|
|
304
|
+
}, W = /* @__PURE__ */ c({
|
|
305
305
|
name: "CtcDrawer",
|
|
306
306
|
inheritAttrs: !1,
|
|
307
307
|
__name: "index",
|
|
@@ -369,11 +369,11 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
369
369
|
"closed"
|
|
370
370
|
],
|
|
371
371
|
setup(e, { emit: o }) {
|
|
372
|
-
let c = e, l = o, u =
|
|
373
|
-
function
|
|
372
|
+
let c = e, l = o, u = C(), d = w(), { isFullscreen: m, toggleFullscreen: h } = B(c, l), g = t(() => m.value ? "100%" : c.size);
|
|
373
|
+
function v(e) {
|
|
374
374
|
l("update:modelValue", e);
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function y() {
|
|
377
377
|
if (c.beforeClose) {
|
|
378
378
|
c.beforeClose((e) => {
|
|
379
379
|
e || l("update:modelValue", !1);
|
|
@@ -382,8 +382,8 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
382
382
|
}
|
|
383
383
|
l("update:modelValue", !1);
|
|
384
384
|
}
|
|
385
|
-
return (t, o) => (
|
|
386
|
-
class: ["ctc-drawer", { "is-fullscreen":
|
|
385
|
+
return (t, o) => (_(), n(S(k), f(S(u), {
|
|
386
|
+
class: ["ctc-drawer", { "is-fullscreen": S(m) }],
|
|
387
387
|
"model-value": e.modelValue,
|
|
388
388
|
"append-to": e.appendTo,
|
|
389
389
|
"before-close": e.beforeClose,
|
|
@@ -395,40 +395,40 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
395
395
|
modal: e.modal,
|
|
396
396
|
"modal-class": e.modalClass,
|
|
397
397
|
"show-close": !1,
|
|
398
|
-
size:
|
|
398
|
+
size: g.value,
|
|
399
399
|
"z-index": e.zIndex,
|
|
400
400
|
"header-class": "ctc-drawer__header",
|
|
401
401
|
"body-class": "ctc-drawer__body",
|
|
402
|
-
"onUpdate:modelValue":
|
|
402
|
+
"onUpdate:modelValue": v,
|
|
403
403
|
onOpen: o[1] ||= (e) => l("open"),
|
|
404
404
|
onOpened: o[2] ||= (e) => l("opened"),
|
|
405
405
|
onClose: o[3] ||= (e) => l("close"),
|
|
406
406
|
onClosed: o[4] ||= (e) => l("closed")
|
|
407
407
|
}), {
|
|
408
|
-
header:
|
|
408
|
+
header: E(() => [a("div", oe, [b(t.$slots, "header", {}, () => [a("span", se, x(e.title), 1)])]), a("div", ce, [e.showFullscreen ? (_(), i("button", {
|
|
409
409
|
key: 0,
|
|
410
410
|
class: "ctc-drawer__fullscreen-toggle",
|
|
411
411
|
type: "button",
|
|
412
|
-
"aria-label":
|
|
413
|
-
title:
|
|
412
|
+
"aria-label": S(m) ? "退出全屏" : "全屏显示",
|
|
413
|
+
title: S(m) ? "退出全屏" : "全屏显示",
|
|
414
414
|
"data-ctc-fullscreen-toggle": "",
|
|
415
|
-
onClick: o[0] ||= (...e) =>
|
|
416
|
-
}, [s(
|
|
417
|
-
default:
|
|
415
|
+
onClick: o[0] ||= (...e) => S(h) && S(h)(...e)
|
|
416
|
+
}, [s(S(A), { "aria-hidden": "true" }, {
|
|
417
|
+
default: E(() => [S(m) ? (_(), n(S(z), { key: 0 })) : (_(), n(S(R), { key: 1 }))]),
|
|
418
418
|
_: 1
|
|
419
|
-
})], 8,
|
|
419
|
+
})], 8, le)) : r("", !0), e.showClose ? (_(), i("button", {
|
|
420
420
|
key: 1,
|
|
421
421
|
class: "ctc-drawer__close",
|
|
422
422
|
type: "button",
|
|
423
423
|
"aria-label": "关闭抽屉",
|
|
424
424
|
title: "关闭",
|
|
425
425
|
"data-ctc-close": "",
|
|
426
|
-
onClick:
|
|
427
|
-
}, [s(
|
|
428
|
-
default:
|
|
426
|
+
onClick: y
|
|
427
|
+
}, [s(S(A), { "aria-hidden": "true" }, {
|
|
428
|
+
default: E(() => [s(S(L))]),
|
|
429
429
|
_: 1
|
|
430
430
|
})])) : r("", !0)])]),
|
|
431
|
-
default:
|
|
431
|
+
default: E(() => [a("div", { class: p(["ctc-drawer__layout", { "has-footer": S(d).footer }]) }, [a("div", U, [b(t.$slots, "default")]), S(d).footer ? (_(), i("div", ue, [b(t.$slots, "footer")])) : r("", !0)], 2)]),
|
|
432
432
|
_: 3
|
|
433
433
|
}, 16, [
|
|
434
434
|
"class",
|
|
@@ -446,7 +446,7 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
446
446
|
"z-index"
|
|
447
447
|
]));
|
|
448
448
|
}
|
|
449
|
-
}),
|
|
449
|
+
}), G = /* @__PURE__ */ c({
|
|
450
450
|
name: "CtcFlex",
|
|
451
451
|
__name: "index",
|
|
452
452
|
props: {
|
|
@@ -473,16 +473,16 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
473
473
|
};
|
|
474
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;
|
|
475
475
|
});
|
|
476
|
-
return (e, t) => (
|
|
476
|
+
return (e, t) => (_(), i("div", {
|
|
477
477
|
class: "ctc-flex",
|
|
478
|
-
style:
|
|
479
|
-
}, [
|
|
478
|
+
style: h(r.value)
|
|
479
|
+
}, [b(e.$slots, "default")], 4));
|
|
480
480
|
}
|
|
481
|
-
}),
|
|
481
|
+
}), de = /* @__PURE__ */ new Set([
|
|
482
482
|
"selection",
|
|
483
483
|
"index",
|
|
484
484
|
"expand"
|
|
485
|
-
]),
|
|
485
|
+
]), K = /* @__PURE__ */ new Map(), fe = c({
|
|
486
486
|
name: "CtcTableColumn",
|
|
487
487
|
props: {
|
|
488
488
|
column: {
|
|
@@ -497,8 +497,8 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
497
497
|
setup(e) {
|
|
498
498
|
let t = (e) => e.slot ?? e.prop, n = (e, t) => {
|
|
499
499
|
if (!t) return;
|
|
500
|
-
let n =
|
|
501
|
-
return n || (n = t.replace(/\[(?:'([^']*)'|"([^"]*)"|([^\]]+))\]/g, ".$1$2$3").split(".").filter(Boolean),
|
|
500
|
+
let n = K.get(t);
|
|
501
|
+
return n || (n = t.replace(/\[(?:'([^']*)'|"([^"]*)"|([^\]]+))\]/g, ".$1$2$3").split(".").filter(Boolean), K.set(t, n)), n.reduce((e, t) => {
|
|
502
502
|
if (!(typeof e != "object" || !e)) return e[t];
|
|
503
503
|
}, e);
|
|
504
504
|
}, r = (r, i) => {
|
|
@@ -519,8 +519,8 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
519
519
|
config: t
|
|
520
520
|
}) : t.renderHeader?.(n);
|
|
521
521
|
}, a = (t) => {
|
|
522
|
-
let { children: n, slot: o, headerSlot: s, renderCell: c, renderHeader:
|
|
523
|
-
return
|
|
522
|
+
let { children: n, slot: o, headerSlot: s, renderCell: c, renderHeader: l, formatter: d, ...f } = t, p = !!n?.length, m = o ?? t.prop, h = !!(m && e.slots[m] || c || d), g = !!(s && e.slots[s] || l), _ = t.type ? de.has(t.type) : !1;
|
|
523
|
+
return u(N, f, {
|
|
524
524
|
default: p ? () => n?.map(a) : h && !_ ? (e) => r(t, e) : void 0,
|
|
525
525
|
header: g ? (e) => i(t, e) : void 0
|
|
526
526
|
});
|
|
@@ -530,15 +530,15 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
530
530
|
});
|
|
531
531
|
//#endregion
|
|
532
532
|
//#region src/components/table/src/merge.ts
|
|
533
|
-
function
|
|
533
|
+
function q(e, t) {
|
|
534
534
|
return t.replace(/\[(?:'([^']*)'|"([^"]*)"|([^\]]+))\]/g, ".$1$2$3").split(".").filter(Boolean).reduce((e, t) => {
|
|
535
535
|
if (!(typeof e != "object" || !e)) return e[t];
|
|
536
536
|
}, e);
|
|
537
537
|
}
|
|
538
|
-
function
|
|
539
|
-
return n.every((n) => Object.is(
|
|
538
|
+
function J(e, t, n) {
|
|
539
|
+
return n.every((n) => Object.is(q(e, n), q(t, n)));
|
|
540
540
|
}
|
|
541
|
-
function
|
|
541
|
+
function pe(e, t) {
|
|
542
542
|
let n = new Map(t.filter((e) => e.prop && e.by.length > 0).map((e) => [e.prop, e]));
|
|
543
543
|
return ({ column: t, rowIndex: r }) => {
|
|
544
544
|
if (t.type === "selection" || t.type === "index" || t.type === "expand") return;
|
|
@@ -546,12 +546,12 @@ function ce(e, t) {
|
|
|
546
546
|
if (!a) return;
|
|
547
547
|
let o = e[r];
|
|
548
548
|
if (!o) return;
|
|
549
|
-
if (r > 0 &&
|
|
549
|
+
if (r > 0 && J(e[r - 1], o, a.by)) return {
|
|
550
550
|
rowspan: 0,
|
|
551
551
|
colspan: 0
|
|
552
552
|
};
|
|
553
553
|
let s = 1;
|
|
554
|
-
for (; r + s < e.length &&
|
|
554
|
+
for (; r + s < e.length && J(o, e[r + s], a.by);) s += 1;
|
|
555
555
|
return {
|
|
556
556
|
rowspan: s,
|
|
557
557
|
colspan: 1
|
|
@@ -560,10 +560,10 @@ function ce(e, t) {
|
|
|
560
560
|
}
|
|
561
561
|
//#endregion
|
|
562
562
|
//#region src/components/table/src/index.vue?vue&type=script&setup=true&lang.ts
|
|
563
|
-
var
|
|
563
|
+
var me = {
|
|
564
564
|
key: 0,
|
|
565
565
|
class: "ctc-table__pagination"
|
|
566
|
-
},
|
|
566
|
+
}, Y = /* @__PURE__ */ c({
|
|
567
567
|
name: "CtcTable",
|
|
568
568
|
inheritAttrs: !1,
|
|
569
569
|
__name: "index",
|
|
@@ -599,90 +599,301 @@ var le = {
|
|
|
599
599
|
"next-click"
|
|
600
600
|
],
|
|
601
601
|
setup(a, { expose: c, emit: l }) {
|
|
602
|
-
let u = a,
|
|
603
|
-
let e = Object.fromEntries(Object.entries(
|
|
604
|
-
return !("border" in
|
|
602
|
+
let u = M, d = a, m = l, h = C(), g = w(), v = I(), x = T("tableRef"), O = /* @__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(".")), k = t(() => {
|
|
603
|
+
let e = Object.fromEntries(Object.entries(h).filter(([e]) => !O.has(e) && e !== "height" && e !== "spanMethod" && e !== "span-method")), t = {};
|
|
604
|
+
return !("border" in h) && v.table?.border !== void 0 && (t.border = v.table.border), !("stripe" in h) && v.table?.stripe !== void 0 && (t.stripe = v.table.stripe), {
|
|
605
605
|
...t,
|
|
606
606
|
...e
|
|
607
607
|
};
|
|
608
|
-
}),
|
|
609
|
-
...
|
|
610
|
-
...
|
|
608
|
+
}), A = t(() => d.pageSize ?? v.table?.pageSize ?? 10), N = t(() => ({
|
|
609
|
+
...v.table?.paginationProps,
|
|
610
|
+
...d.paginationProps
|
|
611
611
|
})), F = t(() => {
|
|
612
|
-
if (typeof
|
|
613
|
-
}),
|
|
614
|
-
|
|
615
|
-
if (
|
|
612
|
+
if (typeof d.height == "string" || typeof d.height == "number") return d.height;
|
|
613
|
+
}), L = t(() => d.autoHeight && F.value === void 0), R = t(() => F.value ?? (L.value ? "100%" : void 0)), z = t(() => {
|
|
614
|
+
let e = h.spanMethod ?? h["span-method"];
|
|
615
|
+
if (typeof e == "function") return e;
|
|
616
|
+
if (d.merge.length !== 0) return pe(d.data, d.merge);
|
|
616
617
|
});
|
|
617
|
-
function
|
|
618
|
-
|
|
618
|
+
function B(e, t) {
|
|
619
|
+
m("current-change", e, t);
|
|
619
620
|
}
|
|
620
621
|
return c({
|
|
621
|
-
elTableRef:
|
|
622
|
-
clearSelection: () =>
|
|
623
|
-
toggleRowSelection: (e, t) =>
|
|
624
|
-
toggleAllSelection: () =>
|
|
625
|
-
toggleRowExpansion: (e, t) =>
|
|
626
|
-
setCurrentRow: (e) =>
|
|
627
|
-
clearSort: () =>
|
|
628
|
-
clearFilter: (e) =>
|
|
629
|
-
doLayout: () =>
|
|
630
|
-
sort: (e, t) =>
|
|
631
|
-
scrollTo: (e, t) =>
|
|
632
|
-
setScrollTop: (e) =>
|
|
633
|
-
setScrollLeft: (e) =>
|
|
634
|
-
}), (t, a) => (
|
|
622
|
+
elTableRef: x,
|
|
623
|
+
clearSelection: () => x.value?.clearSelection(),
|
|
624
|
+
toggleRowSelection: (e, t) => x.value?.toggleRowSelection(e, t),
|
|
625
|
+
toggleAllSelection: () => x.value?.toggleAllSelection(),
|
|
626
|
+
toggleRowExpansion: (e, t) => x.value?.toggleRowExpansion(e, t),
|
|
627
|
+
setCurrentRow: (e) => x.value?.setCurrentRow(e),
|
|
628
|
+
clearSort: () => x.value?.clearSort(),
|
|
629
|
+
clearFilter: (e) => x.value?.clearFilter(e),
|
|
630
|
+
doLayout: () => x.value?.doLayout(),
|
|
631
|
+
sort: (e, t) => x.value?.sort(e, t),
|
|
632
|
+
scrollTo: (e, t) => x.value?.scrollTo(e, t),
|
|
633
|
+
setScrollTop: (e) => x.value?.setScrollTop(e),
|
|
634
|
+
setScrollLeft: (e) => x.value?.setScrollLeft(e)
|
|
635
|
+
}), (t, a) => (_(), i("div", { class: p(["ctc-table", { "ctc-table--auto-height": L.value }]) }, [D((_(), n(S(u), f({
|
|
635
636
|
ref_key: "tableRef",
|
|
636
|
-
ref:
|
|
637
|
-
},
|
|
638
|
-
data:
|
|
639
|
-
height:
|
|
640
|
-
"span-method":
|
|
641
|
-
onCurrentChange:
|
|
637
|
+
ref: x
|
|
638
|
+
}, k.value, {
|
|
639
|
+
data: d.data,
|
|
640
|
+
height: R.value,
|
|
641
|
+
"span-method": z.value,
|
|
642
|
+
onCurrentChange: B
|
|
642
643
|
}), o({
|
|
643
|
-
default:
|
|
644
|
+
default: E(() => [(_(!0), i(e, null, y(d.columns, (e, t) => (_(), n(fe, {
|
|
644
645
|
key: e.prop ?? e.property ?? e.label ?? t,
|
|
645
646
|
column: e,
|
|
646
|
-
slots:
|
|
647
|
+
slots: S(g)
|
|
647
648
|
}, null, 8, ["column", "slots"]))), 128))]),
|
|
648
649
|
_: 2
|
|
649
|
-
}, [
|
|
650
|
+
}, [S(g).empty ? {
|
|
650
651
|
name: "empty",
|
|
651
|
-
fn:
|
|
652
|
+
fn: E(() => [b(t.$slots, "empty")]),
|
|
652
653
|
key: "0"
|
|
653
|
-
} : void 0,
|
|
654
|
+
} : void 0, S(g).append ? {
|
|
654
655
|
name: "append",
|
|
655
|
-
fn:
|
|
656
|
+
fn: E(() => [b(t.$slots, "append")]),
|
|
656
657
|
key: "1"
|
|
657
658
|
} : void 0]), 1040, [
|
|
658
659
|
"data",
|
|
659
660
|
"height",
|
|
660
661
|
"span-method"
|
|
661
|
-
])), [[
|
|
662
|
-
"current-page":
|
|
663
|
-
"page-size":
|
|
664
|
-
total:
|
|
665
|
-
"onUpdate:currentPage": a[0] ||= (e) =>
|
|
666
|
-
"onUpdate:pageSize": a[1] ||= (e) =>
|
|
667
|
-
onCurrentChange: a[2] ||= (e) =>
|
|
668
|
-
onSizeChange: a[3] ||= (e) =>
|
|
669
|
-
onPrevClick: a[4] ||= (e) =>
|
|
670
|
-
onNextClick: a[5] ||= (e) =>
|
|
662
|
+
])), [[S(P), d.loading]]), d.pagination ? (_(), i("div", me, [s(S(j), f(N.value, {
|
|
663
|
+
"current-page": d.currentPage,
|
|
664
|
+
"page-size": A.value,
|
|
665
|
+
total: d.total,
|
|
666
|
+
"onUpdate:currentPage": a[0] ||= (e) => m("update:currentPage", e),
|
|
667
|
+
"onUpdate:pageSize": a[1] ||= (e) => m("update:pageSize", e),
|
|
668
|
+
onCurrentChange: a[2] ||= (e) => m("page-change", e),
|
|
669
|
+
onSizeChange: a[3] ||= (e) => m("page-size-change", e),
|
|
670
|
+
onPrevClick: a[4] ||= (e) => m("prev-click", e),
|
|
671
|
+
onNextClick: a[5] ||= (e) => m("next-click", e)
|
|
671
672
|
}), null, 16, [
|
|
672
673
|
"current-page",
|
|
673
674
|
"page-size",
|
|
674
675
|
"total"
|
|
675
|
-
]),
|
|
676
|
+
]), b(t.$slots, "pagination")])) : r("", !0)], 2));
|
|
677
|
+
}
|
|
678
|
+
}), X = {
|
|
679
|
+
key: 0,
|
|
680
|
+
class: "ctc-report__bar-left"
|
|
681
|
+
}, he = {
|
|
682
|
+
key: 1,
|
|
683
|
+
class: "ctc-report__bar-right"
|
|
684
|
+
}, Z = /* @__PURE__ */ c({
|
|
685
|
+
__name: "ReportBar",
|
|
686
|
+
setup(e) {
|
|
687
|
+
return (e, t) => (_(), n(S(G), {
|
|
688
|
+
class: "ctc-report__bar",
|
|
689
|
+
direction: "row",
|
|
690
|
+
align: "center",
|
|
691
|
+
justify: "space-between"
|
|
692
|
+
}, {
|
|
693
|
+
default: E(() => [b(e.$slots, "default", {}, () => [e.$slots.left ? (_(), i("div", X, [b(e.$slots, "left")])) : r("", !0), e.$slots.right ? (_(), i("div", he, [b(e.$slots, "right")])) : r("", !0)])]),
|
|
694
|
+
_: 3
|
|
695
|
+
}));
|
|
696
|
+
}
|
|
697
|
+
}), ge = {
|
|
698
|
+
key: 0,
|
|
699
|
+
class: "ctc-report__container-top"
|
|
700
|
+
}, _e = {
|
|
701
|
+
key: 0,
|
|
702
|
+
class: "ctc-report__table-bar"
|
|
703
|
+
}, ve = {
|
|
704
|
+
key: 0,
|
|
705
|
+
class: "ctc-report__title"
|
|
706
|
+
}, ye = {
|
|
707
|
+
key: 1,
|
|
708
|
+
class: "ctc-report__before"
|
|
709
|
+
}, be = {
|
|
710
|
+
key: 2,
|
|
711
|
+
class: "ctc-report__after"
|
|
712
|
+
}, Q = /* @__PURE__ */ c({
|
|
713
|
+
name: "CtcReport",
|
|
714
|
+
inheritAttrs: !1,
|
|
715
|
+
__name: "index",
|
|
716
|
+
props: {
|
|
717
|
+
title: { default: "" },
|
|
718
|
+
autoHeight: {
|
|
719
|
+
type: Boolean,
|
|
720
|
+
default: !0
|
|
721
|
+
},
|
|
722
|
+
height: {},
|
|
723
|
+
margin: { default: 0 },
|
|
724
|
+
padding: { default: 0 },
|
|
725
|
+
containerMargin: { default: 0 },
|
|
726
|
+
containerPadding: { default: "var(--ctc-space-4)" }
|
|
727
|
+
},
|
|
728
|
+
emits: [
|
|
729
|
+
"update:currentPage",
|
|
730
|
+
"update:pageSize",
|
|
731
|
+
"current-change",
|
|
732
|
+
"page-change",
|
|
733
|
+
"page-size-change",
|
|
734
|
+
"prev-click",
|
|
735
|
+
"next-click"
|
|
736
|
+
],
|
|
737
|
+
setup(c, { expose: u, emit: d }) {
|
|
738
|
+
let g = c, v = d, D = w(), O = C(), k = T("tableRef"), A = /* @__PURE__ */ new Set([
|
|
739
|
+
"custom-tool-bar",
|
|
740
|
+
"tool-bar",
|
|
741
|
+
"tool-bar-left",
|
|
742
|
+
"tool-bar-right",
|
|
743
|
+
"search-bar",
|
|
744
|
+
"search-bar-left",
|
|
745
|
+
"search-bar-right",
|
|
746
|
+
"container-top",
|
|
747
|
+
"table-bar",
|
|
748
|
+
"table-title",
|
|
749
|
+
"table-info-left",
|
|
750
|
+
"table-info-right",
|
|
751
|
+
"default",
|
|
752
|
+
"table-empty",
|
|
753
|
+
"append-table"
|
|
754
|
+
]);
|
|
755
|
+
function j(e) {
|
|
756
|
+
return typeof e == "number" ? `${e}px` : typeof e == "string" ? e : e.map((e) => `${e}px`).join(" ");
|
|
757
|
+
}
|
|
758
|
+
let M = t(() => ({
|
|
759
|
+
margin: j(g.margin),
|
|
760
|
+
padding: j(g.padding)
|
|
761
|
+
})), N = t(() => ({
|
|
762
|
+
margin: j(g.containerMargin),
|
|
763
|
+
padding: j(g.containerPadding)
|
|
764
|
+
}));
|
|
765
|
+
function P() {
|
|
766
|
+
return Object.fromEntries(Object.entries(O).filter(([e]) => e !== "class" && e !== "style"));
|
|
767
|
+
}
|
|
768
|
+
function F() {
|
|
769
|
+
return Object.keys(D).filter((e) => !A.has(e) && !(e === "empty" && D["table-empty"]));
|
|
770
|
+
}
|
|
771
|
+
function I(e, t) {
|
|
772
|
+
v("current-change", e, t);
|
|
773
|
+
}
|
|
774
|
+
return u({
|
|
775
|
+
tableRef: k,
|
|
776
|
+
clearSelection: () => k.value?.clearSelection(),
|
|
777
|
+
toggleRowSelection: (e, t) => k.value?.toggleRowSelection(e, t),
|
|
778
|
+
toggleAllSelection: () => k.value?.toggleAllSelection(),
|
|
779
|
+
toggleRowExpansion: (e, t) => k.value?.toggleRowExpansion(e, t),
|
|
780
|
+
setCurrentRow: (e) => k.value?.setCurrentRow(e),
|
|
781
|
+
clearSort: () => k.value?.clearSort(),
|
|
782
|
+
clearFilter: (e) => k.value?.clearFilter(e),
|
|
783
|
+
doLayout: () => k.value?.doLayout(),
|
|
784
|
+
sort: (e, t) => k.value?.sort(e, t),
|
|
785
|
+
scrollTo: (e, t) => k.value?.scrollTo(e, t),
|
|
786
|
+
setScrollTop: (e) => k.value?.setScrollTop(e),
|
|
787
|
+
setScrollLeft: (e) => k.value?.setScrollLeft(e)
|
|
788
|
+
}), (t, c) => (_(), n(S(G), {
|
|
789
|
+
class: p(["ctc-report", S(O).class]),
|
|
790
|
+
style: h(S(O).style)
|
|
791
|
+
}, {
|
|
792
|
+
default: E(() => [D["custom-tool-bar"] || D["tool-bar"] || D["tool-bar-left"] || D["tool-bar-right"] || D["search-bar"] || D["search-bar-left"] || D["search-bar-right"] ? (_(), i("div", {
|
|
793
|
+
key: 0,
|
|
794
|
+
class: "ctc-report__header",
|
|
795
|
+
style: h(M.value)
|
|
796
|
+
}, [D["custom-tool-bar"] ? b(t.$slots, "custom-tool-bar", {}, void 0, void 0, 0) : D["tool-bar"] || D["tool-bar-left"] || D["tool-bar-right"] ? (_(), n(Z, {
|
|
797
|
+
key: 1,
|
|
798
|
+
class: "ctc-report__toolbar"
|
|
799
|
+
}, o({ _: 2 }, [
|
|
800
|
+
D["tool-bar"] ? {
|
|
801
|
+
name: "default",
|
|
802
|
+
fn: E(() => [b(t.$slots, "tool-bar")]),
|
|
803
|
+
key: "0"
|
|
804
|
+
} : void 0,
|
|
805
|
+
D["tool-bar-left"] ? {
|
|
806
|
+
name: "left",
|
|
807
|
+
fn: E(() => [b(t.$slots, "tool-bar-left")]),
|
|
808
|
+
key: "1"
|
|
809
|
+
} : void 0,
|
|
810
|
+
D["tool-bar-right"] ? {
|
|
811
|
+
name: "right",
|
|
812
|
+
fn: E(() => [b(t.$slots, "tool-bar-right")]),
|
|
813
|
+
key: "2"
|
|
814
|
+
} : void 0
|
|
815
|
+
]), 1024)) : r("", !0), D["search-bar"] || D["search-bar-left"] || D["search-bar-right"] ? (_(), n(Z, {
|
|
816
|
+
key: 2,
|
|
817
|
+
class: "ctc-report__search"
|
|
818
|
+
}, o({ _: 2 }, [
|
|
819
|
+
D["search-bar"] ? {
|
|
820
|
+
name: "default",
|
|
821
|
+
fn: E(() => [b(t.$slots, "search-bar")]),
|
|
822
|
+
key: "0"
|
|
823
|
+
} : void 0,
|
|
824
|
+
D["search-bar-left"] ? {
|
|
825
|
+
name: "left",
|
|
826
|
+
fn: E(() => [b(t.$slots, "search-bar-left")]),
|
|
827
|
+
key: "1"
|
|
828
|
+
} : void 0,
|
|
829
|
+
D["search-bar-right"] ? {
|
|
830
|
+
name: "right",
|
|
831
|
+
fn: E(() => [b(t.$slots, "search-bar-right")]),
|
|
832
|
+
key: "2"
|
|
833
|
+
} : void 0
|
|
834
|
+
]), 1024)) : r("", !0)], 4)) : r("", !0), s(S(G), {
|
|
835
|
+
class: "ctc-report__container",
|
|
836
|
+
fill: "",
|
|
837
|
+
style: h(N.value)
|
|
838
|
+
}, {
|
|
839
|
+
default: E(() => [D["container-top"] ? (_(), i("div", ge, [b(t.$slots, "container-top")])) : r("", !0), s(S(G), {
|
|
840
|
+
class: "ctc-report__body",
|
|
841
|
+
fill: ""
|
|
842
|
+
}, {
|
|
843
|
+
default: E(() => [
|
|
844
|
+
D["table-bar"] || D["table-title"] || g.title || D["table-info-left"] || D["table-info-right"] ? (_(), i("div", _e, [D["table-bar"] ? b(t.$slots, "table-bar", {}, void 0, void 0, 0) : (_(), i(e, { key: 1 }, [D["table-title"] || g.title ? (_(), i("div", ve, [b(t.$slots, "table-title", {}, () => [a("h2", null, x(g.title), 1)])])) : r("", !0), D["table-info-left"] || D["table-info-right"] ? (_(), n(Z, {
|
|
845
|
+
key: 1,
|
|
846
|
+
class: "ctc-report__info"
|
|
847
|
+
}, o({ _: 2 }, [D["table-info-left"] ? {
|
|
848
|
+
name: "left",
|
|
849
|
+
fn: E(() => [b(t.$slots, "table-info-left")]),
|
|
850
|
+
key: "0"
|
|
851
|
+
} : void 0, D["table-info-right"] ? {
|
|
852
|
+
name: "right",
|
|
853
|
+
fn: E(() => [b(t.$slots, "table-info-right")]),
|
|
854
|
+
key: "1"
|
|
855
|
+
} : void 0]), 1024)) : r("", !0)], 64))])) : r("", !0),
|
|
856
|
+
D.default ? (_(), i("div", ye, [b(t.$slots, "default")])) : r("", !0),
|
|
857
|
+
a("div", { class: p(["ctc-report__table", { "ctc-report__table--auto-height": g.autoHeight && g.height === void 0 }]) }, [s(S(Y), f({
|
|
858
|
+
ref_key: "tableRef",
|
|
859
|
+
ref: k
|
|
860
|
+
}, P(), {
|
|
861
|
+
"auto-height": g.autoHeight,
|
|
862
|
+
height: g.height,
|
|
863
|
+
"onUpdate:currentPage": c[0] ||= (e) => v("update:currentPage", e),
|
|
864
|
+
"onUpdate:pageSize": c[1] ||= (e) => v("update:pageSize", e),
|
|
865
|
+
onCurrentChange: I,
|
|
866
|
+
onPageChange: c[2] ||= (e) => v("page-change", e),
|
|
867
|
+
onPageSizeChange: c[3] ||= (e) => v("page-size-change", e),
|
|
868
|
+
onPrevClick: c[4] ||= (e) => v("prev-click", e),
|
|
869
|
+
onNextClick: c[5] ||= (e) => v("next-click", e)
|
|
870
|
+
}), o({ _: 2 }, [D["table-empty"] ? {
|
|
871
|
+
name: "empty",
|
|
872
|
+
fn: E(() => [b(t.$slots, "table-empty")]),
|
|
873
|
+
key: "0"
|
|
874
|
+
} : void 0, y(F(), (e) => ({
|
|
875
|
+
name: e,
|
|
876
|
+
fn: E((n) => [b(t.$slots, e, m(l(n)))])
|
|
877
|
+
}))]), 1040, ["auto-height", "height"])], 2),
|
|
878
|
+
D["append-table"] ? (_(), i("div", be, [b(t.$slots, "append-table")])) : r("", !0)
|
|
879
|
+
]),
|
|
880
|
+
_: 3
|
|
881
|
+
})]),
|
|
882
|
+
_: 3
|
|
883
|
+
}, 8, ["style"])]),
|
|
884
|
+
_: 3
|
|
885
|
+
}, 8, ["class", "style"]));
|
|
676
886
|
}
|
|
677
|
-
}),
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
887
|
+
}), xe = [
|
|
888
|
+
H,
|
|
889
|
+
W,
|
|
890
|
+
G,
|
|
891
|
+
Y,
|
|
681
892
|
Q
|
|
682
893
|
], $ = { install(e, t = {}) {
|
|
683
|
-
e.provide(
|
|
894
|
+
e.provide(F, t), xe.forEach((t) => {
|
|
684
895
|
e.component(t.name ?? "", t);
|
|
685
896
|
});
|
|
686
897
|
} };
|
|
687
898
|
//#endregion
|
|
688
|
-
export { $ as CtcComponentsUi, $ as default,
|
|
899
|
+
export { $ as CtcComponentsUi, $ as default, H as CtcDialog, W as CtcDrawer, G as CtcFlex, Q as CtcReport, Y as CtcTable };
|