@king-one/antdv 1.0.76 → 1.0.77
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
CHANGED
|
@@ -2,12 +2,12 @@ import { createEventHook as x } from "@vueuse/shared";
|
|
|
2
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
|
-
const { containerStyle: a, wrapperProps:
|
|
5
|
+
const { containerStyle: a, wrapperProps: n, scrollTo: c, calculateRange: e, currentList: o, containerRef: l, scaleTo: u, state: s, onUpdate: f } = "itemHeight" in t ? Y(t, r) : S(t, r);
|
|
6
6
|
return {
|
|
7
7
|
onUpdate: f,
|
|
8
8
|
state: s,
|
|
9
9
|
scaleTo: u,
|
|
10
|
-
list:
|
|
10
|
+
list: o,
|
|
11
11
|
scrollTo: c,
|
|
12
12
|
containerProps: {
|
|
13
13
|
ref: l,
|
|
@@ -16,54 +16,54 @@ function I(r, t) {
|
|
|
16
16
|
},
|
|
17
17
|
style: a
|
|
18
18
|
},
|
|
19
|
-
wrapperProps:
|
|
19
|
+
wrapperProps: n
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
function O(r) {
|
|
23
|
-
const t = H(null), a = X(t),
|
|
24
|
-
return { state: H({ start: 0, end: 10, current: 0, scale: 1 }), source: c, currentList:
|
|
23
|
+
const t = H(null), a = X(t), n = H([]), c = _(r);
|
|
24
|
+
return { state: H({ start: 0, end: 10, current: 0, scale: 1 }), source: c, currentList: n, size: a, containerRef: t };
|
|
25
25
|
}
|
|
26
26
|
function z(r, t, a) {
|
|
27
|
-
return (
|
|
27
|
+
return (n) => {
|
|
28
28
|
const { start: c = 0, scale: e = 1 } = r.value;
|
|
29
29
|
if (typeof a == "number")
|
|
30
|
-
return Math.ceil(
|
|
31
|
-
let
|
|
30
|
+
return Math.ceil(n / (a * e));
|
|
31
|
+
let o = 0, l = 0;
|
|
32
32
|
for (let u = c; u < t.value.length; u++) {
|
|
33
33
|
const s = a(u) * e;
|
|
34
|
-
if (
|
|
34
|
+
if (o += s, l = u, o > n)
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
37
|
return l - c;
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
function P(r, t, a) {
|
|
41
|
-
return (
|
|
41
|
+
return (n) => {
|
|
42
42
|
const { scale: c = 1 } = a.value;
|
|
43
43
|
if (typeof t == "number")
|
|
44
|
-
return Math.floor(
|
|
45
|
-
let e = 0,
|
|
44
|
+
return Math.floor(n / (t * c)) + 1;
|
|
45
|
+
let e = 0, o = 0;
|
|
46
46
|
for (let l = 0; l < r.value.length; l++) {
|
|
47
47
|
const u = t(l) * c;
|
|
48
|
-
if (e += u, e >
|
|
49
|
-
|
|
48
|
+
if (e += u, e > n) {
|
|
49
|
+
o = l;
|
|
50
50
|
break;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
return
|
|
53
|
+
return o + 1;
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function W(r, t, a,
|
|
56
|
+
function W(r, t, a, n, { containerRef: c, state: e, currentList: o, source: l }, u) {
|
|
57
57
|
return () => {
|
|
58
58
|
const s = c.value;
|
|
59
59
|
if (s) {
|
|
60
|
-
const f = a(
|
|
60
|
+
const f = a(r === "vertical" ? Math.ceil(s.scrollTop) + 1 : Math.ceil(s.scrollLeft)), i = n(r === "vertical" ? s.clientHeight : s.clientWidth), p = f - t, g = f + i + t;
|
|
61
61
|
e.value = {
|
|
62
62
|
start: p < 0 ? 0 : p,
|
|
63
63
|
end: g > l.value.length ? l.value.length : g,
|
|
64
64
|
current: f - 1,
|
|
65
65
|
scale: e.value.scale
|
|
66
|
-
},
|
|
66
|
+
}, o.value = l.value.slice(e.value.start, e.value.end).map((h, v) => ({
|
|
67
67
|
data: h,
|
|
68
68
|
index: v + e.value.start
|
|
69
69
|
})), u(e.value);
|
|
@@ -71,51 +71,50 @@ function W(r, t, a, o, { containerRef: c, state: e, currentList: n, source: l },
|
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
function k(r, t, a) {
|
|
74
|
-
return (
|
|
74
|
+
return (n) => {
|
|
75
75
|
const { scale: c = 1 } = a.value;
|
|
76
76
|
if (typeof r == "number") {
|
|
77
|
-
const
|
|
78
|
-
return Math.ceil(
|
|
77
|
+
const o = n * (r * c);
|
|
78
|
+
return Math.ceil(o);
|
|
79
79
|
}
|
|
80
|
-
const e = t.value.slice(0,
|
|
80
|
+
const e = t.value.slice(0, n).reduce((o, l, u) => o + r(u) * c, 0);
|
|
81
81
|
return Math.ceil(e);
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function D(r, t, a,
|
|
84
|
+
function D(r, t, a, n) {
|
|
85
85
|
F([r.width, r.height, t, a], () => {
|
|
86
|
-
|
|
86
|
+
n();
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
function E(r, t, a) {
|
|
90
90
|
return y(() => {
|
|
91
|
-
const { scale:
|
|
92
|
-
return typeof r == "number" ? t.value.length * r *
|
|
91
|
+
const { scale: n = 1 } = a.value;
|
|
92
|
+
return typeof r == "number" ? t.value.length * r * n : t.value.reduce((c, e, o) => c + r(o) * n, 0);
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
const K = {
|
|
96
96
|
horizontal: "scrollLeft",
|
|
97
97
|
vertical: "scrollTop"
|
|
98
98
|
};
|
|
99
|
-
function G(r, t, a,
|
|
99
|
+
function G(r, t, a, n) {
|
|
100
100
|
return (c) => {
|
|
101
|
-
if (
|
|
101
|
+
if (n.value) {
|
|
102
102
|
if (c < 0)
|
|
103
103
|
return;
|
|
104
|
-
|
|
105
|
-
o.value[K[r]] = e, t();
|
|
104
|
+
n.value[K[r]] = a(c), t();
|
|
106
105
|
}
|
|
107
106
|
};
|
|
108
107
|
}
|
|
109
108
|
function S(r, t) {
|
|
110
|
-
const { on: a, trigger:
|
|
109
|
+
const { on: a, trigger: n } = x(), c = O(t), { state: e, source: o, currentList: l, size: u, containerRef: s } = c, f = { overflowX: "auto" }, { itemWidth: i, overscan: p = 5 } = r, g = z(e, o, i), h = P(o, i, e), v = W("horizontal", p, h, g, c, n), m = k(i, o, e), d = y(() => m(e.value.start)), R = E(i, o, e);
|
|
111
110
|
D(u, t, s, v);
|
|
112
|
-
const V = G("horizontal", v, m, s), b = (
|
|
113
|
-
e.value.scale =
|
|
111
|
+
const V = G("horizontal", v, m, s), b = (T) => {
|
|
112
|
+
e.value.scale = T;
|
|
114
113
|
}, C = y(() => ({
|
|
115
114
|
style: {
|
|
116
115
|
height: "100%",
|
|
117
|
-
width: `${R.value -
|
|
118
|
-
marginLeft: `${
|
|
116
|
+
width: `${R.value - d.value}px`,
|
|
117
|
+
marginLeft: `${d.value}px`,
|
|
119
118
|
display: "flex",
|
|
120
119
|
transform: `scale(${e.value.scale})`,
|
|
121
120
|
transformOrigin: "0% 0%"
|
|
@@ -136,19 +135,19 @@ function S(r, t) {
|
|
|
136
135
|
};
|
|
137
136
|
}
|
|
138
137
|
function Y(r, t) {
|
|
139
|
-
const { on: a, trigger:
|
|
138
|
+
const { on: a, trigger: n } = x(), c = O(t), { state: e, source: o, currentList: l, size: u, containerRef: s } = c, f = { overflowY: "auto" }, { itemHeight: i, overscan: p = 5 } = r, g = z(e, o, i), h = P(o, i, e), v = W("vertical", p, h, g, c, n), m = k(i, o, e), d = y(() => m(e.value.start)), R = E(i, o, e);
|
|
140
139
|
D(u, t, s, v);
|
|
141
|
-
const V = G("vertical", v, m, s), b = (
|
|
140
|
+
const V = G("vertical", v, m, s), b = (T) => {
|
|
142
141
|
const w = s.value;
|
|
143
142
|
if (w) {
|
|
144
143
|
const { current: M } = e.value;
|
|
145
144
|
let L = 0;
|
|
146
|
-
typeof i == "number" ? L = M * (
|
|
145
|
+
typeof i == "number" ? L = M * (T * i - e.value.scale * i) : L = o.value.slice(0, M).reduce((U, j, $) => U + T * i($) - e.value.scale * i($), 0), w.scrollTop = w.scrollTop + L >= 0 ? w.scrollTop + L : 0, e.value.scale = T;
|
|
147
146
|
}
|
|
148
147
|
}, C = y(() => ({
|
|
149
148
|
style: {
|
|
150
|
-
height: `${R.value -
|
|
151
|
-
marginTop: `${
|
|
149
|
+
height: `${R.value - d.value}px`,
|
|
150
|
+
marginTop: `${d.value}px`,
|
|
152
151
|
transform: `translateX(-50%) scale(${e.value.scale})`,
|
|
153
152
|
transformOrigin: "50% 0%"
|
|
154
153
|
}
|
|
@@ -1 +1 @@
|
|
|
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(
|
|
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(r==="vertical"?Math.ceil(s.scrollTop)+1:Math.ceil(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;c.value[U[r]]=a(n),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),y=f.computed(()=>m(e.value.start)),b=W(i,o,e);E(u,t,s,p);const R=q("horizontal",p,m,s),V=T=>{e.value.scale=T},H=f.computed(()=>({style:{height:"100%",width:`${b.value-y.value}px`,marginLeft:`${y.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),y=f.computed(()=>m(e.value.start)),b=W(i,o,e);E(u,t,s,p);const R=q("vertical",p,m,s),V=T=>{const L=s.value;if(L){const{current:M}=e.value;let w=0;typeof i=="number"?w=M*(T*i-e.value.scale*i):w=o.value.slice(0,M).reduce((D,X,C)=>D+T*i(C)-e.value.scale*i(C),0),L.scrollTop=L.scrollTop+w>=0?L.scrollTop+w:0,e.value.scale=T}},H=f.computed(()=>({style:{height:`${b.value-y.value}px`,marginTop:`${y.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
|
-
@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=
|
|
1
|
+
@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=85302) format("woff2"),url(fonts/iconfont.woff?t=47154) format("woff"),url(fonts/iconfont.ttf?t=77022) 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=68218) format("woff2"),url(fonts/iconfont.woff?t=32528) format("woff"),url(fonts/iconfont.ttf?t=52591) 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"}
|