@labelbee/lb-components 1.24.0-alpha.13 → 1.24.0-alpha.14

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.
@@ -1 +1 @@
1
- import l,{forwardRef as h,useRef as E,useMemo as S}from"react";import{Tooltip as T,Popover as x}from"antd";import{useSize as j}from"ahooks";import{prefix as L}from"../../constant/index.js";import{SearchOutlined as C}from"@ant-design/icons";var M=Object.defineProperty,N=Object.defineProperties,R=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,b=(t,e,r)=>e in t?M(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,f=(t,e)=>{for(var r in e||(e={}))g.call(e,r)&&b(t,r,e[r]);if(v)for(var r of v(e))P.call(e,r)&&b(t,r,e[r]);return t},W=(t,e)=>N(t,R(e)),$=(t,e)=>{var r={};for(var n in t)g.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&v)for(var n of v(t))e.indexOf(n)<0&&P.call(t,n)&&(r[n]=t[n]);return r};const u=`${L}-longText`,_=h((t,e)=>{var r=t,{text:n,overflowMaxLines:p,style:i}=r,m=$(r,["text","overflowMaxLines","style"]);const a={whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},o={display:"-webkit-box",WebkitLineClamp:p,WebkitBoxOrient:"vertical",overflow:"hidden"},d=p>1?o:a,c=f(f({},d),i!=null?i:{});return l.createElement("div",f({style:c,ref:e},m),n)}),k=t=>{const{text:e,placement:r="bottom",icon:n=l.createElement(C,null),openByText:p,style:i,isToolTips:m,overflowMaxLines:a=1}=t,o=E(null),d=j(o),c=S(()=>{var s,y,O,w;return a>1?o.current&&((s=o.current)==null?void 0:s.clientHeight)<((y=o.current)==null?void 0:y.scrollHeight):o.current&&((O=o.current)==null?void 0:O.clientWidth)<((w=o.current)==null?void 0:w.scrollWidth)},[d]);if(p){let s={placement:r,overlayClassName:`${u}-popover`,content:e,key:`${c}`};return c||Object.assign(s,{open:!1}),m?l.createElement(T,W(f({},s),{title:e}),l.createElement(_,{overflowMaxLines:a,style:i,ref:o,text:e})):l.createElement(x,f({},s),l.createElement(_,{overflowMaxLines:a,style:i,ref:o,text:e}))}return l.createElement("div",{className:u,style:i},l.createElement(_,{overflowMaxLines:a,style:i,ref:o,text:e}),c&&l.createElement(x,{placement:r,overlayClassName:`${u}-popover`,content:e},n))};export{k as default};
1
+ import o,{forwardRef as T,useRef as j,useMemo as L}from"react";import{Tooltip as E,Popover as y}from"antd";import{useSize as C}from"ahooks";import{prefix as W}from"../../constant/index.js";import{SearchOutlined as M}from"@ant-design/icons";var N=Object.defineProperty,R=Object.defineProperties,$=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,P=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,h=(t,e,r)=>e in t?N(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,c=(t,e)=>{for(var r in e||(e={}))P.call(e,r)&&h(t,r,e[r]);if(d)for(var r of d(e))b.call(e,r)&&h(t,r,e[r]);return t},S=(t,e)=>R(t,$(e)),k=(t,e)=>{var r={};for(var l in t)P.call(t,l)&&e.indexOf(l)<0&&(r[l]=t[l]);if(t!=null&&d)for(var l of d(t))e.indexOf(l)<0&&b.call(t,l)&&(r[l]=t[l]);return r};const w=`${W}-longText`,m=T((t,e)=>{var r=t,{text:l,overflowMaxLines:v,style:i}=r,u=k(r,["text","overflowMaxLines","style"]);const s={whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},f={display:"-webkit-box",WebkitLineClamp:v,WebkitBoxOrient:"vertical",overflow:"hidden"},n=v>1?f:s,_=c(c({},n),i!=null?i:{});return o.createElement("div",c({style:_,ref:e},u),l)}),D=t=>{const{text:e,placement:r="bottom",icon:l=o.createElement(M,null),openByText:v,style:i,isToolTips:u,overflowMaxLines:s=1,maxWordCount:f}=t,n=j(null),_=C(n),x=L(()=>{var a,p,O,g;return s>1?n.current&&((a=n.current)==null?void 0:a.clientHeight)<((p=n.current)==null?void 0:p.scrollHeight):n.current&&((O=n.current)==null?void 0:O.clientWidth)<((g=n.current)==null?void 0:g.scrollWidth)},[_]);if(f){if(e.length>f){const a=e.substring(0,f)+"...",p={placement:r,content:e};return u?o.createElement(E,S(c({},p),{title:e}),o.createElement(m,{overflowMaxLines:s,style:i,ref:n,text:a})):o.createElement(y,c({},p),o.createElement(m,{overflowMaxLines:s,style:i,ref:n,text:a}))}return o.createElement("span",null,e)}if(v){let a={placement:r,overlayClassName:`${w}-popover`,content:e,key:`${x}`};return x||Object.assign(a,{open:!1}),u?o.createElement(E,S(c({},a),{title:e}),o.createElement(m,{overflowMaxLines:s,style:i,ref:n,text:e})):o.createElement(y,c({},a),o.createElement(m,{overflowMaxLines:s,style:i,ref:n,text:e}))}return o.createElement("div",{className:w,style:i},o.createElement(m,{overflowMaxLines:s,style:i,ref:n,text:e}),x&&o.createElement(y,{placement:r,overlayClassName:`${w}-popover`,content:e},l))};export{D as default};
@@ -1 +1 @@
1
- import l from"react";import{Row as x,Col as y,Radio as E,Tag as h}from"antd";import a from"./index.module.scss.js";import k from"../longText/index.js";import b from"classnames";const{CheckableTag:N}=h,T=({tagItem:d,selectedTags:c,handleChange:i,disabeledAll:v})=>{var r;const o=v,{isMulti:s,subSelected:u=[],value:m}=d,n=m;return s?l.createElement(l.Fragment,null,u.map(e=>{var t,p;return l.createElement(N,{key:e==null?void 0:e.value,checked:(t=c[n])==null?void 0:t.includes(e==null?void 0:e.value),onChange:f=>{o||i({key:n,tag:e==null?void 0:e.value,checked:f})},className:b({[`${a.disabled}`]:o,[`${a.active}`]:o&&((p=c[n])==null?void 0:p.includes(e==null?void 0:e.value))})},l.createElement("span",{className:a.tagItem},l.createElement(k,{text:e==null?void 0:e.key,openByText:!0})))})):l.createElement(E.Group,{onChange:e=>{i({key:n,tag:e.target.value,checked:e.target.checked,isRadio:!0})},value:(r=c[n])==null?void 0:r[0]},u.map(e=>l.createElement(E,{value:e==null?void 0:e.value,key:e==null?void 0:e.value,disabled:o},l.createElement("span",{className:a.tagItem},l.createElement(k,{text:e==null?void 0:e.key,openByText:!0})))))},L=d=>{const{selectedTags:c,updateValue:i,disabeledAll:v,inputList:r=[]}=d,o=s=>{const{key:u,checked:m,tag:n,isRadio:e}=s;let t=c[u]||[];if(e&&(t=[]),m){if(t==null?void 0:t.includes(n))return;t.push(n)}else!m&&(t==null?void 0:t.includes(n))&&(t=t.filter(f=>f!==n));i({key:u,value:t})};return(r==null?void 0:r.length)>0?l.createElement("div",{className:a.tagList},r.map((s,u)=>l.createElement(x,{key:u,className:a.content},l.createElement(y,{span:4,className:a.left},l.createElement(k,{text:s==null?void 0:s.key,openByText:!0})),l.createElement(y,{span:20,className:a.right},l.createElement(T,{selectedTags:c,handleChange:o,tagItem:s,disabeledAll:v}))))):null};export{L as default};
1
+ import l from"react";import{Row as E,Col as x,Radio as y,Tag as h}from"antd";import a from"./index.module.scss.js";import k from"../longText/index.js";import b from"classnames";const{CheckableTag:N}=h,C=({tagItem:d,selectedTags:o,handleChange:i,disabeledAll:v})=>{var r;const c=v,{isMulti:s,subSelected:u=[],value:m}=d,n=m;return s?l.createElement(l.Fragment,null,u.map(e=>{var t,p;return l.createElement(N,{key:e==null?void 0:e.value,checked:(t=o[n])==null?void 0:t.includes(e==null?void 0:e.value),onChange:f=>{c||i({key:n,tag:e==null?void 0:e.value,checked:f})},className:b({[`${a.disabled}`]:c,[`${a.active}`]:c&&((p=o[n])==null?void 0:p.includes(e==null?void 0:e.value))})},l.createElement("span",{className:a.tagItem},l.createElement(k,{text:e==null?void 0:e.key,openByText:!0,maxWordCount:10})))})):l.createElement(y.Group,{onChange:e=>{i({key:n,tag:e.target.value,checked:e.target.checked,isRadio:!0})},value:(r=o[n])==null?void 0:r[0]},u.map(e=>l.createElement(y,{value:e==null?void 0:e.value,key:e==null?void 0:e.value,disabled:c},l.createElement("span",{className:a.tagItem},l.createElement(k,{text:e==null?void 0:e.key,openByText:!0,maxWordCount:10})))))},T=d=>{const{selectedTags:o,updateValue:i,disabeledAll:v,inputList:r=[]}=d,c=s=>{const{key:u,checked:m,tag:n,isRadio:e}=s;let t=o[u]||[];if(e&&(t=[]),m){if(t==null?void 0:t.includes(n))return;t.push(n)}else!m&&(t==null?void 0:t.includes(n))&&(t=t.filter(f=>f!==n));i({key:u,value:t})};return(r==null?void 0:r.length)>0?l.createElement("div",{className:a.tagList},r.map((s,u)=>l.createElement(E,{key:u,className:a.content},l.createElement(x,{span:4,className:a.left},l.createElement(k,{text:s==null?void 0:s.key,openByText:!0})),l.createElement(x,{span:20,className:a.right},l.createElement(C,{selectedTags:o,handleChange:c,tagItem:s,disabeledAll:v}))))):null};export{T as default};
package/es/index.css CHANGED
@@ -262,7 +262,6 @@
262
262
  }
263
263
  .index-module_tagList__cvWor .index-module_right__RHSL5 .index-module_tagItem__hicyz {
264
264
  display: flex;
265
- max-width: 60px;
266
265
  }
267
266
  .index-module_tagList__cvWor .index-module_right__RHSL5 .index-module_disabled__lpoBn {
268
267
  animation: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.24.0-alpha.13",
3
+ "version": "1.24.0-alpha.14",
4
4
  "description": "Provide a complete library of annotation components",
5
5
  "main": "./dist/index.js",
6
6
  "es": "./es/index.js",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@ant-design/icons": "^4.6.2",
46
- "@labelbee/lb-annotation": "1.28.0-alpha.7",
46
+ "@labelbee/lb-annotation": "1.28.0-alpha.8",
47
47
  "@labelbee/lb-utils": "1.20.0-alpha.1",
48
48
  "@labelbee/wavesurfer": "1.1.0",
49
49
  "@types/react-dom": "^18.2.7",