@vaebe/ccui 2.0.0-beta.0 → 2.0.1-beta.1
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/README.md +4 -0
- package/button/index.es.js +28 -22
- package/button/index.umd.js +1 -1
- package/calendar/index.es.js +445 -90
- package/calendar/index.umd.js +1 -1
- package/ccui-cli.css +1 -1
- package/check-box/index.es.js +8 -2
- package/check-box/index.umd.js +1 -1
- package/chunk-Ndeg2fpE.js +20 -0
- package/collapse/index.es.js +10 -7
- package/collapse/index.umd.js +1 -1
- package/config-provider/chunk-C_CI6nMA.js +13 -0
- package/config-provider/en-BG83iZ_P.js +24 -0
- package/config-provider/index.es.js +408 -53
- package/config-provider/index.umd.js +1 -1
- package/config-provider/ja-B-93MQG5.js +56 -0
- package/config-provider/ko-86th3uXt.js +56 -0
- package/config-provider/zh-cn-BQE-LNg1.js +59 -0
- package/date-picker/ccui-cli.css +1 -1
- package/date-picker/index.es.js +664 -482
- package/date-picker/index.umd.js +1 -1
- package/drawer/index.es.js +271 -279
- package/drawer/index.umd.js +1 -1
- package/dropdown/index.es.js +187 -171
- package/dropdown/index.umd.js +1 -1
- package/empty/index.es.js +341 -24
- package/empty/index.umd.js +1 -1
- package/en-BVwCvuzF.js +24 -0
- package/float-button/index.es.js +1134 -46
- package/float-button/index.umd.js +1 -1
- package/form/index.es.js +1357 -261
- package/form/index.umd.js +1 -1
- package/icon/index.es.js +93 -10
- package/icon/index.umd.js +1 -1
- package/image/index.es.js +353 -36
- package/image/index.umd.js +1 -1
- package/input/index.es.js +24 -15
- package/input/index.umd.js +1 -1
- package/input-number/index.es.js +45 -25
- package/input-number/index.umd.js +1 -1
- package/ja-B4U4rt8A.js +56 -0
- package/ko-BG35I8uK.js +56 -0
- package/menu/index.es.js +3 -1
- package/menu/index.umd.js +1 -1
- package/message/index.es.js +1179 -86
- package/message/index.umd.js +1 -1
- package/modal/index.es.js +735 -335
- package/modal/index.umd.js +1 -1
- package/notification/index.es.js +1176 -83
- package/notification/index.umd.js +1 -1
- package/package.json +9 -9
- package/pagination/index.es.js +381 -60
- package/pagination/index.umd.js +1 -1
- package/popconfirm/index.es.js +469 -143
- package/popconfirm/index.umd.js +1 -1
- package/popover/index.es.js +192 -175
- package/popover/index.umd.js +1 -1
- package/radio/index.es.js +8 -2
- package/radio/index.umd.js +1 -1
- package/rate/index.es.js +22 -12
- package/rate/index.umd.js +1 -1
- package/select/index.es.js +135 -53
- package/select/index.umd.js +1 -1
- package/slider/index.es.js +165 -155
- package/slider/index.umd.js +1 -1
- package/steps/index.es.js +1140 -49
- package/steps/index.umd.js +1 -1
- package/switch/index.es.js +2 -0
- package/switch/index.umd.js +1 -1
- package/tabs/index.es.js +31 -5
- package/tabs/index.umd.js +1 -1
- package/tag/index.es.js +53 -35
- package/tag/index.umd.js +1 -1
- package/tooltip/index.es.js +78 -77
- package/tooltip/index.umd.js +1 -1
- package/tree/ccui-cli.css +1 -1
- package/tree/index.es.js +1491 -276
- package/tree/index.umd.js +1 -1
- package/typography/index.es.js +1213 -125
- package/typography/index.umd.js +1 -1
- package/vue-ccui.es.js +8726 -7604
- package/vue-ccui.umd.js +1 -1
- package/zh-cn-C8nbfD5S.js +59 -0
package/slider/index.es.js
CHANGED
|
@@ -33,8 +33,24 @@ function O(e, t = !1) {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
//#endregion
|
|
36
|
+
//#region ../ccui/ui/shared/utils/deprecated.ts
|
|
37
|
+
var k = /* @__PURE__ */ new Set();
|
|
38
|
+
function A() {
|
|
39
|
+
return globalThis.process?.env?.NODE_ENV !== "production";
|
|
40
|
+
}
|
|
41
|
+
function j(e, t, n) {
|
|
42
|
+
if (!A()) return;
|
|
43
|
+
let r = n ? `${n}.${e}` : e;
|
|
44
|
+
if (k.has(r) || (k.add(r), typeof console > "u")) return;
|
|
45
|
+
let i = n ? `[ccui][${n}]` : "[ccui]", a = t ? `,请改用 ${t}` : "";
|
|
46
|
+
console.warn(`${i} ${e} 已 deprecated${a}。`);
|
|
47
|
+
}
|
|
48
|
+
function M(e, t, n) {
|
|
49
|
+
return e ? Object.prototype.hasOwnProperty.call(e, t) || Object.prototype.hasOwnProperty.call(e, n) : !1;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
36
52
|
//#region ../ccui/ui/input-number/src/input-number.tsx
|
|
37
|
-
var
|
|
53
|
+
var N = /* @__PURE__ */ r({
|
|
38
54
|
name: "CInputNumber",
|
|
39
55
|
props: {
|
|
40
56
|
modelValue: {
|
|
@@ -122,61 +138,61 @@ var k = /* @__PURE__ */ r({
|
|
|
122
138
|
lg: "large",
|
|
123
139
|
md: "default",
|
|
124
140
|
sm: "small"
|
|
125
|
-
}, _ =
|
|
141
|
+
}, _ = t(() => {
|
|
126
142
|
let t = e.size;
|
|
127
|
-
return t === "lg" || t === "md" || t === "sm" ? (
|
|
128
|
-
}),
|
|
143
|
+
return t === "lg" || t === "md" || t === "sm" ? (j(`size="${t}"`, g[t], "InputNumber"), g[t]) : t;
|
|
144
|
+
}), v = t(() => m.value === void 0 || m.value === null ? e.allowEmpty ? "" : "0" : e.precision === void 0 ? String(m.value) : Number(m.value).toFixed(e.precision)), y = t(() => m.value === void 0 ? !1 : m.value >= e.max), b = t(() => m.value === void 0 ? !1 : m.value <= e.min), x = (t) => {
|
|
129
145
|
if (t === "" || t == null) return e.allowEmpty ? void 0 : 0;
|
|
130
146
|
let n = typeof t == "string" ? Number.parseFloat(t) : t;
|
|
131
147
|
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
|
-
},
|
|
148
|
+
}, S = (e, t = !0) => {
|
|
133
149
|
let n = m.value;
|
|
134
150
|
m.value = e, r("update:modelValue", e), r("input", e), t && n !== e && r("change", e, n), l?.validate("change");
|
|
135
|
-
},
|
|
151
|
+
}, C = (t) => {
|
|
136
152
|
let n = t.target, r = n.value;
|
|
137
153
|
if (e.reg && !(typeof e.reg == "string" ? new RegExp(e.reg) : e.reg).test(r)) {
|
|
138
|
-
n.value =
|
|
154
|
+
n.value = v.value;
|
|
139
155
|
return;
|
|
140
156
|
}
|
|
141
157
|
if (r === "") {
|
|
142
|
-
e.allowEmpty ?
|
|
158
|
+
e.allowEmpty ? S(void 0, !1) : n.value = v.value;
|
|
143
159
|
return;
|
|
144
160
|
}
|
|
145
|
-
|
|
146
|
-
},
|
|
161
|
+
S(x(r), !1);
|
|
162
|
+
}, w = (e) => {
|
|
147
163
|
let t = e.target;
|
|
148
|
-
|
|
149
|
-
c.value && (c.value.value =
|
|
164
|
+
S(x(t.value)), s(() => {
|
|
165
|
+
c.value && (c.value.value = v.value);
|
|
150
166
|
});
|
|
151
|
-
},
|
|
167
|
+
}, T = (e) => {
|
|
152
168
|
h.value = !0, r("focus", e);
|
|
153
|
-
},
|
|
154
|
-
h.value = !1, r("blur", e), c.value && (c.value.value =
|
|
169
|
+
}, D = (e) => {
|
|
170
|
+
h.value = !1, r("blur", e), c.value && (c.value.value = v.value), l?.validate("blur");
|
|
171
|
+
}, k = () => {
|
|
172
|
+
e.disabled || y.value || S(x((m.value ?? 0) + e.step));
|
|
155
173
|
}, A = () => {
|
|
156
|
-
e.disabled || b.value ||
|
|
157
|
-
}, j = () => {
|
|
158
|
-
e.disabled || x.value || C(S((m.value ?? 0) - e.step));
|
|
174
|
+
e.disabled || b.value || S(x((m.value ?? 0) - e.step));
|
|
159
175
|
}, M = (t) => {
|
|
160
176
|
if (!(e.disabled || e.readonly)) switch (t.key) {
|
|
161
177
|
case "ArrowUp":
|
|
162
|
-
t.preventDefault(),
|
|
178
|
+
t.preventDefault(), k();
|
|
163
179
|
break;
|
|
164
180
|
case "ArrowDown":
|
|
165
|
-
t.preventDefault(),
|
|
181
|
+
t.preventDefault(), A();
|
|
166
182
|
break;
|
|
167
183
|
}
|
|
168
184
|
};
|
|
169
185
|
return i({
|
|
170
186
|
getValue: () => m.value,
|
|
171
|
-
setValue: (e) =>
|
|
187
|
+
setValue: (e) => S(e),
|
|
172
188
|
focus: () => {
|
|
173
189
|
c.value?.focus();
|
|
174
190
|
},
|
|
175
191
|
blur: () => {
|
|
176
192
|
c.value?.blur();
|
|
177
193
|
},
|
|
178
|
-
increase:
|
|
179
|
-
decrease:
|
|
194
|
+
increase: k,
|
|
195
|
+
decrease: A
|
|
180
196
|
}), f(() => e.modelValue, (e) => {
|
|
181
197
|
e !== m.value && (m.value = e);
|
|
182
198
|
}, { immediate: !0 }), () => {
|
|
@@ -189,7 +205,7 @@ var k = /* @__PURE__ */ r({
|
|
|
189
205
|
[o.m("readonly")]: e.readonly,
|
|
190
206
|
[o.m("without-controls")]: !e.controls,
|
|
191
207
|
[o.m("controls-right")]: t,
|
|
192
|
-
[o.m(
|
|
208
|
+
[o.m(_.value)]: _.value !== "default",
|
|
193
209
|
[o.m("focused")]: h.value,
|
|
194
210
|
[o.m("glow")]: e.showGlowStyle && h.value,
|
|
195
211
|
[o.m(`variant-${e.variant}`)]: !!e.variant,
|
|
@@ -200,9 +216,9 @@ var k = /* @__PURE__ */ r({
|
|
|
200
216
|
style: e.styles?.root
|
|
201
217
|
}, [
|
|
202
218
|
e.controls && !t && n("span", {
|
|
203
|
-
class: [o.e("decrease"), { [o.is("disabled")]:
|
|
219
|
+
class: [o.e("decrease"), { [o.is("disabled")]: b.value || e.disabled }],
|
|
204
220
|
role: "button",
|
|
205
|
-
onClick:
|
|
221
|
+
onClick: A
|
|
206
222
|
}, [n("svg", {
|
|
207
223
|
viewBox: "0 0 1024 1024",
|
|
208
224
|
width: "1em",
|
|
@@ -216,22 +232,29 @@ var k = /* @__PURE__ */ r({
|
|
|
216
232
|
type: "number",
|
|
217
233
|
step: e.step,
|
|
218
234
|
class: o.e("inner"),
|
|
219
|
-
value:
|
|
235
|
+
value: v.value,
|
|
220
236
|
placeholder: e.placeholder,
|
|
221
237
|
disabled: e.disabled,
|
|
222
238
|
readonly: e.readonly,
|
|
223
239
|
min: e.min,
|
|
224
240
|
max: e.max,
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
241
|
+
role: "spinbutton",
|
|
242
|
+
"aria-valuenow": m.value ?? void 0,
|
|
243
|
+
"aria-valuemin": e.min,
|
|
244
|
+
"aria-valuemax": e.max,
|
|
245
|
+
"aria-disabled": e.disabled ? !0 : void 0,
|
|
246
|
+
"aria-readonly": e.readonly ? !0 : void 0,
|
|
247
|
+
"aria-invalid": p.value === "error" ? !0 : void 0,
|
|
248
|
+
onInput: C,
|
|
249
|
+
onChange: w,
|
|
250
|
+
onFocus: T,
|
|
251
|
+
onBlur: D,
|
|
229
252
|
onKeydown: M
|
|
230
253
|
}, null)]),
|
|
231
254
|
e.controls && !t && n("span", {
|
|
232
|
-
class: [o.e("increase"), { [o.is("disabled")]:
|
|
255
|
+
class: [o.e("increase"), { [o.is("disabled")]: y.value || e.disabled }],
|
|
233
256
|
role: "button",
|
|
234
|
-
onClick:
|
|
257
|
+
onClick: k
|
|
235
258
|
}, [n("svg", {
|
|
236
259
|
viewBox: "0 0 1024 1024",
|
|
237
260
|
width: "1em",
|
|
@@ -241,17 +264,17 @@ var k = /* @__PURE__ */ r({
|
|
|
241
264
|
class: [o.e("controls"), e.classNames?.controls],
|
|
242
265
|
style: e.styles?.controls
|
|
243
266
|
}, [n("span", {
|
|
244
|
-
class: [o.e("increase"), { [o.is("disabled")]:
|
|
267
|
+
class: [o.e("increase"), { [o.is("disabled")]: y.value || e.disabled }],
|
|
245
268
|
role: "button",
|
|
246
|
-
onClick:
|
|
269
|
+
onClick: k
|
|
247
270
|
}, [n("svg", {
|
|
248
271
|
viewBox: "0 0 1024 1024",
|
|
249
272
|
width: "1em",
|
|
250
273
|
height: "1em"
|
|
251
274
|
}, [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")]:
|
|
275
|
+
class: [o.e("decrease"), { [o.is("disabled")]: b.value || e.disabled }],
|
|
253
276
|
role: "button",
|
|
254
|
-
onClick:
|
|
277
|
+
onClick: A
|
|
255
278
|
}, [n("svg", {
|
|
256
279
|
viewBox: "0 0 1024 1024",
|
|
257
280
|
width: "1em",
|
|
@@ -263,42 +286,42 @@ var k = /* @__PURE__ */ r({
|
|
|
263
286
|
});
|
|
264
287
|
//#endregion
|
|
265
288
|
//#region ../ccui/ui/input-number/index.ts
|
|
266
|
-
|
|
267
|
-
e.component(
|
|
289
|
+
N.install = function(e) {
|
|
290
|
+
e.component(N.name, N);
|
|
268
291
|
};
|
|
269
292
|
//#endregion
|
|
270
293
|
//#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
271
|
-
function
|
|
294
|
+
function P() {
|
|
272
295
|
return typeof window < "u";
|
|
273
296
|
}
|
|
274
|
-
function
|
|
275
|
-
return
|
|
297
|
+
function F(e) {
|
|
298
|
+
return L(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
276
299
|
}
|
|
277
|
-
function
|
|
300
|
+
function I(e) {
|
|
278
301
|
var t;
|
|
279
302
|
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
280
303
|
}
|
|
281
|
-
function
|
|
282
|
-
return
|
|
304
|
+
function L(e) {
|
|
305
|
+
return P() ? e instanceof Node || e instanceof I(e).Node : !1;
|
|
283
306
|
}
|
|
284
307
|
//#endregion
|
|
285
308
|
//#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
|
|
309
|
+
var R = /* @__PURE__ */ C({
|
|
287
310
|
Vue: () => e,
|
|
288
311
|
Vue2: () => void 0,
|
|
289
|
-
del: () =>
|
|
290
|
-
install: () =>
|
|
312
|
+
del: () => ee,
|
|
313
|
+
install: () => B,
|
|
291
314
|
isVue2: () => !1,
|
|
292
315
|
isVue3: () => !0,
|
|
293
|
-
set: () =>
|
|
316
|
+
set: () => V
|
|
294
317
|
});
|
|
295
|
-
import * as
|
|
296
|
-
T(
|
|
297
|
-
function
|
|
298
|
-
function
|
|
318
|
+
import * as z from "vue";
|
|
319
|
+
T(R, z);
|
|
320
|
+
function B() {}
|
|
321
|
+
function V(e, t, n) {
|
|
299
322
|
return Array.isArray(e) ? (e.length = Math.max(e.length, t), e.splice(t, 1, n), n) : (e[t] = n, n);
|
|
300
323
|
}
|
|
301
|
-
function
|
|
324
|
+
function ee(e, t) {
|
|
302
325
|
if (Array.isArray(e)) {
|
|
303
326
|
e.splice(t, 1);
|
|
304
327
|
return;
|
|
@@ -307,25 +330,25 @@ function R(e, t) {
|
|
|
307
330
|
}
|
|
308
331
|
//#endregion
|
|
309
332
|
//#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
|
|
333
|
+
function H(e) {
|
|
311
334
|
return typeof e == "object" && !!e && "$el" in e;
|
|
312
335
|
}
|
|
313
|
-
function
|
|
314
|
-
if (
|
|
336
|
+
function U(e) {
|
|
337
|
+
if (H(e)) {
|
|
315
338
|
let t = e.$el;
|
|
316
|
-
return
|
|
339
|
+
return L(t) && F(t) === "#comment" ? null : t;
|
|
317
340
|
}
|
|
318
341
|
return e;
|
|
319
342
|
}
|
|
320
|
-
function
|
|
321
|
-
return typeof e == "function" ? e() : (0,
|
|
343
|
+
function W(e) {
|
|
344
|
+
return typeof e == "function" ? e() : (0, R.unref)(e);
|
|
322
345
|
}
|
|
323
|
-
function
|
|
346
|
+
function te(e) {
|
|
324
347
|
return {
|
|
325
348
|
name: "arrow",
|
|
326
349
|
options: e,
|
|
327
350
|
fn(t) {
|
|
328
|
-
let n =
|
|
351
|
+
let n = U(W(e.element));
|
|
329
352
|
return n == null ? {} : p({
|
|
330
353
|
element: n,
|
|
331
354
|
padding: e.padding
|
|
@@ -333,27 +356,27 @@ function ee(e) {
|
|
|
333
356
|
}
|
|
334
357
|
};
|
|
335
358
|
}
|
|
336
|
-
function
|
|
359
|
+
function G(e) {
|
|
337
360
|
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
338
361
|
}
|
|
339
|
-
function
|
|
340
|
-
let n =
|
|
362
|
+
function K(e, t) {
|
|
363
|
+
let n = G(e);
|
|
341
364
|
return Math.round(t * n) / n;
|
|
342
365
|
}
|
|
343
|
-
function
|
|
366
|
+
function ne(e, t, n) {
|
|
344
367
|
n === void 0 && (n = {});
|
|
345
|
-
let r = n.whileElementsMounted, i = (0,
|
|
368
|
+
let r = n.whileElementsMounted, i = (0, R.computed)(() => W(n.open) ?? !0), a = (0, R.computed)(() => W(n.middleware)), o = (0, R.computed)(() => W(n.placement) ?? "bottom"), s = (0, R.computed)(() => W(n.strategy) ?? "absolute"), c = (0, R.computed)(() => W(n.transform) ?? !0), l = (0, R.computed)(() => U(e.value)), u = (0, R.computed)(() => U(t.value)), d = (0, R.ref)(0), f = (0, R.ref)(0), p = (0, R.ref)(s.value), m = (0, R.ref)(o.value), g = (0, R.shallowRef)({}), _ = (0, R.ref)(!1), v = (0, R.computed)(() => {
|
|
346
369
|
let e = {
|
|
347
370
|
position: p.value,
|
|
348
371
|
left: "0",
|
|
349
372
|
top: "0"
|
|
350
373
|
};
|
|
351
374
|
if (!u.value) return e;
|
|
352
|
-
let t =
|
|
375
|
+
let t = K(u.value, d.value), n = K(u.value, f.value);
|
|
353
376
|
return c.value ? {
|
|
354
377
|
...e,
|
|
355
378
|
transform: "translate(" + t + "px, " + n + "px)",
|
|
356
|
-
...
|
|
379
|
+
...G(u.value) >= 1.5 && { willChange: "transform" }
|
|
357
380
|
} : {
|
|
358
381
|
position: p.value,
|
|
359
382
|
left: t + "px",
|
|
@@ -387,33 +410,23 @@ function te(e, t, n) {
|
|
|
387
410
|
function C() {
|
|
388
411
|
i.value || (_.value = !1);
|
|
389
412
|
}
|
|
390
|
-
return (0,
|
|
413
|
+
return (0, R.watch)([
|
|
391
414
|
a,
|
|
392
415
|
o,
|
|
393
416
|
s,
|
|
394
417
|
i
|
|
395
|
-
], b, { flush: "sync" }), (0,
|
|
396
|
-
x: (0,
|
|
397
|
-
y: (0,
|
|
398
|
-
strategy: (0,
|
|
399
|
-
placement: (0,
|
|
400
|
-
middlewareData: (0,
|
|
401
|
-
isPositioned: (0,
|
|
418
|
+
], b, { flush: "sync" }), (0, R.watch)([l, u], S, { flush: "sync" }), (0, R.watch)(i, C, { flush: "sync" }), (0, R.getCurrentScope)() && (0, R.onScopeDispose)(x), {
|
|
419
|
+
x: (0, R.shallowReadonly)(d),
|
|
420
|
+
y: (0, R.shallowReadonly)(f),
|
|
421
|
+
strategy: (0, R.shallowReadonly)(p),
|
|
422
|
+
placement: (0, R.shallowReadonly)(m),
|
|
423
|
+
middlewareData: (0, R.shallowReadonly)(g),
|
|
424
|
+
isPositioned: (0, R.shallowReadonly)(_),
|
|
402
425
|
floatingStyles: v,
|
|
403
426
|
update: b
|
|
404
427
|
};
|
|
405
428
|
}
|
|
406
429
|
//#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
430
|
//#region ../ccui/ui/tooltip/src/tooltip-types.ts
|
|
418
431
|
var q = {
|
|
419
432
|
content: {
|
|
@@ -440,10 +453,6 @@ var q = {
|
|
|
440
453
|
type: Boolean,
|
|
441
454
|
default: void 0
|
|
442
455
|
},
|
|
443
|
-
open: {
|
|
444
|
-
type: Boolean,
|
|
445
|
-
default: void 0
|
|
446
|
-
},
|
|
447
456
|
disabled: {
|
|
448
457
|
type: Boolean,
|
|
449
458
|
default: !1
|
|
@@ -523,10 +532,10 @@ var q = {
|
|
|
523
532
|
};
|
|
524
533
|
//#endregion
|
|
525
534
|
//#region ../ccui/ui/tooltip/src/tooltip.tsx
|
|
526
|
-
function
|
|
535
|
+
function re(e) {
|
|
527
536
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
528
537
|
}
|
|
529
|
-
var J = /* @__PURE__ */ r({
|
|
538
|
+
var ie = 0, J = /* @__PURE__ */ r({
|
|
530
539
|
name: "CTooltip",
|
|
531
540
|
props: q,
|
|
532
541
|
emits: [
|
|
@@ -534,29 +543,28 @@ var J = /* @__PURE__ */ r({
|
|
|
534
543
|
"show",
|
|
535
544
|
"before-hide",
|
|
536
545
|
"hide",
|
|
537
|
-
"update:visible"
|
|
538
|
-
"update:open"
|
|
546
|
+
"update:visible"
|
|
539
547
|
],
|
|
540
548
|
setup(e, { emit: r, slots: a }) {
|
|
541
|
-
let c = O("tooltip"), p = i()?.vnode.props;
|
|
542
|
-
|
|
543
|
-
let
|
|
549
|
+
let c = O("tooltip"), p = `${c.e("popper")}-${++ie}`, h = i()?.vnode.props;
|
|
550
|
+
M(h, "content", "content") && j("content", "title", "Tooltip"), M(h, "showArrow", "show-arrow") && j("showArrow", "arrow", "Tooltip"), M(h, "showAfter", "show-after") && j("showAfter", "mouseEnterDelay", "Tooltip"), M(h, "hideAfter", "hide-after") && j("hideAfter", "mouseLeaveDelay", "Tooltip"), M(h, "popperClass", "popper-class") && j("popperClass", "overlayClassName", "Tooltip");
|
|
551
|
+
let y = t(() => e.visible), b = t(() => y.value !== void 0), x = d(!1), S = d(), C = d(), w = d(), T = d(), E = d(), D = t(() => b.value ? y.value : x.value), k = t(() => e.mouseEnterDelay === void 0 ? e.showAfter : e.mouseEnterDelay), A = t(() => e.mouseLeaveDelay === void 0 ? e.hideAfter : e.mouseLeaveDelay), N = t(() => e.arrow === void 0 ? e.showArrow : typeof e.arrow == "boolean" ? e.arrow : !0), P = t(() => re(e.arrow) ? !!e.arrow.pointAtCenter : !1), F = t(() => e.overlayClassName || e.popperClass), I = t(() => e.title || e.content), L = t(() => e.color ? { backgroundColor: e.color } : {}), R = t(() => [
|
|
544
552
|
c.e("popper"),
|
|
545
553
|
c.em("popper", e.effect),
|
|
546
554
|
c.em("popper", e.placement.split("-")[0]),
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
].filter(Boolean).join(" ")), { floatingStyles:
|
|
555
|
+
P.value && c.em("popper", "arrow-center"),
|
|
556
|
+
F.value
|
|
557
|
+
].filter(Boolean).join(" ")), { floatingStyles: z, middlewareData: B, update: V } = ne(S, C, {
|
|
550
558
|
placement: e.placement,
|
|
551
559
|
middleware: [
|
|
552
560
|
_(e.offset),
|
|
553
561
|
...e.autoAdjustOverflow ? [g()] : [],
|
|
554
562
|
v({ padding: 8 }),
|
|
555
|
-
...
|
|
563
|
+
...N.value ? [te({ element: w })] : []
|
|
556
564
|
]
|
|
557
|
-
}),
|
|
558
|
-
if (!
|
|
559
|
-
let { x: t, y: n } =
|
|
565
|
+
}), ee = t(() => {
|
|
566
|
+
if (!N.value || !B.value.arrow) return {};
|
|
567
|
+
let { x: t, y: n } = B.value.arrow, r = {
|
|
560
568
|
top: "bottom",
|
|
561
569
|
right: "left",
|
|
562
570
|
bottom: "top",
|
|
@@ -569,74 +577,74 @@ var J = /* @__PURE__ */ r({
|
|
|
569
577
|
bottom: "",
|
|
570
578
|
[r]: "-4px"
|
|
571
579
|
};
|
|
572
|
-
}),
|
|
573
|
-
|
|
574
|
-
},
|
|
580
|
+
}), H = () => {
|
|
581
|
+
T.value &&= (clearTimeout(T.value), void 0), E.value &&= (clearTimeout(E.value), void 0);
|
|
582
|
+
}, U = () => {
|
|
575
583
|
if (e.disabled) return;
|
|
576
|
-
|
|
584
|
+
H();
|
|
577
585
|
let t = () => {
|
|
578
|
-
r("before-show"),
|
|
579
|
-
|
|
586
|
+
r("before-show"), b.value || (x.value = !0), r("update:visible", !0), s(() => {
|
|
587
|
+
V(), r("show");
|
|
580
588
|
});
|
|
581
589
|
};
|
|
582
|
-
|
|
583
|
-
},
|
|
584
|
-
|
|
590
|
+
k.value > 0 ? T.value = window.setTimeout(t, k.value) : t();
|
|
591
|
+
}, W = () => {
|
|
592
|
+
H();
|
|
585
593
|
let t = () => {
|
|
586
|
-
r("before-hide"),
|
|
594
|
+
r("before-hide"), b.value || (x.value = !1), r("update:visible", !1), r("hide");
|
|
587
595
|
};
|
|
588
|
-
|
|
589
|
-
},
|
|
590
|
-
e.trigger === "hover" &&
|
|
591
|
-
},
|
|
592
|
-
e.trigger === "hover" &&
|
|
596
|
+
A.value > 0 && e.trigger !== "click" ? E.value = window.setTimeout(t, A.value) : t();
|
|
597
|
+
}, G = () => {
|
|
598
|
+
e.trigger === "hover" && U();
|
|
599
|
+
}, K = () => {
|
|
600
|
+
e.trigger === "hover" && W();
|
|
593
601
|
}, q = () => {
|
|
594
|
-
e.trigger === "click" && (
|
|
602
|
+
e.trigger === "click" && (D.value ? W() : U());
|
|
595
603
|
}, J = () => {
|
|
596
|
-
e.trigger === "focus" &&
|
|
604
|
+
e.trigger === "focus" && U();
|
|
597
605
|
}, Y = () => {
|
|
598
|
-
e.trigger === "focus" &&
|
|
606
|
+
e.trigger === "focus" && W();
|
|
599
607
|
}, X = () => {
|
|
600
|
-
e.trigger === "hover" && e.enterable && B();
|
|
601
|
-
}, Z = () => {
|
|
602
608
|
e.trigger === "hover" && e.enterable && H();
|
|
609
|
+
}, Z = () => {
|
|
610
|
+
e.trigger === "hover" && e.enterable && W();
|
|
603
611
|
}, Q;
|
|
604
612
|
l(() => {
|
|
605
|
-
|
|
613
|
+
D.value && S.value && C.value && (Q = m(S.value, C.value, V));
|
|
606
614
|
}), u(() => {
|
|
607
|
-
|
|
608
|
-
}), f(
|
|
609
|
-
e !== void 0 && e && s(() =>
|
|
610
|
-
}), f(
|
|
611
|
-
e &&
|
|
615
|
+
H(), Q?.();
|
|
616
|
+
}), f(y, (e) => {
|
|
617
|
+
e !== void 0 && e && s(() => V());
|
|
618
|
+
}), f(D, (e) => {
|
|
619
|
+
e && S.value && C.value ? (Q?.(), Q = m(S.value, C.value, V)) : Q?.();
|
|
612
620
|
});
|
|
613
|
-
let
|
|
614
|
-
ref:
|
|
621
|
+
let ae = () => N.value ? n("div", {
|
|
622
|
+
ref: w,
|
|
615
623
|
class: [c.e("arrow"), c.em("arrow", e.placement.split("-")[0])].join(" "),
|
|
616
|
-
style:
|
|
617
|
-
}, null) : null,
|
|
624
|
+
style: ee.value
|
|
625
|
+
}, null) : null, oe = () => a.title ? a.title() : a.content ? a.content() : e.rawContent ? n("div", { innerHTML: I.value }, null) : I.value;
|
|
618
626
|
return () => {
|
|
619
627
|
let t = {};
|
|
620
|
-
return e.trigger === "hover" ? (t.onMouseenter =
|
|
621
|
-
ref:
|
|
628
|
+
return e.trigger === "hover" ? (t.onMouseenter = G, t.onMouseleave = K) : e.trigger === "click" ? t.onClick = q : e.trigger === "focus" && (t.onFocus = J, t.onBlur = Y), n("div", { class: c.b() }, [n("div", o({
|
|
629
|
+
ref: S,
|
|
622
630
|
class: c.e("trigger"),
|
|
623
|
-
"aria-describedby":
|
|
631
|
+
"aria-describedby": D.value ? p : void 0,
|
|
624
632
|
"aria-label": e.ariaLabel,
|
|
625
633
|
tabindex: e.trigger === "focus" ? 0 : void 0
|
|
626
|
-
}, t), [a.default?.()]),
|
|
627
|
-
ref:
|
|
628
|
-
class:
|
|
634
|
+
}, t), [a.default?.()]), D.value && n("div", {
|
|
635
|
+
ref: C,
|
|
636
|
+
class: R.value,
|
|
629
637
|
role: "tooltip",
|
|
630
|
-
id:
|
|
638
|
+
id: p,
|
|
631
639
|
style: {
|
|
632
|
-
...
|
|
633
|
-
...
|
|
640
|
+
...z.value,
|
|
641
|
+
...L.value,
|
|
634
642
|
zIndex: 2e3,
|
|
635
643
|
pointerEvents: e.enterable ? "auto" : "none"
|
|
636
644
|
},
|
|
637
645
|
onMouseenter: X,
|
|
638
646
|
onMouseleave: Z
|
|
639
|
-
}, [
|
|
647
|
+
}, [ae(), n("div", { class: c.e("content") }, [oe()])])]);
|
|
640
648
|
};
|
|
641
649
|
}
|
|
642
650
|
});
|
|
@@ -739,7 +747,7 @@ function Q(e, t, n, r, i) {
|
|
|
739
747
|
}
|
|
740
748
|
};
|
|
741
749
|
}
|
|
742
|
-
function
|
|
750
|
+
function ae(e, t, n) {
|
|
743
751
|
return { handleKeydown: (r, i) => {
|
|
744
752
|
if (e.disabled) return;
|
|
745
753
|
let a = 0;
|
|
@@ -770,7 +778,7 @@ function re(e, t, n) {
|
|
|
770
778
|
n("change", t.value), n("change-complete", t.value);
|
|
771
779
|
} };
|
|
772
780
|
}
|
|
773
|
-
function
|
|
781
|
+
function oe(e, n) {
|
|
774
782
|
let r = t(() => {
|
|
775
783
|
if (!e.marks) return {};
|
|
776
784
|
let t = {};
|
|
@@ -794,7 +802,7 @@ function ie(e, n) {
|
|
|
794
802
|
}
|
|
795
803
|
};
|
|
796
804
|
}
|
|
797
|
-
function
|
|
805
|
+
function se(e, t, n) {
|
|
798
806
|
return { handleInputChange: (r, i) => {
|
|
799
807
|
if (r == null) return;
|
|
800
808
|
let a = Math.max(e.min, Math.min(e.max, r));
|
|
@@ -807,7 +815,7 @@ function ae(e, t, n) {
|
|
|
807
815
|
}
|
|
808
816
|
//#endregion
|
|
809
817
|
//#region ../ccui/ui/slider/src/composables/use-slider-tooltip.ts
|
|
810
|
-
function
|
|
818
|
+
function ce(e, n, r) {
|
|
811
819
|
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
820
|
e.disabled || (i.value = !0, a.value = t);
|
|
813
821
|
}, f = () => {
|
|
@@ -928,7 +936,7 @@ var $ = /* @__PURE__ */ r({
|
|
|
928
936
|
"input"
|
|
929
937
|
],
|
|
930
938
|
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 } =
|
|
939
|
+
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 } = ae(e, a, t), { marks: b, getMarkStyle: x, getMarkLabel: S } = oe(e, o), { handleInputChange: C } = se(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 } = ce(e, m, a);
|
|
932
940
|
return c(() => {
|
|
933
941
|
v();
|
|
934
942
|
}), u(() => {
|
|
@@ -976,7 +984,8 @@ var $ = /* @__PURE__ */ r({
|
|
|
976
984
|
"aria-valuemax": e.max,
|
|
977
985
|
"aria-valuenow": i,
|
|
978
986
|
"aria-valuetext": E(i),
|
|
979
|
-
"aria-orientation": e.vertical ? "vertical" : "horizontal"
|
|
987
|
+
"aria-orientation": e.vertical ? "vertical" : "horizontal",
|
|
988
|
+
"aria-disabled": e.disabled ? !0 : void 0
|
|
980
989
|
};
|
|
981
990
|
return e.showTooltip ? n(J, {
|
|
982
991
|
content: N(t),
|
|
@@ -1000,8 +1009,9 @@ var $ = /* @__PURE__ */ r({
|
|
|
1000
1009
|
[this.ns.m(this.size)]: this.size !== "default"
|
|
1001
1010
|
}],
|
|
1002
1011
|
style: this.vertical ? { height: this.height } : {},
|
|
1003
|
-
"aria-label": this.label || this.ariaLabel
|
|
1004
|
-
|
|
1012
|
+
"aria-label": this.label || this.ariaLabel,
|
|
1013
|
+
"aria-disabled": this.disabled ? !0 : void 0
|
|
1014
|
+
}, [this.showInput && !this.range && n("div", { class: this.ns.e("input") }, [n(N, {
|
|
1005
1015
|
modelValue: this.currentValue,
|
|
1006
1016
|
min: this.min,
|
|
1007
1017
|
max: this.max,
|
|
@@ -1059,7 +1069,7 @@ var $ = /* @__PURE__ */ r({
|
|
|
1059
1069
|
$.install = function(e) {
|
|
1060
1070
|
e.component($.name, $);
|
|
1061
1071
|
};
|
|
1062
|
-
var
|
|
1072
|
+
var le = {
|
|
1063
1073
|
title: "Slider 滑块",
|
|
1064
1074
|
category: "数据录入",
|
|
1065
1075
|
status: "100%",
|
|
@@ -1068,4 +1078,4 @@ var se = {
|
|
|
1068
1078
|
}
|
|
1069
1079
|
};
|
|
1070
1080
|
//#endregion
|
|
1071
|
-
export { $ as Slider,
|
|
1081
|
+
export { $ as Slider, le as default };
|