@king-one/antdv 1.0.69 → 1.0.71
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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createEventHook as
|
|
2
|
-
import { ref as
|
|
1
|
+
import { createEventHook as O } from "@vueuse/shared";
|
|
2
|
+
import { ref as C, 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: n, scrollTo: c, calculateRange: e, currentList: o, 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: n
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const t =
|
|
24
|
-
return { state:
|
|
22
|
+
function z(r) {
|
|
23
|
+
const t = C(null), a = X(t), n = C([]), c = _(r);
|
|
24
|
+
return { state: C({ start: 0, end: 10, current: 0, scale: 1 }), source: c, currentList: n, size: a, containerRef: t };
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function M(r, t, a) {
|
|
27
27
|
return (n) => {
|
|
28
28
|
const { start: c = 0, scale: e = 1 } = r.value;
|
|
29
29
|
if (typeof a == "number")
|
|
@@ -37,7 +37,7 @@ function P(r, t, a) {
|
|
|
37
37
|
return l - c;
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function P(r, t, a) {
|
|
41
41
|
return (n) => {
|
|
42
42
|
const { scale: c = 1 } = a.value;
|
|
43
43
|
if (typeof t == "number")
|
|
@@ -53,7 +53,7 @@ function W(r, t, a) {
|
|
|
53
53
|
return o + 1;
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function
|
|
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) {
|
|
@@ -70,18 +70,23 @@ function k(r, t, a, n, { containerRef: c, state: e, currentList: o, source: l },
|
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function k(r, t, a) {
|
|
74
74
|
return (n) => {
|
|
75
75
|
const { scale: c = 1 } = a.value;
|
|
76
|
-
|
|
76
|
+
if (typeof r == "number") {
|
|
77
|
+
const o = n * (r * c);
|
|
78
|
+
return Math.ceil(o);
|
|
79
|
+
}
|
|
80
|
+
const e = t.value.slice(0, n).reduce((o, l, u) => o + r(u) * c, 0);
|
|
81
|
+
return Math.ceil(e);
|
|
77
82
|
};
|
|
78
83
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
84
|
+
function D(r, t, a, n) {
|
|
85
|
+
F([r.width, r.height, t, a], () => {
|
|
81
86
|
n();
|
|
82
87
|
});
|
|
83
88
|
}
|
|
84
|
-
function
|
|
89
|
+
function E(r, t, a) {
|
|
85
90
|
return y(() => {
|
|
86
91
|
const { scale: n = 1 } = a.value;
|
|
87
92
|
return typeof r == "number" ? t.value.length * r * n : t.value.reduce((c, e, o) => c + r(o) * n, 0);
|
|
@@ -91,15 +96,15 @@ const K = {
|
|
|
91
96
|
horizontal: "scrollLeft",
|
|
92
97
|
vertical: "scrollTop"
|
|
93
98
|
};
|
|
94
|
-
function
|
|
99
|
+
function G(r, t, a, n) {
|
|
95
100
|
return (c) => {
|
|
96
101
|
n.value && (n.value[K[r]] = a(c), t());
|
|
97
102
|
};
|
|
98
103
|
}
|
|
99
104
|
function S(r, t) {
|
|
100
|
-
const { on: a, trigger: n } =
|
|
101
|
-
|
|
102
|
-
const V =
|
|
105
|
+
const { on: a, trigger: n } = O(), c = z(t), { state: e, source: o, currentList: l, size: u, containerRef: s } = c, f = { overflowX: "auto" }, { itemWidth: i, overscan: p = 5 } = r, g = M(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);
|
|
106
|
+
D(u, t, s, v);
|
|
107
|
+
const V = G("horizontal", v, m, s), b = (T) => {
|
|
103
108
|
e.value.scale = T;
|
|
104
109
|
}, x = y(() => ({
|
|
105
110
|
style: {
|
|
@@ -126,14 +131,14 @@ function S(r, t) {
|
|
|
126
131
|
};
|
|
127
132
|
}
|
|
128
133
|
function Y(r, t) {
|
|
129
|
-
const { on: a, trigger: n } =
|
|
130
|
-
|
|
131
|
-
const V =
|
|
134
|
+
const { on: a, trigger: n } = O(), c = z(t), { state: e, source: o, currentList: l, size: u, containerRef: s } = c, f = { overflowY: "auto" }, { itemHeight: i, overscan: p = 5 } = r, g = M(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);
|
|
135
|
+
D(u, t, s, v);
|
|
136
|
+
const V = G("vertical", v, m, s), b = (T) => {
|
|
132
137
|
const w = s.value;
|
|
133
138
|
if (w) {
|
|
134
|
-
const { current:
|
|
139
|
+
const { current: H } = e.value;
|
|
135
140
|
let L = 0;
|
|
136
|
-
typeof i == "number" ? L =
|
|
141
|
+
typeof i == "number" ? L = H * (T * i - e.value.scale * i) : L = o.value.slice(0, H).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;
|
|
137
142
|
}
|
|
138
143
|
}, x = y(() => ({
|
|
139
144
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("@vueuse/shared"),f=require("vue"),G=require("@vueuse/core");function S(r,t){const{containerStyle:a,wrapperProps:o,scrollTo:n,calculateRange:e,currentList:c,containerRef:l,scaleTo:u,state:s,onUpdate:v}="itemHeight"in t?F(t,r):_(t,r);return{onUpdate:v,state:s,scaleTo:u,list:c,scrollTo:n,containerProps:{ref:l,onScroll:()=>{e()},style:a},wrapperProps:o}}function x(r){const t=f.ref(null),a=G.useElementSize(t),o=f.ref([]),n=f.shallowRef(r);return{state:f.ref({start:0,end:10,current:0,scale:1}),source:n,currentList:o,size:a,containerRef:t}}function M(r,t,a){return o=>{const{start:n=0,scale:e=1}=r.value;if(typeof a=="number")return Math.ceil(o/(a*e));let c=0,l=0;for(let u=n;u<t.value.length;u++){const s=a(u)*e;if(c+=s,l=u,c>o)break}return l-n}}function P(r,t,a){return o=>{const{scale:n=1}=a.value;if(typeof t=="number")return Math.floor(o/(t*n))+1;let e=0,c=0;for(let l=0;l<r.value.length;l++){const u=t(l)*n;if(e+=u,e>=o){c=l;break}}return c+1}}function k(r,t,a,o,{containerRef:n,state:e,currentList:c,source:l},u){return()=>{const s=n.value;if(s){const v=a(r==="vertical"?s.scrollTop:s.scrollLeft),i=o(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,scale:e.value.scale},c.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 o=>{const{scale:n=1}=a.value;if(typeof r=="number"){const c=o*(r*n);return Math.ceil(c)}const e=t.value.slice(0,o).reduce((c,l,u)=>c+r(u)*n,0);return Math.ceil(e)}}function E(r,t,a,o){f.watch([r.width,r.height,t,a],()=>{o()})}function W(r,t,a){return f.computed(()=>{const{scale:o=1}=a.value;return typeof r=="number"?t.value.length*r*o:t.value.reduce((n,e,c)=>n+r(c)*o,0)})}const U={horizontal:"scrollLeft",vertical:"scrollTop"};function q(r,t,a,o){return n=>{o.value&&(o.value[U[r]]=a(n),t())}}function _(r,t){const{on:a,trigger:o}=$.createEventHook(),n=x(t),{state:e,source:c,currentList:l,size:u,containerRef:s}=n,v={overflowX:"auto"},{itemWidth:i,overscan:g=5}=r,h=M(e,c,i),d=P(c,i,e),p=k("horizontal",g,d,h,n,o),m=z(i,c,e),y=f.computed(()=>m(e.value.start)),b=W(i,c,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:o}=$.createEventHook(),n=x(t),{state:e,source:c,currentList:l,size:u,containerRef:s}=n,v={overflowY:"auto"},{itemHeight:i,overscan:g=5}=r,h=M(e,c,i),d=P(c,i,e),p=k("vertical",g,d,h,n,o),m=z(i,c,e),y=f.computed(()=>m(e.value.start)),b=W(i,c,e);E(u,t,s,p);const R=q("vertical",p,m,s),V=T=>{const L=s.value;if(L){const{current:C}=e.value;let w=0;typeof i=="number"?w=C*(T*i-e.value.scale*i):w=c.value.slice(0,C).reduce((D,X,O)=>D+T*i(O)-e.value.scale*i(O),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=34336) format("woff2"),url(fonts/iconfont.woff?t=22523) format("woff"),url(fonts/iconfont.ttf?t=24056) 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=98566) format("woff2"),url(fonts/iconfont.woff?t=14580) format("woff"),url(fonts/iconfont.ttf?t=87370) 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"}
|