holyes-table 1.0.2 → 1.0.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "holyes-table",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "合力思虚拟滚动表格组件",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
20
|
"dev": "vite",
|
|
21
|
-
"build": "
|
|
21
|
+
"build": "vite build",
|
|
22
22
|
"prepublishOnly": "pnpm run build",
|
|
23
23
|
"登录npm": "npm login --registry https://registry.npmjs.org",
|
|
24
24
|
"发布npm": "npm publish --registry https://registry.npmjs.org",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(){let e=e=>{let t=0;switch(!0){case!e:case typeof e!=`string`:return t;default:break}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r>=19968&&r<=40959||r>=12352&&r<=12543||r>=44032&&r<=55215?t+=2:t+=1}return t};self.onmessage=t=>{let{tempData:n,commonStyles:r,itemStyles:i,divLineHeight:a,cellMinHeight:o,keyNames:s,isNoAutoWrap:c,columns:l,treeConfig:u,defaultTreeConfig:d,prepare:f,layout:p}=t.data,m=0,h=[],g=new Map,_=e=>{e.slots?.default&&!e.slots?.defaultHeight&&(g.has(e.field)||(console.error(`表格设置了插槽,插槽高度defaultHeight不能为空,否则会导致高度计算错误`,e.field),g.set(e.field,1))),(e.slots.defaultType==`tag`||e.slots.defaultType==`buttons`)&&(e.slots.defaultHeight||(e.slots.defaultHeight=30))},v=u?.childrenField||d.childrenField,y=(t,n)=>{t[v]?.length&&t[v].forEach(e=>{y(e,n+1)});let g=o,b=[],x=0;if(c)for(let e of l)_(e),x=Math.max(x,e.slots?.defaultHeight||0),g=Math.max(g,a);else{for(let r of l){(r.slots?.default||r.slots?.defaultType)&&(_(r),x=Math.max(x,r.slots?.defaultHeight||0));let i=Math.max(r.minWidth||30,r.width||0),a=t[r.field]||``;r.treeNode&&u?.isOpenTree&&(u?.showIcon&&(a+=`图`),u?.indent&&(i-=(u?.indent||d.indent||20)*n));let o=e(a)/i;testLength:for(let e=0;e<3;e++)if((b[e]?.density||0)<o){b[e]={field:r.field,tempWidth:i,density:o,tempText:a};break testLength}}for(let e of b){let t=e.tempWidth,{height:n}=p(f(e.tempText,`${i.fontWeight} ${i.fontSize} ${r}`),t,a);g=Math.max(g,n)}}h.push({pretextHeight:Math.max(g,x)+1,id:t[s.id]}),n==0&&(m+=Math.max(g,x)+1)};for(let e of n)y(e,0);self.postMessage({tempItemHeights:m,heightDatas:h}),self.close()}})();
|