(function(m,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue"),require("@vueuse/core"),require("lodash-es"),require("dayjs"),require("ant-design-vue")):typeof define=="function"&&define.amd?define(["exports","vue","@vueuse/core","lodash-es","dayjs","ant-design-vue"],s):(m=typeof globalThis<"u"?globalThis:m||self,s(m.index={},m.Vue,m.core))})(this,function(m,s,F){"use strict";function Q({el:e=window,name:r,listener:t,options:n,autoRemove:i=!0,isDebounce:o=!0,wait:l=80}){let a=()=>{};const u=s.ref(!1);if(e){const f=s.ref(e),y=o?F.useDebounceFn(t,l):F.useThrottleFn(t,l),P=l?y:t,x=c=>{u.value=!0,c.removeEventListener(r,P,n)},L=c=>c.addEventListener(r,P,n),R=s.watch(f,(c,h,b)=>{c&&(!s.unref(u)&&L(c),b(()=>{i&&x(c)}))},{immediate:!0});a=()=>{x(f.value),R()}}return{removeEvent:a}}const X="G";function Z(e){return typeof e=="function"}for(let e=0;e<=15;e++)e.toString(16);/*!
 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */function A(e){return Object.prototype.toString.call(e)==="[object Object]"}function ee(e){var r,t;return A(e)===!1?!1:(r=e.constructor,r===void 0?!0:(t=r.prototype,!(A(t)===!1||t.hasOwnProperty("isPrototypeOf")===!1)))}function $(){return $=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},$.apply(this,arguments)}function W(e,r){if(e==null)return{};var t,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r.indexOf(t=o[n])>=0||(i[t]=e[t]);return i}const V={silent:!1,logLevel:"warn"},te=["validator"],M=Object.prototype,k=M.toString,ne=M.hasOwnProperty,C=/^\s*function (\w+)/;function D(e){var r;const t=(r=e==null?void 0:e.type)!==null&&r!==void 0?r:e;if(t){const n=t.toString().match(C);return n?n[1]:""}return""}const O=ee,I=e=>e;let d=I;process.env.NODE_ENV!=="production"&&(d=typeof console<"u"?function(r,t=V.logLevel){V.silent===!1&&console[t](`[VueTypes warn]: ${r}`)}:I);const j=(e,r)=>ne.call(e,r),re=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},T=Array.isArray||function(e){return k.call(e)==="[object Array]"},w=e=>k.call(e)==="[object Function]",N=e=>O(e)&&j(e,"_vueTypes_name"),B=e=>O(e)&&(j(e,"type")||["_vueTypes_name","validator","default","required"].some(r=>j(e,r)));function q(e,r){return Object.defineProperty(e.bind(r),"__original",{value:e})}function _(e,r,t=!1){let n,i=!0,o="";n=O(e)?e:{type:e};const l=N(n)?n._vueTypes_name+" - ":"";if(B(n)&&n.type!==null){if(n.type===void 0||n.type===!0||!n.required&&r===void 0)return i;T(n.type)?(i=n.type.some(a=>_(a,r,!0)===!0),o=n.type.map(a=>D(a)).join(" or ")):(o=D(n),i=o==="Array"?T(r):o==="Object"?O(r):o==="String"||o==="Number"||o==="Boolean"||o==="Function"?function(a){if(a==null)return"";const u=a.constructor.toString().match(C);return u?u[1]:""}(r)===o:r instanceof n.type)}if(!i){const a=`${l}value "${r}" should be of type "${o}"`;return t===!1?(d(a),!1):a}if(j(n,"validator")&&w(n.validator)){const a=d,u=[];if(d=f=>{u.push(f)},i=n.validator(r),d=a,!i){const f=(u.length>1?"* ":"")+u.join(`
* `);return u.length=0,t===!1?(d(f),i):f}}return i}function p(e,r){const t=Object.defineProperties(r,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(i){return i===void 0?(j(this,"default")&&delete this.default,this):w(i)||_(this,i,!0)===!0?(this.default=T(i)?()=>[...i]:O(i)?()=>Object.assign({},i):i,this):(d(`${this._vueTypes_name} - invalid default value: "${i}"`),this)}}}),{validator:n}=t;return w(n)&&(t.validator=q(n,t)),t}function g(e,r){const t=p(e,r);return Object.defineProperty(t,"validate",{value(n){return w(this.validator)&&d(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:
${JSON.stringify(this)}`),this.validator=q(n,this),this}})}function Y(e,r,t){const n=function(u){const f={};return Object.getOwnPropertyNames(u).forEach(y=>{f[y]=Object.getOwnPropertyDescriptor(u,y)}),Object.defineProperties({},f)}(r);if(n._vueTypes_name=e,!O(t))return n;const{validator:i}=t,o=W(t,te);if(w(i)){let{validator:u}=n;u&&(u=(a=(l=u).__original)!==null&&a!==void 0?a:l),n.validator=q(u?function(f){return u.call(this,f)&&i.call(this,f)}:i,n)}var l,a;return Object.assign(n,o)}function E(e){return e.replace(/^(?!\s*$)/gm,"  ")}const ie=()=>g("any",{}),oe=()=>g("function",{type:Function}),se=()=>g("boolean",{type:Boolean}),ae=()=>g("string",{type:String}),ue=()=>g("number",{type:Number}),le=()=>g("array",{type:Array}),ce=()=>g("object",{type:Object}),fe=()=>p("integer",{type:Number,validator:e=>re(e)}),de=()=>p("symbol",{validator:e=>typeof e=="symbol"});function pe(e,r="custom validation failed"){if(typeof e!="function")throw new TypeError("[VueTypes error]: You must provide a function as argument");return p(e.name||"<<anonymous function>>",{type:null,validator(t){const n=e(t);return n||d(`${this._vueTypes_name} - ${r}`),n}})}function ye(e){if(!T(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const r=`oneOf - value should be one of "${e.join('", "')}".`,t=e.reduce((n,i)=>{if(i!=null){const o=i.constructor;n.indexOf(o)===-1&&n.push(o)}return n},[]);return p("oneOf",{type:t.length>0?t:void 0,validator(n){const i=e.indexOf(n)!==-1;return i||d(r),i}})}function he(e){if(!T(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let r=!1,t=[];for(let i=0;i<e.length;i+=1){const o=e[i];if(B(o)){if(N(o)&&o._vueTypes_name==="oneOf"&&o.type){t=t.concat(o.type);continue}if(w(o.validator)&&(r=!0),o.type===!0||!o.type){d('oneOfType - invalid usage of "true" or "null" as types.');continue}t=t.concat(o.type)}else t.push(o)}t=t.filter((i,o)=>t.indexOf(i)===o);const n=t.length>0?t:null;return p("oneOfType",r?{type:n,validator(i){const o=[],l=e.some(a=>{const u=_(N(a)&&a._vueTypes_name==="oneOf"?a.type||null:a,i,!0);return typeof u=="string"&&o.push(u),u===!0});return l||d(`oneOfType - provided value does not match any of the ${o.length} passed-in validators:
${E(o.join(`
`))}`),l}}:{type:n})}function ge(e){return p("arrayOf",{type:Array,validator(r){let t="";const n=r.every(i=>(t=_(e,i,!0),t===!0));return n||d(`arrayOf - value validation error:
${E(t)}`),n}})}function me(e){return p("instanceOf",{type:e})}function ve(e){return p("objectOf",{type:Object,validator(r){let t="";const n=Object.keys(r).every(i=>(t=_(e,r[i],!0),t===!0));return n||d(`objectOf - value validation error:
${E(t)}`),n}})}function be(e){const r=Object.keys(e),t=r.filter(i=>{var o;return!((o=e[i])===null||o===void 0||!o.required)}),n=p("shape",{type:Object,validator(i){if(!O(i))return!1;const o=Object.keys(i);if(t.length>0&&t.some(l=>o.indexOf(l)===-1)){const l=t.filter(a=>o.indexOf(a)===-1);return d(l.length===1?`shape - required property "${l[0]}" is not defined.`:`shape - required properties "${l.join('", "')}" are not defined.`),!1}return o.every(l=>{if(r.indexOf(l)===-1)return this._vueTypes_isLoose===!0||(d(`shape - shape definition does not include a "${l}" property. Allowed keys: "${r.join('", "')}".`),!1);const a=_(e[l],i[l],!0);return typeof a=="string"&&d(`shape - "${l}" property validation error:
 ${E(a)}`),a===!0})}});return Object.defineProperty(n,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(n,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),n}const Oe=["name","validate","getter"],_e=(()=>{var e;return(e=class{static get any(){return ie()}static get func(){return oe().def(this.defaults.func)}static get bool(){return se().def(this.defaults.bool)}static get string(){return ae().def(this.defaults.string)}static get number(){return ue().def(this.defaults.number)}static get array(){return le().def(this.defaults.array)}static get object(){return ce().def(this.defaults.object)}static get integer(){return fe().def(this.defaults.integer)}static get symbol(){return de()}static get nullable(){return{type:null}}static extend(r){if(T(r))return r.forEach(u=>this.extend(u)),this;const{name:t,validate:n=!1,getter:i=!1}=r,o=W(r,Oe);if(j(this,t))throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);const{type:l}=o;if(N(l))return delete o.type,Object.defineProperty(this,t,i?{get:()=>Y(t,l,o)}:{value(...u){const f=Y(t,l,o);return f.validator&&(f.validator=f.validator.bind(f,...u)),f}});let a;return a=i?{get(){const u=Object.assign({},o);return n?g(t,u):p(t,u)},enumerable:!0}:{value(...u){const f=Object.assign({},o);let y;return y=n?g(t,f):p(t,f),f.validator&&(y.validator=f.validator.bind(y,...u)),y},enumerable:!0},Object.defineProperty(this,t,a)}}).defaults={},e.sensibleDefaults=void 0,e.config=V,e.custom=pe,e.oneOf=ye,e.instanceOf=me,e.oneOfType=he,e.arrayOf=ge,e.objectOf=ve,e.shape=be,e.utils={validate:(r,t)=>_(t,r,!0)===!0,toType:(r,t,n=!1)=>n?g(r,t):p(r,t)},e})();function J(e={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){var r;return(r=class extends _e{static get sensibleDefaults(){return $({},this.defaults)}static set sensibleDefaults(t){this.defaults=t!==!1?$({},t!==!0?t:e):{}}}).defaults=$({},e),r}class $e extends J(){}J({func:void 0,bool:void 0,string:void 0,number:void 0,object:void 0,integer:void 0}).extend([{name:"style",getter:!0,type:[String,Object],default:void 0},{name:"VNodeChild",getter:!0,type:void 0}]);function je(e,r="default",t,n){if(!e||!Reflect.has(e,r))return null;if(!Z(e[r]))return console.error(`${r} is not a function!`),null;const i=e[r];if(!i)return null;const o={...t,...n};return i(o)}const Te={height:[Number,String],maxHeight:[Number,String],maxWidth:[Number,String],minHeight:[Number,String],minWidth:[Number,String],width:[Number,String],bench:{type:[Number,String],default:0},itemHeight:{type:[Number,String],required:!0},items:{type:Array,default:()=>[]}},Ne="",H="virtual-scroll";function v(e,r="px"){if(!(e==null||e===""))return isNaN(+e)?String(e):`${Number(e)}${r}`}const we=s.defineComponent({name:`${X}VirtualScroll`,props:Te,setup(e,{slots:r}){const t=s.ref(null),n=s.reactive({first:0,last:0,scrollTop:0}),i=s.computed(()=>parseInt(e.bench,10)),o=s.computed(()=>parseInt(e.itemHeight,10)),l=s.computed(()=>Math.max(0,n.first-s.unref(i))),a=s.computed(()=>Math.min((e.items||[]).length,n.last+s.unref(i))),u=s.computed(()=>({height:v((e.items||[]).length*s.unref(o))})),f=s.computed(()=>{const c={},h=v(e.height),b=v(e.minHeight),z=v(e.minWidth),G=v(e.maxHeight),U=v(e.maxWidth),K=v(e.width);return h&&(c.height=h),b&&(c.minHeight=b),z&&(c.minWidth=z),G&&(c.maxHeight=G),U&&(c.maxWidth=U),K&&(c.width=K),c});s.watch([()=>e.itemHeight,()=>e.height],()=>{x()});function y(c){const h=s.unref(t);if(!h)return 0;const b=parseInt(e.height||0,10)||h.clientHeight;return c+Math.ceil(b/s.unref(o))}function P(){return Math.floor(n.scrollTop/s.unref(o))}function x(){const c=s.unref(t);c&&(n.scrollTop=c.scrollTop,n.first=P(),n.last=y(n.first))}function L(){const{items:c=[]}=e;return c.slice(s.unref(l),s.unref(a)).map(R)}function R(c,h){h+=s.unref(l);const b=v(h*s.unref(o));return s.createVNode("div",{class:`${H}__item`,style:{top:b},key:h},[je(r,"default",{index:h,item:c})])}return s.onMounted(()=>{n.last=y(0),s.nextTick(()=>{const c=s.unref(t);c&&Q({el:c,name:"scroll",listener:x,wait:0})})}),()=>s.createVNode("div",{class:H,style:s.unref(f),ref:t},[s.createVNode("div",{class:`${H}__container`,style:s.unref(u)},[L()])])}}),Ee="",S=((e,r)=>{const t=e.__vccOpts||e;for(const[n,i]of r)t[n]=i;return t})(we,[["__scopeId","data-v-65d50d5e"]]);S.install=function(e,r){e.component(r||S.name,S)};const Se={title:"VirtualScroll 虚拟滚动",category:"数据描述",status:"100%",install(e){e.component(S.name,S)}};m.VirtualScroll=S,m.default=Se,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
