common_component_library_vue 0.1.1 → 0.1.3
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-lib/common-component-library-vue.css +1 -1
- package/dist-lib/common-component-library-vue.mjs +1038 -167
- package/dist-lib/common-component-library-vue.umd.js +2 -1
- package/dist-lib/types/components/Chart/CcBarChart.vue.d.ts +32 -0
- package/dist-lib/types/components/Chart/CcLineChart.vue.d.ts +35 -0
- package/dist-lib/types/components/Chart/CcPieChart.vue.d.ts +30 -0
- package/dist-lib/types/components/Chart/common.d.ts +32 -0
- package/dist-lib/types/components/Chart/useECharts.d.ts +18 -0
- package/dist-lib/types/components/Table/CcTable.vue.d.ts +73 -0
- package/dist-lib/types/components/ThemeProvider/CcThemeProvider.vue.d.ts +27 -0
- package/dist-lib/types/index.d.ts +247 -3
- package/dist-lib/types/theme.d.ts +32 -0
- package/package.json +10 -4
- package/src/styles/themes/linear.css +47 -0
- package/src/styles/themes/notion.css +47 -0
- package/src/styles/themes/raycast.css +47 -0
- package/src/styles/themes/vercel.css +47 -0
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s,
|
|
1
|
+
import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createStaticVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeModels as f, nextTick as ee, normalizeClass as p, normalizeStyle as m, onBeforeUnmount as h, onMounted as g, openBlock as _, provide as v, reactive as te, ref as y, renderList as b, renderSlot as x, resolveDynamicComponent as S, shallowRef as C, toDisplayString as w, useCssVars as T, useModel as E, vModelCheckbox as D, vModelRadio as ne, vModelSelect as re, vModelText as ie, watch as O, withCtx as k, withDirectives as A, withModifiers as ae } from "vue";
|
|
2
|
+
import * as j from "echarts/core";
|
|
3
|
+
import { BarChart as M, LineChart as oe, PieChart as N } from "echarts/charts";
|
|
4
|
+
import { GridComponent as P, LegendComponent as F, TooltipComponent as I } from "echarts/components";
|
|
5
|
+
import { CanvasRenderer as L } from "echarts/renderers";
|
|
2
6
|
//#region src/components/Spinner/CcSpinner.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var
|
|
7
|
+
var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
4
8
|
__name: "CcSpinner",
|
|
5
9
|
props: {
|
|
6
10
|
size: { default: 20 },
|
|
7
11
|
color: { default: "var(--cc-primary)" }
|
|
8
12
|
},
|
|
9
13
|
setup(e) {
|
|
10
|
-
return
|
|
14
|
+
return T((e) => ({ f2187a8a: e.color })), (t, n) => (_(), o("svg", {
|
|
11
15
|
class: "cc-spinner",
|
|
12
16
|
width: e.size,
|
|
13
17
|
height: e.size,
|
|
@@ -29,16 +33,16 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
29
33
|
stroke: "currentColor",
|
|
30
34
|
"stroke-width": "3",
|
|
31
35
|
"stroke-linecap": "round"
|
|
32
|
-
}, null, -1)]], 8,
|
|
36
|
+
}, null, -1)]], 8, se));
|
|
33
37
|
}
|
|
34
|
-
}),
|
|
38
|
+
}), R = (e, t) => {
|
|
35
39
|
let n = e.__vccOpts || e;
|
|
36
40
|
for (let [e, r] of t) n[e] = r;
|
|
37
41
|
return n;
|
|
38
|
-
},
|
|
42
|
+
}, z = /*#__PURE__*/ R(ce, [["__scopeId", "data-v-00c109fa"]]), B = {
|
|
39
43
|
key: 0,
|
|
40
44
|
class: "cc-btn__spinner"
|
|
41
|
-
},
|
|
45
|
+
}, le = { class: "cc-btn__content" }, V = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
42
46
|
__name: "CcButton",
|
|
43
47
|
props: {
|
|
44
48
|
variant: { default: "primary" },
|
|
@@ -62,7 +66,7 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
62
66
|
},
|
|
63
67
|
emits: ["click"],
|
|
64
68
|
setup(e, { emit: t }) {
|
|
65
|
-
let n = e, c = t,
|
|
69
|
+
let n = e, c = t, l = r(() => n.variant === "primary" || n.variant === "on-dark" ? "var(--cc-on-primary)" : "var(--cc-primary)");
|
|
66
70
|
function d(e) {
|
|
67
71
|
if (n.disabled || n.loading) {
|
|
68
72
|
e.preventDefault();
|
|
@@ -70,8 +74,8 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
70
74
|
}
|
|
71
75
|
c("click", e);
|
|
72
76
|
}
|
|
73
|
-
return (t, n) => (
|
|
74
|
-
class:
|
|
77
|
+
return (t, n) => (_(), i(S(e.href ? "a" : "button"), {
|
|
78
|
+
class: p(["cc-btn", [
|
|
75
79
|
`cc-btn--${e.variant}`,
|
|
76
80
|
`cc-btn--${e.size}`,
|
|
77
81
|
{
|
|
@@ -87,10 +91,10 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
87
91
|
"aria-busy": e.loading,
|
|
88
92
|
onClick: d
|
|
89
93
|
}, {
|
|
90
|
-
default:
|
|
94
|
+
default: k(() => [e.loading ? (_(), o("span", B, [u(z, {
|
|
91
95
|
size: e.size === "sm" ? 14 : 16,
|
|
92
|
-
color:
|
|
93
|
-
}, null, 8, ["size", "color"])])) : a("", !0), s("span",
|
|
96
|
+
color: l.value
|
|
97
|
+
}, null, 8, ["size", "color"])])) : a("", !0), s("span", le, [x(t.$slots, "default", {}, void 0, !0)])]),
|
|
94
98
|
_: 3
|
|
95
99
|
}, 8, [
|
|
96
100
|
"class",
|
|
@@ -102,7 +106,7 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
102
106
|
"aria-busy"
|
|
103
107
|
]));
|
|
104
108
|
}
|
|
105
|
-
}), [["__scopeId", "data-v-deb42261"]]),
|
|
109
|
+
}), [["__scopeId", "data-v-deb42261"]]), ue = ["for"], H = {
|
|
106
110
|
key: 0,
|
|
107
111
|
class: "cc-input__prefix tnum"
|
|
108
112
|
}, de = [
|
|
@@ -119,13 +123,13 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
119
123
|
"max",
|
|
120
124
|
"step",
|
|
121
125
|
"aria-invalid"
|
|
122
|
-
],
|
|
126
|
+
], U = {
|
|
123
127
|
key: 1,
|
|
124
128
|
class: "cc-input__message cc-input__message--error"
|
|
125
|
-
},
|
|
129
|
+
}, W = {
|
|
126
130
|
key: 2,
|
|
127
131
|
class: "cc-input__message"
|
|
128
|
-
},
|
|
132
|
+
}, G = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
129
133
|
__name: "CcInput",
|
|
130
134
|
props: {
|
|
131
135
|
modelValue: { default: "" },
|
|
@@ -161,16 +165,16 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
161
165
|
function l(e) {
|
|
162
166
|
i("update:modelValue", e.target.value);
|
|
163
167
|
}
|
|
164
|
-
return (t, n) => (
|
|
168
|
+
return (t, n) => (_(), o("div", { class: p(["cc-input", {
|
|
165
169
|
"cc-input--error": c.value,
|
|
166
170
|
"cc-input--disabled": e.disabled
|
|
167
171
|
}]) }, [
|
|
168
|
-
e.label ? (
|
|
172
|
+
e.label ? (_(), o("label", {
|
|
169
173
|
key: 0,
|
|
170
174
|
class: "cc-input__label",
|
|
171
175
|
for: e.name
|
|
172
|
-
},
|
|
173
|
-
s("div", { class:
|
|
176
|
+
}, w(e.label), 9, ue)) : a("", !0),
|
|
177
|
+
s("div", { class: p(["cc-input__field", { "cc-input__field--prefix": e.prefix }]) }, [e.prefix ? (_(), o("span", H, w(e.prefix), 1)) : a("", !0), s("input", {
|
|
174
178
|
id: e.name,
|
|
175
179
|
class: "cc-input__control tnum",
|
|
176
180
|
type: e.type,
|
|
@@ -190,10 +194,10 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
190
194
|
onBlur: n[1] ||= (e) => i("blur", e),
|
|
191
195
|
onChange: n[2] ||= (e) => i("change", e)
|
|
192
196
|
}, null, 40, de)], 2),
|
|
193
|
-
e.error ? (
|
|
197
|
+
e.error ? (_(), o("p", U, w(e.error), 1)) : e.hint ? (_(), o("p", W, w(e.hint), 1)) : a("", !0)
|
|
194
198
|
], 2));
|
|
195
199
|
}
|
|
196
|
-
}), [["__scopeId", "data-v-4b6c01de"]]),
|
|
200
|
+
}), [["__scopeId", "data-v-4b6c01de"]]), K = ["for"], fe = [
|
|
197
201
|
"id",
|
|
198
202
|
"value",
|
|
199
203
|
"name",
|
|
@@ -203,13 +207,13 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
203
207
|
"readonly",
|
|
204
208
|
"autocomplete",
|
|
205
209
|
"aria-invalid"
|
|
206
|
-
],
|
|
210
|
+
], q = {
|
|
207
211
|
key: 1,
|
|
208
212
|
class: "cc-textarea__message cc-textarea__message--error"
|
|
209
|
-
},
|
|
213
|
+
}, J = {
|
|
210
214
|
key: 2,
|
|
211
215
|
class: "cc-textarea__message"
|
|
212
|
-
},
|
|
216
|
+
}, Y = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
213
217
|
__name: "CcTextarea",
|
|
214
218
|
props: {
|
|
215
219
|
modelValue: { default: "" },
|
|
@@ -239,15 +243,15 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
239
243
|
function l(e) {
|
|
240
244
|
i("update:modelValue", e.target.value);
|
|
241
245
|
}
|
|
242
|
-
return (t, n) => (
|
|
246
|
+
return (t, n) => (_(), o("div", { class: p(["cc-textarea", {
|
|
243
247
|
"cc-textarea--error": c.value,
|
|
244
248
|
"cc-textarea--disabled": e.disabled
|
|
245
249
|
}]) }, [
|
|
246
|
-
e.label ? (
|
|
250
|
+
e.label ? (_(), o("label", {
|
|
247
251
|
key: 0,
|
|
248
252
|
class: "cc-textarea__label",
|
|
249
253
|
for: e.name
|
|
250
|
-
},
|
|
254
|
+
}, w(e.label), 9, K)) : a("", !0),
|
|
251
255
|
s("textarea", {
|
|
252
256
|
id: e.name,
|
|
253
257
|
class: "cc-textarea__control",
|
|
@@ -262,28 +266,28 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
262
266
|
onInput: l,
|
|
263
267
|
onFocus: n[0] ||= (e) => i("focus", e),
|
|
264
268
|
onBlur: n[1] ||= (e) => i("blur", e)
|
|
265
|
-
}, null, 40,
|
|
266
|
-
e.error ? (
|
|
269
|
+
}, null, 40, fe),
|
|
270
|
+
e.error ? (_(), o("p", q, w(e.error), 1)) : e.hint ? (_(), o("p", J, w(e.hint), 1)) : a("", !0)
|
|
267
271
|
], 2));
|
|
268
272
|
}
|
|
269
|
-
}), [["__scopeId", "data-v-9840d15e"]]),
|
|
273
|
+
}), [["__scopeId", "data-v-9840d15e"]]), pe = ["for"], X = { class: "cc-select__wrap" }, me = [
|
|
270
274
|
"id",
|
|
271
275
|
"value",
|
|
272
276
|
"name",
|
|
273
277
|
"disabled",
|
|
274
278
|
"aria-invalid"
|
|
275
|
-
],
|
|
279
|
+
], he = {
|
|
276
280
|
key: 0,
|
|
277
281
|
value: "",
|
|
278
282
|
disabled: "",
|
|
279
283
|
selected: ""
|
|
280
|
-
},
|
|
284
|
+
}, ge = ["value", "disabled"], _e = {
|
|
281
285
|
key: 1,
|
|
282
286
|
class: "cc-select__message cc-select__message--error"
|
|
283
|
-
},
|
|
287
|
+
}, ve = {
|
|
284
288
|
key: 2,
|
|
285
289
|
class: "cc-select__message"
|
|
286
|
-
},
|
|
290
|
+
}, ye = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
287
291
|
__name: "CcSelect",
|
|
288
292
|
props: {
|
|
289
293
|
modelValue: { default: "" },
|
|
@@ -305,16 +309,16 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
305
309
|
let t = e.target;
|
|
306
310
|
c("update:modelValue", t.value), c("change", e);
|
|
307
311
|
}
|
|
308
|
-
return (n, r) => (
|
|
312
|
+
return (n, r) => (_(), o("div", { class: p(["cc-select", {
|
|
309
313
|
"cc-select--error": l.value,
|
|
310
314
|
"cc-select--disabled": t.disabled
|
|
311
315
|
}]) }, [
|
|
312
|
-
t.label ? (
|
|
316
|
+
t.label ? (_(), o("label", {
|
|
313
317
|
key: 0,
|
|
314
318
|
class: "cc-select__label",
|
|
315
319
|
for: t.name
|
|
316
|
-
},
|
|
317
|
-
s("div",
|
|
320
|
+
}, w(t.label), 9, pe)) : a("", !0),
|
|
321
|
+
s("div", X, [s("select", {
|
|
318
322
|
id: t.name,
|
|
319
323
|
class: "cc-select__control",
|
|
320
324
|
value: t.modelValue,
|
|
@@ -322,11 +326,11 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
322
326
|
disabled: t.disabled,
|
|
323
327
|
"aria-invalid": l.value || void 0,
|
|
324
328
|
onChange: u
|
|
325
|
-
}, [t.placeholder ? (
|
|
329
|
+
}, [t.placeholder ? (_(), o("option", he, w(t.placeholder), 1)) : a("", !0), (_(!0), o(e, null, b(t.options, (e) => (_(), o("option", {
|
|
326
330
|
key: String(e.value),
|
|
327
331
|
value: e.value,
|
|
328
332
|
disabled: e.disabled
|
|
329
|
-
},
|
|
333
|
+
}, w(e.label), 9, ge))), 128))], 40, me), r[0] ||= s("svg", {
|
|
330
334
|
class: "cc-select__chevron",
|
|
331
335
|
width: "16",
|
|
332
336
|
height: "16",
|
|
@@ -340,19 +344,19 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
340
344
|
"stroke-linecap": "round",
|
|
341
345
|
"stroke-linejoin": "round"
|
|
342
346
|
})], -1)]),
|
|
343
|
-
t.error ? (
|
|
347
|
+
t.error ? (_(), o("p", _e, w(t.error), 1)) : t.hint ? (_(), o("p", ve, w(t.hint), 1)) : a("", !0)
|
|
344
348
|
], 2));
|
|
345
349
|
}
|
|
346
|
-
}), [["__scopeId", "data-v-0e1871e6"]]),
|
|
350
|
+
}), [["__scopeId", "data-v-0e1871e6"]]), be = [
|
|
347
351
|
"aria-checked",
|
|
348
352
|
"aria-label",
|
|
349
353
|
"disabled"
|
|
350
|
-
],
|
|
354
|
+
], xe = {
|
|
351
355
|
key: 0,
|
|
352
356
|
class: "cc-switch__label"
|
|
353
|
-
},
|
|
357
|
+
}, Se = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
354
358
|
__name: "CcSwitch",
|
|
355
|
-
props: /*@__PURE__*/
|
|
359
|
+
props: /*@__PURE__*/ f({
|
|
356
360
|
label: { default: void 0 },
|
|
357
361
|
disabled: {
|
|
358
362
|
type: Boolean,
|
|
@@ -368,13 +372,13 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
368
372
|
}),
|
|
369
373
|
emits: ["update:modelValue"],
|
|
370
374
|
setup(e) {
|
|
371
|
-
let t =
|
|
375
|
+
let t = E(e, "modelValue"), n = e;
|
|
372
376
|
function r() {
|
|
373
377
|
n.disabled || (t.value = !t.value);
|
|
374
378
|
}
|
|
375
|
-
return (n, i) => (
|
|
379
|
+
return (n, i) => (_(), o("button", {
|
|
376
380
|
type: "button",
|
|
377
|
-
class:
|
|
381
|
+
class: p(["cc-switch", [`cc-switch--${e.size}`, {
|
|
378
382
|
"cc-switch--checked": t.value,
|
|
379
383
|
"cc-switch--disabled": e.disabled
|
|
380
384
|
}]]),
|
|
@@ -383,14 +387,14 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
383
387
|
"aria-label": e.label || "switch",
|
|
384
388
|
disabled: e.disabled,
|
|
385
389
|
onClick: r
|
|
386
|
-
}, [i[0] ||= s("span", { class: "cc-switch__track" }, [s("span", { class: "cc-switch__knob" })], -1), e.label ? (
|
|
390
|
+
}, [i[0] ||= s("span", { class: "cc-switch__track" }, [s("span", { class: "cc-switch__knob" })], -1), e.label ? (_(), o("span", xe, w(e.label), 1)) : a("", !0)], 10, be));
|
|
387
391
|
}
|
|
388
|
-
}), [["__scopeId", "data-v-cb8ad6ea"]]),
|
|
392
|
+
}), [["__scopeId", "data-v-cb8ad6ea"]]), Ce = ["disabled"], we = {
|
|
389
393
|
key: 0,
|
|
390
394
|
class: "cc-checkbox__label"
|
|
391
|
-
},
|
|
395
|
+
}, Z = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
392
396
|
__name: "CcCheckbox",
|
|
393
|
-
props: /*@__PURE__*/
|
|
397
|
+
props: /*@__PURE__*/ f({
|
|
394
398
|
label: { default: void 0 },
|
|
395
399
|
disabled: {
|
|
396
400
|
type: Boolean,
|
|
@@ -405,14 +409,14 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
405
409
|
}),
|
|
406
410
|
emits: ["update:modelValue"],
|
|
407
411
|
setup(e) {
|
|
408
|
-
let t =
|
|
409
|
-
return (n, r) => (
|
|
410
|
-
|
|
412
|
+
let t = E(e, "modelValue");
|
|
413
|
+
return (n, r) => (_(), o("label", { class: p(["cc-checkbox", { "cc-checkbox--disabled": e.disabled }]) }, [
|
|
414
|
+
A(s("input", {
|
|
411
415
|
"onUpdate:modelValue": r[0] ||= (e) => t.value = e,
|
|
412
416
|
type: "checkbox",
|
|
413
417
|
class: "cc-checkbox__native",
|
|
414
418
|
disabled: e.disabled
|
|
415
|
-
}, null, 8,
|
|
419
|
+
}, null, 8, Ce), [[D, t.value]]),
|
|
416
420
|
r[1] ||= s("span", {
|
|
417
421
|
class: "cc-checkbox__box",
|
|
418
422
|
"aria-hidden": "true"
|
|
@@ -429,16 +433,16 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
429
433
|
"stroke-linecap": "round",
|
|
430
434
|
"stroke-linejoin": "round"
|
|
431
435
|
})])], -1),
|
|
432
|
-
e.label ? (
|
|
433
|
-
|
|
436
|
+
e.label ? (_(), o("span", we, w(e.label), 1)) : a("", !0),
|
|
437
|
+
x(n.$slots, "default", {}, void 0, !0)
|
|
434
438
|
], 2));
|
|
435
439
|
}
|
|
436
|
-
}), [["__scopeId", "data-v-bf838053"]]),
|
|
440
|
+
}), [["__scopeId", "data-v-bf838053"]]), Te = ["value", "disabled"], Ee = {
|
|
437
441
|
key: 0,
|
|
438
442
|
class: "cc-radio__label"
|
|
439
|
-
},
|
|
443
|
+
}, De = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
440
444
|
__name: "CcRadio",
|
|
441
|
-
props: /*@__PURE__*/
|
|
445
|
+
props: /*@__PURE__*/ f({
|
|
442
446
|
value: {},
|
|
443
447
|
label: { default: void 0 },
|
|
444
448
|
disabled: {
|
|
@@ -451,36 +455,36 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
451
455
|
}),
|
|
452
456
|
emits: ["update:modelValue"],
|
|
453
457
|
setup(e) {
|
|
454
|
-
let t =
|
|
455
|
-
return (n, r) => (
|
|
456
|
-
|
|
458
|
+
let t = E(e, "modelValue");
|
|
459
|
+
return (n, r) => (_(), o("label", { class: p(["cc-radio", { "cc-radio--disabled": e.disabled }]) }, [
|
|
460
|
+
A(s("input", {
|
|
457
461
|
"onUpdate:modelValue": r[0] ||= (e) => t.value = e,
|
|
458
462
|
type: "radio",
|
|
459
463
|
class: "cc-radio__native",
|
|
460
464
|
value: e.value,
|
|
461
465
|
disabled: e.disabled
|
|
462
|
-
}, null, 8,
|
|
466
|
+
}, null, 8, Te), [[ne, t.value]]),
|
|
463
467
|
r[1] ||= s("span", {
|
|
464
468
|
class: "cc-radio__dot",
|
|
465
469
|
"aria-hidden": "true"
|
|
466
470
|
}, null, -1),
|
|
467
|
-
e.label ? (
|
|
468
|
-
|
|
471
|
+
e.label ? (_(), o("span", Ee, w(e.label), 1)) : a("", !0),
|
|
472
|
+
x(n.$slots, "default", {}, void 0, !0)
|
|
469
473
|
], 2));
|
|
470
474
|
}
|
|
471
|
-
}), [["__scopeId", "data-v-0a6c4d47"]]),
|
|
475
|
+
}), [["__scopeId", "data-v-0a6c4d47"]]), Oe = {
|
|
472
476
|
key: 0,
|
|
473
477
|
class: "cc-card__header"
|
|
474
|
-
},
|
|
478
|
+
}, ke = {
|
|
475
479
|
key: 0,
|
|
476
480
|
class: "cc-card__title"
|
|
477
|
-
},
|
|
481
|
+
}, Ae = {
|
|
478
482
|
key: 1,
|
|
479
483
|
class: "cc-card__desc"
|
|
480
|
-
},
|
|
484
|
+
}, je = { class: "cc-card__body" }, Me = {
|
|
481
485
|
key: 0,
|
|
482
486
|
class: "cc-card__footer"
|
|
483
|
-
},
|
|
487
|
+
}, Ne = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
484
488
|
__name: "CcCard",
|
|
485
489
|
props: {
|
|
486
490
|
variant: { default: "feature" },
|
|
@@ -492,16 +496,16 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
492
496
|
}
|
|
493
497
|
},
|
|
494
498
|
setup(e) {
|
|
495
|
-
return (t, n) => (
|
|
496
|
-
|
|
497
|
-
s("div",
|
|
498
|
-
t.$slots.footer ? (
|
|
499
|
+
return (t, n) => (_(), o("article", { class: p(["cc-card", [`cc-card--${e.variant}`, { "cc-card--flush": e.flush }]]) }, [
|
|
500
|
+
x(t.$slots, "header", {}, () => [e.title || e.description ? (_(), o("header", Oe, [e.title ? (_(), o("h3", ke, w(e.title), 1)) : a("", !0), e.description ? (_(), o("p", Ae, w(e.description), 1)) : a("", !0)])) : a("", !0)], !0),
|
|
501
|
+
s("div", je, [x(t.$slots, "default", {}, void 0, !0)]),
|
|
502
|
+
t.$slots.footer ? (_(), o("footer", Me, [x(t.$slots, "footer", {}, void 0, !0)])) : a("", !0)
|
|
499
503
|
], 2));
|
|
500
504
|
}
|
|
501
|
-
}), [["__scopeId", "data-v-7f39ac3e"]]),
|
|
505
|
+
}), [["__scopeId", "data-v-7f39ac3e"]]), Pe = {
|
|
502
506
|
key: 0,
|
|
503
507
|
class: "cc-tag__dot"
|
|
504
|
-
},
|
|
508
|
+
}, Fe = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
505
509
|
__name: "CcTag",
|
|
506
510
|
props: {
|
|
507
511
|
variant: { default: "soft" },
|
|
@@ -518,15 +522,15 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
518
522
|
emits: ["close"],
|
|
519
523
|
setup(e, { emit: t }) {
|
|
520
524
|
let n = t;
|
|
521
|
-
return (t, r) => (
|
|
522
|
-
e.dot ? (
|
|
523
|
-
|
|
524
|
-
e.closable ? (
|
|
525
|
+
return (t, r) => (_(), o("span", { class: p(["cc-tag", [`cc-tag--${e.variant}`, `cc-tag--${e.size}`]]) }, [
|
|
526
|
+
e.dot ? (_(), o("span", Pe)) : a("", !0),
|
|
527
|
+
x(t.$slots, "default", {}, void 0, !0),
|
|
528
|
+
e.closable ? (_(), o("button", {
|
|
525
529
|
key: 1,
|
|
526
530
|
type: "button",
|
|
527
531
|
class: "cc-tag__close",
|
|
528
532
|
"aria-label": "close tag",
|
|
529
|
-
onClick: r[0] ||=
|
|
533
|
+
onClick: r[0] ||= ae((e) => n("close", e), ["stop"])
|
|
530
534
|
}, [...r[1] ||= [s("svg", {
|
|
531
535
|
width: "10",
|
|
532
536
|
height: "10",
|
|
@@ -541,7 +545,7 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
541
545
|
})], -1)]])) : a("", !0)
|
|
542
546
|
], 2));
|
|
543
547
|
}
|
|
544
|
-
}), [["__scopeId", "data-v-858b2086"]]),
|
|
548
|
+
}), [["__scopeId", "data-v-858b2086"]]), Ie = { class: "cc-badge__text tnum" }, Le = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
545
549
|
__name: "CcBadge",
|
|
546
550
|
props: {
|
|
547
551
|
count: { default: 0 },
|
|
@@ -558,15 +562,15 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
558
562
|
let e = Number(t.count);
|
|
559
563
|
return Number.isNaN(e) ? String(t.count) : e > t.max ? `${t.max}+` : String(e);
|
|
560
564
|
});
|
|
561
|
-
return (t, r) => (
|
|
565
|
+
return (t, r) => (_(), o("span", { class: p(["cc-badge", [`cc-badge--${e.variant}`, { "cc-badge--dot-only": e.dot }]]) }, [s("span", Ie, w(n.value), 1)], 2));
|
|
562
566
|
}
|
|
563
|
-
}), [["__scopeId", "data-v-466a4bd0"]]),
|
|
567
|
+
}), [["__scopeId", "data-v-466a4bd0"]]), Re = { class: "cc-alert__content" }, ze = {
|
|
564
568
|
key: 0,
|
|
565
569
|
class: "cc-alert__title"
|
|
566
|
-
},
|
|
570
|
+
}, Be = {
|
|
567
571
|
key: 1,
|
|
568
572
|
class: "cc-alert__desc"
|
|
569
|
-
},
|
|
573
|
+
}, Ve = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
570
574
|
__name: "CcAlert",
|
|
571
575
|
props: {
|
|
572
576
|
variant: { default: "info" },
|
|
@@ -578,7 +582,7 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
578
582
|
}
|
|
579
583
|
},
|
|
580
584
|
setup(e) {
|
|
581
|
-
let t = e, n =
|
|
585
|
+
let t = e, n = y(!0), i = r(() => {
|
|
582
586
|
switch (t.variant) {
|
|
583
587
|
case "success": return "var(--cc-success)";
|
|
584
588
|
case "warning": return "var(--cc-warning)";
|
|
@@ -586,14 +590,14 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
586
590
|
default: return "var(--cc-primary)";
|
|
587
591
|
}
|
|
588
592
|
});
|
|
589
|
-
return (t, r) => n.value ? (
|
|
593
|
+
return (t, r) => n.value ? (_(), o("div", {
|
|
590
594
|
key: 0,
|
|
591
|
-
class:
|
|
595
|
+
class: p(["cc-alert", `cc-alert--${e.variant}`]),
|
|
592
596
|
role: "alert"
|
|
593
597
|
}, [
|
|
594
598
|
s("span", {
|
|
595
599
|
class: "cc-alert__icon",
|
|
596
|
-
style:
|
|
600
|
+
style: m({ color: i.value }),
|
|
597
601
|
"aria-hidden": "true"
|
|
598
602
|
}, [...r[1] ||= [s("svg", {
|
|
599
603
|
width: "16",
|
|
@@ -620,8 +624,8 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
620
624
|
fill: "currentColor"
|
|
621
625
|
})
|
|
622
626
|
], -1)]], 4),
|
|
623
|
-
s("div",
|
|
624
|
-
e.closable ? (
|
|
627
|
+
s("div", Re, [e.title ? (_(), o("p", ze, w(e.title), 1)) : a("", !0), e.description || t.$slots.default ? (_(), o("p", Be, [x(t.$slots, "default", {}, () => [l(w(e.description), 1)], !0)])) : a("", !0)]),
|
|
628
|
+
e.closable ? (_(), o("button", {
|
|
625
629
|
key: 0,
|
|
626
630
|
type: "button",
|
|
627
631
|
class: "cc-alert__close",
|
|
@@ -641,13 +645,13 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
641
645
|
})], -1)]])) : a("", !0)
|
|
642
646
|
], 2)) : a("", !0);
|
|
643
647
|
}
|
|
644
|
-
}), [["__scopeId", "data-v-8671adaf"]]),
|
|
648
|
+
}), [["__scopeId", "data-v-8671adaf"]]), He = ["aria-label"], Ue = { class: "cc-modal__header" }, We = {
|
|
645
649
|
key: 0,
|
|
646
650
|
class: "cc-modal__title"
|
|
647
|
-
},
|
|
651
|
+
}, Ge = { class: "cc-modal__body" }, Ke = {
|
|
648
652
|
key: 0,
|
|
649
653
|
class: "cc-modal__footer"
|
|
650
|
-
},
|
|
654
|
+
}, qe = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
651
655
|
__name: "CcModal",
|
|
652
656
|
props: {
|
|
653
657
|
visible: {
|
|
@@ -675,38 +679,38 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
675
679
|
"close"
|
|
676
680
|
],
|
|
677
681
|
setup(e, { emit: r }) {
|
|
678
|
-
let c = e,
|
|
682
|
+
let c = e, l = r, d = y(null);
|
|
679
683
|
function f() {
|
|
680
|
-
|
|
684
|
+
l("update:visible", !1), l("close");
|
|
681
685
|
}
|
|
682
|
-
function
|
|
686
|
+
function p(e) {
|
|
683
687
|
e.key === "Escape" && c.visible && c.closable && f();
|
|
684
688
|
}
|
|
685
|
-
function
|
|
689
|
+
function v(e) {
|
|
686
690
|
c.maskClosable && e.target === e.currentTarget && f();
|
|
687
691
|
}
|
|
688
|
-
return
|
|
689
|
-
e ? (
|
|
690
|
-
}),
|
|
691
|
-
document.addEventListener("keydown",
|
|
692
|
-
}),
|
|
693
|
-
document.removeEventListener("keydown",
|
|
694
|
-
}), (r, c) => (
|
|
695
|
-
default:
|
|
692
|
+
return O(() => c.visible, async (e) => {
|
|
693
|
+
e ? (l("open"), await ee(), d.value?.focus(), document.body.style.overflow = "hidden") : document.body.style.overflow = "";
|
|
694
|
+
}), g(() => {
|
|
695
|
+
document.addEventListener("keydown", p);
|
|
696
|
+
}), h(() => {
|
|
697
|
+
document.removeEventListener("keydown", p), document.body.style.overflow = "";
|
|
698
|
+
}), (r, c) => (_(), i(t, { to: "body" }, [u(n, { name: "cc-modal" }, {
|
|
699
|
+
default: k(() => [e.visible ? (_(), o("div", {
|
|
696
700
|
key: 0,
|
|
697
701
|
class: "cc-modal",
|
|
698
|
-
onClick:
|
|
702
|
+
onClick: ae(v, ["self"])
|
|
699
703
|
}, [s("div", {
|
|
700
704
|
ref_key: "panel",
|
|
701
705
|
ref: d,
|
|
702
706
|
class: "cc-modal__panel",
|
|
703
|
-
style:
|
|
707
|
+
style: m({ maxWidth: e.width }),
|
|
704
708
|
role: "dialog",
|
|
705
709
|
"aria-modal": "true",
|
|
706
710
|
"aria-label": e.title || "dialog",
|
|
707
711
|
tabindex: "-1"
|
|
708
712
|
}, [
|
|
709
|
-
s("header",
|
|
713
|
+
s("header", Ue, [e.title ? (_(), o("h3", We, w(e.title), 1)) : a("", !0), e.closable ? (_(), o("button", {
|
|
710
714
|
key: 1,
|
|
711
715
|
type: "button",
|
|
712
716
|
class: "cc-modal__close",
|
|
@@ -724,13 +728,13 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
724
728
|
"stroke-width": "1.4",
|
|
725
729
|
"stroke-linecap": "round"
|
|
726
730
|
})], -1)]])) : a("", !0)]),
|
|
727
|
-
s("div",
|
|
728
|
-
r.$slots.footer ? (
|
|
729
|
-
], 12,
|
|
731
|
+
s("div", Ge, [x(r.$slots, "default", {}, void 0, !0)]),
|
|
732
|
+
r.$slots.footer ? (_(), o("footer", Ke, [x(r.$slots, "footer", {}, void 0, !0)])) : a("", !0)
|
|
733
|
+
], 12, He)])) : a("", !0)]),
|
|
730
734
|
_: 3
|
|
731
735
|
})]));
|
|
732
736
|
}
|
|
733
|
-
}), [["__scopeId", "data-v-d2a6d4fd"]]),
|
|
737
|
+
}), [["__scopeId", "data-v-d2a6d4fd"]]), Je = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
734
738
|
__name: "CcTooltip",
|
|
735
739
|
props: {
|
|
736
740
|
content: { default: void 0 },
|
|
@@ -738,81 +742,948 @@ var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
|
738
742
|
delay: { default: 0 }
|
|
739
743
|
},
|
|
740
744
|
setup(e) {
|
|
741
|
-
let t = e, n =
|
|
742
|
-
function
|
|
745
|
+
let t = e, n = y(!1), i = null, s = r(() => n.value);
|
|
746
|
+
function c() {
|
|
743
747
|
t.delay > 0 ? i = setTimeout(() => n.value = !0, t.delay) : n.value = !0;
|
|
744
748
|
}
|
|
745
749
|
function u() {
|
|
746
750
|
i && clearTimeout(i), n.value = !1;
|
|
747
751
|
}
|
|
748
|
-
return (t, n) => (
|
|
752
|
+
return (t, n) => (_(), o("span", {
|
|
749
753
|
class: "cc-tooltip",
|
|
750
|
-
onMouseenter:
|
|
754
|
+
onMouseenter: c,
|
|
751
755
|
onMouseleave: u,
|
|
752
|
-
onFocusin:
|
|
756
|
+
onFocusin: c,
|
|
753
757
|
onFocusout: u
|
|
754
|
-
}, [
|
|
758
|
+
}, [x(t.$slots, "default", {}, void 0, !0), s.value && (e.content || t.$slots.tip) ? (_(), o("span", {
|
|
755
759
|
key: 0,
|
|
756
|
-
class:
|
|
760
|
+
class: p(["cc-tooltip__bubble", `cc-tooltip--${e.placement}`]),
|
|
757
761
|
role: "tooltip"
|
|
758
|
-
}, [
|
|
762
|
+
}, [x(t.$slots, "tip", {}, () => [l(w(e.content), 1)], !0)], 2)) : a("", !0)], 32));
|
|
759
763
|
}
|
|
760
|
-
}), [["__scopeId", "data-v-2befb04b"]]),
|
|
764
|
+
}), [["__scopeId", "data-v-2befb04b"]]), Ye = {
|
|
761
765
|
key: 0,
|
|
762
766
|
class: "cc-divider__label"
|
|
763
|
-
},
|
|
767
|
+
}, Xe = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
764
768
|
__name: "CcDivider",
|
|
765
769
|
props: {
|
|
766
770
|
orientation: { default: "horizontal" },
|
|
767
771
|
height: { default: "1em" }
|
|
768
772
|
},
|
|
769
773
|
setup(e) {
|
|
770
|
-
return (t, n) => (
|
|
771
|
-
class:
|
|
774
|
+
return (t, n) => (_(), o("div", {
|
|
775
|
+
class: p(["cc-divider", [`cc-divider--${e.orientation}`]]),
|
|
772
776
|
role: "separator",
|
|
773
|
-
style:
|
|
774
|
-
}, [t.$slots.default ? (
|
|
777
|
+
style: m(e.orientation === "vertical" ? { height: e.height } : void 0)
|
|
778
|
+
}, [t.$slots.default ? (_(), o("span", Ye, [x(t.$slots, "default", {}, void 0, !0)])) : a("", !0)], 6));
|
|
779
|
+
}
|
|
780
|
+
}), [["__scopeId", "data-v-c42961cd"]]), Ze = { class: "cc-table" }, Qe = { class: "cc-table__toolbar" }, $e = { class: "cc-table__filters" }, et = {
|
|
781
|
+
key: 0,
|
|
782
|
+
class: "cc-table__filter"
|
|
783
|
+
}, tt = { class: "cc-table__filter-label" }, nt = ["onUpdate:modelValue"], rt = ["value"], it = {
|
|
784
|
+
key: 1,
|
|
785
|
+
class: "cc-table__filter"
|
|
786
|
+
}, at = { class: "cc-table__filter-label" }, ot = ["onUpdate:modelValue", "placeholder"], st = { class: "cc-table__settings" }, ct = { class: "cc-table__settings-panel" }, lt = { class: "cc-table__settings-section" }, ut = { class: "cc-table__density" }, dt = ["onClick"], ft = { class: "cc-table__settings-section" }, pt = { class: "cc-table__settings-cols" }, mt = [
|
|
787
|
+
"draggable",
|
|
788
|
+
"onDragstart",
|
|
789
|
+
"onDragover",
|
|
790
|
+
"onDrop"
|
|
791
|
+
], ht = ["checked", "indeterminate"], gt = {
|
|
792
|
+
key: 1,
|
|
793
|
+
class: "cc-table__th-title"
|
|
794
|
+
}, _t = {
|
|
795
|
+
key: 0,
|
|
796
|
+
class: "cc-table__drag-handle",
|
|
797
|
+
width: "10",
|
|
798
|
+
height: "14",
|
|
799
|
+
viewBox: "0 0 10 14",
|
|
800
|
+
fill: "none",
|
|
801
|
+
"aria-hidden": "true"
|
|
802
|
+
}, vt = { key: 0 }, yt = ["colspan"], bt = [
|
|
803
|
+
"checked",
|
|
804
|
+
"aria-label",
|
|
805
|
+
"onChange"
|
|
806
|
+
], xt = { class: "cc-table__footer" }, St = { class: "cc-table__total" }, Ct = { class: "cc-table__pager" }, wt = ["value"], Tt = ["disabled"], Et = ["onClick"], Dt = {
|
|
807
|
+
key: 1,
|
|
808
|
+
class: "cc-table__page-ellipsis"
|
|
809
|
+
}, Ot = ["disabled"], kt = "__selection__", At = 48, jt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
810
|
+
__name: "CcTable",
|
|
811
|
+
props: /*@__PURE__*/ f({
|
|
812
|
+
columns: {},
|
|
813
|
+
data: {},
|
|
814
|
+
rowKey: { default: "id" },
|
|
815
|
+
tableKey: { default: "default" },
|
|
816
|
+
showSelection: {
|
|
817
|
+
type: Boolean,
|
|
818
|
+
default: !0
|
|
819
|
+
},
|
|
820
|
+
pageSizeOptions: { default: () => [
|
|
821
|
+
10,
|
|
822
|
+
20,
|
|
823
|
+
50
|
|
824
|
+
] },
|
|
825
|
+
defaultDensity: { default: "medium" },
|
|
826
|
+
emptyText: { default: "暂无数据" },
|
|
827
|
+
maxHeight: { default: void 0 }
|
|
828
|
+
}, {
|
|
829
|
+
selectedKeys: { default: () => [] },
|
|
830
|
+
selectedKeysModifiers: {}
|
|
831
|
+
}),
|
|
832
|
+
emits: /*@__PURE__*/ f(["selection-change"], ["update:selectedKeys"]),
|
|
833
|
+
setup(t, { emit: n }) {
|
|
834
|
+
let d = t, f = E(t, "selectedKeys"), ee = n, h = [
|
|
835
|
+
{
|
|
836
|
+
label: "大",
|
|
837
|
+
value: "large"
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
label: "中",
|
|
841
|
+
value: "medium"
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
label: "小",
|
|
845
|
+
value: "small"
|
|
846
|
+
}
|
|
847
|
+
], v = r(() => `cc-table:${d.tableKey}`), S = y([]), C = te({}), T = y(d.defaultDensity), D = y(!1);
|
|
848
|
+
function ne() {
|
|
849
|
+
let e = null;
|
|
850
|
+
try {
|
|
851
|
+
let t = localStorage.getItem(v.value);
|
|
852
|
+
t && (e = JSON.parse(t));
|
|
853
|
+
} catch {
|
|
854
|
+
e = null;
|
|
855
|
+
}
|
|
856
|
+
let t = d.columns.map((e) => e.key), n = (e?.order ?? []).filter((e) => t.includes(e));
|
|
857
|
+
S.value = [...n, ...t.filter((e) => !n.includes(e))];
|
|
858
|
+
for (let n of t) C[n] = e?.visibility?.[n] ?? !0;
|
|
859
|
+
e?.density && h.some((t) => t.value === e.density) && (T.value = e.density);
|
|
860
|
+
}
|
|
861
|
+
function ae() {
|
|
862
|
+
let e = {
|
|
863
|
+
v: 1,
|
|
864
|
+
order: S.value,
|
|
865
|
+
visibility: { ...C },
|
|
866
|
+
density: T.value
|
|
867
|
+
};
|
|
868
|
+
try {
|
|
869
|
+
localStorage.setItem(v.value, JSON.stringify(e));
|
|
870
|
+
} catch {}
|
|
871
|
+
}
|
|
872
|
+
function j() {
|
|
873
|
+
S.value = d.columns.map((e) => e.key);
|
|
874
|
+
for (let e of d.columns.map((e) => e.key)) C[e] = !0;
|
|
875
|
+
T.value = d.defaultDensity, D.value = !1;
|
|
876
|
+
}
|
|
877
|
+
O([
|
|
878
|
+
S,
|
|
879
|
+
C,
|
|
880
|
+
T
|
|
881
|
+
], ae, { deep: !0 }), O(() => d.columns.map((e) => e.key), (e) => {
|
|
882
|
+
for (let t of e) S.value.includes(t) || S.value.push(t), C[t] === void 0 && (C[t] = !0);
|
|
883
|
+
});
|
|
884
|
+
function M(e) {
|
|
885
|
+
return e.width ?? 140;
|
|
886
|
+
}
|
|
887
|
+
let oe = r(() => d.columns.filter((e) => !e.fixed)), N = r(() => {
|
|
888
|
+
let e = new Map(S.value.map((e, t) => [e, t]));
|
|
889
|
+
return d.columns.filter((e) => !e.fixed).filter((e) => C[e.key] !== !1).sort((t, n) => (e.get(t.key) ?? 0) - (e.get(n.key) ?? 0));
|
|
890
|
+
}), P = r(() => {
|
|
891
|
+
let e = [], t = (e) => ({
|
|
892
|
+
key: e.key,
|
|
893
|
+
title: e.title,
|
|
894
|
+
width: M(e),
|
|
895
|
+
slot: e.slot ?? "",
|
|
896
|
+
align: e.align ?? "left",
|
|
897
|
+
fixed: e.fixed,
|
|
898
|
+
filterable: e.filterable,
|
|
899
|
+
filterType: e.filterType ?? "text",
|
|
900
|
+
filterOptions: e.filterOptions,
|
|
901
|
+
formatter: e.formatter
|
|
902
|
+
});
|
|
903
|
+
d.showSelection && e.push({
|
|
904
|
+
key: kt,
|
|
905
|
+
title: "",
|
|
906
|
+
width: At,
|
|
907
|
+
slot: "",
|
|
908
|
+
align: "center",
|
|
909
|
+
left: 0,
|
|
910
|
+
isSelection: !0
|
|
911
|
+
});
|
|
912
|
+
let n = d.columns.filter((e) => e.fixed === "left"), r = d.showSelection ? At : 0;
|
|
913
|
+
n.forEach((i, a) => {
|
|
914
|
+
e.push({
|
|
915
|
+
...t(i),
|
|
916
|
+
left: r,
|
|
917
|
+
isLastLeftFixed: a === n.length - 1
|
|
918
|
+
}), r += M(i);
|
|
919
|
+
});
|
|
920
|
+
for (let n of N.value) e.push(t(n));
|
|
921
|
+
let i = d.columns.filter((e) => e.fixed === "right"), a = 0, o = /* @__PURE__ */ new Map();
|
|
922
|
+
for (let e = i.length - 1; e >= 0; e--) o.set(i[e].key, a), a += M(i[e]);
|
|
923
|
+
for (let n of i) e.push({
|
|
924
|
+
...t(n),
|
|
925
|
+
right: o.get(n.key)
|
|
926
|
+
});
|
|
927
|
+
return e;
|
|
928
|
+
}), F = y(null), I = y(null);
|
|
929
|
+
function L(e) {
|
|
930
|
+
return !e.fixed && !e.isSelection;
|
|
931
|
+
}
|
|
932
|
+
function se(e, t) {
|
|
933
|
+
L(e) && (F.value = e.key, I.value = null, t.dataTransfer && (t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData("text/plain", e.key)));
|
|
934
|
+
}
|
|
935
|
+
function ce(e, t) {
|
|
936
|
+
F.value && e.key !== F.value && L(e) && (t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), I.value = e.key);
|
|
937
|
+
}
|
|
938
|
+
function R(e, t) {
|
|
939
|
+
t.preventDefault();
|
|
940
|
+
let n = F.value;
|
|
941
|
+
if (!n || n === e.key) return;
|
|
942
|
+
let r = N.value.map((e) => e.key), i = r.indexOf(n), a = r.indexOf(e.key);
|
|
943
|
+
if (i < 0 || a < 0) return;
|
|
944
|
+
let o = [...r];
|
|
945
|
+
o.splice(i, 1);
|
|
946
|
+
let s = i < a ? a - 1 : a;
|
|
947
|
+
o.splice(s, 0, n);
|
|
948
|
+
let c = d.columns.filter((e) => e.fixed === "left").map((e) => e.key), l = d.columns.filter((e) => e.fixed === "right").map((e) => e.key);
|
|
949
|
+
S.value = [
|
|
950
|
+
...c,
|
|
951
|
+
...o,
|
|
952
|
+
...l
|
|
953
|
+
], I.value = null;
|
|
954
|
+
}
|
|
955
|
+
function z() {
|
|
956
|
+
F.value = null, I.value = null;
|
|
957
|
+
}
|
|
958
|
+
let B = te({}), le = r(() => P.value.filter((e) => e.filterable && !e.isSelection)), ue = r(() => Object.values(B).some((e) => e !== "")), H = r(() => {
|
|
959
|
+
let e = Object.entries(B).filter(([, e]) => e !== "");
|
|
960
|
+
return e.length ? d.data.filter((t) => e.every(([e, n]) => {
|
|
961
|
+
let r = t[e];
|
|
962
|
+
return r == null ? !1 : d.columns.find((t) => t.key === e)?.filterType === "select" ? String(r) === n : String(r).toLowerCase().includes(n.toLowerCase());
|
|
963
|
+
})) : d.data;
|
|
964
|
+
});
|
|
965
|
+
function de() {
|
|
966
|
+
for (let e of Object.keys(B)) B[e] = "";
|
|
967
|
+
W.value = 1;
|
|
968
|
+
}
|
|
969
|
+
let U = y(d.pageSizeOptions[0] ?? 10), W = y(1), G = r(() => Math.max(1, Math.ceil(H.value.length / U.value))), K = r(() => H.value.slice((W.value - 1) * U.value, W.value * U.value)), fe = r(() => {
|
|
970
|
+
let e = G.value, t = W.value;
|
|
971
|
+
if (e <= 7) return Array.from({ length: e }, (e, t) => t + 1);
|
|
972
|
+
let n = [.../* @__PURE__ */ new Set([
|
|
973
|
+
1,
|
|
974
|
+
e,
|
|
975
|
+
t - 1,
|
|
976
|
+
t,
|
|
977
|
+
t + 1
|
|
978
|
+
])].filter((t) => t >= 1 && t <= e).sort((e, t) => e - t), r = [], i = 0;
|
|
979
|
+
for (let e of n) e - i > 1 && r.push("…"), r.push(e), i = e;
|
|
980
|
+
return r;
|
|
981
|
+
});
|
|
982
|
+
O([H, U], () => {
|
|
983
|
+
W.value > G.value && (W.value = G.value);
|
|
984
|
+
});
|
|
985
|
+
function q(e) {
|
|
986
|
+
W.value = Math.min(Math.max(1, e), G.value);
|
|
987
|
+
}
|
|
988
|
+
function J(e) {
|
|
989
|
+
let t = e[d.rowKey];
|
|
990
|
+
return t == null ? JSON.stringify(e) : String(t);
|
|
991
|
+
}
|
|
992
|
+
function Y(e) {
|
|
993
|
+
return f.value.includes(J(e));
|
|
994
|
+
}
|
|
995
|
+
function pe(e) {
|
|
996
|
+
let t = J(e);
|
|
997
|
+
f.value.includes(t) ? f.value = f.value.filter((e) => e !== t) : f.value = [...f.value, t];
|
|
998
|
+
}
|
|
999
|
+
let X = r(() => K.value.length > 0 && K.value.every((e) => Y(e))), me = r(() => !X.value && K.value.some((e) => Y(e)));
|
|
1000
|
+
function he() {
|
|
1001
|
+
if (X.value) {
|
|
1002
|
+
let e = new Set(K.value.map((e) => J(e)));
|
|
1003
|
+
f.value = f.value.filter((t) => !e.has(t));
|
|
1004
|
+
} else {
|
|
1005
|
+
let e = new Set(f.value);
|
|
1006
|
+
for (let t of K.value) e.add(J(t));
|
|
1007
|
+
f.value = [...e];
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
O(f, (e) => {
|
|
1011
|
+
let t = e.map((e) => d.data.find((t) => J(t) === e)).filter((e) => !!e);
|
|
1012
|
+
ee("selection-change", e, t);
|
|
1013
|
+
}, { deep: !0 });
|
|
1014
|
+
function ge(e, t) {
|
|
1015
|
+
let n = t[e.key];
|
|
1016
|
+
return n == null ? "—" : e.formatter ? e.formatter(n, t) : String(n);
|
|
1017
|
+
}
|
|
1018
|
+
return g(ne), (n, r) => (_(), o("div", Ze, [
|
|
1019
|
+
s("div", Qe, [s("div", $e, [(_(!0), o(e, null, b(le.value, (t) => (_(), o(e, { key: t.key }, [t.filterType === "select" ? (_(), o("label", et, [s("span", tt, w(t.title), 1), A(s("select", {
|
|
1020
|
+
"onUpdate:modelValue": (e) => B[t.key] = e,
|
|
1021
|
+
class: "cc-table__filter-control"
|
|
1022
|
+
}, [r[5] ||= s("option", { value: "" }, "全部", -1), (_(!0), o(e, null, b(t.filterOptions, (e) => (_(), o("option", {
|
|
1023
|
+
key: String(e.value),
|
|
1024
|
+
value: String(e.value)
|
|
1025
|
+
}, w(e.label), 9, rt))), 128))], 8, nt), [[re, B[t.key]]])])) : (_(), o("label", it, [s("span", at, w(t.title), 1), A(s("input", {
|
|
1026
|
+
"onUpdate:modelValue": (e) => B[t.key] = e,
|
|
1027
|
+
class: "cc-table__filter-control",
|
|
1028
|
+
type: "text",
|
|
1029
|
+
placeholder: `搜索${t.title}`
|
|
1030
|
+
}, null, 8, ot), [[ie, B[t.key]]])]))], 64))), 128)), ue.value ? (_(), i(V, {
|
|
1031
|
+
key: 0,
|
|
1032
|
+
size: "sm",
|
|
1033
|
+
variant: "ghost",
|
|
1034
|
+
onClick: de
|
|
1035
|
+
}, {
|
|
1036
|
+
default: k(() => [...r[6] ||= [l(" 重置 ", -1)]]),
|
|
1037
|
+
_: 1
|
|
1038
|
+
})) : a("", !0)]), s("div", st, [u(V, {
|
|
1039
|
+
size: "sm",
|
|
1040
|
+
variant: "secondary",
|
|
1041
|
+
onClick: r[0] ||= (e) => D.value = !D.value
|
|
1042
|
+
}, {
|
|
1043
|
+
default: k(() => [...r[7] ||= [l(" 列设置 ", -1)]]),
|
|
1044
|
+
_: 1
|
|
1045
|
+
}), D.value ? (_(), o(e, { key: 0 }, [s("div", {
|
|
1046
|
+
class: "cc-table__backdrop",
|
|
1047
|
+
onClick: r[1] ||= (e) => D.value = !1
|
|
1048
|
+
}), s("div", ct, [
|
|
1049
|
+
s("div", lt, [r[8] ||= s("div", { class: "cc-table__settings-title" }, "表格密度", -1), s("div", ut, [(_(), o(e, null, b(h, (e) => s("button", {
|
|
1050
|
+
key: e.value,
|
|
1051
|
+
type: "button",
|
|
1052
|
+
class: p(["cc-table__density-btn", { "cc-table__density-btn--active": T.value === e.value }]),
|
|
1053
|
+
onClick: (t) => T.value = e.value
|
|
1054
|
+
}, w(e.label), 11, dt)), 64))])]),
|
|
1055
|
+
s("div", ft, [r[9] ||= s("div", { class: "cc-table__settings-title" }, "显示列", -1), s("div", pt, [(_(!0), o(e, null, b(oe.value, (e) => (_(), i(Z, {
|
|
1056
|
+
key: e.key,
|
|
1057
|
+
modelValue: C[e.key],
|
|
1058
|
+
"onUpdate:modelValue": (t) => C[e.key] = t
|
|
1059
|
+
}, {
|
|
1060
|
+
default: k(() => [l(w(e.title), 1)]),
|
|
1061
|
+
_: 2
|
|
1062
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"]))), 128))])]),
|
|
1063
|
+
s("button", {
|
|
1064
|
+
type: "button",
|
|
1065
|
+
class: "cc-table__settings-reset",
|
|
1066
|
+
onClick: j
|
|
1067
|
+
}, "恢复默认")
|
|
1068
|
+
])], 64)) : a("", !0)])]),
|
|
1069
|
+
s("div", {
|
|
1070
|
+
class: "cc-table__scroll",
|
|
1071
|
+
style: m({ maxHeight: t.maxHeight })
|
|
1072
|
+
}, [s("table", { class: p(["cc-table__table", `cc-table--${T.value}`]) }, [
|
|
1073
|
+
s("colgroup", null, [(_(!0), o(e, null, b(P.value, (e) => (_(), o("col", {
|
|
1074
|
+
key: e.key,
|
|
1075
|
+
style: m({ width: `${e.width}px` })
|
|
1076
|
+
}, null, 4))), 128))]),
|
|
1077
|
+
s("thead", null, [s("tr", null, [(_(!0), o(e, null, b(P.value, (e) => (_(), o("th", {
|
|
1078
|
+
key: e.key,
|
|
1079
|
+
class: p(["cc-table__th", [
|
|
1080
|
+
`cc-table__cell--${e.align}`,
|
|
1081
|
+
{ "cc-table__th--fixed-left": e.fixed === "left" || e.isSelection },
|
|
1082
|
+
{ "cc-table__th--fixed-left-end": e.isLastLeftFixed },
|
|
1083
|
+
{ "cc-table__th--fixed-right": e.fixed === "right" },
|
|
1084
|
+
{ "cc-table__th--draggable": L(e) },
|
|
1085
|
+
{ "cc-table__th--dragging": F.value === e.key },
|
|
1086
|
+
{ "cc-table__th--drop-target": I.value === e.key }
|
|
1087
|
+
]]),
|
|
1088
|
+
style: m({
|
|
1089
|
+
left: e.left == null ? void 0 : `${e.left}px`,
|
|
1090
|
+
right: e.right == null ? void 0 : `${e.right}px`
|
|
1091
|
+
}),
|
|
1092
|
+
draggable: L(e),
|
|
1093
|
+
onDragstart: (t) => se(e, t),
|
|
1094
|
+
onDragover: (t) => ce(e, t),
|
|
1095
|
+
onDrop: (t) => R(e, t),
|
|
1096
|
+
onDragend: z
|
|
1097
|
+
}, [e.isSelection ? (_(), o("input", {
|
|
1098
|
+
key: 0,
|
|
1099
|
+
type: "checkbox",
|
|
1100
|
+
class: "cc-table__check",
|
|
1101
|
+
checked: X.value,
|
|
1102
|
+
indeterminate: me.value,
|
|
1103
|
+
"aria-label": "选择本页全部",
|
|
1104
|
+
onChange: he
|
|
1105
|
+
}, null, 40, ht)) : (_(), o("span", gt, [l(w(e.title) + " ", 1), L(e) ? (_(), o("svg", _t, [...r[10] ||= [c("<circle cx=\"3\" cy=\"2.5\" r=\"1\" fill=\"currentColor\" data-v-e1238af3></circle><circle cx=\"7\" cy=\"2.5\" r=\"1\" fill=\"currentColor\" data-v-e1238af3></circle><circle cx=\"3\" cy=\"7\" r=\"1\" fill=\"currentColor\" data-v-e1238af3></circle><circle cx=\"7\" cy=\"7\" r=\"1\" fill=\"currentColor\" data-v-e1238af3></circle><circle cx=\"3\" cy=\"11.5\" r=\"1\" fill=\"currentColor\" data-v-e1238af3></circle><circle cx=\"7\" cy=\"11.5\" r=\"1\" fill=\"currentColor\" data-v-e1238af3></circle>", 6)]])) : a("", !0)]))], 46, mt))), 128))])]),
|
|
1106
|
+
s("tbody", null, [K.value.length ? a("", !0) : (_(), o("tr", vt, [s("td", {
|
|
1107
|
+
class: "cc-table__empty",
|
|
1108
|
+
colspan: P.value.length
|
|
1109
|
+
}, w(t.emptyText), 9, yt)])), (_(!0), o(e, null, b(K.value, (t) => (_(), o("tr", {
|
|
1110
|
+
key: J(t),
|
|
1111
|
+
class: "cc-table__row"
|
|
1112
|
+
}, [(_(!0), o(e, null, b(P.value, (r) => (_(), o("td", {
|
|
1113
|
+
key: r.key,
|
|
1114
|
+
class: p(["cc-table__td", [
|
|
1115
|
+
`cc-table__cell--${r.align}`,
|
|
1116
|
+
{ "cc-table__td--fixed-left": r.fixed === "left" || r.isSelection },
|
|
1117
|
+
{ "cc-table__td--fixed-left-end": r.isLastLeftFixed },
|
|
1118
|
+
{ "cc-table__td--fixed-right": r.fixed === "right" }
|
|
1119
|
+
]]),
|
|
1120
|
+
style: m({
|
|
1121
|
+
left: r.left == null ? void 0 : `${r.left}px`,
|
|
1122
|
+
right: r.right == null ? void 0 : `${r.right}px`
|
|
1123
|
+
})
|
|
1124
|
+
}, [r.isSelection ? (_(), o("input", {
|
|
1125
|
+
key: 0,
|
|
1126
|
+
type: "checkbox",
|
|
1127
|
+
class: "cc-table__check",
|
|
1128
|
+
checked: Y(t),
|
|
1129
|
+
"aria-label": `选择第 ${J(t)} 行`,
|
|
1130
|
+
onChange: (e) => pe(t)
|
|
1131
|
+
}, null, 40, bt)) : r.slot ? x(n.$slots, r.slot, {
|
|
1132
|
+
row: t,
|
|
1133
|
+
value: t[r.key]
|
|
1134
|
+
}, void 0, !0, 1) : (_(), o(e, { key: 2 }, [l(w(ge(r, t)), 1)], 64))], 6))), 128))]))), 128))])
|
|
1135
|
+
], 2)], 4),
|
|
1136
|
+
s("div", xt, [s("span", St, "共 " + w(H.value.length) + " 条", 1), s("div", Ct, [
|
|
1137
|
+
r[13] ||= s("span", { class: "cc-table__pager-size" }, "每页", -1),
|
|
1138
|
+
A(s("select", {
|
|
1139
|
+
"onUpdate:modelValue": r[2] ||= (e) => U.value = e,
|
|
1140
|
+
class: "cc-table__pagesize"
|
|
1141
|
+
}, [(_(!0), o(e, null, b(t.pageSizeOptions, (e) => (_(), o("option", {
|
|
1142
|
+
key: e,
|
|
1143
|
+
value: e
|
|
1144
|
+
}, w(e), 9, wt))), 128))], 512), [[
|
|
1145
|
+
re,
|
|
1146
|
+
U.value,
|
|
1147
|
+
void 0,
|
|
1148
|
+
{ number: !0 }
|
|
1149
|
+
]]),
|
|
1150
|
+
r[14] ||= s("span", { class: "cc-table__pager-size" }, "条", -1),
|
|
1151
|
+
s("button", {
|
|
1152
|
+
type: "button",
|
|
1153
|
+
class: "cc-table__page-btn",
|
|
1154
|
+
disabled: W.value <= 1,
|
|
1155
|
+
"aria-label": "上一页",
|
|
1156
|
+
onClick: r[3] ||= (e) => q(W.value - 1)
|
|
1157
|
+
}, [...r[11] ||= [s("svg", {
|
|
1158
|
+
width: "14",
|
|
1159
|
+
height: "14",
|
|
1160
|
+
viewBox: "0 0 16 16",
|
|
1161
|
+
fill: "none",
|
|
1162
|
+
"aria-hidden": "true"
|
|
1163
|
+
}, [s("path", {
|
|
1164
|
+
d: "M10 4l-4 4 4 4",
|
|
1165
|
+
stroke: "currentColor",
|
|
1166
|
+
"stroke-width": "1.6",
|
|
1167
|
+
"stroke-linecap": "round",
|
|
1168
|
+
"stroke-linejoin": "round"
|
|
1169
|
+
})], -1)]], 8, Tt),
|
|
1170
|
+
(_(!0), o(e, null, b(fe.value, (t, n) => (_(), o(e, { key: `${t}-${n}` }, [t === "…" ? (_(), o("span", Dt, "…")) : (_(), o("button", {
|
|
1171
|
+
key: 0,
|
|
1172
|
+
type: "button",
|
|
1173
|
+
class: p(["cc-table__page-btn cc-table__page-btn--num", { "cc-table__page-btn--active": W.value === t }]),
|
|
1174
|
+
onClick: (e) => q(t)
|
|
1175
|
+
}, w(t), 11, Et))], 64))), 128)),
|
|
1176
|
+
s("button", {
|
|
1177
|
+
type: "button",
|
|
1178
|
+
class: "cc-table__page-btn",
|
|
1179
|
+
disabled: W.value >= G.value,
|
|
1180
|
+
"aria-label": "下一页",
|
|
1181
|
+
onClick: r[4] ||= (e) => q(W.value + 1)
|
|
1182
|
+
}, [...r[12] ||= [s("svg", {
|
|
1183
|
+
width: "14",
|
|
1184
|
+
height: "14",
|
|
1185
|
+
viewBox: "0 0 16 16",
|
|
1186
|
+
fill: "none",
|
|
1187
|
+
"aria-hidden": "true"
|
|
1188
|
+
}, [s("path", {
|
|
1189
|
+
d: "M6 4l4 4-4 4",
|
|
1190
|
+
stroke: "currentColor",
|
|
1191
|
+
"stroke-width": "1.6",
|
|
1192
|
+
"stroke-linecap": "round",
|
|
1193
|
+
"stroke-linejoin": "round"
|
|
1194
|
+
})], -1)]], 8, Ot)
|
|
1195
|
+
])])
|
|
1196
|
+
]));
|
|
1197
|
+
}
|
|
1198
|
+
}), [["__scopeId", "data-v-e1238af3"]]), Mt = [
|
|
1199
|
+
"#533afd",
|
|
1200
|
+
"#635bff",
|
|
1201
|
+
"#00d4ff",
|
|
1202
|
+
"#00c48a",
|
|
1203
|
+
"#f6a609",
|
|
1204
|
+
"#ff5c8a",
|
|
1205
|
+
"#8a6bff",
|
|
1206
|
+
"#22d3ee"
|
|
1207
|
+
], Nt = [
|
|
1208
|
+
"#635bff",
|
|
1209
|
+
"#00d4ff",
|
|
1210
|
+
"#00c48a",
|
|
1211
|
+
"#f6a609",
|
|
1212
|
+
"#ff5c8a",
|
|
1213
|
+
"#a78bfa",
|
|
1214
|
+
"#22d3ee",
|
|
1215
|
+
"#f472b6"
|
|
1216
|
+
], Pt = "#5b6472", Ft = "#9aa3b5", It = "rgba(28, 30, 84, 0.96)";
|
|
1217
|
+
function Q(e) {
|
|
1218
|
+
return {
|
|
1219
|
+
backgroundColor: e ? It : "#ffffff",
|
|
1220
|
+
borderColor: e ? "rgba(255, 255, 255, 0.12)" : "#e6e8ef",
|
|
1221
|
+
borderWidth: 1,
|
|
1222
|
+
padding: [8, 12],
|
|
1223
|
+
textStyle: {
|
|
1224
|
+
color: e ? "#f4f5fa" : "#0d253d",
|
|
1225
|
+
fontSize: 12
|
|
1226
|
+
},
|
|
1227
|
+
extraCssText: "box-shadow: 0 8px 24px rgba(13, 37, 61, 0.12); border-radius: 10px;"
|
|
1228
|
+
};
|
|
1229
|
+
}
|
|
1230
|
+
function Lt(e) {
|
|
1231
|
+
return {
|
|
1232
|
+
show: !0,
|
|
1233
|
+
top: 0,
|
|
1234
|
+
icon: "circle",
|
|
1235
|
+
itemWidth: 8,
|
|
1236
|
+
itemHeight: 8,
|
|
1237
|
+
itemGap: 14,
|
|
1238
|
+
textStyle: {
|
|
1239
|
+
color: e ? Ft : Pt,
|
|
1240
|
+
fontSize: 12
|
|
1241
|
+
}
|
|
1242
|
+
};
|
|
1243
|
+
}
|
|
1244
|
+
function Rt(e) {
|
|
1245
|
+
return {
|
|
1246
|
+
lineStyle: { color: e ? "rgba(255, 255, 255, 0.14)" : "#e6e8ef" },
|
|
1247
|
+
axisLabel: { color: e ? Ft : Pt },
|
|
1248
|
+
splitLine: { lineStyle: { color: e ? "rgba(255, 255, 255, 0.07)" : "#eef0f5" } }
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
//#endregion
|
|
1252
|
+
//#region src/components/Chart/useECharts.ts
|
|
1253
|
+
j.use([
|
|
1254
|
+
M,
|
|
1255
|
+
oe,
|
|
1256
|
+
N,
|
|
1257
|
+
P,
|
|
1258
|
+
F,
|
|
1259
|
+
I,
|
|
1260
|
+
L
|
|
1261
|
+
]);
|
|
1262
|
+
function zt(e) {
|
|
1263
|
+
let t = C(void 0), n;
|
|
1264
|
+
g(() => {
|
|
1265
|
+
e.value && (t.value = j.init(e.value), n = new ResizeObserver(() => {
|
|
1266
|
+
t.value?.resize();
|
|
1267
|
+
}), n.observe(e.value));
|
|
1268
|
+
});
|
|
1269
|
+
function r(e) {
|
|
1270
|
+
t.value && t.value.setOption(e, { notMerge: !0 });
|
|
1271
|
+
}
|
|
1272
|
+
return h(() => {
|
|
1273
|
+
n?.disconnect(), t.value?.dispose(), t.value = void 0;
|
|
1274
|
+
}), {
|
|
1275
|
+
chart: t,
|
|
1276
|
+
setOption: r
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1279
|
+
//#endregion
|
|
1280
|
+
//#region src/components/Chart/CcBarChart.vue
|
|
1281
|
+
var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
1282
|
+
__name: "CcBarChart",
|
|
1283
|
+
props: {
|
|
1284
|
+
categories: {},
|
|
1285
|
+
series: {},
|
|
1286
|
+
height: { default: 320 },
|
|
1287
|
+
horizontal: {
|
|
1288
|
+
type: Boolean,
|
|
1289
|
+
default: !1
|
|
1290
|
+
},
|
|
1291
|
+
stacked: {
|
|
1292
|
+
type: Boolean,
|
|
1293
|
+
default: !1
|
|
1294
|
+
},
|
|
1295
|
+
rounded: {
|
|
1296
|
+
type: Boolean,
|
|
1297
|
+
default: !0
|
|
1298
|
+
},
|
|
1299
|
+
showLegend: {
|
|
1300
|
+
type: Boolean,
|
|
1301
|
+
default: !0
|
|
1302
|
+
},
|
|
1303
|
+
colors: { default: void 0 },
|
|
1304
|
+
dark: {
|
|
1305
|
+
type: Boolean,
|
|
1306
|
+
default: !1
|
|
1307
|
+
}
|
|
1308
|
+
},
|
|
1309
|
+
setup(e) {
|
|
1310
|
+
let t = e, n = y(), { setOption: i } = zt(n), a = r(() => {
|
|
1311
|
+
let e = t.colors ?? (t.dark ? Nt : Mt), n = Rt(t.dark), r = {
|
|
1312
|
+
...n,
|
|
1313
|
+
type: "value",
|
|
1314
|
+
axisLine: { show: !1 },
|
|
1315
|
+
axisTick: { show: !1 },
|
|
1316
|
+
splitLine: {
|
|
1317
|
+
show: !0,
|
|
1318
|
+
lineStyle: { color: t.dark ? "rgba(255, 255, 255, 0.07)" : "#eef0f5" }
|
|
1319
|
+
}
|
|
1320
|
+
}, i = {
|
|
1321
|
+
...n,
|
|
1322
|
+
type: "category",
|
|
1323
|
+
data: t.categories,
|
|
1324
|
+
axisTick: { show: !1 },
|
|
1325
|
+
splitLine: { show: !1 }
|
|
1326
|
+
};
|
|
1327
|
+
return {
|
|
1328
|
+
color: e,
|
|
1329
|
+
backgroundColor: "transparent",
|
|
1330
|
+
animationDuration: 500,
|
|
1331
|
+
grid: {
|
|
1332
|
+
left: 8,
|
|
1333
|
+
right: 12,
|
|
1334
|
+
top: t.showLegend ? 38 : 14,
|
|
1335
|
+
bottom: 6,
|
|
1336
|
+
containLabel: !0
|
|
1337
|
+
},
|
|
1338
|
+
legend: t.showLegend ? Lt(t.dark) : { show: !1 },
|
|
1339
|
+
tooltip: {
|
|
1340
|
+
...Q(t.dark),
|
|
1341
|
+
trigger: "axis",
|
|
1342
|
+
axisPointer: {
|
|
1343
|
+
type: "shadow",
|
|
1344
|
+
shadowStyle: { color: t.dark ? "rgba(255,255,255,0.04)" : "rgba(83,58,253,0.05)" }
|
|
1345
|
+
}
|
|
1346
|
+
},
|
|
1347
|
+
xAxis: t.horizontal ? r : i,
|
|
1348
|
+
yAxis: t.horizontal ? i : r,
|
|
1349
|
+
series: t.series.map((e) => ({
|
|
1350
|
+
name: e.name,
|
|
1351
|
+
type: "bar",
|
|
1352
|
+
data: e.data,
|
|
1353
|
+
stack: t.stacked ? "total" : void 0,
|
|
1354
|
+
barMaxWidth: t.horizontal ? 22 : 36,
|
|
1355
|
+
itemStyle: { borderRadius: t.rounded ? t.horizontal ? [
|
|
1356
|
+
0,
|
|
1357
|
+
4,
|
|
1358
|
+
4,
|
|
1359
|
+
0
|
|
1360
|
+
] : [
|
|
1361
|
+
4,
|
|
1362
|
+
4,
|
|
1363
|
+
0,
|
|
1364
|
+
0
|
|
1365
|
+
] : 0 },
|
|
1366
|
+
emphasis: { itemStyle: {
|
|
1367
|
+
shadowBlur: 8,
|
|
1368
|
+
shadowColor: "rgba(13, 37, 61, 0.18)"
|
|
1369
|
+
} }
|
|
1370
|
+
}))
|
|
1371
|
+
};
|
|
1372
|
+
});
|
|
1373
|
+
return O(a, (e) => i(e), { deep: !0 }), g(() => i(a.value)), (t, r) => (_(), o("div", {
|
|
1374
|
+
class: "cc-chart cc-chart--bar",
|
|
1375
|
+
style: m({ height: `${e.height}px` })
|
|
1376
|
+
}, [s("div", {
|
|
1377
|
+
ref_key: "chartEl",
|
|
1378
|
+
ref: n,
|
|
1379
|
+
class: "cc-chart__canvas"
|
|
1380
|
+
}, null, 512)], 4));
|
|
1381
|
+
}
|
|
1382
|
+
}), [["__scopeId", "data-v-f3347dd9"]]), Vt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
1383
|
+
__name: "CcPieChart",
|
|
1384
|
+
props: {
|
|
1385
|
+
data: {},
|
|
1386
|
+
height: { default: 320 },
|
|
1387
|
+
donut: {
|
|
1388
|
+
type: Boolean,
|
|
1389
|
+
default: !1
|
|
1390
|
+
},
|
|
1391
|
+
rose: {
|
|
1392
|
+
type: Boolean,
|
|
1393
|
+
default: !1
|
|
1394
|
+
},
|
|
1395
|
+
showLegend: {
|
|
1396
|
+
type: Boolean,
|
|
1397
|
+
default: !0
|
|
1398
|
+
},
|
|
1399
|
+
showLabels: {
|
|
1400
|
+
type: Boolean,
|
|
1401
|
+
default: !1
|
|
1402
|
+
},
|
|
1403
|
+
colors: { default: void 0 },
|
|
1404
|
+
dark: {
|
|
1405
|
+
type: Boolean,
|
|
1406
|
+
default: !1
|
|
1407
|
+
}
|
|
1408
|
+
},
|
|
1409
|
+
setup(e) {
|
|
1410
|
+
let t = e, n = y(), { setOption: i } = zt(n), a = r(() => {
|
|
1411
|
+
let e = t.colors ?? (t.dark ? Nt : Mt), n = t.showLegend ? Lt(t.dark) : { show: !1 };
|
|
1412
|
+
return {
|
|
1413
|
+
color: e,
|
|
1414
|
+
backgroundColor: "transparent",
|
|
1415
|
+
animationDuration: 600,
|
|
1416
|
+
legend: t.showLegend ? {
|
|
1417
|
+
...n,
|
|
1418
|
+
bottom: 0,
|
|
1419
|
+
top: void 0
|
|
1420
|
+
} : { show: !1 },
|
|
1421
|
+
tooltip: {
|
|
1422
|
+
...Q(t.dark),
|
|
1423
|
+
trigger: "item",
|
|
1424
|
+
valueFormatter: (e) => String(e)
|
|
1425
|
+
},
|
|
1426
|
+
series: [{
|
|
1427
|
+
name: "占比",
|
|
1428
|
+
type: "pie",
|
|
1429
|
+
radius: t.donut ? ["46%", "70%"] : t.rose ? ["16%", "72%"] : "72%",
|
|
1430
|
+
roseType: t.rose ? "radius" : void 0,
|
|
1431
|
+
center: ["50%", t.showLegend ? "44%" : "50%"],
|
|
1432
|
+
itemStyle: {
|
|
1433
|
+
borderRadius: 5,
|
|
1434
|
+
borderColor: t.dark ? "#121430" : "#ffffff",
|
|
1435
|
+
borderWidth: 2
|
|
1436
|
+
},
|
|
1437
|
+
label: {
|
|
1438
|
+
show: t.showLabels,
|
|
1439
|
+
color: t.dark ? "#f4f5fa" : "#0d253d",
|
|
1440
|
+
fontSize: 12,
|
|
1441
|
+
formatter: "{b}\n{d}%"
|
|
1442
|
+
},
|
|
1443
|
+
labelLine: t.showLabels ? {
|
|
1444
|
+
length: 12,
|
|
1445
|
+
length2: 8
|
|
1446
|
+
} : void 0,
|
|
1447
|
+
emphasis: {
|
|
1448
|
+
scaleSize: 6,
|
|
1449
|
+
itemStyle: {
|
|
1450
|
+
shadowBlur: 12,
|
|
1451
|
+
shadowColor: "rgba(13, 37, 61, 0.2)"
|
|
1452
|
+
}
|
|
1453
|
+
},
|
|
1454
|
+
data: t.data
|
|
1455
|
+
}]
|
|
1456
|
+
};
|
|
1457
|
+
});
|
|
1458
|
+
return O(a, (e) => i(e), { deep: !0 }), g(() => i(a.value)), (t, r) => (_(), o("div", {
|
|
1459
|
+
class: "cc-chart cc-chart--pie",
|
|
1460
|
+
style: m({ height: `${e.height}px` })
|
|
1461
|
+
}, [s("div", {
|
|
1462
|
+
ref_key: "chartEl",
|
|
1463
|
+
ref: n,
|
|
1464
|
+
class: "cc-chart__canvas"
|
|
1465
|
+
}, null, 512)], 4));
|
|
1466
|
+
}
|
|
1467
|
+
}), [["__scopeId", "data-v-7fe37b76"]]), Ht = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
1468
|
+
__name: "CcLineChart",
|
|
1469
|
+
props: {
|
|
1470
|
+
categories: {},
|
|
1471
|
+
series: {},
|
|
1472
|
+
height: { default: 320 },
|
|
1473
|
+
smooth: {
|
|
1474
|
+
type: Boolean,
|
|
1475
|
+
default: !0
|
|
1476
|
+
},
|
|
1477
|
+
area: {
|
|
1478
|
+
type: Boolean,
|
|
1479
|
+
default: !1
|
|
1480
|
+
},
|
|
1481
|
+
showDots: {
|
|
1482
|
+
type: Boolean,
|
|
1483
|
+
default: !1
|
|
1484
|
+
},
|
|
1485
|
+
showLegend: {
|
|
1486
|
+
type: Boolean,
|
|
1487
|
+
default: !0
|
|
1488
|
+
},
|
|
1489
|
+
showGrid: {
|
|
1490
|
+
type: Boolean,
|
|
1491
|
+
default: !0
|
|
1492
|
+
},
|
|
1493
|
+
colors: { default: void 0 },
|
|
1494
|
+
dark: {
|
|
1495
|
+
type: Boolean,
|
|
1496
|
+
default: !1
|
|
1497
|
+
}
|
|
1498
|
+
},
|
|
1499
|
+
setup(e) {
|
|
1500
|
+
let t = e, n = y(), { setOption: i } = zt(n), a = r(() => {
|
|
1501
|
+
let e = t.colors ?? (t.dark ? Nt : Mt), n = Rt(t.dark);
|
|
1502
|
+
return {
|
|
1503
|
+
color: e,
|
|
1504
|
+
backgroundColor: "transparent",
|
|
1505
|
+
animationDuration: 600,
|
|
1506
|
+
grid: {
|
|
1507
|
+
left: 8,
|
|
1508
|
+
right: 12,
|
|
1509
|
+
top: t.showLegend ? 38 : 14,
|
|
1510
|
+
bottom: 6,
|
|
1511
|
+
containLabel: !0
|
|
1512
|
+
},
|
|
1513
|
+
legend: t.showLegend ? Lt(t.dark) : { show: !1 },
|
|
1514
|
+
tooltip: {
|
|
1515
|
+
...Q(t.dark),
|
|
1516
|
+
trigger: "axis",
|
|
1517
|
+
axisPointer: {
|
|
1518
|
+
type: "line",
|
|
1519
|
+
lineStyle: {
|
|
1520
|
+
color: t.dark ? "rgba(255,255,255,0.2)" : "rgba(13,37,61,0.18)",
|
|
1521
|
+
type: "dashed"
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
},
|
|
1525
|
+
xAxis: {
|
|
1526
|
+
...n,
|
|
1527
|
+
type: "category",
|
|
1528
|
+
boundaryGap: !1,
|
|
1529
|
+
data: t.categories,
|
|
1530
|
+
axisTick: { show: !1 },
|
|
1531
|
+
splitLine: { show: !1 }
|
|
1532
|
+
},
|
|
1533
|
+
yAxis: {
|
|
1534
|
+
...n,
|
|
1535
|
+
type: "value",
|
|
1536
|
+
axisLine: { show: !1 },
|
|
1537
|
+
axisTick: { show: !1 },
|
|
1538
|
+
splitLine: {
|
|
1539
|
+
show: t.showGrid,
|
|
1540
|
+
lineStyle: { color: t.dark ? "rgba(255, 255, 255, 0.07)" : "#eef0f5" }
|
|
1541
|
+
}
|
|
1542
|
+
},
|
|
1543
|
+
series: t.series.map((e) => ({
|
|
1544
|
+
name: e.name,
|
|
1545
|
+
type: "line",
|
|
1546
|
+
data: e.data,
|
|
1547
|
+
smooth: t.smooth,
|
|
1548
|
+
showSymbol: t.showDots,
|
|
1549
|
+
symbol: "circle",
|
|
1550
|
+
symbolSize: 6,
|
|
1551
|
+
lineStyle: { width: 2.5 },
|
|
1552
|
+
areaStyle: t.area ? { opacity: .08 } : void 0,
|
|
1553
|
+
emphasis: {
|
|
1554
|
+
focus: "series",
|
|
1555
|
+
lineStyle: { width: 3 }
|
|
1556
|
+
}
|
|
1557
|
+
}))
|
|
1558
|
+
};
|
|
1559
|
+
});
|
|
1560
|
+
return O(a, (e) => i(e), { deep: !0 }), g(() => i(a.value)), (t, r) => (_(), o("div", {
|
|
1561
|
+
class: "cc-chart cc-chart--line",
|
|
1562
|
+
style: m({ height: `${e.height}px` })
|
|
1563
|
+
}, [s("div", {
|
|
1564
|
+
ref_key: "chartEl",
|
|
1565
|
+
ref: n,
|
|
1566
|
+
class: "cc-chart__canvas"
|
|
1567
|
+
}, null, 512)], 4));
|
|
1568
|
+
}
|
|
1569
|
+
}), [["__scopeId", "data-v-5300a86d"]]), Ut = [
|
|
1570
|
+
"stripe",
|
|
1571
|
+
"linear",
|
|
1572
|
+
"vercel",
|
|
1573
|
+
"notion",
|
|
1574
|
+
"raycast"
|
|
1575
|
+
], Wt = {
|
|
1576
|
+
stripe: "Stripe · 经典紫",
|
|
1577
|
+
linear: "Linear · 深色薰衣草",
|
|
1578
|
+
vercel: "Vercel · 黑白极简",
|
|
1579
|
+
notion: "Notion · 纸张笔记",
|
|
1580
|
+
raycast: "Raycast · 暗夜白键"
|
|
1581
|
+
}, $ = "data-cc-theme", Gt = Symbol("cc-theme"), Kt = "stripe";
|
|
1582
|
+
function qt(e) {
|
|
1583
|
+
return typeof e == "string" && Ut.includes(e);
|
|
1584
|
+
}
|
|
1585
|
+
function Jt(e) {
|
|
1586
|
+
if (typeof document > "u") return;
|
|
1587
|
+
let t = document.documentElement;
|
|
1588
|
+
if (e === "stripe") {
|
|
1589
|
+
t.removeAttribute($);
|
|
1590
|
+
return;
|
|
1591
|
+
}
|
|
1592
|
+
t.setAttribute($, e);
|
|
1593
|
+
}
|
|
1594
|
+
function Yt() {
|
|
1595
|
+
if (typeof document > "u") return Kt;
|
|
1596
|
+
let e = document.documentElement.getAttribute($);
|
|
1597
|
+
return qt(e) ? e : Kt;
|
|
1598
|
+
}
|
|
1599
|
+
function Xt() {
|
|
1600
|
+
typeof document > "u" || document.documentElement.removeAttribute($);
|
|
1601
|
+
}
|
|
1602
|
+
//#endregion
|
|
1603
|
+
//#region src/components/ThemeProvider/CcThemeProvider.vue
|
|
1604
|
+
var Zt = /* @__PURE__ */ d({
|
|
1605
|
+
__name: "CcThemeProvider",
|
|
1606
|
+
props: {
|
|
1607
|
+
theme: { default: "stripe" },
|
|
1608
|
+
persist: {
|
|
1609
|
+
type: Boolean,
|
|
1610
|
+
default: !1
|
|
1611
|
+
}
|
|
1612
|
+
},
|
|
1613
|
+
emits: ["change"],
|
|
1614
|
+
setup(e, { emit: t }) {
|
|
1615
|
+
let n = e, r = t, i = y(n.theme);
|
|
1616
|
+
v(Gt, i);
|
|
1617
|
+
function a() {
|
|
1618
|
+
if (!n.persist) return n.theme;
|
|
1619
|
+
try {
|
|
1620
|
+
let e = localStorage.getItem("cc-library-theme");
|
|
1621
|
+
if (qt(e)) return e;
|
|
1622
|
+
} catch {}
|
|
1623
|
+
return n.theme;
|
|
1624
|
+
}
|
|
1625
|
+
function o(e) {
|
|
1626
|
+
if (i.value = e, Jt(e), n.persist) try {
|
|
1627
|
+
localStorage.setItem("cc-library-theme", e);
|
|
1628
|
+
} catch {}
|
|
1629
|
+
r("change", e);
|
|
1630
|
+
}
|
|
1631
|
+
return g(() => {
|
|
1632
|
+
o(a());
|
|
1633
|
+
}), O(() => n.theme, (e) => {
|
|
1634
|
+
qt(e) && o(e);
|
|
1635
|
+
}), (e, t) => x(e.$slots, "default");
|
|
775
1636
|
}
|
|
776
|
-
})
|
|
1637
|
+
});
|
|
777
1638
|
//#endregion
|
|
778
1639
|
//#region src/index.ts
|
|
779
|
-
function
|
|
1640
|
+
function Qt(e) {
|
|
780
1641
|
let t = [
|
|
781
|
-
["CcButton",
|
|
782
|
-
["CcInput",
|
|
783
|
-
["CcTextarea",
|
|
784
|
-
["CcSelect",
|
|
785
|
-
["CcSwitch",
|
|
786
|
-
["CcCheckbox",
|
|
787
|
-
["CcRadio",
|
|
788
|
-
["CcCard",
|
|
789
|
-
["CcTag",
|
|
790
|
-
["CcBadge",
|
|
791
|
-
["CcAlert",
|
|
792
|
-
["CcModal",
|
|
793
|
-
["CcTooltip",
|
|
794
|
-
["CcSpinner",
|
|
795
|
-
["CcDivider",
|
|
1642
|
+
["CcButton", V],
|
|
1643
|
+
["CcInput", G],
|
|
1644
|
+
["CcTextarea", Y],
|
|
1645
|
+
["CcSelect", ye],
|
|
1646
|
+
["CcSwitch", Se],
|
|
1647
|
+
["CcCheckbox", Z],
|
|
1648
|
+
["CcRadio", De],
|
|
1649
|
+
["CcCard", Ne],
|
|
1650
|
+
["CcTag", Fe],
|
|
1651
|
+
["CcBadge", Le],
|
|
1652
|
+
["CcAlert", Ve],
|
|
1653
|
+
["CcModal", qe],
|
|
1654
|
+
["CcTooltip", Je],
|
|
1655
|
+
["CcSpinner", z],
|
|
1656
|
+
["CcDivider", Xe],
|
|
1657
|
+
["CcTable", jt],
|
|
1658
|
+
["CcBarChart", Bt],
|
|
1659
|
+
["CcPieChart", Vt],
|
|
1660
|
+
["CcLineChart", Ht],
|
|
1661
|
+
["CcThemeProvider", Zt]
|
|
796
1662
|
];
|
|
797
1663
|
for (let [n, r] of t) e.component(n, r);
|
|
798
1664
|
}
|
|
799
|
-
var
|
|
800
|
-
install:
|
|
801
|
-
CcButton:
|
|
802
|
-
CcInput:
|
|
803
|
-
CcTextarea:
|
|
804
|
-
CcSelect:
|
|
805
|
-
CcSwitch:
|
|
806
|
-
CcCheckbox:
|
|
807
|
-
CcRadio:
|
|
808
|
-
CcCard:
|
|
809
|
-
CcTag:
|
|
810
|
-
CcBadge:
|
|
811
|
-
CcAlert:
|
|
812
|
-
CcModal:
|
|
813
|
-
CcTooltip:
|
|
814
|
-
CcSpinner:
|
|
815
|
-
CcDivider:
|
|
1665
|
+
var $t = {
|
|
1666
|
+
install: Qt,
|
|
1667
|
+
CcButton: V,
|
|
1668
|
+
CcInput: G,
|
|
1669
|
+
CcTextarea: Y,
|
|
1670
|
+
CcSelect: ye,
|
|
1671
|
+
CcSwitch: Se,
|
|
1672
|
+
CcCheckbox: Z,
|
|
1673
|
+
CcRadio: De,
|
|
1674
|
+
CcCard: Ne,
|
|
1675
|
+
CcTag: Fe,
|
|
1676
|
+
CcBadge: Le,
|
|
1677
|
+
CcAlert: Ve,
|
|
1678
|
+
CcModal: qe,
|
|
1679
|
+
CcTooltip: Je,
|
|
1680
|
+
CcSpinner: z,
|
|
1681
|
+
CcDivider: Xe,
|
|
1682
|
+
CcTable: jt,
|
|
1683
|
+
CcBarChart: Bt,
|
|
1684
|
+
CcPieChart: Vt,
|
|
1685
|
+
CcLineChart: Ht,
|
|
1686
|
+
CcThemeProvider: Zt
|
|
816
1687
|
};
|
|
817
1688
|
//#endregion
|
|
818
|
-
export {
|
|
1689
|
+
export { Ut as CC_THEMES, Wt as CC_THEME_LABELS, Ve as CcAlert, Le as CcBadge, Bt as CcBarChart, V as CcButton, Ne as CcCard, Z as CcCheckbox, Xe as CcDivider, G as CcInput, Ht as CcLineChart, qe as CcModal, Vt as CcPieChart, De as CcRadio, ye as CcSelect, z as CcSpinner, Se as CcSwitch, jt as CcTable, Fe as CcTag, Y as CcTextarea, Zt as CcThemeProvider, Je as CcTooltip, $t as default, Yt as getTheme, Qt as install, Xt as resetTheme, Jt as setTheme };
|