@labelbee/lb-components 1.24.0-alpha.11 → 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{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 S,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 F}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:i}=$(),[p,b]=N(),[y]=u.useForm(),{t:o}=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 l={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(l,{subAttribute:c})}p&&Object.assign(l,p),C(z(r,l,[t.prevPage-1,t.nextPage-1],f)),a()},x=H(()=>{var t;const{prevPage:s,nextPage:l}=y.getFieldsValue(["prevPage","nextPage"]),c=f.filter((d,v)=>G.isInRange(v,[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){b(void 0);return}const g=F.getMaxSizeFromBox({trackID:i.info.trackID,imgList:c});b(g)},[f,i,k]),j=()=>y.submit(),U=()=>{if(!p||!(i==null?void 0:i.info))return;const t={marginRight:16},{length:s,width:l,height:c}=F.transferBox2Kitti(h(h({},i==null?void 0:i.info),p));return e.createElement("div",null,e.createElement("span",{style:t},o("Length"),": ",s.toFixed(P)),e.createElement("span",{style:t},o("Width"),": ",l.toFixed(P)),e.createElement("span",{style:t},o("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"},I={marginBottom:"24px",display:"flex",alignItems:"center"};return e.createElement(L,{title:o("UnifyParams"),visible:n,onCancel:a,onOk:j,wrapClassName:"labelbee-custom-modal"},e.createElement(u,te(h({},re),{form:y,onFinish:D}),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:A,name:"prevPage",noStyle:!0,initialValue:1},e.createElement(S,{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(S,{precision:0,min:1,style:{width:"80px"},onChange:()=>x()})),e.createElement("span",{style:{display:"inline-block",width:"40x",marginLeft:"10px",textAlign:"center"}},o("Page"))),e.createElement(u.Item,{name:"UnifySize",label:o("UnifySize")},U()),e.createElement(u.Item,{label:o("UnifyTag"),required:!0},e.createElement("div",{style:I},e.createElement(O,{text:o("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:I},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(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:M})(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.11",
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.6",
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",