@king-one/antdv 1.0.26 → 1.0.28
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/scale-virtual-list/component/scale-virtual-list.vue2.mjs +28 -26
- package/dist/es/components/scale-virtual-list/hooks/useVirtualList.mjs +101 -97
- package/dist/es/node_modules/.pnpm/@vueuse_shared@10.11.1_vue@3.4.38/node_modules/@vueuse/shared/index.mjs +1189 -0
- package/dist/lib/node_modules/.pnpm/@vueuse_shared@10.11.1_vue@3.4.38/node_modules/@vueuse/shared/index.js +1 -0
- package/dist/lib/packages/antdv/components/scale-virtual-list/component/scale-virtual-list.vue2.js +1 -0
- package/dist/lib/packages/antdv/components/scale-virtual-list/hooks/useVirtualList.js +1 -0
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/scale-virtual-list.css +1 -1
- package/dist/types/components/scale-virtual-list/component/scale-virtual-list.vue.d.ts +8 -2
- package/dist/types/components/scale-virtual-list/hooks/useVirtualList.d.ts +3 -2
- package/dist/types/components/scale-virtual-list/index.d.ts +23 -8
- package/package.json +1 -1
- package/dist/lib/components/scale-virtual-list/component/scale-virtual-list.vue2.js +0 -1
- package/dist/lib/components/scale-virtual-list/hooks/useVirtualList.js +0 -1
- /package/dist/lib/{components → packages/antdv/components}/base/style/index.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/collapse-transtion/hooks/use-collapse-transtion.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/collapse-transtion/index.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/collapse-transtion/src/collapse-transtion.vue.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/collapse-transtion/src/collapse-transtion.vue2.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/collapse-transtion/src/types.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/collapse-transtion/style/index.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/form/component/form.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/form/component/form.vue.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/form/component/form.vue2.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/form/index.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/index.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/pro-dialog/hooks/useProDialog.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/pro-dialog/index.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/pro-dialog/src/pro-dialog.vue.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/pro-dialog/src/pro-dialog.vue2.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/pro-dialog/src/types.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/scale-virtual-list/component/scale-virtual-list.vue.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/scale-virtual-list/component/types.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/scale-virtual-list/index.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/scale-virtual-list/style/index.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/scroll-bar/index.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/scroll-bar/src/scroll-bar.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/scroll-bar/src/types.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/utils/install.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/virtual-list/index.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/virtual-list/src/types.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/virtual-list/src/virtual-list.vue.js +0 -0
- /package/dist/lib/{components → packages/antdv/components}/virtual-list/src/virtual-list.vue2.js +0 -0
- /package/dist/lib/{hooks → packages/antdv/hooks}/use-namespace/index.js +0 -0
- /package/dist/lib/{index.js → packages/antdv/index.js} +0 -0
- /package/dist/lib/{installer.js → packages/antdv/installer.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue-demi");function Y(e,t){var n;const r=i.shallowRef();return i.watchEffect(()=>{r.value=e()},{...t,flush:(n=t==null?void 0:t.flush)!=null?n:"sync"}),i.readonly(r)}function $(e,t){let n,r,o;const u=i.ref(!0),s=()=>{u.value=!0,o()};i.watch(e,s,{flush:"sync"});const c=typeof t=="function"?t:t.get,l=typeof t=="function"?void 0:t.set,p=i.customRef((m,d)=>(r=m,o=d,{get(){return u.value&&(n=c(),u.value=!1),r(),n},set(f){l==null||l(f)}}));return Object.isExtensible(p)&&(p.trigger=s),p}function A(e){return i.getCurrentScope()?(i.onScopeDispose(e),!0):!1}function de(){const e=new Set,t=o=>{e.delete(o)};return{on:o=>{e.add(o);const u=()=>t(o);return A(u),{off:u}},off:t,trigger:(...o)=>Promise.all(Array.from(e).map(u=>u(...o)))}}function me(e){let t=!1,n;const r=i.effectScope(!0);return(...o)=>(t||(n=r.run(()=>e(...o)),t=!0),n)}const T=new WeakMap,G=(e,t)=>{var n;const r=(n=i.getCurrentInstance())==null?void 0:n.proxy;if(r==null)throw new Error("provideLocal must be called in setup");T.has(r)||T.set(r,Object.create(null));const o=T.get(r);o[e]=t,i.provide(e,t)},z=(...e)=>{var t;const n=e[0],r=(t=i.getCurrentInstance())==null?void 0:t.proxy;if(r==null)throw new Error("injectLocal must be called in setup");return T.has(r)&&n in T.get(r)?T.get(r)[n]:i.inject(...e)};function pe(e,t){const n=(t==null?void 0:t.injectionKey)||Symbol(e.name||"InjectionState"),r=t==null?void 0:t.defaultValue;return[(...s)=>{const c=e(...s);return G(n,c),c},()=>z(n,r)]}function he(e){let t=0,n,r;const o=()=>{t-=1,r&&t<=0&&(r.stop(),n=void 0,r=void 0)};return(...u)=>(t+=1,n||(r=i.effectScope(!0),n=r.run(()=>e(...u))),A(o),n)}function q(e,t,{enumerable:n=!1,unwrap:r=!0}={}){if(!i.isVue3&&!i.version.startsWith("2.7.")){if(process.env.NODE_ENV!=="production")throw new Error("[VueUse] extendRef only works in Vue 2.7 or above.");return}for(const[o,u]of Object.entries(t))o!=="value"&&(i.isRef(u)&&r?Object.defineProperty(e,o,{get(){return u.value},set(s){u.value=s},enumerable:n}):Object.defineProperty(e,o,{value:u,enumerable:n}));return e}function ve(e,t){return t==null?i.unref(e):i.unref(e)[t]}function ye(e){return i.unref(e)!=null}function ge(e,t){if(typeof Symbol<"u"){const n={...e};return Object.defineProperty(n,Symbol.iterator,{enumerable:!1,value(){let r=0;return{next:()=>({value:t[r++],done:r>t.length})}}}),n}else return Object.assign([...t],e)}function a(e){return typeof e=="function"?e():i.unref(e)}const we=a;function _(e,t){const n=(t==null?void 0:t.computedGetter)===!1?i.unref:a;return function(...r){return i.computed(()=>e.apply(this,r.map(o=>n(o))))}}function be(e,t={}){let n=[],r;if(Array.isArray(t))n=t;else{r=t;const{includeOwnProperties:o=!0}=t;n.push(...Object.keys(e)),o&&n.push(...Object.getOwnPropertyNames(e))}return Object.fromEntries(n.map(o=>{const u=e[o];return[o,typeof u=="function"?_(u.bind(e),r):u]}))}function Z(e){if(!i.isRef(e))return i.reactive(e);const t=new Proxy({},{get(n,r,o){return i.unref(Reflect.get(e.value,r,o))},set(n,r,o){return i.isRef(e.value[r])&&!i.isRef(o)?e.value[r].value=o:e.value[r]=o,!0},deleteProperty(n,r){return Reflect.deleteProperty(e.value,r)},has(n,r){return Reflect.has(e.value,r)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return i.reactive(t)}function N(e){return Z(i.computed(e))}function Ae(e,...t){const n=t.flat(),r=n[0];return N(()=>Object.fromEntries(typeof r=="function"?Object.entries(i.toRefs(e)).filter(([o,u])=>!r(a(u),o)):Object.entries(i.toRefs(e)).filter(o=>!n.includes(o[0]))))}const D=typeof window<"u"&&typeof document<"u",Oe=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,Se=e=>typeof e<"u",Te=e=>e!=null,De=(e,...t)=>{e||console.warn(...t)},Fe=Object.prototype.toString,J=e=>Fe.call(e)==="[object Object]",Me=()=>Date.now(),X=()=>+Date.now(),Pe=(e,t,n)=>Math.min(n,Math.max(t,e)),O=()=>{},Re=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),Ie=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Ee=Ce();function Ce(){var e,t;return D&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function F(e,t){function n(...r){return new Promise((o,u)=>{Promise.resolve(e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(o).catch(u)})}return n}const E=e=>e();function j(e,t={}){let n,r,o=O;const u=c=>{clearTimeout(c),o(),o=O};return c=>{const l=a(e),p=a(t.maxWait);return n&&u(n),l<=0||p!==void 0&&p<=0?(r&&(u(r),r=null),Promise.resolve(c())):new Promise((m,d)=>{o=t.rejectOnCancel?d:m,p&&!r&&(r=setTimeout(()=>{n&&u(n),r=null,m(c())},p)),n=setTimeout(()=>{r&&u(r),r=null,m(c())},l)})}}function L(...e){let t=0,n,r=!0,o=O,u,s,c,l,p;!i.isRef(e[0])&&typeof e[0]=="object"?{delay:s,trailing:c=!0,leading:l=!0,rejectOnCancel:p=!1}=e[0]:[s,c=!0,l=!0,p=!1]=e;const m=()=>{n&&(clearTimeout(n),n=void 0,o(),o=O)};return f=>{const h=a(s),v=Date.now()-t,g=()=>u=f();return m(),h<=0?(t=Date.now(),g()):(v>h&&(l||!r)?(t=Date.now(),g()):c&&(u=new Promise((y,w)=>{o=p?w:y,n=setTimeout(()=>{t=Date.now(),r=!0,y(g()),m()},Math.max(0,h-v))})),!l&&!n&&(n=setTimeout(()=>r=!0,h)),r=!1,u)}}function K(e=E){const t=i.ref(!0);function n(){t.value=!1}function r(){t.value=!0}const o=(...u)=>{t.value&&e(...u)};return{isActive:i.readonly(t),pause:n,resume:r,eventFilter:o}}const ke={mounted:i.isVue3?"mounted":"inserted",updated:i.isVue3?"updated":"componentUpdated",unmounted:i.isVue3?"unmounted":"unbind"};function Q(e){const t=Object.create(null);return n=>t[n]||(t[n]=e(n))}const xe=/\B([A-Z])/g,_e=Q(e=>e.replace(xe,"-$1").toLowerCase()),Ne=/-(\w)/g,je=Q(e=>e.replace(Ne,(t,n)=>n?n.toUpperCase():""));function k(e,t=!1,n="Timeout"){return new Promise((r,o)=>{setTimeout(t?()=>o(n):r,e)})}function Le(e){return e}function We(e){let t;function n(){return t||(t=e()),t}return n.reset=async()=>{const r=t;t=void 0,r&&await r},n}function Ue(e){return e()}function ee(e,...t){return t.some(n=>n in e)}function Ve(e,t){var n;if(typeof e=="number")return e+t;const r=((n=e.match(/^-?\d+\.?\d*/))==null?void 0:n[0])||"",o=e.slice(r.length),u=Number.parseFloat(r)+t;return Number.isNaN(u)?e:u+o}function Be(e,t,n=!1){return t.reduce((r,o)=>(o in e&&(!n||e[o]!==void 0)&&(r[o]=e[o]),r),{})}function He(e,t,n=!1){return Object.fromEntries(Object.entries(e).filter(([r,o])=>(!n||o!==void 0)&&!t.includes(r)))}function Ye(e){return Object.entries(e)}function M(e){return e||i.getCurrentInstance()}function W(...e){if(e.length!==1)return i.toRef(...e);const t=e[0];return typeof t=="function"?i.readonly(i.customRef(()=>({get:t,set:O}))):i.ref(t)}const $e=W;function Ge(e,...t){const n=t.flat(),r=n[0];return N(()=>Object.fromEntries(typeof r=="function"?Object.entries(i.toRefs(e)).filter(([o,u])=>r(a(u),o)):n.map(o=>[o,W(e,o)])))}function te(e,t=1e4){return i.customRef((n,r)=>{let o=a(e),u;const s=()=>setTimeout(()=>{o=a(e),r()},a(t));return A(()=>{clearTimeout(u)}),{get(){return n(),o},set(c){o=c,r(),clearTimeout(u),u=s()}}})}function ne(e,t=200,n={}){return F(j(t,n),e)}function U(e,t=200,n={}){const r=i.ref(e.value),o=ne(()=>{r.value=e.value},t,n);return i.watch(e,()=>o()),r}function ze(e,t){return i.computed({get(){var n;return(n=e.value)!=null?n:t},set(n){e.value=n}})}function re(e,t=200,n=!1,r=!0,o=!1){return F(L(t,n,r,o),e)}function V(e,t=200,n=!0,r=!0){if(t<=0)return e;const o=i.ref(e.value),u=re(()=>{o.value=e.value},t,n,r);return i.watch(e,()=>u()),o}function oe(e,t={}){let n=e,r,o;const u=i.customRef((f,h)=>(r=f,o=h,{get(){return s()},set(v){c(v)}}));function s(f=!0){return f&&r(),n}function c(f,h=!0){var v,g;if(f===n)return;const y=n;((v=t.onBeforeChange)==null?void 0:v.call(t,f,y))!==!1&&(n=f,(g=t.onChanged)==null||g.call(t,f,y),h&&o())}return q(u,{get:s,set:c,untrackedGet:()=>s(!1),silentSet:f=>c(f,!1),peek:()=>s(!1),lay:f=>c(f,!1)},{enumerable:!0})}const qe=oe;function Ze(...e){if(e.length===2){const[t,n]=e;t.value=n}if(e.length===3)if(i.isVue2)i.set(...e);else{const[t,n,r]=e;t[n]=r}}function P(e,t,n={}){const{eventFilter:r=E,...o}=n;return i.watch(e,F(r,t),o)}function I(e,t,n={}){const{eventFilter:r,...o}=n,{eventFilter:u,pause:s,resume:c,isActive:l}=K(r);return{stop:P(e,t,{...o,eventFilter:u}),pause:s,resume:c,isActive:l}}function Je(e,t,...[n]){const{flush:r="sync",deep:o=!1,immediate:u=!0,direction:s="both",transform:c={}}=n||{},l=[],p="ltr"in c&&c.ltr||(f=>f),m="rtl"in c&&c.rtl||(f=>f);return(s==="both"||s==="ltr")&&l.push(I(e,f=>{l.forEach(h=>h.pause()),t.value=p(f),l.forEach(h=>h.resume())},{flush:r,deep:o,immediate:u})),(s==="both"||s==="rtl")&&l.push(I(t,f=>{l.forEach(h=>h.pause()),e.value=m(f),l.forEach(h=>h.resume())},{flush:r,deep:o,immediate:u})),()=>{l.forEach(f=>f.stop())}}function Xe(e,t,n={}){const{flush:r="sync",deep:o=!1,immediate:u=!0}=n;return Array.isArray(t)||(t=[t]),i.watch(e,s=>t.forEach(c=>c.value=s),{flush:r,deep:o,immediate:u})}function Ke(e,t={}){if(!i.isRef(e))return i.toRefs(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const r in e.value)n[r]=i.customRef(()=>({get(){return e.value[r]},set(o){var u;if((u=a(t.replaceRef))!=null?u:!0)if(Array.isArray(e.value)){const c=[...e.value];c[r]=o,e.value=c}else{const c={...e.value,[r]:o};Object.setPrototypeOf(c,Object.getPrototypeOf(e.value)),e.value=c}else e.value[r]=o}}));return n}function Qe(e,t=!0,n){M(n)?i.onBeforeMount(e,n):t?e():i.nextTick(e)}function et(e,t){M(t)&&i.onBeforeUnmount(e,t)}function tt(e,t=!0,n){M()?i.onMounted(e,n):t?e():i.nextTick(e)}function nt(e,t){M(t)&&i.onUnmounted(e,t)}function x(e,t=!1){function n(d,{flush:f="sync",deep:h=!1,timeout:v,throwOnTimeout:g}={}){let y=null;const C=[new Promise(R=>{y=i.watch(e,S=>{d(S)!==t&&(y==null||y(),R(S))},{flush:f,deep:h,immediate:!0})})];return v!=null&&C.push(k(v,g).then(()=>a(e)).finally(()=>y==null?void 0:y())),Promise.race(C)}function r(d,f){if(!i.isRef(d))return n(S=>S===d,f);const{flush:h="sync",deep:v=!1,timeout:g,throwOnTimeout:y}=f??{};let w=null;const R=[new Promise(S=>{w=i.watch([e,d],([H,fe])=>{t!==(H===fe)&&(w==null||w(),S(H))},{flush:h,deep:v,immediate:!0})})];return g!=null&&R.push(k(g,y).then(()=>a(e)).finally(()=>(w==null||w(),a(e)))),Promise.race(R)}function o(d){return n(f=>!!f,d)}function u(d){return r(null,d)}function s(d){return r(void 0,d)}function c(d){return n(Number.isNaN,d)}function l(d,f){return n(h=>{const v=Array.from(h);return v.includes(d)||v.includes(a(d))},f)}function p(d){return m(1,d)}function m(d=1,f){let h=-1;return n(()=>(h+=1,h>=d),f)}return Array.isArray(a(e))?{toMatch:n,toContains:l,changed:p,changedTimes:m,get not(){return x(e,!t)}}:{toMatch:n,toBe:r,toBeTruthy:o,toBeNull:u,toBeNaN:c,toBeUndefined:s,changed:p,changedTimes:m,get not(){return x(e,!t)}}}function rt(e){return x(e)}function ot(e,t){return e===t}function ut(...e){var t;const n=e[0],r=e[1];let o=(t=e[2])!=null?t:ot;if(typeof o=="string"){const u=o;o=(s,c)=>s[u]===c[u]}return i.computed(()=>a(n).filter(u=>a(r).findIndex(s=>o(u,s))===-1))}function it(e,t){return i.computed(()=>a(e).every((n,r,o)=>t(a(n),r,o)))}function ct(e,t){return i.computed(()=>a(e).map(n=>a(n)).filter(t))}function st(e,t){return i.computed(()=>a(a(e).find((n,r,o)=>t(a(n),r,o))))}function at(e,t){return i.computed(()=>a(e).findIndex((n,r,o)=>t(a(n),r,o)))}function lt(e,t){let n=e.length;for(;n-- >0;)if(t(e[n],n,e))return e[n]}function ft(e,t){return i.computed(()=>a(Array.prototype.findLast?a(e).findLast((n,r,o)=>t(a(n),r,o)):lt(a(e),(n,r,o)=>t(a(n),r,o))))}function dt(e){return J(e)&&ee(e,"formIndex","comparator")}function mt(...e){var t;const n=e[0],r=e[1];let o=e[2],u=0;if(dt(o)&&(u=(t=o.fromIndex)!=null?t:0,o=o.comparator),typeof o=="string"){const s=o;o=(c,l)=>c[s]===a(l)}return o=o??((s,c)=>s===a(c)),i.computed(()=>a(n).slice(u).some((s,c,l)=>o(a(s),a(r),c,a(l))))}function pt(e,t){return i.computed(()=>a(e).map(n=>a(n)).join(a(t)))}function ht(e,t){return i.computed(()=>a(e).map(n=>a(n)).map(t))}function vt(e,t,...n){const r=(o,u,s)=>t(a(o),a(u),s);return i.computed(()=>{const o=a(e);return n.length?o.reduce(r,a(n[0])):o.reduce(r)})}function yt(e,t){return i.computed(()=>a(e).some((n,r,o)=>t(a(n),r,o)))}function gt(e){return Array.from(new Set(e))}function wt(e,t){return e.reduce((n,r)=>(n.some(o=>t(r,o,e))||n.push(r),n),[])}function bt(e,t){return i.computed(()=>{const n=a(e).map(r=>a(r));return t?wt(n,t):gt(n)})}function At(e=0,t={}){let n=i.unref(e);const r=i.ref(e),{max:o=Number.POSITIVE_INFINITY,min:u=Number.NEGATIVE_INFINITY}=t,s=(d=1)=>r.value=Math.max(Math.min(o,r.value+d),u),c=(d=1)=>r.value=Math.min(Math.max(u,r.value-d),o),l=()=>r.value,p=d=>r.value=Math.max(u,Math.min(o,d));return{count:r,inc:s,dec:c,get:l,set:p,reset:(d=n)=>(n=d,p(d))}}const Ot=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[T\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/i,St=/[YMDHhms]o|\[([^\]]+)\]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;function Tt(e,t,n,r){let o=e<12?"AM":"PM";return r&&(o=o.split("").reduce((u,s)=>u+=`${s}.`,"")),n?o.toLowerCase():o}function b(e){const t=["th","st","nd","rd"],n=e%100;return e+(t[(n-20)%10]||t[n]||t[0])}function ue(e,t,n={}){var r;const o=e.getFullYear(),u=e.getMonth(),s=e.getDate(),c=e.getHours(),l=e.getMinutes(),p=e.getSeconds(),m=e.getMilliseconds(),d=e.getDay(),f=(r=n.customMeridiem)!=null?r:Tt,h={Yo:()=>b(o),YY:()=>String(o).slice(-2),YYYY:()=>o,M:()=>u+1,Mo:()=>b(u+1),MM:()=>`${u+1}`.padStart(2,"0"),MMM:()=>e.toLocaleDateString(n.locales,{month:"short"}),MMMM:()=>e.toLocaleDateString(n.locales,{month:"long"}),D:()=>String(s),Do:()=>b(s),DD:()=>`${s}`.padStart(2,"0"),H:()=>String(c),Ho:()=>b(c),HH:()=>`${c}`.padStart(2,"0"),h:()=>`${c%12||12}`.padStart(1,"0"),ho:()=>b(c%12||12),hh:()=>`${c%12||12}`.padStart(2,"0"),m:()=>String(l),mo:()=>b(l),mm:()=>`${l}`.padStart(2,"0"),s:()=>String(p),so:()=>b(p),ss:()=>`${p}`.padStart(2,"0"),SSS:()=>`${m}`.padStart(3,"0"),d:()=>d,dd:()=>e.toLocaleDateString(n.locales,{weekday:"narrow"}),ddd:()=>e.toLocaleDateString(n.locales,{weekday:"short"}),dddd:()=>e.toLocaleDateString(n.locales,{weekday:"long"}),A:()=>f(c,l),AA:()=>f(c,l,!1,!0),a:()=>f(c,l,!0),aa:()=>f(c,l,!0,!0)};return t.replace(St,(v,g)=>{var y,w;return(w=g??((y=h[v])==null?void 0:y.call(h)))!=null?w:v})}function ie(e){if(e===null)return new Date(Number.NaN);if(e===void 0)return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){const t=e.match(Ot);if(t){const n=t[2]-1||0,r=(t[7]||"0").substring(0,3);return new Date(t[1],n,t[3]||1,t[4]||0,t[5]||0,t[6]||0,r)}}return new Date(e)}function Dt(e,t="HH:mm:ss",n={}){return i.computed(()=>ue(ie(a(e)),a(t),n))}function ce(e,t=1e3,n={}){const{immediate:r=!0,immediateCallback:o=!1}=n;let u=null;const s=i.ref(!1);function c(){u&&(clearInterval(u),u=null)}function l(){s.value=!1,c()}function p(){const m=a(t);m<=0||(s.value=!0,o&&e(),c(),u=setInterval(e,m))}if(r&&D&&p(),i.isRef(t)||typeof t=="function"){const m=i.watch(t,()=>{s.value&&D&&p()});A(m)}return A(l),{isActive:s,pause:l,resume:p}}function Ft(e=1e3,t={}){const{controls:n=!1,immediate:r=!0,callback:o}=t,u=i.ref(0),s=()=>u.value+=1,c=()=>{u.value=0},l=ce(o?()=>{s(),o(u.value)}:s,e,{immediate:r});return n?{counter:u,reset:c,...l}:u}function Mt(e,t={}){var n;const r=i.ref((n=t.initialValue)!=null?n:null);return i.watch(e,()=>r.value=X(),t),r}function se(e,t,n={}){const{immediate:r=!0}=n,o=i.ref(!1);let u=null;function s(){u&&(clearTimeout(u),u=null)}function c(){o.value=!1,s()}function l(...p){s(),o.value=!0,u=setTimeout(()=>{o.value=!1,u=null,e(...p)},a(t))}return r&&(o.value=!0,D&&l()),A(c),{isPending:i.readonly(o),start:l,stop:c}}function Pt(e=1e3,t={}){const{controls:n=!1,callback:r}=t,o=se(r??O,e,t),u=i.computed(()=>!o.isPending.value);return n?{ready:u,...o}:u}function Rt(e,t={}){const{method:n="parseFloat",radix:r,nanToZero:o}=t;return i.computed(()=>{let u=a(e);return typeof u=="string"&&(u=Number[n](u,r)),o&&Number.isNaN(u)&&(u=0),u})}function It(e){return i.computed(()=>`${a(e)}`)}function Et(e=!1,t={}){const{truthyValue:n=!0,falsyValue:r=!1}=t,o=i.isRef(e),u=i.ref(e);function s(c){if(arguments.length)return u.value=c,u.value;{const l=a(n);return u.value=u.value===l?a(r):l,u.value}}return o?s:[u,s]}function Ct(e,t,n){let r=n!=null&&n.immediate?[]:[...e instanceof Function?e():Array.isArray(e)?e:a(e)];return i.watch(e,(o,u,s)=>{const c=Array.from({length:r.length}),l=[];for(const m of o){let d=!1;for(let f=0;f<r.length;f++)if(!c[f]&&m===r[f]){c[f]=!0,d=!0;break}d||l.push(m)}const p=r.filter((m,d)=>!c[d]);t(o,r,l,p,s),r=[...o]},n)}function kt(e,t,n){const{count:r,...o}=n,u=i.ref(0),s=P(e,(...c)=>{u.value+=1,u.value>=a(r)&&i.nextTick(()=>s()),t(...c)},o);return{count:u,stop:s}}function ae(e,t,n={}){const{debounce:r=0,maxWait:o=void 0,...u}=n;return P(e,t,{...u,eventFilter:j(r,{maxWait:o})})}function xt(e,t,n){return i.watch(e,t,{...n,deep:!0})}function B(e,t,n={}){const{eventFilter:r=E,...o}=n,u=F(r,t);let s,c,l;if(o.flush==="sync"){const p=i.ref(!1);c=()=>{},s=m=>{p.value=!0,m(),p.value=!1},l=i.watch(e,(...m)=>{p.value||u(...m)},o)}else{const p=[],m=i.ref(0),d=i.ref(0);c=()=>{m.value=d.value},p.push(i.watch(e,()=>{d.value++},{...o,flush:"sync"})),s=f=>{const h=d.value;f(),m.value+=d.value-h},p.push(i.watch(e,(...f)=>{const h=m.value>0&&m.value===d.value;m.value=0,d.value=0,!h&&u(...f)},o)),l=()=>{p.forEach(f=>f())}}return{stop:l,ignoreUpdates:s,ignorePrevAsyncUpdates:c}}function _t(e,t,n){return i.watch(e,t,{...n,immediate:!0})}function Nt(e,t,n){const r=i.watch(e,(...o)=>(i.nextTick(()=>r()),t(...o)),n);return r}function le(e,t,n={}){const{throttle:r=0,trailing:o=!0,leading:u=!0,...s}=n;return P(e,t,{...s,eventFilter:L(r,o,u)})}function jt(e,t,n={}){let r;function o(){if(!r)return;const m=r;r=void 0,m()}function u(m){r=m}const s=(m,d)=>(o(),t(m,d,u)),c=B(e,s,n),{ignoreUpdates:l}=c;return{...c,trigger:()=>{let m;return l(()=>{m=s(Lt(e),Wt(e))}),m}}}function Lt(e){return i.isReactive(e)?e:Array.isArray(e)?e.map(t=>a(t)):a(e)}function Wt(e){return Array.isArray(e)?e.map(()=>{}):void 0}function Ut(e,t,n){const r=i.watch(e,(o,u,s)=>{o&&(n!=null&&n.once&&i.nextTick(()=>r()),t(o,u,s))},{...n,once:!1});return r}exports.assert=De;exports.autoResetRef=te;exports.bypassFilter=E;exports.camelize=je;exports.clamp=Pe;exports.computedEager=Y;exports.computedWithControl=$;exports.containsProp=ee;exports.controlledComputed=$;exports.controlledRef=qe;exports.createEventHook=de;exports.createFilterWrapper=F;exports.createGlobalState=me;exports.createInjectionState=pe;exports.createReactiveFn=_;exports.createSharedComposable=he;exports.createSingletonPromise=We;exports.debounceFilter=j;exports.debouncedRef=U;exports.debouncedWatch=ae;exports.directiveHooks=ke;exports.eagerComputed=Y;exports.extendRef=q;exports.formatDate=ue;exports.get=ve;exports.getLifeCycleTarget=M;exports.hasOwn=Ie;exports.hyphenate=_e;exports.identity=Le;exports.ignorableWatch=B;exports.increaseWithUnit=Ve;exports.injectLocal=z;exports.invoke=Ue;exports.isClient=D;exports.isDef=Se;exports.isDefined=ye;exports.isIOS=Ee;exports.isObject=J;exports.isWorker=Oe;exports.makeDestructurable=ge;exports.noop=O;exports.normalizeDate=ie;exports.notNullish=Te;exports.now=Me;exports.objectEntries=Ye;exports.objectOmit=He;exports.objectPick=Be;exports.pausableFilter=K;exports.pausableWatch=I;exports.promiseTimeout=k;exports.provideLocal=G;exports.rand=Re;exports.reactify=_;exports.reactifyObject=be;exports.reactiveComputed=N;exports.reactiveOmit=Ae;exports.reactivePick=Ge;exports.refAutoReset=te;exports.refDebounced=U;exports.refDefault=ze;exports.refThrottled=V;exports.refWithControl=oe;exports.resolveRef=$e;exports.resolveUnref=we;exports.set=Ze;exports.syncRef=Je;exports.syncRefs=Xe;exports.throttleFilter=L;exports.throttledRef=V;exports.throttledWatch=le;exports.timestamp=X;exports.toReactive=Z;exports.toRef=W;exports.toRefs=Ke;exports.toValue=a;exports.tryOnBeforeMount=Qe;exports.tryOnBeforeUnmount=et;exports.tryOnMounted=tt;exports.tryOnScopeDispose=A;exports.tryOnUnmounted=nt;exports.until=rt;exports.useArrayDifference=ut;exports.useArrayEvery=it;exports.useArrayFilter=ct;exports.useArrayFind=st;exports.useArrayFindIndex=at;exports.useArrayFindLast=ft;exports.useArrayIncludes=mt;exports.useArrayJoin=pt;exports.useArrayMap=ht;exports.useArrayReduce=vt;exports.useArraySome=yt;exports.useArrayUnique=bt;exports.useCounter=At;exports.useDateFormat=Dt;exports.useDebounce=U;exports.useDebounceFn=ne;exports.useInterval=Ft;exports.useIntervalFn=ce;exports.useLastChanged=Mt;exports.useThrottle=V;exports.useThrottleFn=re;exports.useTimeout=Pt;exports.useTimeoutFn=se;exports.useToNumber=Rt;exports.useToString=It;exports.useToggle=Et;exports.watchArray=Ct;exports.watchAtMost=kt;exports.watchDebounced=ae;exports.watchDeep=xt;exports.watchIgnorable=B;exports.watchImmediate=_t;exports.watchOnce=Nt;exports.watchPausable=I;exports.watchThrottled=le;exports.watchTriggerable=jt;exports.watchWithFilter=P;exports.whenever=Ut;
|
package/dist/lib/packages/antdv/components/scale-virtual-list/component/scale-virtual-list.vue2.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("../../../hooks/use-namespace/index.js"),_=require("../hooks/useVirtualList.js"),B=e.defineComponent({__name:"scale-virtual-list",props:{list:{},option:{}},emits:["update:state"],setup(l,{expose:n,emit:o}){const a=l,c=o,{list:i}=e.toRefs(a),{list:u,containerProps:p,wrapperProps:d,scrollTo:m,scaleTo:f,state:v,onUpdate:k}=_.useVirtualList(i,a.option);return n({scrollTo:m,scaleTo:f,state:v}),k(t=>c("update:state",t)),(t,g)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:`${e.unref(r.defaultNamespace)}-scale-virtual-list`},e.unref(p)),[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(r.defaultNamespace)}-scale-virtual-list-container`)},[e.createElementVNode("div",e.mergeProps({class:`${e.unref(r.defaultNamespace)}-scale-vittual-wrapper`},e.unref(d)),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),s=>(e.openBlock(),e.createElementBlock("div",{key:s.index},[e.renderSlot(t.$slots,"default",{item:s,index:s.index})]))),128))],16)],2)],16))}});exports.default=B;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("../../../../../node_modules/.pnpm/@vueuse_shared@10.11.1_vue@3.4.38/node_modules/@vueuse/shared/index.js"),f=require("vue-demi"),M=require("@vueuse/core");function S(r,t){const{containerStyle:a,wrapperProps:o,scrollTo:c,calculateRange:e,currentList:n,containerRef:l,scaleTo:u,state:s,onUpdate:v}="itemHeight"in t?F(t,r):_(t,r);return{onUpdate:v,state:s,scaleTo:u,list:n,scrollTo:c,containerProps:{ref:l,onScroll:()=>{e()},style:a},wrapperProps:o}}function O(r){const t=f.ref(null),a=M.useElementSize(t),o=f.ref([]),c=f.shallowRef(r);return{state:f.ref({start:0,end:10,current:0,scale:1}),source:c,currentList:o,size:a,containerRef:t}}function $(r,t,a){return o=>{const{start:c=0,scale:e=1}=r.value;if(typeof a=="number")return Math.ceil(o/(a*e));let n=0,l=0;for(let u=c;u<t.value.length;u++){const s=a(u)*e;if(n+=s,l=u,n>o)break}return l-c}}function P(r,t,a){return o=>{const{scale:c=1}=a.value;if(typeof t=="number")return Math.floor(o/(t*c))+1;let e=0,n=0;for(let l=0;l<r.value.length;l++){const u=t(l)*c;if(e+=u,e>=o){n=l;break}}return n+1}}function k(r,t,a,o,{containerRef:c,state:e,currentList:n,source:l},u){return()=>{const s=c.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-1,scale:e.value.scale},n.value=l.value.slice(e.value.start,e.value.end).map((d,p)=>({data:d,index:p+e.value.start})),u(e.value)}}}function D(r,t,a){return o=>{const{scale:c=1}=a.value;return typeof r=="number"?o*(r*c):t.value.slice(0,o).reduce((n,l,u)=>n+r(u)*c,0)}}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((c,e,n)=>c+r(n)*o,0)})}const U={horizontal:"scrollLeft",vertical:"scrollTop"};function q(r,t,a,o){return c=>{o.value&&(o.value[U[r]]=a(c),t())}}function _(r,t){const{on:a,trigger:o}=C.createEventHook(),c=O(t),{state:e,source:n,currentList:l,size:u,containerRef:s}=c,v={overflowX:"auto"},{itemWidth:i,overscan:g=5}=r,h=$(e,n,i),d=P(n,i,e),p=k("horizontal",g,d,h,c,o),m=D(i,n,e),y=f.computed(()=>m(e.value.start)),b=W(i,n,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:"50% 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}=C.createEventHook(),c=O(t),{state:e,source:n,currentList:l,size:u,containerRef:s}=c,v={overflowY:"auto"},{itemHeight:i,overscan:g=5}=r,h=$(e,n,i),d=P(n,i,e),p=k("vertical",g,d,h,c,o),m=D(i,n,e),y=f.computed(()=>m(e.value.start)),b=W(i,n,e);E(u,t,s,p);const R=q("vertical",p,m,s),V=T=>{const L=s.value;if(L){const{current:x}=e.value;let w=0;typeof i=="number"?w=x*(T*i-e.value.scale*i):w=n.value.slice(0,x).reduce((G,j,z)=>G+T*i(z)-e.value.scale*i(z),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:`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
|
-
: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-
|
|
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-vittual-wrapper{width:-moz-fit-content;width:fit-content;margin:0 auto}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.king-scale-virtual-list{width:100%;height:100%}.king-scale-virtual-list .king-scale-
|
|
1
|
+
.king-scale-virtual-list{width:100%;height:100%}.king-scale-virtual-list .king-scale-vittual-wrapper{width:-moz-fit-content;width:fit-content;margin:0 auto}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { UseVirtualListState } from '../hooks/useVirtualList';
|
|
1
2
|
import { VirtualListProps, VirtualListSlot } from './types';
|
|
2
|
-
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
import { DefineComponent, Ref, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
4
|
declare function __VLS_template(): {
|
|
4
5
|
slots: Readonly<VirtualListSlot> & VirtualListSlot;
|
|
5
6
|
refs: {};
|
|
@@ -9,7 +10,12 @@ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
|
9
10
|
declare const __VLS_component: DefineComponent<__VLS_TypePropsToOption<VirtualListProps>, {
|
|
10
11
|
scrollTo: (index: number) => void;
|
|
11
12
|
scaleTo: (s: number) => void;
|
|
12
|
-
|
|
13
|
+
state: Ref<UseVirtualListState>;
|
|
14
|
+
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
15
|
+
"update:state": (state: UseVirtualListState | null) => void;
|
|
16
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToOption<VirtualListProps>>> & {
|
|
17
|
+
"onUpdate:state"?: ((state: UseVirtualListState | null) => any) | undefined;
|
|
18
|
+
}, {}, {}>;
|
|
13
19
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
14
20
|
export default _default;
|
|
15
21
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MaybeRef } from '@vueuse/shared';
|
|
1
|
+
import { EventHookOn, MaybeRef } from '@vueuse/shared';
|
|
2
2
|
import { ComputedRef, Ref, StyleValue } from 'vue-demi';
|
|
3
|
-
interface UseVirtualListState {
|
|
3
|
+
export interface UseVirtualListState {
|
|
4
4
|
start: number;
|
|
5
5
|
end: number;
|
|
6
6
|
current: number;
|
|
@@ -38,6 +38,7 @@ export interface UseVirtualListItem<T> {
|
|
|
38
38
|
index: number;
|
|
39
39
|
}
|
|
40
40
|
export interface UseVirtualListReturn<T> {
|
|
41
|
+
onUpdate: EventHookOn<UseVirtualListState | null>;
|
|
41
42
|
state: RefState;
|
|
42
43
|
list: Ref<UseVirtualListItem<T>[]>;
|
|
43
44
|
scrollTo: (index: number) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SFCWithInstall } from '../utils/install';
|
|
2
|
-
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase } from 'vue';
|
|
3
|
-
import { UseVirtualListOptions } from './hooks/useVirtualList';
|
|
2
|
+
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, Ref, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase } from 'vue';
|
|
3
|
+
import { UseVirtualListOptions, UseVirtualListState } from './hooks/useVirtualList';
|
|
4
4
|
import { VirtualListSlot } from './component/types';
|
|
5
5
|
export * from './style/index';
|
|
6
6
|
export * from './component/types';
|
|
@@ -14,10 +14,15 @@ export declare const KScaleVirtualList: SFCWithInstall<{
|
|
|
14
14
|
type: PropType<UseVirtualListOptions>;
|
|
15
15
|
required: true;
|
|
16
16
|
};
|
|
17
|
-
}
|
|
17
|
+
}>> & {
|
|
18
|
+
"onUpdate:state"?: ((state: UseVirtualListState | null) => any) | undefined;
|
|
19
|
+
}, {
|
|
18
20
|
scrollTo: (index: number) => void;
|
|
19
21
|
scaleTo: (s: number) => void;
|
|
20
|
-
|
|
22
|
+
state: Ref<UseVirtualListState>;
|
|
23
|
+
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
24
|
+
"update:state": (state: UseVirtualListState | null) => void;
|
|
25
|
+
}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
21
26
|
list: {
|
|
22
27
|
type: PropType<any[]>;
|
|
23
28
|
required: true;
|
|
@@ -26,7 +31,9 @@ export declare const KScaleVirtualList: SFCWithInstall<{
|
|
|
26
31
|
type: PropType<UseVirtualListOptions>;
|
|
27
32
|
required: true;
|
|
28
33
|
};
|
|
29
|
-
}
|
|
34
|
+
}>> & {
|
|
35
|
+
"onUpdate:state"?: ((state: UseVirtualListState | null) => any) | undefined;
|
|
36
|
+
}, {}, true, {}, {}, {
|
|
30
37
|
P: {};
|
|
31
38
|
B: {};
|
|
32
39
|
D: {};
|
|
@@ -42,9 +49,12 @@ export declare const KScaleVirtualList: SFCWithInstall<{
|
|
|
42
49
|
type: PropType<UseVirtualListOptions>;
|
|
43
50
|
required: true;
|
|
44
51
|
};
|
|
45
|
-
}
|
|
52
|
+
}>> & {
|
|
53
|
+
"onUpdate:state"?: ((state: UseVirtualListState | null) => any) | undefined;
|
|
54
|
+
}, {
|
|
46
55
|
scrollTo: (index: number) => void;
|
|
47
56
|
scaleTo: (s: number) => void;
|
|
57
|
+
state: Ref<UseVirtualListState>;
|
|
48
58
|
}, {}, {}, {}, {}>;
|
|
49
59
|
__isFragment?: never;
|
|
50
60
|
__isTeleport?: never;
|
|
@@ -58,10 +68,15 @@ export declare const KScaleVirtualList: SFCWithInstall<{
|
|
|
58
68
|
type: PropType<UseVirtualListOptions>;
|
|
59
69
|
required: true;
|
|
60
70
|
};
|
|
61
|
-
}
|
|
71
|
+
}>> & {
|
|
72
|
+
"onUpdate:state"?: ((state: UseVirtualListState | null) => any) | undefined;
|
|
73
|
+
}, {
|
|
62
74
|
scrollTo: (index: number) => void;
|
|
63
75
|
scaleTo: (s: number) => void;
|
|
64
|
-
|
|
76
|
+
state: Ref<UseVirtualListState>;
|
|
77
|
+
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
78
|
+
"update:state": (state: UseVirtualListState | null) => void;
|
|
79
|
+
}, string, {}, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
65
80
|
$slots: Readonly< VirtualListSlot> & VirtualListSlot;
|
|
66
81
|
})>;
|
|
67
82
|
export default KScaleVirtualList;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("../../../hooks/use-namespace/index.js"),f=require("../hooks/useVirtualList.js"),m=e.defineComponent({__name:"scale-virtual-list",props:{list:{},option:{}},setup(l,{expose:n}){const s=l,{list:o}=e.toRefs(s),{list:a,containerProps:c,wrapperProps:i,scrollTo:u,scaleTo:p}=f.useVirtualList(o,s.option);return n({scrollTo:u,scaleTo:p}),(d,v)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:`${e.unref(r.defaultNamespace)}-scale-virtual-list`},e.unref(c)),[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(r.defaultNamespace)}-scale-virtual-list-container`)},[e.createElementVNode("div",e.mergeProps({class:`${e.unref(r.defaultNamespace)}-scale-vittual-wrapper`},e.unref(i)),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),t=>(e.openBlock(),e.createElementBlock("div",{key:t.index},[e.renderSlot(d.$slots,"default",{item:t,index:t.index})]))),128))],16)],2)],16))}});exports.default=m;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue-demi"),M=require("@vueuse/core");function S(c,t){const{containerStyle:n,wrapperProps:e,scrollTo:r,calculateRange:a,currentList:u,containerRef:o,scaleTo:s,state:l}="itemHeight"in t?q(t,c):k(t,c);return{state:l,scaleTo:s,list:u,scrollTo:r,containerProps:{ref:o,onScroll:()=>{a()},style:n},wrapperProps:e}}function C(c){const t=i.ref(null),n=M.useElementSize(t),e=i.ref([]),r=i.shallowRef(c);return{state:i.ref({start:0,end:10,current:0,scale:1}),source:r,currentList:e,size:n,containerRef:t}}function O(c,t,n){return e=>{const{start:r=0,scale:a=1}=c.value;if(typeof n=="number")return Math.ceil(e/(n*a));let u=0,o=0;for(let s=r;s<t.value.length;s++){const l=n(s)*a;if(u+=l,o=s,u>e)break}return o-r}}function $(c,t,n){return e=>{const{scale:r=1}=n.value;if(typeof t=="number")return Math.floor(e/(t*r))+1;let a=0,u=0;for(let o=0;o<c.value.length;o++){const s=t(o)*r;if(a+=s,a>=e){u=o;break}}return u+1}}function x(c,t,n,e,{containerRef:r,state:a,currentList:u,source:o}){return()=>{const s=r.value;if(s){const l=n(c==="vertical"?s.scrollTop:s.scrollLeft),h=e(c==="vertical"?s.clientHeight:s.clientWidth),p=l-t,g=l+h+t;a.value={start:p<0?0:p,end:g>o.value.length?o.value.length:g,current:l-1,scale:a.value.scale},u.value=o.value.slice(a.value.start,a.value.end).map((f,v)=>({data:f,index:v+a.value.start}))}}}function H(c,t,n){return e=>{const{scale:r=1}=n.value;return typeof c=="number"?e*(c*r):t.value.slice(0,e).reduce((u,o,s)=>u+c(s)*r,0)}}function P(c,t,n,e){i.watch([c.width,c.height,t,n],()=>{e()})}function D(c,t,n){return i.computed(()=>{const{scale:e=1}=n.value;return typeof c=="number"?t.value.length*c*e:t.value.reduce((r,a,u)=>r+c(u)*e,0)})}const _={horizontal:"scrollLeft",vertical:"scrollTop"};function W(c,t,n,e){return r=>{e.value&&(e.value[_[c]]=n(r),t())}}function k(c,t){const n=C(t),{state:e,source:r,currentList:a,size:u,containerRef:o}=n,s={overflowX:"auto"},{itemWidth:l,overscan:h=5}=c,p=O(e,r,l),g=$(r,l,e),f=x("horizontal",h,g,p,n),v=H(l,r,e),m=i.computed(()=>v(e.value.start)),L=D(l,r,e);P(u,t,o,f);const w=W("horizontal",f,v,o),b=d=>{e.value.scale=d},R=i.computed(()=>({style:{height:"100%",width:`${L.value-m.value}px`,marginLeft:`${m.value}px`,display:"flex",transform:`scale(${e.value.scale})`,transformOrigin:"50% 0%"}}));return{state:e,scaleTo:b,scrollTo:w,calculateRange:f,wrapperProps:R,containerStyle:s,currentList:a,containerRef:o}}function q(c,t){const n=C(t),{state:e,source:r,currentList:a,size:u,containerRef:o}=n,s={overflowY:"auto"},{itemHeight:l,overscan:h=5}=c,p=O(e,r,l),g=$(r,l,e),f=x("vertical",h,g,p,n),v=H(l,r,e),m=i.computed(()=>v(e.value.start)),L=D(l,r,e);P(u,t,o,f);const w=W("vertical",f,v,o),b=d=>{const y=o.value;if(y){const{current:V}=e.value;let T=0;typeof l=="number"?T=V*(d*l-e.value.scale*l):T=r.value.slice(0,V).reduce((G,E,z)=>G+d*l(z)-e.value.scale*l(z),0),y.scrollTop=y.scrollTop+T>=0?y.scrollTop+T:0,e.value.scale=d}},R=i.computed(()=>({style:{height:`${L.value-m.value}px`,marginTop:`${m.value}px`,transform:`translateX(-50%) scale(${e.value.scale})`,transformOrigin:"50% 0%"}}));return{state:e,scaleTo:b,calculateRange:f,scrollTo:w,containerStyle:s,wrapperProps:R,currentList:a,containerRef:o}}exports.useVirtualList=S;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/{components → packages/antdv/components}/collapse-transtion/style/index.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/{components → packages/antdv/components}/pro-dialog/src/pro-dialog.vue2.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/{components → packages/antdv/components}/scale-virtual-list/component/types.js
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/lib/{components → packages/antdv/components}/scale-virtual-list/style/index.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/{components → packages/antdv/components}/virtual-list/src/virtual-list.vue.js
RENAMED
|
File without changes
|
/package/dist/lib/{components → packages/antdv/components}/virtual-list/src/virtual-list.vue2.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|