@king-one/antdv 1.0.74 → 1.0.76
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/CHANGELOG.md +12 -0
- package/dist/es/components/collapse-transtion/src/collapse-transtion.vue2.mjs +2 -2
- package/dist/es/components/form/component/form-item.vue2.mjs +2 -2
- package/dist/es/components/form/component/form.vue2.mjs +2 -2
- package/dist/es/components/icon/src/icon.vue2.mjs +4 -4
- package/dist/es/components/pro-area/src/ProArea.vue2.mjs +8 -8
- package/dist/es/components/pro-modal/src/ProModal.vue2.mjs +13 -13
- package/dist/es/components/pro-picker/src/ProPicker.vue2.mjs +3 -3
- package/dist/es/components/pro-signature/src/ProSignature.vue2.mjs +4 -4
- package/dist/es/components/pro-tag/src/ProTag.vue2.mjs +7 -7
- package/dist/es/components/pro-title/src/ProTitle.vue2.mjs +7 -7
- package/dist/es/components/scale-virtual-list/component/scale-virtual-list.vue2.mjs +4 -4
- package/dist/es/components/scale-virtual-list/hooks/useVirtualList.mjs +28 -25
- package/dist/es/components/scroll-bar/src/scroll-bar.mjs +6 -6
- package/dist/lib/components/scale-virtual-list/hooks/useVirtualList.js +1 -1
- package/dist/lib/components/scroll-bar/src/scroll-bar.js +1 -1
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/types/components/collapse-transtion/index.d.ts +5 -10
- package/dist/types/components/collapse-transtion/src/collapse-transtion.vue.d.ts +6 -5
- package/dist/types/components/form/component/form-item.vue.d.ts +6 -5
- package/dist/types/components/form/component/form.vue.d.ts +4 -3
- package/dist/types/components/form/index.d.ts +8 -14
- package/dist/types/components/icon/index.d.ts +5 -5
- package/dist/types/components/icon/src/icon.vue.d.ts +5 -5
- package/dist/types/components/pro-area/hooks/use-pro-area.d.ts +1 -1
- package/dist/types/components/pro-area/index.d.ts +9 -9
- package/dist/types/components/pro-area/src/ProArea.vue.d.ts +9 -9
- package/dist/types/components/pro-modal/hooks/useProModal.d.ts +1 -1
- package/dist/types/components/pro-modal/index.d.ts +17 -33
- package/dist/types/components/pro-modal/src/Modal.d.ts +5 -5
- package/dist/types/components/pro-modal/src/ProModal.vue.d.ts +11 -8
- package/dist/types/components/pro-picker/index.d.ts +9 -8
- package/dist/types/components/pro-picker/src/ProPicker.vue.d.ts +9 -8
- package/dist/types/components/pro-signature/index.d.ts +9 -7
- package/dist/types/components/pro-signature/src/ProSignature.vue.d.ts +9 -7
- package/dist/types/components/pro-tag/index.d.ts +7 -7
- package/dist/types/components/pro-tag/src/ProTag.vue.d.ts +7 -7
- package/dist/types/components/pro-title/index.d.ts +7 -24
- package/dist/types/components/pro-title/src/ProTitle.vue.d.ts +7 -6
- package/dist/types/components/scale-virtual-list/component/scale-virtual-list.vue.d.ts +12 -30
- package/dist/types/components/scale-virtual-list/index.d.ts +21 -73
- package/dist/types/components/scroll-bar/index.d.ts +12 -12
- package/dist/types/components/scroll-bar/src/scroll-bar.d.ts +12 -12
- package/dist/types/hooks/useProForm.d.ts +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as a,
|
|
1
|
+
import { defineComponent as a, createBlock as s, openBlock as p, Transition as i, mergeProps as l, unref as o, toHandlers as m, withCtx as c, renderSlot as f } from "vue";
|
|
2
2
|
import { defaultNamespace as r } from "../../../hooks/use-namespace/index.mjs";
|
|
3
3
|
import { useCollapseTranstion as u } from "../hooks/use-collapse-transtion.mjs";
|
|
4
4
|
import { collapseProps as d } from "./types.mjs";
|
|
@@ -8,7 +8,7 @@ const z = /* @__PURE__ */ a({
|
|
|
8
8
|
props: d,
|
|
9
9
|
setup(t) {
|
|
10
10
|
const n = u(t);
|
|
11
|
-
return (e, h) => (
|
|
11
|
+
return (e, h) => (p(), s(i, l({
|
|
12
12
|
name: e.mode === "horizontal" ? `${o(r)}-horizontal-transition` : `${o(r)}-vertical-transition`
|
|
13
13
|
}, m(o(n))), {
|
|
14
14
|
default: c(() => [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as p, computed as f, ref as d, toRaw as u,
|
|
1
|
+
import { defineComponent as p, computed as f, ref as d, toRaw as u, createElementBlock as v, openBlock as g, normalizeClass as e, createElementVNode as r, unref as s, renderSlot as _, toDisplayString as b } from "vue";
|
|
2
2
|
import { useNamespace as I } from "../../../hooks/use-namespace/index.mjs";
|
|
3
3
|
import { useProvideFormItem as k } from "../content/form-content.mjs";
|
|
4
4
|
import { formItemProps as y } from "./form.mjs";
|
|
@@ -10,7 +10,7 @@ const P = /* @__PURE__ */ p({
|
|
|
10
10
|
const l = a, { b: m, e: o } = I("form-item"), n = f(() => [m()]), c = async (t) => {
|
|
11
11
|
console.log("trigger", t);
|
|
12
12
|
}, i = d("请输入姓名");
|
|
13
|
-
return k({ ...u(l), validate: c }), (t, B) => (
|
|
13
|
+
return k({ ...u(l), validate: c }), (t, B) => (g(), v(
|
|
14
14
|
"div",
|
|
15
15
|
{
|
|
16
16
|
class: e(n.value)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as t, computed as m,
|
|
1
|
+
import { defineComponent as t, computed as m, createElementBlock as n, openBlock as s, normalizeClass as a, renderSlot as c } from "vue";
|
|
2
2
|
import { useNamespace as l } from "../../../hooks/use-namespace/index.mjs";
|
|
3
3
|
const d = /* @__PURE__ */ t({
|
|
4
4
|
name: "KForm",
|
|
5
5
|
__name: "form",
|
|
6
6
|
setup(p) {
|
|
7
7
|
const { b: e } = l("form"), o = m(() => [e()]);
|
|
8
|
-
return (r, f) => (
|
|
8
|
+
return (r, f) => (s(), n(
|
|
9
9
|
"form",
|
|
10
10
|
{
|
|
11
11
|
class: a(o.value)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as l, computed as e,
|
|
1
|
+
import { defineComponent as l, computed as e, createElementBlock as a, openBlock as m, normalizeStyle as i, normalizeClass as p } from "vue";
|
|
2
2
|
import { useNamespace as u } from "../../../hooks/use-namespace/index.mjs";
|
|
3
3
|
import { iconProps as f } from "./types.mjs";
|
|
4
4
|
const x = /* @__PURE__ */ l({
|
|
@@ -9,11 +9,11 @@ const x = /* @__PURE__ */ l({
|
|
|
9
9
|
fontSize: `${o.size}px`,
|
|
10
10
|
color: o.color
|
|
11
11
|
})), s = e(() => [c(), t.value]);
|
|
12
|
-
return (_, z) => (
|
|
12
|
+
return (_, z) => (m(), a(
|
|
13
13
|
"i",
|
|
14
14
|
{
|
|
15
|
-
class:
|
|
16
|
-
style:
|
|
15
|
+
class: p(s.value),
|
|
16
|
+
style: i(r.value)
|
|
17
17
|
},
|
|
18
18
|
null,
|
|
19
19
|
6
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as B,
|
|
1
|
+
import { defineComponent as B, useModel as F, computed as u, createBlock as m, openBlock as i, unref as d, withCtx as f, createElementBlock as P, Fragment as w, renderList as y, createVNode as A, normalizeClass as E, mergeModels as I } from "vue";
|
|
2
2
|
import { Form as M, Row as N, Col as k, Select as U } from "ant-design-vue";
|
|
3
3
|
import { useNamespace as j } from "../../../hooks/use-namespace/index.mjs";
|
|
4
4
|
import { ProAreaProps as q } from "./types.mjs";
|
|
5
5
|
const R = /* @__PURE__ */ B({
|
|
6
6
|
name: "ProArea",
|
|
7
7
|
__name: "ProArea",
|
|
8
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ I(q, {
|
|
9
9
|
modelValue: {
|
|
10
10
|
required: !0
|
|
11
11
|
},
|
|
@@ -15,7 +15,7 @@ const R = /* @__PURE__ */ B({
|
|
|
15
15
|
setup(p) {
|
|
16
16
|
const n = p;
|
|
17
17
|
M.useInjectFormItemContext();
|
|
18
|
-
const a =
|
|
18
|
+
const a = F(p, "modelValue"), { b: v } = j("pro-area-select"), h = u(() => (e) => `请选择${e === 1 ? "请选择省份" : e === 2 ? "请选择城市" : "请选择区县"}`), g = u(() => (e) => n.options.length > 0 ? C(e) : []);
|
|
19
19
|
function C(e) {
|
|
20
20
|
var t;
|
|
21
21
|
if (e === 1)
|
|
@@ -67,19 +67,19 @@ const R = /* @__PURE__ */ B({
|
|
|
67
67
|
}
|
|
68
68
|
return (e, t) => (i(), m(d(N), { gutter: 10 }, {
|
|
69
69
|
default: f(() => [
|
|
70
|
-
(i(!0),
|
|
71
|
-
|
|
70
|
+
(i(!0), P(
|
|
71
|
+
w,
|
|
72
72
|
null,
|
|
73
|
-
|
|
73
|
+
y(c.value, (l, o) => (i(), m(d(k), {
|
|
74
74
|
key: l,
|
|
75
75
|
span: 24 / e.level
|
|
76
76
|
}, {
|
|
77
77
|
default: f(() => [
|
|
78
|
-
|
|
78
|
+
A(d(U), {
|
|
79
79
|
value: a.value[l],
|
|
80
80
|
"onUpdate:value": (b) => a.value[l] = b,
|
|
81
81
|
placeholder: h.value(o + 1),
|
|
82
|
-
class:
|
|
82
|
+
class: E(V.value),
|
|
83
83
|
options: g.value(o + 1),
|
|
84
84
|
onChange: () => _(o + 1)
|
|
85
85
|
}, null, 8, ["value", "onUpdate:value", "placeholder", "class", "options", "onChange"])
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as X,
|
|
1
|
+
import { defineComponent as X, ref as e, useModel as Y, computed as y, watch as M, watchEffect as E, createBlock as R, openBlock as b, unref as N, mergeProps as q, createSlots as z, withCtx as r, renderSlot as w, createElementVNode as k, normalizeStyle as O, resolveDynamicComponent as U, toDisplayString as _, mergeModels as P } from "vue";
|
|
2
2
|
import { Modal as j } from "ant-design-vue";
|
|
3
3
|
import { useNamespace as A } from "../../../hooks/use-namespace/index.mjs";
|
|
4
4
|
import { useDraggable as F } from "@vueuse/core";
|
|
@@ -6,13 +6,13 @@ import { ProModalProps as G } from "./types.mjs";
|
|
|
6
6
|
const Q = /* @__PURE__ */ X({
|
|
7
7
|
name: "ProModal",
|
|
8
8
|
__name: "ProModal",
|
|
9
|
-
props: /* @__PURE__ */
|
|
9
|
+
props: /* @__PURE__ */ P(G, {
|
|
10
10
|
modelValue: { required: !0, type: Boolean },
|
|
11
11
|
modelModifiers: {}
|
|
12
12
|
}),
|
|
13
|
-
emits: /* @__PURE__ */
|
|
13
|
+
emits: /* @__PURE__ */ P(["onConfirm", "onCancel"], ["update:modelValue"]),
|
|
14
14
|
setup(B, { emit: D }) {
|
|
15
|
-
const c = D, l = e(null), f = Y(B, "modelValue"), { b: S } = A("pro-modal"), $ =
|
|
15
|
+
const c = D, l = e(null), f = Y(B, "modelValue"), { b: S } = A("pro-modal"), $ = y(() => S());
|
|
16
16
|
function T() {
|
|
17
17
|
c("onConfirm");
|
|
18
18
|
}
|
|
@@ -20,22 +20,22 @@ const Q = /* @__PURE__ */ X({
|
|
|
20
20
|
c("onCancel");
|
|
21
21
|
}
|
|
22
22
|
const { x: s, y: u, isDragging: v } = F(l), p = e(0), g = e(0), n = e(!1), m = e(0), i = e(0), h = e(0), C = e(0), o = e({ left: 0, right: 0, top: 0, bottom: 0 });
|
|
23
|
-
|
|
23
|
+
M([s, u], () => {
|
|
24
24
|
if (!n.value && l.value) {
|
|
25
25
|
p.value = s.value, g.value = u.value;
|
|
26
26
|
const t = document.body.getBoundingClientRect(), a = l.value.getBoundingClientRect();
|
|
27
27
|
o.value.right = t.width - a.width, o.value.bottom = t.height - a.height, h.value = m.value, C.value = i.value;
|
|
28
28
|
}
|
|
29
29
|
n.value = !0;
|
|
30
|
-
}),
|
|
30
|
+
}), M(v, () => {
|
|
31
31
|
v || (n.value = !1);
|
|
32
32
|
}), E(() => {
|
|
33
33
|
n.value && (m.value = h.value + Math.min(Math.max(o.value.left, s.value), o.value.right) - p.value, i.value = C.value + Math.min(Math.max(o.value.top, u.value), o.value.bottom) - g.value);
|
|
34
34
|
});
|
|
35
|
-
const x =
|
|
35
|
+
const x = y(() => ({
|
|
36
36
|
transform: `translate(${m.value}px, ${i.value}px)`
|
|
37
37
|
}));
|
|
38
|
-
return (t, a) => (b(),
|
|
38
|
+
return (t, a) => (b(), R(N(j), q({
|
|
39
39
|
open: f.value,
|
|
40
40
|
"onUpdate:open": a[0] || (a[0] = (d) => f.value = d)
|
|
41
41
|
}, t.modalProps, {
|
|
@@ -51,7 +51,7 @@ const Q = /* @__PURE__ */ X({
|
|
|
51
51
|
ref: l,
|
|
52
52
|
class: "pro-modal-title"
|
|
53
53
|
},
|
|
54
|
-
|
|
54
|
+
_(t.title),
|
|
55
55
|
513
|
|
56
56
|
/* TEXT, NEED_PATCH */
|
|
57
57
|
)
|
|
@@ -60,17 +60,17 @@ const Q = /* @__PURE__ */ X({
|
|
|
60
60
|
k(
|
|
61
61
|
"div",
|
|
62
62
|
{
|
|
63
|
-
style:
|
|
63
|
+
style: O(x.value)
|
|
64
64
|
},
|
|
65
65
|
[
|
|
66
|
-
(b(),
|
|
66
|
+
(b(), R(U(d)))
|
|
67
67
|
],
|
|
68
68
|
4
|
|
69
69
|
/* STYLE */
|
|
70
70
|
)
|
|
71
71
|
]),
|
|
72
72
|
default: r(() => [
|
|
73
|
-
|
|
73
|
+
w(t.$slots, "default")
|
|
74
74
|
]),
|
|
75
75
|
_: 2
|
|
76
76
|
/* DYNAMIC */
|
|
@@ -78,7 +78,7 @@ const Q = /* @__PURE__ */ X({
|
|
|
78
78
|
t.$slots.footer ? {
|
|
79
79
|
name: "footer",
|
|
80
80
|
fn: r(() => [
|
|
81
|
-
|
|
81
|
+
w(t.$slots, "footer")
|
|
82
82
|
]),
|
|
83
83
|
key: "0"
|
|
84
84
|
} : void 0
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as g,
|
|
1
|
+
import { defineComponent as g, useModel as y, reactive as b, watch as P, createBlock as k, openBlock as S, unref as s, createSlots as C, withCtx as w, createVNode as A, mergeModels as d } from "vue";
|
|
2
2
|
import { debounce as M } from "lodash-es";
|
|
3
3
|
import { Select as O, Spin as B } from "ant-design-vue";
|
|
4
4
|
import { proPickerApi as p } from "../apis/pro-picker.api.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { PickerApiEnum as u, ProPickerProps as _ } from "./types.mjs";
|
|
6
6
|
const N = /* @__PURE__ */ g({
|
|
7
7
|
name: "ProPicker",
|
|
8
8
|
__name: "ProPicker",
|
|
@@ -59,7 +59,7 @@ const N = /* @__PURE__ */ g({
|
|
|
59
59
|
function v(e, o) {
|
|
60
60
|
m("change", o);
|
|
61
61
|
}
|
|
62
|
-
return (e, o) => (
|
|
62
|
+
return (e, o) => (S(), k(s(O), {
|
|
63
63
|
value: i.value,
|
|
64
64
|
"onUpdate:value": o[0] || (o[0] = (n) => i.value = n),
|
|
65
65
|
mode: e.mode,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as A, ref as o, computed as k, watch as F, onMounted as N, onBeforeUnmount as $, reactive as H,
|
|
1
|
+
import { defineComponent as A, ref as o, computed as k, watch as F, onMounted as N, onBeforeUnmount as $, reactive as H, createElementBlock as Q, openBlock as G, withModifiers as K, normalizeStyle as V } from "vue";
|
|
2
2
|
import { ProSignatureProps as Z } from "./types.mjs";
|
|
3
3
|
const te = /* @__PURE__ */ A({
|
|
4
4
|
__name: "ProSignature",
|
|
@@ -121,18 +121,18 @@ const te = /* @__PURE__ */ A({
|
|
|
121
121
|
return X({
|
|
122
122
|
generate: U,
|
|
123
123
|
reset: J
|
|
124
|
-
}), (e, l) => (
|
|
124
|
+
}), (e, l) => (G(), Q(
|
|
125
125
|
"canvas",
|
|
126
126
|
{
|
|
127
127
|
ref_key: "canvas",
|
|
128
128
|
ref: a,
|
|
129
|
-
style:
|
|
129
|
+
style: V(O),
|
|
130
130
|
onMousedown: B,
|
|
131
131
|
onMousemove: I,
|
|
132
132
|
onMouseup: E,
|
|
133
133
|
onTouchstartPassive: _,
|
|
134
134
|
onTouchmovePassive: L,
|
|
135
|
-
onTouchend:
|
|
135
|
+
onTouchend: K(W, ["prevent"])
|
|
136
136
|
},
|
|
137
137
|
null,
|
|
138
138
|
36
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as c,
|
|
1
|
+
import { defineComponent as c, useModel as p, computed as s, createBlock as i, openBlock as d, unref as m, withCtx as g, createTextVNode as f, toDisplayString as T, mergeModels as _ } from "vue";
|
|
2
2
|
import { Tag as v } from "ant-design-vue";
|
|
3
3
|
import { proTagProps as x } from "./types.mjs";
|
|
4
4
|
const S = /* @__PURE__ */ c({
|
|
5
5
|
name: "ProTag",
|
|
6
6
|
__name: "ProTag",
|
|
7
|
-
props: /* @__PURE__ */
|
|
7
|
+
props: /* @__PURE__ */ _(x, {
|
|
8
8
|
tag: { type: [String, Number, Boolean], required: !0 },
|
|
9
9
|
tagModifiers: {}
|
|
10
10
|
}),
|
|
11
11
|
emits: ["update:tag"],
|
|
12
12
|
setup(e) {
|
|
13
|
-
const n = e, l =
|
|
13
|
+
const n = e, l = p(e, "tag"), t = s(() => n.options.find((o) => o.value === l.value));
|
|
14
14
|
return (u, o) => {
|
|
15
15
|
var a;
|
|
16
|
-
return d(), m(
|
|
16
|
+
return d(), i(m(v), {
|
|
17
17
|
color: ((a = t.value) == null ? void 0 : a.color) || "default"
|
|
18
18
|
}, {
|
|
19
|
-
default:
|
|
19
|
+
default: g(() => {
|
|
20
20
|
var r;
|
|
21
21
|
return [
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
f(
|
|
23
|
+
T(((r = t.value) == null ? void 0 : r.label) || ""),
|
|
24
24
|
1
|
|
25
25
|
/* TEXT */
|
|
26
26
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as s, computed as i,
|
|
1
|
+
import { defineComponent as s, computed as i, createElementBlock as a, openBlock as c, normalizeClass as m, createVNode as p, createElementVNode as u, renderSlot as f, unref as d, normalizeStyle as z, toDisplayString as S } from "vue";
|
|
2
2
|
import { useNamespace as y } from "../../../hooks/use-namespace/index.mjs";
|
|
3
3
|
import { KIcon as B } from "../../icon/index.mjs";
|
|
4
4
|
import { TitleProps as N } from "./types.mjs";
|
|
@@ -8,28 +8,28 @@ const C = /* @__PURE__ */ s({
|
|
|
8
8
|
props: N,
|
|
9
9
|
setup(r) {
|
|
10
10
|
const t = r, { b: o, m: n } = y("pro-title"), l = i(() => t.unBorder ? [o(), n("unborder")] : [o()]);
|
|
11
|
-
return (e, P) => (
|
|
11
|
+
return (e, P) => (c(), a(
|
|
12
12
|
"div",
|
|
13
13
|
{
|
|
14
14
|
class: m(l.value)
|
|
15
15
|
},
|
|
16
16
|
[
|
|
17
|
-
p(
|
|
17
|
+
p(d(B), {
|
|
18
18
|
name: "title-icon",
|
|
19
19
|
class: "icon",
|
|
20
20
|
size: e.size,
|
|
21
21
|
color: e.color
|
|
22
22
|
}, null, 8, ["size", "color"]),
|
|
23
|
-
|
|
23
|
+
u(
|
|
24
24
|
"span",
|
|
25
25
|
{
|
|
26
|
-
style:
|
|
26
|
+
style: z({ fontSize: `${e.size}px`, color: e.color })
|
|
27
27
|
},
|
|
28
|
-
|
|
28
|
+
S(e.title),
|
|
29
29
|
5
|
|
30
30
|
/* TEXT, STYLE */
|
|
31
31
|
),
|
|
32
|
-
|
|
32
|
+
f(e.$slots, "default")
|
|
33
33
|
],
|
|
34
34
|
2
|
|
35
35
|
/* CLASS */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as h, ref as B, computed as E, toRefs as P,
|
|
1
|
+
import { defineComponent as h, ref as B, computed as E, toRefs as P, createElementBlock as a, openBlock as l, mergeProps as i, unref as e, createElementVNode as p, normalizeStyle as R, normalizeClass as c, Fragment as S, renderList as z, renderSlot as L } from "vue";
|
|
2
2
|
import { defaultNamespace as s } from "../../../hooks/use-namespace/index.mjs";
|
|
3
3
|
import { useElementBounding as T } from "@vueuse/core";
|
|
4
4
|
import { useVirtualList as V } from "../hooks/useVirtualList.mjs";
|
|
@@ -18,7 +18,7 @@ const q = /* @__PURE__ */ h({
|
|
|
18
18
|
scrollTo: k,
|
|
19
19
|
scaleTo: C,
|
|
20
20
|
state: N
|
|
21
|
-
}), g((t) => f("update:state", t)), (t, F) => (
|
|
21
|
+
}), g((t) => f("update:state", t)), (t, F) => (l(), a(
|
|
22
22
|
"div",
|
|
23
23
|
i({
|
|
24
24
|
class: `${e(s)}-scale-virtual-list`
|
|
@@ -39,10 +39,10 @@ const q = /* @__PURE__ */ h({
|
|
|
39
39
|
class: `${e(s)}-scale-vittual-wrapper`
|
|
40
40
|
}),
|
|
41
41
|
[
|
|
42
|
-
(
|
|
42
|
+
(l(!0), a(
|
|
43
43
|
S,
|
|
44
44
|
null,
|
|
45
|
-
z(e(x), (r) => (
|
|
45
|
+
z(e(x), (r) => (l(), a(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
48
|
key: r.index,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createEventHook as
|
|
2
|
-
import { ref as
|
|
1
|
+
import { createEventHook as x } from "@vueuse/shared";
|
|
2
|
+
import { ref as H, shallowRef as _, watch as F, computed as y } from "vue";
|
|
3
3
|
import { useElementSize as X } from "@vueuse/core";
|
|
4
4
|
function I(r, t) {
|
|
5
5
|
const { containerStyle: a, wrapperProps: o, scrollTo: c, calculateRange: e, currentList: n, containerRef: l, scaleTo: u, state: s, onUpdate: f } = "itemHeight" in t ? Y(t, r) : S(t, r);
|
|
@@ -19,11 +19,11 @@ function I(r, t) {
|
|
|
19
19
|
wrapperProps: o
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const t =
|
|
24
|
-
return { state:
|
|
22
|
+
function O(r) {
|
|
23
|
+
const t = H(null), a = X(t), o = H([]), c = _(r);
|
|
24
|
+
return { state: H({ start: 0, end: 10, current: 0, scale: 1 }), source: c, currentList: o, size: a, containerRef: t };
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function z(r, t, a) {
|
|
27
27
|
return (o) => {
|
|
28
28
|
const { start: c = 0, scale: e = 1 } = r.value;
|
|
29
29
|
if (typeof a == "number")
|
|
@@ -57,9 +57,7 @@ function W(r, t, a, o, { containerRef: c, state: e, currentList: n, source: l },
|
|
|
57
57
|
return () => {
|
|
58
58
|
const s = c.value;
|
|
59
59
|
if (s) {
|
|
60
|
-
const f = a(r === "vertical" ? s.scrollTop : s.scrollLeft);
|
|
61
|
-
console.log("offset", f);
|
|
62
|
-
const i = o(r === "vertical" ? s.clientHeight : s.clientWidth), p = f - t, g = f + i + t;
|
|
60
|
+
const f = a(Math.ceil(r === "vertical" ? s.scrollTop : s.scrollLeft)), i = o(r === "vertical" ? s.clientHeight : s.clientWidth), p = f - t, g = f + i + t;
|
|
63
61
|
e.value = {
|
|
64
62
|
start: p < 0 ? 0 : p,
|
|
65
63
|
end: g > l.value.length ? l.value.length : g,
|
|
@@ -100,19 +98,24 @@ const K = {
|
|
|
100
98
|
};
|
|
101
99
|
function G(r, t, a, o) {
|
|
102
100
|
return (c) => {
|
|
103
|
-
|
|
101
|
+
if (o.value) {
|
|
102
|
+
if (c < 0)
|
|
103
|
+
return;
|
|
104
|
+
const e = a(c);
|
|
105
|
+
o.value[K[r]] = e, t();
|
|
106
|
+
}
|
|
104
107
|
};
|
|
105
108
|
}
|
|
106
109
|
function S(r, t) {
|
|
107
|
-
const { on: a, trigger: o } =
|
|
110
|
+
const { on: a, trigger: o } = x(), c = O(t), { state: e, source: n, currentList: l, size: u, containerRef: s } = c, f = { overflowX: "auto" }, { itemWidth: i, overscan: p = 5 } = r, g = z(e, n, i), h = P(n, i, e), v = W("horizontal", p, h, g, c, o), m = k(i, n, e), T = y(() => m(e.value.start)), R = E(i, n, e);
|
|
108
111
|
D(u, t, s, v);
|
|
109
|
-
const V = G("horizontal", v, m, s), b = (
|
|
110
|
-
e.value.scale =
|
|
111
|
-
},
|
|
112
|
+
const V = G("horizontal", v, m, s), b = (d) => {
|
|
113
|
+
e.value.scale = d;
|
|
114
|
+
}, C = y(() => ({
|
|
112
115
|
style: {
|
|
113
116
|
height: "100%",
|
|
114
|
-
width: `${R.value -
|
|
115
|
-
marginLeft: `${
|
|
117
|
+
width: `${R.value - T.value}px`,
|
|
118
|
+
marginLeft: `${T.value}px`,
|
|
116
119
|
display: "flex",
|
|
117
120
|
transform: `scale(${e.value.scale})`,
|
|
118
121
|
transformOrigin: "0% 0%"
|
|
@@ -126,26 +129,26 @@ function S(r, t) {
|
|
|
126
129
|
scaleTo: b,
|
|
127
130
|
scrollTo: V,
|
|
128
131
|
calculateRange: v,
|
|
129
|
-
wrapperProps:
|
|
132
|
+
wrapperProps: C,
|
|
130
133
|
containerStyle: f,
|
|
131
134
|
currentList: l,
|
|
132
135
|
containerRef: s
|
|
133
136
|
};
|
|
134
137
|
}
|
|
135
138
|
function Y(r, t) {
|
|
136
|
-
const { on: a, trigger: o } =
|
|
139
|
+
const { on: a, trigger: o } = x(), c = O(t), { state: e, source: n, currentList: l, size: u, containerRef: s } = c, f = { overflowY: "auto" }, { itemHeight: i, overscan: p = 5 } = r, g = z(e, n, i), h = P(n, i, e), v = W("vertical", p, h, g, c, o), m = k(i, n, e), T = y(() => m(e.value.start)), R = E(i, n, e);
|
|
137
140
|
D(u, t, s, v);
|
|
138
|
-
const V = G("vertical", v, m, s), b = (
|
|
141
|
+
const V = G("vertical", v, m, s), b = (d) => {
|
|
139
142
|
const w = s.value;
|
|
140
143
|
if (w) {
|
|
141
|
-
const { current:
|
|
144
|
+
const { current: M } = e.value;
|
|
142
145
|
let L = 0;
|
|
143
|
-
typeof i == "number" ? L =
|
|
146
|
+
typeof i == "number" ? L = M * (d * i - e.value.scale * i) : L = n.value.slice(0, M).reduce((U, j, $) => U + d * i($) - e.value.scale * i($), 0), w.scrollTop = w.scrollTop + L >= 0 ? w.scrollTop + L : 0, e.value.scale = d;
|
|
144
147
|
}
|
|
145
|
-
},
|
|
148
|
+
}, C = y(() => ({
|
|
146
149
|
style: {
|
|
147
|
-
height: `${R.value -
|
|
148
|
-
marginTop: `${
|
|
150
|
+
height: `${R.value - T.value}px`,
|
|
151
|
+
marginTop: `${T.value}px`,
|
|
149
152
|
transform: `translateX(-50%) scale(${e.value.scale})`,
|
|
150
153
|
transformOrigin: "50% 0%"
|
|
151
154
|
}
|
|
@@ -157,7 +160,7 @@ function Y(r, t) {
|
|
|
157
160
|
calculateRange: v,
|
|
158
161
|
scrollTo: V,
|
|
159
162
|
containerStyle: f,
|
|
160
|
-
wrapperProps:
|
|
163
|
+
wrapperProps: C,
|
|
161
164
|
currentList: l,
|
|
162
165
|
containerRef: s
|
|
163
166
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ue,
|
|
1
|
+
import { defineComponent as ue, createVNode as h, mergeProps as se, onMounted as fe, ref as l, computed as r } from "vue";
|
|
2
2
|
import { useResizeObserver as k } from "@vueuse/core";
|
|
3
3
|
import { off as T, on as X } from "evtd";
|
|
4
4
|
import { defaultNamespace as s } from "../../../hooks/use-namespace/index.mjs";
|
|
@@ -8,7 +8,7 @@ const Me = /* @__PURE__ */ ue({
|
|
|
8
8
|
props: de,
|
|
9
9
|
inheritAttrs: !1,
|
|
10
10
|
setup(o) {
|
|
11
|
-
|
|
11
|
+
fe(() => {
|
|
12
12
|
o.container || v();
|
|
13
13
|
});
|
|
14
14
|
const R = l(null), m = l(null), x = l(null), Y = l(null), d = l(null), f = l(null), u = l(null), S = l(null), b = l(null), L = l(null), q = r(() => {
|
|
@@ -230,7 +230,7 @@ const Me = /* @__PURE__ */ ue({
|
|
|
230
230
|
left: this.xBarLeftPxRef
|
|
231
231
|
},
|
|
232
232
|
onMousedown: this.handleXScrollMouseDown
|
|
233
|
-
}, null,
|
|
233
|
+
}, null, 46, ["onMousedown"])], 2), x = () => h("div", {
|
|
234
234
|
class: `${s}-scrollbar-rail ${s}-scrollbar-rail--vertical`,
|
|
235
235
|
ref: "yRailRef"
|
|
236
236
|
}, [this.needYBarRef && this.showYBarRef && h("div", {
|
|
@@ -240,10 +240,10 @@ const Me = /* @__PURE__ */ ue({
|
|
|
240
240
|
top: this.yBarTopPxRef
|
|
241
241
|
},
|
|
242
242
|
onMousedown: this.handleYScrollMouseDown
|
|
243
|
-
}, null,
|
|
243
|
+
}, null, 46, ["onMousedown"])], 2);
|
|
244
244
|
return (() => {
|
|
245
245
|
var f, u;
|
|
246
|
-
return h("div",
|
|
246
|
+
return h("div", se({
|
|
247
247
|
class: `${s}-scrollbar`
|
|
248
248
|
}, this.$attrs, {
|
|
249
249
|
onMouseenter: this.handleMouseEnter,
|
|
@@ -255,7 +255,7 @@ const Me = /* @__PURE__ */ ue({
|
|
|
255
255
|
}, [h("div", {
|
|
256
256
|
ref: "contentRef",
|
|
257
257
|
class: `${s}-scrollbar-content`
|
|
258
|
-
}, [(u = o.default) == null ? void 0 : u.call(o)],
|
|
258
|
+
}, [(u = o.default) == null ? void 0 : u.call(o)], 2)], 42, ["onScroll"]), x(), R && m()], 16, ["onMouseenter", "onMouseleave"]);
|
|
259
259
|
})();
|
|
260
260
|
}
|
|
261
261
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("@vueuse/shared"),f=require("vue"),G=require("@vueuse/core");function S(r,t){const{containerStyle:a,wrapperProps:c,scrollTo:n,calculateRange:e,currentList:o,containerRef:l,scaleTo:u,state:s,onUpdate:v}="itemHeight"in t?F(t,r):_(t,r);return{onUpdate:v,state:s,scaleTo:u,list:o,scrollTo:n,containerProps:{ref:l,onScroll:()=>{e()},style:a},wrapperProps:c}}function $(r){const t=f.ref(null),a=G.useElementSize(t),c=f.ref([]),n=f.shallowRef(r);return{state:f.ref({start:0,end:10,current:0,scale:1}),source:n,currentList:c,size:a,containerRef:t}}function P(r,t,a){return c=>{const{start:n=0,scale:e=1}=r.value;if(typeof a=="number")return Math.ceil(c/(a*e));let o=0,l=0;for(let u=n;u<t.value.length;u++){const s=a(u)*e;if(o+=s,l=u,o>c)break}return l-n}}function k(r,t,a){return c=>{const{scale:n=1}=a.value;if(typeof t=="number")return Math.floor(c/(t*n))+1;let e=0,o=0;for(let l=0;l<r.value.length;l++){const u=t(l)*n;if(e+=u,e>c){o=l;break}}return o+1}}function x(r,t,a,c,{containerRef:n,state:e,currentList:o,source:l},u){return()=>{const s=n.value;if(s){const v=a(Math.ceil(r==="vertical"?s.scrollTop:s.scrollLeft)),i=c(r==="vertical"?s.clientHeight:s.clientWidth),g=v-t,h=v+i+t;e.value={start:g<0?0:g,end:h>l.value.length?l.value.length:h,current:v-1,scale:e.value.scale},o.value=l.value.slice(e.value.start,e.value.end).map((d,p)=>({data:d,index:p+e.value.start})),u(e.value)}}}function z(r,t,a){return c=>{const{scale:n=1}=a.value;if(typeof r=="number"){const o=c*(r*n);return Math.ceil(o)}const e=t.value.slice(0,c).reduce((o,l,u)=>o+r(u)*n,0);return Math.ceil(e)}}function E(r,t,a,c){f.watch([r.width,r.height,t,a],()=>{c()})}function W(r,t,a){return f.computed(()=>{const{scale:c=1}=a.value;return typeof r=="number"?t.value.length*r*c:t.value.reduce((n,e,o)=>n+r(o)*c,0)})}const U={horizontal:"scrollLeft",vertical:"scrollTop"};function q(r,t,a,c){return n=>{if(c.value){if(n<0)return;const e=a(n);c.value[U[r]]=e,t()}}}function _(r,t){const{on:a,trigger:c}=O.createEventHook(),n=$(t),{state:e,source:o,currentList:l,size:u,containerRef:s}=n,v={overflowX:"auto"},{itemWidth:i,overscan:g=5}=r,h=P(e,o,i),d=k(o,i,e),p=x("horizontal",g,d,h,n,c),m=z(i,o,e),T=f.computed(()=>m(e.value.start)),b=W(i,o,e);E(u,t,s,p);const R=q("horizontal",p,m,s),V=y=>{e.value.scale=y},H=f.computed(()=>({style:{height:"100%",width:`${b.value-T.value}px`,marginLeft:`${T.value}px`,display:"flex",transform:`scale(${e.value.scale})`,transformOrigin:"0% 0%"}}));return{onUpdate:a,state:e,scaleTo:V,scrollTo:R,calculateRange:p,wrapperProps:H,containerStyle:v,currentList:l,containerRef:s}}function F(r,t){const{on:a,trigger:c}=O.createEventHook(),n=$(t),{state:e,source:o,currentList:l,size:u,containerRef:s}=n,v={overflowY:"auto"},{itemHeight:i,overscan:g=5}=r,h=P(e,o,i),d=k(o,i,e),p=x("vertical",g,d,h,n,c),m=z(i,o,e),T=f.computed(()=>m(e.value.start)),b=W(i,o,e);E(u,t,s,p);const R=q("vertical",p,m,s),V=y=>{const L=s.value;if(L){const{current:M}=e.value;let w=0;typeof i=="number"?w=M*(y*i-e.value.scale*i):w=o.value.slice(0,M).reduce((D,X,C)=>D+y*i(C)-e.value.scale*i(C),0),L.scrollTop=L.scrollTop+w>=0?L.scrollTop+w:0,e.value.scale=y}},H=f.computed(()=>({style:{height:`${b.value-T.value}px`,marginTop:`${T.value}px`,transform:`translateX(-50%) scale(${e.value.scale})`,transformOrigin:"50% 0%"}}));return{onUpdate:a,state:e,scaleTo:V,calculateRange:p,scrollTo:R,containerStyle:v,wrapperProps:H,currentList:l,containerRef:s}}exports.useVirtualList=S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),I=require("@vueuse/core"),f=require("evtd"),s=require("../../../hooks/use-namespace/index.js"),ae=require("./types.js"),ce=t.defineComponent({name:"KScrollbar",props:ae.scrollbarProps,inheritAttrs:!1,setup(l){t.onMounted(()=>{l.container||v()});const h=t.ref(null),m=t.ref(null),B=t.ref(null),z=t.ref(null),d=t.ref(null),i=t.ref(null),u=t.ref(null),R=t.ref(null),N=t.ref(null),P=t.ref(null),j=t.computed(()=>{var e;return((e=l.content)==null?void 0:e.call(l))||h.value}),M=t.computed(()=>{var e;return((e=l.container)==null?void 0:e.call(l))||m.value}),T=t.ref(0),X=t.ref(0);I.useResizeObserver(h,()=>{v()}),I.useResizeObserver(m,()=>{v()});const A=t.computed(()=>{const{value:e}=u,{value:n}=d;return e!==null&&n!==null&&n>e}),S=t.ref(!1),K=t.computed(()=>{const{trigger:e}=l;return e==="none"||S.value}),Y=t.computed(()=>{const{value:e}=u,{value:n}=d,{value:o}=N;return e===null||n===null||o===null?0:Math.min(e,o*e/n+5*1.5)}),k=t.computed(()=>`${Y.value}px`),F=t.computed(()=>{const{value:e}=u,{value:n}=T,{value:o}=d,{value:a}=N;if(e===null||o===null||a===null)return 0;{const r=o-e;return r?n/r*(a-Y.value):0}}),G=t.computed(()=>`${F.value}px`);let g=!1,$=0,D=0,x,y;const C=e=>{if(!g)return;y!==void 0&&window.clearTimeout(y),x!==void 0&&window.clearTimeout(x);const{value:n}=u,{value:o}=d,{value:a}=Y;if(n===null||o===null)return;const H=(e.clientY-D)*(o-n)/(n-a),W=o-n;let c=$+H;c=Math.min(W,c),c=Math.max(c,0);const{value:w}=M;w&&(w.scrollTop=c)},V=e=>{e.preventDefault(),e.stopPropagation(),f.off("mousemove",window,C,!0),f.off("mouseup",window,V,!0),g=!1,S.value=!1,v()},J=e=>{e.preventDefault(),e.stopPropagation(),f.on("mousemove",window,C,!0),f.on("mouseup",window,V,!0),$=T.value,D=e.clientY,g=!0,S.value=!0};function Q(e){const{onScroll:n}=l;n&&n(e),O()}const Z=t.computed(()=>{const{value:e}=R,{value:n}=i;return e!==null&&n!==null&&n>e}),p=t.ref(!1),ee=t.computed(()=>{const{trigger:e}=l;return e==="none"||p.value}),L=t.computed(()=>{const{value:e}=R,{value:n}=i,{value:o}=P;return e===null||n===null||o===null?0:o*e/n+5*1.5}),te=t.computed(()=>`${L.value}px`),ne=t.computed(()=>{const{value:e}=R,{value:n}=X,{value:o}=i,{value:a}=P;if(e===null||o===null||a===null)return 0;{const r=o-e;return r?n/r*(a-L.value):0}}),oe=t.computed(()=>`${ne.value}px`);let b=!1,_=0,q=0;const E=e=>{if(!b)return;y!==void 0&&window.clearTimeout(y),x!==void 0&&window.clearTimeout(x);const{value:n}=R,{value:o}=i,{value:a}=L;if(n===null||o===null)return;const H=(e.clientX-q)*(o-n)/(n-a),W=o-n;let c=_+H;c=Math.min(W,c),c=Math.max(c,0);const{value:w}=M;w&&(w.scrollLeft=c)},U=e=>{e.preventDefault(),e.stopPropagation(),f.off("mousemove",window,E,!0),f.off("mouseup",window,U,!0),p.value=!1,b=!1,v()};function le(e){e.preventDefault(),e.stopPropagation(),b=!0,p.value=!0,f.on("mousemove",window,E,!0),f.on("mouseup",window,U,!0),_=X.value,q=e.clientX}function O(){const{value:e}=M;e&&(T.value=e.scrollTop,X.value=e.scrollLeft)}const re=()=>{const{value:e}=j;if(e){const r=e.getBoundingClientRect();d.value=r.height,i.value=r.width}const{value:n}=M;if(n){const r=n.getBoundingClientRect();u.value=r.height,R.value=r.width}const{value:o}=B;o&&(N.value=o.offsetHeight);const{value:a}=z;a&&(P.value=a.offsetWidth)};function v(){re(),O()}return{showYBarRef:K,showXBarRef:ee,sync:v,handleMouseEnter:()=>{S.value=!0,p.value=!0},handleMouseLeave:()=>{g||(S.value=!1),b||(p.value=!1)},contentRef:h,yRailRef:B,xRailRef:z,containerRef:m,contentHeightRef:d,containerHeightRef:u,needYBarRef:A,needXBarRef:Z,yBarSizePxRef:k,handleYScrollMouseDown:J,handleXScrollMouseDown:le,yBarTopPxRef:G,handleScroll:Q,xBarSizePxRef:te,xBarLeftPxRef:oe}},render(){const{$slots:l,xScrollable:h}=this,m=()=>t.createVNode("div",{class:`${s.defaultNamespace}-scrollbar-rail ${s.defaultNamespace}-scrollbar-rail--horizontal`,ref:"xRailRef"},[this.needXBarRef&&this.showXBarRef&&t.createVNode("div",{class:`${s.defaultNamespace}-scrollbar-rail__scrollbar--horizontal`,style:{width:this.xBarSizePxRef,left:this.xBarLeftPxRef},onMousedown:this.handleXScrollMouseDown},null,
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),I=require("@vueuse/core"),f=require("evtd"),s=require("../../../hooks/use-namespace/index.js"),ae=require("./types.js"),ce=t.defineComponent({name:"KScrollbar",props:ae.scrollbarProps,inheritAttrs:!1,setup(l){t.onMounted(()=>{l.container||v()});const h=t.ref(null),m=t.ref(null),B=t.ref(null),z=t.ref(null),d=t.ref(null),i=t.ref(null),u=t.ref(null),R=t.ref(null),N=t.ref(null),P=t.ref(null),j=t.computed(()=>{var e;return((e=l.content)==null?void 0:e.call(l))||h.value}),M=t.computed(()=>{var e;return((e=l.container)==null?void 0:e.call(l))||m.value}),T=t.ref(0),X=t.ref(0);I.useResizeObserver(h,()=>{v()}),I.useResizeObserver(m,()=>{v()});const A=t.computed(()=>{const{value:e}=u,{value:n}=d;return e!==null&&n!==null&&n>e}),S=t.ref(!1),K=t.computed(()=>{const{trigger:e}=l;return e==="none"||S.value}),Y=t.computed(()=>{const{value:e}=u,{value:n}=d,{value:o}=N;return e===null||n===null||o===null?0:Math.min(e,o*e/n+5*1.5)}),k=t.computed(()=>`${Y.value}px`),F=t.computed(()=>{const{value:e}=u,{value:n}=T,{value:o}=d,{value:a}=N;if(e===null||o===null||a===null)return 0;{const r=o-e;return r?n/r*(a-Y.value):0}}),G=t.computed(()=>`${F.value}px`);let g=!1,$=0,D=0,x,y;const C=e=>{if(!g)return;y!==void 0&&window.clearTimeout(y),x!==void 0&&window.clearTimeout(x);const{value:n}=u,{value:o}=d,{value:a}=Y;if(n===null||o===null)return;const H=(e.clientY-D)*(o-n)/(n-a),W=o-n;let c=$+H;c=Math.min(W,c),c=Math.max(c,0);const{value:w}=M;w&&(w.scrollTop=c)},V=e=>{e.preventDefault(),e.stopPropagation(),f.off("mousemove",window,C,!0),f.off("mouseup",window,V,!0),g=!1,S.value=!1,v()},J=e=>{e.preventDefault(),e.stopPropagation(),f.on("mousemove",window,C,!0),f.on("mouseup",window,V,!0),$=T.value,D=e.clientY,g=!0,S.value=!0};function Q(e){const{onScroll:n}=l;n&&n(e),O()}const Z=t.computed(()=>{const{value:e}=R,{value:n}=i;return e!==null&&n!==null&&n>e}),p=t.ref(!1),ee=t.computed(()=>{const{trigger:e}=l;return e==="none"||p.value}),L=t.computed(()=>{const{value:e}=R,{value:n}=i,{value:o}=P;return e===null||n===null||o===null?0:o*e/n+5*1.5}),te=t.computed(()=>`${L.value}px`),ne=t.computed(()=>{const{value:e}=R,{value:n}=X,{value:o}=i,{value:a}=P;if(e===null||o===null||a===null)return 0;{const r=o-e;return r?n/r*(a-L.value):0}}),oe=t.computed(()=>`${ne.value}px`);let b=!1,_=0,q=0;const E=e=>{if(!b)return;y!==void 0&&window.clearTimeout(y),x!==void 0&&window.clearTimeout(x);const{value:n}=R,{value:o}=i,{value:a}=L;if(n===null||o===null)return;const H=(e.clientX-q)*(o-n)/(n-a),W=o-n;let c=_+H;c=Math.min(W,c),c=Math.max(c,0);const{value:w}=M;w&&(w.scrollLeft=c)},U=e=>{e.preventDefault(),e.stopPropagation(),f.off("mousemove",window,E,!0),f.off("mouseup",window,U,!0),p.value=!1,b=!1,v()};function le(e){e.preventDefault(),e.stopPropagation(),b=!0,p.value=!0,f.on("mousemove",window,E,!0),f.on("mouseup",window,U,!0),_=X.value,q=e.clientX}function O(){const{value:e}=M;e&&(T.value=e.scrollTop,X.value=e.scrollLeft)}const re=()=>{const{value:e}=j;if(e){const r=e.getBoundingClientRect();d.value=r.height,i.value=r.width}const{value:n}=M;if(n){const r=n.getBoundingClientRect();u.value=r.height,R.value=r.width}const{value:o}=B;o&&(N.value=o.offsetHeight);const{value:a}=z;a&&(P.value=a.offsetWidth)};function v(){re(),O()}return{showYBarRef:K,showXBarRef:ee,sync:v,handleMouseEnter:()=>{S.value=!0,p.value=!0},handleMouseLeave:()=>{g||(S.value=!1),b||(p.value=!1)},contentRef:h,yRailRef:B,xRailRef:z,containerRef:m,contentHeightRef:d,containerHeightRef:u,needYBarRef:A,needXBarRef:Z,yBarSizePxRef:k,handleYScrollMouseDown:J,handleXScrollMouseDown:le,yBarTopPxRef:G,handleScroll:Q,xBarSizePxRef:te,xBarLeftPxRef:oe}},render(){const{$slots:l,xScrollable:h}=this,m=()=>t.createVNode("div",{class:`${s.defaultNamespace}-scrollbar-rail ${s.defaultNamespace}-scrollbar-rail--horizontal`,ref:"xRailRef"},[this.needXBarRef&&this.showXBarRef&&t.createVNode("div",{class:`${s.defaultNamespace}-scrollbar-rail__scrollbar--horizontal`,style:{width:this.xBarSizePxRef,left:this.xBarLeftPxRef},onMousedown:this.handleXScrollMouseDown},null,46,["onMousedown"])],2),B=()=>t.createVNode("div",{class:`${s.defaultNamespace}-scrollbar-rail ${s.defaultNamespace}-scrollbar-rail--vertical`,ref:"yRailRef"},[this.needYBarRef&&this.showYBarRef&&t.createVNode("div",{class:`${s.defaultNamespace}-scrollbar-rail__scrollbar--vertical`,style:{height:this.yBarSizePxRef,top:this.yBarTopPxRef},onMousedown:this.handleYScrollMouseDown},null,46,["onMousedown"])],2);return(()=>{var i,u;return t.createVNode("div",t.mergeProps({class:`${s.defaultNamespace}-scrollbar`},this.$attrs,{onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave}),[this.container?(i=l.default)==null?void 0:i.call(l):t.createVNode("div",{class:`${s.defaultNamespace}-scrollbar-container`,onScroll:this.handleScroll,ref:"containerRef"},[t.createVNode("div",{ref:"contentRef",class:`${s.defaultNamespace}-scrollbar-content`},[(u=l.default)==null?void 0:u.call(l)],2)],42,["onScroll"]),B(),h&&m()],16,["onMouseenter","onMouseleave"])})()}});exports.default=ce;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=
|
|
1
|
+
@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=87008) format("woff2"),url(fonts/iconfont.woff?t=79200) format("woff"),url(fonts/iconfont.ttf?t=40515) format("truetype")}.king-icon{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-king-title-icon:before{content:"\e680"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--king-color-white:#ffffff;--king-color-primary:#409eff;--king-color-success:#67c23a;--king-color-warning:#e6a23c;--king-color-danger:#f56c6c;--king-color-error:#f56c6c;--king-color-info:#909399;--king-transition-duration:0.3s}.king-button--primary{--king-button-text-color:var(--king-color-primary)}.king-button--success{--king-button-text-color:var(--king-color-success)}.king-button--warning{--king-button-text-color:var(--king-color-warning)}.king-button--danger{--king-button-text-color:var(--king-color-danger)}.king-button--error{--king-button-text-color:var(--king-color-error)}.king-button--info{--king-button-text-color:var(--king-color-info)}.king-button{color:var(--king-button-text-color)}.king-scrollbar{overflow:hidden;position:relative;z-index:auto;height:100%;width:100%}.king-scrollbar .king-scrollbar-container{width:100%;overflow:scroll;height:100%;min-height:inherit;max-height:inherit;scrollbar-width:none}.king-scrollbar .king-scrollbar-content{width:-moz-fit-content;width:fit-content}.king-scrollbar .king-scrollbar-rail{position:absolute}.king-scrollbar .king-scrollbar-rail--vertical{right:0;width:5px;top:2px;bottom:2px;right:4px}.king-scrollbar .king-scrollbar-rail--horizontal{bottom:2px;height:5px;left:2px;right:2px}.king-scrollbar .king-scrollbar-rail__scrollbar--vertical{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;width:100%;cursor:pointer}.king-scrollbar .king-scrollbar-rail__scrollbar--horizontal{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;height:100%;cursor:pointer}.v-vl-items{width:-moz-fit-content;width:fit-content}.king-scale-virtual-list{width:100%;height:100%}.king-scale-virtual-list .king-scale-virtual-list-container{margin:0 auto;position:relative}.king-scale-virtual-list .king-scale-vittual-wrapper{width:-moz-fit-content;width:fit-content;margin:0 auto;position:absolute;left:50%}.king-pro-title{border-bottom:1px solid #ccc;font-weight:500;display:flex;align-items:center}.king-pro-title .icon{margin-right:10px}.king-pro-title--unborder{border:none}.king-pro-modal .ant-modal-content{padding:0}.king-pro-modal .ant-modal-header{height:56px;padding-left:32px;padding-right:24px;display:flex;justify-content:space-between;align-items:center;background:#f1f7ff;border-bottom:1px solid #e6e8ea}.king-pro-modal .ant-modal-body{padding:10px 20px;max-height:65vh;overflow:auto}.king-pro-modal .ant-modal-footer{height:56px;display:flex;padding:0 16px;justify-content:flex-end;align-items:center;border-top:1px solid #e6e8ea}.king-pro-modal .ant-modal-title{flex:1}.king-pro-modal .pro-modal-title{cursor:move;width:100%}.king-pro-area-select{width:100%}@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=
|
|
1
|
+
:root{--king-color-white:#ffffff;--king-color-primary:#409eff;--king-color-success:#67c23a;--king-color-warning:#e6a23c;--king-color-danger:#f56c6c;--king-color-error:#f56c6c;--king-color-info:#909399;--king-transition-duration:0.3s}.king-button--primary{--king-button-text-color:var(--king-color-primary)}.king-button--success{--king-button-text-color:var(--king-color-success)}.king-button--warning{--king-button-text-color:var(--king-color-warning)}.king-button--danger{--king-button-text-color:var(--king-color-danger)}.king-button--error{--king-button-text-color:var(--king-color-error)}.king-button--info{--king-button-text-color:var(--king-color-info)}.king-button{color:var(--king-button-text-color)}.king-scrollbar{overflow:hidden;position:relative;z-index:auto;height:100%;width:100%}.king-scrollbar .king-scrollbar-container{width:100%;overflow:scroll;height:100%;min-height:inherit;max-height:inherit;scrollbar-width:none}.king-scrollbar .king-scrollbar-content{width:-moz-fit-content;width:fit-content}.king-scrollbar .king-scrollbar-rail{position:absolute}.king-scrollbar .king-scrollbar-rail--vertical{right:0;width:5px;top:2px;bottom:2px;right:4px}.king-scrollbar .king-scrollbar-rail--horizontal{bottom:2px;height:5px;left:2px;right:2px}.king-scrollbar .king-scrollbar-rail__scrollbar--vertical{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;width:100%;cursor:pointer}.king-scrollbar .king-scrollbar-rail__scrollbar--horizontal{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;height:100%;cursor:pointer}.v-vl-items{width:-moz-fit-content;width:fit-content}.king-scale-virtual-list{width:100%;height:100%}.king-scale-virtual-list .king-scale-virtual-list-container{margin:0 auto;position:relative}.king-scale-virtual-list .king-scale-vittual-wrapper{width:-moz-fit-content;width:fit-content;margin:0 auto;position:absolute;left:50%}.king-pro-title{border-bottom:1px solid #ccc;font-weight:500;display:flex;align-items:center}.king-pro-title .icon{margin-right:10px}.king-pro-title--unborder{border:none}.king-pro-modal .ant-modal-content{padding:0}.king-pro-modal .ant-modal-header{height:56px;padding-left:32px;padding-right:24px;display:flex;justify-content:space-between;align-items:center;background:#f1f7ff;border-bottom:1px solid #e6e8ea}.king-pro-modal .ant-modal-body{padding:10px 20px;max-height:65vh;overflow:auto}.king-pro-modal .ant-modal-footer{height:56px;display:flex;padding:0 16px;justify-content:flex-end;align-items:center;border-top:1px solid #e6e8ea}.king-pro-modal .ant-modal-title{flex:1}.king-pro-modal .pro-modal-title{cursor:move;width:100%}.king-pro-area-select{width:100%}@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=13932) format("woff2"),url(fonts/iconfont.woff?t=72330) format("woff"),url(fonts/iconfont.ttf?t=86389) format("truetype")}.king-icon{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-king-title-icon:before{content:"\e680"}
|