st-comp 0.0.280 → 0.0.282
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/es/CustomFunction.cjs +2 -2
- package/es/CustomFunction.js +512 -306
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +25 -25
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +10 -10
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +418 -416
- package/es/KlineConfig.cjs +1 -1
- package/es/KlineConfig.js +16 -16
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +9 -9
- package/es/KlinePlus.cjs +1 -1
- package/es/KlinePlus.js +11 -11
- package/es/MonacoEditor.cjs +1 -1
- package/es/MonacoEditor.js +17 -17
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +13 -13
- package/es/PasswordPrompt.cjs +1 -1
- package/es/PasswordPrompt.js +2 -2
- package/es/Table.cjs +1 -1
- package/es/Table.js +22 -22
- package/es/User.cjs +1 -1
- package/es/User.js +18 -18
- package/es/VarSelectDialog.cjs +1 -1
- package/es/VarSelectDialog.js +19 -19
- package/es/VarietyAiHelper.cjs +7 -7
- package/es/VarietyAiHelper.js +426 -437
- package/es/VarietyAutoComplete.cjs +1 -1
- package/es/VarietyAutoComplete.js +7 -7
- package/es/VarietySearch.cjs +8 -8
- package/es/VarietySearch.js +385 -372
- package/es/{VarietySelect-c402bade.js → VarietySelect-3fc0f0ce.js} +3 -3
- package/es/{VarietySelect-aa082a9c.cjs → VarietySelect-d2d25a3d.cjs} +1 -1
- package/es/VarietyTextCopy.cjs +1 -1
- package/es/VarietyTextCopy.js +9 -9
- package/es/VirtualTable.cjs +1 -1
- package/es/VirtualTable.js +94 -94
- package/es/{_baseClone-10bdb989.cjs → _baseClone-f8e5d3ba.cjs} +1 -1
- package/es/{_baseClone-98af8b33.js → _baseClone-fb6a3947.js} +2 -2
- package/es/{config-provider-563023c9.js → config-provider-06d8207f.js} +3 -3
- package/es/{config-provider-33a127c4.cjs → config-provider-bb61bd3e.cjs} +1 -1
- package/es/{dropdown-ce7496c7.cjs → dropdown-8fa21bfd.cjs} +1 -1
- package/es/{dropdown-feea8702.js → dropdown-bcf8d198.js} +2 -2
- package/es/{el-autocomplete-d9253bba.cjs → el-autocomplete-13b9e372.cjs} +1 -1
- package/es/{el-autocomplete-eac54f9f.js → el-autocomplete-419bfbcf.js} +5 -5
- package/es/{el-button-8a9721f8.js → el-button-ee9fe159.js} +3 -3
- package/es/{el-button-8259594b.cjs → el-button-fac5e058.cjs} +1 -1
- package/es/{el-checkbox-6303fc92.cjs → el-checkbox-6cf1a71c.cjs} +1 -1
- package/es/{el-checkbox-c328b097.js → el-checkbox-b5ac7f04.js} +4 -4
- package/es/{el-dialog-67536fac.js → el-dialog-060b3735.js} +4 -4
- package/es/{el-dialog-8788bcc1.cjs → el-dialog-54aebacd.cjs} +1 -1
- package/es/{el-form-item-8efcf2c3.js → el-form-item-2be6b683.js} +3 -3
- package/es/{el-form-item-95e68669.cjs → el-form-item-758dfefa.cjs} +1 -1
- package/es/{el-input-c8a9bb71.cjs → el-input-7fe53030.cjs} +1 -1
- package/es/{el-input-e66500b7.js → el-input-d23f5442.js} +60 -60
- package/es/{el-input-number-68ee0d65.js → el-input-number-484fb184.js} +15 -15
- package/es/{el-input-number-d7a81922.cjs → el-input-number-f0f4eedb.cjs} +1 -1
- package/es/{el-loading-db4c6d13.js → el-loading-9d3e405c.js} +1 -1
- package/es/{el-loading-62132db2.cjs → el-loading-fafaaa7b.cjs} +1 -1
- package/es/{el-menu-item-c2523d82.js → el-menu-item-0ac22681.js} +4 -4
- package/es/{el-menu-item-4b8e7794.cjs → el-menu-item-c91ae430.cjs} +1 -1
- package/es/{el-message-box-7c13546c.js → el-message-box-568a0aa6.js} +9 -9
- package/es/{el-message-box-fed174f0.cjs → el-message-box-ceacb54e.cjs} +1 -1
- package/es/{el-overlay-17299785.cjs → el-overlay-9f36e73c.cjs} +1 -1
- package/es/{el-overlay-36f223e9.js → el-overlay-cb5c85aa.js} +3 -3
- package/es/{el-popconfirm-520b2928.cjs → el-popconfirm-4a8cd35c.cjs} +1 -1
- package/es/{el-popconfirm-a857c54a.js → el-popconfirm-6f8e65c8.js} +4 -4
- package/es/{el-popper-852446fd.js → el-popper-0454c8e8.js} +1 -1
- package/es/{el-popper-f824c63b.cjs → el-popper-acd0ff35.cjs} +1 -1
- package/es/{el-segmented-bf08279f.js → el-segmented-64dc7258.js} +2 -2
- package/es/{el-segmented-45dcc036.cjs → el-segmented-eb3c8e65.cjs} +1 -1
- package/es/{el-select-a34348e1.js → el-select-a573c78b.js} +8 -8
- package/es/{el-select-d2958ae8.cjs → el-select-c317294a.cjs} +1 -1
- package/es/{el-table-column-e2be313e.js → el-table-column-1c443963.js} +9 -9
- package/es/{el-table-column-ad70ee0e.cjs → el-table-column-f555115d.cjs} +1 -1
- package/es/{el-tag-9bcfae32.js → el-tag-2d8a3fe7.js} +2 -2
- package/es/{el-tag-527f06f0.cjs → el-tag-dca1292c.cjs} +1 -1
- package/es/{el-text-fc345ffd.cjs → el-text-649c986a.cjs} +1 -1
- package/es/{el-text-f9379288.js → el-text-761e6717.js} +1 -1
- package/es/{index-7711aa69.cjs → index-11181b5f.cjs} +1 -1
- package/es/{index-5e76a22d.cjs → index-21a3dc89.cjs} +1 -1
- package/es/{index-99bb359f.cjs → index-33e039e3.cjs} +1 -1
- package/es/{index-bb0bc131.cjs → index-4614e8e9.cjs} +2 -2
- package/es/{index-dfb34e00.js → index-53beef02.js} +1 -1
- package/es/index-5cada1ed.cjs +1 -0
- package/es/{index-3ed0c678.cjs → index-6a36e1fc.cjs} +1 -1
- package/es/{index-60900c6c.js → index-6a52dc7c.js} +112 -82
- package/es/{index-b9a26e7f.js → index-78dab605.js} +3 -3
- package/es/{index-99d4335d.cjs → index-798fec2d.cjs} +1 -1
- package/es/{index-47d30a52.js → index-9573f74b.js} +1 -1
- package/es/{index-69d2353a.js → index-ab0ad219.js} +9 -9
- package/es/{index-3a0a7c36.cjs → index-beb5cb7d.cjs} +1 -1
- package/es/{index-86678b72.js → index-c09fc6f5.js} +2 -2
- package/es/{index-5dec535a.cjs → index-ceae4c47.cjs} +1 -1
- package/es/{index-a0522466.js → index-d9379af4.js} +2 -2
- package/es/{index-7c4d8f5d.js → index-dddacf80.js} +1 -1
- package/es/{index-2419d69a.js → index-e2e58ea9.js} +5 -5
- package/es/{python-922eca89.cjs → python-60e79979.cjs} +1 -1
- package/es/{python-6eafa04b.js → python-673bf8b8.js} +17 -17
- package/es/style.css +1 -1
- package/es/{use-form-item-0a831287.cjs → use-form-item-76516e50.cjs} +1 -1
- package/es/{use-form-item-187cd7db.js → use-form-item-784142b4.js} +16 -16
- package/es/{use-global-config-c90c91f7.cjs → use-global-config-7ff9a1c2.cjs} +1 -1
- package/es/{use-global-config-17dafd40.js → use-global-config-9a4ccf33.js} +2 -2
- package/es/{validator-ee5bc3eb.cjs → validator-1926345b.cjs} +1 -1
- package/es/{validator-800ed2ba.js → validator-a66ec4f8.js} +1 -1
- package/es/{zh-cn-26cc7233.js → zh-cn-51c2e528.js} +1 -1
- package/es/{zh-cn-a22a6792.cjs → zh-cn-ad12d9f5.cjs} +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +207 -207
- package/lib/{index-74ed48c6.js → index-2b2824f6.js} +23900 -23662
- package/lib/{python-7aaa84e4.js → python-b8d31c7a.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/es/index-3e7d5ffb.cjs +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { E as y } from "./el-autocomplete-
|
|
1
|
+
import { E as y } from "./el-autocomplete-419bfbcf.js";
|
|
2
2
|
import "./base-dd156b8e.js";
|
|
3
|
-
import "./el-input-
|
|
3
|
+
import "./el-input-d23f5442.js";
|
|
4
4
|
import "./el-scrollbar-0a42c1d0.js";
|
|
5
|
-
import "./el-popper-
|
|
5
|
+
import "./el-popper-0454c8e8.js";
|
|
6
6
|
import { inject as S, ref as V, openBlock as i, createElementBlock as p, createCommentVNode as b, createVNode as x, withCtx as v, createElementVNode as C, toDisplayString as E } from "vue";
|
|
7
7
|
import { U as z } from "./index-53cc4e43.js";
|
|
8
8
|
import { _ as B } from "./_plugin-vue_export-helper-dad06003.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const f=require("./el-autocomplete-
|
|
1
|
+
"use strict";const f=require("./el-autocomplete-13b9e372.cjs");require("./base-d987e5c9.cjs");require("./el-input-7fe53030.cjs");require("./el-scrollbar-225c6c9e.cjs");require("./el-popper-acd0ff35.cjs");const e=require("vue"),y=require("./index-94131fd7.cjs"),S=require("./_plugin-vue_export-helper-f246444f.cjs");const V={class:"variety-auto-complete"},b={key:0},q={class:"label"},x={__name:"VarietySelect",props:{size:{type:String,default:"default"},placeholder:{type:String,default:"请输入品种名称或代码"},labelShowEnable:{type:Boolean,default:!0},selectClearEnable:{type:Boolean,default:!0}},emits:["select","change"],setup(s,{emit:u}){const p=e.inject("stConfig"),r=u,n=s,c=e.ref(""),d=async(t,l)=>{if(t===""||t==="null")l([]);else{const a={keyWord:t,pageNum:1,pageSize:999,userId:y.U("id"),hotSearchFlag:1},{body:o}=await p.request.post("/common/qt/getFeatureInfosByPage",a),g=o.list.map(({code:i,featureName:h})=>({label:`${i} ${h}`,value:i}));l(g)}},_=({label:t,value:l})=>{const a=t.split(" ").at(-1);r("select",{name:a,code:l}),n.selectClearEnable&&(c.value="")},m=t=>{r("change",t)};return(t,l)=>{const a=f.ElAutocomplete;return e.openBlock(),e.createElementBlock("div",V,[s.labelShowEnable?(e.openBlock(),e.createElementBlock("span",b,"品种搜索:")):e.createCommentVNode("",!0),e.createVNode(a,{modelValue:c.value,"onUpdate:modelValue":l[0]||(l[0]=o=>c.value=o),clearable:"",size:n.size,placeholder:n.placeholder,"fetch-suggestions":d,onSelect:_,onChange:m},{default:e.withCtx(({item:o})=>[e.createElementVNode("div",q,e.toDisplayString(o.label),1)]),_:1},8,["modelValue","size","placeholder"])])}}},v=S._export_sfc(x,[["__scopeId","data-v-31c6f027"]]);exports.VarietySelect=v;
|
package/es/VarietyTextCopy.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const i=require("./index-
|
|
1
|
+
"use strict";const i=require("./index-5cada1ed.cjs"),m=require("./el-popper-acd0ff35.cjs"),v=require("./el-input-7fe53030.cjs"),q=require("./index-ceae4c47.cjs");require("./base-d987e5c9.cjs");require("./el-tooltip-0ea8fbf8.cjs");const e=require("vue");require("./el-message-0ea8fbf8.cjs");const V=require("./_plugin-vue_export-helper-f246444f.cjs");require("./index-d372e68f.cjs");require("./use-form-item-76516e50.cjs");require("./raf-735cc598.cjs");require("./index-11181b5f.cjs");require("./typescript-b63f8e83.cjs");require("./config-provider-bb61bd3e.cjs");require("./use-global-config-7ff9a1c2.cjs");require("./index-6a36e1fc.cjs");const f={class:"variety-text-copy"},y={class:"stats-container"},N={class:"stat-item"},g={class:"value"},E={__name:"index",props:{required:{type:Boolean,default:!0}},setup(l,{expose:u}){const c=e.inject("stConfig"),d=l,n=e.ref(""),p=e.computed(()=>a(n.value).length),a=o=>o?o.split(`
|
|
2
2
|
`).reduce((t,s)=>{const r=s.trim().replace(/\s+/gi," ").split(" ")[0];return r&&t.push(r),t},[]):[];return u({validate:o=>new Promise(async(t,s)=>{try{if(d.required&&(!n.value||n.value.trim()===""))return q.ElMessage.error("品种内容不可为空"),o(!1);const{body:r}=await c.request.post("/invest/analysis/strategy/verifyCodes",{codes:a(n.value)});return o(!0,r)}catch(r){return s(r)}})}),(o,t)=>{const s=i.ElIcon,r=m.ElTooltip,_=v.ElInput;return e.openBlock(),e.createElementBlock("div",f,[e.createElementVNode("div",y,[e.createElementVNode("div",N,[t[2]||(t[2]=e.createElementVNode("span",{class:"label"},"品种数量统计:",-1)),e.createElementVNode("span",g,e.toDisplayString(p.value),1),e.createVNode(r,{class:"box-item",effect:"dark",placement:"right"},{content:e.withCtx(()=>[...t[1]||(t[1]=[e.createTextVNode(" 仅统计符合输入格式的数量, 输入格式示例(代码和名称需空格隔开, 名称可不写):",-1),e.createElementVNode("br",null,null,-1),e.createTextVNode("hc8888 热轧卷板期货指数 ",-1),e.createElementVNode("br",null,null,-1),e.createTextVNode("sp8888 纸浆期货指数",-1)])]),default:e.withCtx(()=>[e.createVNode(s,null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.info_filled_default))]),_:1})]),_:1})])]),e.createVNode(_,{class:"textarea",modelValue:n.value,"onUpdate:modelValue":t[0]||(t[0]=x=>n.value=x),resize:"none",type:"textarea",placeholder:`文本格式要求示例:
|
|
3
3
|
hc8888 热轧卷板期货指数
|
|
4
4
|
sp8888 纸浆期货指数
|
package/es/VarietyTextCopy.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { i as v, E as y } from "./index-
|
|
2
|
-
import { E as g } from "./el-popper-
|
|
3
|
-
import { E } from "./el-input-
|
|
4
|
-
import { E as C } from "./index-
|
|
1
|
+
import { i as v, E as y } from "./index-6a52dc7c.js";
|
|
2
|
+
import { E as g } from "./el-popper-0454c8e8.js";
|
|
3
|
+
import { E } from "./el-input-d23f5442.js";
|
|
4
|
+
import { E as C } from "./index-e2e58ea9.js";
|
|
5
5
|
import "./base-dd156b8e.js";
|
|
6
6
|
import "./el-tooltip-4ed993c7.js";
|
|
7
7
|
import { inject as V, ref as h, computed as b, openBlock as T, createElementBlock as q, createElementVNode as n, toDisplayString as w, createVNode as a, withCtx as i, createTextVNode as p, unref as B } from "vue";
|
|
8
8
|
import "./el-message-4ed993c7.js";
|
|
9
9
|
import { _ as I } from "./_plugin-vue_export-helper-dad06003.js";
|
|
10
10
|
import "./index-a181f161.js";
|
|
11
|
-
import "./use-form-item-
|
|
11
|
+
import "./use-form-item-784142b4.js";
|
|
12
12
|
import "./raf-b4fd1e12.js";
|
|
13
|
-
import "./index-
|
|
13
|
+
import "./index-dddacf80.js";
|
|
14
14
|
import "./typescript-7ae59c4c.js";
|
|
15
|
-
import "./config-provider-
|
|
16
|
-
import "./use-global-config-
|
|
17
|
-
import "./index-
|
|
15
|
+
import "./config-provider-06d8207f.js";
|
|
16
|
+
import "./use-global-config-9a4ccf33.js";
|
|
17
|
+
import "./index-9573f74b.js";
|
|
18
18
|
const N = { class: "variety-text-copy" }, S = { class: "stats-container" }, k = { class: "stat-item" }, j = { class: "value" }, z = {
|
|
19
19
|
__name: "index",
|
|
20
20
|
props: {
|
package/es/VirtualTable.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Zt=require("./el-button-8259594b.cjs"),Jt=require("./el-divider-3f0320be.cjs"),Tt=require("./el-empty-58bc2a10.cjs"),h=require("./base-d987e5c9.cjs"),nt=require("./index-d372e68f.cjs"),e=require("vue"),Qt=require("./debounce-37b17615.cjs"),Rt=require("./typescript-b63f8e83.cjs"),Fe=require("./use-form-item-0a831287.cjs"),en=require("./scroll-07bade1e.cjs"),Se=require("./raf-735cc598.cjs"),tn=require("./el-scrollbar-225c6c9e.cjs"),nn=require("./castArray-d9ffe84a.cjs"),Ae=require("./index-3e7d5ffb.cjs"),on=require("./_plugin-vue_export-helper-f246444f.cjs");require("./index-f5474dcc.cjs");require("./use-global-config-c90c91f7.cjs");require("./index-3ed0c678.cjs");require("./index-71ba4c28.cjs");require("./toNumber-b47ceb68.cjs");const ut="itemRendered",dt="scroll",je="forward",rn="backward",we="auto",qe="start",Ne="center",ln="horizontal",Et="vertical",$e="negative",Nt="positive-ascending",Ct="positive-descending",an={[ln]:"left",[Et]:"top"},Ue=h.buildProp({type:h.definePropType([Number,Function]),required:!0}),Ye=h.buildProp({type:Number}),Xe=h.buildProp({type:Number,default:2}),sn=h.buildProp({type:String,values:["ltr","rtl"],default:"ltr"}),Ze=h.buildProp({type:Number,default:0}),ke=h.buildProp({type:Number,required:!0}),Pt=h.buildProp({type:String,values:["horizontal","vertical"],default:Et}),Ht=h.buildProps({className:{type:h.definePropType([String,Array,Object,Boolean]),default:""},containerElement:{type:h.definePropType([String,Object]),default:"div"},data:{type:h.definePropType(Array),default:()=>Rt.mutable([])},direction:sn,height:{type:[String,Number],required:!0},innerElement:{type:[String,Object],default:"div"},innerProps:{type:h.definePropType(Object),default:()=>({})},style:{type:h.definePropType([Object,String,Array,Boolean]),default:void 0},useIsScrolling:Boolean,width:{type:[Number,String],required:!1},innerWidth:{type:[Number,String],required:!1},perfMode:{type:Boolean,default:!0},scrollbarAlwaysOn:Boolean}),cn=h.buildProps({cache:Xe,estimatedItemSize:Ye,layout:Pt,initScrollOffset:Ze,total:ke,itemSize:Ue,...Ht}),Je={type:Number,default:6},Mt={type:Number,default:0},At={type:Number,default:2},pe=h.buildProps({columnCache:Xe,columnWidth:Ue,estimatedColumnWidth:Ye,estimatedRowHeight:Ye,initScrollLeft:Ze,initScrollTop:Ze,itemKey:{type:h.definePropType(Function),default:({columnIndex:t,rowIndex:n})=>`${n}:${t}`},rowCache:Xe,rowHeight:Ue,totalColumn:ke,totalRow:ke,hScrollbarSize:Je,vScrollbarSize:Je,scrollbarStartGap:Mt,scrollbarEndGap:At,role:String,...Ht}),Vt=h.buildProps({alwaysOn:Boolean,class:{type:h.definePropType([String,Array,Object,Boolean]),default:""},layout:Pt,total:ke,ratio:{type:Number,required:!0},clientSize:{type:Number,required:!0},scrollFrom:{type:Number,required:!0},scrollbarSize:Je,startGap:Mt,endGap:At,visible:Boolean}),Le=(t,n)=>t<n?je:rn,ft=t=>t==="rtl";let Ee=null;function ht(t=!1){if(Ee===null||t){const n=document.createElement("div"),o=n.style;o.width="50px",o.height="50px",o.overflow="scroll",o.direction="rtl";const r=document.createElement("div"),l=r.style;return l.width="100px",l.height="100px",n.appendChild(r),document.body.appendChild(n),n.scrollLeft>0?Ee=Ct:(n.scrollLeft=1,n.scrollLeft===0?Ee=$e:Ee=Nt),document.body.removeChild(n),Ee}return Ee}function un({move:t,size:n,bar:o},r){const l={},a=`translate${o.axis}(${t}px)`;return l[o.size]=n,l.transform=a,r==="horizontal"?l.height="100%":l.width="100%",l}var mt=Number.isNaN||function(n){return typeof n=="number"&&n!==n};function dn(t,n){return!!(t===n||mt(t)&&mt(n))}function fn(t,n){if(t.length!==n.length)return!1;for(var o=0;o<t.length;o++)if(!dn(t[o],n[o]))return!1;return!0}function hn(t,n){n===void 0&&(n=fn);var o=null;function r(){for(var l=[],a=0;a<arguments.length;a++)l[a]=arguments[a];if(o&&o.lastThis===this&&n(l,o.lastArgs))return o.lastResult;var s=t.apply(this,l);return o={lastResult:s,lastArgs:l,lastThis:this},s}return r.clear=function(){o=null},r}const mn=()=>{const t=e.getCurrentInstance().proxy.$props;return e.computed(()=>{const n=(o,r,l)=>({});return t.perfMode?nt.memoize(n):hn(n)})},yt=e.defineComponent({name:"ElVirtualScrollBar",props:Vt,emits:["scroll","start-move","stop-move"],setup(t,{emit:n}){const o=e.computed(()=>t.startGap+t.endGap),r=h.useNamespace("virtual-scrollbar"),l=h.useNamespace("scrollbar"),a=e.ref(),s=e.ref();let f=null,g=null;const m=e.reactive({isDragging:!1,traveled:0}),i=e.computed(()=>tn.BAR_MAP[t.layout]),y=e.computed(()=>t.clientSize-e.unref(o)),S=e.computed(()=>({position:"absolute",width:`${t.layout==="horizontal"?y.value:t.scrollbarSize}px`,height:`${t.layout==="horizontal"?t.scrollbarSize:y.value}px`,[an[t.layout]]:"2px",right:"2px",bottom:"2px",borderRadius:"4px"})),w=e.computed(()=>{const p=t.ratio;if(p>=100)return Number.POSITIVE_INFINITY;if(p>=50)return p*y.value/100;const L=y.value/3;return Math.floor(Math.min(Math.max(p*y.value/100,20),L))}),b=e.computed(()=>{if(!Number.isFinite(w.value))return{display:"none"};const p=`${w.value}px`;return un({bar:i.value,size:p,move:m.traveled},t.layout)}),c=e.computed(()=>Math.ceil(t.clientSize-w.value-e.unref(o))),u=()=>{window.addEventListener("mousemove",N),window.addEventListener("mouseup",x);const p=e.unref(s);p&&(g=document.onselectstart,document.onselectstart=()=>!1,p.addEventListener("touchmove",N,{passive:!0}),p.addEventListener("touchend",x))},d=()=>{window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",x),document.onselectstart=g,g=null;const p=e.unref(s);p&&(p.removeEventListener("touchmove",N),p.removeEventListener("touchend",x))},v=p=>{p.stopImmediatePropagation(),!(p.ctrlKey||[1,2].includes(p.button))&&(m.isDragging=!0,m[i.value.axis]=p.currentTarget[i.value.offset]-(p[i.value.client]-p.currentTarget.getBoundingClientRect()[i.value.direction]),n("start-move"),u())},x=()=>{m.isDragging=!1,m[i.value.axis]=0,n("stop-move"),d()},N=p=>{const{isDragging:L}=m;if(!L||!s.value||!a.value)return;const z=m[i.value.axis];if(!z)return;Se.cAF(f);const F=(a.value.getBoundingClientRect()[i.value.direction]-p[i.value.client])*-1-(s.value[i.value.offset]-z);f=Se.rAF(()=>{m.traveled=Math.max(0,Math.min(F,c.value)),n("scroll",F,c.value)})},C=p=>{const L=Math.abs(p.target.getBoundingClientRect()[i.value.direction]-p[i.value.client])-s.value[i.value.offset]/2;m.traveled=Math.max(0,Math.min(L,c.value)),n("scroll",L,c.value)};return e.watch(()=>t.scrollFrom,p=>{m.isDragging||(m.traveled=Math.ceil(p*c.value))}),e.onBeforeUnmount(()=>{d()}),()=>e.h("div",{role:"presentation",ref:a,class:[r.b(),t.class,(t.alwaysOn||m.isDragging)&&"always-on"],style:S.value,onMousedown:e.withModifiers(C,["stop","prevent"]),onTouchstartPrevent:v},e.h("div",{ref:s,class:l.e("thumb"),style:b.value,onMousedown:v},[]))}}),yn=({atXEndEdge:t,atXStartEdge:n,atYEndEdge:o,atYStartEdge:r},l)=>{let a=null,s=0,f=0;const g=(i,y)=>{const S=i<0&&n.value||i>0&&t.value,w=y<0&&r.value||y>0&&o.value;return S||w};return{hasReachedEdge:g,onWheel:i=>{Se.cAF(a);let y=i.deltaX,S=i.deltaY;if(Math.abs(y)>Math.abs(S)?S=0:y=0,i.shiftKey&&S!==0&&(y=S,S=0),g(y,S)){i.deltaX!==0&&y===0&&i.preventDefault();return}s+=y,f+=S,i.preventDefault(),a=Se.rAF(()=>{l(s,f),s=0,f=0})}}},gn=(t,n,o,r,l,a,s)=>{const f=e.ref(0),g=e.ref(0);let m,i=0,y=0;const S=b=>{Se.cAF(m),f.value=b.touches[0].clientX,g.value=b.touches[0].clientY,i=0,y=0},w=b=>{b.preventDefault(),Se.cAF(m),i+=f.value-b.touches[0].clientX,y+=g.value-b.touches[0].clientY,f.value=b.touches[0].clientX,g.value=b.touches[0].clientY,m=Se.rAF(()=>{const c=r.value-e.unref(a),u=l.value-e.unref(s);o({scrollLeft:Math.min(n.value.scrollLeft+i,c),scrollTop:Math.min(n.value.scrollTop+y,u)}),i=0,y=0})};return Fe.useEventListener(t,"touchstart",S,{passive:!0}),Fe.useEventListener(t,"touchmove",w,{passive:!1}),{touchStartX:f,touchStartY:g,handleTouchStart:S,handleTouchMove:w}},_t=({name:t,clearCache:n,getColumnPosition:o,getColumnStartIndexForOffset:r,getColumnStopIndexForStartIndex:l,getEstimatedTotalHeight:a,getEstimatedTotalWidth:s,getColumnOffset:f,getRowOffset:g,getRowPosition:m,getRowStartIndexForOffset:i,getRowStopIndexForStartIndex:y,initCache:S,injectToInstance:w,validateProps:b})=>e.defineComponent({name:t??"ElVirtualList",props:pe,emits:[ut,dt],setup(c,{emit:u,expose:d,slots:v}){const x=h.useNamespace("vl");b(c);const N=e.getCurrentInstance(),C=e.ref(S(c,N));w==null||w(N,C);const p=e.ref(),L=e.ref(),z=e.ref(),F=e.ref(),T=e.ref({isScrolling:!1,scrollLeft:h.isNumber(c.initScrollLeft)?c.initScrollLeft:0,scrollTop:h.isNumber(c.initScrollTop)?c.initScrollTop:0,updateRequested:!1,xAxisScrollDir:je,yAxisScrollDir:je}),M=mn(),I=e.computed(()=>Number.parseInt(`${c.height}`,10)),A=e.computed(()=>Number.parseInt(`${c.width}`,10)),k=e.computed(()=>{const{totalColumn:E,totalRow:R,columnCache:P}=c,{isScrolling:_,xAxisScrollDir:H,scrollLeft:V}=e.unref(T);if(E===0||R===0)return[0,0,0,0];const O=r(c,V,e.unref(C)),D=l(c,O,V,e.unref(C)),B=!_||H==="backward"?Math.max(1,P):1,$=!_||H==="forward"?Math.max(1,P):1;return[Math.max(0,O-B),Math.max(0,Math.min(E-1,D+$)),O,D]}),W=e.computed(()=>{const{totalColumn:E,totalRow:R,rowCache:P}=c,{isScrolling:_,yAxisScrollDir:H,scrollTop:V}=e.unref(T);if(E===0||R===0)return[0,0,0,0];const O=i(c,V,e.unref(C)),D=y(c,O,V,e.unref(C)),B=!_||H==="backward"?Math.max(1,P):1,$=!_||H==="forward"?Math.max(1,P):1;return[Math.max(0,O-B),Math.max(0,Math.min(R-1,D+$)),O,D]}),G=e.computed(()=>a(c,e.unref(C))),K=e.computed(()=>s(c,e.unref(C))),ee=e.computed(()=>[{position:"relative",overflow:"hidden",WebkitOverflowScrolling:"touch",willChange:"transform"},{direction:c.direction,height:h.isNumber(c.height)?`${c.height}px`:c.height,width:h.isNumber(c.width)?`${c.width}px`:c.width},c.style??{}]),fe=e.computed(()=>{const E=`${e.unref(K)}px`;return{height:`${e.unref(G)}px`,pointerEvents:e.unref(T).isScrolling?"none":void 0,width:E,margin:0,boxSizing:"border-box"}}),re=()=>{const{totalColumn:E,totalRow:R}=c;if(E>0&&R>0){const[D,B,$,X]=e.unref(k),[J,j,He,Ie]=e.unref(W);u(ut,{columnCacheStart:D,columnCacheEnd:B,rowCacheStart:J,rowCacheEnd:j,columnVisibleStart:$,columnVisibleEnd:X,rowVisibleStart:He,rowVisibleEnd:Ie})}const{scrollLeft:P,scrollTop:_,updateRequested:H,xAxisScrollDir:V,yAxisScrollDir:O}=e.unref(T);u(dt,{xAxisScrollDir:V,scrollLeft:P,yAxisScrollDir:O,scrollTop:_,updateRequested:H})},te=E=>{const{clientHeight:R,clientWidth:P,scrollHeight:_,scrollLeft:H,scrollTop:V,scrollWidth:O}=E.currentTarget,D=e.unref(T);if(D.scrollTop===V&&D.scrollLeft===H)return;let B=H;if(ft(c.direction))switch(ht()){case $e:B=-H;break;case Ct:B=O-P-H;break}T.value={...D,isScrolling:!0,scrollLeft:B,scrollTop:Math.max(0,Math.min(V,_-R)),updateRequested:!0,xAxisScrollDir:Le(D.scrollLeft,B),yAxisScrollDir:Le(D.scrollTop,V)},e.nextTick(()=>le()),Re(),re()},he=(E,R)=>{const P=e.unref(I),_=(G.value-P)/R*E;Y({scrollTop:Math.min(G.value-P,_)})},ue=(E,R)=>{const P=e.unref(A),_=(K.value-P)/R*E;Y({scrollLeft:Math.min(K.value-P,_)})},{onWheel:ne}=yn({atXStartEdge:e.computed(()=>T.value.scrollLeft<=0),atXEndEdge:e.computed(()=>T.value.scrollLeft>=K.value-e.unref(A)),atYStartEdge:e.computed(()=>T.value.scrollTop<=0),atYEndEdge:e.computed(()=>T.value.scrollTop>=G.value-e.unref(I))},(E,R)=>{var H,V,O,D;(V=(H=L.value)==null?void 0:H.onMouseUp)==null||V.call(H),(D=(O=z.value)==null?void 0:O.onMouseUp)==null||D.call(O);const P=e.unref(A),_=e.unref(I);Y({scrollLeft:Math.min(T.value.scrollLeft+E,K.value-P),scrollTop:Math.min(T.value.scrollTop+R,G.value-_)})});Fe.useEventListener(p,"wheel",ne,{passive:!1});const Y=({scrollLeft:E=T.value.scrollLeft,scrollTop:R=T.value.scrollTop})=>{E=Math.max(E,0),R=Math.max(R,0);const P=e.unref(T);R===P.scrollTop&&E===P.scrollLeft||(T.value={...P,xAxisScrollDir:Le(P.scrollLeft,E),yAxisScrollDir:Le(P.scrollTop,R),scrollLeft:E,scrollTop:R,updateRequested:!0},e.nextTick(()=>le()),Re(),re())},{touchStartX:Z,touchStartY:Te,handleTouchStart:me,handleTouchMove:ye}=gn(p,T,Y,K,G,A,I),Ce=(E=0,R=0,P=we)=>{const _=e.unref(T);R=Math.max(0,Math.min(R,c.totalColumn-1)),E=Math.max(0,Math.min(E,c.totalRow-1));const H=en.getScrollBarWidth(x.namespace.value),V=e.unref(C),O=a(c,V),D=s(c,V);Y({scrollLeft:f(c,R,P,_.scrollLeft,V,D>c.width?H:0),scrollTop:g(c,E,P,_.scrollTop,V,O>c.height?H:0)})},Pe=(E,R)=>{const{columnWidth:P,direction:_,rowHeight:H}=c,V=M.value(n&&P,n&&H,n&&_),O=`${E},${R}`;if(h.hasOwn(V,O))return V[O];{const[,D]=o(c,R,e.unref(C)),B=e.unref(C),$=ft(_),[X,J]=m(c,E,B),[j]=o(c,R,B);return V[O]={position:"absolute",left:$?void 0:`${D}px`,right:$?`${D}px`:void 0,top:`${J}px`,height:`${X}px`,width:`${j}px`},V[O]}},le=()=>{T.value.isScrolling=!1,e.nextTick(()=>{M.value(-1,null,null)})};e.onMounted(()=>{if(!h.isClient)return;const{initScrollLeft:E,initScrollTop:R}=c,P=e.unref(p);P&&(h.isNumber(E)&&(P.scrollLeft=E),h.isNumber(R)&&(P.scrollTop=R)),re()});const Re=()=>{const{direction:E}=c,{scrollLeft:R,scrollTop:P,updateRequested:_}=e.unref(T),H=e.unref(p);if(_&&H){if(E==="rtl")switch(ht()){case $e:H.scrollLeft=-R;break;case Nt:H.scrollLeft=R;break;default:{const{clientWidth:V,scrollWidth:O}=H;H.scrollLeft=O-V-R;break}}else H.scrollLeft=Math.max(0,R);H.scrollTop=Math.max(0,P)}},{resetAfterColumnIndex:q,resetAfterRowIndex:U,resetAfter:oe}=N.proxy;d({windowRef:p,innerRef:F,getItemStyleCache:M,touchStartX:Z,touchStartY:Te,handleTouchStart:me,handleTouchMove:ye,scrollTo:Y,scrollToItem:Ce,states:T,resetAfterColumnIndex:q,resetAfterRowIndex:U,resetAfter:oe});const ae=()=>{const{scrollbarAlwaysOn:E,scrollbarStartGap:R,scrollbarEndGap:P,totalColumn:_,totalRow:H}=c,V=e.unref(A),O=e.unref(I),D=e.unref(K),B=e.unref(G),{scrollLeft:$,scrollTop:X}=e.unref(T);return{horizontalScrollbar:e.h(yt,{ref:L,alwaysOn:E,startGap:R,endGap:P,class:x.e("horizontal"),clientSize:V,layout:"horizontal",onScroll:ue,ratio:V*100/D,scrollFrom:$/(D-V),total:H,visible:!0}),verticalScrollbar:e.h(yt,{ref:z,alwaysOn:E,startGap:R,endGap:P,class:x.e("vertical"),clientSize:O,layout:"vertical",onScroll:he,ratio:O*100/B,scrollFrom:X/(B-O),total:_,visible:!0})}},se=()=>{var X;const[E,R]=e.unref(k),[P,_]=e.unref(W),{data:H,totalColumn:V,totalRow:O,useIsScrolling:D,itemKey:B}=c,$=[];if(O>0&&V>0)for(let J=P;J<=_;J++)for(let j=E;j<=R;j++){const He=B({columnIndex:j,data:H,rowIndex:J});$.push(e.h(e.Fragment,{key:He},(X=v.default)==null?void 0:X.call(v,{columnIndex:j,data:H,isScrolling:D?e.unref(T).isScrolling:void 0,style:Pe(J,j),rowIndex:J})))}return $},Ge=()=>{const E=e.resolveDynamicComponent(c.innerElement),R=se();return[e.h(E,e.mergeProps(c.innerProps,{style:e.unref(fe),ref:F}),h.isString(E)?R:{default:()=>R})]};return()=>{const E=e.resolveDynamicComponent(c.containerElement),{horizontalScrollbar:R,verticalScrollbar:P}=ae(),_=Ge();return e.h("div",{key:0,class:x.e("wrapper"),role:c.role},[e.h(E,{class:c.className,style:e.unref(ee),onScroll:te,ref:p},h.isString(E)?_:{default:()=>_}),R,P])}}}),gt="ElFixedSizeGrid",bn=_t({name:"ElFixedSizeGrid",getColumnPosition:({columnWidth:t},n)=>[t,n*t],getRowPosition:({rowHeight:t},n)=>[t,n*t],getEstimatedTotalHeight:({totalRow:t,rowHeight:n})=>n*t,getEstimatedTotalWidth:({totalColumn:t,columnWidth:n})=>n*t,getColumnOffset:({totalColumn:t,columnWidth:n,width:o},r,l,a,s,f)=>{o=Number(o);const g=Math.max(0,t*n-o),m=Math.min(g,r*n),i=Math.max(0,r*n-o+f+n);switch(l==="smart"&&(a>=i-o&&a<=m+o?l=we:l=Ne),l){case qe:return m;case"end":return i;case Ne:{const y=Math.round(i+(m-i)/2);return y<Math.ceil(o/2)?0:y>g+Math.floor(o/2)?g:y}case we:default:return a>=i&&a<=m?a:i>m||a<i?i:m}},getRowOffset:({rowHeight:t,height:n,totalRow:o},r,l,a,s,f)=>{n=Number(n);const g=Math.max(0,o*t-n),m=Math.min(g,r*t),i=Math.max(0,r*t-n+f+t);switch(l==="smart"&&(a>=i-n&&a<=m+n?l=we:l=Ne),l){case qe:return m;case"end":return i;case Ne:{const y=Math.round(i+(m-i)/2);return y<Math.ceil(n/2)?0:y>g+Math.floor(n/2)?g:y}case we:default:return a>=i&&a<=m?a:i>m||a<i?i:m}},getColumnStartIndexForOffset:({columnWidth:t,totalColumn:n},o)=>Math.max(0,Math.min(n-1,Math.floor(o/t))),getColumnStopIndexForStartIndex:({columnWidth:t,totalColumn:n,width:o},r,l)=>{const a=r*t,s=Math.ceil((o+l-a)/t);return Math.max(0,Math.min(n-1,r+s-1))},getRowStartIndexForOffset:({rowHeight:t,totalRow:n},o)=>Math.max(0,Math.min(n-1,Math.floor(o/t))),getRowStopIndexForStartIndex:({rowHeight:t,totalRow:n,height:o},r,l)=>{const a=r*t,s=Math.ceil((o+l-a)/t);return Math.max(0,Math.min(n-1,r+s-1))},initCache:()=>{},clearCache:!0,validateProps:({columnWidth:t,rowHeight:n})=>{h.isNumber(t)||h.throwError(gt,`
|
|
1
|
+
"use strict";const Zt=require("./el-button-fac5e058.cjs"),Jt=require("./el-divider-3f0320be.cjs"),Tt=require("./el-empty-58bc2a10.cjs"),h=require("./base-d987e5c9.cjs"),nt=require("./index-d372e68f.cjs"),e=require("vue"),Qt=require("./debounce-37b17615.cjs"),Rt=require("./typescript-b63f8e83.cjs"),Fe=require("./use-form-item-76516e50.cjs"),en=require("./scroll-07bade1e.cjs"),Se=require("./raf-735cc598.cjs"),tn=require("./el-scrollbar-225c6c9e.cjs"),nn=require("./castArray-d9ffe84a.cjs"),Ae=require("./index-5cada1ed.cjs"),on=require("./_plugin-vue_export-helper-f246444f.cjs");require("./index-f5474dcc.cjs");require("./use-global-config-7ff9a1c2.cjs");require("./index-6a36e1fc.cjs");require("./index-71ba4c28.cjs");require("./toNumber-b47ceb68.cjs");const ut="itemRendered",dt="scroll",je="forward",rn="backward",we="auto",qe="start",Ne="center",ln="horizontal",Et="vertical",$e="negative",Nt="positive-ascending",Ct="positive-descending",an={[ln]:"left",[Et]:"top"},Ue=h.buildProp({type:h.definePropType([Number,Function]),required:!0}),Ye=h.buildProp({type:Number}),Xe=h.buildProp({type:Number,default:2}),sn=h.buildProp({type:String,values:["ltr","rtl"],default:"ltr"}),Ze=h.buildProp({type:Number,default:0}),ke=h.buildProp({type:Number,required:!0}),Pt=h.buildProp({type:String,values:["horizontal","vertical"],default:Et}),Ht=h.buildProps({className:{type:h.definePropType([String,Array,Object,Boolean]),default:""},containerElement:{type:h.definePropType([String,Object]),default:"div"},data:{type:h.definePropType(Array),default:()=>Rt.mutable([])},direction:sn,height:{type:[String,Number],required:!0},innerElement:{type:[String,Object],default:"div"},innerProps:{type:h.definePropType(Object),default:()=>({})},style:{type:h.definePropType([Object,String,Array,Boolean]),default:void 0},useIsScrolling:Boolean,width:{type:[Number,String],required:!1},innerWidth:{type:[Number,String],required:!1},perfMode:{type:Boolean,default:!0},scrollbarAlwaysOn:Boolean}),cn=h.buildProps({cache:Xe,estimatedItemSize:Ye,layout:Pt,initScrollOffset:Ze,total:ke,itemSize:Ue,...Ht}),Je={type:Number,default:6},Mt={type:Number,default:0},At={type:Number,default:2},pe=h.buildProps({columnCache:Xe,columnWidth:Ue,estimatedColumnWidth:Ye,estimatedRowHeight:Ye,initScrollLeft:Ze,initScrollTop:Ze,itemKey:{type:h.definePropType(Function),default:({columnIndex:t,rowIndex:n})=>`${n}:${t}`},rowCache:Xe,rowHeight:Ue,totalColumn:ke,totalRow:ke,hScrollbarSize:Je,vScrollbarSize:Je,scrollbarStartGap:Mt,scrollbarEndGap:At,role:String,...Ht}),Vt=h.buildProps({alwaysOn:Boolean,class:{type:h.definePropType([String,Array,Object,Boolean]),default:""},layout:Pt,total:ke,ratio:{type:Number,required:!0},clientSize:{type:Number,required:!0},scrollFrom:{type:Number,required:!0},scrollbarSize:Je,startGap:Mt,endGap:At,visible:Boolean}),Le=(t,n)=>t<n?je:rn,ft=t=>t==="rtl";let Ee=null;function ht(t=!1){if(Ee===null||t){const n=document.createElement("div"),o=n.style;o.width="50px",o.height="50px",o.overflow="scroll",o.direction="rtl";const r=document.createElement("div"),l=r.style;return l.width="100px",l.height="100px",n.appendChild(r),document.body.appendChild(n),n.scrollLeft>0?Ee=Ct:(n.scrollLeft=1,n.scrollLeft===0?Ee=$e:Ee=Nt),document.body.removeChild(n),Ee}return Ee}function un({move:t,size:n,bar:o},r){const l={},a=`translate${o.axis}(${t}px)`;return l[o.size]=n,l.transform=a,r==="horizontal"?l.height="100%":l.width="100%",l}var mt=Number.isNaN||function(n){return typeof n=="number"&&n!==n};function dn(t,n){return!!(t===n||mt(t)&&mt(n))}function fn(t,n){if(t.length!==n.length)return!1;for(var o=0;o<t.length;o++)if(!dn(t[o],n[o]))return!1;return!0}function hn(t,n){n===void 0&&(n=fn);var o=null;function r(){for(var l=[],a=0;a<arguments.length;a++)l[a]=arguments[a];if(o&&o.lastThis===this&&n(l,o.lastArgs))return o.lastResult;var s=t.apply(this,l);return o={lastResult:s,lastArgs:l,lastThis:this},s}return r.clear=function(){o=null},r}const mn=()=>{const t=e.getCurrentInstance().proxy.$props;return e.computed(()=>{const n=(o,r,l)=>({});return t.perfMode?nt.memoize(n):hn(n)})},yt=e.defineComponent({name:"ElVirtualScrollBar",props:Vt,emits:["scroll","start-move","stop-move"],setup(t,{emit:n}){const o=e.computed(()=>t.startGap+t.endGap),r=h.useNamespace("virtual-scrollbar"),l=h.useNamespace("scrollbar"),a=e.ref(),s=e.ref();let f=null,g=null;const m=e.reactive({isDragging:!1,traveled:0}),i=e.computed(()=>tn.BAR_MAP[t.layout]),y=e.computed(()=>t.clientSize-e.unref(o)),S=e.computed(()=>({position:"absolute",width:`${t.layout==="horizontal"?y.value:t.scrollbarSize}px`,height:`${t.layout==="horizontal"?t.scrollbarSize:y.value}px`,[an[t.layout]]:"2px",right:"2px",bottom:"2px",borderRadius:"4px"})),w=e.computed(()=>{const p=t.ratio;if(p>=100)return Number.POSITIVE_INFINITY;if(p>=50)return p*y.value/100;const L=y.value/3;return Math.floor(Math.min(Math.max(p*y.value/100,20),L))}),b=e.computed(()=>{if(!Number.isFinite(w.value))return{display:"none"};const p=`${w.value}px`;return un({bar:i.value,size:p,move:m.traveled},t.layout)}),c=e.computed(()=>Math.ceil(t.clientSize-w.value-e.unref(o))),u=()=>{window.addEventListener("mousemove",N),window.addEventListener("mouseup",x);const p=e.unref(s);p&&(g=document.onselectstart,document.onselectstart=()=>!1,p.addEventListener("touchmove",N,{passive:!0}),p.addEventListener("touchend",x))},d=()=>{window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",x),document.onselectstart=g,g=null;const p=e.unref(s);p&&(p.removeEventListener("touchmove",N),p.removeEventListener("touchend",x))},v=p=>{p.stopImmediatePropagation(),!(p.ctrlKey||[1,2].includes(p.button))&&(m.isDragging=!0,m[i.value.axis]=p.currentTarget[i.value.offset]-(p[i.value.client]-p.currentTarget.getBoundingClientRect()[i.value.direction]),n("start-move"),u())},x=()=>{m.isDragging=!1,m[i.value.axis]=0,n("stop-move"),d()},N=p=>{const{isDragging:L}=m;if(!L||!s.value||!a.value)return;const z=m[i.value.axis];if(!z)return;Se.cAF(f);const F=(a.value.getBoundingClientRect()[i.value.direction]-p[i.value.client])*-1-(s.value[i.value.offset]-z);f=Se.rAF(()=>{m.traveled=Math.max(0,Math.min(F,c.value)),n("scroll",F,c.value)})},C=p=>{const L=Math.abs(p.target.getBoundingClientRect()[i.value.direction]-p[i.value.client])-s.value[i.value.offset]/2;m.traveled=Math.max(0,Math.min(L,c.value)),n("scroll",L,c.value)};return e.watch(()=>t.scrollFrom,p=>{m.isDragging||(m.traveled=Math.ceil(p*c.value))}),e.onBeforeUnmount(()=>{d()}),()=>e.h("div",{role:"presentation",ref:a,class:[r.b(),t.class,(t.alwaysOn||m.isDragging)&&"always-on"],style:S.value,onMousedown:e.withModifiers(C,["stop","prevent"]),onTouchstartPrevent:v},e.h("div",{ref:s,class:l.e("thumb"),style:b.value,onMousedown:v},[]))}}),yn=({atXEndEdge:t,atXStartEdge:n,atYEndEdge:o,atYStartEdge:r},l)=>{let a=null,s=0,f=0;const g=(i,y)=>{const S=i<0&&n.value||i>0&&t.value,w=y<0&&r.value||y>0&&o.value;return S||w};return{hasReachedEdge:g,onWheel:i=>{Se.cAF(a);let y=i.deltaX,S=i.deltaY;if(Math.abs(y)>Math.abs(S)?S=0:y=0,i.shiftKey&&S!==0&&(y=S,S=0),g(y,S)){i.deltaX!==0&&y===0&&i.preventDefault();return}s+=y,f+=S,i.preventDefault(),a=Se.rAF(()=>{l(s,f),s=0,f=0})}}},gn=(t,n,o,r,l,a,s)=>{const f=e.ref(0),g=e.ref(0);let m,i=0,y=0;const S=b=>{Se.cAF(m),f.value=b.touches[0].clientX,g.value=b.touches[0].clientY,i=0,y=0},w=b=>{b.preventDefault(),Se.cAF(m),i+=f.value-b.touches[0].clientX,y+=g.value-b.touches[0].clientY,f.value=b.touches[0].clientX,g.value=b.touches[0].clientY,m=Se.rAF(()=>{const c=r.value-e.unref(a),u=l.value-e.unref(s);o({scrollLeft:Math.min(n.value.scrollLeft+i,c),scrollTop:Math.min(n.value.scrollTop+y,u)}),i=0,y=0})};return Fe.useEventListener(t,"touchstart",S,{passive:!0}),Fe.useEventListener(t,"touchmove",w,{passive:!1}),{touchStartX:f,touchStartY:g,handleTouchStart:S,handleTouchMove:w}},_t=({name:t,clearCache:n,getColumnPosition:o,getColumnStartIndexForOffset:r,getColumnStopIndexForStartIndex:l,getEstimatedTotalHeight:a,getEstimatedTotalWidth:s,getColumnOffset:f,getRowOffset:g,getRowPosition:m,getRowStartIndexForOffset:i,getRowStopIndexForStartIndex:y,initCache:S,injectToInstance:w,validateProps:b})=>e.defineComponent({name:t??"ElVirtualList",props:pe,emits:[ut,dt],setup(c,{emit:u,expose:d,slots:v}){const x=h.useNamespace("vl");b(c);const N=e.getCurrentInstance(),C=e.ref(S(c,N));w==null||w(N,C);const p=e.ref(),L=e.ref(),z=e.ref(),F=e.ref(),T=e.ref({isScrolling:!1,scrollLeft:h.isNumber(c.initScrollLeft)?c.initScrollLeft:0,scrollTop:h.isNumber(c.initScrollTop)?c.initScrollTop:0,updateRequested:!1,xAxisScrollDir:je,yAxisScrollDir:je}),M=mn(),I=e.computed(()=>Number.parseInt(`${c.height}`,10)),A=e.computed(()=>Number.parseInt(`${c.width}`,10)),k=e.computed(()=>{const{totalColumn:E,totalRow:R,columnCache:P}=c,{isScrolling:_,xAxisScrollDir:H,scrollLeft:V}=e.unref(T);if(E===0||R===0)return[0,0,0,0];const O=r(c,V,e.unref(C)),D=l(c,O,V,e.unref(C)),B=!_||H==="backward"?Math.max(1,P):1,$=!_||H==="forward"?Math.max(1,P):1;return[Math.max(0,O-B),Math.max(0,Math.min(E-1,D+$)),O,D]}),W=e.computed(()=>{const{totalColumn:E,totalRow:R,rowCache:P}=c,{isScrolling:_,yAxisScrollDir:H,scrollTop:V}=e.unref(T);if(E===0||R===0)return[0,0,0,0];const O=i(c,V,e.unref(C)),D=y(c,O,V,e.unref(C)),B=!_||H==="backward"?Math.max(1,P):1,$=!_||H==="forward"?Math.max(1,P):1;return[Math.max(0,O-B),Math.max(0,Math.min(R-1,D+$)),O,D]}),G=e.computed(()=>a(c,e.unref(C))),K=e.computed(()=>s(c,e.unref(C))),ee=e.computed(()=>[{position:"relative",overflow:"hidden",WebkitOverflowScrolling:"touch",willChange:"transform"},{direction:c.direction,height:h.isNumber(c.height)?`${c.height}px`:c.height,width:h.isNumber(c.width)?`${c.width}px`:c.width},c.style??{}]),fe=e.computed(()=>{const E=`${e.unref(K)}px`;return{height:`${e.unref(G)}px`,pointerEvents:e.unref(T).isScrolling?"none":void 0,width:E,margin:0,boxSizing:"border-box"}}),re=()=>{const{totalColumn:E,totalRow:R}=c;if(E>0&&R>0){const[D,B,$,X]=e.unref(k),[J,j,He,Ie]=e.unref(W);u(ut,{columnCacheStart:D,columnCacheEnd:B,rowCacheStart:J,rowCacheEnd:j,columnVisibleStart:$,columnVisibleEnd:X,rowVisibleStart:He,rowVisibleEnd:Ie})}const{scrollLeft:P,scrollTop:_,updateRequested:H,xAxisScrollDir:V,yAxisScrollDir:O}=e.unref(T);u(dt,{xAxisScrollDir:V,scrollLeft:P,yAxisScrollDir:O,scrollTop:_,updateRequested:H})},te=E=>{const{clientHeight:R,clientWidth:P,scrollHeight:_,scrollLeft:H,scrollTop:V,scrollWidth:O}=E.currentTarget,D=e.unref(T);if(D.scrollTop===V&&D.scrollLeft===H)return;let B=H;if(ft(c.direction))switch(ht()){case $e:B=-H;break;case Ct:B=O-P-H;break}T.value={...D,isScrolling:!0,scrollLeft:B,scrollTop:Math.max(0,Math.min(V,_-R)),updateRequested:!0,xAxisScrollDir:Le(D.scrollLeft,B),yAxisScrollDir:Le(D.scrollTop,V)},e.nextTick(()=>le()),Re(),re()},he=(E,R)=>{const P=e.unref(I),_=(G.value-P)/R*E;Y({scrollTop:Math.min(G.value-P,_)})},ue=(E,R)=>{const P=e.unref(A),_=(K.value-P)/R*E;Y({scrollLeft:Math.min(K.value-P,_)})},{onWheel:ne}=yn({atXStartEdge:e.computed(()=>T.value.scrollLeft<=0),atXEndEdge:e.computed(()=>T.value.scrollLeft>=K.value-e.unref(A)),atYStartEdge:e.computed(()=>T.value.scrollTop<=0),atYEndEdge:e.computed(()=>T.value.scrollTop>=G.value-e.unref(I))},(E,R)=>{var H,V,O,D;(V=(H=L.value)==null?void 0:H.onMouseUp)==null||V.call(H),(D=(O=z.value)==null?void 0:O.onMouseUp)==null||D.call(O);const P=e.unref(A),_=e.unref(I);Y({scrollLeft:Math.min(T.value.scrollLeft+E,K.value-P),scrollTop:Math.min(T.value.scrollTop+R,G.value-_)})});Fe.useEventListener(p,"wheel",ne,{passive:!1});const Y=({scrollLeft:E=T.value.scrollLeft,scrollTop:R=T.value.scrollTop})=>{E=Math.max(E,0),R=Math.max(R,0);const P=e.unref(T);R===P.scrollTop&&E===P.scrollLeft||(T.value={...P,xAxisScrollDir:Le(P.scrollLeft,E),yAxisScrollDir:Le(P.scrollTop,R),scrollLeft:E,scrollTop:R,updateRequested:!0},e.nextTick(()=>le()),Re(),re())},{touchStartX:Z,touchStartY:Te,handleTouchStart:me,handleTouchMove:ye}=gn(p,T,Y,K,G,A,I),Ce=(E=0,R=0,P=we)=>{const _=e.unref(T);R=Math.max(0,Math.min(R,c.totalColumn-1)),E=Math.max(0,Math.min(E,c.totalRow-1));const H=en.getScrollBarWidth(x.namespace.value),V=e.unref(C),O=a(c,V),D=s(c,V);Y({scrollLeft:f(c,R,P,_.scrollLeft,V,D>c.width?H:0),scrollTop:g(c,E,P,_.scrollTop,V,O>c.height?H:0)})},Pe=(E,R)=>{const{columnWidth:P,direction:_,rowHeight:H}=c,V=M.value(n&&P,n&&H,n&&_),O=`${E},${R}`;if(h.hasOwn(V,O))return V[O];{const[,D]=o(c,R,e.unref(C)),B=e.unref(C),$=ft(_),[X,J]=m(c,E,B),[j]=o(c,R,B);return V[O]={position:"absolute",left:$?void 0:`${D}px`,right:$?`${D}px`:void 0,top:`${J}px`,height:`${X}px`,width:`${j}px`},V[O]}},le=()=>{T.value.isScrolling=!1,e.nextTick(()=>{M.value(-1,null,null)})};e.onMounted(()=>{if(!h.isClient)return;const{initScrollLeft:E,initScrollTop:R}=c,P=e.unref(p);P&&(h.isNumber(E)&&(P.scrollLeft=E),h.isNumber(R)&&(P.scrollTop=R)),re()});const Re=()=>{const{direction:E}=c,{scrollLeft:R,scrollTop:P,updateRequested:_}=e.unref(T),H=e.unref(p);if(_&&H){if(E==="rtl")switch(ht()){case $e:H.scrollLeft=-R;break;case Nt:H.scrollLeft=R;break;default:{const{clientWidth:V,scrollWidth:O}=H;H.scrollLeft=O-V-R;break}}else H.scrollLeft=Math.max(0,R);H.scrollTop=Math.max(0,P)}},{resetAfterColumnIndex:q,resetAfterRowIndex:U,resetAfter:oe}=N.proxy;d({windowRef:p,innerRef:F,getItemStyleCache:M,touchStartX:Z,touchStartY:Te,handleTouchStart:me,handleTouchMove:ye,scrollTo:Y,scrollToItem:Ce,states:T,resetAfterColumnIndex:q,resetAfterRowIndex:U,resetAfter:oe});const ae=()=>{const{scrollbarAlwaysOn:E,scrollbarStartGap:R,scrollbarEndGap:P,totalColumn:_,totalRow:H}=c,V=e.unref(A),O=e.unref(I),D=e.unref(K),B=e.unref(G),{scrollLeft:$,scrollTop:X}=e.unref(T);return{horizontalScrollbar:e.h(yt,{ref:L,alwaysOn:E,startGap:R,endGap:P,class:x.e("horizontal"),clientSize:V,layout:"horizontal",onScroll:ue,ratio:V*100/D,scrollFrom:$/(D-V),total:H,visible:!0}),verticalScrollbar:e.h(yt,{ref:z,alwaysOn:E,startGap:R,endGap:P,class:x.e("vertical"),clientSize:O,layout:"vertical",onScroll:he,ratio:O*100/B,scrollFrom:X/(B-O),total:_,visible:!0})}},se=()=>{var X;const[E,R]=e.unref(k),[P,_]=e.unref(W),{data:H,totalColumn:V,totalRow:O,useIsScrolling:D,itemKey:B}=c,$=[];if(O>0&&V>0)for(let J=P;J<=_;J++)for(let j=E;j<=R;j++){const He=B({columnIndex:j,data:H,rowIndex:J});$.push(e.h(e.Fragment,{key:He},(X=v.default)==null?void 0:X.call(v,{columnIndex:j,data:H,isScrolling:D?e.unref(T).isScrolling:void 0,style:Pe(J,j),rowIndex:J})))}return $},Ge=()=>{const E=e.resolveDynamicComponent(c.innerElement),R=se();return[e.h(E,e.mergeProps(c.innerProps,{style:e.unref(fe),ref:F}),h.isString(E)?R:{default:()=>R})]};return()=>{const E=e.resolveDynamicComponent(c.containerElement),{horizontalScrollbar:R,verticalScrollbar:P}=ae(),_=Ge();return e.h("div",{key:0,class:x.e("wrapper"),role:c.role},[e.h(E,{class:c.className,style:e.unref(ee),onScroll:te,ref:p},h.isString(E)?_:{default:()=>_}),R,P])}}}),gt="ElFixedSizeGrid",bn=_t({name:"ElFixedSizeGrid",getColumnPosition:({columnWidth:t},n)=>[t,n*t],getRowPosition:({rowHeight:t},n)=>[t,n*t],getEstimatedTotalHeight:({totalRow:t,rowHeight:n})=>n*t,getEstimatedTotalWidth:({totalColumn:t,columnWidth:n})=>n*t,getColumnOffset:({totalColumn:t,columnWidth:n,width:o},r,l,a,s,f)=>{o=Number(o);const g=Math.max(0,t*n-o),m=Math.min(g,r*n),i=Math.max(0,r*n-o+f+n);switch(l==="smart"&&(a>=i-o&&a<=m+o?l=we:l=Ne),l){case qe:return m;case"end":return i;case Ne:{const y=Math.round(i+(m-i)/2);return y<Math.ceil(o/2)?0:y>g+Math.floor(o/2)?g:y}case we:default:return a>=i&&a<=m?a:i>m||a<i?i:m}},getRowOffset:({rowHeight:t,height:n,totalRow:o},r,l,a,s,f)=>{n=Number(n);const g=Math.max(0,o*t-n),m=Math.min(g,r*t),i=Math.max(0,r*t-n+f+t);switch(l==="smart"&&(a>=i-n&&a<=m+n?l=we:l=Ne),l){case qe:return m;case"end":return i;case Ne:{const y=Math.round(i+(m-i)/2);return y<Math.ceil(n/2)?0:y>g+Math.floor(n/2)?g:y}case we:default:return a>=i&&a<=m?a:i>m||a<i?i:m}},getColumnStartIndexForOffset:({columnWidth:t,totalColumn:n},o)=>Math.max(0,Math.min(n-1,Math.floor(o/t))),getColumnStopIndexForStartIndex:({columnWidth:t,totalColumn:n,width:o},r,l)=>{const a=r*t,s=Math.ceil((o+l-a)/t);return Math.max(0,Math.min(n-1,r+s-1))},getRowStartIndexForOffset:({rowHeight:t,totalRow:n},o)=>Math.max(0,Math.min(n-1,Math.floor(o/t))),getRowStopIndexForStartIndex:({rowHeight:t,totalRow:n,height:o},r,l)=>{const a=r*t,s=Math.ceil((o+l-a)/t);return Math.max(0,Math.min(n-1,r+s-1))},initCache:()=>{},clearCache:!0,validateProps:({columnWidth:t,rowHeight:n})=>{h.isNumber(t)||h.throwError(gt,`
|
|
2
2
|
"columnWidth" must be passed as number,
|
|
3
3
|
instead ${typeof t} was given.
|
|
4
4
|
`),h.isNumber(n)||h.throwError(gt,`
|