common_component_library_vue 0.1.4 → 0.1.5
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 +665 -371
- 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/index.d.ts +94 -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,85 +979,85 @@ 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:
|
|
1034
|
+
onClick: oe
|
|
1035
1035
|
}, {
|
|
1036
|
-
default:
|
|
1036
|
+
default: F(() => [...r[6] ||= [l(" 重置 ", -1)]]),
|
|
1037
1037
|
_: 1
|
|
1038
|
-
})) : a("", !0)]), s("div",
|
|
1038
|
+
})) : a("", !0)]), s("div", ct, [u(q, {
|
|
1039
1039
|
size: "sm",
|
|
1040
1040
|
variant: "secondary",
|
|
1041
1041
|
onClick: r[0] ||= (e) => D.value = !D.value
|
|
1042
1042
|
}, {
|
|
1043
|
-
default:
|
|
1043
|
+
default: F(() => [...r[7] ||= [l(" 列设置 ", -1)]]),
|
|
1044
1044
|
_: 1
|
|
1045
|
-
}), D.value ? (
|
|
1045
|
+
}), D.value ? (y(), o(e, { key: 0 }, [s("div", {
|
|
1046
1046
|
class: "cc-table__backdrop",
|
|
1047
1047
|
onClick: r[1] ||= (e) => D.value = !1
|
|
1048
|
-
}), s("div",
|
|
1049
|
-
s("div",
|
|
1048
|
+
}), s("div", lt, [
|
|
1049
|
+
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", {
|
|
1050
1050
|
key: e.value,
|
|
1051
1051
|
type: "button",
|
|
1052
|
-
class:
|
|
1053
|
-
onClick: (t) =>
|
|
1054
|
-
},
|
|
1055
|
-
s("div",
|
|
1052
|
+
class: m(["cc-table__density-btn", { "cc-table__density-btn--active": E.value === e.value }]),
|
|
1053
|
+
onClick: (t) => E.value = e.value
|
|
1054
|
+
}, O(e.label), 11, ft)), 64))])]),
|
|
1055
|
+
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, {
|
|
1056
1056
|
key: e.key,
|
|
1057
|
-
modelValue:
|
|
1058
|
-
"onUpdate:modelValue": (t) =>
|
|
1057
|
+
modelValue: T[e.key],
|
|
1058
|
+
"onUpdate:modelValue": (t) => T[e.key] = t
|
|
1059
1059
|
}, {
|
|
1060
|
-
default:
|
|
1060
|
+
default: F(() => [l(O(e.title), 1)]),
|
|
1061
1061
|
_: 2
|
|
1062
1062
|
}, 1032, ["modelValue", "onUpdate:modelValue"]))), 128))])]),
|
|
1063
1063
|
s("button", {
|
|
@@ -1068,82 +1068,82 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
1068
1068
|
])], 64)) : a("", !0)])]),
|
|
1069
1069
|
s("div", {
|
|
1070
1070
|
class: "cc-table__scroll",
|
|
1071
|
-
style:
|
|
1072
|
-
}, [s("table", { class:
|
|
1073
|
-
s("colgroup", null, [(
|
|
1071
|
+
style: h({ maxHeight: t.maxHeight })
|
|
1072
|
+
}, [s("table", { class: m(["cc-table__table", `cc-table--${E.value}`]) }, [
|
|
1073
|
+
s("colgroup", null, [(y(!0), o(e, null, C(z.value, (e) => (y(), o("col", {
|
|
1074
1074
|
key: e.key,
|
|
1075
|
-
style:
|
|
1075
|
+
style: h({ width: `${e.width}px` })
|
|
1076
1076
|
}, null, 4))), 128))]),
|
|
1077
|
-
s("thead", null, [s("tr", null, [(
|
|
1077
|
+
s("thead", null, [s("tr", null, [(y(!0), o(e, null, C(z.value, (e) => (y(), o("th", {
|
|
1078
1078
|
key: e.key,
|
|
1079
|
-
class:
|
|
1079
|
+
class: m(["cc-table__th", [
|
|
1080
1080
|
`cc-table__cell--${e.align}`,
|
|
1081
1081
|
{ "cc-table__th--fixed-left": e.fixed === "left" || e.isSelection },
|
|
1082
1082
|
{ "cc-table__th--fixed-left-end": e.isLastLeftFixed },
|
|
1083
1083
|
{ "cc-table__th--fixed-right": e.fixed === "right" },
|
|
1084
|
-
{ "cc-table__th--draggable":
|
|
1085
|
-
{ "cc-table__th--dragging":
|
|
1086
|
-
{ "cc-table__th--drop-target":
|
|
1084
|
+
{ "cc-table__th--draggable": H(e) },
|
|
1085
|
+
{ "cc-table__th--dragging": B.value === e.key },
|
|
1086
|
+
{ "cc-table__th--drop-target": V.value === e.key }
|
|
1087
1087
|
]]),
|
|
1088
|
-
style:
|
|
1088
|
+
style: h({
|
|
1089
1089
|
left: e.left == null ? void 0 : `${e.left}px`,
|
|
1090
1090
|
right: e.right == null ? void 0 : `${e.right}px`
|
|
1091
1091
|
}),
|
|
1092
|
-
draggable:
|
|
1093
|
-
onDragstart: (t) =>
|
|
1094
|
-
onDragover: (t) =>
|
|
1095
|
-
onDrop: (t) =>
|
|
1096
|
-
onDragend:
|
|
1097
|
-
}, [e.isSelection ? (
|
|
1092
|
+
draggable: H(e),
|
|
1093
|
+
onDragstart: (t) => ne(e, t),
|
|
1094
|
+
onDragover: (t) => re(e, t),
|
|
1095
|
+
onDrop: (t) => ie(e, t),
|
|
1096
|
+
onDragend: ae
|
|
1097
|
+
}, [e.isSelection ? (y(), o("input", {
|
|
1098
1098
|
key: 0,
|
|
1099
1099
|
type: "checkbox",
|
|
1100
1100
|
class: "cc-table__check",
|
|
1101
|
-
checked:
|
|
1102
|
-
indeterminate:
|
|
1101
|
+
checked: ue.value,
|
|
1102
|
+
indeterminate: de.value,
|
|
1103
1103
|
"aria-label": "选择本页全部",
|
|
1104
|
-
onChange:
|
|
1105
|
-
}, null, 40,
|
|
1106
|
-
s("tbody", null, [
|
|
1104
|
+
onChange: fe
|
|
1105
|
+
}, 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-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, ht))), 128))])]),
|
|
1106
|
+
s("tbody", null, [Z.value.length ? a("", !0) : (y(), o("tr", yt, [s("td", {
|
|
1107
1107
|
class: "cc-table__empty",
|
|
1108
|
-
colspan:
|
|
1109
|
-
},
|
|
1110
|
-
key:
|
|
1108
|
+
colspan: z.value.length
|
|
1109
|
+
}, O(t.emptyText), 9, bt)])), (y(!0), o(e, null, C(Z.value, (t) => (y(), o("tr", {
|
|
1110
|
+
key: $(t),
|
|
1111
1111
|
class: "cc-table__row"
|
|
1112
|
-
}, [(
|
|
1112
|
+
}, [(y(!0), o(e, null, C(z.value, (r) => (y(), o("td", {
|
|
1113
1113
|
key: r.key,
|
|
1114
|
-
class:
|
|
1114
|
+
class: m(["cc-table__td", [
|
|
1115
1115
|
`cc-table__cell--${r.align}`,
|
|
1116
1116
|
{ "cc-table__td--fixed-left": r.fixed === "left" || r.isSelection },
|
|
1117
1117
|
{ "cc-table__td--fixed-left-end": r.isLastLeftFixed },
|
|
1118
1118
|
{ "cc-table__td--fixed-right": r.fixed === "right" }
|
|
1119
1119
|
]]),
|
|
1120
|
-
style:
|
|
1120
|
+
style: h({
|
|
1121
1121
|
left: r.left == null ? void 0 : `${r.left}px`,
|
|
1122
1122
|
right: r.right == null ? void 0 : `${r.right}px`
|
|
1123
1123
|
})
|
|
1124
|
-
}, [r.isSelection ? (
|
|
1124
|
+
}, [r.isSelection ? (y(), o("input", {
|
|
1125
1125
|
key: 0,
|
|
1126
1126
|
type: "checkbox",
|
|
1127
1127
|
class: "cc-table__check",
|
|
1128
|
-
checked:
|
|
1129
|
-
"aria-label": `选择第 ${
|
|
1130
|
-
onChange: (e) =>
|
|
1131
|
-
}, null, 40,
|
|
1128
|
+
checked: ce(t),
|
|
1129
|
+
"aria-label": `选择第 ${$(t)} 行`,
|
|
1130
|
+
onChange: (e) => le(t)
|
|
1131
|
+
}, null, 40, xt)) : r.slot ? w(n.$slots, r.slot, {
|
|
1132
1132
|
row: t,
|
|
1133
1133
|
value: t[r.key]
|
|
1134
|
-
}, void 0, !0, 1) : (
|
|
1134
|
+
}, void 0, !0, 1) : (y(), o(e, { key: 2 }, [l(O(pe(r, t)), 1)], 64))], 6))), 128))]))), 128))])
|
|
1135
1135
|
], 2)], 4),
|
|
1136
|
-
s("div",
|
|
1136
|
+
s("div", St, [s("span", Ct, "共 " + O(K.value.length) + " 条", 1), s("div", wt, [
|
|
1137
1137
|
r[13] ||= s("span", { class: "cc-table__pager-size" }, "每页", -1),
|
|
1138
|
-
|
|
1139
|
-
"onUpdate:modelValue": r[2] ||= (e) =>
|
|
1138
|
+
I(s("select", {
|
|
1139
|
+
"onUpdate:modelValue": r[2] ||= (e) => J.value = e,
|
|
1140
1140
|
class: "cc-table__pagesize"
|
|
1141
|
-
}, [(
|
|
1141
|
+
}, [(y(!0), o(e, null, C(t.pageSizeOptions, (e) => (y(), o("option", {
|
|
1142
1142
|
key: e,
|
|
1143
1143
|
value: e
|
|
1144
|
-
},
|
|
1145
|
-
|
|
1146
|
-
|
|
1144
|
+
}, O(e), 9, Tt))), 128))], 512), [[
|
|
1145
|
+
te,
|
|
1146
|
+
J.value,
|
|
1147
1147
|
void 0,
|
|
1148
1148
|
{ number: !0 }
|
|
1149
1149
|
]]),
|
|
@@ -1151,9 +1151,9 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
1151
1151
|
s("button", {
|
|
1152
1152
|
type: "button",
|
|
1153
1153
|
class: "cc-table__page-btn",
|
|
1154
|
-
disabled:
|
|
1154
|
+
disabled: Y.value <= 1,
|
|
1155
1155
|
"aria-label": "上一页",
|
|
1156
|
-
onClick: r[3] ||= (e) =>
|
|
1156
|
+
onClick: r[3] ||= (e) => Q(Y.value - 1)
|
|
1157
1157
|
}, [...r[11] ||= [s("svg", {
|
|
1158
1158
|
width: "14",
|
|
1159
1159
|
height: "14",
|
|
@@ -1166,19 +1166,19 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
1166
1166
|
"stroke-width": "1.6",
|
|
1167
1167
|
"stroke-linecap": "round",
|
|
1168
1168
|
"stroke-linejoin": "round"
|
|
1169
|
-
})], -1)]], 8,
|
|
1170
|
-
(
|
|
1169
|
+
})], -1)]], 8, Et),
|
|
1170
|
+
(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
1171
|
key: 0,
|
|
1172
1172
|
type: "button",
|
|
1173
|
-
class:
|
|
1174
|
-
onClick: (e) =>
|
|
1175
|
-
},
|
|
1173
|
+
class: m(["cc-table__page-btn cc-table__page-btn--num", { "cc-table__page-btn--active": Y.value === t }]),
|
|
1174
|
+
onClick: (e) => Q(t)
|
|
1175
|
+
}, O(t), 11, Dt))], 64))), 128)),
|
|
1176
1176
|
s("button", {
|
|
1177
1177
|
type: "button",
|
|
1178
1178
|
class: "cc-table__page-btn",
|
|
1179
|
-
disabled:
|
|
1179
|
+
disabled: Y.value >= X.value,
|
|
1180
1180
|
"aria-label": "下一页",
|
|
1181
|
-
onClick: r[4] ||= (e) =>
|
|
1181
|
+
onClick: r[4] ||= (e) => Q(Y.value + 1)
|
|
1182
1182
|
}, [...r[12] ||= [s("svg", {
|
|
1183
1183
|
width: "14",
|
|
1184
1184
|
height: "14",
|
|
@@ -1191,11 +1191,11 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
1191
1191
|
"stroke-width": "1.6",
|
|
1192
1192
|
"stroke-linecap": "round",
|
|
1193
1193
|
"stroke-linejoin": "round"
|
|
1194
|
-
})], -1)]], 8,
|
|
1194
|
+
})], -1)]], 8, kt)
|
|
1195
1195
|
])])
|
|
1196
1196
|
]));
|
|
1197
1197
|
}
|
|
1198
|
-
}), [["__scopeId", "data-v-e1238af3"]]),
|
|
1198
|
+
}), [["__scopeId", "data-v-e1238af3"]]), Nt = [
|
|
1199
1199
|
"#533afd",
|
|
1200
1200
|
"#635bff",
|
|
1201
1201
|
"#00d4ff",
|
|
@@ -1204,7 +1204,7 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
1204
1204
|
"#ff5c8a",
|
|
1205
1205
|
"#8a6bff",
|
|
1206
1206
|
"#22d3ee"
|
|
1207
|
-
],
|
|
1207
|
+
], Pt = [
|
|
1208
1208
|
"#635bff",
|
|
1209
1209
|
"#00d4ff",
|
|
1210
1210
|
"#00c48a",
|
|
@@ -1213,10 +1213,10 @@ var se = ["width", "height"], ce = /*@__PURE__*/ d({
|
|
|
1213
1213
|
"#a78bfa",
|
|
1214
1214
|
"#22d3ee",
|
|
1215
1215
|
"#f472b6"
|
|
1216
|
-
],
|
|
1217
|
-
function
|
|
1216
|
+
], Ft = "#5b6472", It = "#9aa3b5", Lt = "rgba(28, 30, 84, 0.96)";
|
|
1217
|
+
function Rt(e) {
|
|
1218
1218
|
return {
|
|
1219
|
-
backgroundColor: e ?
|
|
1219
|
+
backgroundColor: e ? Lt : "#ffffff",
|
|
1220
1220
|
borderColor: e ? "rgba(255, 255, 255, 0.12)" : "#e6e8ef",
|
|
1221
1221
|
borderWidth: 1,
|
|
1222
1222
|
padding: [8, 12],
|
|
@@ -1227,7 +1227,7 @@ function Q(e) {
|
|
|
1227
1227
|
extraCssText: "box-shadow: 0 8px 24px rgba(13, 37, 61, 0.12); border-radius: 10px;"
|
|
1228
1228
|
};
|
|
1229
1229
|
}
|
|
1230
|
-
function
|
|
1230
|
+
function zt(e) {
|
|
1231
1231
|
return {
|
|
1232
1232
|
show: !0,
|
|
1233
1233
|
top: 0,
|
|
@@ -1236,40 +1236,40 @@ function Lt(e) {
|
|
|
1236
1236
|
itemHeight: 8,
|
|
1237
1237
|
itemGap: 14,
|
|
1238
1238
|
textStyle: {
|
|
1239
|
-
color: e ?
|
|
1239
|
+
color: e ? It : Ft,
|
|
1240
1240
|
fontSize: 12
|
|
1241
1241
|
}
|
|
1242
1242
|
};
|
|
1243
1243
|
}
|
|
1244
|
-
function
|
|
1244
|
+
function Bt(e) {
|
|
1245
1245
|
return {
|
|
1246
1246
|
lineStyle: { color: e ? "rgba(255, 255, 255, 0.14)" : "#e6e8ef" },
|
|
1247
|
-
axisLabel: { color: e ?
|
|
1247
|
+
axisLabel: { color: e ? It : Ft },
|
|
1248
1248
|
splitLine: { lineStyle: { color: e ? "rgba(255, 255, 255, 0.07)" : "#eef0f5" } }
|
|
1249
1249
|
};
|
|
1250
1250
|
}
|
|
1251
1251
|
//#endregion
|
|
1252
1252
|
//#region src/components/Chart/useECharts.ts
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1253
|
+
R.use([
|
|
1254
|
+
z,
|
|
1255
|
+
B,
|
|
1256
|
+
V,
|
|
1257
|
+
H,
|
|
1258
|
+
ne,
|
|
1259
|
+
re,
|
|
1260
|
+
ie
|
|
1261
1261
|
]);
|
|
1262
|
-
function
|
|
1263
|
-
let t =
|
|
1264
|
-
|
|
1265
|
-
e.value && (t.value =
|
|
1262
|
+
function Vt(e) {
|
|
1263
|
+
let t = D(void 0), n;
|
|
1264
|
+
_(() => {
|
|
1265
|
+
e.value && (t.value = R.init(e.value), n = new ResizeObserver(() => {
|
|
1266
1266
|
t.value?.resize();
|
|
1267
1267
|
}), n.observe(e.value));
|
|
1268
1268
|
});
|
|
1269
1269
|
function r(e) {
|
|
1270
1270
|
t.value && t.value.setOption(e, { notMerge: !0 });
|
|
1271
1271
|
}
|
|
1272
|
-
return
|
|
1272
|
+
return g(() => {
|
|
1273
1273
|
n?.disconnect(), t.value?.dispose(), t.value = void 0;
|
|
1274
1274
|
}), {
|
|
1275
1275
|
chart: t,
|
|
@@ -1278,7 +1278,7 @@ function zt(e) {
|
|
|
1278
1278
|
}
|
|
1279
1279
|
//#endregion
|
|
1280
1280
|
//#region src/components/Chart/CcBarChart.vue
|
|
1281
|
-
var
|
|
1281
|
+
var Ht = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
1282
1282
|
__name: "CcBarChart",
|
|
1283
1283
|
props: {
|
|
1284
1284
|
categories: {},
|
|
@@ -1307,8 +1307,8 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1307
1307
|
}
|
|
1308
1308
|
},
|
|
1309
1309
|
setup(e) {
|
|
1310
|
-
let t = e, n =
|
|
1311
|
-
let e = t.colors ?? (t.dark ?
|
|
1310
|
+
let t = e, n = S(), { setOption: i } = Vt(n), a = r(() => {
|
|
1311
|
+
let e = t.colors ?? (t.dark ? Pt : Nt), n = Bt(t.dark), r = {
|
|
1312
1312
|
...n,
|
|
1313
1313
|
type: "value",
|
|
1314
1314
|
axisLine: { show: !1 },
|
|
@@ -1335,9 +1335,9 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1335
1335
|
bottom: 6,
|
|
1336
1336
|
containLabel: !0
|
|
1337
1337
|
},
|
|
1338
|
-
legend: t.showLegend ?
|
|
1338
|
+
legend: t.showLegend ? zt(t.dark) : { show: !1 },
|
|
1339
1339
|
tooltip: {
|
|
1340
|
-
...
|
|
1340
|
+
...Rt(t.dark),
|
|
1341
1341
|
trigger: "axis",
|
|
1342
1342
|
axisPointer: {
|
|
1343
1343
|
type: "shadow",
|
|
@@ -1370,16 +1370,16 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1370
1370
|
}))
|
|
1371
1371
|
};
|
|
1372
1372
|
});
|
|
1373
|
-
return
|
|
1373
|
+
return P(a, (e) => i(e), { deep: !0 }), _(() => i(a.value)), (t, r) => (y(), o("div", {
|
|
1374
1374
|
class: "cc-chart cc-chart--bar",
|
|
1375
|
-
style:
|
|
1375
|
+
style: h({ height: `${e.height}px` })
|
|
1376
1376
|
}, [s("div", {
|
|
1377
1377
|
ref_key: "chartEl",
|
|
1378
1378
|
ref: n,
|
|
1379
1379
|
class: "cc-chart__canvas"
|
|
1380
1380
|
}, null, 512)], 4));
|
|
1381
1381
|
}
|
|
1382
|
-
}), [["__scopeId", "data-v-f3347dd9"]]),
|
|
1382
|
+
}), [["__scopeId", "data-v-f3347dd9"]]), Ut = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
1383
1383
|
__name: "CcPieChart",
|
|
1384
1384
|
props: {
|
|
1385
1385
|
data: {},
|
|
@@ -1407,8 +1407,8 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1407
1407
|
}
|
|
1408
1408
|
},
|
|
1409
1409
|
setup(e) {
|
|
1410
|
-
let t = e, n =
|
|
1411
|
-
let e = t.colors ?? (t.dark ?
|
|
1410
|
+
let t = e, n = S(), { setOption: i } = Vt(n), a = r(() => {
|
|
1411
|
+
let e = t.colors ?? (t.dark ? Pt : Nt), n = t.showLegend ? zt(t.dark) : { show: !1 };
|
|
1412
1412
|
return {
|
|
1413
1413
|
color: e,
|
|
1414
1414
|
backgroundColor: "transparent",
|
|
@@ -1419,7 +1419,7 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1419
1419
|
top: void 0
|
|
1420
1420
|
} : { show: !1 },
|
|
1421
1421
|
tooltip: {
|
|
1422
|
-
...
|
|
1422
|
+
...Rt(t.dark),
|
|
1423
1423
|
trigger: "item",
|
|
1424
1424
|
valueFormatter: (e) => String(e)
|
|
1425
1425
|
},
|
|
@@ -1455,16 +1455,16 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1455
1455
|
}]
|
|
1456
1456
|
};
|
|
1457
1457
|
});
|
|
1458
|
-
return
|
|
1458
|
+
return P(a, (e) => i(e), { deep: !0 }), _(() => i(a.value)), (t, r) => (y(), o("div", {
|
|
1459
1459
|
class: "cc-chart cc-chart--pie",
|
|
1460
|
-
style:
|
|
1460
|
+
style: h({ height: `${e.height}px` })
|
|
1461
1461
|
}, [s("div", {
|
|
1462
1462
|
ref_key: "chartEl",
|
|
1463
1463
|
ref: n,
|
|
1464
1464
|
class: "cc-chart__canvas"
|
|
1465
1465
|
}, null, 512)], 4));
|
|
1466
1466
|
}
|
|
1467
|
-
}), [["__scopeId", "data-v-7fe37b76"]]),
|
|
1467
|
+
}), [["__scopeId", "data-v-7fe37b76"]]), Wt = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
1468
1468
|
__name: "CcLineChart",
|
|
1469
1469
|
props: {
|
|
1470
1470
|
categories: {},
|
|
@@ -1497,8 +1497,8 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1497
1497
|
}
|
|
1498
1498
|
},
|
|
1499
1499
|
setup(e) {
|
|
1500
|
-
let t = e, n =
|
|
1501
|
-
let e = t.colors ?? (t.dark ?
|
|
1500
|
+
let t = e, n = S(), { setOption: i } = Vt(n), a = r(() => {
|
|
1501
|
+
let e = t.colors ?? (t.dark ? Pt : Nt), n = Bt(t.dark);
|
|
1502
1502
|
return {
|
|
1503
1503
|
color: e,
|
|
1504
1504
|
backgroundColor: "transparent",
|
|
@@ -1510,9 +1510,9 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1510
1510
|
bottom: 6,
|
|
1511
1511
|
containLabel: !0
|
|
1512
1512
|
},
|
|
1513
|
-
legend: t.showLegend ?
|
|
1513
|
+
legend: t.showLegend ? zt(t.dark) : { show: !1 },
|
|
1514
1514
|
tooltip: {
|
|
1515
|
-
...
|
|
1515
|
+
...Rt(t.dark),
|
|
1516
1516
|
trigger: "axis",
|
|
1517
1517
|
axisPointer: {
|
|
1518
1518
|
type: "line",
|
|
@@ -1557,51 +1557,343 @@ var Bt = /*#__PURE__*/ R(/* @__PURE__ */ d({
|
|
|
1557
1557
|
}))
|
|
1558
1558
|
};
|
|
1559
1559
|
});
|
|
1560
|
-
return
|
|
1560
|
+
return P(a, (e) => i(e), { deep: !0 }), _(() => i(a.value)), (t, r) => (y(), o("div", {
|
|
1561
1561
|
class: "cc-chart cc-chart--line",
|
|
1562
|
-
style:
|
|
1562
|
+
style: h({ height: `${e.height}px` })
|
|
1563
1563
|
}, [s("div", {
|
|
1564
1564
|
ref_key: "chartEl",
|
|
1565
1565
|
ref: n,
|
|
1566
1566
|
class: "cc-chart__canvas"
|
|
1567
1567
|
}, null, 512)], 4));
|
|
1568
1568
|
}
|
|
1569
|
-
}), [["__scopeId", "data-v-5300a86d"]]),
|
|
1569
|
+
}), [["__scopeId", "data-v-5300a86d"]]), Gt = [
|
|
1570
1570
|
"stripe",
|
|
1571
1571
|
"linear",
|
|
1572
1572
|
"vercel",
|
|
1573
1573
|
"notion",
|
|
1574
1574
|
"raycast"
|
|
1575
|
-
],
|
|
1575
|
+
], Kt = {
|
|
1576
1576
|
stripe: "Stripe · 经典紫",
|
|
1577
1577
|
linear: "Linear · 深色薰衣草",
|
|
1578
1578
|
vercel: "Vercel · 黑白极简",
|
|
1579
1579
|
notion: "Notion · 纸张笔记",
|
|
1580
1580
|
raycast: "Raycast · 暗夜白键"
|
|
1581
|
-
},
|
|
1582
|
-
function
|
|
1583
|
-
return typeof e == "string" &&
|
|
1581
|
+
}, qt = "data-cc-theme", Jt = Symbol("cc-theme"), Yt = "stripe";
|
|
1582
|
+
function Xt(e) {
|
|
1583
|
+
return typeof e == "string" && Gt.includes(e);
|
|
1584
1584
|
}
|
|
1585
|
-
function
|
|
1585
|
+
function Zt(e) {
|
|
1586
1586
|
if (typeof document > "u") return;
|
|
1587
1587
|
let t = document.documentElement;
|
|
1588
1588
|
if (e === "stripe") {
|
|
1589
|
-
t.removeAttribute(
|
|
1589
|
+
t.removeAttribute(qt);
|
|
1590
1590
|
return;
|
|
1591
1591
|
}
|
|
1592
|
-
t.setAttribute(
|
|
1592
|
+
t.setAttribute(qt, e);
|
|
1593
1593
|
}
|
|
1594
|
-
function
|
|
1595
|
-
if (typeof document > "u") return
|
|
1596
|
-
let e = document.documentElement.getAttribute(
|
|
1597
|
-
return
|
|
1594
|
+
function Qt() {
|
|
1595
|
+
if (typeof document > "u") return Yt;
|
|
1596
|
+
let e = document.documentElement.getAttribute(qt);
|
|
1597
|
+
return Xt(e) ? e : Yt;
|
|
1598
1598
|
}
|
|
1599
|
-
function
|
|
1600
|
-
typeof document > "u" || document.documentElement.removeAttribute(
|
|
1599
|
+
function $t() {
|
|
1600
|
+
typeof document > "u" || document.documentElement.removeAttribute(qt);
|
|
1601
1601
|
}
|
|
1602
1602
|
//#endregion
|
|
1603
|
-
//#region src/components/
|
|
1604
|
-
var
|
|
1603
|
+
//#region src/components/Menus/CcMenuList.vue?vue&type=script&setup=true&lang.ts
|
|
1604
|
+
var en = { class: "cc-menus__list" }, tn = ["onClick"], nn = { class: "cc-menus__name" }, rn = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
1605
|
+
__name: "CcMenuList",
|
|
1606
|
+
props: {
|
|
1607
|
+
nodes: {},
|
|
1608
|
+
expandedIds: {},
|
|
1609
|
+
value: {},
|
|
1610
|
+
showIndentLine: { type: Boolean }
|
|
1611
|
+
},
|
|
1612
|
+
emits: [
|
|
1613
|
+
"toggle",
|
|
1614
|
+
"select",
|
|
1615
|
+
"row-click"
|
|
1616
|
+
],
|
|
1617
|
+
setup(t, { emit: n }) {
|
|
1618
|
+
let r = n;
|
|
1619
|
+
return (n, c) => {
|
|
1620
|
+
let l = T("CcMenuList", !0);
|
|
1621
|
+
return y(), o("ul", en, [(y(!0), o(e, null, C(t.nodes, (e) => (y(), o("li", {
|
|
1622
|
+
key: e.id,
|
|
1623
|
+
class: "cc-menus__item"
|
|
1624
|
+
}, [s("button", {
|
|
1625
|
+
type: "button",
|
|
1626
|
+
class: m(["cc-menus__row", { "cc-menus__row--active": e.id === t.value }]),
|
|
1627
|
+
onClick: (t) => r("row-click", e)
|
|
1628
|
+
}, [w(n.$slots, "default", {
|
|
1629
|
+
node: e,
|
|
1630
|
+
level: e.menuLevel ?? 0
|
|
1631
|
+
}, () => [s("span", nn, O(e.name), 1)], !0), e.children && e.children.length > 0 ? (y(), o("svg", {
|
|
1632
|
+
key: 0,
|
|
1633
|
+
width: "12",
|
|
1634
|
+
height: "12",
|
|
1635
|
+
viewBox: "0 0 24 24",
|
|
1636
|
+
fill: "none",
|
|
1637
|
+
class: m(["cc-menus__chevron", { "cc-menus__chevron--open": t.expandedIds.has(e.id) }]),
|
|
1638
|
+
"aria-hidden": "true"
|
|
1639
|
+
}, [...c[3] ||= [s("path", {
|
|
1640
|
+
d: "m9 6 6 6-6 6",
|
|
1641
|
+
stroke: "currentColor",
|
|
1642
|
+
"stroke-width": "2",
|
|
1643
|
+
"stroke-linecap": "round",
|
|
1644
|
+
"stroke-linejoin": "round"
|
|
1645
|
+
}, null, -1)]], 2)) : a("", !0)], 10, tn), e.children && e.children.length > 0 && t.expandedIds.has(e.id) ? (y(), i(l, {
|
|
1646
|
+
key: 0,
|
|
1647
|
+
class: m(["cc-menus__list--nested", { "cc-menus__list--plain": t.showIndentLine === !1 }]),
|
|
1648
|
+
nodes: e.children,
|
|
1649
|
+
"expanded-ids": t.expandedIds,
|
|
1650
|
+
value: t.value,
|
|
1651
|
+
"show-indent-line": t.showIndentLine,
|
|
1652
|
+
onToggle: c[0] ||= (e) => r("toggle", e),
|
|
1653
|
+
onSelect: c[1] ||= (e) => r("select", e),
|
|
1654
|
+
onRowClick: c[2] ||= (e) => r("row-click", e)
|
|
1655
|
+
}, null, 8, [
|
|
1656
|
+
"class",
|
|
1657
|
+
"nodes",
|
|
1658
|
+
"expanded-ids",
|
|
1659
|
+
"value",
|
|
1660
|
+
"show-indent-line"
|
|
1661
|
+
])) : a("", !0)]))), 128))]);
|
|
1662
|
+
};
|
|
1663
|
+
}
|
|
1664
|
+
}), [["__scopeId", "data-v-9320b1fb"]]), an = { class: "cc-menus__brand" }, on = { class: "cc-menus__nav" }, sn = {
|
|
1665
|
+
key: 1,
|
|
1666
|
+
class: "cc-menus__topnav"
|
|
1667
|
+
}, cn = ["onMouseenter"], ln = ["onClick"], un = {
|
|
1668
|
+
key: 0,
|
|
1669
|
+
class: "cc-menus__dropdown"
|
|
1670
|
+
}, dn = { class: "cc-menus__user" }, fn = ["aria-expanded"], pn = ["src"], mn = {
|
|
1671
|
+
key: 1,
|
|
1672
|
+
class: "cc-menus__avatar"
|
|
1673
|
+
}, hn = { class: "cc-menus__username" }, gn = {
|
|
1674
|
+
key: 0,
|
|
1675
|
+
class: "cc-menus__dropdown cc-menus__dropdown--user",
|
|
1676
|
+
role: "menu"
|
|
1677
|
+
}, _n = { class: "cc-menus__user-info" }, vn = { class: "cc-menus__user-name" }, yn = {
|
|
1678
|
+
key: 0,
|
|
1679
|
+
class: "cc-menus__user-account"
|
|
1680
|
+
}, bn = { class: "cc-menus__theme" }, xn = { class: "cc-menus__layout-options" }, Sn = { class: "cc-menus__theme" }, Cn = /*#__PURE__*/ W(/* @__PURE__ */ d({
|
|
1681
|
+
__name: "CcMenus",
|
|
1682
|
+
props: {
|
|
1683
|
+
menus: {},
|
|
1684
|
+
position: { default: "left" },
|
|
1685
|
+
user: { default: null },
|
|
1686
|
+
themeStorageKey: { default: "cc-menus-theme" },
|
|
1687
|
+
activeMenuId: { default: void 0 },
|
|
1688
|
+
defaultExpanded: {
|
|
1689
|
+
type: Boolean,
|
|
1690
|
+
default: !0
|
|
1691
|
+
}
|
|
1692
|
+
},
|
|
1693
|
+
emits: [
|
|
1694
|
+
"menu-click",
|
|
1695
|
+
"logout",
|
|
1696
|
+
"update:position"
|
|
1697
|
+
],
|
|
1698
|
+
setup(t, { emit: n }) {
|
|
1699
|
+
let c = t, d = n;
|
|
1700
|
+
function f(e) {
|
|
1701
|
+
let t = e.filter((e) => e.id !== void 0).map((e) => ({
|
|
1702
|
+
...e,
|
|
1703
|
+
children: e.children ? [...e.children] : void 0
|
|
1704
|
+
})), n = /* @__PURE__ */ new Map();
|
|
1705
|
+
for (let e of t) n.set(e.id, e);
|
|
1706
|
+
let r = [];
|
|
1707
|
+
for (let e of t) {
|
|
1708
|
+
let t = e.parentMenuId ?? 0, i = n.get(t);
|
|
1709
|
+
i && i.id !== e.id ? (i.children = i.children ?? [], i.children.push(e)) : r.push(e);
|
|
1710
|
+
}
|
|
1711
|
+
let i = (e) => {
|
|
1712
|
+
e.sort((e, t) => (e.orderNumber ?? 0) - (t.orderNumber ?? 0) || e.id - t.id);
|
|
1713
|
+
for (let t of e) t.children && t.children.length && i(t.children);
|
|
1714
|
+
};
|
|
1715
|
+
return i(r), r;
|
|
1716
|
+
}
|
|
1717
|
+
let p = r(() => f(c.menus)), h = S(/* @__PURE__ */ new Set());
|
|
1718
|
+
function g(e) {
|
|
1719
|
+
return !!(e.children && e.children.length > 0);
|
|
1720
|
+
}
|
|
1721
|
+
function b(e) {
|
|
1722
|
+
let t = new Set(h.value);
|
|
1723
|
+
t.has(e) ? t.delete(e) : t.add(e), h.value = t;
|
|
1724
|
+
}
|
|
1725
|
+
function x(e) {
|
|
1726
|
+
g(e) || d("menu-click", e);
|
|
1727
|
+
}
|
|
1728
|
+
function T(e) {
|
|
1729
|
+
g(e) ? b(e.id) : d("menu-click", e);
|
|
1730
|
+
}
|
|
1731
|
+
let E = S(Qt()), D = Gt.map((e) => ({
|
|
1732
|
+
label: Kt[e],
|
|
1733
|
+
value: e
|
|
1734
|
+
}));
|
|
1735
|
+
P(E, (e) => {
|
|
1736
|
+
Zt(e), localStorage.setItem(c.themeStorageKey, e);
|
|
1737
|
+
});
|
|
1738
|
+
let k = S(!1), A = S(null), j = null;
|
|
1739
|
+
function M(e) {
|
|
1740
|
+
j &&= (clearTimeout(j), null), A.value = e;
|
|
1741
|
+
}
|
|
1742
|
+
function te() {
|
|
1743
|
+
j && clearTimeout(j), j = setTimeout(() => {
|
|
1744
|
+
A.value = null;
|
|
1745
|
+
}, 120);
|
|
1746
|
+
}
|
|
1747
|
+
let N = S(null);
|
|
1748
|
+
function I(e) {
|
|
1749
|
+
if (!N.value) return;
|
|
1750
|
+
let t = e.target;
|
|
1751
|
+
N.value.contains(t) || (j &&= (clearTimeout(j), null), k.value = !1, A.value = null);
|
|
1752
|
+
}
|
|
1753
|
+
let L = r(() => c.user?.role ?? c.user?.displayName ?? c.user?.username ?? "未命名用户"), R = r(() => L.value.charAt(0).toUpperCase());
|
|
1754
|
+
function z() {
|
|
1755
|
+
k.value = !1, d("logout");
|
|
1756
|
+
}
|
|
1757
|
+
return _(() => {
|
|
1758
|
+
document.addEventListener("click", I);
|
|
1759
|
+
let e = localStorage.getItem(c.themeStorageKey);
|
|
1760
|
+
if (e && Gt.includes(e) && (E.value = e), c.defaultExpanded) {
|
|
1761
|
+
let e = (t) => {
|
|
1762
|
+
let n = /* @__PURE__ */ new Set();
|
|
1763
|
+
for (let r of t) if (g(r)) {
|
|
1764
|
+
n.add(r.id);
|
|
1765
|
+
for (let t of e(r.children ?? [])) n.add(t);
|
|
1766
|
+
}
|
|
1767
|
+
return n;
|
|
1768
|
+
};
|
|
1769
|
+
h.value = e(p.value);
|
|
1770
|
+
}
|
|
1771
|
+
}), v(() => {
|
|
1772
|
+
j && clearTimeout(j), document.removeEventListener("click", I);
|
|
1773
|
+
}), (n, r) => (y(), o("div", {
|
|
1774
|
+
ref_key: "rootEl",
|
|
1775
|
+
ref: N,
|
|
1776
|
+
class: m(["cc-menus", `cc-menus--${t.position}`])
|
|
1777
|
+
}, [
|
|
1778
|
+
s("div", an, [w(n.$slots, "logo", {}, () => [r[4] ||= s("span", { class: "cc-menus__brand-default" }, "Company", -1)], !0)]),
|
|
1779
|
+
s("nav", on, [t.position === "left" ? (y(), i(rn, {
|
|
1780
|
+
key: 0,
|
|
1781
|
+
nodes: p.value,
|
|
1782
|
+
"expanded-ids": h.value,
|
|
1783
|
+
value: t.activeMenuId,
|
|
1784
|
+
"show-indent-line": !1,
|
|
1785
|
+
onToggle: b,
|
|
1786
|
+
onSelect: x,
|
|
1787
|
+
onRowClick: T
|
|
1788
|
+
}, {
|
|
1789
|
+
default: F(({ node: e, level: t }) => [w(n.$slots, "menu-item", {
|
|
1790
|
+
menu: e,
|
|
1791
|
+
level: t
|
|
1792
|
+
}, () => [l(O(e.name), 1)], !0)]),
|
|
1793
|
+
_: 3
|
|
1794
|
+
}, 8, [
|
|
1795
|
+
"nodes",
|
|
1796
|
+
"expanded-ids",
|
|
1797
|
+
"value"
|
|
1798
|
+
])) : (y(), o("ul", sn, [(y(!0), o(e, null, C(p.value, (e) => (y(), o("li", {
|
|
1799
|
+
key: e.id,
|
|
1800
|
+
class: "cc-menus__topnav-item",
|
|
1801
|
+
onMouseenter: (t) => M(e.id),
|
|
1802
|
+
onMouseleave: te
|
|
1803
|
+
}, [s("button", {
|
|
1804
|
+
type: "button",
|
|
1805
|
+
class: "cc-menus__topnav-btn",
|
|
1806
|
+
onClick: (t) => T(e)
|
|
1807
|
+
}, [w(n.$slots, "menu-item", {
|
|
1808
|
+
menu: e,
|
|
1809
|
+
level: 0
|
|
1810
|
+
}, () => [l(O(e.name), 1)], !0), g(e) ? (y(), o("svg", {
|
|
1811
|
+
key: 0,
|
|
1812
|
+
class: m(["cc-menus__caret", { "cc-menus__caret--open": A.value === e.id }]),
|
|
1813
|
+
width: "12",
|
|
1814
|
+
height: "12",
|
|
1815
|
+
viewBox: "0 0 24 24",
|
|
1816
|
+
fill: "none",
|
|
1817
|
+
"aria-hidden": "true"
|
|
1818
|
+
}, [...r[5] ||= [s("path", {
|
|
1819
|
+
d: "m6 9 6 6 6-6",
|
|
1820
|
+
stroke: "currentColor",
|
|
1821
|
+
"stroke-width": "2",
|
|
1822
|
+
"stroke-linecap": "round",
|
|
1823
|
+
"stroke-linejoin": "round"
|
|
1824
|
+
}, null, -1)]], 2)) : a("", !0)], 8, ln), g(e) && A.value === e.id ? (y(), o("div", un, [u(rn, {
|
|
1825
|
+
nodes: e.children ?? [],
|
|
1826
|
+
"expanded-ids": h.value,
|
|
1827
|
+
value: t.activeMenuId,
|
|
1828
|
+
"show-indent-line": !1,
|
|
1829
|
+
onToggle: b,
|
|
1830
|
+
onSelect: x,
|
|
1831
|
+
onRowClick: T
|
|
1832
|
+
}, {
|
|
1833
|
+
default: F(({ node: e, level: t }) => [w(n.$slots, "menu-item", {
|
|
1834
|
+
menu: e,
|
|
1835
|
+
level: t
|
|
1836
|
+
}, () => [l(O(e.name), 1)], !0)]),
|
|
1837
|
+
_: 3
|
|
1838
|
+
}, 8, [
|
|
1839
|
+
"nodes",
|
|
1840
|
+
"expanded-ids",
|
|
1841
|
+
"value"
|
|
1842
|
+
])])) : a("", !0)], 40, cn))), 128))]))]),
|
|
1843
|
+
r[9] ||= s("div", { class: "cc-menus__spacer" }, null, -1),
|
|
1844
|
+
s("div", dn, [s("button", {
|
|
1845
|
+
type: "button",
|
|
1846
|
+
class: "cc-menus__user-btn",
|
|
1847
|
+
"aria-expanded": k.value,
|
|
1848
|
+
"aria-haspopup": "menu",
|
|
1849
|
+
onClick: r[0] ||= (e) => k.value = !k.value
|
|
1850
|
+
}, [
|
|
1851
|
+
c.user?.avatarUrl ? (y(), o("img", {
|
|
1852
|
+
key: 0,
|
|
1853
|
+
class: "cc-menus__avatar cc-menus__avatar--img",
|
|
1854
|
+
src: c.user.avatarUrl,
|
|
1855
|
+
alt: ""
|
|
1856
|
+
}, null, 8, pn)) : (y(), o("span", mn, O(R.value), 1)),
|
|
1857
|
+
s("span", hn, O(L.value), 1),
|
|
1858
|
+
(y(), o("svg", {
|
|
1859
|
+
class: m(["cc-menus__caret", { "cc-menus__caret--open": k.value }]),
|
|
1860
|
+
width: "12",
|
|
1861
|
+
height: "12",
|
|
1862
|
+
viewBox: "0 0 24 24",
|
|
1863
|
+
fill: "none",
|
|
1864
|
+
"aria-hidden": "true"
|
|
1865
|
+
}, [...r[6] ||= [s("path", {
|
|
1866
|
+
d: "m6 9 6 6 6-6",
|
|
1867
|
+
stroke: "currentColor",
|
|
1868
|
+
"stroke-width": "2",
|
|
1869
|
+
"stroke-linecap": "round",
|
|
1870
|
+
"stroke-linejoin": "round"
|
|
1871
|
+
}, null, -1)]], 2))
|
|
1872
|
+
], 8, fn), k.value ? (y(), o("div", gn, [
|
|
1873
|
+
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)])]),
|
|
1874
|
+
s("div", bn, [r[7] ||= s("p", { class: "cc-menus__theme-label" }, "菜单栏位置", -1), s("div", xn, [s("button", {
|
|
1875
|
+
type: "button",
|
|
1876
|
+
class: m(["cc-menus__layout-option", { "is-active": t.position === "left" }]),
|
|
1877
|
+
onClick: r[1] ||= (e) => d("update:position", "left")
|
|
1878
|
+
}, "左侧", 2), s("button", {
|
|
1879
|
+
type: "button",
|
|
1880
|
+
class: m(["cc-menus__layout-option", { "is-active": t.position === "top" }]),
|
|
1881
|
+
onClick: r[2] ||= (e) => d("update:position", "top")
|
|
1882
|
+
}, "顶部", 2)])]),
|
|
1883
|
+
s("div", Sn, [r[8] ||= s("p", { class: "cc-menus__theme-label" }, "主题风格", -1), u(ye, {
|
|
1884
|
+
modelValue: E.value,
|
|
1885
|
+
"onUpdate:modelValue": r[3] ||= (e) => E.value = e,
|
|
1886
|
+
options: ee(D)
|
|
1887
|
+
}, null, 8, ["modelValue", "options"])]),
|
|
1888
|
+
s("button", {
|
|
1889
|
+
type: "button",
|
|
1890
|
+
class: "cc-menus__logout",
|
|
1891
|
+
onClick: z
|
|
1892
|
+
}, "退出登录")
|
|
1893
|
+
])) : a("", !0)])
|
|
1894
|
+
], 2));
|
|
1895
|
+
}
|
|
1896
|
+
}), [["__scopeId", "data-v-67df3fd6"]]), wn = /* @__PURE__ */ d({
|
|
1605
1897
|
__name: "CcThemeProvider",
|
|
1606
1898
|
props: {
|
|
1607
1899
|
theme: { default: "stripe" },
|
|
@@ -1612,78 +1904,80 @@ var Zt = /* @__PURE__ */ d({
|
|
|
1612
1904
|
},
|
|
1613
1905
|
emits: ["change"],
|
|
1614
1906
|
setup(e, { emit: t }) {
|
|
1615
|
-
let n = e, r = t, i =
|
|
1616
|
-
|
|
1907
|
+
let n = e, r = t, i = S(n.theme);
|
|
1908
|
+
b(Jt, i);
|
|
1617
1909
|
function a() {
|
|
1618
1910
|
if (!n.persist) return n.theme;
|
|
1619
1911
|
try {
|
|
1620
1912
|
let e = localStorage.getItem("cc-library-theme");
|
|
1621
|
-
if (
|
|
1913
|
+
if (Xt(e)) return e;
|
|
1622
1914
|
} catch {}
|
|
1623
1915
|
return n.theme;
|
|
1624
1916
|
}
|
|
1625
1917
|
function o(e) {
|
|
1626
|
-
if (i.value = e,
|
|
1918
|
+
if (i.value = e, Zt(e), n.persist) try {
|
|
1627
1919
|
localStorage.setItem("cc-library-theme", e);
|
|
1628
1920
|
} catch {}
|
|
1629
1921
|
r("change", e);
|
|
1630
1922
|
}
|
|
1631
|
-
return
|
|
1923
|
+
return _(() => {
|
|
1632
1924
|
o(a());
|
|
1633
|
-
}),
|
|
1634
|
-
|
|
1635
|
-
}), (e, t) =>
|
|
1925
|
+
}), P(() => n.theme, (e) => {
|
|
1926
|
+
Xt(e) && o(e);
|
|
1927
|
+
}), (e, t) => w(e.$slots, "default");
|
|
1636
1928
|
}
|
|
1637
1929
|
});
|
|
1638
1930
|
//#endregion
|
|
1639
1931
|
//#region src/index.ts
|
|
1640
|
-
function
|
|
1932
|
+
function Tn(e) {
|
|
1641
1933
|
let t = [
|
|
1642
|
-
["CcButton",
|
|
1643
|
-
["CcInput",
|
|
1644
|
-
["CcTextarea",
|
|
1934
|
+
["CcButton", q],
|
|
1935
|
+
["CcInput", Q],
|
|
1936
|
+
["CcTextarea", de],
|
|
1645
1937
|
["CcSelect", ye],
|
|
1646
1938
|
["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
|
-
["
|
|
1939
|
+
["CcCheckbox", Te],
|
|
1940
|
+
["CcRadio", Oe],
|
|
1941
|
+
["CcCard", Pe],
|
|
1942
|
+
["CcTag", Ie],
|
|
1943
|
+
["CcBadge", Re],
|
|
1944
|
+
["CcAlert", He],
|
|
1945
|
+
["CcModal", Je],
|
|
1946
|
+
["CcTooltip", Ye],
|
|
1947
|
+
["CcSpinner", G],
|
|
1948
|
+
["CcDivider", Ze],
|
|
1949
|
+
["CcTable", Mt],
|
|
1950
|
+
["CcBarChart", Ht],
|
|
1951
|
+
["CcPieChart", Ut],
|
|
1952
|
+
["CcLineChart", Wt],
|
|
1953
|
+
["CcMenus", Cn],
|
|
1954
|
+
["CcThemeProvider", wn]
|
|
1662
1955
|
];
|
|
1663
1956
|
for (let [n, r] of t) e.component(n, r);
|
|
1664
1957
|
}
|
|
1665
|
-
var
|
|
1666
|
-
install:
|
|
1667
|
-
CcButton:
|
|
1668
|
-
CcInput:
|
|
1669
|
-
CcTextarea:
|
|
1958
|
+
var En = {
|
|
1959
|
+
install: Tn,
|
|
1960
|
+
CcButton: q,
|
|
1961
|
+
CcInput: Q,
|
|
1962
|
+
CcTextarea: de,
|
|
1670
1963
|
CcSelect: ye,
|
|
1671
1964
|
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
|
-
|
|
1965
|
+
CcCheckbox: Te,
|
|
1966
|
+
CcRadio: Oe,
|
|
1967
|
+
CcCard: Pe,
|
|
1968
|
+
CcTag: Ie,
|
|
1969
|
+
CcBadge: Re,
|
|
1970
|
+
CcAlert: He,
|
|
1971
|
+
CcModal: Je,
|
|
1972
|
+
CcTooltip: Ye,
|
|
1973
|
+
CcSpinner: G,
|
|
1974
|
+
CcDivider: Ze,
|
|
1975
|
+
CcTable: Mt,
|
|
1976
|
+
CcBarChart: Ht,
|
|
1977
|
+
CcPieChart: Ut,
|
|
1978
|
+
CcLineChart: Wt,
|
|
1979
|
+
CcMenus: Cn,
|
|
1980
|
+
CcThemeProvider: wn
|
|
1687
1981
|
};
|
|
1688
1982
|
//#endregion
|
|
1689
|
-
export {
|
|
1983
|
+
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 };
|