@labelbee/lb-components 1.24.0-alpha.10 → 1.24.0-alpha.12

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{getClassName as d}from"../../utils/dom.js";import{cKeyCode as W,PointCloud as X}from"@labelbee/lb-annotation";import{PointCloudUtils as S,EPerspectiveView as E}from"@labelbee/lb-utils";import O from"classnames";import o,{useContext as T,useState as b,useRef as Y,useEffect as u,useMemo as $}from"react";import{PointCloudContainer as ee}from"./PointCloudLayout.js";import{PointCloudContext as te}from"./PointCloudContext.js";import{a2MapStateToProps as oe}from"../../store/annotation/map.js";import{connect as ne}from"react-redux";import{jsonParser as ie}from"../../utils/index.js";import{useSingleBox as le}from"./hooks/useSingleBox.js";import{useSphere as re}from"./hooks/useSphere.js";import{Switch as ae,Tooltip as se}from"antd";import ce from"../../hooks/useSize.js";import{usePointCloudViews as de}from"./hooks/usePointCloudViews.js";import{useTranslation as R}from"react-i18next";import{LabelBeeContext as me}from"../../store/ctx.js";import ue from"./components/PointCloudSizeSlider/index.js";import pe from"./components/TitleButton/index.js";import{LeftOutlined as we}from"@ant-design/icons";import{useToolStyleContext as ve}from"../../hooks/useToolStyle.js";import{usePointCloudAttribute as fe}from"./hooks/usePointCloudAttribute.js";var Ce=Object.defineProperty,A=Object.getOwnPropertySymbols,Ve=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,F=(n,l,a)=>l in n?Ce(n,l,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[l]=a,Pe=(n,l)=>{for(var a in l||(l={}))Ve.call(l,a)&&F(n,a,l[a]);if(A)for(var a of A(l))ge.call(l,a)&&F(n,a,l[a]);return n};const Ee=W.default,Ie="LABELBEE-POINTCLOUD",I=o.createContext({isActive:!1,setTarget3DView:()=>{},reset3DView:()=>{},followTopView:()=>{}}),w=({perspectiveView:n})=>{const{isActive:l,setTarget3DView:a}=T(I),f=p=>O({[d("point-cloud-3d-view",p)]:!0,active:l});return o.createElement("span",{onClick:()=>{a(E[n])},className:f(n.toLocaleLowerCase())})},H=({isEnlarge:n})=>{const{reset3DView:l,followTopView:a}=T(I),{t:f}=R(),p=o.createElement(o.Fragment,null,o.createElement(w,{perspectiveView:"Top"}),o.createElement(w,{perspectiveView:"Front"}),o.createElement(w,{perspectiveView:"Left"}),o.createElement(w,{perspectiveView:"Back"}),o.createElement(w,{perspectiveView:"Right"}),o.createElement(w,{perspectiveView:"LFT"}),o.createElement(w,{perspectiveView:"RBT"})),t=o.createElement(o.Fragment,null,o.createElement(se,{title:f("CameraFollowTopView")},o.createElement("span",{onClick:()=>{a()},className:d("point-cloud-3d-view","followTop")})),o.createElement("span",{onClick:()=>{l()},className:d("point-cloud-3d-view","reset")}));return n?o.createElement("div",{className:d("point-cloud-3d-sidebarZoom")},t,p):o.createElement("div",{className:d("point-cloud-3d-sidebar")},p,t)},he=({currentData:n,config:l,highlightAttribute:a,setResourceLoading:f})=>{var p;const t=T(te),[U,K]=b(!0),[C,h]=b(!1),V=Y(null),{initPointCloud3d:y}=de(),g=ce(V),{t:x}=R(),{value:B}=ve(),{hiddenText:L}=B||{},{updatePointCloudAttribute:M}=fe(f,l);u(()=>{let e=t.mainViewInstance;e&&e.updateHiddenTextAndRender(L,t.pointCloudBoxList)},[B]),u(()=>{!t.mainViewInstance||y==null||y(g)},[g]);const{selectedBox:m}=le(),{selectedSphere:P}=re(),[Z,j]=b(!0),_=e=>{var i,s;const r=m==null?void 0:m.info;if(r){const c=Pe({},r.center);c.x=c.x-.01,c.z=1e3;const v=e===E.Top;(i=t.mainViewInstance)==null||i.updateCameraByBox(r,e,v?c:void 0)}P&&((s=t.mainViewInstance)==null||s.updateCameraBySphere(P,e))},q=()=>{var e;(e=t.mainViewInstance)==null||e.resetCamera()},G=()=>{var e,i;const s=(e=t.topViewInstance)==null?void 0:e.pointCloudInstance.camera;s&&((i=t.mainViewInstance)==null||i.applyCameraTarget(s))};u(()=>{if(V.current&&(n==null?void 0:n.url)){let e=t.mainViewInstance;!e&&g.width&&(e=new X({container:V.current,isOrthographicCamera:!0,orthographicParams:S.getDefaultOrthographicParams(g),config:l,hiddenText:L}),e.setHandlerPipe({setSelectedIDs:t.setSelectedIDs,setNeedUpdateCenter:j}),t.setMainViewInstance(e))}},[g,n]),u(()=>{var e;if(V.current&&(n==null?void 0:n.url)&&n.result&&t.mainViewInstance){let i=t.mainViewInstance;const s=S.getRectParamsFromResultList(n.result),r=S.getBoxParamsFromResultList(n.result),c=r.find(v=>v.id===t.selectedID);c&&M(c.attribute),t.setPointCloudValid((e=ie(n.result))==null?void 0:e.valid),t.setPointCloudResult(r),t.setRectList(s),i.generateBoxes(r)}},[n.result,t.mainViewInstance]),u(()=>{var e,i,s,r,c,v,k;const N=(e=m==null?void 0:m.info)==null?void 0:e.id;if(!Z){j(!0);return}if(N!==void 0){_(E.Top);const Q=(r=(s=(i=t.topViewInstance)==null?void 0:i.pointCloudInstance)==null?void 0:s.camera.zoom)!=null?r:1;(c=t.mainViewInstance)==null||c.updateCameraZoom(Q)}(v=t.mainViewInstance)==null||v.setHighlightColor(N),(k=t.mainViewInstance)==null||k.render()},[(p=m==null?void 0:m.info)==null?void 0:p.id]),u(()=>{var e,i,s,r;if(P){_(E.Top);const c=(s=(i=(e=t.topViewInstance)==null?void 0:e.pointCloudInstance)==null?void 0:i.camera.zoom)!=null?s:1;(r=t.mainViewInstance)==null||r.updateCameraZoom(c)}},[P]),u(()=>(window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}),[]);const z=e=>{if(e.keyCode===Ee.Esc){h(!1);return}},D=$(()=>({reset3DView:q,setTarget3DView:_,isActive:!!m,followTopView:G}),[m,t.mainViewInstance]);u(()=>{var e,i,s;const r=t.pointCloudBoxList.filter(c=>c.attribute===a);(r==null?void 0:r.length)>0&&((e=t.mainViewInstance)==null||e.clearHighlightBoxes(),(i=t.mainViewInstance)==null||i.highlightBoxes(r)),r.length===0&&((s=t.mainViewInstance)==null||s.clearHighlightBoxesAndRender())},[a,t.mainViewInstance]);const J=o.createElement(o.Fragment,null,o.createElement(ue,{onChange:e=>{var i;(i=t.mainViewInstance)==null||i.updatePointSize({customSize:e})}}),o.createElement("span",{style:{marginRight:8}},x("ShowArrows")),o.createElement(ae,{size:"small",checked:U,onChange:e=>{var i;K(e),(i=t.mainViewInstance)==null||i.setShowDirection(e)}}),C&&o.createElement(I.Provider,{value:D},o.createElement(H,{isEnlarge:C})));return o.createElement(ee,{className:O({[d("point-cloud-3d-container")]:!0,[d("point-cloud-container","zoom")]:C}),title:C?o.createElement("div",{style:{display:"flex",alignItems:"center"}},o.createElement(we,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{h(!1)}}),x("3DView")):o.createElement(pe,{title:x("3DView"),onClick:()=>{h(!0)}}),toolbar:J},o.createElement("div",{className:d("point-cloud-3d-content")},!C&&o.createElement(I.Provider,{value:D},o.createElement(H,null)),o.createElement("div",{className:d("point-cloud-3d-view"),id:Ie,ref:V})))};var xe=ne(oe,null,null,{context:me})(he);export{xe as default};
1
+ import{getClassName as u}from"../../utils/dom.js";import{cKeyCode as $,PointCloud as ee}from"@labelbee/lb-annotation";import{PointCloudUtils as T,EPerspectiveView as E}from"@labelbee/lb-utils";import R from"classnames";import o,{useContext as b,useState as y,useRef as te,useEffect as p,useMemo as oe}from"react";import{PointCloudContainer as ne}from"./PointCloudLayout.js";import{PointCloudContext as ie}from"./PointCloudContext.js";import{a2MapStateToProps as le}from"../../store/annotation/map.js";import{connect as re}from"react-redux";import{jsonParser as se}from"../../utils/index.js";import{useSingleBox as O}from"./hooks/useSingleBox.js";import{useSphere as ae}from"./hooks/useSphere.js";import{Switch as ce,Tooltip as de}from"antd";import ue from"../../hooks/useSize.js";import{usePointCloudViews as me}from"./hooks/usePointCloudViews.js";import{useTranslation as A}from"react-i18next";import{LabelBeeContext as pe}from"../../store/ctx.js";import we from"./components/PointCloudSizeSlider/index.js";import ve from"./components/TitleButton/index.js";import{LeftOutlined as fe}from"@ant-design/icons";import{useToolStyleContext as Ce}from"../../hooks/useToolStyle.js";import{usePointCloudAttribute as Ve}from"./hooks/usePointCloudAttribute.js";var ge=Object.defineProperty,F=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,H=(n,l,r)=>l in n?ge(n,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[l]=r,Ee=(n,l)=>{for(var r in l||(l={}))Ie.call(l,r)&&H(n,r,l[r]);if(F)for(var r of F(l))Pe.call(l,r)&&H(n,r,l[r]);return n};const he=$.default,xe="LABELBEE-POINTCLOUD",h=o.createContext({isActive:!1,setTarget3DView:()=>{},reset3DView:()=>{},followTopView:()=>{}}),v=({perspectiveView:n})=>{const{isActive:l,setTarget3DView:r}=b(h),f=w=>R({[u("point-cloud-3d-view",w)]:!0,active:l});return o.createElement("span",{onClick:()=>{r(E[n])},className:f(n.toLocaleLowerCase())})},U=({isEnlarge:n})=>{const{reset3DView:l,followTopView:r}=b(h),{t:f}=A(),w=o.createElement(o.Fragment,null,o.createElement(v,{perspectiveView:"Top"}),o.createElement(v,{perspectiveView:"Front"}),o.createElement(v,{perspectiveView:"Left"}),o.createElement(v,{perspectiveView:"Back"}),o.createElement(v,{perspectiveView:"Right"}),o.createElement(v,{perspectiveView:"LFT"}),o.createElement(v,{perspectiveView:"RBT"})),e=o.createElement(o.Fragment,null,o.createElement(de,{title:f("CameraFollowTopView")},o.createElement("span",{onClick:()=>{r()},className:u("point-cloud-3d-view","followTop")})),o.createElement("span",{onClick:()=>{l()},className:u("point-cloud-3d-view","reset")}));return n?o.createElement("div",{className:u("point-cloud-3d-sidebarZoom")},e,w):o.createElement("div",{className:u("point-cloud-3d-sidebar")},w,e)},_e=({currentData:n,config:l,highlightAttribute:r,setResourceLoading:f})=>{var w;const e=b(ie),[K,M]=y(!0),[C,x]=y(!1),V=te(null),{initPointCloud3d:B,generateRects:Z}=me(),g=ue(V),{t:_}=A(),{value:L}=Ce(),{hiddenText:j}=L||{},{updatePointCloudAttribute:q}=Ve(f,l),{updateSelectedBox:G}=O({generateRects:Z});p(()=>{let t=e.mainViewInstance;t&&t.updateHiddenTextAndRender(j,e.pointCloudBoxList)},[L]),p(()=>{!e.mainViewInstance||B==null||B(g)},[g]);const{selectedBox:m}=O(),{selectedSphere:I}=ae(),[J,D]=y(!0),S=t=>{var i,s;const a=m==null?void 0:m.info;if(a){const c=Ee({},a.center);c.x=c.x-.01,c.z=1e3;const d=t===E.Top;(i=e.mainViewInstance)==null||i.updateCameraByBox(a,t,d?c:void 0)}I&&((s=e.mainViewInstance)==null||s.updateCameraBySphere(I,t))},Q=()=>{var t;(t=e.mainViewInstance)==null||t.resetCamera()},W=()=>{var t,i;const s=(t=e.topViewInstance)==null?void 0:t.pointCloudInstance.camera;s&&((i=e.mainViewInstance)==null||i.applyCameraTarget(s))};p(()=>{if(V.current&&(n==null?void 0:n.url)){let t=e.mainViewInstance;!t&&g.width&&(t=new ee({container:V.current,isOrthographicCamera:!0,orthographicParams:T.getDefaultOrthographicParams(g),config:l,hiddenText:j}),t.setHandlerPipe({setSelectedIDs:e.setSelectedIDs,setNeedUpdateCenter:D}),e.setMainViewInstance(t))}},[g,n]),p(()=>{var t,i;if(V.current&&(n==null?void 0:n.url)&&n.result&&e.mainViewInstance){let s=e.mainViewInstance;const a=T.getRectParamsFromResultList(n.result),c=T.getBoxParamsFromResultList(n.result),d=c.find(P=>P.id===e.selectedID);d&&((t=e.topViewInstance)==null||t.updatePolygonList(c,void 0),q(d.attribute),G(d),e.setSelectedIDs(d.id)),e.setPointCloudValid((i=se(n.result))==null?void 0:i.valid),e.setPointCloudResult(c),e.setRectList(a),s.generateBoxes(c)}},[n.result,e.mainViewInstance]),p(()=>{var t,i,s,a,c,d,P;const N=(t=m==null?void 0:m.info)==null?void 0:t.id;if(!J){D(!0);return}if(N!==void 0){S(E.Top);const Y=(a=(s=(i=e.topViewInstance)==null?void 0:i.pointCloudInstance)==null?void 0:s.camera.zoom)!=null?a:1;(c=e.mainViewInstance)==null||c.updateCameraZoom(Y)}(d=e.mainViewInstance)==null||d.setHighlightColor(N),(P=e.mainViewInstance)==null||P.render()},[(w=m==null?void 0:m.info)==null?void 0:w.id]),p(()=>{var t,i,s,a;if(I){S(E.Top);const c=(s=(i=(t=e.topViewInstance)==null?void 0:t.pointCloudInstance)==null?void 0:i.camera.zoom)!=null?s:1;(a=e.mainViewInstance)==null||a.updateCameraZoom(c)}},[I]),p(()=>(window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}),[]);const z=t=>{if(t.keyCode===he.Esc){x(!1);return}},k=oe(()=>({reset3DView:Q,setTarget3DView:S,isActive:!!m,followTopView:W}),[m,e.mainViewInstance]);p(()=>{var t,i,s;const a=e.pointCloudBoxList.filter(c=>c.attribute===r);(a==null?void 0:a.length)>0&&((t=e.mainViewInstance)==null||t.clearHighlightBoxes(),(i=e.mainViewInstance)==null||i.highlightBoxes(a)),a.length===0&&((s=e.mainViewInstance)==null||s.clearHighlightBoxesAndRender())},[r,e.mainViewInstance]);const X=o.createElement(o.Fragment,null,o.createElement(we,{onChange:t=>{var i;(i=e.mainViewInstance)==null||i.updatePointSize({customSize:t})}}),o.createElement("span",{style:{marginRight:8}},_("ShowArrows")),o.createElement(ce,{size:"small",checked:K,onChange:t=>{var i;M(t),(i=e.mainViewInstance)==null||i.setShowDirection(t)}}),C&&o.createElement(h.Provider,{value:k},o.createElement(U,{isEnlarge:C})));return o.createElement(ne,{className:R({[u("point-cloud-3d-container")]:!0,[u("point-cloud-container","zoom")]:C}),title:C?o.createElement("div",{style:{display:"flex",alignItems:"center"}},o.createElement(fe,{style:{cursor:"pointer",marginRight:"12px"},onClick:()=>{x(!1)}}),_("3DView")):o.createElement(ve,{title:_("3DView"),onClick:()=>{x(!0)}}),toolbar:X},o.createElement("div",{className:u("point-cloud-3d-content")},!C&&o.createElement(h.Provider,{value:k},o.createElement(U,null)),o.createElement("div",{className:u("point-cloud-3d-view"),id:xe,ref:V})))};var Se=re(le,null,null,{context:pe})(_e);export{Se as default};
@@ -1 +1 @@
1
- import{BatchUpdateResultByTrackID as z}from"../../../../store/annotation/actionCreators.js";import{LabelBeeContext as R,useDispatch as L}from"../../../../store/ctx.js";import{Form as u,Modal as M,InputNumber as I,Select as E,Popover as T,message as q}from"antd";import e,{useState as N,useEffect as V,useCallback as H}from"react";import{useTranslation as K}from"react-i18next";import{QuestionCircleOutlined as Q}from"@ant-design/icons";import{PointCloudUtils as S}from"@labelbee/lb-utils";import{connect as W}from"react-redux";import{useSingleBox as $}from"../../hooks/useSingleBox.js";import{MathUtils as G}from"@labelbee/lb-annotation";var J=Object.defineProperty,X=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,B=(r,n,a)=>n in r?J(r,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[n]=a,v=(r,n)=>{for(var a in n||(n={}))Z.call(n,a)&&B(r,a,n[a]);if(F)for(var a of F(n))ee.call(n,a)&&B(r,a,n[a]);return r},te=(r,n)=>X(r,Y(n));const re={labelCol:{span:8},wrapperCol:{span:16}},w=[{required:!0,message:"\u8BF7\u586B\u5199\u4E00\u4E2A\u6570\u5B57"}],ne=[{required:!0,message:"\u8BF7\u9009\u62E9\u4E3B\u5C5E\u6027"}],h=2,O=({text:r})=>e.createElement("span",{style:{borderRadius:"4px 0px 0px 4px",padding:"0px 12px",background:"#FAFAFA",border:"1px solid rgb(217 217 217)",borderRight:"0",display:"flex",alignItems:"center",height:32}},r),ae=({id:r,visible:n,onCancel:a,config:m,imgList:d,imgIndex:k})=>{const A=L(),{selectedBox:i}=$(),[p,y]=N(),[f]=u.useForm(),{t:o}=K();V(()=>{n===!1?(f.resetFields(),y(void 0)):b()},[n]);const C=t=>{var s;if(!r)return;if(!p){q.info("\u8BE5\u8303\u56F4\u4E0D\u5B58\u5728\u66F4\u6539\u6570\u636E, \u8BF7\u66F4\u6539\u7EDF\u4E00\u8303\u56F4");return}const l={attribute:t.attribute};if(m.secondaryAttributeConfigurable){const c={};(s=m.inputList)==null||s.forEach(g=>{const x=t[g.value];x!==void 0&&Object.assign(c,{[g.value]:x})}),Object.keys(c).length>0&&Object.assign(l,{subAttribute:c})}p&&Object.assign(l,p),A(z(r,l,[t.prevPage-1,t.nextPage-1],d)),a()},b=H(()=>{var t;const{prevPage:s,nextPage:l}=f.getFieldsValue(["prevPage","nextPage"]),c=d.filter((x,U)=>G.isInRange(U,[s-1,l-1]));if(!((c==null?void 0:c.length)>0)||!(i==null?void 0:i.info)||((t=i==null?void 0:i.info)==null?void 0:t.trackID)===void 0){y(void 0);return}const g=S.getMaxSizeFromBox({trackID:i.info.trackID,imgList:c});y(g)},[d,i,k]),D=()=>f.submit(),j=()=>{if(!p||!(i==null?void 0:i.info))return;const t={marginRight:16},{length:s,width:l,height:c}=S.transferBox2Kitti(v(v({},i==null?void 0:i.info),p));return e.createElement("div",null,e.createElement("span",{style:t},o("Length"),": ",s.toFixed(h)),e.createElement("span",{style:t},o("Width"),": ",l.toFixed(h)),e.createElement("span",{style:t},o("Height"),": ",c.toFixed(h)),e.createElement(T,{placement:"rightBottom",content:"\u7EDF\u4E00\u5C3A\u5BF8\u4E3A\u8BE5ID\u7684\u6240\u6709\u6807\u6CE8\u6846\u4E2D\u6700\u5927\u7684\u5C3A\u5BF8"},e.createElement(Q,null)))},P={width:"200px"},_={marginBottom:"24px",display:"flex",alignItems:"center"};return e.createElement(M,{title:o("UnifyParams"),visible:n,onCancel:a,onOk:D,wrapClassName:"labelbee-custom-modal"},e.createElement(u,te(v({},re),{form:f,onFinish:C}),e.createElement(u.Item,{name:"id",label:o("UnifyTrackID")},r),e.createElement(u.Item,{label:o("UnifyAttributeRange"),required:!0},e.createElement(u.Item,{style:{display:"inline-block"},rules:w,name:"prevPage",noStyle:!0,initialValue:1},e.createElement(I,{precision:0,min:1,style:{width:"80px"},onChange:()=>b()})),e.createElement("span",{style:{display:"inline-block",width:"24px",textAlign:"center"}},"-"),e.createElement(u.Item,{style:{display:"inline-block"},rules:w,name:"nextPage",noStyle:!0,initialValue:d.length},e.createElement(I,{precision:0,min:1,style:{width:"80px"},onChange:()=>b()})),e.createElement("span",{style:{display:"inline-block",width:"40x",marginLeft:"10px",textAlign:"center"}},o("Page"))),e.createElement(u.Item,{name:"UnifySize",label:o("UnifySize")},j()),e.createElement(u.Item,{label:o("UnifyTag"),required:!0},e.createElement("div",{style:_},e.createElement(O,{text:o("Attribute")}),e.createElement(u.Item,{name:"attribute",noStyle:!0,rules:ne},e.createElement(E,{style:P},m.attributeList.map(t=>e.createElement(E.Option,{key:t.value,value:t.value},t.key))))),m.secondaryAttributeConfigurable&&m.inputList.map(t=>{var s;return e.createElement("div",{key:t.value,style:_},e.createElement(O,{text:t.key}),e.createElement(u.Item,{name:t.value,noStyle:!0,required:!1},e.createElement(E,{style:P},(s=t.subSelected)==null?void 0:s.map(l=>e.createElement(E.Option,{key:l.value,value:l.value},l.key)))))}))))},le=r=>({imgIndex:r.annotation.imgIndex});var ie=W(le,null,null,{context:R})(ae);export{ie as default};
1
+ import{BatchUpdateResultByTrackID as z}from"../../../../store/annotation/actionCreators.js";import{LabelBeeContext as M,useDispatch as R}from"../../../../store/ctx.js";import{Form as u,Modal as L,InputNumber as I,Select as E,Popover as T,message as q}from"antd";import e,{useState as N,useEffect as V,useCallback as H}from"react";import{useTranslation as K}from"react-i18next";import{QuestionCircleOutlined as Q}from"@ant-design/icons";import{PointCloudUtils as S}from"@labelbee/lb-utils";import{connect as W}from"react-redux";import{useSingleBox as $}from"../../hooks/useSingleBox.js";import{MathUtils as G}from"@labelbee/lb-annotation";var J=Object.defineProperty,X=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,B=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,w=(r,n,a)=>n in r?J(r,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[n]=a,h=(r,n)=>{for(var a in n||(n={}))Z.call(n,a)&&w(r,a,n[a]);if(B)for(var a of B(n))ee.call(n,a)&&w(r,a,n[a]);return r},te=(r,n)=>X(r,Y(n));const re={labelCol:{span:8},wrapperCol:{span:16}},A=[{required:!0,message:"\u8BF7\u586B\u5199\u4E00\u4E2A\u6570\u5B57"}],ne=[{required:!0,message:"\u8BF7\u9009\u62E9\u4E3B\u5C5E\u6027"}],P=2,O=({text:r})=>e.createElement("span",{style:{borderRadius:"4px 0px 0px 4px",padding:"0px 12px",background:"#FAFAFA",border:"1px solid rgb(217 217 217)",borderRight:"0",display:"flex",alignItems:"center",height:32}},r),ae=({id:r,visible:n,onCancel:a,config:m,imgList:f,imgIndex:k})=>{const C=R(),{selectedBox:o}=$(),[p,b]=N(),[y]=u.useForm(),{t:l}=K();V(()=>{n===!1?(y.resetFields(),b(void 0)):x()},[n]);const D=t=>{var s;if(!r)return;if(!p){q.info("\u8BE5\u8303\u56F4\u4E0D\u5B58\u5728\u66F4\u6539\u6570\u636E, \u8BF7\u66F4\u6539\u7EDF\u4E00\u8303\u56F4");return}const i={attribute:t.attribute};if(m.secondaryAttributeConfigurable){const c={};(s=m.inputList)==null||s.forEach(g=>{const d=t[g.value];if(d!==void 0){const v=Array.isArray(d)?d.join(";"):d;Object.assign(c,{[g.value]:v})}}),Object.keys(c).length>0&&Object.assign(i,{subAttribute:c})}p&&Object.assign(i,p),C(z(r,i,[t.prevPage-1,t.nextPage-1],f)),a()},x=H(()=>{var t;const{prevPage:s,nextPage:i}=y.getFieldsValue(["prevPage","nextPage"]),c=f.filter((d,v)=>G.isInRange(v,[s-1,i-1]));if(!((c==null?void 0:c.length)>0)||!(o==null?void 0:o.info)||((t=o==null?void 0:o.info)==null?void 0:t.trackID)===void 0){b(void 0);return}const g=S.getMaxSizeFromBox({trackID:o.info.trackID,imgList:c});b(g)},[f,o,k]),j=()=>y.submit(),U=()=>{if(!p||!(o==null?void 0:o.info))return;const t={marginRight:16},{length:s,width:i,height:c}=S.transferBox2Kitti(h(h({},o==null?void 0:o.info),p));return e.createElement("div",null,e.createElement("span",{style:t},l("Length"),": ",s.toFixed(P)),e.createElement("span",{style:t},l("Width"),": ",i.toFixed(P)),e.createElement("span",{style:t},l("Height"),": ",c.toFixed(P)),e.createElement(T,{placement:"rightBottom",content:"\u7EDF\u4E00\u5C3A\u5BF8\u4E3A\u8BE5ID\u7684\u6240\u6709\u6807\u6CE8\u6846\u4E2D\u6700\u5927\u7684\u5C3A\u5BF8"},e.createElement(Q,null)))},_={width:"200px"},F={marginBottom:"24px",display:"flex",alignItems:"center"};return e.createElement(L,{title:l("UnifyParams"),visible:n,onCancel:a,onOk:j,wrapClassName:"labelbee-custom-modal"},e.createElement(e.Fragment,null,e.createElement("div",{style:{marginBottom:"20px",color:"#f00"}},l("UnifyParamsTips")),e.createElement(u,te(h({},re),{form:y,onFinish:D}),e.createElement(u.Item,{name:"id",label:l("UnifyTrackID")},r),e.createElement(u.Item,{label:l("UnifyAttributeRange"),required:!0},e.createElement(u.Item,{style:{display:"inline-block"},rules:A,name:"prevPage",noStyle:!0,initialValue:1},e.createElement(I,{precision:0,min:1,style:{width:"80px"},onChange:()=>x()})),e.createElement("span",{style:{display:"inline-block",width:"24px",textAlign:"center"}},"-"),e.createElement(u.Item,{style:{display:"inline-block"},rules:A,name:"nextPage",noStyle:!0,initialValue:f.length},e.createElement(I,{precision:0,min:1,style:{width:"80px"},onChange:()=>x()})),e.createElement("span",{style:{display:"inline-block",width:"40x",marginLeft:"10px",textAlign:"center"}},l("Page"))),e.createElement(u.Item,{name:"UnifySize",label:l("UnifySize")},U()),e.createElement(u.Item,{label:l("UnifyTag"),required:!0},e.createElement("div",{style:F},e.createElement(O,{text:l("Attribute")}),e.createElement(u.Item,{name:"attribute",noStyle:!0,rules:ne},e.createElement(E,{style:_},m.attributeList.map(t=>e.createElement(E.Option,{key:t.value,value:t.value},t.key))))),m.secondaryAttributeConfigurable&&m.inputList.map(t=>{var s;return e.createElement("div",{key:t.value,style:F},e.createElement(O,{text:t.key}),e.createElement(u.Item,{name:t.value,noStyle:!0,required:!1},e.createElement(E,{style:_,mode:t.isMulti?"multiple":void 0},(s=t.subSelected)==null?void 0:s.map(i=>e.createElement(E.Option,{key:i.value,value:i.value},i.key)))))})))))},le=r=>({imgIndex:r.annotation.imgIndex});var ie=W(le,null,null,{context:M})(ae);export{ie as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.24.0-alpha.10",
3
+ "version": "1.24.0-alpha.12",
4
4
  "description": "Provide a complete library of annotation components",
5
5
  "main": "./dist/index.js",
6
6
  "es": "./es/index.js",
@@ -43,8 +43,8 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@ant-design/icons": "^4.6.2",
46
- "@labelbee/lb-annotation": "1.28.0-alpha.5",
47
- "@labelbee/lb-utils": "1.19.0",
46
+ "@labelbee/lb-annotation": "1.28.0-alpha.7",
47
+ "@labelbee/lb-utils": "1.20.0-alpha.1",
48
48
  "@labelbee/wavesurfer": "1.1.0",
49
49
  "@types/react-dom": "^18.2.7",
50
50
  "@types/react-transition-group": "^4.4.9",