@vaebe/ccui 2.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +31 -0
- package/affix/ccui-cli.css +2 -0
- package/affix/index.es.js +132 -0
- package/affix/index.umd.js +1 -0
- package/alert/ccui-cli.css +2 -0
- package/alert/index.es.js +127 -0
- package/alert/index.umd.js +1 -0
- package/anchor/ccui-cli.css +2 -0
- package/anchor/index.es.js +160 -0
- package/anchor/index.umd.js +1 -0
- package/avatar/ccui-cli.css +2 -0
- package/avatar/index.es.js +235 -0
- package/avatar/index.umd.js +1 -0
- package/badge/ccui-cli.css +2 -0
- package/badge/index.es.js +146 -0
- package/badge/index.umd.js +1 -0
- package/breadcrumb/ccui-cli.css +2 -0
- package/breadcrumb/index.es.js +89 -0
- package/breadcrumb/index.umd.js +1 -0
- package/button/ccui-cli.css +2 -0
- package/button/index.es.js +1236 -0
- package/button/index.umd.js +1 -0
- package/button-3d/ccui-cli.css +2 -0
- package/button-3d/index.es.js +80 -0
- package/button-3d/index.umd.js +1 -0
- package/calendar/ccui-cli.css +2 -0
- package/calendar/index.es.js +450 -0
- package/calendar/index.umd.js +1 -0
- package/card/ccui-cli.css +2 -0
- package/card/index.es.js +78 -0
- package/card/index.umd.js +1 -0
- package/ccui-cli.css +2 -0
- package/check-box/ccui-cli.css +2 -0
- package/check-box/index.es.js +173 -0
- package/check-box/index.umd.js +1 -0
- package/collapse/ccui-cli.css +2 -0
- package/collapse/index.es.js +176 -0
- package/collapse/index.umd.js +1 -0
- package/config-provider/index.es.js +204 -0
- package/config-provider/index.umd.js +1 -0
- package/date-picker/ccui-cli.css +2 -0
- package/date-picker/index.es.js +2447 -0
- package/date-picker/index.umd.js +1 -0
- package/descriptions/ccui-cli.css +2 -0
- package/descriptions/index.es.js +175 -0
- package/descriptions/index.umd.js +1 -0
- package/divider/ccui-cli.css +2 -0
- package/divider/index.es.js +78 -0
- package/divider/index.umd.js +1 -0
- package/drawer/ccui-cli.css +2 -0
- package/drawer/index.es.js +1320 -0
- package/drawer/index.umd.js +1 -0
- package/dropdown/ccui-cli.css +2 -0
- package/dropdown/index.es.js +606 -0
- package/dropdown/index.umd.js +1 -0
- package/empty/ccui-cli.css +2 -0
- package/empty/index.es.js +173 -0
- package/empty/index.umd.js +1 -0
- package/flex/ccui-cli.css +2 -0
- package/flex/index.es.js +87 -0
- package/flex/index.umd.js +1 -0
- package/float-button/ccui-cli.css +2 -0
- package/float-button/index.es.js +169 -0
- package/float-button/index.umd.js +1 -0
- package/form/ccui-cli.css +2 -0
- package/form/index.es.js +752 -0
- package/form/index.umd.js +1 -0
- package/grid/ccui-cli.css +2 -0
- package/grid/index.es.js +207 -0
- package/grid/index.umd.js +1 -0
- package/icon/ccui-cli.css +2 -0
- package/icon/index.es.js +1228 -0
- package/icon/index.umd.js +1 -0
- package/image/ccui-cli.css +2 -0
- package/image/index.es.js +276 -0
- package/image/index.umd.js +1 -0
- package/index.d.ts +7 -0
- package/input/ccui-cli.css +2 -0
- package/input/index.es.js +1293 -0
- package/input/index.umd.js +1 -0
- package/input-number/ccui-cli.css +2 -0
- package/input-number/index.es.js +263 -0
- package/input-number/index.umd.js +1 -0
- package/layout/ccui-cli.css +2 -0
- package/layout/index.es.js +184 -0
- package/layout/index.umd.js +1 -0
- package/masonry/ccui-cli.css +2 -0
- package/masonry/index.es.js +119 -0
- package/masonry/index.umd.js +1 -0
- package/menu/ccui-cli.css +2 -0
- package/menu/index.es.js +385 -0
- package/menu/index.umd.js +1 -0
- package/message/ccui-cli.css +2 -0
- package/message/index.es.js +351 -0
- package/message/index.umd.js +1 -0
- package/modal/ccui-cli.css +2 -0
- package/modal/index.es.js +1553 -0
- package/modal/index.umd.js +1 -0
- package/notification/ccui-cli.css +2 -0
- package/notification/index.es.js +347 -0
- package/notification/index.umd.js +1 -0
- package/nuxt/components/category.js +2 -0
- package/nuxt/components/install.js +2 -0
- package/nuxt/components/status.js +2 -0
- package/nuxt/components/title.js +2 -0
- package/nuxt/index.js +13 -0
- package/package.json +53 -0
- package/pagination/ccui-cli.css +2 -0
- package/pagination/index.es.js +296 -0
- package/pagination/index.umd.js +1 -0
- package/popconfirm/ccui-cli.css +2 -0
- package/popconfirm/index.es.js +735 -0
- package/popconfirm/index.umd.js +1 -0
- package/popover/ccui-cli.css +2 -0
- package/popover/index.es.js +530 -0
- package/popover/index.umd.js +1 -0
- package/progress/ccui-cli.css +2 -0
- package/progress/index.es.js +167 -0
- package/progress/index.umd.js +1 -0
- package/radio/ccui-cli.css +2 -0
- package/radio/index.es.js +157 -0
- package/radio/index.umd.js +1 -0
- package/rate/ccui-cli.css +2 -0
- package/rate/index.es.js +115 -0
- package/rate/index.umd.js +1 -0
- package/result/ccui-cli.css +2 -0
- package/result/index.es.js +90 -0
- package/result/index.umd.js +1 -0
- package/segmented/ccui-cli.css +2 -0
- package/segmented/index.es.js +99 -0
- package/segmented/index.umd.js +1 -0
- package/select/ccui-cli.css +2 -0
- package/select/index.es.js +1885 -0
- package/select/index.umd.js +1 -0
- package/skeleton/ccui-cli.css +2 -0
- package/skeleton/index.es.js +117 -0
- package/skeleton/index.umd.js +1 -0
- package/slider/ccui-cli.css +2 -0
- package/slider/index.es.js +1071 -0
- package/slider/index.umd.js +1 -0
- package/space/ccui-cli.css +2 -0
- package/space/index.es.js +108 -0
- package/space/index.umd.js +1 -0
- package/spin/ccui-cli.css +2 -0
- package/spin/index.es.js +86 -0
- package/spin/index.umd.js +1 -0
- package/splitter/ccui-cli.css +2 -0
- package/splitter/index.es.js +198 -0
- package/splitter/index.umd.js +1 -0
- package/status/ccui-cli.css +2 -0
- package/status/index.es.js +44 -0
- package/status/index.umd.js +1 -0
- package/steps/ccui-cli.css +2 -0
- package/steps/index.es.js +118 -0
- package/steps/index.umd.js +1 -0
- package/switch/ccui-cli.css +2 -0
- package/switch/index.es.js +118 -0
- package/switch/index.umd.js +1 -0
- package/table/ccui-cli.css +2 -0
- package/table/index.es.js +553 -0
- package/table/index.umd.js +1 -0
- package/tabs/ccui-cli.css +2 -0
- package/tabs/index.es.js +128 -0
- package/tabs/index.umd.js +1 -0
- package/tag/ccui-cli.css +2 -0
- package/tag/index.es.js +116 -0
- package/tag/index.umd.js +1 -0
- package/theme/darkTheme.css +352 -0
- package/theme/theme.scss +703 -0
- package/timeline/ccui-cli.css +2 -0
- package/timeline/index.es.js +113 -0
- package/timeline/index.umd.js +1 -0
- package/tooltip/ccui-cli.css +2 -0
- package/tooltip/index.es.js +423 -0
- package/tooltip/index.umd.js +1 -0
- package/tree/ccui-cli.css +2 -0
- package/tree/index.es.js +810 -0
- package/tree/index.umd.js +1 -0
- package/typography/ccui-cli.css +2 -0
- package/typography/index.es.js +270 -0
- package/typography/index.umd.js +1 -0
- package/util/index.es.js +78 -0
- package/util/index.umd.js +1 -0
- package/vue-ccui.es.js +18989 -0
- package/vue-ccui.umd.js +1 -0
- package/watermark/ccui-cli.css +2 -0
- package/watermark/index.es.js +179 -0
- package/watermark/index.umd.js +1 -0
|
@@ -0,0 +1,1071 @@
|
|
|
1
|
+
import * as e from "vue";
|
|
2
|
+
import { computed as t, createVNode as n, defineComponent as r, getCurrentInstance as i, inject as a, mergeProps as o, nextTick as s, onBeforeUnmount as c, onMounted as l, onUnmounted as u, ref as d, watch as f } from "vue";
|
|
3
|
+
import { arrow as p, autoUpdate as m, computePosition as h, flip as g, offset as _, shift as v } from "@floating-ui/dom";
|
|
4
|
+
//#region \0rolldown/runtime.js
|
|
5
|
+
var y = Object.defineProperty, b = Object.getOwnPropertyDescriptor, x = Object.getOwnPropertyNames, S = Object.prototype.hasOwnProperty, C = (e, t) => {
|
|
6
|
+
let n = {};
|
|
7
|
+
for (var r in e) y(n, r, {
|
|
8
|
+
get: e[r],
|
|
9
|
+
enumerable: !0
|
|
10
|
+
});
|
|
11
|
+
return t || y(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
12
|
+
}, w = (e, t, n, r) => {
|
|
13
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = x(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !S.call(e, s) && s !== n && y(e, s, {
|
|
14
|
+
get: ((e) => t[e]).bind(null, s),
|
|
15
|
+
enumerable: !(r = b(t, s)) || r.enumerable
|
|
16
|
+
});
|
|
17
|
+
return e;
|
|
18
|
+
}, T = (e, t, n) => (w(e, t, "default"), n && w(n, t, "default")), E = Symbol("ccuiFormItem");
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region ../ccui/ui/shared/hooks/use-namespace.ts
|
|
21
|
+
function D(e, t, n) {
|
|
22
|
+
let r = e;
|
|
23
|
+
return t && (r += `__${t}`), n && (r += `--${n}`), r;
|
|
24
|
+
}
|
|
25
|
+
function O(e, t = !1) {
|
|
26
|
+
let n = t ? `.ccui-${e}` : `ccui-${e}`;
|
|
27
|
+
return {
|
|
28
|
+
b: () => D(n),
|
|
29
|
+
e: (e) => e ? D(n, e) : "",
|
|
30
|
+
m: (e) => e ? D(n, "", e) : "",
|
|
31
|
+
em: (e, t) => e && t ? D(n, e, t) : "",
|
|
32
|
+
is: (e) => `is-${e}`
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region ../ccui/ui/input-number/src/input-number.tsx
|
|
37
|
+
var k = /* @__PURE__ */ r({
|
|
38
|
+
name: "CInputNumber",
|
|
39
|
+
props: {
|
|
40
|
+
modelValue: {
|
|
41
|
+
type: Number,
|
|
42
|
+
default: void 0
|
|
43
|
+
},
|
|
44
|
+
step: {
|
|
45
|
+
type: Number,
|
|
46
|
+
default: 1
|
|
47
|
+
},
|
|
48
|
+
placeholder: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: ""
|
|
51
|
+
},
|
|
52
|
+
max: {
|
|
53
|
+
type: Number,
|
|
54
|
+
default: Infinity
|
|
55
|
+
},
|
|
56
|
+
min: {
|
|
57
|
+
type: Number,
|
|
58
|
+
default: -Infinity
|
|
59
|
+
},
|
|
60
|
+
disabled: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !1
|
|
63
|
+
},
|
|
64
|
+
readonly: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: !1
|
|
67
|
+
},
|
|
68
|
+
precision: {
|
|
69
|
+
type: Number,
|
|
70
|
+
default: void 0
|
|
71
|
+
},
|
|
72
|
+
size: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: "default"
|
|
75
|
+
},
|
|
76
|
+
reg: {
|
|
77
|
+
type: [RegExp, String],
|
|
78
|
+
default: void 0
|
|
79
|
+
},
|
|
80
|
+
allowEmpty: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: !1
|
|
83
|
+
},
|
|
84
|
+
showGlowStyle: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: !0
|
|
87
|
+
},
|
|
88
|
+
controls: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: !0
|
|
91
|
+
},
|
|
92
|
+
controlsPosition: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: "both"
|
|
95
|
+
},
|
|
96
|
+
variant: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: "outlined"
|
|
99
|
+
},
|
|
100
|
+
status: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: ""
|
|
103
|
+
},
|
|
104
|
+
classNames: {
|
|
105
|
+
type: Object,
|
|
106
|
+
default: void 0
|
|
107
|
+
},
|
|
108
|
+
styles: {
|
|
109
|
+
type: Object,
|
|
110
|
+
default: void 0
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
emits: [
|
|
114
|
+
"update:modelValue",
|
|
115
|
+
"change",
|
|
116
|
+
"blur",
|
|
117
|
+
"focus",
|
|
118
|
+
"input"
|
|
119
|
+
],
|
|
120
|
+
setup(e, { emit: r, expose: i }) {
|
|
121
|
+
let o = O("input-number"), c = d(), l = a(E, null), u = t(() => l?.validateStatus.value ?? ""), p = t(() => e.status || u.value), m = d(e.modelValue), h = d(!1), g = {
|
|
122
|
+
lg: "large",
|
|
123
|
+
md: "default",
|
|
124
|
+
sm: "small"
|
|
125
|
+
}, _ = d(!1), v = t(() => {
|
|
126
|
+
let t = e.size;
|
|
127
|
+
return t === "lg" || t === "md" || t === "sm" ? (!_.value && typeof console < "u" && (console.warn(`[ccui][InputNumber] size="${t}" 已 deprecated,请改用 "${g[t]}"('large' | 'default' | 'small')。`), _.value = !0), g[t]) : t;
|
|
128
|
+
}), y = t(() => m.value === void 0 || m.value === null ? e.allowEmpty ? "" : "0" : e.precision === void 0 ? String(m.value) : Number(m.value).toFixed(e.precision)), b = t(() => m.value === void 0 ? !1 : m.value >= e.max), x = t(() => m.value === void 0 ? !1 : m.value <= e.min), S = (t) => {
|
|
129
|
+
if (t === "" || t == null) return e.allowEmpty ? void 0 : 0;
|
|
130
|
+
let n = typeof t == "string" ? Number.parseFloat(t) : t;
|
|
131
|
+
return Number.isNaN(n) ? e.allowEmpty ? void 0 : 0 : (e.precision !== void 0 && (n = Number.parseFloat(n.toFixed(e.precision))), n = Math.max(e.min, Math.min(e.max, n)), n);
|
|
132
|
+
}, C = (e, t = !0) => {
|
|
133
|
+
let n = m.value;
|
|
134
|
+
m.value = e, r("update:modelValue", e), r("input", e), t && n !== e && r("change", e, n), l?.validate("change");
|
|
135
|
+
}, w = (t) => {
|
|
136
|
+
let n = t.target, r = n.value;
|
|
137
|
+
if (e.reg && !(typeof e.reg == "string" ? new RegExp(e.reg) : e.reg).test(r)) {
|
|
138
|
+
n.value = y.value;
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (r === "") {
|
|
142
|
+
e.allowEmpty ? C(void 0, !1) : n.value = y.value;
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
C(S(r), !1);
|
|
146
|
+
}, T = (e) => {
|
|
147
|
+
let t = e.target;
|
|
148
|
+
C(S(t.value)), s(() => {
|
|
149
|
+
c.value && (c.value.value = y.value);
|
|
150
|
+
});
|
|
151
|
+
}, D = (e) => {
|
|
152
|
+
h.value = !0, r("focus", e);
|
|
153
|
+
}, k = (e) => {
|
|
154
|
+
h.value = !1, r("blur", e), c.value && (c.value.value = y.value), l?.validate("blur");
|
|
155
|
+
}, A = () => {
|
|
156
|
+
e.disabled || b.value || C(S((m.value ?? 0) + e.step));
|
|
157
|
+
}, j = () => {
|
|
158
|
+
e.disabled || x.value || C(S((m.value ?? 0) - e.step));
|
|
159
|
+
}, M = (t) => {
|
|
160
|
+
if (!(e.disabled || e.readonly)) switch (t.key) {
|
|
161
|
+
case "ArrowUp":
|
|
162
|
+
t.preventDefault(), A();
|
|
163
|
+
break;
|
|
164
|
+
case "ArrowDown":
|
|
165
|
+
t.preventDefault(), j();
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
return i({
|
|
170
|
+
getValue: () => m.value,
|
|
171
|
+
setValue: (e) => C(e),
|
|
172
|
+
focus: () => {
|
|
173
|
+
c.value?.focus();
|
|
174
|
+
},
|
|
175
|
+
blur: () => {
|
|
176
|
+
c.value?.blur();
|
|
177
|
+
},
|
|
178
|
+
increase: A,
|
|
179
|
+
decrease: j
|
|
180
|
+
}), f(() => e.modelValue, (e) => {
|
|
181
|
+
e !== m.value && (m.value = e);
|
|
182
|
+
}, { immediate: !0 }), () => {
|
|
183
|
+
let t = e.controlsPosition === "right";
|
|
184
|
+
return n("div", {
|
|
185
|
+
class: [
|
|
186
|
+
o.b(),
|
|
187
|
+
{
|
|
188
|
+
[o.m("disabled")]: e.disabled,
|
|
189
|
+
[o.m("readonly")]: e.readonly,
|
|
190
|
+
[o.m("without-controls")]: !e.controls,
|
|
191
|
+
[o.m("controls-right")]: t,
|
|
192
|
+
[o.m(v.value)]: v.value !== "default",
|
|
193
|
+
[o.m("focused")]: h.value,
|
|
194
|
+
[o.m("glow")]: e.showGlowStyle && h.value,
|
|
195
|
+
[o.m(`variant-${e.variant}`)]: !!e.variant,
|
|
196
|
+
[o.m(`status-${p.value}`)]: !!p.value
|
|
197
|
+
},
|
|
198
|
+
e.classNames?.root
|
|
199
|
+
],
|
|
200
|
+
style: e.styles?.root
|
|
201
|
+
}, [
|
|
202
|
+
e.controls && !t && n("span", {
|
|
203
|
+
class: [o.e("decrease"), { [o.is("disabled")]: x.value || e.disabled }],
|
|
204
|
+
role: "button",
|
|
205
|
+
onClick: j
|
|
206
|
+
}, [n("svg", {
|
|
207
|
+
viewBox: "0 0 1024 1024",
|
|
208
|
+
width: "1em",
|
|
209
|
+
height: "1em"
|
|
210
|
+
}, [n("path", { d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z" }, null)])]),
|
|
211
|
+
n("div", {
|
|
212
|
+
class: [o.e("input"), e.classNames?.input],
|
|
213
|
+
style: e.styles?.input
|
|
214
|
+
}, [n("input", {
|
|
215
|
+
ref: c,
|
|
216
|
+
type: "number",
|
|
217
|
+
step: e.step,
|
|
218
|
+
class: o.e("inner"),
|
|
219
|
+
value: y.value,
|
|
220
|
+
placeholder: e.placeholder,
|
|
221
|
+
disabled: e.disabled,
|
|
222
|
+
readonly: e.readonly,
|
|
223
|
+
min: e.min,
|
|
224
|
+
max: e.max,
|
|
225
|
+
onInput: w,
|
|
226
|
+
onChange: T,
|
|
227
|
+
onFocus: D,
|
|
228
|
+
onBlur: k,
|
|
229
|
+
onKeydown: M
|
|
230
|
+
}, null)]),
|
|
231
|
+
e.controls && !t && n("span", {
|
|
232
|
+
class: [o.e("increase"), { [o.is("disabled")]: b.value || e.disabled }],
|
|
233
|
+
role: "button",
|
|
234
|
+
onClick: A
|
|
235
|
+
}, [n("svg", {
|
|
236
|
+
viewBox: "0 0 1024 1024",
|
|
237
|
+
width: "1em",
|
|
238
|
+
height: "1em"
|
|
239
|
+
}, [n("path", { d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64h352z" }, null)])]),
|
|
240
|
+
e.controls && t && n("div", {
|
|
241
|
+
class: [o.e("controls"), e.classNames?.controls],
|
|
242
|
+
style: e.styles?.controls
|
|
243
|
+
}, [n("span", {
|
|
244
|
+
class: [o.e("increase"), { [o.is("disabled")]: b.value || e.disabled }],
|
|
245
|
+
role: "button",
|
|
246
|
+
onClick: A
|
|
247
|
+
}, [n("svg", {
|
|
248
|
+
viewBox: "0 0 1024 1024",
|
|
249
|
+
width: "1em",
|
|
250
|
+
height: "1em"
|
|
251
|
+
}, [n("path", { d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64h352z" }, null)])]), n("span", {
|
|
252
|
+
class: [o.e("decrease"), { [o.is("disabled")]: x.value || e.disabled }],
|
|
253
|
+
role: "button",
|
|
254
|
+
onClick: j
|
|
255
|
+
}, [n("svg", {
|
|
256
|
+
viewBox: "0 0 1024 1024",
|
|
257
|
+
width: "1em",
|
|
258
|
+
height: "1em"
|
|
259
|
+
}, [n("path", { d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z" }, null)])])])
|
|
260
|
+
]);
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region ../ccui/ui/input-number/index.ts
|
|
266
|
+
k.install = function(e) {
|
|
267
|
+
e.component(k.name, k);
|
|
268
|
+
};
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
271
|
+
function A() {
|
|
272
|
+
return typeof window < "u";
|
|
273
|
+
}
|
|
274
|
+
function j(e) {
|
|
275
|
+
return N(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
276
|
+
}
|
|
277
|
+
function M(e) {
|
|
278
|
+
var t;
|
|
279
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
280
|
+
}
|
|
281
|
+
function N(e) {
|
|
282
|
+
return A() ? e instanceof Node || e instanceof M(e).Node : !1;
|
|
283
|
+
}
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region ../../node_modules/.pnpm/vue-demi@0.14.10_vue@3.5.33_typescript@5.9.3_/node_modules/vue-demi/lib/index.mjs
|
|
286
|
+
var P = /* @__PURE__ */ C({
|
|
287
|
+
Vue: () => e,
|
|
288
|
+
Vue2: () => void 0,
|
|
289
|
+
del: () => R,
|
|
290
|
+
install: () => I,
|
|
291
|
+
isVue2: () => !1,
|
|
292
|
+
isVue3: () => !0,
|
|
293
|
+
set: () => L
|
|
294
|
+
});
|
|
295
|
+
import * as F from "vue";
|
|
296
|
+
T(P, F);
|
|
297
|
+
function I() {}
|
|
298
|
+
function L(e, t, n) {
|
|
299
|
+
return Array.isArray(e) ? (e.length = Math.max(e.length, t), e.splice(t, 1, n), n) : (e[t] = n, n);
|
|
300
|
+
}
|
|
301
|
+
function R(e, t) {
|
|
302
|
+
if (Array.isArray(e)) {
|
|
303
|
+
e.splice(t, 1);
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
delete e[t];
|
|
307
|
+
}
|
|
308
|
+
//#endregion
|
|
309
|
+
//#region ../../node_modules/.pnpm/@floating-ui+vue@1.1.9_vue@3.5.33_typescript@5.9.3_/node_modules/@floating-ui/vue/dist/floating-ui.vue.mjs
|
|
310
|
+
function z(e) {
|
|
311
|
+
return typeof e == "object" && !!e && "$el" in e;
|
|
312
|
+
}
|
|
313
|
+
function B(e) {
|
|
314
|
+
if (z(e)) {
|
|
315
|
+
let t = e.$el;
|
|
316
|
+
return N(t) && j(t) === "#comment" ? null : t;
|
|
317
|
+
}
|
|
318
|
+
return e;
|
|
319
|
+
}
|
|
320
|
+
function V(e) {
|
|
321
|
+
return typeof e == "function" ? e() : (0, P.unref)(e);
|
|
322
|
+
}
|
|
323
|
+
function ee(e) {
|
|
324
|
+
return {
|
|
325
|
+
name: "arrow",
|
|
326
|
+
options: e,
|
|
327
|
+
fn(t) {
|
|
328
|
+
let n = B(V(e.element));
|
|
329
|
+
return n == null ? {} : p({
|
|
330
|
+
element: n,
|
|
331
|
+
padding: e.padding
|
|
332
|
+
}).fn(t);
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
function H(e) {
|
|
337
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
338
|
+
}
|
|
339
|
+
function U(e, t) {
|
|
340
|
+
let n = H(e);
|
|
341
|
+
return Math.round(t * n) / n;
|
|
342
|
+
}
|
|
343
|
+
function te(e, t, n) {
|
|
344
|
+
n === void 0 && (n = {});
|
|
345
|
+
let r = n.whileElementsMounted, i = (0, P.computed)(() => V(n.open) ?? !0), a = (0, P.computed)(() => V(n.middleware)), o = (0, P.computed)(() => V(n.placement) ?? "bottom"), s = (0, P.computed)(() => V(n.strategy) ?? "absolute"), c = (0, P.computed)(() => V(n.transform) ?? !0), l = (0, P.computed)(() => B(e.value)), u = (0, P.computed)(() => B(t.value)), d = (0, P.ref)(0), f = (0, P.ref)(0), p = (0, P.ref)(s.value), m = (0, P.ref)(o.value), g = (0, P.shallowRef)({}), _ = (0, P.ref)(!1), v = (0, P.computed)(() => {
|
|
346
|
+
let e = {
|
|
347
|
+
position: p.value,
|
|
348
|
+
left: "0",
|
|
349
|
+
top: "0"
|
|
350
|
+
};
|
|
351
|
+
if (!u.value) return e;
|
|
352
|
+
let t = U(u.value, d.value), n = U(u.value, f.value);
|
|
353
|
+
return c.value ? {
|
|
354
|
+
...e,
|
|
355
|
+
transform: "translate(" + t + "px, " + n + "px)",
|
|
356
|
+
...H(u.value) >= 1.5 && { willChange: "transform" }
|
|
357
|
+
} : {
|
|
358
|
+
position: p.value,
|
|
359
|
+
left: t + "px",
|
|
360
|
+
top: n + "px"
|
|
361
|
+
};
|
|
362
|
+
}), y;
|
|
363
|
+
function b() {
|
|
364
|
+
if (l.value == null || u.value == null) return;
|
|
365
|
+
let e = i.value;
|
|
366
|
+
h(l.value, u.value, {
|
|
367
|
+
middleware: a.value,
|
|
368
|
+
placement: o.value,
|
|
369
|
+
strategy: s.value
|
|
370
|
+
}).then((t) => {
|
|
371
|
+
d.value = t.x, f.value = t.y, p.value = t.strategy, m.value = t.placement, g.value = t.middlewareData, _.value = e !== !1;
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
function x() {
|
|
375
|
+
typeof y == "function" && (y(), y = void 0);
|
|
376
|
+
}
|
|
377
|
+
function S() {
|
|
378
|
+
if (x(), r === void 0) {
|
|
379
|
+
b();
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
if (l.value != null && u.value != null) {
|
|
383
|
+
y = r(l.value, u.value, b);
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
function C() {
|
|
388
|
+
i.value || (_.value = !1);
|
|
389
|
+
}
|
|
390
|
+
return (0, P.watch)([
|
|
391
|
+
a,
|
|
392
|
+
o,
|
|
393
|
+
s,
|
|
394
|
+
i
|
|
395
|
+
], b, { flush: "sync" }), (0, P.watch)([l, u], S, { flush: "sync" }), (0, P.watch)(i, C, { flush: "sync" }), (0, P.getCurrentScope)() && (0, P.onScopeDispose)(x), {
|
|
396
|
+
x: (0, P.shallowReadonly)(d),
|
|
397
|
+
y: (0, P.shallowReadonly)(f),
|
|
398
|
+
strategy: (0, P.shallowReadonly)(p),
|
|
399
|
+
placement: (0, P.shallowReadonly)(m),
|
|
400
|
+
middlewareData: (0, P.shallowReadonly)(g),
|
|
401
|
+
isPositioned: (0, P.shallowReadonly)(_),
|
|
402
|
+
floatingStyles: v,
|
|
403
|
+
update: b
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
//#endregion
|
|
407
|
+
//#region ../ccui/ui/shared/hooks/use-deprecation-warning.ts
|
|
408
|
+
var W = /* @__PURE__ */ new Set();
|
|
409
|
+
function G(e, t, n) {
|
|
410
|
+
let r = `${e}.${t}`;
|
|
411
|
+
W.has(r) || (W.add(r), typeof console < "u" && console.warn(`[ccui][${e}] ${t} 已 deprecated,请改用 ${n}。`));
|
|
412
|
+
}
|
|
413
|
+
function K(e, t, n) {
|
|
414
|
+
return e ? Object.prototype.hasOwnProperty.call(e, t) || Object.prototype.hasOwnProperty.call(e, n) : !1;
|
|
415
|
+
}
|
|
416
|
+
//#endregion
|
|
417
|
+
//#region ../ccui/ui/tooltip/src/tooltip-types.ts
|
|
418
|
+
var q = {
|
|
419
|
+
content: {
|
|
420
|
+
type: String,
|
|
421
|
+
default: ""
|
|
422
|
+
},
|
|
423
|
+
title: {
|
|
424
|
+
type: String,
|
|
425
|
+
default: ""
|
|
426
|
+
},
|
|
427
|
+
placement: {
|
|
428
|
+
type: String,
|
|
429
|
+
default: "bottom"
|
|
430
|
+
},
|
|
431
|
+
effect: {
|
|
432
|
+
type: String,
|
|
433
|
+
default: "dark"
|
|
434
|
+
},
|
|
435
|
+
color: {
|
|
436
|
+
type: String,
|
|
437
|
+
default: ""
|
|
438
|
+
},
|
|
439
|
+
visible: {
|
|
440
|
+
type: Boolean,
|
|
441
|
+
default: void 0
|
|
442
|
+
},
|
|
443
|
+
open: {
|
|
444
|
+
type: Boolean,
|
|
445
|
+
default: void 0
|
|
446
|
+
},
|
|
447
|
+
disabled: {
|
|
448
|
+
type: Boolean,
|
|
449
|
+
default: !1
|
|
450
|
+
},
|
|
451
|
+
showArrow: {
|
|
452
|
+
type: Boolean,
|
|
453
|
+
default: !0
|
|
454
|
+
},
|
|
455
|
+
arrow: {
|
|
456
|
+
type: [Boolean, Object],
|
|
457
|
+
default: void 0
|
|
458
|
+
},
|
|
459
|
+
trigger: {
|
|
460
|
+
type: String,
|
|
461
|
+
default: "hover"
|
|
462
|
+
},
|
|
463
|
+
showAfter: {
|
|
464
|
+
type: Number,
|
|
465
|
+
default: 0
|
|
466
|
+
},
|
|
467
|
+
hideAfter: {
|
|
468
|
+
type: Number,
|
|
469
|
+
default: 200
|
|
470
|
+
},
|
|
471
|
+
mouseEnterDelay: {
|
|
472
|
+
type: Number,
|
|
473
|
+
default: void 0
|
|
474
|
+
},
|
|
475
|
+
mouseLeaveDelay: {
|
|
476
|
+
type: Number,
|
|
477
|
+
default: void 0
|
|
478
|
+
},
|
|
479
|
+
popperClass: {
|
|
480
|
+
type: String,
|
|
481
|
+
default: ""
|
|
482
|
+
},
|
|
483
|
+
overlayClassName: {
|
|
484
|
+
type: String,
|
|
485
|
+
default: ""
|
|
486
|
+
},
|
|
487
|
+
offset: {
|
|
488
|
+
type: Number,
|
|
489
|
+
default: 8
|
|
490
|
+
},
|
|
491
|
+
rawContent: {
|
|
492
|
+
type: Boolean,
|
|
493
|
+
default: !1
|
|
494
|
+
},
|
|
495
|
+
enterable: {
|
|
496
|
+
type: Boolean,
|
|
497
|
+
default: !0
|
|
498
|
+
},
|
|
499
|
+
fresh: {
|
|
500
|
+
type: Boolean,
|
|
501
|
+
default: !1
|
|
502
|
+
},
|
|
503
|
+
destroyTooltipOnHide: {
|
|
504
|
+
type: Boolean,
|
|
505
|
+
default: !1
|
|
506
|
+
},
|
|
507
|
+
autoAdjustOverflow: {
|
|
508
|
+
type: Boolean,
|
|
509
|
+
default: !0
|
|
510
|
+
},
|
|
511
|
+
align: {
|
|
512
|
+
type: Object,
|
|
513
|
+
default: void 0
|
|
514
|
+
},
|
|
515
|
+
getPopupContainer: {
|
|
516
|
+
type: Function,
|
|
517
|
+
default: void 0
|
|
518
|
+
},
|
|
519
|
+
ariaLabel: {
|
|
520
|
+
type: String,
|
|
521
|
+
default: ""
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
//#endregion
|
|
525
|
+
//#region ../ccui/ui/tooltip/src/tooltip.tsx
|
|
526
|
+
function ne(e) {
|
|
527
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
528
|
+
}
|
|
529
|
+
var J = /* @__PURE__ */ r({
|
|
530
|
+
name: "CTooltip",
|
|
531
|
+
props: q,
|
|
532
|
+
emits: [
|
|
533
|
+
"before-show",
|
|
534
|
+
"show",
|
|
535
|
+
"before-hide",
|
|
536
|
+
"hide",
|
|
537
|
+
"update:visible",
|
|
538
|
+
"update:open"
|
|
539
|
+
],
|
|
540
|
+
setup(e, { emit: r, slots: a }) {
|
|
541
|
+
let c = O("tooltip"), p = i()?.vnode.props;
|
|
542
|
+
K(p, "content", "content") && G("Tooltip", "content", "title"), K(p, "visible", "visible") && G("Tooltip", "visible", "open(v-model:open)"), K(p, "showArrow", "show-arrow") && G("Tooltip", "showArrow", "arrow"), K(p, "showAfter", "show-after") && G("Tooltip", "showAfter", "mouseEnterDelay"), K(p, "hideAfter", "hide-after") && G("Tooltip", "hideAfter", "mouseLeaveDelay"), K(p, "popperClass", "popper-class") && G("Tooltip", "popperClass", "overlayClassName");
|
|
543
|
+
let h = t(() => e.open === void 0 ? e.visible : e.open), y = t(() => h.value !== void 0), b = d(!1), x = d(), S = d(), C = d(), w = d(), T = d(), E = t(() => y.value ? h.value : b.value), D = t(() => e.mouseEnterDelay === void 0 ? e.showAfter : e.mouseEnterDelay), k = t(() => e.mouseLeaveDelay === void 0 ? e.hideAfter : e.mouseLeaveDelay), A = t(() => e.arrow === void 0 ? e.showArrow : typeof e.arrow == "boolean" ? e.arrow : !0), j = t(() => ne(e.arrow) ? !!e.arrow.pointAtCenter : !1), M = t(() => e.overlayClassName || e.popperClass), N = t(() => e.title || e.content), P = t(() => e.color ? { backgroundColor: e.color } : {}), F = t(() => [
|
|
544
|
+
c.e("popper"),
|
|
545
|
+
c.em("popper", e.effect),
|
|
546
|
+
c.em("popper", e.placement.split("-")[0]),
|
|
547
|
+
j.value && c.em("popper", "arrow-center"),
|
|
548
|
+
M.value
|
|
549
|
+
].filter(Boolean).join(" ")), { floatingStyles: I, middlewareData: L, update: R } = te(x, S, {
|
|
550
|
+
placement: e.placement,
|
|
551
|
+
middleware: [
|
|
552
|
+
_(e.offset),
|
|
553
|
+
...e.autoAdjustOverflow ? [g()] : [],
|
|
554
|
+
v({ padding: 8 }),
|
|
555
|
+
...A.value ? [ee({ element: C })] : []
|
|
556
|
+
]
|
|
557
|
+
}), z = t(() => {
|
|
558
|
+
if (!A.value || !L.value.arrow) return {};
|
|
559
|
+
let { x: t, y: n } = L.value.arrow, r = {
|
|
560
|
+
top: "bottom",
|
|
561
|
+
right: "left",
|
|
562
|
+
bottom: "top",
|
|
563
|
+
left: "right"
|
|
564
|
+
}[e.placement.split("-")[0]];
|
|
565
|
+
return {
|
|
566
|
+
left: t == null ? "" : `${t}px`,
|
|
567
|
+
top: n == null ? "" : `${n}px`,
|
|
568
|
+
right: "",
|
|
569
|
+
bottom: "",
|
|
570
|
+
[r]: "-4px"
|
|
571
|
+
};
|
|
572
|
+
}), B = () => {
|
|
573
|
+
w.value &&= (clearTimeout(w.value), void 0), T.value &&= (clearTimeout(T.value), void 0);
|
|
574
|
+
}, V = () => {
|
|
575
|
+
if (e.disabled) return;
|
|
576
|
+
B();
|
|
577
|
+
let t = () => {
|
|
578
|
+
r("before-show"), y.value || (b.value = !0), r("update:visible", !0), r("update:open", !0), s(() => {
|
|
579
|
+
R(), r("show");
|
|
580
|
+
});
|
|
581
|
+
};
|
|
582
|
+
D.value > 0 ? w.value = window.setTimeout(t, D.value) : t();
|
|
583
|
+
}, H = () => {
|
|
584
|
+
B();
|
|
585
|
+
let t = () => {
|
|
586
|
+
r("before-hide"), y.value || (b.value = !1), r("update:visible", !1), r("update:open", !1), r("hide");
|
|
587
|
+
};
|
|
588
|
+
k.value > 0 && e.trigger !== "click" ? T.value = window.setTimeout(t, k.value) : t();
|
|
589
|
+
}, U = () => {
|
|
590
|
+
e.trigger === "hover" && V();
|
|
591
|
+
}, W = () => {
|
|
592
|
+
e.trigger === "hover" && H();
|
|
593
|
+
}, q = () => {
|
|
594
|
+
e.trigger === "click" && (E.value ? H() : V());
|
|
595
|
+
}, J = () => {
|
|
596
|
+
e.trigger === "focus" && V();
|
|
597
|
+
}, Y = () => {
|
|
598
|
+
e.trigger === "focus" && H();
|
|
599
|
+
}, X = () => {
|
|
600
|
+
e.trigger === "hover" && e.enterable && B();
|
|
601
|
+
}, Z = () => {
|
|
602
|
+
e.trigger === "hover" && e.enterable && H();
|
|
603
|
+
}, Q;
|
|
604
|
+
l(() => {
|
|
605
|
+
E.value && x.value && S.value && (Q = m(x.value, S.value, R));
|
|
606
|
+
}), u(() => {
|
|
607
|
+
B(), Q?.();
|
|
608
|
+
}), f(h, (e) => {
|
|
609
|
+
e !== void 0 && e && s(() => R());
|
|
610
|
+
}), f(E, (e) => {
|
|
611
|
+
e && x.value && S.value ? (Q?.(), Q = m(x.value, S.value, R)) : Q?.();
|
|
612
|
+
});
|
|
613
|
+
let re = () => A.value ? n("div", {
|
|
614
|
+
ref: C,
|
|
615
|
+
class: [c.e("arrow"), c.em("arrow", e.placement.split("-")[0])].join(" "),
|
|
616
|
+
style: z.value
|
|
617
|
+
}, null) : null, ie = () => a.title ? a.title() : a.content ? a.content() : e.rawContent ? n("div", { innerHTML: N.value }, null) : N.value;
|
|
618
|
+
return () => {
|
|
619
|
+
let t = {};
|
|
620
|
+
return e.trigger === "hover" ? (t.onMouseenter = U, t.onMouseleave = W) : e.trigger === "click" ? t.onClick = q : e.trigger === "focus" && (t.onFocus = J, t.onBlur = Y), n("div", { class: c.b() }, [n("div", o({
|
|
621
|
+
ref: x,
|
|
622
|
+
class: c.e("trigger"),
|
|
623
|
+
"aria-describedby": E.value ? c.e("popper") : void 0,
|
|
624
|
+
"aria-label": e.ariaLabel,
|
|
625
|
+
tabindex: e.trigger === "focus" ? 0 : void 0
|
|
626
|
+
}, t), [a.default?.()]), E.value && n("div", {
|
|
627
|
+
ref: S,
|
|
628
|
+
class: F.value,
|
|
629
|
+
role: "tooltip",
|
|
630
|
+
id: c.e("popper"),
|
|
631
|
+
style: {
|
|
632
|
+
...I.value,
|
|
633
|
+
...P.value,
|
|
634
|
+
zIndex: 2e3,
|
|
635
|
+
pointerEvents: e.enterable ? "auto" : "none"
|
|
636
|
+
},
|
|
637
|
+
onMouseenter: X,
|
|
638
|
+
onMouseleave: Z
|
|
639
|
+
}, [re(), n("div", { class: c.e("content") }, [ie()])])]);
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
//#endregion
|
|
644
|
+
//#region ../ccui/ui/tooltip/index.ts
|
|
645
|
+
J.install = function(e) {
|
|
646
|
+
e.component(J.name, J);
|
|
647
|
+
};
|
|
648
|
+
//#endregion
|
|
649
|
+
//#region ../ccui/ui/slider/src/composables/use-slider.ts
|
|
650
|
+
function Y(e, n) {
|
|
651
|
+
return { currentValue: t({
|
|
652
|
+
get() {
|
|
653
|
+
return e.modelValue;
|
|
654
|
+
},
|
|
655
|
+
set(e) {
|
|
656
|
+
n("update:modelValue", e), n("input", e);
|
|
657
|
+
}
|
|
658
|
+
}) };
|
|
659
|
+
}
|
|
660
|
+
function X(e) {
|
|
661
|
+
let t = e.max - e.min;
|
|
662
|
+
return {
|
|
663
|
+
getPercent: (n) => {
|
|
664
|
+
if (t <= 0) return 0;
|
|
665
|
+
let r = (n - e.min) / t * 100;
|
|
666
|
+
return Math.max(0, Math.min(100, r));
|
|
667
|
+
},
|
|
668
|
+
getValueFromPercent: (n) => {
|
|
669
|
+
if (t <= 0) return e.min;
|
|
670
|
+
let r = e.min + n / 100 * t;
|
|
671
|
+
if (e.step <= 0) return Math.max(e.min, Math.min(e.max, r));
|
|
672
|
+
let i = e.min + Math.round((r - e.min) / e.step) * e.step;
|
|
673
|
+
return Math.max(e.min, Math.min(e.max, i));
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
function Z(e, n, r) {
|
|
678
|
+
return {
|
|
679
|
+
trackStyle: t(() => {
|
|
680
|
+
if (e.range && Array.isArray(n.value)) {
|
|
681
|
+
let [t, i] = n.value;
|
|
682
|
+
return e.vertical ? {
|
|
683
|
+
bottom: `${r(t)}%`,
|
|
684
|
+
height: `${r(i) - r(t)}%`
|
|
685
|
+
} : {
|
|
686
|
+
left: `${r(t)}%`,
|
|
687
|
+
width: `${r(i) - r(t)}%`
|
|
688
|
+
};
|
|
689
|
+
} else {
|
|
690
|
+
let t = Array.isArray(n.value) ? n.value[0] : n.value;
|
|
691
|
+
return e.vertical ? { height: `${r(t)}%` } : { width: `${r(t)}%` };
|
|
692
|
+
}
|
|
693
|
+
}),
|
|
694
|
+
firstButtonStyle: t(() => {
|
|
695
|
+
let t = r(Array.isArray(n.value) ? n.value[0] : n.value);
|
|
696
|
+
return e.vertical ? { bottom: `${t}%` } : { left: `${t}%` };
|
|
697
|
+
}),
|
|
698
|
+
secondButtonStyle: t(() => e.range && Array.isArray(n.value) ? e.vertical ? { bottom: `${r(n.value[1])}%` } : { left: `${r(n.value[1])}%` } : {})
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
function Q(e, t, n, r, i) {
|
|
702
|
+
let a = d(!1), o = d(null), s = (t) => {
|
|
703
|
+
let n = r.value?.getBoundingClientRect();
|
|
704
|
+
if (!n) return 0;
|
|
705
|
+
if (e.vertical) {
|
|
706
|
+
let e = "touches" in t ? t.touches[0].clientY : t.clientY;
|
|
707
|
+
return (n.bottom - e) / n.height * 100;
|
|
708
|
+
}
|
|
709
|
+
return (("touches" in t ? t.touches[0].clientX : t.clientX) - n.left) / n.width * 100;
|
|
710
|
+
}, c = (r) => {
|
|
711
|
+
if (e.disabled || a.value) return;
|
|
712
|
+
let o = i(s(r));
|
|
713
|
+
if (e.range && Array.isArray(t.value)) {
|
|
714
|
+
let [n, r] = t.value;
|
|
715
|
+
o <= (n + r) / 2 ? t.value = [Math.max(e.min, Math.min(o, r)), r] : t.value = [n, Math.min(e.max, Math.max(o, n))];
|
|
716
|
+
} else t.value = Math.max(e.min, Math.min(e.max, o));
|
|
717
|
+
n("change", t.value), n("change-complete", t.value);
|
|
718
|
+
}, l = (n) => {
|
|
719
|
+
if (!a.value) return;
|
|
720
|
+
n.preventDefault();
|
|
721
|
+
let r = i(s(n));
|
|
722
|
+
if (e.range && Array.isArray(t.value)) {
|
|
723
|
+
let [n, i] = t.value;
|
|
724
|
+
o.value === 0 ? t.value = [Math.max(e.min, Math.min(r, i)), i] : t.value = [n, Math.min(e.max, Math.max(r, n))];
|
|
725
|
+
} else t.value = Math.max(e.min, Math.min(e.max, r));
|
|
726
|
+
}, u = () => {
|
|
727
|
+
a.value && (a.value = !1, o.value = null, document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", u), document.removeEventListener("touchmove", l), document.removeEventListener("touchend", u), n("change", t.value), n("change-complete", t.value));
|
|
728
|
+
};
|
|
729
|
+
return {
|
|
730
|
+
isDragging: a,
|
|
731
|
+
dragIndex: o,
|
|
732
|
+
handleSliderClick: c,
|
|
733
|
+
handleDragStart: (t, n) => {
|
|
734
|
+
e.disabled || (t.preventDefault(), a.value = !0, o.value = n ?? 0, document.addEventListener("mousemove", l), document.addEventListener("mouseup", u), document.addEventListener("touchmove", l), document.addEventListener("touchend", u));
|
|
735
|
+
},
|
|
736
|
+
handleDragEnd: u,
|
|
737
|
+
cleanup: () => {
|
|
738
|
+
a.value && u();
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
function re(e, t, n) {
|
|
743
|
+
return { handleKeydown: (r, i) => {
|
|
744
|
+
if (e.disabled) return;
|
|
745
|
+
let a = 0;
|
|
746
|
+
switch (r.key) {
|
|
747
|
+
case "ArrowLeft":
|
|
748
|
+
case "ArrowDown":
|
|
749
|
+
a = -e.step;
|
|
750
|
+
break;
|
|
751
|
+
case "ArrowRight":
|
|
752
|
+
case "ArrowUp":
|
|
753
|
+
a = e.step;
|
|
754
|
+
break;
|
|
755
|
+
case "Home":
|
|
756
|
+
a = e.min - (Array.isArray(t.value) ? t.value[i ?? 0] : t.value);
|
|
757
|
+
break;
|
|
758
|
+
case "End":
|
|
759
|
+
a = e.max - (Array.isArray(t.value) ? t.value[i ?? 0] : t.value);
|
|
760
|
+
break;
|
|
761
|
+
default: return;
|
|
762
|
+
}
|
|
763
|
+
if (r.preventDefault(), e.range && Array.isArray(t.value)) {
|
|
764
|
+
let [n, r] = t.value;
|
|
765
|
+
i === 0 ? t.value = [Math.max(e.min, Math.min(n + a, r)), r] : t.value = [n, Math.min(e.max, Math.max(r + a, n))];
|
|
766
|
+
} else {
|
|
767
|
+
let n = Array.isArray(t.value) ? t.value[0] : t.value;
|
|
768
|
+
t.value = Math.max(e.min, Math.min(e.max, n + a));
|
|
769
|
+
}
|
|
770
|
+
n("change", t.value), n("change-complete", t.value);
|
|
771
|
+
} };
|
|
772
|
+
}
|
|
773
|
+
function ie(e, n) {
|
|
774
|
+
let r = t(() => {
|
|
775
|
+
if (!e.marks) return {};
|
|
776
|
+
let t = {};
|
|
777
|
+
return Object.keys(e.marks).forEach((n) => {
|
|
778
|
+
let r = Number(n);
|
|
779
|
+
r >= e.min && r <= e.max && (t[r] = e.marks[n]);
|
|
780
|
+
}), t;
|
|
781
|
+
});
|
|
782
|
+
return {
|
|
783
|
+
marks: r,
|
|
784
|
+
getMarkStyle: (t) => {
|
|
785
|
+
let i = n(t), a = r.value[t], o = e.vertical ? { bottom: `${i}%` } : { left: `${i}%` };
|
|
786
|
+
return typeof a == "object" && a.style ? {
|
|
787
|
+
...o,
|
|
788
|
+
...a.style
|
|
789
|
+
} : o;
|
|
790
|
+
},
|
|
791
|
+
getMarkLabel: (e) => {
|
|
792
|
+
let t = r.value[e];
|
|
793
|
+
return typeof t == "string" ? t : typeof t == "object" && t.label !== void 0 ? t.label : e;
|
|
794
|
+
}
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
function ae(e, t, n) {
|
|
798
|
+
return { handleInputChange: (r, i) => {
|
|
799
|
+
if (r == null) return;
|
|
800
|
+
let a = Math.max(e.min, Math.min(e.max, r));
|
|
801
|
+
if (e.range && Array.isArray(t.value)) {
|
|
802
|
+
let [e, n] = t.value;
|
|
803
|
+
i === 0 ? t.value = [Math.min(a, n), n] : t.value = [e, Math.max(a, e)];
|
|
804
|
+
} else t.value = a;
|
|
805
|
+
n("change", t.value), n("change-complete", t.value), e.validateEvent;
|
|
806
|
+
} };
|
|
807
|
+
}
|
|
808
|
+
//#endregion
|
|
809
|
+
//#region ../ccui/ui/slider/src/composables/use-slider-tooltip.ts
|
|
810
|
+
function oe(e, n, r) {
|
|
811
|
+
let i = d(!1), a = d(null), o = t(() => e.showTooltip), s = (t) => e.tipsRenderer === null ? null : e.formatTooltip ? e.formatTooltip(t) : e.tipsRenderer ? e.tipsRenderer(t) : t.toString(), c = (t) => e.formatTooltip ? e.formatTooltip(t) : t.toString(), l = (t) => e.formatValueText ? e.formatValueText(t) : t.toString(), u = (t) => {
|
|
812
|
+
e.disabled || (i.value = !0, a.value = t);
|
|
813
|
+
}, f = () => {
|
|
814
|
+
i.value = !1, a.value = null;
|
|
815
|
+
}, p = (t) => e.range && Array.isArray(r.value) ? r.value[t] : Array.isArray(r.value) ? r.value[0] : r.value, m = (e) => o.value && (a.value === e || n.value), h = (t) => e.showTooltip && e.tipsRenderer === null && e.showDefaultTooltip && (a.value === t || n.value || e.persistent);
|
|
816
|
+
return {
|
|
817
|
+
isHovering: i,
|
|
818
|
+
hoverIndex: a,
|
|
819
|
+
shouldShowTooltip: o,
|
|
820
|
+
formatTooltipText: s,
|
|
821
|
+
getDefaultText: c,
|
|
822
|
+
getAriaValueText: l,
|
|
823
|
+
handleButtonMouseEnter: u,
|
|
824
|
+
handleButtonMouseLeave: f,
|
|
825
|
+
getCurrentValue: p,
|
|
826
|
+
shouldShowTooltipForButton: m,
|
|
827
|
+
shouldShowDefaultTooltipForButton: h,
|
|
828
|
+
getTooltipContent: (e) => {
|
|
829
|
+
let t = p(e);
|
|
830
|
+
return m(e) && s(t) ? s(t) : h(e) ? c(t) : "";
|
|
831
|
+
},
|
|
832
|
+
getTooltipVisible: (e) => m(e) || h(e),
|
|
833
|
+
getTooltipPlacement: () => e.placement && e.placement !== "top" ? e.placement : e.vertical ? "right" : "top"
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
//#endregion
|
|
837
|
+
//#region ../ccui/ui/slider/src/slider.tsx
|
|
838
|
+
var $ = /* @__PURE__ */ r({
|
|
839
|
+
name: "CSlider",
|
|
840
|
+
props: {
|
|
841
|
+
modelValue: {
|
|
842
|
+
type: [Number, Array],
|
|
843
|
+
default: 0
|
|
844
|
+
},
|
|
845
|
+
min: {
|
|
846
|
+
type: Number,
|
|
847
|
+
default: 0
|
|
848
|
+
},
|
|
849
|
+
max: {
|
|
850
|
+
type: Number,
|
|
851
|
+
default: 100
|
|
852
|
+
},
|
|
853
|
+
step: {
|
|
854
|
+
type: Number,
|
|
855
|
+
default: 1
|
|
856
|
+
},
|
|
857
|
+
disabled: {
|
|
858
|
+
type: Boolean,
|
|
859
|
+
default: !1
|
|
860
|
+
},
|
|
861
|
+
showInput: {
|
|
862
|
+
type: Boolean,
|
|
863
|
+
default: !1
|
|
864
|
+
},
|
|
865
|
+
showInputControls: {
|
|
866
|
+
type: Boolean,
|
|
867
|
+
default: !0
|
|
868
|
+
},
|
|
869
|
+
size: {
|
|
870
|
+
type: String,
|
|
871
|
+
default: "default"
|
|
872
|
+
},
|
|
873
|
+
inputSize: {
|
|
874
|
+
type: String,
|
|
875
|
+
default: "default"
|
|
876
|
+
},
|
|
877
|
+
label: { type: String },
|
|
878
|
+
precision: { type: Number },
|
|
879
|
+
showStops: {
|
|
880
|
+
type: Boolean,
|
|
881
|
+
default: !1
|
|
882
|
+
},
|
|
883
|
+
showTooltip: {
|
|
884
|
+
type: Boolean,
|
|
885
|
+
default: !0
|
|
886
|
+
},
|
|
887
|
+
formatTooltip: { type: Function },
|
|
888
|
+
range: {
|
|
889
|
+
type: Boolean,
|
|
890
|
+
default: !1
|
|
891
|
+
},
|
|
892
|
+
vertical: {
|
|
893
|
+
type: Boolean,
|
|
894
|
+
default: !1
|
|
895
|
+
},
|
|
896
|
+
height: {
|
|
897
|
+
type: String,
|
|
898
|
+
default: "200px"
|
|
899
|
+
},
|
|
900
|
+
ariaLabel: { type: String },
|
|
901
|
+
rangeStartLabel: { type: String },
|
|
902
|
+
rangeEndLabel: { type: String },
|
|
903
|
+
formatValueText: { type: Function },
|
|
904
|
+
tooltipClass: { type: String },
|
|
905
|
+
placement: {
|
|
906
|
+
type: String,
|
|
907
|
+
default: "top"
|
|
908
|
+
},
|
|
909
|
+
marks: { type: Object },
|
|
910
|
+
validateEvent: {
|
|
911
|
+
type: Boolean,
|
|
912
|
+
default: !0
|
|
913
|
+
},
|
|
914
|
+
persistent: {
|
|
915
|
+
type: Boolean,
|
|
916
|
+
default: !0
|
|
917
|
+
},
|
|
918
|
+
tipsRenderer: { type: [Function, null] },
|
|
919
|
+
showDefaultTooltip: {
|
|
920
|
+
type: Boolean,
|
|
921
|
+
default: !1
|
|
922
|
+
}
|
|
923
|
+
},
|
|
924
|
+
emits: [
|
|
925
|
+
"update:modelValue",
|
|
926
|
+
"change",
|
|
927
|
+
"change-complete",
|
|
928
|
+
"input"
|
|
929
|
+
],
|
|
930
|
+
setup(e, { emit: t }) {
|
|
931
|
+
let r = O("slider"), i = d(), { currentValue: a } = Y(e, t), { getPercent: o, getValueFromPercent: s } = X(e), { trackStyle: l, firstButtonStyle: f, secondButtonStyle: p } = Z(e, a, o), { isDragging: m, handleSliderClick: h, handleDragStart: g, handleDragEnd: _, cleanup: v } = Q(e, a, t, i, s), { handleKeydown: y } = re(e, a, t), { marks: b, getMarkStyle: x, getMarkLabel: S } = ie(e, o), { handleInputChange: C } = ae(e, a, t), { formatTooltipText: w, getDefaultText: T, getAriaValueText: E, handleButtonMouseEnter: D, handleButtonMouseLeave: k, shouldShowTooltipForButton: A, shouldShowDefaultTooltipForButton: j, getCurrentValue: M, getTooltipContent: N, getTooltipVisible: P, getTooltipPlacement: F } = oe(e, m, a);
|
|
932
|
+
return c(() => {
|
|
933
|
+
v();
|
|
934
|
+
}), u(() => {
|
|
935
|
+
_();
|
|
936
|
+
}), {
|
|
937
|
+
ns: r,
|
|
938
|
+
sliderRef: i,
|
|
939
|
+
isDragging: m,
|
|
940
|
+
currentValue: a,
|
|
941
|
+
trackStyle: l,
|
|
942
|
+
firstButtonStyle: f,
|
|
943
|
+
secondButtonStyle: p,
|
|
944
|
+
handleSliderClick: h,
|
|
945
|
+
handleDragStart: g,
|
|
946
|
+
handleKeydown: y,
|
|
947
|
+
marks: b,
|
|
948
|
+
getMarkStyle: x,
|
|
949
|
+
getMarkLabel: S,
|
|
950
|
+
formatTooltipText: w,
|
|
951
|
+
getDefaultText: T,
|
|
952
|
+
getPercent: o,
|
|
953
|
+
getValueFromPercent: s,
|
|
954
|
+
handleInputChange: C,
|
|
955
|
+
getAriaValueText: E,
|
|
956
|
+
handleButtonMouseEnter: D,
|
|
957
|
+
handleButtonMouseLeave: k,
|
|
958
|
+
shouldShowTooltipForButton: A,
|
|
959
|
+
shouldShowDefaultTooltipForButton: j,
|
|
960
|
+
getCurrentValue: M,
|
|
961
|
+
getTooltipContent: N,
|
|
962
|
+
getTooltipVisible: P,
|
|
963
|
+
getTooltipPlacement: F,
|
|
964
|
+
renderButton: (t, i, a, o) => {
|
|
965
|
+
let s = {
|
|
966
|
+
class: [r.e("button"), { [r.em("button", "disabled")]: e.disabled }],
|
|
967
|
+
tabindex: e.disabled ? -1 : 0,
|
|
968
|
+
onMousedown: (e) => g(e, t),
|
|
969
|
+
onTouchstart: (e) => g(e, t),
|
|
970
|
+
onKeydown: (e) => y(e, t),
|
|
971
|
+
onMouseenter: () => D(t),
|
|
972
|
+
onMouseleave: k,
|
|
973
|
+
role: "slider",
|
|
974
|
+
"aria-label": o,
|
|
975
|
+
"aria-valuemin": e.min,
|
|
976
|
+
"aria-valuemax": e.max,
|
|
977
|
+
"aria-valuenow": i,
|
|
978
|
+
"aria-valuetext": E(i),
|
|
979
|
+
"aria-orientation": e.vertical ? "vertical" : "horizontal"
|
|
980
|
+
};
|
|
981
|
+
return e.showTooltip ? n(J, {
|
|
982
|
+
content: N(t),
|
|
983
|
+
visible: P(t),
|
|
984
|
+
placement: F(),
|
|
985
|
+
effect: "dark",
|
|
986
|
+
showArrow: !0,
|
|
987
|
+
trigger: "manual",
|
|
988
|
+
popperClass: e.tooltipClass
|
|
989
|
+
}, { default: () => [n("div", s, null)] }) : n("div", s, null);
|
|
990
|
+
}
|
|
991
|
+
};
|
|
992
|
+
},
|
|
993
|
+
render() {
|
|
994
|
+
let e = this.range && Array.isArray(this.currentValue), t = this.getCurrentValue(0), r = e ? this.getCurrentValue(1) : 0;
|
|
995
|
+
return n("div", {
|
|
996
|
+
class: [this.ns.b(), {
|
|
997
|
+
[this.ns.m("disabled")]: this.disabled,
|
|
998
|
+
[this.ns.m("vertical")]: this.vertical,
|
|
999
|
+
[this.ns.m("with-input")]: this.showInput && !this.range,
|
|
1000
|
+
[this.ns.m(this.size)]: this.size !== "default"
|
|
1001
|
+
}],
|
|
1002
|
+
style: this.vertical ? { height: this.height } : {},
|
|
1003
|
+
"aria-label": this.label || this.ariaLabel
|
|
1004
|
+
}, [this.showInput && !this.range && n("div", { class: this.ns.e("input") }, [n(k, {
|
|
1005
|
+
modelValue: this.currentValue,
|
|
1006
|
+
min: this.min,
|
|
1007
|
+
max: this.max,
|
|
1008
|
+
step: this.step,
|
|
1009
|
+
disabled: this.disabled,
|
|
1010
|
+
size: this.inputSize,
|
|
1011
|
+
controls: this.showInputControls,
|
|
1012
|
+
precision: this.precision,
|
|
1013
|
+
"onUpdate:modelValue": this.handleInputChange,
|
|
1014
|
+
onChange: this.handleInputChange,
|
|
1015
|
+
class: this.ns.e("input-number")
|
|
1016
|
+
}, null)]), n("div", {
|
|
1017
|
+
ref: "sliderRef",
|
|
1018
|
+
class: this.ns.e("wrapper"),
|
|
1019
|
+
onClick: this.handleSliderClick,
|
|
1020
|
+
role: "slider",
|
|
1021
|
+
"aria-label": this.ariaLabel || (this.range ? "range slider" : "slider"),
|
|
1022
|
+
"aria-valuemin": this.min,
|
|
1023
|
+
"aria-valuemax": this.max,
|
|
1024
|
+
"aria-orientation": this.vertical ? "vertical" : "horizontal"
|
|
1025
|
+
}, [
|
|
1026
|
+
n("div", { class: this.ns.e("track") }, [n("div", {
|
|
1027
|
+
class: this.ns.e("bar"),
|
|
1028
|
+
style: this.trackStyle
|
|
1029
|
+
}, null)]),
|
|
1030
|
+
this.showStops && n("div", { class: this.ns.e("stops") }, [Array.from({ length: Math.floor((this.max - this.min) / this.step) + 1 }).map((e, t) => {
|
|
1031
|
+
let r = this.min + t * this.step, i = this.getPercent(r);
|
|
1032
|
+
return n("div", {
|
|
1033
|
+
key: t,
|
|
1034
|
+
class: this.ns.e("stop"),
|
|
1035
|
+
style: { [this.vertical ? "bottom" : "left"]: `${i}%` }
|
|
1036
|
+
}, null);
|
|
1037
|
+
})]),
|
|
1038
|
+
this.marks && Object.keys(this.marks).length > 0 && n("div", { class: this.ns.e("marks") }, [Object.keys(this.marks).map((e) => {
|
|
1039
|
+
let t = Number(e);
|
|
1040
|
+
return n("div", {
|
|
1041
|
+
key: t,
|
|
1042
|
+
class: this.ns.e("mark"),
|
|
1043
|
+
style: this.getMarkStyle(t)
|
|
1044
|
+
}, [n("div", { class: this.ns.e("mark-line") }, null), n("span", { class: this.ns.e("mark-label") }, [this.getMarkLabel(t)])]);
|
|
1045
|
+
})]),
|
|
1046
|
+
n("div", {
|
|
1047
|
+
class: [this.ns.e("button-wrapper"), { [this.ns.em("button-wrapper", "first")]: e }],
|
|
1048
|
+
style: this.firstButtonStyle
|
|
1049
|
+
}, [this.renderButton(0, t, this.firstButtonStyle, this.rangeStartLabel || "start value")]),
|
|
1050
|
+
e && n("div", {
|
|
1051
|
+
class: [this.ns.e("button-wrapper"), this.ns.em("button-wrapper", "second")],
|
|
1052
|
+
style: this.secondButtonStyle
|
|
1053
|
+
}, [this.renderButton(1, r, this.secondButtonStyle, this.rangeEndLabel || "end value")])
|
|
1054
|
+
])]);
|
|
1055
|
+
}
|
|
1056
|
+
});
|
|
1057
|
+
//#endregion
|
|
1058
|
+
//#region ../ccui/ui/slider/index.ts
|
|
1059
|
+
$.install = function(e) {
|
|
1060
|
+
e.component($.name, $);
|
|
1061
|
+
};
|
|
1062
|
+
var se = {
|
|
1063
|
+
title: "Slider 滑块",
|
|
1064
|
+
category: "数据录入",
|
|
1065
|
+
status: "100%",
|
|
1066
|
+
install(e) {
|
|
1067
|
+
e.component($.name, $);
|
|
1068
|
+
}
|
|
1069
|
+
};
|
|
1070
|
+
//#endregion
|
|
1071
|
+
export { $ as Slider, se as default };
|