common_component_library_vue 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/common-component-library-vue.css +1 -1
- package/dist-lib/common-component-library-vue.mjs +705 -254
- 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/ThemeProvider/CcThemeProvider.vue.d.ts +27 -0
- package/dist-lib/types/index.d.ts +148 -3
- package/dist-lib/types/theme.d.ts +32 -0
- package/package.json +13 -5
- 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, 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
|
|
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 ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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" },
|
|
@@ -70,7 +74,7 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
70
74
|
}
|
|
71
75
|
c("click", e);
|
|
72
76
|
}
|
|
73
|
-
return (t, n) => (
|
|
77
|
+
return (t, n) => (_(), i(S(e.href ? "a" : "button"), {
|
|
74
78
|
class: p(["cc-btn", [
|
|
75
79
|
`cc-btn--${e.variant}`,
|
|
76
80
|
`cc-btn--${e.size}`,
|
|
@@ -87,10 +91,10 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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
96
|
color: l.value
|
|
93
|
-
}, null, 8, ["size", "color"])])) : a("", !0), s("span",
|
|
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,10 +106,10 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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 = [
|
|
109
113
|
"id",
|
|
110
114
|
"type",
|
|
111
115
|
"value",
|
|
@@ -119,13 +123,13 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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 ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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: p(["cc-input__field", { "cc-input__field--prefix": e.prefix }]) }, [e.prefix ? (
|
|
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,
|
|
@@ -189,11 +193,11 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
189
193
|
onFocus: n[0] ||= (e) => i("focus", e),
|
|
190
194
|
onBlur: n[1] ||= (e) => i("blur", e),
|
|
191
195
|
onChange: n[2] ||= (e) => i("change", e)
|
|
192
|
-
}, null, 40,
|
|
193
|
-
e.error ? (
|
|
196
|
+
}, null, 40, de)], 2),
|
|
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 ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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 ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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 ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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 ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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 ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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,17 +344,17 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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
359
|
props: /*@__PURE__*/ f({
|
|
356
360
|
label: { default: void 0 },
|
|
@@ -368,11 +372,11 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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
381
|
class: p(["cc-switch", [`cc-switch--${e.size}`, {
|
|
378
382
|
"cc-switch--checked": t.value,
|
|
@@ -383,12 +387,12 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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
397
|
props: /*@__PURE__*/ f({
|
|
394
398
|
label: { default: void 0 },
|
|
@@ -405,14 +409,14 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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,14 +433,14 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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
445
|
props: /*@__PURE__*/ f({
|
|
442
446
|
value: {},
|
|
@@ -451,36 +455,36 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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 ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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 ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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 ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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 ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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 ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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,7 +590,7 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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
595
|
class: p(["cc-alert", `cc-alert--${e.variant}`]),
|
|
592
596
|
role: "alert"
|
|
@@ -620,8 +624,8 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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 ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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,27 +679,27 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
675
679
|
"close"
|
|
676
680
|
],
|
|
677
681
|
setup(e, { emit: r }) {
|
|
678
|
-
let c = e, l = r, d =
|
|
682
|
+
let c = e, l = r, d = y(null);
|
|
679
683
|
function f() {
|
|
680
684
|
l("update:visible", !1), l("close");
|
|
681
685
|
}
|
|
682
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
|
|
692
|
+
return O(() => c.visible, async (e) => {
|
|
689
693
|
e ? (l("open"), await ee(), d.value?.focus(), document.body.style.overflow = "hidden") : document.body.style.overflow = "";
|
|
690
|
-
}),
|
|
694
|
+
}), g(() => {
|
|
691
695
|
document.addEventListener("keydown", p);
|
|
692
696
|
}), h(() => {
|
|
693
697
|
document.removeEventListener("keydown", p), document.body.style.overflow = "";
|
|
694
|
-
}), (r, c) => (
|
|
695
|
-
default:
|
|
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,
|
|
@@ -706,7 +710,7 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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 ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
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,56 +742,56 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
738
742
|
delay: { default: 0 }
|
|
739
743
|
},
|
|
740
744
|
setup(e) {
|
|
741
|
-
let t = e, n =
|
|
745
|
+
let t = e, n = y(!1), i = null, s = r(() => n.value);
|
|
742
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
754
|
onMouseenter: c,
|
|
751
755
|
onMouseleave: u,
|
|
752
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
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) => (
|
|
774
|
+
return (t, n) => (_(), o("div", {
|
|
771
775
|
class: p(["cc-divider", [`cc-divider--${e.orientation}`]]),
|
|
772
776
|
role: "separator",
|
|
773
777
|
style: m(e.orientation === "vertical" ? { height: e.height } : void 0)
|
|
774
|
-
}, [t.$slots.default ? (
|
|
778
|
+
}, [t.$slots.default ? (_(), o("span", Ye, [x(t.$slots, "default", {}, void 0, !0)])) : a("", !0)], 6));
|
|
775
779
|
}
|
|
776
|
-
}), [["__scopeId", "data-v-c42961cd"]]),
|
|
780
|
+
}), [["__scopeId", "data-v-c42961cd"]]), Ze = { class: "cc-table" }, Qe = { class: "cc-table__toolbar" }, $e = { class: "cc-table__filters" }, et = {
|
|
777
781
|
key: 0,
|
|
778
782
|
class: "cc-table__filter"
|
|
779
|
-
},
|
|
783
|
+
}, tt = { class: "cc-table__filter-label" }, nt = ["onUpdate:modelValue"], rt = ["value"], it = {
|
|
780
784
|
key: 1,
|
|
781
785
|
class: "cc-table__filter"
|
|
782
|
-
},
|
|
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 = [
|
|
783
787
|
"draggable",
|
|
784
788
|
"onDragstart",
|
|
785
789
|
"onDragover",
|
|
786
790
|
"onDrop"
|
|
787
|
-
],
|
|
791
|
+
], ht = ["checked", "indeterminate"], gt = {
|
|
788
792
|
key: 1,
|
|
789
793
|
class: "cc-table__th-title"
|
|
790
|
-
},
|
|
794
|
+
}, _t = {
|
|
791
795
|
key: 0,
|
|
792
796
|
class: "cc-table__drag-handle",
|
|
793
797
|
width: "10",
|
|
@@ -795,14 +799,14 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
795
799
|
viewBox: "0 0 10 14",
|
|
796
800
|
fill: "none",
|
|
797
801
|
"aria-hidden": "true"
|
|
798
|
-
},
|
|
802
|
+
}, vt = { key: 0 }, yt = ["colspan"], bt = [
|
|
799
803
|
"checked",
|
|
800
804
|
"aria-label",
|
|
801
805
|
"onChange"
|
|
802
|
-
],
|
|
806
|
+
], xt = { class: "cc-table__footer" }, St = { class: "cc-table__total" }, Ct = { class: "cc-table__pager" }, wt = ["value"], Tt = ["disabled"], Et = ["onClick"], Dt = {
|
|
803
807
|
key: 1,
|
|
804
808
|
class: "cc-table__page-ellipsis"
|
|
805
|
-
},
|
|
809
|
+
}, Ot = ["disabled"], kt = "__selection__", At = 48, jt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
806
810
|
__name: "CcTable",
|
|
807
811
|
props: /*@__PURE__*/ f({
|
|
808
812
|
columns: {},
|
|
@@ -827,7 +831,7 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
827
831
|
}),
|
|
828
832
|
emits: /*@__PURE__*/ f(["selection-change"], ["update:selectedKeys"]),
|
|
829
833
|
setup(t, { emit: n }) {
|
|
830
|
-
let d = t, f =
|
|
834
|
+
let d = t, f = E(t, "selectedKeys"), ee = n, h = [
|
|
831
835
|
{
|
|
832
836
|
label: "大",
|
|
833
837
|
value: "large"
|
|
@@ -840,50 +844,50 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
840
844
|
label: "小",
|
|
841
845
|
value: "small"
|
|
842
846
|
}
|
|
843
|
-
],
|
|
844
|
-
function
|
|
847
|
+
], v = r(() => `cc-table:${d.tableKey}`), S = y([]), C = te({}), T = y(d.defaultDensity), D = y(!1);
|
|
848
|
+
function ne() {
|
|
845
849
|
let e = null;
|
|
846
850
|
try {
|
|
847
|
-
let t = localStorage.getItem(
|
|
851
|
+
let t = localStorage.getItem(v.value);
|
|
848
852
|
t && (e = JSON.parse(t));
|
|
849
853
|
} catch {
|
|
850
854
|
e = null;
|
|
851
855
|
}
|
|
852
856
|
let t = d.columns.map((e) => e.key), n = (e?.order ?? []).filter((e) => t.includes(e));
|
|
853
|
-
|
|
854
|
-
for (let n of t)
|
|
855
|
-
e?.density && h.some((t) => t.value === e.density) && (
|
|
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);
|
|
856
860
|
}
|
|
857
861
|
function ae() {
|
|
858
862
|
let e = {
|
|
859
863
|
v: 1,
|
|
860
|
-
order:
|
|
861
|
-
visibility: { ...
|
|
862
|
-
density:
|
|
864
|
+
order: S.value,
|
|
865
|
+
visibility: { ...C },
|
|
866
|
+
density: T.value
|
|
863
867
|
};
|
|
864
868
|
try {
|
|
865
|
-
localStorage.setItem(
|
|
869
|
+
localStorage.setItem(v.value, JSON.stringify(e));
|
|
866
870
|
} catch {}
|
|
867
871
|
}
|
|
868
872
|
function j() {
|
|
869
|
-
|
|
870
|
-
for (let e of d.columns.map((e) => e.key))
|
|
871
|
-
|
|
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;
|
|
872
876
|
}
|
|
873
|
-
|
|
877
|
+
O([
|
|
878
|
+
S,
|
|
874
879
|
C,
|
|
875
|
-
T
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
for (let t of e) C.value.includes(t) || C.value.push(t), T[t] === void 0 && (T[t] = !0);
|
|
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);
|
|
879
883
|
});
|
|
880
884
|
function M(e) {
|
|
881
885
|
return e.width ?? 140;
|
|
882
886
|
}
|
|
883
887
|
let oe = r(() => d.columns.filter((e) => !e.fixed)), N = r(() => {
|
|
884
|
-
let e = new Map(
|
|
885
|
-
return d.columns.filter((e) => !e.fixed).filter((e) =>
|
|
886
|
-
}),
|
|
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(() => {
|
|
887
891
|
let e = [], t = (e) => ({
|
|
888
892
|
key: e.key,
|
|
889
893
|
title: e.title,
|
|
@@ -897,15 +901,15 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
897
901
|
formatter: e.formatter
|
|
898
902
|
});
|
|
899
903
|
d.showSelection && e.push({
|
|
900
|
-
key:
|
|
904
|
+
key: kt,
|
|
901
905
|
title: "",
|
|
902
|
-
width:
|
|
906
|
+
width: At,
|
|
903
907
|
slot: "",
|
|
904
908
|
align: "center",
|
|
905
909
|
left: 0,
|
|
906
910
|
isSelection: !0
|
|
907
911
|
});
|
|
908
|
-
let n = d.columns.filter((e) => e.fixed === "left"), r = d.showSelection ?
|
|
912
|
+
let n = d.columns.filter((e) => e.fixed === "left"), r = d.showSelection ? At : 0;
|
|
909
913
|
n.forEach((i, a) => {
|
|
910
914
|
e.push({
|
|
911
915
|
...t(i),
|
|
@@ -921,19 +925,19 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
921
925
|
right: o.get(n.key)
|
|
922
926
|
});
|
|
923
927
|
return e;
|
|
924
|
-
}),
|
|
925
|
-
function
|
|
928
|
+
}), F = y(null), I = y(null);
|
|
929
|
+
function L(e) {
|
|
926
930
|
return !e.fixed && !e.isSelection;
|
|
927
931
|
}
|
|
928
932
|
function se(e, t) {
|
|
929
|
-
|
|
930
|
-
}
|
|
931
|
-
function z(e, t) {
|
|
932
|
-
I.value && e.key !== I.value && R(e) && (t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), L.value = e.key);
|
|
933
|
+
L(e) && (F.value = e.key, I.value = null, t.dataTransfer && (t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData("text/plain", e.key)));
|
|
933
934
|
}
|
|
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) {
|
|
935
939
|
t.preventDefault();
|
|
936
|
-
let n =
|
|
940
|
+
let n = F.value;
|
|
937
941
|
if (!n || n === e.key) return;
|
|
938
942
|
let r = N.value.map((e) => e.key), i = r.indexOf(n), a = r.indexOf(e.key);
|
|
939
943
|
if (i < 0 || a < 0) return;
|
|
@@ -942,16 +946,16 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
942
946
|
let s = i < a ? a - 1 : a;
|
|
943
947
|
o.splice(s, 0, n);
|
|
944
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);
|
|
945
|
-
|
|
949
|
+
S.value = [
|
|
946
950
|
...c,
|
|
947
951
|
...o,
|
|
948
952
|
...l
|
|
949
|
-
],
|
|
953
|
+
], I.value = null;
|
|
950
954
|
}
|
|
951
|
-
function
|
|
952
|
-
|
|
955
|
+
function z() {
|
|
956
|
+
F.value = null, I.value = null;
|
|
953
957
|
}
|
|
954
|
-
let B =
|
|
958
|
+
let B = te({}), le = r(() => P.value.filter((e) => e.filterable && !e.isSelection)), ue = r(() => Object.values(B).some((e) => e !== "")), H = r(() => {
|
|
955
959
|
let e = Object.entries(B).filter(([, e]) => e !== "");
|
|
956
960
|
return e.length ? d.data.filter((t) => e.every(([e, n]) => {
|
|
957
961
|
let r = t[e];
|
|
@@ -962,7 +966,7 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
962
966
|
for (let e of Object.keys(B)) B[e] = "";
|
|
963
967
|
W.value = 1;
|
|
964
968
|
}
|
|
965
|
-
let U =
|
|
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(() => {
|
|
966
970
|
let e = G.value, t = W.value;
|
|
967
971
|
if (e <= 7) return Array.from({ length: e }, (e, t) => t + 1);
|
|
968
972
|
let n = [.../* @__PURE__ */ new Set([
|
|
@@ -975,7 +979,7 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
975
979
|
for (let e of n) e - i > 1 && r.push("…"), r.push(e), i = e;
|
|
976
980
|
return r;
|
|
977
981
|
});
|
|
978
|
-
|
|
982
|
+
O([H, U], () => {
|
|
979
983
|
W.value > G.value && (W.value = G.value);
|
|
980
984
|
});
|
|
981
985
|
function q(e) {
|
|
@@ -988,13 +992,13 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
988
992
|
function Y(e) {
|
|
989
993
|
return f.value.includes(J(e));
|
|
990
994
|
}
|
|
991
|
-
function
|
|
995
|
+
function pe(e) {
|
|
992
996
|
let t = J(e);
|
|
993
997
|
f.value.includes(t) ? f.value = f.value.filter((e) => e !== t) : f.value = [...f.value, t];
|
|
994
998
|
}
|
|
995
|
-
let
|
|
996
|
-
function
|
|
997
|
-
if (
|
|
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) {
|
|
998
1002
|
let e = new Set(K.value.map((e) => J(e)));
|
|
999
1003
|
f.value = f.value.filter((t) => !e.has(t));
|
|
1000
1004
|
} else {
|
|
@@ -1003,57 +1007,57 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
1003
1007
|
f.value = [...e];
|
|
1004
1008
|
}
|
|
1005
1009
|
}
|
|
1006
|
-
|
|
1010
|
+
O(f, (e) => {
|
|
1007
1011
|
let t = e.map((e) => d.data.find((t) => J(t) === e)).filter((e) => !!e);
|
|
1008
1012
|
ee("selection-change", e, t);
|
|
1009
1013
|
}, { deep: !0 });
|
|
1010
|
-
function
|
|
1014
|
+
function ge(e, t) {
|
|
1011
1015
|
let n = t[e.key];
|
|
1012
1016
|
return n == null ? "—" : e.formatter ? e.formatter(n, t) : String(n);
|
|
1013
1017
|
}
|
|
1014
|
-
return
|
|
1015
|
-
s("div",
|
|
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", {
|
|
1016
1020
|
"onUpdate:modelValue": (e) => B[t.key] = e,
|
|
1017
1021
|
class: "cc-table__filter-control"
|
|
1018
|
-
}, [r[5] ||= s("option", { value: "" }, "全部", -1), (
|
|
1022
|
+
}, [r[5] ||= s("option", { value: "" }, "全部", -1), (_(!0), o(e, null, b(t.filterOptions, (e) => (_(), o("option", {
|
|
1019
1023
|
key: String(e.value),
|
|
1020
1024
|
value: String(e.value)
|
|
1021
|
-
},
|
|
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", {
|
|
1022
1026
|
"onUpdate:modelValue": (e) => B[t.key] = e,
|
|
1023
1027
|
class: "cc-table__filter-control",
|
|
1024
1028
|
type: "text",
|
|
1025
1029
|
placeholder: `搜索${t.title}`
|
|
1026
|
-
}, null, 8,
|
|
1030
|
+
}, null, 8, ot), [[ie, B[t.key]]])]))], 64))), 128)), ue.value ? (_(), i(V, {
|
|
1027
1031
|
key: 0,
|
|
1028
1032
|
size: "sm",
|
|
1029
1033
|
variant: "ghost",
|
|
1030
1034
|
onClick: de
|
|
1031
1035
|
}, {
|
|
1032
|
-
default:
|
|
1036
|
+
default: k(() => [...r[6] ||= [l(" 重置 ", -1)]]),
|
|
1033
1037
|
_: 1
|
|
1034
|
-
})) : a("", !0)]), s("div",
|
|
1038
|
+
})) : a("", !0)]), s("div", st, [u(V, {
|
|
1035
1039
|
size: "sm",
|
|
1036
1040
|
variant: "secondary",
|
|
1037
|
-
onClick: r[0] ||= (e) =>
|
|
1041
|
+
onClick: r[0] ||= (e) => D.value = !D.value
|
|
1038
1042
|
}, {
|
|
1039
|
-
default:
|
|
1043
|
+
default: k(() => [...r[7] ||= [l(" 列设置 ", -1)]]),
|
|
1040
1044
|
_: 1
|
|
1041
|
-
}),
|
|
1045
|
+
}), D.value ? (_(), o(e, { key: 0 }, [s("div", {
|
|
1042
1046
|
class: "cc-table__backdrop",
|
|
1043
|
-
onClick: r[1] ||= (e) =>
|
|
1044
|
-
}), s("div",
|
|
1045
|
-
s("div",
|
|
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", {
|
|
1046
1050
|
key: e.value,
|
|
1047
1051
|
type: "button",
|
|
1048
|
-
class: p(["cc-table__density-btn", { "cc-table__density-btn--active":
|
|
1049
|
-
onClick: (t) =>
|
|
1050
|
-
},
|
|
1051
|
-
s("div",
|
|
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, {
|
|
1052
1056
|
key: e.key,
|
|
1053
|
-
modelValue:
|
|
1054
|
-
"onUpdate:modelValue": (t) =>
|
|
1057
|
+
modelValue: C[e.key],
|
|
1058
|
+
"onUpdate:modelValue": (t) => C[e.key] = t
|
|
1055
1059
|
}, {
|
|
1056
|
-
default:
|
|
1060
|
+
default: k(() => [l(w(e.title), 1)]),
|
|
1057
1061
|
_: 2
|
|
1058
1062
|
}, 1032, ["modelValue", "onUpdate:modelValue"]))), 128))])]),
|
|
1059
1063
|
s("button", {
|
|
@@ -1065,47 +1069,47 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
1065
1069
|
s("div", {
|
|
1066
1070
|
class: "cc-table__scroll",
|
|
1067
1071
|
style: m({ maxHeight: t.maxHeight })
|
|
1068
|
-
}, [s("table", { class: p(["cc-table__table", `cc-table--${
|
|
1069
|
-
s("colgroup", null, [(
|
|
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", {
|
|
1070
1074
|
key: e.key,
|
|
1071
1075
|
style: m({ width: `${e.width}px` })
|
|
1072
1076
|
}, null, 4))), 128))]),
|
|
1073
|
-
s("thead", null, [s("tr", null, [(
|
|
1077
|
+
s("thead", null, [s("tr", null, [(_(!0), o(e, null, b(P.value, (e) => (_(), o("th", {
|
|
1074
1078
|
key: e.key,
|
|
1075
1079
|
class: p(["cc-table__th", [
|
|
1076
1080
|
`cc-table__cell--${e.align}`,
|
|
1077
1081
|
{ "cc-table__th--fixed-left": e.fixed === "left" || e.isSelection },
|
|
1078
1082
|
{ "cc-table__th--fixed-left-end": e.isLastLeftFixed },
|
|
1079
1083
|
{ "cc-table__th--fixed-right": e.fixed === "right" },
|
|
1080
|
-
{ "cc-table__th--draggable":
|
|
1081
|
-
{ "cc-table__th--dragging":
|
|
1082
|
-
{ "cc-table__th--drop-target":
|
|
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 }
|
|
1083
1087
|
]]),
|
|
1084
1088
|
style: m({
|
|
1085
1089
|
left: e.left == null ? void 0 : `${e.left}px`,
|
|
1086
1090
|
right: e.right == null ? void 0 : `${e.right}px`
|
|
1087
1091
|
}),
|
|
1088
|
-
draggable:
|
|
1092
|
+
draggable: L(e),
|
|
1089
1093
|
onDragstart: (t) => se(e, t),
|
|
1090
|
-
onDragover: (t) =>
|
|
1091
|
-
onDrop: (t) =>
|
|
1092
|
-
onDragend:
|
|
1093
|
-
}, [e.isSelection ? (
|
|
1094
|
+
onDragover: (t) => ce(e, t),
|
|
1095
|
+
onDrop: (t) => R(e, t),
|
|
1096
|
+
onDragend: z
|
|
1097
|
+
}, [e.isSelection ? (_(), o("input", {
|
|
1094
1098
|
key: 0,
|
|
1095
1099
|
type: "checkbox",
|
|
1096
1100
|
class: "cc-table__check",
|
|
1097
|
-
checked:
|
|
1098
|
-
indeterminate:
|
|
1101
|
+
checked: X.value,
|
|
1102
|
+
indeterminate: me.value,
|
|
1099
1103
|
"aria-label": "选择本页全部",
|
|
1100
|
-
onChange:
|
|
1101
|
-
}, null, 40,
|
|
1102
|
-
s("tbody", null, [K.value.length ? a("", !0) : (
|
|
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", {
|
|
1103
1107
|
class: "cc-table__empty",
|
|
1104
|
-
colspan:
|
|
1105
|
-
},
|
|
1108
|
+
colspan: P.value.length
|
|
1109
|
+
}, w(t.emptyText), 9, yt)])), (_(!0), o(e, null, b(K.value, (t) => (_(), o("tr", {
|
|
1106
1110
|
key: J(t),
|
|
1107
1111
|
class: "cc-table__row"
|
|
1108
|
-
}, [(
|
|
1112
|
+
}, [(_(!0), o(e, null, b(P.value, (r) => (_(), o("td", {
|
|
1109
1113
|
key: r.key,
|
|
1110
1114
|
class: p(["cc-table__td", [
|
|
1111
1115
|
`cc-table__cell--${r.align}`,
|
|
@@ -1117,28 +1121,28 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
1117
1121
|
left: r.left == null ? void 0 : `${r.left}px`,
|
|
1118
1122
|
right: r.right == null ? void 0 : `${r.right}px`
|
|
1119
1123
|
})
|
|
1120
|
-
}, [r.isSelection ? (
|
|
1124
|
+
}, [r.isSelection ? (_(), o("input", {
|
|
1121
1125
|
key: 0,
|
|
1122
1126
|
type: "checkbox",
|
|
1123
1127
|
class: "cc-table__check",
|
|
1124
1128
|
checked: Y(t),
|
|
1125
1129
|
"aria-label": `选择第 ${J(t)} 行`,
|
|
1126
|
-
onChange: (e) =>
|
|
1127
|
-
}, null, 40,
|
|
1130
|
+
onChange: (e) => pe(t)
|
|
1131
|
+
}, null, 40, bt)) : r.slot ? x(n.$slots, r.slot, {
|
|
1128
1132
|
row: t,
|
|
1129
1133
|
value: t[r.key]
|
|
1130
|
-
}, void 0, !0, 1) : (
|
|
1134
|
+
}, void 0, !0, 1) : (_(), o(e, { key: 2 }, [l(w(ge(r, t)), 1)], 64))], 6))), 128))]))), 128))])
|
|
1131
1135
|
], 2)], 4),
|
|
1132
|
-
s("div",
|
|
1136
|
+
s("div", xt, [s("span", St, "共 " + w(H.value.length) + " 条", 1), s("div", Ct, [
|
|
1133
1137
|
r[13] ||= s("span", { class: "cc-table__pager-size" }, "每页", -1),
|
|
1134
|
-
|
|
1138
|
+
A(s("select", {
|
|
1135
1139
|
"onUpdate:modelValue": r[2] ||= (e) => U.value = e,
|
|
1136
1140
|
class: "cc-table__pagesize"
|
|
1137
|
-
}, [(
|
|
1141
|
+
}, [(_(!0), o(e, null, b(t.pageSizeOptions, (e) => (_(), o("option", {
|
|
1138
1142
|
key: e,
|
|
1139
1143
|
value: e
|
|
1140
|
-
},
|
|
1141
|
-
|
|
1144
|
+
}, w(e), 9, wt))), 128))], 512), [[
|
|
1145
|
+
re,
|
|
1142
1146
|
U.value,
|
|
1143
1147
|
void 0,
|
|
1144
1148
|
{ number: !0 }
|
|
@@ -1162,13 +1166,13 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
1162
1166
|
"stroke-width": "1.6",
|
|
1163
1167
|
"stroke-linecap": "round",
|
|
1164
1168
|
"stroke-linejoin": "round"
|
|
1165
|
-
})], -1)]], 8,
|
|
1166
|
-
(
|
|
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", {
|
|
1167
1171
|
key: 0,
|
|
1168
1172
|
type: "button",
|
|
1169
1173
|
class: p(["cc-table__page-btn cc-table__page-btn--num", { "cc-table__page-btn--active": W.value === t }]),
|
|
1170
1174
|
onClick: (e) => q(t)
|
|
1171
|
-
},
|
|
1175
|
+
}, w(t), 11, Et))], 64))), 128)),
|
|
1172
1176
|
s("button", {
|
|
1173
1177
|
type: "button",
|
|
1174
1178
|
class: "cc-table__page-btn",
|
|
@@ -1187,52 +1191,499 @@ var ie = ["width", "height"], ae = /*@__PURE__*/ d({
|
|
|
1187
1191
|
"stroke-width": "1.6",
|
|
1188
1192
|
"stroke-linecap": "round",
|
|
1189
1193
|
"stroke-linejoin": "round"
|
|
1190
|
-
})], -1)]], 8,
|
|
1194
|
+
})], -1)]], 8, Ot)
|
|
1191
1195
|
])])
|
|
1192
1196
|
]));
|
|
1193
1197
|
}
|
|
1194
|
-
}), [["__scopeId", "data-v-e1238af3"]])
|
|
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");
|
|
1636
|
+
}
|
|
1637
|
+
});
|
|
1195
1638
|
//#endregion
|
|
1196
1639
|
//#region src/index.ts
|
|
1197
|
-
function
|
|
1640
|
+
function Qt(e) {
|
|
1198
1641
|
let t = [
|
|
1199
|
-
["CcButton",
|
|
1200
|
-
["CcInput",
|
|
1201
|
-
["CcTextarea",
|
|
1202
|
-
["CcSelect",
|
|
1203
|
-
["CcSwitch",
|
|
1204
|
-
["CcCheckbox",
|
|
1205
|
-
["CcRadio",
|
|
1206
|
-
["CcCard",
|
|
1207
|
-
["CcTag",
|
|
1208
|
-
["CcBadge",
|
|
1209
|
-
["CcAlert",
|
|
1210
|
-
["CcModal",
|
|
1211
|
-
["CcTooltip",
|
|
1212
|
-
["CcSpinner",
|
|
1213
|
-
["CcDivider",
|
|
1214
|
-
["CcTable",
|
|
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]
|
|
1215
1662
|
];
|
|
1216
1663
|
for (let [n, r] of t) e.component(n, r);
|
|
1217
1664
|
}
|
|
1218
|
-
var
|
|
1219
|
-
install:
|
|
1220
|
-
CcButton:
|
|
1221
|
-
CcInput:
|
|
1222
|
-
CcTextarea:
|
|
1223
|
-
CcSelect:
|
|
1224
|
-
CcSwitch:
|
|
1225
|
-
CcCheckbox:
|
|
1226
|
-
CcRadio:
|
|
1227
|
-
CcCard:
|
|
1228
|
-
CcTag:
|
|
1229
|
-
CcBadge:
|
|
1230
|
-
CcAlert:
|
|
1231
|
-
CcModal:
|
|
1232
|
-
CcTooltip:
|
|
1233
|
-
CcSpinner:
|
|
1234
|
-
CcDivider:
|
|
1235
|
-
CcTable:
|
|
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
|
|
1236
1687
|
};
|
|
1237
1688
|
//#endregion
|
|
1238
|
-
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 };
|