common_component_library_vue 0.1.4 → 0.1.6
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 +687 -389
- package/dist-lib/common-component-library-vue.umd.js +2 -2
- package/dist-lib/types/components/Menus/CcMenuList.vue.d.ts +36 -0
- package/dist-lib/types/components/Menus/CcMenus.vue.d.ts +83 -0
- package/dist-lib/types/components/Table/CcTable.vue.d.ts +4 -2
- package/dist-lib/types/index.d.ts +96 -1
- package/package.json +1 -1
|
@@ -1,17 +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
|
|
2
|
-
import * as
|
|
3
|
-
import { BarChart as
|
|
4
|
-
import { GridComponent as
|
|
5
|
-
import { CanvasRenderer 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 p, normalizeClass as m, normalizeStyle as h, onBeforeUnmount as g, onMounted as _, onUnmounted as v, openBlock as y, provide as b, reactive as x, ref as S, renderList as C, renderSlot as w, resolveComponent as T, resolveDynamicComponent as E, shallowRef as D, toDisplayString as O, unref as ee, useCssVars as k, useModel as A, vModelCheckbox as j, vModelRadio as M, vModelSelect as te, vModelText as N, watch as P, withCtx as F, withDirectives as I, withModifiers as L } from "vue";
|
|
2
|
+
import * as R from "echarts/core";
|
|
3
|
+
import { BarChart as z, LineChart as B, PieChart as V } from "echarts/charts";
|
|
4
|
+
import { GridComponent as H, LegendComponent as ne, TooltipComponent as re } from "echarts/components";
|
|
5
|
+
import { CanvasRenderer as ie } from "echarts/renderers";
|
|
6
6
|
//#region src/components/Spinner/CcSpinner.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var ae = ["width", "height"], U = /*@__PURE__*/ d({
|
|
8
8
|
__name: "CcSpinner",
|
|
9
9
|
props: {
|
|
10
10
|
size: { default: 20 },
|
|
11
11
|
color: { default: "var(--cc-primary)" }
|
|
12
12
|
},
|
|
13
13
|
setup(e) {
|
|
14
|
-
return
|
|
14
|
+
return k((e) => ({ f2187a8a: e.color })), (t, n) => (y(), o("svg", {
|
|
15
15
|
class: "cc-spinner",
|
|
16
16
|
width: e.size,
|
|
17
17
|
height: e.size,
|
|
@@ -33,16 +33,16 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
33
33
|
stroke: "currentColor",
|
|
34
34
|
"stroke-width": "3",
|
|
35
35
|
"stroke-linecap": "round"
|
|
36
|
-
}, null, -1)]], 8,
|
|
36
|
+
}, null, -1)]], 8, ae));
|
|
37
37
|
}
|
|
38
|
-
}),
|
|
38
|
+
}), W = (e, t) => {
|
|
39
39
|
let n = e.__vccOpts || e;
|
|
40
40
|
for (let [e, r] of t) n[e] = r;
|
|
41
41
|
return n;
|
|
42
|
-
},
|
|
42
|
+
}, G = /*#__PURE__*/ W(U, [["__scopeId", "data-v-00c109fa"]]), K = {
|
|
43
43
|
key: 0,
|
|
44
44
|
class: "cc-btn__spinner"
|
|
45
|
-
},
|
|
45
|
+
}, oe = { class: "cc-btn__content" }, q = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
46
46
|
__name: "CcButton",
|
|
47
47
|
props: {
|
|
48
48
|
variant: { default: "primary" },
|
|
@@ -74,8 +74,8 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
74
74
|
}
|
|
75
75
|
c("click", e);
|
|
76
76
|
}
|
|
77
|
-
return (t, n) => (
|
|
78
|
-
class:
|
|
77
|
+
return (t, n) => (y(), i(E(e.href ? "a" : "button"), {
|
|
78
|
+
class: m(["cc-btn", [
|
|
79
79
|
`cc-btn--${e.variant}`,
|
|
80
80
|
`cc-btn--${e.size}`,
|
|
81
81
|
{
|
|
@@ -91,10 +91,10 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
91
91
|
"aria-busy": e.loading,
|
|
92
92
|
onClick: d
|
|
93
93
|
}, {
|
|
94
|
-
default:
|
|
94
|
+
default: F(() => [e.loading ? (y(), o("span", K, [u(G, {
|
|
95
95
|
size: e.size === "sm" ? 14 : 16,
|
|
96
96
|
color: l.value
|
|
97
|
-
}, null, 8, ["size", "color"])])) : a("", !0), s("span",
|
|
97
|
+
}, null, 8, ["size", "color"])])) : a("", !0), s("span", oe, [w(t.$slots, "default", {}, void 0, !0)])]),
|
|
98
98
|
_: 3
|
|
99
99
|
}, 8, [
|
|
100
100
|
"class",
|
|
@@ -106,10 +106,10 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
106
106
|
"aria-busy"
|
|
107
107
|
]));
|
|
108
108
|
}
|
|
109
|
-
}), [["__scopeId", "data-v-deb42261"]]),
|
|
109
|
+
}), [["__scopeId", "data-v-deb42261"]]), J = ["for"], Y = {
|
|
110
110
|
key: 0,
|
|
111
111
|
class: "cc-input__prefix tnum"
|
|
112
|
-
},
|
|
112
|
+
}, X = [
|
|
113
113
|
"id",
|
|
114
114
|
"type",
|
|
115
115
|
"value",
|
|
@@ -123,13 +123,13 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
123
123
|
"max",
|
|
124
124
|
"step",
|
|
125
125
|
"aria-invalid"
|
|
126
|
-
],
|
|
126
|
+
], Z = {
|
|
127
127
|
key: 1,
|
|
128
128
|
class: "cc-input__message cc-input__message--error"
|
|
129
|
-
},
|
|
129
|
+
}, se = {
|
|
130
130
|
key: 2,
|
|
131
131
|
class: "cc-input__message"
|
|
132
|
-
},
|
|
132
|
+
}, Q = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
133
133
|
__name: "CcInput",
|
|
134
134
|
props: {
|
|
135
135
|
modelValue: { default: "" },
|
|
@@ -165,16 +165,16 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
165
165
|
function l(e) {
|
|
166
166
|
i("update:modelValue", e.target.value);
|
|
167
167
|
}
|
|
168
|
-
return (t, n) => (
|
|
168
|
+
return (t, n) => (y(), o("div", { class: m(["cc-input", {
|
|
169
169
|
"cc-input--error": c.value,
|
|
170
170
|
"cc-input--disabled": e.disabled
|
|
171
171
|
}]) }, [
|
|
172
|
-
e.label ? (
|
|
172
|
+
e.label ? (y(), o("label", {
|
|
173
173
|
key: 0,
|
|
174
174
|
class: "cc-input__label",
|
|
175
175
|
for: e.name
|
|
176
|
-
},
|
|
177
|
-
s("div", { class:
|
|
176
|
+
}, O(e.label), 9, J)) : a("", !0),
|
|
177
|
+
s("div", { class: m(["cc-input__field", { "cc-input__field--prefix": e.prefix }]) }, [e.prefix ? (y(), o("span", Y, O(e.prefix), 1)) : a("", !0), s("input", {
|
|
178
178
|
id: e.name,
|
|
179
179
|
class: "cc-input__control tnum",
|
|
180
180
|
type: e.type,
|
|
@@ -193,11 +193,11 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
193
193
|
onFocus: n[0] ||= (e) => i("focus", e),
|
|
194
194
|
onBlur: n[1] ||= (e) => i("blur", e),
|
|
195
195
|
onChange: n[2] ||= (e) => i("change", e)
|
|
196
|
-
}, null, 40,
|
|
197
|
-
e.error ? (
|
|
196
|
+
}, null, 40, X)], 2),
|
|
197
|
+
e.error ? (y(), o("p", Z, O(e.error), 1)) : e.hint ? (y(), o("p", se, O(e.hint), 1)) : a("", !0)
|
|
198
198
|
], 2));
|
|
199
199
|
}
|
|
200
|
-
}), [["__scopeId", "data-v-4b6c01de"]]),
|
|
200
|
+
}), [["__scopeId", "data-v-4b6c01de"]]), $ = ["for"], ce = [
|
|
201
201
|
"id",
|
|
202
202
|
"value",
|
|
203
203
|
"name",
|
|
@@ -207,13 +207,13 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
207
207
|
"readonly",
|
|
208
208
|
"autocomplete",
|
|
209
209
|
"aria-invalid"
|
|
210
|
-
],
|
|
210
|
+
], le = {
|
|
211
211
|
key: 1,
|
|
212
212
|
class: "cc-textarea__message cc-textarea__message--error"
|
|
213
|
-
},
|
|
213
|
+
}, ue = {
|
|
214
214
|
key: 2,
|
|
215
215
|
class: "cc-textarea__message"
|
|
216
|
-
},
|
|
216
|
+
}, de = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
217
217
|
__name: "CcTextarea",
|
|
218
218
|
props: {
|
|
219
219
|
modelValue: { default: "" },
|
|
@@ -243,15 +243,15 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
243
243
|
function l(e) {
|
|
244
244
|
i("update:modelValue", e.target.value);
|
|
245
245
|
}
|
|
246
|
-
return (t, n) => (
|
|
246
|
+
return (t, n) => (y(), o("div", { class: m(["cc-textarea", {
|
|
247
247
|
"cc-textarea--error": c.value,
|
|
248
248
|
"cc-textarea--disabled": e.disabled
|
|
249
249
|
}]) }, [
|
|
250
|
-
e.label ? (
|
|
250
|
+
e.label ? (y(), o("label", {
|
|
251
251
|
key: 0,
|
|
252
252
|
class: "cc-textarea__label",
|
|
253
253
|
for: e.name
|
|
254
|
-
},
|
|
254
|
+
}, O(e.label), 9, $)) : a("", !0),
|
|
255
255
|
s("textarea", {
|
|
256
256
|
id: e.name,
|
|
257
257
|
class: "cc-textarea__control",
|
|
@@ -266,11 +266,11 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
266
266
|
onInput: l,
|
|
267
267
|
onFocus: n[0] ||= (e) => i("focus", e),
|
|
268
268
|
onBlur: n[1] ||= (e) => i("blur", e)
|
|
269
|
-
}, null, 40,
|
|
270
|
-
e.error ? (
|
|
269
|
+
}, null, 40, ce),
|
|
270
|
+
e.error ? (y(), o("p", le, O(e.error), 1)) : e.hint ? (y(), o("p", ue, O(e.hint), 1)) : a("", !0)
|
|
271
271
|
], 2));
|
|
272
272
|
}
|
|
273
|
-
}), [["__scopeId", "data-v-9840d15e"]]),
|
|
273
|
+
}), [["__scopeId", "data-v-9840d15e"]]), fe = ["for"], pe = { class: "cc-select__wrap" }, me = [
|
|
274
274
|
"id",
|
|
275
275
|
"value",
|
|
276
276
|
"name",
|
|
@@ -287,7 +287,7 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
287
287
|
}, ve = {
|
|
288
288
|
key: 2,
|
|
289
289
|
class: "cc-select__message"
|
|
290
|
-
}, ye = /*#__PURE__*/
|
|
290
|
+
}, ye = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
291
291
|
__name: "CcSelect",
|
|
292
292
|
props: {
|
|
293
293
|
modelValue: { default: "" },
|
|
@@ -309,16 +309,16 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
309
309
|
let t = e.target;
|
|
310
310
|
c("update:modelValue", t.value), c("change", e);
|
|
311
311
|
}
|
|
312
|
-
return (n, r) => (
|
|
312
|
+
return (n, r) => (y(), o("div", { class: m(["cc-select", {
|
|
313
313
|
"cc-select--error": l.value,
|
|
314
314
|
"cc-select--disabled": t.disabled
|
|
315
315
|
}]) }, [
|
|
316
|
-
t.label ? (
|
|
316
|
+
t.label ? (y(), o("label", {
|
|
317
317
|
key: 0,
|
|
318
318
|
class: "cc-select__label",
|
|
319
319
|
for: t.name
|
|
320
|
-
},
|
|
321
|
-
s("div",
|
|
320
|
+
}, O(t.label), 9, fe)) : a("", !0),
|
|
321
|
+
s("div", pe, [s("select", {
|
|
322
322
|
id: t.name,
|
|
323
323
|
class: "cc-select__control",
|
|
324
324
|
value: t.modelValue,
|
|
@@ -326,11 +326,11 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
326
326
|
disabled: t.disabled,
|
|
327
327
|
"aria-invalid": l.value || void 0,
|
|
328
328
|
onChange: u
|
|
329
|
-
}, [t.placeholder ? (
|
|
329
|
+
}, [t.placeholder ? (y(), o("option", he, O(t.placeholder), 1)) : a("", !0), (y(!0), o(e, null, C(t.options, (e) => (y(), o("option", {
|
|
330
330
|
key: String(e.value),
|
|
331
331
|
value: e.value,
|
|
332
332
|
disabled: e.disabled
|
|
333
|
-
},
|
|
333
|
+
}, O(e.label), 9, ge))), 128))], 40, me), r[0] ||= s("svg", {
|
|
334
334
|
class: "cc-select__chevron",
|
|
335
335
|
width: "16",
|
|
336
336
|
height: "16",
|
|
@@ -344,7 +344,7 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
344
344
|
"stroke-linecap": "round",
|
|
345
345
|
"stroke-linejoin": "round"
|
|
346
346
|
})], -1)]),
|
|
347
|
-
t.error ? (
|
|
347
|
+
t.error ? (y(), o("p", _e, O(t.error), 1)) : t.hint ? (y(), o("p", ve, O(t.hint), 1)) : a("", !0)
|
|
348
348
|
], 2));
|
|
349
349
|
}
|
|
350
350
|
}), [["__scopeId", "data-v-0e1871e6"]]), be = [
|
|
@@ -354,7 +354,7 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
354
354
|
], xe = {
|
|
355
355
|
key: 0,
|
|
356
356
|
class: "cc-switch__label"
|
|
357
|
-
}, Se = /*#__PURE__*/
|
|
357
|
+
}, Se = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
358
358
|
__name: "CcSwitch",
|
|
359
359
|
props: /*@__PURE__*/ f({
|
|
360
360
|
label: { default: void 0 },
|
|
@@ -372,13 +372,13 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
372
372
|
}),
|
|
373
373
|
emits: ["update:modelValue"],
|
|
374
374
|
setup(e) {
|
|
375
|
-
let t =
|
|
375
|
+
let t = A(e, "modelValue"), n = e;
|
|
376
376
|
function r() {
|
|
377
377
|
n.disabled || (t.value = !t.value);
|
|
378
378
|
}
|
|
379
|
-
return (n, i) => (
|
|
379
|
+
return (n, i) => (y(), o("button", {
|
|
380
380
|
type: "button",
|
|
381
|
-
class:
|
|
381
|
+
class: m(["cc-switch", [`cc-switch--${e.size}`, {
|
|
382
382
|
"cc-switch--checked": t.value,
|
|
383
383
|
"cc-switch--disabled": e.disabled
|
|
384
384
|
}]]),
|
|
@@ -387,12 +387,12 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
387
387
|
"aria-label": e.label || "switch",
|
|
388
388
|
disabled: e.disabled,
|
|
389
389
|
onClick: r
|
|
390
|
-
}, [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 ? (y(), o("span", xe, O(e.label), 1)) : a("", !0)], 10, be));
|
|
391
391
|
}
|
|
392
392
|
}), [["__scopeId", "data-v-cb8ad6ea"]]), Ce = ["disabled"], we = {
|
|
393
393
|
key: 0,
|
|
394
394
|
class: "cc-checkbox__label"
|
|
395
|
-
},
|
|
395
|
+
}, Te = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
396
396
|
__name: "CcCheckbox",
|
|
397
397
|
props: /*@__PURE__*/ f({
|
|
398
398
|
label: { default: void 0 },
|
|
@@ -409,14 +409,14 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
409
409
|
}),
|
|
410
410
|
emits: ["update:modelValue"],
|
|
411
411
|
setup(e) {
|
|
412
|
-
let t =
|
|
413
|
-
return (n, r) => (
|
|
414
|
-
|
|
412
|
+
let t = A(e, "modelValue");
|
|
413
|
+
return (n, r) => (y(), o("label", { class: m(["cc-checkbox", { "cc-checkbox--disabled": e.disabled }]) }, [
|
|
414
|
+
I(s("input", {
|
|
415
415
|
"onUpdate:modelValue": r[0] ||= (e) => t.value = e,
|
|
416
416
|
type: "checkbox",
|
|
417
417
|
class: "cc-checkbox__native",
|
|
418
418
|
disabled: e.disabled
|
|
419
|
-
}, null, 8, Ce), [[
|
|
419
|
+
}, null, 8, Ce), [[j, t.value]]),
|
|
420
420
|
r[1] ||= s("span", {
|
|
421
421
|
class: "cc-checkbox__box",
|
|
422
422
|
"aria-hidden": "true"
|
|
@@ -433,14 +433,14 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
433
433
|
"stroke-linecap": "round",
|
|
434
434
|
"stroke-linejoin": "round"
|
|
435
435
|
})])], -1),
|
|
436
|
-
e.label ? (
|
|
437
|
-
|
|
436
|
+
e.label ? (y(), o("span", we, O(e.label), 1)) : a("", !0),
|
|
437
|
+
w(n.$slots, "default", {}, void 0, !0)
|
|
438
438
|
], 2));
|
|
439
439
|
}
|
|
440
|
-
}), [["__scopeId", "data-v-bf838053"]]),
|
|
440
|
+
}), [["__scopeId", "data-v-bf838053"]]), Ee = ["value", "disabled"], De = {
|
|
441
441
|
key: 0,
|
|
442
442
|
class: "cc-radio__label"
|
|
443
|
-
},
|
|
443
|
+
}, Oe = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
444
444
|
__name: "CcRadio",
|
|
445
445
|
props: /*@__PURE__*/ f({
|
|
446
446
|
value: {},
|
|
@@ -455,36 +455,36 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
455
455
|
}),
|
|
456
456
|
emits: ["update:modelValue"],
|
|
457
457
|
setup(e) {
|
|
458
|
-
let t =
|
|
459
|
-
return (n, r) => (
|
|
460
|
-
|
|
458
|
+
let t = A(e, "modelValue");
|
|
459
|
+
return (n, r) => (y(), o("label", { class: m(["cc-radio", { "cc-radio--disabled": e.disabled }]) }, [
|
|
460
|
+
I(s("input", {
|
|
461
461
|
"onUpdate:modelValue": r[0] ||= (e) => t.value = e,
|
|
462
462
|
type: "radio",
|
|
463
463
|
class: "cc-radio__native",
|
|
464
464
|
value: e.value,
|
|
465
465
|
disabled: e.disabled
|
|
466
|
-
}, null, 8,
|
|
466
|
+
}, null, 8, Ee), [[M, t.value]]),
|
|
467
467
|
r[1] ||= s("span", {
|
|
468
468
|
class: "cc-radio__dot",
|
|
469
469
|
"aria-hidden": "true"
|
|
470
470
|
}, null, -1),
|
|
471
|
-
e.label ? (
|
|
472
|
-
|
|
471
|
+
e.label ? (y(), o("span", De, O(e.label), 1)) : a("", !0),
|
|
472
|
+
w(n.$slots, "default", {}, void 0, !0)
|
|
473
473
|
], 2));
|
|
474
474
|
}
|
|
475
|
-
}), [["__scopeId", "data-v-0a6c4d47"]]),
|
|
475
|
+
}), [["__scopeId", "data-v-0a6c4d47"]]), ke = {
|
|
476
476
|
key: 0,
|
|
477
477
|
class: "cc-card__header"
|
|
478
|
-
},
|
|
478
|
+
}, Ae = {
|
|
479
479
|
key: 0,
|
|
480
480
|
class: "cc-card__title"
|
|
481
|
-
},
|
|
481
|
+
}, je = {
|
|
482
482
|
key: 1,
|
|
483
483
|
class: "cc-card__desc"
|
|
484
|
-
},
|
|
484
|
+
}, Me = { class: "cc-card__body" }, Ne = {
|
|
485
485
|
key: 0,
|
|
486
486
|
class: "cc-card__footer"
|
|
487
|
-
},
|
|
487
|
+
}, Pe = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
488
488
|
__name: "CcCard",
|
|
489
489
|
props: {
|
|
490
490
|
variant: { default: "feature" },
|
|
@@ -496,16 +496,16 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
496
496
|
}
|
|
497
497
|
},
|
|
498
498
|
setup(e) {
|
|
499
|
-
return (t, n) => (
|
|
500
|
-
|
|
501
|
-
s("div",
|
|
502
|
-
t.$slots.footer ? (
|
|
499
|
+
return (t, n) => (y(), o("article", { class: m(["cc-card", [`cc-card--${e.variant}`, { "cc-card--flush": e.flush }]]) }, [
|
|
500
|
+
w(t.$slots, "header", {}, () => [e.title || e.description ? (y(), o("header", ke, [e.title ? (y(), o("h3", Ae, O(e.title), 1)) : a("", !0), e.description ? (y(), o("p", je, O(e.description), 1)) : a("", !0)])) : a("", !0)], !0),
|
|
501
|
+
s("div", Me, [w(t.$slots, "default", {}, void 0, !0)]),
|
|
502
|
+
t.$slots.footer ? (y(), o("footer", Ne, [w(t.$slots, "footer", {}, void 0, !0)])) : a("", !0)
|
|
503
503
|
], 2));
|
|
504
504
|
}
|
|
505
|
-
}), [["__scopeId", "data-v-7f39ac3e"]]),
|
|
505
|
+
}), [["__scopeId", "data-v-7f39ac3e"]]), Fe = {
|
|
506
506
|
key: 0,
|
|
507
507
|
class: "cc-tag__dot"
|
|
508
|
-
},
|
|
508
|
+
}, Ie = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
509
509
|
__name: "CcTag",
|
|
510
510
|
props: {
|
|
511
511
|
variant: { default: "soft" },
|
|
@@ -522,15 +522,15 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
522
522
|
emits: ["close"],
|
|
523
523
|
setup(e, { emit: t }) {
|
|
524
524
|
let n = t;
|
|
525
|
-
return (t, r) => (
|
|
526
|
-
e.dot ? (
|
|
527
|
-
|
|
528
|
-
e.closable ? (
|
|
525
|
+
return (t, r) => (y(), o("span", { class: m(["cc-tag", [`cc-tag--${e.variant}`, `cc-tag--${e.size}`]]) }, [
|
|
526
|
+
e.dot ? (y(), o("span", Fe)) : a("", !0),
|
|
527
|
+
w(t.$slots, "default", {}, void 0, !0),
|
|
528
|
+
e.closable ? (y(), o("button", {
|
|
529
529
|
key: 1,
|
|
530
530
|
type: "button",
|
|
531
531
|
class: "cc-tag__close",
|
|
532
532
|
"aria-label": "close tag",
|
|
533
|
-
onClick: r[0] ||=
|
|
533
|
+
onClick: r[0] ||= L((e) => n("close", e), ["stop"])
|
|
534
534
|
}, [...r[1] ||= [s("svg", {
|
|
535
535
|
width: "10",
|
|
536
536
|
height: "10",
|
|
@@ -545,7 +545,7 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
545
545
|
})], -1)]])) : a("", !0)
|
|
546
546
|
], 2));
|
|
547
547
|
}
|
|
548
|
-
}), [["__scopeId", "data-v-858b2086"]]),
|
|
548
|
+
}), [["__scopeId", "data-v-858b2086"]]), Le = { class: "cc-badge__text tnum" }, Re = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
549
549
|
__name: "CcBadge",
|
|
550
550
|
props: {
|
|
551
551
|
count: { default: 0 },
|
|
@@ -562,15 +562,15 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
562
562
|
let e = Number(t.count);
|
|
563
563
|
return Number.isNaN(e) ? String(t.count) : e > t.max ? `${t.max}+` : String(e);
|
|
564
564
|
});
|
|
565
|
-
return (t, r) => (
|
|
565
|
+
return (t, r) => (y(), o("span", { class: m(["cc-badge", [`cc-badge--${e.variant}`, { "cc-badge--dot-only": e.dot }]]) }, [s("span", Le, O(n.value), 1)], 2));
|
|
566
566
|
}
|
|
567
|
-
}), [["__scopeId", "data-v-466a4bd0"]]),
|
|
567
|
+
}), [["__scopeId", "data-v-466a4bd0"]]), ze = { class: "cc-alert__content" }, Be = {
|
|
568
568
|
key: 0,
|
|
569
569
|
class: "cc-alert__title"
|
|
570
|
-
},
|
|
570
|
+
}, Ve = {
|
|
571
571
|
key: 1,
|
|
572
572
|
class: "cc-alert__desc"
|
|
573
|
-
},
|
|
573
|
+
}, He = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
574
574
|
__name: "CcAlert",
|
|
575
575
|
props: {
|
|
576
576
|
variant: { default: "info" },
|
|
@@ -582,7 +582,7 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
582
582
|
}
|
|
583
583
|
},
|
|
584
584
|
setup(e) {
|
|
585
|
-
let t = e, n =
|
|
585
|
+
let t = e, n = S(!0), i = r(() => {
|
|
586
586
|
switch (t.variant) {
|
|
587
587
|
case "success": return "var(--cc-success)";
|
|
588
588
|
case "warning": return "var(--cc-warning)";
|
|
@@ -590,14 +590,14 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
590
590
|
default: return "var(--cc-primary)";
|
|
591
591
|
}
|
|
592
592
|
});
|
|
593
|
-
return (t, r) => n.value ? (
|
|
593
|
+
return (t, r) => n.value ? (y(), o("div", {
|
|
594
594
|
key: 0,
|
|
595
|
-
class:
|
|
595
|
+
class: m(["cc-alert", `cc-alert--${e.variant}`]),
|
|
596
596
|
role: "alert"
|
|
597
597
|
}, [
|
|
598
598
|
s("span", {
|
|
599
599
|
class: "cc-alert__icon",
|
|
600
|
-
style:
|
|
600
|
+
style: h({ color: i.value }),
|
|
601
601
|
"aria-hidden": "true"
|
|
602
602
|
}, [...r[1] ||= [s("svg", {
|
|
603
603
|
width: "16",
|
|
@@ -624,8 +624,8 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
624
624
|
fill: "currentColor"
|
|
625
625
|
})
|
|
626
626
|
], -1)]], 4),
|
|
627
|
-
s("div",
|
|
628
|
-
e.closable ? (
|
|
627
|
+
s("div", ze, [e.title ? (y(), o("p", Be, O(e.title), 1)) : a("", !0), e.description || t.$slots.default ? (y(), o("p", Ve, [w(t.$slots, "default", {}, () => [l(O(e.description), 1)], !0)])) : a("", !0)]),
|
|
628
|
+
e.closable ? (y(), o("button", {
|
|
629
629
|
key: 0,
|
|
630
630
|
type: "button",
|
|
631
631
|
class: "cc-alert__close",
|
|
@@ -645,13 +645,13 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
645
645
|
})], -1)]])) : a("", !0)
|
|
646
646
|
], 2)) : a("", !0);
|
|
647
647
|
}
|
|
648
|
-
}), [["__scopeId", "data-v-8671adaf"]]),
|
|
648
|
+
}), [["__scopeId", "data-v-8671adaf"]]), Ue = ["aria-label"], We = { class: "cc-modal__header" }, Ge = {
|
|
649
649
|
key: 0,
|
|
650
650
|
class: "cc-modal__title"
|
|
651
|
-
},
|
|
651
|
+
}, Ke = { class: "cc-modal__body" }, qe = {
|
|
652
652
|
key: 0,
|
|
653
653
|
class: "cc-modal__footer"
|
|
654
|
-
},
|
|
654
|
+
}, Je = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
655
655
|
__name: "CcModal",
|
|
656
656
|
props: {
|
|
657
657
|
visible: {
|
|
@@ -679,38 +679,38 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
679
679
|
"close"
|
|
680
680
|
],
|
|
681
681
|
setup(e, { emit: r }) {
|
|
682
|
-
let c = e, l = r, d =
|
|
682
|
+
let c = e, l = r, d = S(null);
|
|
683
683
|
function f() {
|
|
684
684
|
l("update:visible", !1), l("close");
|
|
685
685
|
}
|
|
686
|
-
function
|
|
686
|
+
function m(e) {
|
|
687
687
|
e.key === "Escape" && c.visible && c.closable && f();
|
|
688
688
|
}
|
|
689
689
|
function v(e) {
|
|
690
690
|
c.maskClosable && e.target === e.currentTarget && f();
|
|
691
691
|
}
|
|
692
|
-
return
|
|
693
|
-
e ? (l("open"), await
|
|
692
|
+
return P(() => c.visible, async (e) => {
|
|
693
|
+
e ? (l("open"), await p(), d.value?.focus(), document.body.style.overflow = "hidden") : document.body.style.overflow = "";
|
|
694
|
+
}), _(() => {
|
|
695
|
+
document.addEventListener("keydown", m);
|
|
694
696
|
}), g(() => {
|
|
695
|
-
document.
|
|
696
|
-
}),
|
|
697
|
-
|
|
698
|
-
}), (r, c) => (_(), i(t, { to: "body" }, [u(n, { name: "cc-modal" }, {
|
|
699
|
-
default: k(() => [e.visible ? (_(), o("div", {
|
|
697
|
+
document.removeEventListener("keydown", m), document.body.style.overflow = "";
|
|
698
|
+
}), (r, c) => (y(), i(t, { to: "body" }, [u(n, { name: "cc-modal" }, {
|
|
699
|
+
default: F(() => [e.visible ? (y(), o("div", {
|
|
700
700
|
key: 0,
|
|
701
701
|
class: "cc-modal",
|
|
702
|
-
onClick:
|
|
702
|
+
onClick: L(v, ["self"])
|
|
703
703
|
}, [s("div", {
|
|
704
704
|
ref_key: "panel",
|
|
705
705
|
ref: d,
|
|
706
706
|
class: "cc-modal__panel",
|
|
707
|
-
style:
|
|
707
|
+
style: h({ maxWidth: e.width }),
|
|
708
708
|
role: "dialog",
|
|
709
709
|
"aria-modal": "true",
|
|
710
710
|
"aria-label": e.title || "dialog",
|
|
711
711
|
tabindex: "-1"
|
|
712
712
|
}, [
|
|
713
|
-
s("header",
|
|
713
|
+
s("header", We, [e.title ? (y(), o("h3", Ge, O(e.title), 1)) : a("", !0), e.closable ? (y(), o("button", {
|
|
714
714
|
key: 1,
|
|
715
715
|
type: "button",
|
|
716
716
|
class: "cc-modal__close",
|
|
@@ -728,13 +728,13 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
728
728
|
"stroke-width": "1.4",
|
|
729
729
|
"stroke-linecap": "round"
|
|
730
730
|
})], -1)]])) : a("", !0)]),
|
|
731
|
-
s("div",
|
|
732
|
-
r.$slots.footer ? (
|
|
733
|
-
], 12,
|
|
731
|
+
s("div", Ke, [w(r.$slots, "default", {}, void 0, !0)]),
|
|
732
|
+
r.$slots.footer ? (y(), o("footer", qe, [w(r.$slots, "footer", {}, void 0, !0)])) : a("", !0)
|
|
733
|
+
], 12, Ue)])) : a("", !0)]),
|
|
734
734
|
_: 3
|
|
735
735
|
})]));
|
|
736
736
|
}
|
|
737
|
-
}), [["__scopeId", "data-v-d2a6d4fd"]]),
|
|
737
|
+
}), [["__scopeId", "data-v-d2a6d4fd"]]), Ye = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
738
738
|
__name: "CcTooltip",
|
|
739
739
|
props: {
|
|
740
740
|
content: { default: void 0 },
|
|
@@ -742,56 +742,56 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
742
742
|
delay: { default: 0 }
|
|
743
743
|
},
|
|
744
744
|
setup(e) {
|
|
745
|
-
let t = e, n =
|
|
745
|
+
let t = e, n = S(!1), i = null, s = r(() => n.value);
|
|
746
746
|
function c() {
|
|
747
747
|
t.delay > 0 ? i = setTimeout(() => n.value = !0, t.delay) : n.value = !0;
|
|
748
748
|
}
|
|
749
749
|
function u() {
|
|
750
750
|
i && clearTimeout(i), n.value = !1;
|
|
751
751
|
}
|
|
752
|
-
return (t, n) => (
|
|
752
|
+
return (t, n) => (y(), o("span", {
|
|
753
753
|
class: "cc-tooltip",
|
|
754
754
|
onMouseenter: c,
|
|
755
755
|
onMouseleave: u,
|
|
756
756
|
onFocusin: c,
|
|
757
757
|
onFocusout: u
|
|
758
|
-
}, [
|
|
758
|
+
}, [w(t.$slots, "default", {}, void 0, !0), s.value && (e.content || t.$slots.tip) ? (y(), o("span", {
|
|
759
759
|
key: 0,
|
|
760
|
-
class:
|
|
760
|
+
class: m(["cc-tooltip__bubble", `cc-tooltip--${e.placement}`]),
|
|
761
761
|
role: "tooltip"
|
|
762
|
-
}, [
|
|
762
|
+
}, [w(t.$slots, "tip", {}, () => [l(O(e.content), 1)], !0)], 2)) : a("", !0)], 32));
|
|
763
763
|
}
|
|
764
|
-
}), [["__scopeId", "data-v-2befb04b"]]),
|
|
764
|
+
}), [["__scopeId", "data-v-2befb04b"]]), Xe = {
|
|
765
765
|
key: 0,
|
|
766
766
|
class: "cc-divider__label"
|
|
767
|
-
},
|
|
767
|
+
}, Ze = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
768
768
|
__name: "CcDivider",
|
|
769
769
|
props: {
|
|
770
770
|
orientation: { default: "horizontal" },
|
|
771
771
|
height: { default: "1em" }
|
|
772
772
|
},
|
|
773
773
|
setup(e) {
|
|
774
|
-
return (t, n) => (
|
|
775
|
-
class:
|
|
774
|
+
return (t, n) => (y(), o("div", {
|
|
775
|
+
class: m(["cc-divider", [`cc-divider--${e.orientation}`]]),
|
|
776
776
|
role: "separator",
|
|
777
|
-
style:
|
|
778
|
-
}, [t.$slots.default ? (
|
|
777
|
+
style: h(e.orientation === "vertical" ? { height: e.height } : void 0)
|
|
778
|
+
}, [t.$slots.default ? (y(), o("span", Xe, [w(t.$slots, "default", {}, void 0, !0)])) : a("", !0)], 6));
|
|
779
779
|
}
|
|
780
|
-
}), [["__scopeId", "data-v-c42961cd"]]),
|
|
780
|
+
}), [["__scopeId", "data-v-c42961cd"]]), Qe = { class: "cc-table" }, $e = { class: "cc-table__toolbar" }, et = { class: "cc-table__filters" }, tt = {
|
|
781
781
|
key: 0,
|
|
782
782
|
class: "cc-table__filter"
|
|
783
|
-
},
|
|
783
|
+
}, nt = { class: "cc-table__filter-label" }, rt = ["onUpdate:modelValue"], it = ["value"], at = {
|
|
784
784
|
key: 1,
|
|
785
785
|
class: "cc-table__filter"
|
|
786
|
-
},
|
|
786
|
+
}, ot = { class: "cc-table__filter-label" }, st = ["onUpdate:modelValue", "placeholder"], ct = { class: "cc-table__settings" }, lt = { class: "cc-table__settings-panel" }, ut = { class: "cc-table__settings-section" }, dt = { class: "cc-table__density" }, ft = ["onClick"], pt = { class: "cc-table__settings-section" }, mt = { class: "cc-table__settings-cols" }, ht = [
|
|
787
787
|
"draggable",
|
|
788
788
|
"onDragstart",
|
|
789
789
|
"onDragover",
|
|
790
790
|
"onDrop"
|
|
791
|
-
],
|
|
791
|
+
], gt = ["checked", "indeterminate"], _t = {
|
|
792
792
|
key: 1,
|
|
793
793
|
class: "cc-table__th-title"
|
|
794
|
-
},
|
|
794
|
+
}, vt = {
|
|
795
795
|
key: 0,
|
|
796
796
|
class: "cc-table__drag-handle",
|
|
797
797
|
width: "10",
|
|
@@ -799,14 +799,14 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
799
799
|
viewBox: "0 0 10 14",
|
|
800
800
|
fill: "none",
|
|
801
801
|
"aria-hidden": "true"
|
|
802
|
-
},
|
|
802
|
+
}, yt = { key: 0 }, bt = ["colspan"], xt = [
|
|
803
803
|
"checked",
|
|
804
804
|
"aria-label",
|
|
805
805
|
"onChange"
|
|
806
|
-
],
|
|
806
|
+
], St = { class: "cc-table__footer" }, Ct = { class: "cc-table__total" }, wt = { class: "cc-table__pager" }, Tt = ["value"], Et = ["disabled"], Dt = ["onClick"], Ot = {
|
|
807
807
|
key: 1,
|
|
808
808
|
class: "cc-table__page-ellipsis"
|
|
809
|
-
},
|
|
809
|
+
}, kt = ["disabled"], At = "__selection__", jt = 48, Mt = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
810
810
|
__name: "CcTable",
|
|
811
811
|
props: /*@__PURE__*/ f({
|
|
812
812
|
columns: {},
|
|
@@ -831,7 +831,7 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
831
831
|
}),
|
|
832
832
|
emits: /*@__PURE__*/ f(["selection-change"], ["update:selectedKeys"]),
|
|
833
833
|
setup(t, { emit: n }) {
|
|
834
|
-
let d = t, f =
|
|
834
|
+
let d = t, f = A(t, "selectedKeys"), p = n, g = [
|
|
835
835
|
{
|
|
836
836
|
label: "大",
|
|
837
837
|
value: "large"
|
|
@@ -844,8 +844,8 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
844
844
|
label: "小",
|
|
845
845
|
value: "small"
|
|
846
846
|
}
|
|
847
|
-
], v = r(() => `cc-table:${d.tableKey}`),
|
|
848
|
-
function
|
|
847
|
+
], v = r(() => `cc-table:${d.tableKey}`), b = S([]), T = x({}), E = S(d.defaultDensity), D = S(!1);
|
|
848
|
+
function ee() {
|
|
849
849
|
let e = null;
|
|
850
850
|
try {
|
|
851
851
|
let t = localStorage.getItem(v.value);
|
|
@@ -854,40 +854,40 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
854
854
|
e = null;
|
|
855
855
|
}
|
|
856
856
|
let t = d.columns.map((e) => e.key), n = (e?.order ?? []).filter((e) => t.includes(e));
|
|
857
|
-
|
|
858
|
-
for (let n of t)
|
|
859
|
-
e?.density &&
|
|
857
|
+
b.value = [...n, ...t.filter((e) => !n.includes(e))];
|
|
858
|
+
for (let n of t) T[n] = e?.visibility?.[n] ?? !0;
|
|
859
|
+
e?.density && g.some((t) => t.value === e.density) && (E.value = e.density);
|
|
860
860
|
}
|
|
861
|
-
function
|
|
861
|
+
function k() {
|
|
862
862
|
let e = {
|
|
863
863
|
v: 1,
|
|
864
|
-
order:
|
|
865
|
-
visibility: { ...
|
|
866
|
-
density:
|
|
864
|
+
order: b.value,
|
|
865
|
+
visibility: { ...T },
|
|
866
|
+
density: E.value
|
|
867
867
|
};
|
|
868
868
|
try {
|
|
869
869
|
localStorage.setItem(v.value, JSON.stringify(e));
|
|
870
870
|
} catch {}
|
|
871
871
|
}
|
|
872
872
|
function j() {
|
|
873
|
-
|
|
874
|
-
for (let e of d.columns.map((e) => e.key))
|
|
875
|
-
|
|
873
|
+
b.value = d.columns.map((e) => e.key);
|
|
874
|
+
for (let e of d.columns.map((e) => e.key)) T[e] = !0;
|
|
875
|
+
E.value = d.defaultDensity, D.value = !1;
|
|
876
876
|
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
],
|
|
882
|
-
for (let t of e)
|
|
877
|
+
P([
|
|
878
|
+
b,
|
|
879
|
+
T,
|
|
880
|
+
E
|
|
881
|
+
], k, { deep: !0 }), P(() => d.columns.map((e) => e.key), (e) => {
|
|
882
|
+
for (let t of e) b.value.includes(t) || b.value.push(t), T[t] === void 0 && (T[t] = !0);
|
|
883
883
|
});
|
|
884
884
|
function M(e) {
|
|
885
885
|
return e.width ?? 140;
|
|
886
886
|
}
|
|
887
|
-
let
|
|
888
|
-
let e = new Map(
|
|
889
|
-
return d.columns.filter((e) => !e.fixed).filter((e) =>
|
|
890
|
-
}),
|
|
887
|
+
let L = r(() => d.columns.filter((e) => !e.fixed)), R = r(() => {
|
|
888
|
+
let e = new Map(b.value.map((e, t) => [e, t]));
|
|
889
|
+
return d.columns.filter((e) => !e.fixed).filter((e) => T[e.key] !== !1).sort((t, n) => (e.get(t.key) ?? 0) - (e.get(n.key) ?? 0));
|
|
890
|
+
}), z = r(() => {
|
|
891
891
|
let e = [], t = (e) => ({
|
|
892
892
|
key: e.key,
|
|
893
893
|
title: e.title,
|
|
@@ -901,15 +901,15 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
901
901
|
formatter: e.formatter
|
|
902
902
|
});
|
|
903
903
|
d.showSelection && e.push({
|
|
904
|
-
key:
|
|
904
|
+
key: At,
|
|
905
905
|
title: "",
|
|
906
|
-
width:
|
|
906
|
+
width: jt,
|
|
907
907
|
slot: "",
|
|
908
908
|
align: "center",
|
|
909
909
|
left: 0,
|
|
910
910
|
isSelection: !0
|
|
911
911
|
});
|
|
912
|
-
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 ? jt : 0;
|
|
913
913
|
n.forEach((i, a) => {
|
|
914
914
|
e.push({
|
|
915
915
|
...t(i),
|
|
@@ -917,7 +917,7 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
917
917
|
isLastLeftFixed: a === n.length - 1
|
|
918
918
|
}), r += M(i);
|
|
919
919
|
});
|
|
920
|
-
for (let n of
|
|
920
|
+
for (let n of R.value) e.push(t(n));
|
|
921
921
|
let i = d.columns.filter((e) => e.fixed === "right"), a = 0, o = /* @__PURE__ */ new Map();
|
|
922
922
|
for (let e = i.length - 1; e >= 0; e--) o.set(i[e].key, a), a += M(i[e]);
|
|
923
923
|
for (let n of i) e.push({
|
|
@@ -925,49 +925,49 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
925
925
|
right: o.get(n.key)
|
|
926
926
|
});
|
|
927
927
|
return e;
|
|
928
|
-
}),
|
|
929
|
-
function
|
|
928
|
+
}), B = S(null), V = S(null);
|
|
929
|
+
function H(e) {
|
|
930
930
|
return !e.fixed && !e.isSelection;
|
|
931
931
|
}
|
|
932
|
-
function
|
|
933
|
-
|
|
932
|
+
function ne(e, t) {
|
|
933
|
+
H(e) && (B.value = e.key, V.value = null, t.dataTransfer && (t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData("text/plain", e.key)));
|
|
934
934
|
}
|
|
935
|
-
function
|
|
936
|
-
|
|
935
|
+
function re(e, t) {
|
|
936
|
+
B.value && e.key !== B.value && H(e) && (t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), V.value = e.key);
|
|
937
937
|
}
|
|
938
|
-
function
|
|
938
|
+
function ie(e, t) {
|
|
939
939
|
t.preventDefault();
|
|
940
|
-
let n =
|
|
940
|
+
let n = B.value;
|
|
941
941
|
if (!n || n === e.key) return;
|
|
942
|
-
let r =
|
|
942
|
+
let r = R.value.map((e) => e.key), i = r.indexOf(n), a = r.indexOf(e.key);
|
|
943
943
|
if (i < 0 || a < 0) return;
|
|
944
944
|
let o = [...r];
|
|
945
945
|
o.splice(i, 1);
|
|
946
946
|
let s = i < a ? a - 1 : a;
|
|
947
947
|
o.splice(s, 0, n);
|
|
948
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
|
-
|
|
949
|
+
b.value = [
|
|
950
950
|
...c,
|
|
951
951
|
...o,
|
|
952
952
|
...l
|
|
953
|
-
],
|
|
953
|
+
], V.value = null;
|
|
954
954
|
}
|
|
955
|
-
function
|
|
956
|
-
|
|
955
|
+
function ae() {
|
|
956
|
+
B.value = null, V.value = null;
|
|
957
957
|
}
|
|
958
|
-
let
|
|
959
|
-
let e = Object.entries(
|
|
958
|
+
let U = x({}), W = r(() => z.value.filter((e) => e.filterable && !e.isSelection)), G = r(() => Object.values(U).some((e) => e !== "")), K = r(() => {
|
|
959
|
+
let e = Object.entries(U).filter(([, e]) => e !== "");
|
|
960
960
|
return e.length ? d.data.filter((t) => e.every(([e, n]) => {
|
|
961
961
|
let r = t[e];
|
|
962
962
|
return r == null ? !1 : d.columns.find((t) => t.key === e)?.filterType === "select" ? String(r) === n : String(r).toLowerCase().includes(n.toLowerCase());
|
|
963
963
|
})) : d.data;
|
|
964
964
|
});
|
|
965
|
-
function
|
|
966
|
-
for (let e of Object.keys(
|
|
967
|
-
|
|
965
|
+
function oe() {
|
|
966
|
+
for (let e of Object.keys(U)) U[e] = "";
|
|
967
|
+
Y.value = 1;
|
|
968
968
|
}
|
|
969
|
-
let
|
|
970
|
-
let e =
|
|
969
|
+
let J = S(d.pageSizeOptions[0] ?? 10), Y = S(1), X = r(() => Math.max(1, Math.ceil(K.value.length / J.value))), Z = r(() => K.value.slice((Y.value - 1) * J.value, Y.value * J.value)), se = r(() => {
|
|
970
|
+
let e = X.value, t = Y.value;
|
|
971
971
|
if (e <= 7) return Array.from({ length: e }, (e, t) => t + 1);
|
|
972
972
|
let n = [.../* @__PURE__ */ new Set([
|
|
973
973
|
1,
|
|
@@ -979,171 +979,175 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
979
979
|
for (let e of n) e - i > 1 && r.push("…"), r.push(e), i = e;
|
|
980
980
|
return r;
|
|
981
981
|
});
|
|
982
|
-
|
|
983
|
-
|
|
982
|
+
P([K, J], () => {
|
|
983
|
+
Y.value > X.value && (Y.value = X.value);
|
|
984
984
|
});
|
|
985
|
-
function
|
|
986
|
-
|
|
985
|
+
function Q(e) {
|
|
986
|
+
Y.value = Math.min(Math.max(1, e), X.value);
|
|
987
987
|
}
|
|
988
|
-
function
|
|
988
|
+
function $(e) {
|
|
989
989
|
let t = e[d.rowKey];
|
|
990
990
|
return t == null ? JSON.stringify(e) : String(t);
|
|
991
991
|
}
|
|
992
|
-
function
|
|
993
|
-
return f.value.includes(
|
|
992
|
+
function ce(e) {
|
|
993
|
+
return f.value.includes($(e));
|
|
994
994
|
}
|
|
995
|
-
function
|
|
996
|
-
let t =
|
|
995
|
+
function le(e) {
|
|
996
|
+
let t = $(e);
|
|
997
997
|
f.value.includes(t) ? f.value = f.value.filter((e) => e !== t) : f.value = [...f.value, t];
|
|
998
998
|
}
|
|
999
|
-
let
|
|
1000
|
-
function
|
|
1001
|
-
if (
|
|
1002
|
-
let e = new Set(
|
|
999
|
+
let ue = r(() => Z.value.length > 0 && Z.value.every((e) => ce(e))), de = r(() => !ue.value && Z.value.some((e) => ce(e)));
|
|
1000
|
+
function fe() {
|
|
1001
|
+
if (ue.value) {
|
|
1002
|
+
let e = new Set(Z.value.map((e) => $(e)));
|
|
1003
1003
|
f.value = f.value.filter((t) => !e.has(t));
|
|
1004
1004
|
} else {
|
|
1005
1005
|
let e = new Set(f.value);
|
|
1006
|
-
for (let t of
|
|
1006
|
+
for (let t of Z.value) e.add($(t));
|
|
1007
1007
|
f.value = [...e];
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
|
-
|
|
1011
|
-
let t = e.map((e) => d.data.find((t) =>
|
|
1012
|
-
|
|
1010
|
+
P(f, (e) => {
|
|
1011
|
+
let t = e.map((e) => d.data.find((t) => $(t) === e)).filter((e) => !!e);
|
|
1012
|
+
p("selection-change", e, t);
|
|
1013
1013
|
}, { deep: !0 });
|
|
1014
|
-
function
|
|
1014
|
+
function pe(e, t) {
|
|
1015
1015
|
let n = t[e.key];
|
|
1016
1016
|
return n == null ? "—" : e.formatter ? e.formatter(n, t) : String(n);
|
|
1017
1017
|
}
|
|
1018
|
-
return
|
|
1019
|
-
s("div",
|
|
1020
|
-
"onUpdate:modelValue": (e) =>
|
|
1018
|
+
return _(ee), (n, r) => (y(), o("div", Qe, [
|
|
1019
|
+
s("div", $e, [s("div", et, [(y(!0), o(e, null, C(W.value, (t) => (y(), o(e, { key: t.key }, [t.filterType === "select" ? (y(), o("label", tt, [s("span", nt, O(t.title), 1), I(s("select", {
|
|
1020
|
+
"onUpdate:modelValue": (e) => U[t.key] = e,
|
|
1021
1021
|
class: "cc-table__filter-control"
|
|
1022
|
-
}, [r[5] ||= s("option", { value: "" }, "全部", -1), (
|
|
1022
|
+
}, [r[5] ||= s("option", { value: "" }, "全部", -1), (y(!0), o(e, null, C(t.filterOptions, (e) => (y(), o("option", {
|
|
1023
1023
|
key: String(e.value),
|
|
1024
1024
|
value: String(e.value)
|
|
1025
|
-
},
|
|
1026
|
-
"onUpdate:modelValue": (e) =>
|
|
1025
|
+
}, O(e.label), 9, it))), 128))], 8, rt), [[te, U[t.key]]])])) : (y(), o("label", at, [s("span", ot, O(t.title), 1), I(s("input", {
|
|
1026
|
+
"onUpdate:modelValue": (e) => U[t.key] = e,
|
|
1027
1027
|
class: "cc-table__filter-control",
|
|
1028
1028
|
type: "text",
|
|
1029
1029
|
placeholder: `搜索${t.title}`
|
|
1030
|
-
}, null, 8,
|
|
1030
|
+
}, null, 8, st), [[N, U[t.key]]])]))], 64))), 128)), G.value ? (y(), i(q, {
|
|
1031
1031
|
key: 0,
|
|
1032
1032
|
size: "sm",
|
|
1033
1033
|
variant: "ghost",
|
|
1034
|
-
onClick:
|
|
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
|
|
1034
|
+
onClick: oe
|
|
1042
1035
|
}, {
|
|
1043
|
-
default:
|
|
1036
|
+
default: F(() => [...r[6] ||= [l(" 重置 ", -1)]]),
|
|
1044
1037
|
_: 1
|
|
1045
|
-
})
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
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
|
|
1038
|
+
})) : a("", !0)]), s("div", ct, [
|
|
1039
|
+
w(n.$slots, "toolbar-actions", {}, void 0, !0),
|
|
1040
|
+
u(q, {
|
|
1041
|
+
size: "sm",
|
|
1042
|
+
variant: "secondary",
|
|
1043
|
+
onClick: r[0] ||= (e) => D.value = !D.value
|
|
1059
1044
|
}, {
|
|
1060
|
-
default:
|
|
1061
|
-
_:
|
|
1062
|
-
}
|
|
1063
|
-
s("
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1045
|
+
default: F(() => [...r[7] ||= [l(" 列设置 ", -1)]]),
|
|
1046
|
+
_: 1
|
|
1047
|
+
}),
|
|
1048
|
+
D.value ? (y(), o(e, { key: 0 }, [s("div", {
|
|
1049
|
+
class: "cc-table__backdrop",
|
|
1050
|
+
onClick: r[1] ||= (e) => D.value = !1
|
|
1051
|
+
}), s("div", lt, [
|
|
1052
|
+
s("div", ut, [r[8] ||= s("div", { class: "cc-table__settings-title" }, "表格密度", -1), s("div", dt, [(y(), o(e, null, C(g, (e) => s("button", {
|
|
1053
|
+
key: e.value,
|
|
1054
|
+
type: "button",
|
|
1055
|
+
class: m(["cc-table__density-btn", { "cc-table__density-btn--active": E.value === e.value }]),
|
|
1056
|
+
onClick: (t) => E.value = e.value
|
|
1057
|
+
}, O(e.label), 11, ft)), 64))])]),
|
|
1058
|
+
s("div", pt, [r[9] ||= s("div", { class: "cc-table__settings-title" }, "显示列", -1), s("div", mt, [(y(!0), o(e, null, C(L.value, (e) => (y(), i(Te, {
|
|
1059
|
+
key: e.key,
|
|
1060
|
+
modelValue: T[e.key],
|
|
1061
|
+
"onUpdate:modelValue": (t) => T[e.key] = t
|
|
1062
|
+
}, {
|
|
1063
|
+
default: F(() => [l(O(e.title), 1)]),
|
|
1064
|
+
_: 2
|
|
1065
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"]))), 128))])]),
|
|
1066
|
+
s("button", {
|
|
1067
|
+
type: "button",
|
|
1068
|
+
class: "cc-table__settings-reset",
|
|
1069
|
+
onClick: j
|
|
1070
|
+
}, "恢复默认")
|
|
1071
|
+
])], 64)) : a("", !0)
|
|
1072
|
+
])]),
|
|
1069
1073
|
s("div", {
|
|
1070
1074
|
class: "cc-table__scroll",
|
|
1071
|
-
style:
|
|
1072
|
-
}, [s("table", { class:
|
|
1073
|
-
s("colgroup", null, [(
|
|
1075
|
+
style: h({ maxHeight: t.maxHeight })
|
|
1076
|
+
}, [s("table", { class: m(["cc-table__table", `cc-table--${E.value}`]) }, [
|
|
1077
|
+
s("colgroup", null, [(y(!0), o(e, null, C(z.value, (e) => (y(), o("col", {
|
|
1074
1078
|
key: e.key,
|
|
1075
|
-
style:
|
|
1079
|
+
style: h({ width: `${e.width}px` })
|
|
1076
1080
|
}, null, 4))), 128))]),
|
|
1077
|
-
s("thead", null, [s("tr", null, [(
|
|
1081
|
+
s("thead", null, [s("tr", null, [(y(!0), o(e, null, C(z.value, (e) => (y(), o("th", {
|
|
1078
1082
|
key: e.key,
|
|
1079
|
-
class:
|
|
1083
|
+
class: m(["cc-table__th", [
|
|
1080
1084
|
`cc-table__cell--${e.align}`,
|
|
1081
1085
|
{ "cc-table__th--fixed-left": e.fixed === "left" || e.isSelection },
|
|
1082
1086
|
{ "cc-table__th--fixed-left-end": e.isLastLeftFixed },
|
|
1083
1087
|
{ "cc-table__th--fixed-right": e.fixed === "right" },
|
|
1084
|
-
{ "cc-table__th--draggable":
|
|
1085
|
-
{ "cc-table__th--dragging":
|
|
1086
|
-
{ "cc-table__th--drop-target":
|
|
1088
|
+
{ "cc-table__th--draggable": H(e) },
|
|
1089
|
+
{ "cc-table__th--dragging": B.value === e.key },
|
|
1090
|
+
{ "cc-table__th--drop-target": V.value === e.key }
|
|
1087
1091
|
]]),
|
|
1088
|
-
style:
|
|
1092
|
+
style: h({
|
|
1089
1093
|
left: e.left == null ? void 0 : `${e.left}px`,
|
|
1090
1094
|
right: e.right == null ? void 0 : `${e.right}px`
|
|
1091
1095
|
}),
|
|
1092
|
-
draggable:
|
|
1093
|
-
onDragstart: (t) =>
|
|
1094
|
-
onDragover: (t) =>
|
|
1095
|
-
onDrop: (t) =>
|
|
1096
|
-
onDragend:
|
|
1097
|
-
}, [e.isSelection ? (
|
|
1096
|
+
draggable: H(e),
|
|
1097
|
+
onDragstart: (t) => ne(e, t),
|
|
1098
|
+
onDragover: (t) => re(e, t),
|
|
1099
|
+
onDrop: (t) => ie(e, t),
|
|
1100
|
+
onDragend: ae
|
|
1101
|
+
}, [e.isSelection ? (y(), o("input", {
|
|
1098
1102
|
key: 0,
|
|
1099
1103
|
type: "checkbox",
|
|
1100
1104
|
class: "cc-table__check",
|
|
1101
|
-
checked:
|
|
1102
|
-
indeterminate:
|
|
1105
|
+
checked: ue.value,
|
|
1106
|
+
indeterminate: de.value,
|
|
1103
1107
|
"aria-label": "选择本页全部",
|
|
1104
|
-
onChange:
|
|
1105
|
-
}, null, 40,
|
|
1106
|
-
s("tbody", null, [
|
|
1108
|
+
onChange: fe
|
|
1109
|
+
}, null, 40, gt)) : (y(), o("span", _t, [l(O(e.title) + " ", 1), H(e) ? (y(), o("svg", vt, [...r[10] ||= [c("<circle cx=\"3\" cy=\"2.5\" r=\"1\" fill=\"currentColor\" data-v-568baede></circle><circle cx=\"7\" cy=\"2.5\" r=\"1\" fill=\"currentColor\" data-v-568baede></circle><circle cx=\"3\" cy=\"7\" r=\"1\" fill=\"currentColor\" data-v-568baede></circle><circle cx=\"7\" cy=\"7\" r=\"1\" fill=\"currentColor\" data-v-568baede></circle><circle cx=\"3\" cy=\"11.5\" r=\"1\" fill=\"currentColor\" data-v-568baede></circle><circle cx=\"7\" cy=\"11.5\" r=\"1\" fill=\"currentColor\" data-v-568baede></circle>", 6)]])) : a("", !0)]))], 46, ht))), 128))])]),
|
|
1110
|
+
s("tbody", null, [Z.value.length ? a("", !0) : (y(), o("tr", yt, [s("td", {
|
|
1107
1111
|
class: "cc-table__empty",
|
|
1108
|
-
colspan:
|
|
1109
|
-
},
|
|
1110
|
-
key:
|
|
1112
|
+
colspan: z.value.length
|
|
1113
|
+
}, O(t.emptyText), 9, bt)])), (y(!0), o(e, null, C(Z.value, (t) => (y(), o("tr", {
|
|
1114
|
+
key: $(t),
|
|
1111
1115
|
class: "cc-table__row"
|
|
1112
|
-
}, [(
|
|
1116
|
+
}, [(y(!0), o(e, null, C(z.value, (r) => (y(), o("td", {
|
|
1113
1117
|
key: r.key,
|
|
1114
|
-
class:
|
|
1118
|
+
class: m(["cc-table__td", [
|
|
1115
1119
|
`cc-table__cell--${r.align}`,
|
|
1116
1120
|
{ "cc-table__td--fixed-left": r.fixed === "left" || r.isSelection },
|
|
1117
1121
|
{ "cc-table__td--fixed-left-end": r.isLastLeftFixed },
|
|
1118
1122
|
{ "cc-table__td--fixed-right": r.fixed === "right" }
|
|
1119
1123
|
]]),
|
|
1120
|
-
style:
|
|
1124
|
+
style: h({
|
|
1121
1125
|
left: r.left == null ? void 0 : `${r.left}px`,
|
|
1122
1126
|
right: r.right == null ? void 0 : `${r.right}px`
|
|
1123
1127
|
})
|
|
1124
|
-
}, [r.isSelection ? (
|
|
1128
|
+
}, [r.isSelection ? (y(), o("input", {
|
|
1125
1129
|
key: 0,
|
|
1126
1130
|
type: "checkbox",
|
|
1127
1131
|
class: "cc-table__check",
|
|
1128
|
-
checked:
|
|
1129
|
-
"aria-label": `选择第 ${
|
|
1130
|
-
onChange: (e) =>
|
|
1131
|
-
}, null, 40,
|
|
1132
|
+
checked: ce(t),
|
|
1133
|
+
"aria-label": `选择第 ${$(t)} 行`,
|
|
1134
|
+
onChange: (e) => le(t)
|
|
1135
|
+
}, null, 40, xt)) : r.slot ? w(n.$slots, r.slot, {
|
|
1132
1136
|
row: t,
|
|
1133
1137
|
value: t[r.key]
|
|
1134
|
-
}, void 0, !0, 1) : (
|
|
1138
|
+
}, void 0, !0, 1) : (y(), o(e, { key: 2 }, [l(O(pe(r, t)), 1)], 64))], 6))), 128))]))), 128))])
|
|
1135
1139
|
], 2)], 4),
|
|
1136
|
-
s("div",
|
|
1140
|
+
s("div", St, [s("span", Ct, "共 " + O(K.value.length) + " 条", 1), s("div", wt, [
|
|
1137
1141
|
r[13] ||= s("span", { class: "cc-table__pager-size" }, "每页", -1),
|
|
1138
|
-
|
|
1139
|
-
"onUpdate:modelValue": r[2] ||= (e) =>
|
|
1142
|
+
I(s("select", {
|
|
1143
|
+
"onUpdate:modelValue": r[2] ||= (e) => J.value = e,
|
|
1140
1144
|
class: "cc-table__pagesize"
|
|
1141
|
-
}, [(
|
|
1145
|
+
}, [(y(!0), o(e, null, C(t.pageSizeOptions, (e) => (y(), o("option", {
|
|
1142
1146
|
key: e,
|
|
1143
1147
|
value: e
|
|
1144
|
-
},
|
|
1145
|
-
|
|
1146
|
-
|
|
1148
|
+
}, O(e), 9, Tt))), 128))], 512), [[
|
|
1149
|
+
te,
|
|
1150
|
+
J.value,
|
|
1147
1151
|
void 0,
|
|
1148
1152
|
{ number: !0 }
|
|
1149
1153
|
]]),
|
|
@@ -1151,9 +1155,9 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
1151
1155
|
s("button", {
|
|
1152
1156
|
type: "button",
|
|
1153
1157
|
class: "cc-table__page-btn",
|
|
1154
|
-
disabled:
|
|
1158
|
+
disabled: Y.value <= 1,
|
|
1155
1159
|
"aria-label": "上一页",
|
|
1156
|
-
onClick: r[3] ||= (e) =>
|
|
1160
|
+
onClick: r[3] ||= (e) => Q(Y.value - 1)
|
|
1157
1161
|
}, [...r[11] ||= [s("svg", {
|
|
1158
1162
|
width: "14",
|
|
1159
1163
|
height: "14",
|
|
@@ -1166,19 +1170,19 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
1166
1170
|
"stroke-width": "1.6",
|
|
1167
1171
|
"stroke-linecap": "round",
|
|
1168
1172
|
"stroke-linejoin": "round"
|
|
1169
|
-
})], -1)]], 8,
|
|
1170
|
-
(
|
|
1173
|
+
})], -1)]], 8, Et),
|
|
1174
|
+
(y(!0), o(e, null, C(se.value, (t, n) => (y(), o(e, { key: `${t}-${n}` }, [t === "…" ? (y(), o("span", Ot, "…")) : (y(), o("button", {
|
|
1171
1175
|
key: 0,
|
|
1172
1176
|
type: "button",
|
|
1173
|
-
class:
|
|
1174
|
-
onClick: (e) =>
|
|
1175
|
-
},
|
|
1177
|
+
class: m(["cc-table__page-btn cc-table__page-btn--num", { "cc-table__page-btn--active": Y.value === t }]),
|
|
1178
|
+
onClick: (e) => Q(t)
|
|
1179
|
+
}, O(t), 11, Dt))], 64))), 128)),
|
|
1176
1180
|
s("button", {
|
|
1177
1181
|
type: "button",
|
|
1178
1182
|
class: "cc-table__page-btn",
|
|
1179
|
-
disabled:
|
|
1183
|
+
disabled: Y.value >= X.value,
|
|
1180
1184
|
"aria-label": "下一页",
|
|
1181
|
-
onClick: r[4] ||= (e) =>
|
|
1185
|
+
onClick: r[4] ||= (e) => Q(Y.value + 1)
|
|
1182
1186
|
}, [...r[12] ||= [s("svg", {
|
|
1183
1187
|
width: "14",
|
|
1184
1188
|
height: "14",
|
|
@@ -1191,11 +1195,11 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
1191
1195
|
"stroke-width": "1.6",
|
|
1192
1196
|
"stroke-linecap": "round",
|
|
1193
1197
|
"stroke-linejoin": "round"
|
|
1194
|
-
})], -1)]], 8,
|
|
1198
|
+
})], -1)]], 8, kt)
|
|
1195
1199
|
])])
|
|
1196
1200
|
]));
|
|
1197
1201
|
}
|
|
1198
|
-
}), [["__scopeId", "data-v-
|
|
1202
|
+
}), [["__scopeId", "data-v-568baede"]]), Nt = [
|
|
1199
1203
|
"#533afd",
|
|
1200
1204
|
"#635bff",
|
|
1201
1205
|
"#00d4ff",
|
|
@@ -1204,7 +1208,7 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
1204
1208
|
"#ff5c8a",
|
|
1205
1209
|
"#8a6bff",
|
|
1206
1210
|
"#22d3ee"
|
|
1207
|
-
],
|
|
1211
|
+
], Pt = [
|
|
1208
1212
|
"#635bff",
|
|
1209
1213
|
"#00d4ff",
|
|
1210
1214
|
"#00c48a",
|
|
@@ -1213,10 +1217,10 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
1213
1217
|
"#a78bfa",
|
|
1214
1218
|
"#22d3ee",
|
|
1215
1219
|
"#f472b6"
|
|
1216
|
-
],
|
|
1217
|
-
function
|
|
1220
|
+
], Ft = "#5b6472", It = "#9aa3b5", Lt = "rgba(28, 30, 84, 0.96)";
|
|
1221
|
+
function Rt(e) {
|
|
1218
1222
|
return {
|
|
1219
|
-
backgroundColor: e ?
|
|
1223
|
+
backgroundColor: e ? Lt : "#ffffff",
|
|
1220
1224
|
borderColor: e ? "rgba(255, 255, 255, 0.12)" : "#e6e8ef",
|
|
1221
1225
|
borderWidth: 1,
|
|
1222
1226
|
padding: [8, 12],
|
|
@@ -1227,7 +1231,7 @@ function Q(e) {
|
|
|
1227
1231
|
extraCssText: "box-shadow: 0 8px 24px rgba(13, 37, 61, 0.12); border-radius: 10px;"
|
|
1228
1232
|
};
|
|
1229
1233
|
}
|
|
1230
|
-
function
|
|
1234
|
+
function zt(e) {
|
|
1231
1235
|
return {
|
|
1232
1236
|
show: !0,
|
|
1233
1237
|
top: 0,
|
|
@@ -1236,40 +1240,40 @@ function Lt(e) {
|
|
|
1236
1240
|
itemHeight: 8,
|
|
1237
1241
|
itemGap: 14,
|
|
1238
1242
|
textStyle: {
|
|
1239
|
-
color: e ?
|
|
1243
|
+
color: e ? It : Ft,
|
|
1240
1244
|
fontSize: 12
|
|
1241
1245
|
}
|
|
1242
1246
|
};
|
|
1243
1247
|
}
|
|
1244
|
-
function
|
|
1248
|
+
function Bt(e) {
|
|
1245
1249
|
return {
|
|
1246
1250
|
lineStyle: { color: e ? "rgba(255, 255, 255, 0.14)" : "#e6e8ef" },
|
|
1247
|
-
axisLabel: { color: e ?
|
|
1251
|
+
axisLabel: { color: e ? It : Ft },
|
|
1248
1252
|
splitLine: { lineStyle: { color: e ? "rgba(255, 255, 255, 0.07)" : "#eef0f5" } }
|
|
1249
1253
|
};
|
|
1250
1254
|
}
|
|
1251
1255
|
//#endregion
|
|
1252
1256
|
//#region src/components/Chart/useECharts.ts
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1257
|
+
R.use([
|
|
1258
|
+
z,
|
|
1259
|
+
B,
|
|
1260
|
+
V,
|
|
1261
|
+
H,
|
|
1262
|
+
ne,
|
|
1263
|
+
re,
|
|
1264
|
+
ie
|
|
1261
1265
|
]);
|
|
1262
|
-
function
|
|
1263
|
-
let t =
|
|
1264
|
-
|
|
1265
|
-
e.value && (t.value =
|
|
1266
|
+
function Vt(e) {
|
|
1267
|
+
let t = D(void 0), n;
|
|
1268
|
+
_(() => {
|
|
1269
|
+
e.value && (t.value = R.init(e.value), n = new ResizeObserver(() => {
|
|
1266
1270
|
t.value?.resize();
|
|
1267
1271
|
}), n.observe(e.value));
|
|
1268
1272
|
});
|
|
1269
1273
|
function r(e) {
|
|
1270
1274
|
t.value && t.value.setOption(e, { notMerge: !0 });
|
|
1271
1275
|
}
|
|
1272
|
-
return
|
|
1276
|
+
return g(() => {
|
|
1273
1277
|
n?.disconnect(), t.value?.dispose(), t.value = void 0;
|
|
1274
1278
|
}), {
|
|
1275
1279
|
chart: t,
|
|
@@ -1278,7 +1282,7 @@ function zt(e) {
|
|
|
1278
1282
|
}
|
|
1279
1283
|
//#endregion
|
|
1280
1284
|
//#region src/components/Chart/CcBarChart.vue
|
|
1281
|
-
var
|
|
1285
|
+
var Ht = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
1282
1286
|
__name: "CcBarChart",
|
|
1283
1287
|
props: {
|
|
1284
1288
|
categories: {},
|
|
@@ -1307,8 +1311,8 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1307
1311
|
}
|
|
1308
1312
|
},
|
|
1309
1313
|
setup(e) {
|
|
1310
|
-
let t = e, n =
|
|
1311
|
-
let e = t.colors ?? (t.dark ?
|
|
1314
|
+
let t = e, n = S(), { setOption: i } = Vt(n), a = r(() => {
|
|
1315
|
+
let e = t.colors ?? (t.dark ? Pt : Nt), n = Bt(t.dark), r = {
|
|
1312
1316
|
...n,
|
|
1313
1317
|
type: "value",
|
|
1314
1318
|
axisLine: { show: !1 },
|
|
@@ -1335,9 +1339,9 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1335
1339
|
bottom: 6,
|
|
1336
1340
|
containLabel: !0
|
|
1337
1341
|
},
|
|
1338
|
-
legend: t.showLegend ?
|
|
1342
|
+
legend: t.showLegend ? zt(t.dark) : { show: !1 },
|
|
1339
1343
|
tooltip: {
|
|
1340
|
-
...
|
|
1344
|
+
...Rt(t.dark),
|
|
1341
1345
|
trigger: "axis",
|
|
1342
1346
|
axisPointer: {
|
|
1343
1347
|
type: "shadow",
|
|
@@ -1370,16 +1374,16 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1370
1374
|
}))
|
|
1371
1375
|
};
|
|
1372
1376
|
});
|
|
1373
|
-
return
|
|
1377
|
+
return P(a, (e) => i(e), { deep: !0 }), _(() => i(a.value)), (t, r) => (y(), o("div", {
|
|
1374
1378
|
class: "cc-chart cc-chart--bar",
|
|
1375
|
-
style:
|
|
1379
|
+
style: h({ height: `${e.height}px` })
|
|
1376
1380
|
}, [s("div", {
|
|
1377
1381
|
ref_key: "chartEl",
|
|
1378
1382
|
ref: n,
|
|
1379
1383
|
class: "cc-chart__canvas"
|
|
1380
1384
|
}, null, 512)], 4));
|
|
1381
1385
|
}
|
|
1382
|
-
}), [["__scopeId", "data-v-f3347dd9"]]),
|
|
1386
|
+
}), [["__scopeId", "data-v-f3347dd9"]]), Ut = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
1383
1387
|
__name: "CcPieChart",
|
|
1384
1388
|
props: {
|
|
1385
1389
|
data: {},
|
|
@@ -1407,8 +1411,8 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1407
1411
|
}
|
|
1408
1412
|
},
|
|
1409
1413
|
setup(e) {
|
|
1410
|
-
let t = e, n =
|
|
1411
|
-
let e = t.colors ?? (t.dark ?
|
|
1414
|
+
let t = e, n = S(), { setOption: i } = Vt(n), a = r(() => {
|
|
1415
|
+
let e = t.colors ?? (t.dark ? Pt : Nt), n = t.showLegend ? zt(t.dark) : { show: !1 };
|
|
1412
1416
|
return {
|
|
1413
1417
|
color: e,
|
|
1414
1418
|
backgroundColor: "transparent",
|
|
@@ -1419,7 +1423,7 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1419
1423
|
top: void 0
|
|
1420
1424
|
} : { show: !1 },
|
|
1421
1425
|
tooltip: {
|
|
1422
|
-
...
|
|
1426
|
+
...Rt(t.dark),
|
|
1423
1427
|
trigger: "item",
|
|
1424
1428
|
valueFormatter: (e) => String(e)
|
|
1425
1429
|
},
|
|
@@ -1455,16 +1459,16 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1455
1459
|
}]
|
|
1456
1460
|
};
|
|
1457
1461
|
});
|
|
1458
|
-
return
|
|
1462
|
+
return P(a, (e) => i(e), { deep: !0 }), _(() => i(a.value)), (t, r) => (y(), o("div", {
|
|
1459
1463
|
class: "cc-chart cc-chart--pie",
|
|
1460
|
-
style:
|
|
1464
|
+
style: h({ height: `${e.height}px` })
|
|
1461
1465
|
}, [s("div", {
|
|
1462
1466
|
ref_key: "chartEl",
|
|
1463
1467
|
ref: n,
|
|
1464
1468
|
class: "cc-chart__canvas"
|
|
1465
1469
|
}, null, 512)], 4));
|
|
1466
1470
|
}
|
|
1467
|
-
}), [["__scopeId", "data-v-7fe37b76"]]),
|
|
1471
|
+
}), [["__scopeId", "data-v-7fe37b76"]]), Wt = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
1468
1472
|
__name: "CcLineChart",
|
|
1469
1473
|
props: {
|
|
1470
1474
|
categories: {},
|
|
@@ -1497,8 +1501,8 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1497
1501
|
}
|
|
1498
1502
|
},
|
|
1499
1503
|
setup(e) {
|
|
1500
|
-
let t = e, n =
|
|
1501
|
-
let e = t.colors ?? (t.dark ?
|
|
1504
|
+
let t = e, n = S(), { setOption: i } = Vt(n), a = r(() => {
|
|
1505
|
+
let e = t.colors ?? (t.dark ? Pt : Nt), n = Bt(t.dark);
|
|
1502
1506
|
return {
|
|
1503
1507
|
color: e,
|
|
1504
1508
|
backgroundColor: "transparent",
|
|
@@ -1510,9 +1514,9 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1510
1514
|
bottom: 6,
|
|
1511
1515
|
containLabel: !0
|
|
1512
1516
|
},
|
|
1513
|
-
legend: t.showLegend ?
|
|
1517
|
+
legend: t.showLegend ? zt(t.dark) : { show: !1 },
|
|
1514
1518
|
tooltip: {
|
|
1515
|
-
...
|
|
1519
|
+
...Rt(t.dark),
|
|
1516
1520
|
trigger: "axis",
|
|
1517
1521
|
axisPointer: {
|
|
1518
1522
|
type: "line",
|
|
@@ -1557,51 +1561,343 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1557
1561
|
}))
|
|
1558
1562
|
};
|
|
1559
1563
|
});
|
|
1560
|
-
return
|
|
1564
|
+
return P(a, (e) => i(e), { deep: !0 }), _(() => i(a.value)), (t, r) => (y(), o("div", {
|
|
1561
1565
|
class: "cc-chart cc-chart--line",
|
|
1562
|
-
style:
|
|
1566
|
+
style: h({ height: `${e.height}px` })
|
|
1563
1567
|
}, [s("div", {
|
|
1564
1568
|
ref_key: "chartEl",
|
|
1565
1569
|
ref: n,
|
|
1566
1570
|
class: "cc-chart__canvas"
|
|
1567
1571
|
}, null, 512)], 4));
|
|
1568
1572
|
}
|
|
1569
|
-
}), [["__scopeId", "data-v-5300a86d"]]),
|
|
1573
|
+
}), [["__scopeId", "data-v-5300a86d"]]), Gt = [
|
|
1570
1574
|
"stripe",
|
|
1571
1575
|
"linear",
|
|
1572
1576
|
"vercel",
|
|
1573
1577
|
"notion",
|
|
1574
1578
|
"raycast"
|
|
1575
|
-
],
|
|
1579
|
+
], Kt = {
|
|
1576
1580
|
stripe: "Stripe · 经典紫",
|
|
1577
1581
|
linear: "Linear · 深色薰衣草",
|
|
1578
1582
|
vercel: "Vercel · 黑白极简",
|
|
1579
1583
|
notion: "Notion · 纸张笔记",
|
|
1580
1584
|
raycast: "Raycast · 暗夜白键"
|
|
1581
|
-
},
|
|
1582
|
-
function
|
|
1583
|
-
return typeof e == "string" &&
|
|
1585
|
+
}, qt = "data-cc-theme", Jt = Symbol("cc-theme"), Yt = "stripe";
|
|
1586
|
+
function Xt(e) {
|
|
1587
|
+
return typeof e == "string" && Gt.includes(e);
|
|
1584
1588
|
}
|
|
1585
|
-
function
|
|
1589
|
+
function Zt(e) {
|
|
1586
1590
|
if (typeof document > "u") return;
|
|
1587
1591
|
let t = document.documentElement;
|
|
1588
1592
|
if (e === "stripe") {
|
|
1589
|
-
t.removeAttribute(
|
|
1593
|
+
t.removeAttribute(qt);
|
|
1590
1594
|
return;
|
|
1591
1595
|
}
|
|
1592
|
-
t.setAttribute(
|
|
1596
|
+
t.setAttribute(qt, e);
|
|
1593
1597
|
}
|
|
1594
|
-
function
|
|
1595
|
-
if (typeof document > "u") return
|
|
1596
|
-
let e = document.documentElement.getAttribute(
|
|
1597
|
-
return
|
|
1598
|
+
function Qt() {
|
|
1599
|
+
if (typeof document > "u") return Yt;
|
|
1600
|
+
let e = document.documentElement.getAttribute(qt);
|
|
1601
|
+
return Xt(e) ? e : Yt;
|
|
1598
1602
|
}
|
|
1599
|
-
function
|
|
1600
|
-
typeof document > "u" || document.documentElement.removeAttribute(
|
|
1603
|
+
function $t() {
|
|
1604
|
+
typeof document > "u" || document.documentElement.removeAttribute(qt);
|
|
1601
1605
|
}
|
|
1602
1606
|
//#endregion
|
|
1603
|
-
//#region src/components/
|
|
1604
|
-
var
|
|
1607
|
+
//#region src/components/Menus/CcMenuList.vue?vue&type=script&setup=true&lang.ts
|
|
1608
|
+
var en = { class: "cc-menus__list" }, tn = ["onClick"], nn = { class: "cc-menus__name" }, rn = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
1609
|
+
__name: "CcMenuList",
|
|
1610
|
+
props: {
|
|
1611
|
+
nodes: {},
|
|
1612
|
+
expandedIds: {},
|
|
1613
|
+
value: {},
|
|
1614
|
+
showIndentLine: { type: Boolean }
|
|
1615
|
+
},
|
|
1616
|
+
emits: [
|
|
1617
|
+
"toggle",
|
|
1618
|
+
"select",
|
|
1619
|
+
"row-click"
|
|
1620
|
+
],
|
|
1621
|
+
setup(t, { emit: n }) {
|
|
1622
|
+
let r = n;
|
|
1623
|
+
return (n, c) => {
|
|
1624
|
+
let l = T("CcMenuList", !0);
|
|
1625
|
+
return y(), o("ul", en, [(y(!0), o(e, null, C(t.nodes, (e) => (y(), o("li", {
|
|
1626
|
+
key: e.id,
|
|
1627
|
+
class: "cc-menus__item"
|
|
1628
|
+
}, [s("button", {
|
|
1629
|
+
type: "button",
|
|
1630
|
+
class: m(["cc-menus__row", { "cc-menus__row--active": e.id === t.value }]),
|
|
1631
|
+
onClick: (t) => r("row-click", e)
|
|
1632
|
+
}, [w(n.$slots, "default", {
|
|
1633
|
+
node: e,
|
|
1634
|
+
level: e.menuLevel ?? 0
|
|
1635
|
+
}, () => [s("span", nn, O(e.name), 1)], !0), e.children && e.children.length > 0 ? (y(), o("svg", {
|
|
1636
|
+
key: 0,
|
|
1637
|
+
width: "12",
|
|
1638
|
+
height: "12",
|
|
1639
|
+
viewBox: "0 0 24 24",
|
|
1640
|
+
fill: "none",
|
|
1641
|
+
class: m(["cc-menus__chevron", { "cc-menus__chevron--open": t.expandedIds.has(e.id) }]),
|
|
1642
|
+
"aria-hidden": "true"
|
|
1643
|
+
}, [...c[3] ||= [s("path", {
|
|
1644
|
+
d: "m9 6 6 6-6 6",
|
|
1645
|
+
stroke: "currentColor",
|
|
1646
|
+
"stroke-width": "2",
|
|
1647
|
+
"stroke-linecap": "round",
|
|
1648
|
+
"stroke-linejoin": "round"
|
|
1649
|
+
}, null, -1)]], 2)) : a("", !0)], 10, tn), e.children && e.children.length > 0 && t.expandedIds.has(e.id) ? (y(), i(l, {
|
|
1650
|
+
key: 0,
|
|
1651
|
+
class: m(["cc-menus__list--nested", { "cc-menus__list--plain": t.showIndentLine === !1 }]),
|
|
1652
|
+
nodes: e.children,
|
|
1653
|
+
"expanded-ids": t.expandedIds,
|
|
1654
|
+
value: t.value,
|
|
1655
|
+
"show-indent-line": t.showIndentLine,
|
|
1656
|
+
onToggle: c[0] ||= (e) => r("toggle", e),
|
|
1657
|
+
onSelect: c[1] ||= (e) => r("select", e),
|
|
1658
|
+
onRowClick: c[2] ||= (e) => r("row-click", e)
|
|
1659
|
+
}, null, 8, [
|
|
1660
|
+
"class",
|
|
1661
|
+
"nodes",
|
|
1662
|
+
"expanded-ids",
|
|
1663
|
+
"value",
|
|
1664
|
+
"show-indent-line"
|
|
1665
|
+
])) : a("", !0)]))), 128))]);
|
|
1666
|
+
};
|
|
1667
|
+
}
|
|
1668
|
+
}), [["__scopeId", "data-v-9320b1fb"]]), an = { class: "cc-menus__brand" }, on = { class: "cc-menus__nav" }, sn = {
|
|
1669
|
+
key: 1,
|
|
1670
|
+
class: "cc-menus__topnav"
|
|
1671
|
+
}, cn = ["onMouseenter"], ln = ["onClick"], un = {
|
|
1672
|
+
key: 0,
|
|
1673
|
+
class: "cc-menus__dropdown"
|
|
1674
|
+
}, dn = { class: "cc-menus__user" }, fn = ["aria-expanded"], pn = ["src"], mn = {
|
|
1675
|
+
key: 1,
|
|
1676
|
+
class: "cc-menus__avatar"
|
|
1677
|
+
}, hn = { class: "cc-menus__username" }, gn = {
|
|
1678
|
+
key: 0,
|
|
1679
|
+
class: "cc-menus__dropdown cc-menus__dropdown--user",
|
|
1680
|
+
role: "menu"
|
|
1681
|
+
}, _n = { class: "cc-menus__user-info" }, vn = { class: "cc-menus__user-name" }, yn = {
|
|
1682
|
+
key: 0,
|
|
1683
|
+
class: "cc-menus__user-account"
|
|
1684
|
+
}, bn = { class: "cc-menus__theme" }, xn = { class: "cc-menus__layout-options" }, Sn = { class: "cc-menus__theme" }, Cn = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
1685
|
+
__name: "CcMenus",
|
|
1686
|
+
props: {
|
|
1687
|
+
menus: {},
|
|
1688
|
+
position: { default: "left" },
|
|
1689
|
+
user: { default: null },
|
|
1690
|
+
themeStorageKey: { default: "cc-menus-theme" },
|
|
1691
|
+
activeMenuId: { default: void 0 },
|
|
1692
|
+
defaultExpanded: {
|
|
1693
|
+
type: Boolean,
|
|
1694
|
+
default: !0
|
|
1695
|
+
}
|
|
1696
|
+
},
|
|
1697
|
+
emits: [
|
|
1698
|
+
"menu-click",
|
|
1699
|
+
"logout",
|
|
1700
|
+
"update:position"
|
|
1701
|
+
],
|
|
1702
|
+
setup(t, { emit: n }) {
|
|
1703
|
+
let c = t, d = n;
|
|
1704
|
+
function f(e) {
|
|
1705
|
+
let t = e.filter((e) => e.id !== void 0).map((e) => ({
|
|
1706
|
+
...e,
|
|
1707
|
+
children: e.children ? [...e.children] : void 0
|
|
1708
|
+
})), n = /* @__PURE__ */ new Map();
|
|
1709
|
+
for (let e of t) n.set(e.id, e);
|
|
1710
|
+
let r = [];
|
|
1711
|
+
for (let e of t) {
|
|
1712
|
+
let t = e.parentMenuId ?? 0, i = n.get(t);
|
|
1713
|
+
i && i.id !== e.id ? (i.children = i.children ?? [], i.children.push(e)) : r.push(e);
|
|
1714
|
+
}
|
|
1715
|
+
let i = (e) => {
|
|
1716
|
+
e.sort((e, t) => (e.orderNumber ?? 0) - (t.orderNumber ?? 0) || e.id - t.id);
|
|
1717
|
+
for (let t of e) t.children && t.children.length && i(t.children);
|
|
1718
|
+
};
|
|
1719
|
+
return i(r), r;
|
|
1720
|
+
}
|
|
1721
|
+
let p = r(() => f(c.menus)), h = S(/* @__PURE__ */ new Set());
|
|
1722
|
+
function g(e) {
|
|
1723
|
+
return !!(e.children && e.children.length > 0);
|
|
1724
|
+
}
|
|
1725
|
+
function b(e) {
|
|
1726
|
+
let t = new Set(h.value);
|
|
1727
|
+
t.has(e) ? t.delete(e) : t.add(e), h.value = t;
|
|
1728
|
+
}
|
|
1729
|
+
function x(e) {
|
|
1730
|
+
g(e) || d("menu-click", e);
|
|
1731
|
+
}
|
|
1732
|
+
function T(e) {
|
|
1733
|
+
g(e) ? b(e.id) : d("menu-click", e);
|
|
1734
|
+
}
|
|
1735
|
+
let E = S(Qt()), D = Gt.map((e) => ({
|
|
1736
|
+
label: Kt[e],
|
|
1737
|
+
value: e
|
|
1738
|
+
}));
|
|
1739
|
+
P(E, (e) => {
|
|
1740
|
+
Zt(e), localStorage.setItem(c.themeStorageKey, e);
|
|
1741
|
+
});
|
|
1742
|
+
let k = S(!1), A = S(null), j = null;
|
|
1743
|
+
function M(e) {
|
|
1744
|
+
j &&= (clearTimeout(j), null), A.value = e;
|
|
1745
|
+
}
|
|
1746
|
+
function te() {
|
|
1747
|
+
j && clearTimeout(j), j = setTimeout(() => {
|
|
1748
|
+
A.value = null;
|
|
1749
|
+
}, 120);
|
|
1750
|
+
}
|
|
1751
|
+
let N = S(null);
|
|
1752
|
+
function I(e) {
|
|
1753
|
+
if (!N.value) return;
|
|
1754
|
+
let t = e.target;
|
|
1755
|
+
N.value.contains(t) || (j &&= (clearTimeout(j), null), k.value = !1, A.value = null);
|
|
1756
|
+
}
|
|
1757
|
+
let L = r(() => c.user?.role ?? c.user?.displayName ?? c.user?.username ?? "未命名用户"), R = r(() => L.value.charAt(0).toUpperCase());
|
|
1758
|
+
function z() {
|
|
1759
|
+
k.value = !1, d("logout");
|
|
1760
|
+
}
|
|
1761
|
+
return _(() => {
|
|
1762
|
+
document.addEventListener("click", I);
|
|
1763
|
+
let e = localStorage.getItem(c.themeStorageKey);
|
|
1764
|
+
if (e && Gt.includes(e) && (E.value = e), c.defaultExpanded) {
|
|
1765
|
+
let e = (t) => {
|
|
1766
|
+
let n = /* @__PURE__ */ new Set();
|
|
1767
|
+
for (let r of t) if (g(r)) {
|
|
1768
|
+
n.add(r.id);
|
|
1769
|
+
for (let t of e(r.children ?? [])) n.add(t);
|
|
1770
|
+
}
|
|
1771
|
+
return n;
|
|
1772
|
+
};
|
|
1773
|
+
h.value = e(p.value);
|
|
1774
|
+
}
|
|
1775
|
+
}), v(() => {
|
|
1776
|
+
j && clearTimeout(j), document.removeEventListener("click", I);
|
|
1777
|
+
}), (n, r) => (y(), o("div", {
|
|
1778
|
+
ref_key: "rootEl",
|
|
1779
|
+
ref: N,
|
|
1780
|
+
class: m(["cc-menus", `cc-menus--${t.position}`])
|
|
1781
|
+
}, [
|
|
1782
|
+
s("div", an, [w(n.$slots, "logo", {}, () => [r[4] ||= s("span", { class: "cc-menus__brand-default" }, "Company", -1)], !0)]),
|
|
1783
|
+
s("nav", on, [t.position === "left" ? (y(), i(rn, {
|
|
1784
|
+
key: 0,
|
|
1785
|
+
nodes: p.value,
|
|
1786
|
+
"expanded-ids": h.value,
|
|
1787
|
+
value: t.activeMenuId,
|
|
1788
|
+
"show-indent-line": !1,
|
|
1789
|
+
onToggle: b,
|
|
1790
|
+
onSelect: x,
|
|
1791
|
+
onRowClick: T
|
|
1792
|
+
}, {
|
|
1793
|
+
default: F(({ node: e, level: t }) => [w(n.$slots, "menu-item", {
|
|
1794
|
+
menu: e,
|
|
1795
|
+
level: t
|
|
1796
|
+
}, () => [l(O(e.name), 1)], !0)]),
|
|
1797
|
+
_: 3
|
|
1798
|
+
}, 8, [
|
|
1799
|
+
"nodes",
|
|
1800
|
+
"expanded-ids",
|
|
1801
|
+
"value"
|
|
1802
|
+
])) : (y(), o("ul", sn, [(y(!0), o(e, null, C(p.value, (e) => (y(), o("li", {
|
|
1803
|
+
key: e.id,
|
|
1804
|
+
class: "cc-menus__topnav-item",
|
|
1805
|
+
onMouseenter: (t) => M(e.id),
|
|
1806
|
+
onMouseleave: te
|
|
1807
|
+
}, [s("button", {
|
|
1808
|
+
type: "button",
|
|
1809
|
+
class: "cc-menus__topnav-btn",
|
|
1810
|
+
onClick: (t) => T(e)
|
|
1811
|
+
}, [w(n.$slots, "menu-item", {
|
|
1812
|
+
menu: e,
|
|
1813
|
+
level: 0
|
|
1814
|
+
}, () => [l(O(e.name), 1)], !0), g(e) ? (y(), o("svg", {
|
|
1815
|
+
key: 0,
|
|
1816
|
+
class: m(["cc-menus__caret", { "cc-menus__caret--open": A.value === e.id }]),
|
|
1817
|
+
width: "12",
|
|
1818
|
+
height: "12",
|
|
1819
|
+
viewBox: "0 0 24 24",
|
|
1820
|
+
fill: "none",
|
|
1821
|
+
"aria-hidden": "true"
|
|
1822
|
+
}, [...r[5] ||= [s("path", {
|
|
1823
|
+
d: "m6 9 6 6 6-6",
|
|
1824
|
+
stroke: "currentColor",
|
|
1825
|
+
"stroke-width": "2",
|
|
1826
|
+
"stroke-linecap": "round",
|
|
1827
|
+
"stroke-linejoin": "round"
|
|
1828
|
+
}, null, -1)]], 2)) : a("", !0)], 8, ln), g(e) && A.value === e.id ? (y(), o("div", un, [u(rn, {
|
|
1829
|
+
nodes: e.children ?? [],
|
|
1830
|
+
"expanded-ids": h.value,
|
|
1831
|
+
value: t.activeMenuId,
|
|
1832
|
+
"show-indent-line": !1,
|
|
1833
|
+
onToggle: b,
|
|
1834
|
+
onSelect: x,
|
|
1835
|
+
onRowClick: T
|
|
1836
|
+
}, {
|
|
1837
|
+
default: F(({ node: e, level: t }) => [w(n.$slots, "menu-item", {
|
|
1838
|
+
menu: e,
|
|
1839
|
+
level: t
|
|
1840
|
+
}, () => [l(O(e.name), 1)], !0)]),
|
|
1841
|
+
_: 3
|
|
1842
|
+
}, 8, [
|
|
1843
|
+
"nodes",
|
|
1844
|
+
"expanded-ids",
|
|
1845
|
+
"value"
|
|
1846
|
+
])])) : a("", !0)], 40, cn))), 128))]))]),
|
|
1847
|
+
r[9] ||= s("div", { class: "cc-menus__spacer" }, null, -1),
|
|
1848
|
+
s("div", dn, [s("button", {
|
|
1849
|
+
type: "button",
|
|
1850
|
+
class: "cc-menus__user-btn",
|
|
1851
|
+
"aria-expanded": k.value,
|
|
1852
|
+
"aria-haspopup": "menu",
|
|
1853
|
+
onClick: r[0] ||= (e) => k.value = !k.value
|
|
1854
|
+
}, [
|
|
1855
|
+
c.user?.avatarUrl ? (y(), o("img", {
|
|
1856
|
+
key: 0,
|
|
1857
|
+
class: "cc-menus__avatar cc-menus__avatar--img",
|
|
1858
|
+
src: c.user.avatarUrl,
|
|
1859
|
+
alt: ""
|
|
1860
|
+
}, null, 8, pn)) : (y(), o("span", mn, O(R.value), 1)),
|
|
1861
|
+
s("span", hn, O(L.value), 1),
|
|
1862
|
+
(y(), o("svg", {
|
|
1863
|
+
class: m(["cc-menus__caret", { "cc-menus__caret--open": k.value }]),
|
|
1864
|
+
width: "12",
|
|
1865
|
+
height: "12",
|
|
1866
|
+
viewBox: "0 0 24 24",
|
|
1867
|
+
fill: "none",
|
|
1868
|
+
"aria-hidden": "true"
|
|
1869
|
+
}, [...r[6] ||= [s("path", {
|
|
1870
|
+
d: "m6 9 6 6 6-6",
|
|
1871
|
+
stroke: "currentColor",
|
|
1872
|
+
"stroke-width": "2",
|
|
1873
|
+
"stroke-linecap": "round",
|
|
1874
|
+
"stroke-linejoin": "round"
|
|
1875
|
+
}, null, -1)]], 2))
|
|
1876
|
+
], 8, fn), k.value ? (y(), o("div", gn, [
|
|
1877
|
+
s("div", _n, [s("p", vn, [l(O(L.value), 1), c.user?.username ? (y(), o("span", yn, " · " + O(c.user.username), 1)) : a("", !0)])]),
|
|
1878
|
+
s("div", bn, [r[7] ||= s("p", { class: "cc-menus__theme-label" }, "菜单栏位置", -1), s("div", xn, [s("button", {
|
|
1879
|
+
type: "button",
|
|
1880
|
+
class: m(["cc-menus__layout-option", { "is-active": t.position === "left" }]),
|
|
1881
|
+
onClick: r[1] ||= (e) => d("update:position", "left")
|
|
1882
|
+
}, "左侧", 2), s("button", {
|
|
1883
|
+
type: "button",
|
|
1884
|
+
class: m(["cc-menus__layout-option", { "is-active": t.position === "top" }]),
|
|
1885
|
+
onClick: r[2] ||= (e) => d("update:position", "top")
|
|
1886
|
+
}, "顶部", 2)])]),
|
|
1887
|
+
s("div", Sn, [r[8] ||= s("p", { class: "cc-menus__theme-label" }, "主题风格", -1), u(ye, {
|
|
1888
|
+
modelValue: E.value,
|
|
1889
|
+
"onUpdate:modelValue": r[3] ||= (e) => E.value = e,
|
|
1890
|
+
options: ee(D)
|
|
1891
|
+
}, null, 8, ["modelValue", "options"])]),
|
|
1892
|
+
s("button", {
|
|
1893
|
+
type: "button",
|
|
1894
|
+
class: "cc-menus__logout",
|
|
1895
|
+
onClick: z
|
|
1896
|
+
}, "退出登录")
|
|
1897
|
+
])) : a("", !0)])
|
|
1898
|
+
], 2));
|
|
1899
|
+
}
|
|
1900
|
+
}), [["__scopeId", "data-v-67df3fd6"]]), wn = /* @__PURE__ */ d({
|
|
1605
1901
|
__name: "CcThemeProvider",
|
|
1606
1902
|
props: {
|
|
1607
1903
|
theme: { default: "stripe" },
|
|
@@ -1612,78 +1908,80 @@ var Zt = /* @__PURE__ */ d({
|
|
|
1612
1908
|
},
|
|
1613
1909
|
emits: ["change"],
|
|
1614
1910
|
setup(e, { emit: t }) {
|
|
1615
|
-
let n = e, r = t, i =
|
|
1616
|
-
|
|
1911
|
+
let n = e, r = t, i = S(n.theme);
|
|
1912
|
+
b(Jt, i);
|
|
1617
1913
|
function a() {
|
|
1618
1914
|
if (!n.persist) return n.theme;
|
|
1619
1915
|
try {
|
|
1620
1916
|
let e = localStorage.getItem("cc-library-theme");
|
|
1621
|
-
if (
|
|
1917
|
+
if (Xt(e)) return e;
|
|
1622
1918
|
} catch {}
|
|
1623
1919
|
return n.theme;
|
|
1624
1920
|
}
|
|
1625
1921
|
function o(e) {
|
|
1626
|
-
if (i.value = e,
|
|
1922
|
+
if (i.value = e, Zt(e), n.persist) try {
|
|
1627
1923
|
localStorage.setItem("cc-library-theme", e);
|
|
1628
1924
|
} catch {}
|
|
1629
1925
|
r("change", e);
|
|
1630
1926
|
}
|
|
1631
|
-
return
|
|
1927
|
+
return _(() => {
|
|
1632
1928
|
o(a());
|
|
1633
|
-
}),
|
|
1634
|
-
|
|
1635
|
-
}), (e, t) =>
|
|
1929
|
+
}), P(() => n.theme, (e) => {
|
|
1930
|
+
Xt(e) && o(e);
|
|
1931
|
+
}), (e, t) => w(e.$slots, "default");
|
|
1636
1932
|
}
|
|
1637
1933
|
});
|
|
1638
1934
|
//#endregion
|
|
1639
1935
|
//#region src/index.ts
|
|
1640
|
-
function
|
|
1936
|
+
function Tn(e) {
|
|
1641
1937
|
let t = [
|
|
1642
|
-
["CcButton",
|
|
1643
|
-
["CcInput",
|
|
1644
|
-
["CcTextarea",
|
|
1938
|
+
["CcButton", q],
|
|
1939
|
+
["CcInput", Q],
|
|
1940
|
+
["CcTextarea", de],
|
|
1645
1941
|
["CcSelect", ye],
|
|
1646
1942
|
["CcSwitch", Se],
|
|
1647
|
-
["CcCheckbox",
|
|
1648
|
-
["CcRadio",
|
|
1649
|
-
["CcCard",
|
|
1650
|
-
["CcTag",
|
|
1651
|
-
["CcBadge",
|
|
1652
|
-
["CcAlert",
|
|
1653
|
-
["CcModal",
|
|
1654
|
-
["CcTooltip",
|
|
1655
|
-
["CcSpinner",
|
|
1656
|
-
["CcDivider",
|
|
1657
|
-
["CcTable",
|
|
1658
|
-
["CcBarChart",
|
|
1659
|
-
["CcPieChart",
|
|
1660
|
-
["CcLineChart",
|
|
1661
|
-
["
|
|
1943
|
+
["CcCheckbox", Te],
|
|
1944
|
+
["CcRadio", Oe],
|
|
1945
|
+
["CcCard", Pe],
|
|
1946
|
+
["CcTag", Ie],
|
|
1947
|
+
["CcBadge", Re],
|
|
1948
|
+
["CcAlert", He],
|
|
1949
|
+
["CcModal", Je],
|
|
1950
|
+
["CcTooltip", Ye],
|
|
1951
|
+
["CcSpinner", G],
|
|
1952
|
+
["CcDivider", Ze],
|
|
1953
|
+
["CcTable", Mt],
|
|
1954
|
+
["CcBarChart", Ht],
|
|
1955
|
+
["CcPieChart", Ut],
|
|
1956
|
+
["CcLineChart", Wt],
|
|
1957
|
+
["CcMenus", Cn],
|
|
1958
|
+
["CcThemeProvider", wn]
|
|
1662
1959
|
];
|
|
1663
1960
|
for (let [n, r] of t) e.component(n, r);
|
|
1664
1961
|
}
|
|
1665
|
-
var
|
|
1666
|
-
install:
|
|
1667
|
-
CcButton:
|
|
1668
|
-
CcInput:
|
|
1669
|
-
CcTextarea:
|
|
1962
|
+
var En = {
|
|
1963
|
+
install: Tn,
|
|
1964
|
+
CcButton: q,
|
|
1965
|
+
CcInput: Q,
|
|
1966
|
+
CcTextarea: de,
|
|
1670
1967
|
CcSelect: ye,
|
|
1671
1968
|
CcSwitch: Se,
|
|
1672
|
-
CcCheckbox:
|
|
1673
|
-
CcRadio:
|
|
1674
|
-
CcCard:
|
|
1675
|
-
CcTag:
|
|
1676
|
-
CcBadge:
|
|
1677
|
-
CcAlert:
|
|
1678
|
-
CcModal:
|
|
1679
|
-
CcTooltip:
|
|
1680
|
-
CcSpinner:
|
|
1681
|
-
CcDivider:
|
|
1682
|
-
CcTable:
|
|
1683
|
-
CcBarChart:
|
|
1684
|
-
CcPieChart:
|
|
1685
|
-
CcLineChart:
|
|
1686
|
-
|
|
1969
|
+
CcCheckbox: Te,
|
|
1970
|
+
CcRadio: Oe,
|
|
1971
|
+
CcCard: Pe,
|
|
1972
|
+
CcTag: Ie,
|
|
1973
|
+
CcBadge: Re,
|
|
1974
|
+
CcAlert: He,
|
|
1975
|
+
CcModal: Je,
|
|
1976
|
+
CcTooltip: Ye,
|
|
1977
|
+
CcSpinner: G,
|
|
1978
|
+
CcDivider: Ze,
|
|
1979
|
+
CcTable: Mt,
|
|
1980
|
+
CcBarChart: Ht,
|
|
1981
|
+
CcPieChart: Ut,
|
|
1982
|
+
CcLineChart: Wt,
|
|
1983
|
+
CcMenus: Cn,
|
|
1984
|
+
CcThemeProvider: wn
|
|
1687
1985
|
};
|
|
1688
1986
|
//#endregion
|
|
1689
|
-
export {
|
|
1987
|
+
export { Gt as CC_THEMES, Kt as CC_THEME_LABELS, He as CcAlert, Re as CcBadge, Ht as CcBarChart, q as CcButton, Pe as CcCard, Te as CcCheckbox, Ze as CcDivider, Q as CcInput, Wt as CcLineChart, Cn as CcMenus, Je as CcModal, Ut as CcPieChart, Oe as CcRadio, ye as CcSelect, G as CcSpinner, Se as CcSwitch, Mt as CcTable, Ie as CcTag, de as CcTextarea, wn as CcThemeProvider, Ye as CcTooltip, En as default, Qt as getTheme, Tn as install, $t as resetTheme, Zt as setTheme };
|