@ctc-front/components-ui-next 0.1.3 → 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/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, mergeProps as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as p, openBlock as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, unref as y, useAttrs as b, useSlots as x, useTemplateRef as S, withCtx as C, withDirectives as w } from "vue";
2
- import { ElDialog as T, ElDrawer as E, ElIcon as D, ElPagination as O, ElTable as k, ElTableColumn as A, vLoading as j } from "element-plus";
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
+ //#region src/config.ts
4
+ var F = Symbol("CtcComponentsUiConfig");
5
+ function I() {
6
+ return d(F, {});
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 M = /* @__PURE__ */ c({
10
+ var L = /* @__PURE__ */ c({
5
11
  name: "Close",
6
12
  __name: "close",
7
13
  setup(e) {
8
- return (e, t) => (m(), i("svg", {
14
+ return (e, t) => (_(), 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
- }), N = /* @__PURE__ */ c({
22
+ }), R = /* @__PURE__ */ c({
17
23
  name: "FullScreen",
18
24
  __name: "full-screen",
19
25
  setup(e) {
20
- return (e, t) => (m(), i("svg", {
26
+ return (e, t) => (_(), 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
- }), P = /* @__PURE__ */ c({
34
+ }), z = /* @__PURE__ */ c({
29
35
  name: "Minus",
30
36
  __name: "minus",
31
37
  setup(e) {
32
- return (e, t) => (m(), i("svg", {
38
+ return (e, t) => (_(), i("svg", {
33
39
  xmlns: "http://www.w3.org/2000/svg",
34
40
  viewBox: "0 0 1024 1024"
35
41
  }, [a("path", {
@@ -39,8 +45,8 @@ var M = /* @__PURE__ */ c({
39
45
  }
40
46
  });
41
47
  //#endregion
42
- //#region src/components/dialog/src/useFullscreen.ts
43
- function F(e, n) {
48
+ //#region src/composables/useFullscreen.ts
49
+ function B(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 I(e, t, n) {
61
+ function V(e, t, n) {
56
62
  return Math.min(Math.max(e, t), n);
57
63
  }
58
- function L(e, t) {
59
- let n = h(!1), r = h({}), i = () => {};
64
+ function ee(e, t) {
65
+ let n = v(!1), r = v({}), 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(I(c.width + e.clientX - p, l, d)), a = Math.round(I(c.height + e.clientY - m, u, f));
76
+ let i = Math.round(V(c.width + e.clientX - p, l, d)), a = Math.round(V(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 p(a), {
92
+ return g(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 R = { class: "ctc-dialog__header-content" }, z = { class: "ctc-dialog__title" }, B = { class: "ctc-dialog__header-actions" }, V = ["aria-label", "title"], H = { class: "ctc-dialog__content" }, U = /* @__PURE__ */ c({
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({
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: Boolean,
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, d = c, f = b(), p = x(), { isFullscreen: h, toggleFullscreen: g } = F(l, d), { isResized: S, resizeStyle: w, startResize: E } = L(l, d), O = t(() => h.value ? {} : w.value), k = t(() => S.value && !h.value);
183
- function A(e) {
184
- d("update:modelValue", e);
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
+ function M(e) {
193
+ u("update:modelValue", e);
185
194
  }
186
- function j() {
195
+ function N() {
187
196
  if (l.beforeClose) {
188
197
  l.beforeClose((e) => {
189
- e || d("update:modelValue", !1);
198
+ e || u("update:modelValue", !1);
190
199
  });
191
200
  return;
192
201
  }
193
- d("update:modelValue", !1);
202
+ u("update:modelValue", !1);
194
203
  }
195
- return (t, c) => (m(), n(y(T), u(y(f), {
204
+ return (t, c) => (_(), n(S(O), f(S(d), {
196
205
  class: ["ctc-dialog", {
197
206
  "ctc-dialog--content-fill": e.contentFill,
198
207
  "ctc-dialog--resizable": e.resizable,
199
208
  "ctc-dialog--resized": k.value
200
209
  }],
201
- style: O.value,
210
+ style: D.value,
202
211
  "model-value": e.modelValue,
203
- fullscreen: y(h),
212
+ fullscreen: S(h),
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": e.closeOnClickModal,
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": A,
227
- onOpen: c[2] ||= (e) => d("open"),
228
- onOpened: c[3] ||= (e) => d("opened"),
229
- onClose: c[4] ||= (e) => d("close"),
230
- onClosed: c[5] ||= (e) => d("closed")
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: C(() => [a("div", R, [_(t.$slots, "header", {}, () => [a("span", z, v(e.title), 1)])]), a("div", B, [e.showFullscreen ? (m(), i("button", {
241
+ header: E(() => [a("div", te, [b(t.$slots, "header", {}, () => [a("span", ne, x(e.title), 1)])]), a("div", re, [e.showFullscreen ? (_(), i("button", {
233
242
  key: 0,
234
243
  class: "ctc-dialog__fullscreen-toggle",
235
244
  type: "button",
236
- "aria-label": y(h) ? "退出全屏" : "全屏显示",
237
- title: y(h) ? "退出全屏" : "全屏显示",
245
+ "aria-label": S(h) ? "退出全屏" : "全屏显示",
246
+ title: S(h) ? "退出全屏" : "全屏显示",
238
247
  "data-ctc-fullscreen-toggle": "",
239
- onClick: c[0] ||= (...e) => y(g) && y(g)(...e)
240
- }, [s(y(D), { "aria-hidden": "true" }, {
241
- default: C(() => [y(h) ? (m(), n(y(P), { key: 0 })) : (m(), n(y(N), { key: 1 }))]),
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 }))]),
242
251
  _: 1
243
- })], 8, V)) : r("", !0), e.showClose ? (m(), i("button", {
252
+ })], 8, ie)) : r("", !0), e.showClose ? (_(), 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: j
251
- }, [s(y(D), { "aria-hidden": "true" }, {
252
- default: C(() => [s(y(M))]),
259
+ onClick: N
260
+ }, [s(S(A), { "aria-hidden": "true" }, {
261
+ default: E(() => [s(S(L))]),
253
262
  _: 1
254
263
  })])) : r("", !0)])]),
255
- default: C(() => [a("div", H, [_(t.$slots, "default")]), e.resizable && !y(h) ? (m(), i("div", {
264
+ default: E(() => [a("div", ae, [b(t.$slots, "default")]), e.resizable && !S(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) => y(E) && y(E)(...e)
269
+ onPointerdown: c[1] ||= (...e) => S(T) && S(T)(...e)
261
270
  }, null, 32)) : r("", !0)]),
262
271
  _: 2
263
- }, [y(p).footer ? {
272
+ }, [S(p).footer ? {
264
273
  name: "footer",
265
- fn: C(() => [_(t.$slots, "footer")]),
274
+ fn: E(() => [b(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
- }), W = { class: "ctc-drawer__header-content" }, G = { class: "ctc-drawer__title" }, K = { class: "ctc-drawer__header-actions" }, q = ["aria-label", "title"], ee = { class: "ctc-drawer__content" }, te = {
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 = {
293
302
  key: 0,
294
303
  class: "ctc-drawer__footer"
295
- }, J = /* @__PURE__ */ c({
304
+ }, W = /* @__PURE__ */ c({
296
305
  name: "CtcDrawer",
297
306
  inheritAttrs: !1,
298
307
  __name: "index",
@@ -360,11 +369,11 @@ 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, f = b(), p = x(), { isFullscreen: h, toggleFullscreen: g } = F(c, l), S = t(() => h.value ? "100%" : c.size);
364
- function w(e) {
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) {
365
374
  l("update:modelValue", e);
366
375
  }
367
- function T() {
376
+ function y() {
368
377
  if (c.beforeClose) {
369
378
  c.beforeClose((e) => {
370
379
  e || l("update:modelValue", !1);
@@ -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) => (m(), n(y(E), u(y(f), {
377
- class: ["ctc-drawer", { "is-fullscreen": y(h) }],
385
+ return (t, o) => (_(), n(S(k), f(S(u), {
386
+ class: ["ctc-drawer", { "is-fullscreen": S(m) }],
378
387
  "model-value": e.modelValue,
379
388
  "append-to": e.appendTo,
380
389
  "before-close": e.beforeClose,
@@ -386,40 +395,40 @@ 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: S.value,
398
+ size: g.value,
390
399
  "z-index": e.zIndex,
391
400
  "header-class": "ctc-drawer__header",
392
401
  "body-class": "ctc-drawer__body",
393
- "onUpdate:modelValue": w,
402
+ "onUpdate:modelValue": v,
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: C(() => [a("div", W, [_(t.$slots, "header", {}, () => [a("span", G, v(e.title), 1)])]), a("div", K, [e.showFullscreen ? (m(), i("button", {
408
+ header: E(() => [a("div", oe, [b(t.$slots, "header", {}, () => [a("span", se, x(e.title), 1)])]), a("div", ce, [e.showFullscreen ? (_(), i("button", {
400
409
  key: 0,
401
410
  class: "ctc-drawer__fullscreen-toggle",
402
411
  type: "button",
403
- "aria-label": y(h) ? "退出全屏" : "全屏显示",
404
- title: y(h) ? "退出全屏" : "全屏显示",
412
+ "aria-label": S(m) ? "退出全屏" : "全屏显示",
413
+ title: S(m) ? "退出全屏" : "全屏显示",
405
414
  "data-ctc-fullscreen-toggle": "",
406
- onClick: o[0] ||= (...e) => y(g) && y(g)(...e)
407
- }, [s(y(D), { "aria-hidden": "true" }, {
408
- default: C(() => [y(h) ? (m(), n(y(P), { key: 0 })) : (m(), n(y(N), { key: 1 }))]),
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 }))]),
409
418
  _: 1
410
- })], 8, q)) : r("", !0), e.showClose ? (m(), i("button", {
419
+ })], 8, le)) : r("", !0), e.showClose ? (_(), i("button", {
411
420
  key: 1,
412
421
  class: "ctc-drawer__close",
413
422
  type: "button",
414
423
  "aria-label": "关闭抽屉",
415
424
  title: "关闭",
416
425
  "data-ctc-close": "",
417
- onClick: T
418
- }, [s(y(D), { "aria-hidden": "true" }, {
419
- default: C(() => [s(y(M))]),
426
+ onClick: y
427
+ }, [s(S(A), { "aria-hidden": "true" }, {
428
+ default: E(() => [s(S(L))]),
420
429
  _: 1
421
430
  })])) : r("", !0)])]),
422
- default: C(() => [a("div", { class: d(["ctc-drawer__layout", { "has-footer": y(p).footer }]) }, [a("div", ee, [_(t.$slots, "default")]), y(p).footer ? (m(), i("div", te, [_(t.$slots, "footer")])) : r("", !0)], 2)]),
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)]),
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
- }), Y = /* @__PURE__ */ c({
449
+ }), G = /* @__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) => (m(), i("div", {
476
+ return (e, t) => (_(), i("div", {
468
477
  class: "ctc-flex",
469
- style: f(r.value)
470
- }, [_(e.$slots, "default")], 4));
478
+ style: h(r.value)
479
+ }, [b(e.$slots, "default")], 4));
471
480
  }
472
- }), ne = /* @__PURE__ */ new Set([
481
+ }), de = /* @__PURE__ */ new Set([
473
482
  "selection",
474
483
  "index",
475
484
  "expand"
476
- ]), re = c({
485
+ ]), K = /* @__PURE__ */ new Map(), fe = 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 t.replace(/\[(?:'([^']*)'|"([^"]*)"|([^\]]+))\]/g, ".$1$2$3").split(".").filter(Boolean).reduce((e, t) => {
499
+ if (!t) return;
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) => {
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 ? ne.has(t.type) : !1;
512
- return l(A, f, {
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, {
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
  });
@@ -519,15 +530,15 @@ var R = { class: "ctc-dialog__header-content" }, z = { class: "ctc-dialog__title
519
530
  });
520
531
  //#endregion
521
532
  //#region src/components/table/src/merge.ts
522
- function X(e, t) {
533
+ function q(e, t) {
523
534
  return t.replace(/\[(?:'([^']*)'|"([^"]*)"|([^\]]+))\]/g, ".$1$2$3").split(".").filter(Boolean).reduce((e, t) => {
524
535
  if (!(typeof e != "object" || !e)) return e[t];
525
536
  }, e);
526
537
  }
527
- function Z(e, t, n) {
528
- return n.every((n) => Object.is(X(e, n), X(t, n)));
538
+ function J(e, t, n) {
539
+ return n.every((n) => Object.is(q(e, n), q(t, n)));
529
540
  }
530
- function ie(e, t) {
541
+ function pe(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;
@@ -535,12 +546,12 @@ function ie(e, t) {
535
546
  if (!a) return;
536
547
  let o = e[r];
537
548
  if (!o) return;
538
- if (r > 0 && Z(e[r - 1], o, a.by)) return {
549
+ if (r > 0 && J(e[r - 1], o, a.by)) return {
539
550
  rowspan: 0,
540
551
  colspan: 0
541
552
  };
542
553
  let s = 1;
543
- for (; r + s < e.length && Z(o, e[r + s], a.by);) s += 1;
554
+ for (; r + s < e.length && J(o, e[r + s], a.by);) s += 1;
544
555
  return {
545
556
  rowspan: s,
546
557
  colspan: 1
@@ -549,10 +560,10 @@ 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 ae = {
563
+ var me = {
553
564
  key: 0,
554
565
  class: "ctc-table__pagination"
555
- }, Q = /* @__PURE__ */ c({
566
+ }, Y = /* @__PURE__ */ c({
556
567
  name: "CtcTable",
557
568
  inheritAttrs: !1,
558
569
  __name: "index",
@@ -570,7 +581,7 @@ var ae = {
570
581
  default: !1
571
582
  },
572
583
  merge: { default: () => [] },
573
- pageSize: { default: 10 },
584
+ pageSize: {},
574
585
  pagination: {
575
586
  type: Boolean,
576
587
  default: !1
@@ -588,77 +599,301 @@ var ae = {
588
599
  "next-click"
589
600
  ],
590
601
  setup(a, { expose: c, emit: l }) {
591
- let f = a, p = l, h = b(), v = x(), T = S("tableRef"), E = /* @__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(".")), D = t(() => Object.fromEntries(Object.entries(h).filter(([e]) => !E.has(e) && e !== "height" && e !== "spanMethod"))), A = t(() => {
592
- if (typeof f.height == "string" || typeof f.height == "number") return f.height;
593
- }), M = t(() => f.autoHeight && A.value === void 0), N = t(() => A.value ?? (M.value ? "100%" : void 0)), P = t(() => {
594
- if (typeof h.spanMethod == "function") return h.spanMethod;
595
- if (f.merge.length !== 0) return ie(f.data, f.merge);
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
+ ...t,
606
+ ...e
607
+ };
608
+ }), A = t(() => d.pageSize ?? v.table?.pageSize ?? 10), N = t(() => ({
609
+ ...v.table?.paginationProps,
610
+ ...d.paginationProps
611
+ })), F = t(() => {
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);
596
617
  });
597
- function F(e, t) {
598
- p("current-change", e, t);
618
+ function B(e, t) {
619
+ m("current-change", e, t);
599
620
  }
600
621
  return c({
601
- clearSelection: () => T.value?.clearSelection(),
602
- toggleRowSelection: (e, t) => T.value?.toggleRowSelection(e, t),
603
- toggleAllSelection: () => T.value?.toggleAllSelection(),
604
- toggleRowExpansion: (e, t) => T.value?.toggleRowExpansion(e, t),
605
- setCurrentRow: (e) => T.value?.setCurrentRow(e),
606
- clearSort: () => T.value?.clearSort(),
607
- clearFilter: (e) => T.value?.clearFilter(e),
608
- doLayout: () => T.value?.doLayout(),
609
- sort: (e, t) => T.value?.sort(e, t)
610
- }), (t, a) => (m(), i("div", { class: d(["ctc-table", { "ctc-table--auto-height": M.value }]) }, [w((m(), n(y(k), u({
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({
611
636
  ref_key: "tableRef",
612
- ref: T
613
- }, D.value, {
614
- data: f.data,
615
- height: N.value,
616
- "span-method": P.value,
617
- onCurrentChange: F
637
+ ref: x
638
+ }, k.value, {
639
+ data: d.data,
640
+ height: R.value,
641
+ "span-method": z.value,
642
+ onCurrentChange: B
618
643
  }), o({
619
- default: C(() => [(m(!0), i(e, null, g(f.columns, (e, t) => (m(), n(re, {
644
+ default: E(() => [(_(!0), i(e, null, y(d.columns, (e, t) => (_(), n(fe, {
620
645
  key: e.prop ?? e.property ?? e.label ?? t,
621
646
  column: e,
622
- slots: y(v)
647
+ slots: S(g)
623
648
  }, null, 8, ["column", "slots"]))), 128))]),
624
649
  _: 2
625
- }, [y(v).empty ? {
650
+ }, [S(g).empty ? {
626
651
  name: "empty",
627
- fn: C(() => [_(t.$slots, "empty")]),
652
+ fn: E(() => [b(t.$slots, "empty")]),
628
653
  key: "0"
629
- } : void 0, y(v).append ? {
654
+ } : void 0, S(g).append ? {
630
655
  name: "append",
631
- fn: C(() => [_(t.$slots, "append")]),
656
+ fn: E(() => [b(t.$slots, "append")]),
632
657
  key: "1"
633
658
  } : void 0]), 1040, [
634
659
  "data",
635
660
  "height",
636
661
  "span-method"
637
- ])), [[y(j), f.loading]]), f.pagination ? (m(), i("div", ae, [s(y(O), u(f.paginationProps, {
638
- "current-page": f.currentPage,
639
- "page-size": f.pageSize,
640
- total: f.total,
641
- "onUpdate:currentPage": a[0] ||= (e) => p("update:currentPage", e),
642
- "onUpdate:pageSize": a[1] ||= (e) => p("update:pageSize", e),
643
- onCurrentChange: a[2] ||= (e) => p("page-change", e),
644
- onSizeChange: a[3] ||= (e) => p("page-size-change", e),
645
- onPrevClick: a[4] ||= (e) => p("prev-click", e),
646
- onNextClick: a[5] ||= (e) => p("next-click", 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)
647
672
  }), null, 16, [
648
673
  "current-page",
649
674
  "page-size",
650
675
  "total"
651
- ]), _(t.$slots, "pagination")])) : r("", !0)], 2));
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"]));
652
886
  }
653
- }), oe = [
654
- U,
655
- J,
887
+ }), xe = [
888
+ H,
889
+ W,
890
+ G,
656
891
  Y,
657
892
  Q
658
- ], $ = { install(e) {
659
- oe.forEach((t) => {
893
+ ], $ = { install(e, t = {}) {
894
+ e.provide(F, t), xe.forEach((t) => {
660
895
  e.component(t.name ?? "", t);
661
896
  });
662
897
  } };
663
898
  //#endregion
664
- export { $ as CtcComponentsUi, $ as default, U as CtcDialog, J as CtcDrawer, Y as CtcFlex, Q as CtcTable };
899
+ export { $ as CtcComponentsUi, $ as default, H as CtcDialog, W as CtcDrawer, G as CtcFlex, Q as CtcReport, Y as CtcTable };