bj-web-components 0.2.33 → 0.2.34
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/dist/index.d.ts +160 -15
- package/dist/index.js +1 -1
- package/dist/index.mjs +28 -24
- package/dist/style.css +1 -1
- package/dist/web/CategoryDropdown/CategoryDropdown.js +1 -1
- package/dist/web/CategoryDropdown/CategoryDropdown.mjs +1 -1
- package/dist/web/CheckBox/BCheckBox.js +1 -1
- package/dist/web/CheckBox/BCheckBox.mjs +51 -49
- package/dist/web/CheckBox/Group.js +1 -1
- package/dist/web/CheckBox/Group.mjs +51 -49
- package/dist/web/MobileDrawer/BMobileDrawer.js +1 -0
- package/dist/web/MobileDrawer/BMobileDrawer.mjs +151 -0
- package/dist/web/Pagination/Pagination.js +1 -1
- package/dist/web/Pagination/Pagination.mjs +8 -8
- package/dist/web/Radio/BRadio.js +1 -0
- package/dist/web/Radio/BRadio.mjs +79 -0
- package/dist/web/Radio/Button.js +1 -0
- package/dist/web/Radio/Button.mjs +9 -0
- package/dist/web/Radio/Group.js +1 -0
- package/dist/web/Radio/Group.mjs +80 -0
- package/dist/web/Radio/context.js +1 -0
- package/dist/web/Radio/context.mjs +6 -0
- package/dist/web/Radio/index.js +1 -0
- package/dist/web/Radio/index.mjs +10 -0
- package/dist/web/Table/BTable.js +1 -1
- package/dist/web/Table/BTable.mjs +30 -30
- package/dist/web.d.ts +160 -15
- package/dist/web.js +1 -1
- package/dist/web.mjs +28 -24
- package/package.json +8 -7
package/dist/web/Table/BTable.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),o=require("react"),Zt=require("react-dom"),Xt=require("../Pagination/Pagination.js"),Me=require("../Icon/Icon.js");;/* empty css */const Yt=require("../Tooltip/ContentTooltip.js"),es=require("../Tooltip/TooltipWrapper.js"),ts=require("../CheckBox/index.js"),ss=require("../Dropdown/BDropdown.js"),ns=require("../OverlayScrollbar/BOverlayScrollbar.js"),rs=require("../SkuInputCard/spin_loading_red.gif.js"),as=require("../ProductField/no_data_light.svg.js"),is=require("./Column.js"),ls=require("./ColumnGroup.js"),m=require("./utils/sortFilter.js"),Oe=require("./utils/columns.js");;/* empty css */const ds=300,ke=1;function z(...g){return g.filter(Boolean).join(" ")}function cs(g,x){return x===void 0?void 0:(Array.isArray(x)?x:[x]).reduce((F,c)=>{if(!(F==null||typeof F!="object"))return F[c]},g)}function V(g,x,v){if(typeof v=="function")return v(g,x);if(v){const F=g[String(v)];if(typeof F=="string"||typeof F=="number")return F}return x}function fs(g,x){return Math.max(1,Math.ceil(g/x))}function bs(g){return!!(g&&typeof g=="object"&&!o.isValidElement(g)&&"props"in g)}function os(g,x){return(typeof x.text=="string"||typeof x.text=="number"?String(x.text):String(x.value)).toLocaleLowerCase().includes(g.toLocaleLowerCase())}function ut({checked:g,disabled:x,label:v,name:F,onChange:c,type:G="checkbox"}){return G==="checkbox"?d.jsx(ts.BCheckBox,{"aria-label":v,checked:g,className:"bj-table__selection-checkbox",disabled:x,name:F,onChange:c,skipGroup:!0}):d.jsxs("label",{className:z("bj-table__selection-control",g&&"bj-table__selection-control--checked",x&&"bj-table__selection-control--disabled"),children:[d.jsx("input",{"aria-label":v,checked:g,className:"bj-table__selection-input",disabled:x,name:F,onChange:c,type:G}),d.jsx("span",{"aria-hidden":"true",className:"bj-table__selection-box",children:g&&d.jsx(Me,{className:"bj-table__selection-check-icon",type:"icon-a-dagouxi"})})]})}function us({columns:g,dataSource:x=[],rowKey:v,preserveSelectedRowKeys:F=!1,rowSelection:c,pagination:G=!1,loading:oe=!1,bordered:ht=!0,size:_t="middle",showHeader:qe=!0,emptyText:ue,emptyImage:he=as,emptyHeight:jt,t:Q=ae=>ae,className:yt,style:xt,rowClassName:_e,sortDirections:gt=["ascend","descend",null],onChange:je,children:ze,title:Te,footer:Le,summary:Ie,tableLayout:ye,components:E,onRow:xe,onHeaderRow:ge,id:vt,scroll:f,locale:Z,groupCollapse:u}){var ct,ft,bt;const ae=o.useRef(null),ve=o.useRef(null),ie=o.useMemo(()=>g??Oe.convertChildrenToColumns(ze),[ze,g]),Y=o.useMemo(()=>Oe.flattenColumns(ie),[ie]),we=o.useMemo(()=>Oe.buildHeaderRows(ie),[ie]),[mt,Ve]=o.useState((c==null?void 0:c.defaultSelectedRowKeys)??[]),[me,le]=o.useState(G?G.defaultCurrent??1:1),[pt,Nt]=o.useState(G?G.defaultPageSize??10:10),[Rt,Et]=o.useState(()=>new Map(Y.flatMap((e,t)=>e.defaultSortOrder?[[m.getColumnKey(e,t),e.defaultSortOrder]]:[]))),[St,Ft]=o.useState(()=>new Map(Y.flatMap((e,t)=>e.defaultFilteredValue===void 0?[]:[[m.getColumnKey(e,t),e.defaultFilteredValue]]))),[Kt,Dt]=o.useState(u!=null&&u.defaultExpandedKeys?[...u.defaultExpandedKeys]:[]),[T,$]=o.useState(null),[Ge,ee]=o.useState(new Map),[Pt,de]=o.useState(null),Ot=o.useRef(`btable-${Math.random().toString(36).slice(2,10)}`).current,[U,pe]=o.useState(null),[Ne,Ae]=o.useState(null),[Re,We]=o.useState(""),[te,He]=o.useState(""),[kt,Ee]=o.useState(),Se=o.useRef(0),Fe=o.useRef(!1),[$e,Ue]=o.useState({start:0,end:0}),[Ce,Je]=o.useState({start:!1,end:!1}),a=G||void 0,A=(a==null?void 0:a.pageSize)??pt,P=(c==null?void 0:c.selectedRowKeys)??mt,y=Y,Mt=`${y.map(e=>`${String(e.fixed??"")}:${String(e.width??"")}`).join("|")}|${c?String(c.columnWidth??""):"-"}|${String((f==null?void 0:f.x)??"")}|${String(ye??"")}`,W=e=>!!(e&&(e.fixed==="left"||e.fixed===!0)),X=e=>!!(e&&e.fixed==="right"),K=new Map(Rt),O=new Map(St);y.forEach((e,t)=>{if("children"in e)return;const s=m.getColumnKey(e,t);e.sortOrder!==void 0&&K.set(s,e.sortOrder),e.filteredValue!==void 0&&O.set(s,e.filteredValue)});const Qe=o.useMemo(()=>m.filterRecords(x,y,O),[y,O,x]),k=o.useMemo(()=>m.sortRecords(Qe,y,K),[y,Qe,K]),Ze=(a==null?void 0:a.total)??k.length,Xe=fs(Ze,A),H=Math.min((a==null?void 0:a.current)??me,Xe),C=(u==null?void 0:u.expandedKeys)??Kt,se=(e,t)=>u!=null&&u.isGroupRow?u.isGroupRow(e,t):!!e.isGroup,ce=(e,t)=>u!=null&&u.groupKey?u.groupKey(e,t):e.groupId,Ye=(e,t)=>u!=null&&u.childrenKeys?u.childrenKeys(e,t):e.childrenIds??[],Bt=(e,t)=>{var r;const s=ce(e,t),i=C.includes(s),l=i?C.filter(n=>n!==s):[...C,s];(u==null?void 0:u.expandedKeys)===void 0&&Dt(l),(r=u==null?void 0:u.onExpandedKeysChange)==null||r.call(u,l,e,!i)};o.useEffect(()=>{H!==me&&(a==null?void 0:a.current)===void 0&&le(H)},[H,a==null?void 0:a.current,me]),o.useEffect(()=>{if(!U||T===null){Ae(null);return}const e=()=>{const t=U.getBoundingClientRect();Ae({left:t.left,top:t.bottom+4})};return e(),document.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{document.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[U,T]),o.useEffect(()=>{if(T===null)return;const e=t=>{const s=t.target;U!=null&&U.contains(s)||s.closest(".bj-table__filter-dropdown")||($(null),pe(null))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[U,T]),o.useEffect(()=>{const e=window.setTimeout(()=>He(Re.trim()),ds);return()=>window.clearTimeout(e)},[Re]),o.useEffect(()=>{if(T===null)return;const e=Y.find((s,i)=>m.getColumnKey(s,i)===T);if(!e||"children"in e||!e.filterRequest)return;const t=++Se.current;Promise.resolve().then(()=>e.filterRequest(te)).then(s=>{Se.current===t&&Ee(s)},()=>{Se.current===t&&Ee([])})},[te,Y,T]);const L=o.useMemo(()=>{if(!a||a.serverPagination)return k.map((t,s)=>({record:t,index:s})).filter(({record:t,index:s})=>{if(!u||se(t,s))return!0;const i=V(t,s,v);return k.some((l,r)=>se(l,r)&&C.includes(ce(l,r))&&Ye(l,r).includes(i))});const e=(H-1)*A;return k.slice(e,e+A).map((t,s)=>({record:t,index:e+s})).filter(({record:t,index:s})=>{if(!u||se(t,s))return!0;const i=V(t,s,v);return k.some((l,r)=>se(l,r)&&C.includes(ce(l,r))&&Ye(l,r).includes(i))})},[H,C,u,A,a,k,v]),et=o.useMemo(()=>L.map(({record:e,index:t})=>V(e,t,v)),[v,L]),qt=P.map(String).join("|"),zt=et.map(String).join("|");o.useEffect(()=>{var l;if(!c||F||P.length===0)return;const e=new Set(et),t=P.filter(r=>e.has(r));if(t.length===P.length)return;c.selectedRowKeys===void 0&&Ve(t);const s=new Set(t),i=L.filter(({record:r,index:n})=>s.has(V(r,n,v))).map(({record:r})=>r);(l=c.onChange)==null||l.call(c,t,i,{type:"multiple"})},[F,c,v,qt,zt,L]),o.useEffect(()=>{const e=ve.current;if(!e||!(f!=null&&f.x)){Ue(r=>r.start===0&&r.end===0?r:{start:0,end:0}),Je(r=>r.start||r.end?{start:!1,end:!1}:r);return}const t=()=>{const r=e.querySelector(".bj-table__header .bj-table__header-row")??e.querySelector(".bj-table__body .bj-table__row");let n=0,_=0;if(r){Array.from(r.children).forEach(p=>{const j=p.getBoundingClientRect().width;p.classList.contains("bj-table__cell--fixed-right")?_+=j:(p.classList.contains("bj-table__cell--fixed-left")||p.classList.contains("bj-table__selection-cell--fixed"))&&(n+=j)});const h=e.clientLeft;n>0&&(n+=h),_>0&&(_=Math.max(_-h,0))}Ue(h=>h.start===n&&h.end===_?h:{start:n,end:_})},s=()=>{const r=e.scrollWidth-e.clientWidth,n=r>ke,_={start:n&&e.scrollLeft>ke,end:n&&e.scrollLeft<r-ke};Je(h=>h.start===_.start&&h.end===_.end?h:_)},i=()=>{t(),s()};i(),e.addEventListener("scroll",s,{passive:!0});const l=new ResizeObserver(i);return l.observe(e),e.firstElementChild&&l.observe(e.firstElementChild),()=>{e.removeEventListener("scroll",s),l.disconnect()}},[Mt,f==null?void 0:f.x,qe,L.length]);const fe=(e,t=K,s=O,i=H,l=A)=>{const r=Object.fromEntries(s),n=m.filterRecords(x,y,s),_=m.sortRecords(n,y,t);je==null||je({...a,current:i,pageSize:l,total:(a==null?void 0:a.total)??_.length},r,m.getSorterResult(y,t),{action:e,currentDataSource:_})},Tt=(e,t)=>{if(!e.sorter)return;const s=m.getColumnKey(e,t),i=m.getNextSortOrder(K.get(s)??null,e.sortDirections??gt),l=new Map;l.set(s,i),e.sortOrder===void 0&&Et(l),fe("sort",l)},Ke=(e,t,s)=>{const i=m.getColumnKey(e,t),l=new Map(O);l.set(i,s),e.filteredValue===void 0&&Ft(l),$(null),(a==null?void 0:a.current)===void 0&&le(1),fe("filter",K,l,1)},Lt=(e,t)=>{const s=m.getColumnKey(e,t),i=e.filterResetToDefaultFilteredValue?e.defaultFilteredValue??[]:[];ee(l=>new Map(l).set(s,i))},be=(e,t,s)=>{var l,r,n,_;const i=m.getColumnKey(e,t);if(T===i){$(null),pe(null),(l=e.onFilterDropdownOpenChange)==null||l.call(e,!1),(r=e.onFilterDropdownVisibleChange)==null||r.call(e,!1);return}We(""),He(""),Ee(void 0),ee(h=>new Map(h).set(i,O.get(i)??[])),$(i),s&&pe(s),(n=e.onFilterDropdownOpenChange)==null||n.call(e,!0),(_=e.onFilterDropdownVisibleChange)==null||_.call(e,!0)},It=(e,t)=>{var S,B;const s=m.getColumnKey(e,t),i=`bj-table-badge-${Ot}-${String(s).replace(/[^a-zA-Z0-9_-]/g,"-")}`,l=K.get(s)??null,r=O.get(s)??[],n=Ge.get(s)??r,_=e.filterDropdownOpen??e.filterDropdownVisible??T===s,h=e.filtered||r.length>0,p=l==="ascend"?"icon-a-zhengxumian":l==="descend"?"icon-a-daoxumian":"icon-a-weipaixumian",j=m.renderColumnTitle(e.title,{sortOrder:l,sortColumn:l?e:void 0,sortColumns:l?[{column:e,order:l}]:[],filters:Object.fromEntries(O)}),J=typeof e.filterDropdown=="function"?e.filterDropdown({prefixCls:"bj-table",selectedKeys:n.filter(b=>typeof b!="boolean"),setSelectedKeys:b=>ee(R=>new Map(R).set(s,b)),confirm:b=>{Ke(e,t,Ge.get(s)??n),(b==null?void 0:b.closeDropdown)===!1&&$(s)},clearFilters:b=>{const R=e.filterResetToDefaultFilteredValue?e.defaultFilteredValue??[]:[];ee(D=>new Map(D).set(s,R)),(b==null?void 0:b.confirm)===!0&&Ke(e,t,R),((b==null?void 0:b.closeDropdown)===!1||(b==null?void 0:b.confirm)!==!0)&&$(s)},filters:e.filters,close:()=>$(null),visible:_}):e.filterDropdown,w=e.filterRequest?kt??[]:e.filters??[],q=te&&!e.filterRequest?w.filter(b=>typeof e.filterSearch=="function"?e.filterSearch(te,b):os(te,b)):w,N=!!(e.filterSearch||e.filterRequest),M=d.jsxs("div",{className:z("bj-table__column-header",e.sorter&&"bj-table__column-header--sortable"),children:[e.badge!==void 0&&d.jsx("span",{"aria-label":"表头提示",className:"bj-table__column-badge-trigger",id:i,onBlur:()=>de(null),onClick:b=>b.stopPropagation(),onFocus:()=>de(s),onKeyDown:b=>b.stopPropagation(),onMouseEnter:()=>de(s),onMouseLeave:()=>de(null),role:"button",tabIndex:0,children:d.jsx("span",{"aria-hidden":"true",className:"bj-table__column-badge-shape"})}),d.jsxs("div",{className:"bj-table__column-title",children:[d.jsx("span",{className:"bj-table__column-title-content",children:j}),e.sorter&&d.jsx("span",{"aria-hidden":"true",className:"bj-table__column-sorter",children:d.jsx(Me,{className:"bj-table__column-sorter-icon",type:p})})]}),(e.filters||e.filterDropdown)&&d.jsxs("div",{className:"bj-table__filter",children:[d.jsx("button",{"aria-expanded":_,"aria-label":"筛选",className:z("bj-table__filter-trigger",h&&"bj-table__filter-trigger--active"),onClick:b=>{b.stopPropagation(),be(e,t)},type:"button",children:typeof e.filterIcon=="function"?e.filterIcon(h):e.filterIcon??d.jsx(Me,{className:"bj-table__filter-icon",type:h?"icon-shaixuan-daidian":"icon-a-shaixuanxi"})}),_&&Ne&&typeof document<"u"&&Zt.createPortal(d.jsx("div",{className:"bj-table__filter-dropdown",onClick:b=>b.stopPropagation(),role:"dialog",style:{left:Ne.left,top:Ne.top},children:J??d.jsx(ss.BDropdown,{...e.filterDropdownProps,emptyText:(Z==null?void 0:Z.filterEmptyText)??Q("暂无结果"),multiple:e.filterMultiple!==!1,onChange:(b,R)=>{var D,ot;ee(Qt=>new Map(Qt).set(s,b)),(ot=(D=e.filterDropdownProps)==null?void 0:D.onChange)==null||ot.call(D,b,R)},onConfirm:b=>{var R,D;Ke(e,t,b),(D=(R=e.filterDropdownProps)==null?void 0:R.onConfirm)==null||D.call(R,b)},onReset:()=>{var b,R;Lt(e,t),(R=(b=e.filterDropdownProps)==null?void 0:b.onReset)==null||R.call(b)},onSearch:b=>{var R,D;We(b),(D=(R=e.filterDropdownProps)==null?void 0:R.onSearch)==null||D.call(R,b)},options:q.map(b=>({label:b.text,description:b.description,value:b.value})),searchable:((S=e.filterDropdownProps)==null?void 0:S.searchable)??N,searchPlaceholder:((B=e.filterDropdownProps)==null?void 0:B.searchPlaceholder)??(e.filterRequest?Q("请输入搜索内容"):(Z==null?void 0:Z.filterSearchPlaceholder)??Q("搜索")),searchValue:Re,t:Q,value:n})}),document.body)]})]});return e.badge!==void 0?d.jsxs(es,{className:"bj-table__column-tooltip-wrapper",children:[d.jsx("div",{className:"bj-table__column-tooltip-trigger",children:M}),Pt===s&&d.jsx(Yt,{className:"bj-table__column-tooltip",content:e.badge,getAnchorElement:()=>document.getElementById(i),getPopupContainer:()=>document.body,placement:"top"})]}):M},tt=(e,t,s)=>{var r,n;t.selectedRowKeys===void 0&&Ve(e);const i=new Set(e),l=x.filter((_,h)=>i.has(V(_,h,v)));(r=t.onChange)==null||r.call(t,e,l),s&&((n=t.onSelect)==null||n.call(t,s,i.has(V(s,x.indexOf(s),v)),l))},wt=(e,t)=>{if(!c)return;const s=V(e,t,v),i=P.includes(s),l=c.type==="radio"?i?[]:[s]:i?P.filter(r=>r!==s):[...P,s];tt(l,c,e)},st=L.filter(({record:e})=>{var t;return!((t=c==null?void 0:c.getCheckboxProps)!=null&&t.call(c,e).disabled)}),ne=st.map(({record:e,index:t})=>V(e,t,v)),De=ne.length>0&&ne.every(e=>P.includes(e)),Vt=()=>{var s;if(!c||c.type==="radio")return;const e=new Set(ne),t=De?P.filter(i=>!e.has(i)):Array.from(new Set([...P,...ne]));tt(t,c),new Set(t),(s=c.onSelectAll)==null||s.call(c,!De,st.map(({record:i})=>i))},Gt=e=>{var t;!a||e<1||e>Xe||e===H||(a.current===void 0&&le(e),(t=a.onChange)==null||t.call(a,e,A),fe("paginate",K,O,e))},At=e=>{var s,i;if(!a||e===A)return;const t=1;Fe.current=!0,a.pageSize===void 0&&Nt(e),a.current===void 0&&le(t),(s=a.onShowSizeChange)==null||s.call(a,t,e),(i=a.onChange)==null||i.call(a,t,e),fe("paginate",K,O,t,e)},nt=y.length+(c?1:0),re=(c==null?void 0:c.columnWidth)??48,rt=e=>typeof e.width=="number"?e.width:0,at=(e,t)=>{const s=e.fixed===!0?"left":e.fixed;return s==="left"?{position:"sticky",left:y.slice(0,t).reduce((l,r)=>l+rt(r),c&&typeof re=="number"?re:0),zIndex:2}:s==="right"?{position:"sticky",right:y.slice(t+1).reduce((l,r)=>l+rt(r),0),zIndex:2}:{}},Wt=f!=null&&f.x?{width:f.x===!0?"max-content":f.x,minWidth:"100%",tableLayout:ye??"fixed"}:{tableLayout:ye},Ht=(E==null?void 0:E.table)??"table",$t=((ct=E==null?void 0:E.header)==null?void 0:ct.wrapper)??"thead",Ut=((ft=E==null?void 0:E.header)==null?void 0:ft.row)??"tr",it=((bt=E==null?void 0:E.header)==null?void 0:bt.cell)??"th",I=typeof(E==null?void 0:E.body)=="object"?E.body:void 0,Ct=(I==null?void 0:I.wrapper)??"tbody",lt=(I==null?void 0:I.row)??"tr",Pe=(I==null?void 0:I.cell)??"td",Jt=typeof ue=="function"?ue():ue??Q("暂无数据"),dt=typeof he=="string"?d.jsx("img",{alt:"",className:"bj-table__empty-image",src:he}):he;return d.jsxs("div",{id:vt,ref:ae,className:z("bj-table",ht&&"bj-table--bordered",`bj-table--${_t}`,oe&&"bj-table--loading",k.length===0&&"bj-table--empty",Ce.start&&"bj-table--ping-left",Ce.end&&"bj-table--ping-right",yt),style:xt,children:[Te&&d.jsx("div",{className:"bj-table__title",children:Te(k)}),d.jsxs("div",{className:"bj-table__viewport",children:[d.jsx("div",{className:z("bj-table__scroll",!!(f!=null&&f.x||f!=null&&f.y)&&"bj-overlay-scrollbar-hidden"),ref:ve,style:{maxHeight:f==null?void 0:f.y},children:d.jsxs(Ht,{className:"bj-table__native-table",style:Wt,children:[y.some(e=>e.width)&&d.jsxs("colgroup",{children:[c&&d.jsx("col",{className:"bj-table__selection-col",style:{width:re}}),y.map((e,t)=>d.jsx("col",{style:{width:e.width}},e.key??t))]}),qe&&d.jsx($t,{className:"bj-table__header",children:we.map((e,t)=>d.jsxs(Ut,{className:"bj-table__header-row",...ge==null?void 0:ge(y,t),children:[c&&t===0&&d.jsxs(it,{className:z("bj-table__header-cell","bj-table__selection-cell",!!(f!=null&&f.x)&&"bj-table__selection-cell--fixed",!!(f!=null&&f.x)&&!W(y[0])&&"bj-table__cell--fixed-left-last"),rowSpan:we.length,scope:"col",style:{width:re},children:[c.type!=="radio"&&d.jsx(ut,{checked:De,disabled:ne.length===0,onChange:Vt,label:"选择当前页所有行"}),c.columnTitle]}),e.map(({column:s,colSpan:i,rowSpan:l},r)=>{var w,q;const n=s,_=y.indexOf(n),h=_>=0?_:r,p=!("children"in s)&&!!(n.filters||n.filterDropdown),j=!("children"in s)&&!!n.sorter,J=()=>{p?be(n,h):j&&Tt(n,h)};return o.createElement(it,{...(w=n.onHeaderCell)==null?void 0:w.call(n,s,r),"aria-label":typeof n.title=="string"?n.title:void 0,"aria-sort":j?K.get(m.getColumnKey(n,h))==="ascend"?"ascending":K.get(m.getColumnKey(n,h))==="descend"?"descending":"none":void 0,className:z("bj-table__header-cell",((q=y[h+1])==null?void 0:q.fixed)==="right"&&"bj-table__cell--before-fixed-right",n.fixed&&"bj-table__cell--fixed",W(n)&&"bj-table__cell--fixed-left",W(n)&&!W(y[h+1])&&"bj-table__cell--fixed-left-last",X(n)&&"bj-table__cell--fixed-right",X(n)&&!X(y[h-1])&&"bj-table__cell--fixed-right-first",n.sorter&&"bj-table__header-cell--sortable",p&&"bj-table__header-cell--filterable",K.get(m.getColumnKey(n,h))&&"bj-table__header-cell--sorted",n.className),colSpan:i,key:n.key??String(n.dataIndex??r),onClick:N=>{var M,S,B;(B=(S=(M=n.onHeaderCell)==null?void 0:M.call(n,s,r))==null?void 0:S.onClick)==null||B.call(S,N),!N.target.closest(".bj-table__filter-dropdown")&&(p?be(n,h,N.currentTarget):J())},onKeyDown:N=>{var M,S,B;(B=(S=(M=n.onHeaderCell)==null?void 0:M.call(n,s,r))==null?void 0:S.onKeyDown)==null||B.call(S,N),!N.target.closest(".bj-table__filter-dropdown")&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),p?be(n,h,N.currentTarget):J())},rowSpan:l,scope:"col",style:{textAlign:n.align,...at(n,h)},tabIndex:p||j?0:void 0},"children"in s?m.renderColumnTitle(s.title,{filters:Object.fromEntries(O)}):It(n,h))})]},t))}),d.jsx(Ct,{className:"bj-table__body",children:L.length>0?L.map(({record:e,index:t})=>{var _;const s=V(e,t,v),i=se(e,t),l=((_=c==null?void 0:c.getCheckboxProps)==null?void 0:_.call(c,e).disabled)??!1,r=P.includes(s),n=typeof _e=="function"?_e(e,t,0):_e;return o.createElement(lt,{...xe==null?void 0:xe(e,t),className:z("bj-table__row",i&&"bj-table__row--group",r&&"bj-table__row--selected",n),key:s},c&&!i&&d.jsx(Pe,{className:z("bj-table__cell","bj-table__selection-cell",!!(f!=null&&f.x)&&"bj-table__selection-cell--fixed",!!(f!=null&&f.x)&&!W(y[0])&&"bj-table__cell--fixed-left-last"),style:{width:re},children:d.jsx(ut,{checked:r,disabled:l,label:`选择第 ${t+1} 行`,name:c.type==="radio"?"bj-table-row-selection":void 0,onChange:()=>wt(e,t),type:c.type??"checkbox"})}),y.map((h,p)=>{var S,B,b;if(i&&p>0)return null;const j=h,J=cs(e,j.dataIndex),w=j.render?j.render(J,e,t):J,q=bs(w)?w:void 0,N={...(S=j.onCell)==null?void 0:S.call(j,e,t),...q==null?void 0:q.props},M=q?q.children:w;return N.colSpan===0||N.rowSpan===0?null:o.createElement(Pe,{...N,className:z("bj-table__cell",((B=y[p+1])==null?void 0:B.fixed)==="right"&&"bj-table__cell--before-fixed-right",i&&"bj-table__cell--group",j.fixed&&"bj-table__cell--fixed",W(j)&&"bj-table__cell--fixed-left",W(j)&&!W(y[p+1])&&"bj-table__cell--fixed-left-last",X(j)&&"bj-table__cell--fixed-right",X(j)&&!X(y[p-1])&&"bj-table__cell--fixed-right-first",j.ellipsis&&"bj-table__cell--ellipsis",j.className,N.className),key:j.key??String(j.dataIndex??p),colSpan:i?nt:N.colSpan,style:{textAlign:j.align,...at(j,p),...N.style}},i?((b=u==null?void 0:u.render)==null?void 0:b.call(u,{record:e,expanded:C.includes(ce(e,t)),onToggle:()=>Bt(e,t)}))??M??"":d.jsx("div",{className:"bj-table__cell-content",children:M??""}))}))}):d.jsx(lt,{className:"bj-table__empty-row",children:d.jsx(Pe,{className:"bj-table__empty-cell",colSpan:Math.max(nt,1),style:{height:jt}})})}),Ie&&d.jsx("tfoot",{className:"bj-table__summary",children:Ie(k)})]})}),L.length===0&&d.jsx("div",{className:"bj-table__empty-overlay",children:d.jsxs("div",{className:"bj-table__empty-content",children:[dt&&d.jsx("div",{className:"bj-table__empty-image-wrap",children:dt}),d.jsx("div",{className:"bj-table__empty-text",children:Jt})]})})]}),((f==null?void 0:f.x)||(f==null?void 0:f.y))&&d.jsx(ns,{containerRef:ae,direction:f!=null&&f.x&&(f!=null&&f.y)?"both":f!=null&&f.x?"horizontal":"vertical",gap:2,horizontalInsetEnd:$e.end,horizontalInsetStart:$e.start,size:4,targetRef:ve}),Le&&d.jsx("div",{className:"bj-table__footer",children:Le(k)}),oe&&d.jsxs("div",{"aria-live":"polite","aria-busy":"true",className:"bj-table__loading",role:"status",children:[d.jsx("img",{alt:"",className:"bj-table__loading-indicator",src:rs}),d.jsx("span",{className:"bj-table__loading-text",children:"加载中..."})]}),a&&k.length>0&&d.jsx("div",{className:"bj-table__pagination",children:d.jsx(Xt,{align:"end",disabled:oe||a.disabled,current:H,defaultCurrent:a.defaultCurrent,defaultPageSize:a.defaultPageSize,dropdownClassName:a.dropdownClassName,hideOnSinglePage:a.hideOnSinglePage,onChange:e=>{if(Fe.current){Fe.current=!1;return}Gt(e)},onShowSizeChange:(e,t)=>At(t),pageSize:A,pageSizeOptions:a.pageSizeOptions,popupPlacement:a.popupPlacement,resolvePopupPlacement:a.resolvePopupPlacement,showQuickJumper:a.showQuickJumper,showSizeChanger:a.showSizeChanger,showTotal:a.showTotal,simple:a.simple,size:a.size,t:a.t??Q,total:Ze})})]})}const Be=us;Be.Column=is;Be.ColumnGroup=ls;exports.BTable=Be;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),o=require("react"),Zt=require("react-dom"),Xt=require("../Pagination/Pagination.js"),Be=require("../Icon/Icon.js");;/* empty css */const Yt=require("../Tooltip/ContentTooltip.js"),es=require("../Tooltip/TooltipWrapper.js"),ts=require("../CheckBox/index.js"),ss=require("../Dropdown/BDropdown.js"),ns=require("../OverlayScrollbar/BOverlayScrollbar.js"),rs=require("../SkuInputCard/spin_loading_red.gif.js"),as=require("../ProductField/no_data_light.svg.js"),is=require("./Column.js"),ls=require("./ColumnGroup.js"),m=require("./utils/sortFilter.js"),Oe=require("./utils/columns.js");;/* empty css */const ds=300,ke=1;function z(...g){return g.filter(Boolean).join(" ")}function cs(g,x){return x===void 0?void 0:(Array.isArray(x)?x:[x]).reduce((F,c)=>{if(!(F==null||typeof F!="object"))return F[c]},g)}function V(g,x,v){if(typeof v=="function")return v(g,x);if(v){const F=g[String(v)];if(typeof F=="string"||typeof F=="number")return F}return x}function fs(g,x){return Math.max(1,Math.ceil(g/x))}function bs(g){return!!(g&&typeof g=="object"&&!o.isValidElement(g)&&"props"in g)}function os(g,x){return(typeof x.text=="string"||typeof x.text=="number"?String(x.text):String(x.value)).toLocaleLowerCase().includes(g.toLocaleLowerCase())}function ut({checked:g,disabled:x,label:v,name:F,onChange:c,type:G="checkbox"}){return G==="checkbox"?d.jsx(ts.BCheckBox,{"aria-label":v,checked:g,className:"bj-table__selection-checkbox",disabled:x,name:F,onChange:c,skipGroup:!0}):d.jsxs("label",{className:z("bj-table__selection-control",g&&"bj-table__selection-control--checked",x&&"bj-table__selection-control--disabled"),children:[d.jsx("input",{"aria-label":v,checked:g,className:"bj-table__selection-input",disabled:x,name:F,onChange:c,type:G}),d.jsx("span",{"aria-hidden":"true",className:"bj-table__selection-box",children:g&&d.jsx(Be,{className:"bj-table__selection-check-icon",type:"icon-a-dagouxi"})})]})}function us({columns:g,dataSource:x=[],rowKey:v,preserveSelectedRowKeys:F=!1,rowSelection:c,pagination:G=!1,loading:oe=!1,bordered:ht=!0,size:_t="middle",showHeader:qe=!0,emptyText:ue,emptyImage:he=as,emptyHeight:jt,t:Q=ae=>ae,className:yt,style:xt,rowClassName:_e,sortDirections:gt=["ascend","descend",null],onChange:je,children:ze,title:Te,footer:Le,summary:Ie,tableLayout:ye,components:E,onRow:xe,onHeaderRow:ge,id:vt,scroll:f,locale:Z,groupCollapse:u}){var ct,ft,bt;const ae=o.useRef(null),ve=o.useRef(null),ie=o.useMemo(()=>g??Oe.convertChildrenToColumns(ze),[ze,g]),Y=o.useMemo(()=>Oe.flattenColumns(ie),[ie]),we=o.useMemo(()=>Oe.buildHeaderRows(ie),[ie]),[mt,Ve]=o.useState((c==null?void 0:c.defaultSelectedRowKeys)??[]),[me,le]=o.useState(G?G.defaultCurrent??1:1),[pt,Nt]=o.useState(G?G.defaultPageSize??10:10),[Rt,Et]=o.useState(()=>new Map(Y.flatMap((e,t)=>e.defaultSortOrder?[[m.getColumnKey(e,t),e.defaultSortOrder]]:[]))),[St,Ft]=o.useState(()=>new Map(Y.flatMap((e,t)=>e.defaultFilteredValue===void 0?[]:[[m.getColumnKey(e,t),e.defaultFilteredValue]]))),[Kt,Dt]=o.useState(u!=null&&u.defaultExpandedKeys?[...u.defaultExpandedKeys]:[]),[T,$]=o.useState(null),[Ge,ee]=o.useState(new Map),[Pt,de]=o.useState(null),Ot=o.useRef(`btable-${Math.random().toString(36).slice(2,10)}`).current,[U,pe]=o.useState(null),[Ne,Ae]=o.useState(null),[Re,We]=o.useState(""),[te,He]=o.useState(""),[kt,Ee]=o.useState(),Se=o.useRef(0),Fe=o.useRef(!1),[$e,Ue]=o.useState({start:0,end:0}),[Ce,Je]=o.useState({start:!1,end:!1}),a=G||void 0,A=(a==null?void 0:a.pageSize)??pt,P=(c==null?void 0:c.selectedRowKeys)??mt,y=Y,Bt=`${y.map(e=>`${String(e.fixed??"")}:${String(e.width??"")}`).join("|")}|${c?String(c.columnWidth??""):"-"}|${String((f==null?void 0:f.x)??"")}|${String(ye??"")}`,W=e=>!!(e&&(e.fixed==="left"||e.fixed===!0)),X=e=>!!(e&&e.fixed==="right"),K=new Map(Rt),O=new Map(St);y.forEach((e,t)=>{if("children"in e)return;const s=m.getColumnKey(e,t);e.sortOrder!==void 0&&K.set(s,e.sortOrder),e.filteredValue!==void 0&&O.set(s,e.filteredValue)});const Qe=o.useMemo(()=>m.filterRecords(x,y,O),[y,O,x]),k=o.useMemo(()=>m.sortRecords(Qe,y,K),[y,Qe,K]),Ze=(a==null?void 0:a.total)??k.length,Xe=fs(Ze,A),H=Math.min((a==null?void 0:a.current)??me,Xe),C=(u==null?void 0:u.expandedKeys)??Kt,se=(e,t)=>u!=null&&u.isGroupRow?u.isGroupRow(e,t):!!e.isGroup,ce=(e,t)=>u!=null&&u.groupKey?u.groupKey(e,t):e.groupId,Ye=(e,t)=>u!=null&&u.childrenKeys?u.childrenKeys(e,t):e.childrenIds??[],Mt=(e,t)=>{var r;const s=ce(e,t),i=C.includes(s),l=i?C.filter(n=>n!==s):[...C,s];(u==null?void 0:u.expandedKeys)===void 0&&Dt(l),(r=u==null?void 0:u.onExpandedKeysChange)==null||r.call(u,l,e,!i)};o.useEffect(()=>{H!==me&&(a==null?void 0:a.current)===void 0&&le(H)},[H,a==null?void 0:a.current,me]),o.useEffect(()=>{if(!U||T===null){Ae(null);return}const e=()=>{const t=U.getBoundingClientRect();Ae({left:t.left,top:t.bottom+4})};return e(),document.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{document.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[U,T]),o.useEffect(()=>{if(T===null)return;const e=t=>{const s=t.target;U!=null&&U.contains(s)||s.closest(".bj-table__filter-dropdown")||($(null),pe(null))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[U,T]),o.useEffect(()=>{const e=window.setTimeout(()=>He(Re.trim()),ds);return()=>window.clearTimeout(e)},[Re]),o.useEffect(()=>{if(T===null)return;const e=Y.find((s,i)=>m.getColumnKey(s,i)===T);if(!e||"children"in e||!e.filterRequest)return;const t=++Se.current;Promise.resolve().then(()=>e.filterRequest(te)).then(s=>{Se.current===t&&Ee(s)},()=>{Se.current===t&&Ee([])})},[te,Y,T]);const L=o.useMemo(()=>{if(!a||a.serverPagination)return k.map((t,s)=>({record:t,index:s})).filter(({record:t,index:s})=>{if(!u||se(t,s))return!0;const i=V(t,s,v);return k.some((l,r)=>se(l,r)&&C.includes(ce(l,r))&&Ye(l,r).includes(i))});const e=(H-1)*A;return k.slice(e,e+A).map((t,s)=>({record:t,index:e+s})).filter(({record:t,index:s})=>{if(!u||se(t,s))return!0;const i=V(t,s,v);return k.some((l,r)=>se(l,r)&&C.includes(ce(l,r))&&Ye(l,r).includes(i))})},[H,C,u,A,a,k,v]),et=o.useMemo(()=>L.map(({record:e,index:t})=>V(e,t,v)),[v,L]),qt=P.map(String).join("|"),zt=et.map(String).join("|");o.useEffect(()=>{var l;if(!c||F||P.length===0)return;const e=new Set(et),t=P.filter(r=>e.has(r));if(t.length===P.length)return;c.selectedRowKeys===void 0&&Ve(t);const s=new Set(t),i=L.filter(({record:r,index:n})=>s.has(V(r,n,v))).map(({record:r})=>r);(l=c.onChange)==null||l.call(c,t,i,{type:"multiple"})},[F,c,v,qt,zt,L]),o.useEffect(()=>{const e=ve.current;if(!e||!(f!=null&&f.x)){Ue(r=>r.start===0&&r.end===0?r:{start:0,end:0}),Je(r=>r.start||r.end?{start:!1,end:!1}:r);return}const t=()=>{const r=e.querySelector(".bj-table__header .bj-table__header-row")??e.querySelector(".bj-table__body .bj-table__row");let n=0,_=0;if(r){Array.from(r.children).forEach(p=>{const j=p.getBoundingClientRect().width;p.classList.contains("bj-table__cell--fixed-right")?_+=j:(p.classList.contains("bj-table__cell--fixed-left")||p.classList.contains("bj-table__selection-cell--fixed"))&&(n+=j)});const h=e.clientLeft;n>0&&(n+=h),_>0&&(_=Math.max(_-h,0))}Ue(h=>h.start===n&&h.end===_?h:{start:n,end:_})},s=()=>{const r=e.scrollWidth-e.clientWidth,n=r>ke,_={start:n&&e.scrollLeft>ke,end:n&&e.scrollLeft<r-ke};Je(h=>h.start===_.start&&h.end===_.end?h:_)},i=()=>{t(),s()};i(),e.addEventListener("scroll",s,{passive:!0});const l=new ResizeObserver(i);return l.observe(e),e.firstElementChild&&l.observe(e.firstElementChild),()=>{e.removeEventListener("scroll",s),l.disconnect()}},[Bt,f==null?void 0:f.x,qe,L.length]);const fe=(e,t=K,s=O,i=H,l=A)=>{const r=Object.fromEntries(s),n=m.filterRecords(x,y,s),_=m.sortRecords(n,y,t);je==null||je({...a,current:i,pageSize:l,total:(a==null?void 0:a.total)??_.length},r,m.getSorterResult(y,t),{action:e,currentDataSource:_})},Tt=(e,t)=>{if(!e.sorter)return;const s=m.getColumnKey(e,t),i=m.getNextSortOrder(K.get(s)??null,e.sortDirections??gt),l=new Map;l.set(s,i),e.sortOrder===void 0&&Et(l),fe("sort",l)},Ke=(e,t,s)=>{const i=m.getColumnKey(e,t),l=new Map(O);l.set(i,s),e.filteredValue===void 0&&Ft(l),$(null),(a==null?void 0:a.current)===void 0&&le(1),fe("filter",K,l,1)},Lt=(e,t)=>{const s=m.getColumnKey(e,t),i=e.filterResetToDefaultFilteredValue?e.defaultFilteredValue??[]:[];ee(l=>new Map(l).set(s,i))},be=(e,t,s)=>{var l,r,n,_;const i=m.getColumnKey(e,t);if(T===i){$(null),pe(null),(l=e.onFilterDropdownOpenChange)==null||l.call(e,!1),(r=e.onFilterDropdownVisibleChange)==null||r.call(e,!1);return}We(""),He(""),Ee(void 0),ee(h=>new Map(h).set(i,O.get(i)??[])),$(i),s&&pe(s),(n=e.onFilterDropdownOpenChange)==null||n.call(e,!0),(_=e.onFilterDropdownVisibleChange)==null||_.call(e,!0)},It=(e,t)=>{var S,M;const s=m.getColumnKey(e,t),i=`bj-table-badge-${Ot}-${String(s).replace(/[^a-zA-Z0-9_-]/g,"-")}`,l=K.get(s)??null,r=O.get(s)??[],n=Ge.get(s)??r,_=e.filterDropdownOpen??e.filterDropdownVisible??T===s,h=e.filtered||r.length>0,p=l==="ascend"?"icon-a-zhengxumian":l==="descend"?"icon-a-daoxumian":"icon-a-weipaixumian",j=m.renderColumnTitle(e.title,{sortOrder:l,sortColumn:l?e:void 0,sortColumns:l?[{column:e,order:l}]:[],filters:Object.fromEntries(O)}),J=typeof e.filterDropdown=="function"?e.filterDropdown({prefixCls:"bj-table",selectedKeys:n.filter(b=>typeof b!="boolean"),setSelectedKeys:b=>ee(R=>new Map(R).set(s,b)),confirm:b=>{Ke(e,t,Ge.get(s)??n),(b==null?void 0:b.closeDropdown)===!1&&$(s)},clearFilters:b=>{const R=e.filterResetToDefaultFilteredValue?e.defaultFilteredValue??[]:[];ee(D=>new Map(D).set(s,R)),(b==null?void 0:b.confirm)===!0&&Ke(e,t,R),((b==null?void 0:b.closeDropdown)===!1||(b==null?void 0:b.confirm)!==!0)&&$(s)},filters:e.filters,close:()=>$(null),visible:_}):e.filterDropdown,w=e.filterRequest?kt??[]:e.filters??[],q=te&&!e.filterRequest?w.filter(b=>typeof e.filterSearch=="function"?e.filterSearch(te,b):os(te,b)):w,N=!!(e.filterSearch||e.filterRequest),B=d.jsxs("div",{className:z("bj-table__column-header",e.sorter&&"bj-table__column-header--sortable"),children:[e.badge!==void 0&&d.jsx("span",{"aria-label":"表头提示",className:"bj-table__column-badge-trigger",id:i,onBlur:()=>de(null),onClick:b=>b.stopPropagation(),onFocus:()=>de(s),onKeyDown:b=>b.stopPropagation(),onMouseEnter:()=>de(s),onMouseLeave:()=>de(null),role:"button",tabIndex:0,children:d.jsx("span",{"aria-hidden":"true",className:"bj-table__column-badge-shape"})}),d.jsxs("div",{className:"bj-table__column-title",children:[d.jsx("span",{className:"bj-table__column-title-content",children:j}),e.sorter&&d.jsx("span",{"aria-hidden":"true",className:"bj-table__column-sorter",children:d.jsx(Be,{className:"bj-table__column-sorter-icon",type:p})})]}),(e.filters||e.filterDropdown)&&d.jsxs("div",{className:"bj-table__filter",children:[d.jsx("button",{"aria-expanded":_,"aria-label":"筛选",className:z("bj-table__filter-trigger",h&&"bj-table__filter-trigger--active"),onClick:b=>{b.stopPropagation(),be(e,t)},type:"button",children:typeof e.filterIcon=="function"?e.filterIcon(h):e.filterIcon??d.jsx(Be,{className:"bj-table__filter-icon",type:h?"icon-shaixuan-daidian":"icon-a-shaixuanxi"})}),_&&Ne&&typeof document<"u"&&Zt.createPortal(d.jsx("div",{className:"bj-table__filter-dropdown",onClick:b=>b.stopPropagation(),role:"dialog",style:{left:Ne.left,top:Ne.top},children:J??d.jsx(ss.BDropdown,{...e.filterDropdownProps,emptyText:(Z==null?void 0:Z.filterEmptyText)??Q("暂无结果"),multiple:e.filterMultiple!==!1,onChange:(b,R)=>{var D,ot;ee(Qt=>new Map(Qt).set(s,b)),(ot=(D=e.filterDropdownProps)==null?void 0:D.onChange)==null||ot.call(D,b,R)},onConfirm:b=>{var R,D;Ke(e,t,b),(D=(R=e.filterDropdownProps)==null?void 0:R.onConfirm)==null||D.call(R,b)},onReset:()=>{var b,R;Lt(e,t),(R=(b=e.filterDropdownProps)==null?void 0:b.onReset)==null||R.call(b)},onSearch:b=>{var R,D;We(b),(D=(R=e.filterDropdownProps)==null?void 0:R.onSearch)==null||D.call(R,b)},options:q.map(b=>({label:b.text,description:b.description,value:b.value})),searchable:((S=e.filterDropdownProps)==null?void 0:S.searchable)??N,searchPlaceholder:((M=e.filterDropdownProps)==null?void 0:M.searchPlaceholder)??(e.filterRequest?Q("请输入搜索内容"):(Z==null?void 0:Z.filterSearchPlaceholder)??Q("搜索")),searchValue:Re,t:Q,value:n})}),document.body)]})]});return e.badge!==void 0?d.jsxs(es,{className:"bj-table__column-tooltip-wrapper",children:[d.jsx("div",{className:"bj-table__column-tooltip-trigger",children:B}),Pt===s&&d.jsx(Yt,{className:"bj-table__column-tooltip",content:e.badge,getAnchorElement:()=>document.getElementById(i),getPopupContainer:()=>document.body,placement:"top"})]}):B},tt=(e,t,s)=>{var r,n;t.selectedRowKeys===void 0&&Ve(e);const i=new Set(e),l=x.filter((_,h)=>i.has(V(_,h,v)));(r=t.onChange)==null||r.call(t,e,l),s&&((n=t.onSelect)==null||n.call(t,s,i.has(V(s,x.indexOf(s),v)),l))},wt=(e,t)=>{if(!c)return;const s=V(e,t,v),i=P.includes(s),l=c.type==="radio"?i?[]:[s]:i?P.filter(r=>r!==s):[...P,s];tt(l,c,e)},st=L.filter(({record:e})=>{var t;return!((t=c==null?void 0:c.getCheckboxProps)!=null&&t.call(c,e).disabled)}),ne=st.map(({record:e,index:t})=>V(e,t,v)),De=ne.length>0&&ne.every(e=>P.includes(e)),Vt=()=>{var s;if(!c||c.type==="radio")return;const e=new Set(ne),t=De?P.filter(i=>!e.has(i)):Array.from(new Set([...P,...ne]));tt(t,c),new Set(t),(s=c.onSelectAll)==null||s.call(c,!De,st.map(({record:i})=>i))},Gt=e=>{var t;!a||e<1||e>Xe||e===H||(a.current===void 0&&le(e),(t=a.onChange)==null||t.call(a,e,A),fe("paginate",K,O,e))},At=e=>{var s,i;if(!a||e===A)return;const t=1;Fe.current=!0,a.pageSize===void 0&&Nt(e),a.current===void 0&&le(t),(s=a.onShowSizeChange)==null||s.call(a,t,e),(i=a.onChange)==null||i.call(a,t,e),fe("paginate",K,O,t,e)},nt=y.length+(c?1:0),re=(c==null?void 0:c.columnWidth)??48,rt=e=>typeof e.width=="number"?e.width:0,at=(e,t)=>{const s=e.fixed===!0?"left":e.fixed;return s==="left"?{position:"sticky",left:y.slice(0,t).reduce((l,r)=>l+rt(r),c&&typeof re=="number"?re:0),zIndex:2}:s==="right"?{position:"sticky",right:y.slice(t+1).reduce((l,r)=>l+rt(r),0),zIndex:2}:{}},Wt=f!=null&&f.x?{width:f.x===!0?"max-content":f.x,minWidth:"100%",tableLayout:ye??"fixed"}:{tableLayout:ye},Ht=(E==null?void 0:E.table)??"table",$t=((ct=E==null?void 0:E.header)==null?void 0:ct.wrapper)??"thead",Ut=((ft=E==null?void 0:E.header)==null?void 0:ft.row)??"tr",it=((bt=E==null?void 0:E.header)==null?void 0:bt.cell)??"th",I=typeof(E==null?void 0:E.body)=="object"?E.body:void 0,Ct=(I==null?void 0:I.wrapper)??"tbody",lt=(I==null?void 0:I.row)??"tr",Pe=(I==null?void 0:I.cell)??"td",Jt=typeof ue=="function"?ue():ue??Q("暂无数据"),dt=typeof he=="string"?d.jsx("img",{alt:"",className:"bj-table__empty-image",src:he}):he;return d.jsxs("div",{id:vt,ref:ae,className:z("bj-table",ht&&"bj-table--bordered",`bj-table--${_t}`,oe&&"bj-table--loading",k.length===0&&"bj-table--empty",Ce.start&&"bj-table--ping-left",Ce.end&&"bj-table--ping-right",yt),style:xt,children:[Te&&d.jsx("div",{className:"bj-table__title",children:Te(k)}),d.jsxs("div",{className:"bj-table__viewport",children:[d.jsx("div",{className:z("bj-table__scroll",!!(f!=null&&f.x||f!=null&&f.y)&&"bj-overlay-scrollbar-hidden"),ref:ve,style:{maxHeight:f==null?void 0:f.y},children:d.jsxs(Ht,{className:"bj-table__native-table",style:Wt,children:[y.some(e=>e.width)&&d.jsxs("colgroup",{children:[c&&d.jsx("col",{className:"bj-table__selection-col",style:{width:re}}),y.map((e,t)=>d.jsx("col",{style:{width:e.width}},e.key??t))]}),qe&&d.jsx($t,{className:"bj-table__header",children:we.map((e,t)=>d.jsxs(Ut,{className:"bj-table__header-row",...ge==null?void 0:ge(y,t),children:[c&&t===0&&d.jsxs(it,{className:z("bj-table__header-cell","bj-table__selection-cell",!!(f!=null&&f.x)&&"bj-table__selection-cell--fixed",!!(f!=null&&f.x)&&!W(y[0])&&"bj-table__cell--fixed-left-last"),rowSpan:we.length,scope:"col",style:{width:re},children:[c.type!=="radio"&&d.jsx(ut,{checked:De,disabled:ne.length===0,onChange:Vt,label:"选择当前页所有行"}),c.columnTitle]}),e.map(({column:s,colSpan:i,rowSpan:l},r)=>{var w,q;const n=s,_=y.indexOf(n),h=_>=0?_:r,p=!("children"in s)&&!!(n.filters||n.filterDropdown),j=!("children"in s)&&!!n.sorter,J=()=>{p?be(n,h):j&&Tt(n,h)};return o.createElement(it,{...(w=n.onHeaderCell)==null?void 0:w.call(n,s,r),"aria-label":typeof n.title=="string"?n.title:void 0,"aria-sort":j?K.get(m.getColumnKey(n,h))==="ascend"?"ascending":K.get(m.getColumnKey(n,h))==="descend"?"descending":"none":void 0,className:z("bj-table__header-cell",((q=y[h+1])==null?void 0:q.fixed)==="right"&&"bj-table__cell--before-fixed-right",n.fixed&&"bj-table__cell--fixed",W(n)&&"bj-table__cell--fixed-left",W(n)&&!W(y[h+1])&&"bj-table__cell--fixed-left-last",X(n)&&"bj-table__cell--fixed-right",X(n)&&!X(y[h-1])&&"bj-table__cell--fixed-right-first",n.sorter&&"bj-table__header-cell--sortable",p&&"bj-table__header-cell--filterable",K.get(m.getColumnKey(n,h))&&"bj-table__header-cell--sorted",n.className),colSpan:i,key:n.key??String(n.dataIndex??r),onClick:N=>{var B,S,M;(M=(S=(B=n.onHeaderCell)==null?void 0:B.call(n,s,r))==null?void 0:S.onClick)==null||M.call(S,N),!N.target.closest(".bj-table__filter-dropdown")&&(p?be(n,h,N.currentTarget):J())},onKeyDown:N=>{var B,S,M;(M=(S=(B=n.onHeaderCell)==null?void 0:B.call(n,s,r))==null?void 0:S.onKeyDown)==null||M.call(S,N),!N.target.closest(".bj-table__filter-dropdown")&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),p?be(n,h,N.currentTarget):J())},rowSpan:l,scope:"col",style:{textAlign:n.align,...at(n,h)},tabIndex:p||j?0:void 0},"children"in s?m.renderColumnTitle(s.title,{filters:Object.fromEntries(O)}):It(n,h))})]},t))}),d.jsx(Ct,{className:"bj-table__body",children:L.length>0?L.map(({record:e,index:t})=>{var _;const s=V(e,t,v),i=se(e,t),l=((_=c==null?void 0:c.getCheckboxProps)==null?void 0:_.call(c,e).disabled)??!1,r=P.includes(s),n=typeof _e=="function"?_e(e,t,0):_e;return o.createElement(lt,{...xe==null?void 0:xe(e,t),className:z("bj-table__row",i&&"bj-table__row--group",r&&"bj-table__row--selected",n),key:s},c&&!i&&d.jsx(Pe,{className:z("bj-table__cell","bj-table__selection-cell",!!(f!=null&&f.x)&&"bj-table__selection-cell--fixed",!!(f!=null&&f.x)&&!W(y[0])&&"bj-table__cell--fixed-left-last"),style:{width:re},children:d.jsx(ut,{checked:r,disabled:l,label:`选择第 ${t+1} 行`,name:c.type==="radio"?"bj-table-row-selection":void 0,onChange:()=>wt(e,t),type:c.type??"checkbox"})}),y.map((h,p)=>{var S,M,b;if(i&&p>0)return null;const j=h,J=cs(e,j.dataIndex),w=j.render?j.render(J,e,t):J,q=bs(w)?w:void 0,N={...(S=j.onCell)==null?void 0:S.call(j,e,t),...q==null?void 0:q.props},B=q?q.children:w;return N.colSpan===0||N.rowSpan===0?null:o.createElement(Pe,{...N,className:z("bj-table__cell",((M=y[p+1])==null?void 0:M.fixed)==="right"&&"bj-table__cell--before-fixed-right",i&&"bj-table__cell--group",j.fixed&&"bj-table__cell--fixed",W(j)&&"bj-table__cell--fixed-left",W(j)&&!W(y[p+1])&&"bj-table__cell--fixed-left-last",X(j)&&"bj-table__cell--fixed-right",X(j)&&!X(y[p-1])&&"bj-table__cell--fixed-right-first",j.ellipsis&&"bj-table__cell--ellipsis",j.className,N.className),key:j.key??String(j.dataIndex??p),colSpan:i?nt:N.colSpan,style:{textAlign:j.align,...at(j,p),...N.style}},i?((b=u==null?void 0:u.render)==null?void 0:b.call(u,{record:e,expanded:C.includes(ce(e,t)),onToggle:()=>Mt(e,t)}))??B??"":d.jsx("div",{className:"bj-table__cell-content",children:B??""}))}))}):d.jsx(lt,{className:"bj-table__empty-row",children:d.jsx(Pe,{className:"bj-table__empty-cell",colSpan:Math.max(nt,1),style:{height:jt}})})}),Ie&&d.jsx("tfoot",{className:"bj-table__summary",children:Ie(k)})]})}),L.length===0&&d.jsx("div",{className:"bj-table__empty-overlay",children:d.jsxs("div",{className:"bj-table__empty-content",children:[dt&&d.jsx("div",{className:"bj-table__empty-image-wrap",children:dt}),d.jsx("div",{className:"bj-table__empty-text",children:Jt})]})})]}),((f==null?void 0:f.x)||(f==null?void 0:f.y))&&d.jsx(ns,{containerRef:ae,direction:f!=null&&f.x&&(f!=null&&f.y)?"both":f!=null&&f.x?"horizontal":"vertical",gap:2,horizontalInsetEnd:$e.end,horizontalInsetStart:$e.start,size:4,targetRef:ve}),Le&&d.jsx("div",{className:"bj-table__footer",children:Le(k)}),oe&&d.jsxs("div",{"aria-live":"polite","aria-busy":"true",className:"bj-table__loading",role:"status",children:[d.jsx("img",{alt:"",className:"bj-table__loading-indicator",src:rs}),d.jsx("span",{className:"bj-table__loading-text",children:"加载中..."})]}),a&&k.length>0&&d.jsx("div",{className:"bj-table__pagination",children:d.jsx(Xt,{align:"end",disabled:!!oe||a.disabled,current:H,defaultCurrent:a.defaultCurrent,defaultPageSize:a.defaultPageSize,dropdownClassName:a.dropdownClassName,hideOnSinglePage:a.hideOnSinglePage,onChange:e=>{if(Fe.current){Fe.current=!1;return}Gt(e)},onShowSizeChange:(e,t)=>At(t),pageSize:A,pageSizeOptions:a.pageSizeOptions,popupPlacement:a.popupPlacement,resolvePopupPlacement:a.resolvePopupPlacement,showQuickJumper:a.showQuickJumper,showSizeChanger:a.showSizeChanger,showTotal:a.showTotal,simple:a.simple,size:a.size,t:a.t??Q,total:Ze})})]})}const Me=us;Me.Column=is;Me.ColumnGroup=ls;exports.BTable=Me;
|
|
@@ -13,7 +13,7 @@ import hr from "../SkuInputCard/spin_loading_red.gif.mjs";
|
|
|
13
13
|
import or from "../ProductField/no_data_light.svg.mjs";
|
|
14
14
|
import _r from "./Column.mjs";
|
|
15
15
|
import ur from "./ColumnGroup.mjs";
|
|
16
|
-
import { getColumnKey as
|
|
16
|
+
import { getColumnKey as B, filterRecords as yt, sortRecords as jt, renderColumnTitle as mt, getNextSortOrder as yr, getSorterResult as jr } from "./utils/sortFilter.mjs";
|
|
17
17
|
import { convertChildrenToColumns as mr, flattenColumns as gr, buildHeaderRows as pr } from "./utils/columns.mjs";
|
|
18
18
|
/* empty css */
|
|
19
19
|
const vr = 300, Te = 1;
|
|
@@ -121,18 +121,18 @@ function Dr({
|
|
|
121
121
|
(d == null ? void 0 : d.defaultSelectedRowKeys) ?? []
|
|
122
122
|
), [Fe, be] = R(
|
|
123
123
|
A ? A.defaultCurrent ?? 1 : 1
|
|
124
|
-
), [kt,
|
|
124
|
+
), [kt, Bt] = R(
|
|
125
125
|
A ? A.defaultPageSize ?? 10 : 10
|
|
126
|
-
), [
|
|
127
|
-
() => new Map(re.flatMap((e, t) => e.defaultSortOrder ? [[
|
|
126
|
+
), [Ot, Kt] = R(
|
|
127
|
+
() => new Map(re.flatMap((e, t) => e.defaultSortOrder ? [[B(e, t), e.defaultSortOrder]] : []))
|
|
128
128
|
), [St, zt] = R(
|
|
129
|
-
() => new Map(re.flatMap((e, t) => e.defaultFilteredValue === void 0 ? [] : [[
|
|
129
|
+
() => new Map(re.flatMap((e, t) => e.defaultFilteredValue === void 0 ? [] : [[B(e, t), e.defaultFilteredValue]]))
|
|
130
130
|
), [Mt, Tt] = R(
|
|
131
131
|
h != null && h.defaultExpandedKeys ? [...h.defaultExpandedKeys] : []
|
|
132
|
-
), [I, U] = R(null), [$e, ie] = R(/* @__PURE__ */ new Map()), [Lt, he] = R(null), It = de(`btable-${Math.random().toString(36).slice(2, 10)}`).current, [J, De] = R(null), [Ee, He] = R(null), [Pe, Ue] = R(""), [ae, Je] = R(""), [Vt, ke] = R(),
|
|
132
|
+
), [I, U] = R(null), [$e, ie] = R(/* @__PURE__ */ new Map()), [Lt, he] = R(null), It = de(`btable-${Math.random().toString(36).slice(2, 10)}`).current, [J, De] = R(null), [Ee, He] = R(null), [Pe, Ue] = R(""), [ae, Je] = R(""), [Vt, ke] = R(), Be = de(0), Oe = de(!1), [Qe, Ze] = R({ start: 0, end: 0 }), [Xe, Ye] = R({ start: !1, end: !1 }), n = A || void 0, W = (n == null ? void 0 : n.pageSize) ?? kt, O = (d == null ? void 0 : d.selectedRowKeys) ?? Pt, y = re, wt = `${y.map((e) => `${String(e.fixed ?? "")}:${String(e.width ?? "")}`).join("|")}|${d ? String(d.columnWidth ?? "") : "-"}|${String((f == null ? void 0 : f.x) ?? "")}|${String(ve ?? "")}`, $ = (e) => !!(e && (e.fixed === "left" || e.fixed === !0)), te = (e) => !!(e && e.fixed === "right"), P = new Map(Ot), K = new Map(St);
|
|
133
133
|
y.forEach((e, t) => {
|
|
134
134
|
if ("children" in e) return;
|
|
135
|
-
const r =
|
|
135
|
+
const r = B(e, t);
|
|
136
136
|
e.sortOrder !== void 0 && P.set(r, e.sortOrder), e.filteredValue !== void 0 && K.set(r, e.filteredValue);
|
|
137
137
|
});
|
|
138
138
|
const Ce = X(
|
|
@@ -175,15 +175,15 @@ function Dr({
|
|
|
175
175
|
return () => window.clearTimeout(e);
|
|
176
176
|
}, [Pe]), Y(() => {
|
|
177
177
|
if (I === null) return;
|
|
178
|
-
const e = re.find((r, s) =>
|
|
178
|
+
const e = re.find((r, s) => B(r, s) === I);
|
|
179
179
|
if (!e || "children" in e || !e.filterRequest) return;
|
|
180
|
-
const t = ++
|
|
180
|
+
const t = ++Be.current;
|
|
181
181
|
Promise.resolve().then(() => e.filterRequest(ae)).then(
|
|
182
182
|
(r) => {
|
|
183
|
-
|
|
183
|
+
Be.current === t && ke(r);
|
|
184
184
|
},
|
|
185
185
|
() => {
|
|
186
|
-
|
|
186
|
+
Be.current === t && ke([]);
|
|
187
187
|
}
|
|
188
188
|
);
|
|
189
189
|
}, [ae, re, I]);
|
|
@@ -210,12 +210,12 @@ function Dr({
|
|
|
210
210
|
}, [H, Q, h, W, n, S, g]), it = X(
|
|
211
211
|
() => V.map(({ record: e, index: t }) => q(e, t, g)),
|
|
212
212
|
[g, V]
|
|
213
|
-
), qt =
|
|
213
|
+
), qt = O.map(String).join("|"), At = it.map(String).join("|");
|
|
214
214
|
Y(() => {
|
|
215
215
|
var l;
|
|
216
|
-
if (!d || D ||
|
|
217
|
-
const e = new Set(it), t =
|
|
218
|
-
if (t.length ===
|
|
216
|
+
if (!d || D || O.length === 0) return;
|
|
217
|
+
const e = new Set(it), t = O.filter((a) => e.has(a));
|
|
218
|
+
if (t.length === O.length) return;
|
|
219
219
|
d.selectedRowKeys === void 0 && We(t);
|
|
220
220
|
const r = new Set(t), s = V.filter(({ record: a, index: i }) => r.has(q(a, i, g))).map(({ record: a }) => a);
|
|
221
221
|
(l = d.onChange) == null || l.call(d, t, s, { type: "multiple" });
|
|
@@ -262,17 +262,17 @@ function Dr({
|
|
|
262
262
|
);
|
|
263
263
|
}, Wt = (e, t) => {
|
|
264
264
|
if (!e.sorter) return;
|
|
265
|
-
const r =
|
|
265
|
+
const r = B(e, t), s = yr(P.get(r) ?? null, e.sortDirections ?? Dt), l = /* @__PURE__ */ new Map();
|
|
266
266
|
l.set(r, s), e.sortOrder === void 0 && Kt(l), _e("sort", l);
|
|
267
267
|
}, Ke = (e, t, r) => {
|
|
268
|
-
const s =
|
|
268
|
+
const s = B(e, t), l = new Map(K);
|
|
269
269
|
l.set(s, r), e.filteredValue === void 0 && zt(l), U(null), (n == null ? void 0 : n.current) === void 0 && be(1), _e("filter", P, l, 1);
|
|
270
270
|
}, $t = (e, t) => {
|
|
271
|
-
const r =
|
|
271
|
+
const r = B(e, t), s = e.filterResetToDefaultFilteredValue ? e.defaultFilteredValue ?? [] : [];
|
|
272
272
|
ie((l) => new Map(l).set(r, s));
|
|
273
273
|
}, ue = (e, t, r) => {
|
|
274
274
|
var l, a, i, _;
|
|
275
|
-
const s =
|
|
275
|
+
const s = B(e, t);
|
|
276
276
|
if (I === s) {
|
|
277
277
|
U(null), De(null), (l = e.onFilterDropdownOpenChange) == null || l.call(e, !1), (a = e.onFilterDropdownVisibleChange) == null || a.call(e, !1);
|
|
278
278
|
return;
|
|
@@ -280,7 +280,7 @@ function Dr({
|
|
|
280
280
|
Ue(""), Je(""), ke(void 0), ie((o) => new Map(o).set(s, K.get(s) ?? [])), U(s), r && De(r), (i = e.onFilterDropdownOpenChange) == null || i.call(e, !0), (_ = e.onFilterDropdownVisibleChange) == null || _.call(e, !0);
|
|
281
281
|
}, Ht = (e, t) => {
|
|
282
282
|
var F, M;
|
|
283
|
-
const r =
|
|
283
|
+
const r = B(e, t), s = `bj-table-badge-${It}-${String(r).replace(/[^a-zA-Z0-9_-]/g, "-")}`, l = P.get(r) ?? null, a = K.get(r) ?? [], i = $e.get(r) ?? a, _ = e.filterDropdownOpen ?? e.filterDropdownVisible ?? I === r, o = e.filtered || a.length > 0, p = l === "ascend" ? "icon-a-zhengxumian" : l === "descend" ? "icon-a-daoxumian" : "icon-a-weipaixumian", u = mt(e.title, {
|
|
284
284
|
sortOrder: l,
|
|
285
285
|
sortColumn: l ? e : void 0,
|
|
286
286
|
sortColumns: l ? [{ column: e, order: l }] : [],
|
|
@@ -423,7 +423,7 @@ function Dr({
|
|
|
423
423
|
}, Ut = (e, t) => {
|
|
424
424
|
if (!d)
|
|
425
425
|
return;
|
|
426
|
-
const r = q(e, t, g), s =
|
|
426
|
+
const r = q(e, t, g), s = O.includes(r), l = d.type === "radio" ? s ? [] : [r] : s ? O.filter((a) => a !== r) : [...O, r];
|
|
427
427
|
at(l, d, e);
|
|
428
428
|
}, nt = V.filter(
|
|
429
429
|
({ record: e }) => {
|
|
@@ -432,11 +432,11 @@ function Dr({
|
|
|
432
432
|
}
|
|
433
433
|
), se = nt.map(
|
|
434
434
|
({ record: e, index: t }) => q(e, t, g)
|
|
435
|
-
), Se = se.length > 0 && se.every((e) =>
|
|
435
|
+
), Se = se.length > 0 && se.every((e) => O.includes(e)), Jt = () => {
|
|
436
436
|
var r;
|
|
437
437
|
if (!d || d.type === "radio")
|
|
438
438
|
return;
|
|
439
|
-
const e = new Set(se), t = Se ?
|
|
439
|
+
const e = new Set(se), t = Se ? O.filter((s) => !e.has(s)) : Array.from(/* @__PURE__ */ new Set([...O, ...se]));
|
|
440
440
|
at(t, d), new Set(t), (r = d.onSelectAll) == null || r.call(
|
|
441
441
|
d,
|
|
442
442
|
!Se,
|
|
@@ -450,7 +450,7 @@ function Dr({
|
|
|
450
450
|
if (!n || e === W)
|
|
451
451
|
return;
|
|
452
452
|
const t = 1;
|
|
453
|
-
|
|
453
|
+
Oe.current = !0, n.pageSize === void 0 && Bt(e), n.current === void 0 && be(t), (r = n.onShowSizeChange) == null || r.call(n, t, e), (s = n.onChange) == null || s.call(n, t, e), _e("paginate", P, K, t, e);
|
|
454
454
|
}, st = y.length + (d ? 1 : 0), le = (d == null ? void 0 : d.columnWidth) ?? 48, lt = (e) => typeof e.width == "number" ? e.width : 0, dt = (e, t) => {
|
|
455
455
|
const r = e.fixed === !0 ? "left" : e.fixed;
|
|
456
456
|
return r === "left" ? { position: "sticky", left: y.slice(0, t).reduce((l, a) => l + lt(a), d && typeof le == "number" ? le : 0), zIndex: 2 } : r === "right" ? { position: "sticky", right: y.slice(t + 1).reduce((l, a) => l + lt(a), 0), zIndex: 2 } : {};
|
|
@@ -527,7 +527,7 @@ function Dr({
|
|
|
527
527
|
{
|
|
528
528
|
...(G = i.onHeaderCell) == null ? void 0 : G.call(i, r, a),
|
|
529
529
|
"aria-label": typeof i.title == "string" ? i.title : void 0,
|
|
530
|
-
"aria-sort": u ? P.get(
|
|
530
|
+
"aria-sort": u ? P.get(B(i, o)) === "ascend" ? "ascending" : P.get(B(i, o)) === "descend" ? "descending" : "none" : void 0,
|
|
531
531
|
className: L(
|
|
532
532
|
"bj-table__header-cell",
|
|
533
533
|
((T = y[o + 1]) == null ? void 0 : T.fixed) === "right" && "bj-table__cell--before-fixed-right",
|
|
@@ -538,7 +538,7 @@ function Dr({
|
|
|
538
538
|
te(i) && !te(y[o - 1]) && "bj-table__cell--fixed-right-first",
|
|
539
539
|
i.sorter && "bj-table__header-cell--sortable",
|
|
540
540
|
p && "bj-table__header-cell--filterable",
|
|
541
|
-
P.get(
|
|
541
|
+
P.get(B(i, o)) && "bj-table__header-cell--sorted",
|
|
542
542
|
i.className
|
|
543
543
|
),
|
|
544
544
|
colSpan: s,
|
|
@@ -562,7 +562,7 @@ function Dr({
|
|
|
562
562
|
] }, t)) }),
|
|
563
563
|
/* @__PURE__ */ b(tr, { className: "bj-table__body", children: V.length > 0 ? V.map(({ record: e, index: t }) => {
|
|
564
564
|
var _;
|
|
565
|
-
const r = q(e, t, g), s = ne(e, t), l = ((_ = d == null ? void 0 : d.getCheckboxProps) == null ? void 0 : _.call(d, e).disabled) ?? !1, a =
|
|
565
|
+
const r = q(e, t, g), s = ne(e, t), l = ((_ = d == null ? void 0 : d.getCheckboxProps) == null ? void 0 : _.call(d, e).disabled) ?? !1, a = O.includes(r), i = typeof ge == "function" ? ge(e, t, 0) : ge;
|
|
566
566
|
return /* @__PURE__ */ Me(
|
|
567
567
|
ct,
|
|
568
568
|
{
|
|
@@ -665,15 +665,15 @@ function Dr({
|
|
|
665
665
|
sr,
|
|
666
666
|
{
|
|
667
667
|
align: "end",
|
|
668
|
-
disabled: ye || n.disabled,
|
|
668
|
+
disabled: !!ye || n.disabled,
|
|
669
669
|
current: H,
|
|
670
670
|
defaultCurrent: n.defaultCurrent,
|
|
671
671
|
defaultPageSize: n.defaultPageSize,
|
|
672
672
|
dropdownClassName: n.dropdownClassName,
|
|
673
673
|
hideOnSinglePage: n.hideOnSinglePage,
|
|
674
674
|
onChange: (e) => {
|
|
675
|
-
if (
|
|
676
|
-
|
|
675
|
+
if (Oe.current) {
|
|
676
|
+
Oe.current = !1;
|
|
677
677
|
return;
|
|
678
678
|
}
|
|
679
679
|
Qt(e);
|
package/dist/web.d.ts
CHANGED
|
@@ -5,13 +5,14 @@ import { FocusEventHandler } from 'react';
|
|
|
5
5
|
import { ForwardRefExoticComponent } from 'react';
|
|
6
6
|
import { HTMLAttributes } from 'react';
|
|
7
7
|
import { InputHTMLAttributes } from 'react';
|
|
8
|
-
import { JSX } from 'react';
|
|
8
|
+
import { JSX as JSX_2 } from 'react';
|
|
9
9
|
import { Key } from 'react';
|
|
10
10
|
import { KeyboardEvent as KeyboardEvent_2 } from 'react';
|
|
11
11
|
import { KeyboardEventHandler } from 'react';
|
|
12
12
|
import { MouseEventHandler } from 'react';
|
|
13
13
|
import { ReactElement } from 'react';
|
|
14
14
|
import { ReactNode } from 'react';
|
|
15
|
+
import { ReactPortal } from 'react';
|
|
15
16
|
import { Ref } from 'react';
|
|
16
17
|
import { RefAttributes } from 'react';
|
|
17
18
|
import { RefObject } from 'react';
|
|
@@ -47,6 +48,7 @@ export declare interface BCheckBoxGroupProps {
|
|
|
47
48
|
children?: ReactNode;
|
|
48
49
|
direction?: 'ltr' | 'rtl';
|
|
49
50
|
variant?: BCheckBoxVariant;
|
|
51
|
+
shape?: BCheckBoxShape;
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
export declare interface BCheckBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'checked' | 'children' | 'defaultChecked' | 'onChange' | 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'style' | 'type' | 'value'> {
|
|
@@ -70,11 +72,15 @@ export declare interface BCheckBoxProps extends Omit<InputHTMLAttributes<HTMLInp
|
|
|
70
72
|
skipGroup?: boolean;
|
|
71
73
|
direction?: 'ltr' | 'rtl';
|
|
72
74
|
variant?: BCheckBoxVariant;
|
|
75
|
+
shape?: BCheckBoxShape;
|
|
73
76
|
}
|
|
74
77
|
|
|
78
|
+
/** 勾选框形状:方框(默认)或圆形 */
|
|
79
|
+
export declare type BCheckBoxShape = 'square' | 'circle';
|
|
80
|
+
|
|
75
81
|
export declare type BCheckBoxVariant = 'dark' | 'white';
|
|
76
82
|
|
|
77
|
-
export declare function BDropdown({ className, style, options, value, defaultValue, multiple, optionMode, searchable, searchValue, searchPlaceholder, onSearch, filterOption, emptyText, labels, t, optionRender, onChange, footer, showReset, showConfirm, resetText, confirmText, onReset, onConfirm, }: BDropdownProps):
|
|
83
|
+
export declare function BDropdown({ className, style, options, value, defaultValue, multiple, optionMode, searchable, searchValue, searchPlaceholder, onSearch, filterOption, emptyText, labels, t, optionRender, onChange, footer, showReset, showConfirm, resetText, confirmText, onReset, onConfirm, }: BDropdownProps): JSX_2.Element;
|
|
78
84
|
|
|
79
85
|
export declare interface BDropdownOption {
|
|
80
86
|
label: ReactNode;
|
|
@@ -221,7 +227,59 @@ export declare type BInputSize = 'small' | 'middle' | 'large';
|
|
|
221
227
|
|
|
222
228
|
export declare type BInputStatus = 'error' | 'warning';
|
|
223
229
|
|
|
224
|
-
export declare function
|
|
230
|
+
export declare function BMobileDrawer({ visible, defaultVisible, title, options, value, defaultValue, onChange, onOK, onCancel, onClose, footer, t, okText, cancelText, emptyText, closable, maskClosable, maxHeight, zIndex, className, style, getContainer, }: BMobileDrawerProps): ReactPortal | null;
|
|
231
|
+
|
|
232
|
+
export declare interface BMobileDrawerOption {
|
|
233
|
+
/** 选项文案,单行展示,超出宽度时省略 */
|
|
234
|
+
label: ReactNode;
|
|
235
|
+
value: BMobileDrawerValue;
|
|
236
|
+
disabled?: boolean;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export declare interface BMobileDrawerProps {
|
|
240
|
+
/** 受控显隐;不传时由组件内部维护(defaultVisible) */
|
|
241
|
+
visible?: boolean;
|
|
242
|
+
defaultVisible?: boolean;
|
|
243
|
+
/** 标题,由父组件控制,例如「请选择材质」 */
|
|
244
|
+
title?: ReactNode;
|
|
245
|
+
/** 选项列表,左侧固定使用圆形 BCheckBox 多选 */
|
|
246
|
+
options: BMobileDrawerOption[];
|
|
247
|
+
/** 受控选中值 */
|
|
248
|
+
value?: BMobileDrawerValue[];
|
|
249
|
+
/** 非受控默认选中值 */
|
|
250
|
+
defaultValue?: BMobileDrawerValue[];
|
|
251
|
+
/** 勾选变化(草稿态),点击确定后才由父组件落地 */
|
|
252
|
+
onChange?: (value: BMobileDrawerValue[], option: BMobileDrawerOption) => void;
|
|
253
|
+
/** 点击确定,回传当前草稿值;关闭动作由父组件决定 */
|
|
254
|
+
onOK?: (value: BMobileDrawerValue[]) => void;
|
|
255
|
+
/** 点击取消 */
|
|
256
|
+
onCancel?: () => void;
|
|
257
|
+
/** 点击关闭图标或遮罩 */
|
|
258
|
+
onClose?: () => void;
|
|
259
|
+
/** 自定义底栏;传 false 时不渲染底栏 */
|
|
260
|
+
footer?: ReactNode | false;
|
|
261
|
+
okText?: string;
|
|
262
|
+
cancelText?: string;
|
|
263
|
+
/** 选项为空时的占位文案 */
|
|
264
|
+
emptyText?: ReactNode;
|
|
265
|
+
/** 国际化函数,用于关闭按钮 aria-label 与默认文案 */
|
|
266
|
+
t?: (text: string) => string;
|
|
267
|
+
/** 是否显示右上角关闭图标 */
|
|
268
|
+
closable?: boolean;
|
|
269
|
+
/** 点击遮罩是否关闭 */
|
|
270
|
+
maskClosable?: boolean;
|
|
271
|
+
/** 浮层高度上限,默认 86.21vh(设计稿 700 / 812) */
|
|
272
|
+
maxHeight?: number | string;
|
|
273
|
+
zIndex?: number;
|
|
274
|
+
className?: string;
|
|
275
|
+
style?: CSSProperties;
|
|
276
|
+
/** 挂载容器,默认 document.body */
|
|
277
|
+
getContainer?: () => HTMLElement;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export declare type BMobileDrawerValue = string | number;
|
|
281
|
+
|
|
282
|
+
export declare function BOverlayScrollbar({ containerRef, targetRef, selector, direction, size, gap, background, showOnHover, showOnScroll, hoverSelector, horizontalInsetStart, horizontalInsetEnd, horizontalThumbLength, className, }: BOverlayScrollbarProps): JSX_2.Element;
|
|
225
283
|
|
|
226
284
|
export declare interface BOverlayScrollbarProps {
|
|
227
285
|
containerRef: RefObject<HTMLElement | null>;
|
|
@@ -240,6 +298,63 @@ export declare interface BOverlayScrollbarProps {
|
|
|
240
298
|
className?: string;
|
|
241
299
|
}
|
|
242
300
|
|
|
301
|
+
export declare const BRadio: typeof BRadio_2 & {
|
|
302
|
+
Group: typeof Group_2;
|
|
303
|
+
Button: typeof Button;
|
|
304
|
+
__ANT_RADIO: boolean;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
declare const BRadio_2: ForwardRefExoticComponent<BRadioProps & RefAttributes<HTMLInputElement>>;
|
|
308
|
+
|
|
309
|
+
export declare interface BRadioGroupProps {
|
|
310
|
+
className?: string;
|
|
311
|
+
style?: CSSProperties;
|
|
312
|
+
id?: string;
|
|
313
|
+
name?: string;
|
|
314
|
+
options?: Array<RadioOptionType | string | number>;
|
|
315
|
+
disabled?: boolean;
|
|
316
|
+
defaultValue?: RadioValueType;
|
|
317
|
+
value?: RadioValueType;
|
|
318
|
+
onChange?: (event: RadioChangeEvent) => void;
|
|
319
|
+
children?: ReactNode;
|
|
320
|
+
direction?: 'ltr' | 'rtl';
|
|
321
|
+
variant?: BRadioVariant;
|
|
322
|
+
/** 组内单选的呈现形态,缺省时回落到子项的 `BRadio.Button` 声明 */
|
|
323
|
+
optionType?: RadioGroupOptionType;
|
|
324
|
+
buttonStyle?: RadioGroupButtonStyle;
|
|
325
|
+
/** 仅作用于 `optionType="button"` 的按钮高度 */
|
|
326
|
+
size?: BRadioSize;
|
|
327
|
+
onMouseEnter?: MouseEventHandler<HTMLDivElement>;
|
|
328
|
+
onMouseLeave?: MouseEventHandler<HTMLDivElement>;
|
|
329
|
+
onFocus?: FocusEventHandler<HTMLDivElement>;
|
|
330
|
+
onBlur?: FocusEventHandler<HTMLDivElement>;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export declare interface BRadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'checked' | 'children' | 'defaultChecked' | 'onChange' | 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'size' | 'style' | 'type' | 'value'> {
|
|
334
|
+
className?: string;
|
|
335
|
+
style?: CSSProperties;
|
|
336
|
+
checked?: boolean;
|
|
337
|
+
defaultChecked?: boolean;
|
|
338
|
+
disabled?: boolean;
|
|
339
|
+
onChange?: (event: RadioChangeEvent) => void;
|
|
340
|
+
onClick?: MouseEventHandler<HTMLInputElement>;
|
|
341
|
+
onMouseEnter?: MouseEventHandler<HTMLLabelElement>;
|
|
342
|
+
onMouseLeave?: MouseEventHandler<HTMLLabelElement>;
|
|
343
|
+
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
344
|
+
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
345
|
+
onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
|
|
346
|
+
onKeyPress?: KeyboardEventHandler<HTMLInputElement>;
|
|
347
|
+
onKeyUp?: KeyboardEventHandler<HTMLInputElement>;
|
|
348
|
+
value?: RadioValueType;
|
|
349
|
+
children?: ReactNode;
|
|
350
|
+
direction?: 'ltr' | 'rtl';
|
|
351
|
+
variant?: BRadioVariant;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export declare type BRadioSize = 'large' | 'middle' | 'small';
|
|
355
|
+
|
|
356
|
+
export declare type BRadioVariant = 'dark' | 'white' | 'primary';
|
|
357
|
+
|
|
243
358
|
export declare type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
244
359
|
|
|
245
360
|
export declare const BTable: typeof BTable_2 & {
|
|
@@ -247,9 +362,9 @@ export declare const BTable: typeof BTable_2 & {
|
|
|
247
362
|
ColumnGroup: typeof ColumnGroup;
|
|
248
363
|
};
|
|
249
364
|
|
|
250
|
-
declare function BTable_2<RecordType extends object>({ columns, dataSource, rowKey, preserveSelectedRowKeys, rowSelection, pagination, loading, bordered, size, showHeader, emptyText, emptyImage, emptyHeight, t, className, style, rowClassName, sortDirections, onChange, children, title, footer, summary, tableLayout, components, onRow, onHeaderRow, id, scroll, locale, groupCollapse, }: TableProps<RecordType>):
|
|
365
|
+
declare function BTable_2<RecordType extends object>({ columns, dataSource, rowKey, preserveSelectedRowKeys, rowSelection, pagination, loading, bordered, size, showHeader, emptyText, emptyImage, emptyHeight, t, className, style, rowClassName, sortDirections, onChange, children, title, footer, summary, tableLayout, components, onRow, onHeaderRow, id, scroll, locale, groupCollapse, }: TableProps<RecordType>): JSX_2.Element;
|
|
251
366
|
|
|
252
|
-
export declare function BTabs({ activeKey, children, centered, className, defaultActiveKey, id, items, onChange, onTabClick, style, tabBarGutter, tabBarStyle, tabPosition, type, }: BTabsProps):
|
|
367
|
+
export declare function BTabs({ activeKey, children, centered, className, defaultActiveKey, id, items, onChange, onTabClick, style, tabBarGutter, tabBarStyle, tabPosition, type, }: BTabsProps): JSX_2.Element;
|
|
253
368
|
|
|
254
369
|
export declare namespace BTabs {
|
|
255
370
|
var TabPane: TabPane;
|
|
@@ -291,11 +406,11 @@ export declare interface BTabsTabPaneProps extends Omit<BTabsItem, 'key' | 'labe
|
|
|
291
406
|
|
|
292
407
|
export declare type BTabsType = 'line' | 'card';
|
|
293
408
|
|
|
294
|
-
declare function BTooltip({ children, placement, content, variant, className, style, getPopupContainer, getAnchorElement, color, fontColor, autoAdjustOverflow, }: ContentTooltipProps):
|
|
409
|
+
declare function BTooltip({ children, placement, content, variant, className, style, getPopupContainer, getAnchorElement, color, fontColor, autoAdjustOverflow, }: ContentTooltipProps): JSX_2.Element;
|
|
295
410
|
export { BTooltip }
|
|
296
411
|
export { BTooltip as ContentTooltip }
|
|
297
412
|
|
|
298
|
-
export declare function BuCategoryDropdown({ data, value, onChange, placeholder, disabled, maxVisible, className, style, getPopupContainer, dropdownStyle: customDropdownStyle, }: BuCategoryDropdownProps):
|
|
413
|
+
export declare function BuCategoryDropdown({ data, value, onChange, placeholder, disabled, maxVisible, className, style, getPopupContainer, dropdownStyle: customDropdownStyle, }: BuCategoryDropdownProps): JSX_2.Element;
|
|
299
414
|
|
|
300
415
|
export declare interface BuCategoryDropdownProps {
|
|
301
416
|
/** 分类树数据 */
|
|
@@ -351,7 +466,7 @@ export declare interface BuEmptyInputBoxProps {
|
|
|
351
466
|
}
|
|
352
467
|
|
|
353
468
|
export declare const BuIcon: {
|
|
354
|
-
({ type, style, onClick, className, ...rest }: BuIconProps):
|
|
469
|
+
({ type, style, onClick, className, ...rest }: BuIconProps): JSX_2.Element;
|
|
355
470
|
displayName: string;
|
|
356
471
|
};
|
|
357
472
|
|
|
@@ -426,7 +541,7 @@ export declare interface BuInputProps {
|
|
|
426
541
|
|
|
427
542
|
export declare type BuInputType = 'input' | 'textarea' | 'number';
|
|
428
543
|
|
|
429
|
-
export declare function BuModal({ open, title, mode, children, okText, cancelText, onOk, onCancel, onClose, activeLang, onLangChange, labels, hint, confirmLoading, width, className, style, }: BuModalProps):
|
|
544
|
+
export declare function BuModal({ open, title, mode, children, okText, cancelText, onOk, onCancel, onClose, activeLang, onLangChange, labels, hint, confirmLoading, width, className, style, }: BuModalProps): JSX_2.Element | null;
|
|
430
545
|
|
|
431
546
|
export declare interface BuModalProps {
|
|
432
547
|
/** 是否显示弹窗 */
|
|
@@ -468,7 +583,7 @@ export declare interface BuModalProps {
|
|
|
468
583
|
style?: CSSProperties;
|
|
469
584
|
}
|
|
470
585
|
|
|
471
|
-
export declare function BuProductField({ options, value, onChange, placeholder, emptyText, onManageField, multiple, showSearch, showSort, addButtonText, onAdd, labels, className, style, getPopupContainer, }: BuProductFieldProps):
|
|
586
|
+
export declare function BuProductField({ options, value, onChange, placeholder, emptyText, onManageField, multiple, showSearch, showSort, addButtonText, onAdd, labels, className, style, getPopupContainer, }: BuProductFieldProps): JSX_2.Element;
|
|
472
587
|
|
|
473
588
|
export declare interface BuProductFieldProps {
|
|
474
589
|
/** 可选项列表 */
|
|
@@ -511,7 +626,7 @@ export declare interface BuProductFieldProps {
|
|
|
511
626
|
}
|
|
512
627
|
|
|
513
628
|
export declare const BuSwitch: {
|
|
514
|
-
({ checked: controlledChecked, defaultChecked, onChange, disabled, loading, checkedChildren, unCheckedChildren, theme, activeColor, inactiveColor, className, style, }: BuSwitchProps):
|
|
629
|
+
({ checked: controlledChecked, defaultChecked, onChange, disabled, loading, checkedChildren, unCheckedChildren, theme, activeColor, inactiveColor, className, style, }: BuSwitchProps): JSX_2.Element;
|
|
515
630
|
displayName: string;
|
|
516
631
|
};
|
|
517
632
|
|
|
@@ -545,6 +660,8 @@ export declare interface BuSwitchProps {
|
|
|
545
660
|
/** 开关颜色主题 */
|
|
546
661
|
export declare type BuSwitchTheme = 'light' | 'dark';
|
|
547
662
|
|
|
663
|
+
declare const Button: ForwardRefExoticComponent<BRadioProps & RefAttributes<HTMLInputElement>>;
|
|
664
|
+
|
|
548
665
|
export declare interface CategoryItem {
|
|
549
666
|
/** 唯一标识 */
|
|
550
667
|
value: string;
|
|
@@ -685,7 +802,7 @@ export declare interface ColumnType<RecordType> extends ColumnSharedType<RecordT
|
|
|
685
802
|
|
|
686
803
|
export declare type CompareFn<RecordType> = (first: RecordType, second: RecordType, sortOrder?: SortOrder) => number;
|
|
687
804
|
|
|
688
|
-
export declare function ConfirmTooltip({ placement, title, okText, cancelText, onOk, onCancel, className, style, }: ConfirmTooltipProps):
|
|
805
|
+
export declare function ConfirmTooltip({ placement, title, okText, cancelText, onOk, onCancel, className, style, }: ConfirmTooltipProps): JSX_2.Element;
|
|
689
806
|
|
|
690
807
|
export declare interface ConfirmTooltipProps extends BaseTooltipProps {
|
|
691
808
|
title?: string;
|
|
@@ -735,7 +852,7 @@ export declare interface ExpandableConfig<RecordType> {
|
|
|
735
852
|
fixed?: FixedType;
|
|
736
853
|
}
|
|
737
854
|
|
|
738
|
-
export declare function FileCard(props: FileCardProps):
|
|
855
|
+
export declare function FileCard(props: FileCardProps): JSX_2.Element;
|
|
739
856
|
|
|
740
857
|
export declare interface FileCardProps {
|
|
741
858
|
/** 文件名 */
|
|
@@ -788,6 +905,8 @@ export declare type GetRowKey<RecordType> = (record: RecordType, index?: number)
|
|
|
788
905
|
|
|
789
906
|
declare const Group: ForwardRefExoticComponent<BCheckBoxGroupProps & RefAttributes<HTMLDivElement>>;
|
|
790
907
|
|
|
908
|
+
declare const Group_2: ForwardRefExoticComponent<BRadioGroupProps & RefAttributes<HTMLDivElement>>;
|
|
909
|
+
|
|
791
910
|
export declare interface GroupCollapseConfig<RecordType> {
|
|
792
911
|
/** Identify group header records. Defaults to `record.isGroup`. */
|
|
793
912
|
isGroupRow?: (record: RecordType, index: number) => boolean;
|
|
@@ -813,7 +932,7 @@ export declare type ModalMode = 'standard' | 'bilingual' | 'single';
|
|
|
813
932
|
|
|
814
933
|
export declare type OverlayScrollbarDirection = 'vertical' | 'horizontal' | 'both';
|
|
815
934
|
|
|
816
|
-
export declare const Pagination: (props: PaginationProps) =>
|
|
935
|
+
export declare const Pagination: (props: PaginationProps) => JSX_2.Element | null;
|
|
817
936
|
|
|
818
937
|
export declare type PaginationAlign = 'start' | 'center' | 'end';
|
|
819
938
|
|
|
@@ -878,6 +997,32 @@ export declare interface ProgressTooltipProps extends BaseTooltipProps {
|
|
|
878
997
|
progress?: number;
|
|
879
998
|
}
|
|
880
999
|
|
|
1000
|
+
export declare interface RadioChangeEvent {
|
|
1001
|
+
target: RadioChangeEventTarget;
|
|
1002
|
+
stopPropagation: () => void;
|
|
1003
|
+
preventDefault: () => void;
|
|
1004
|
+
nativeEvent: Event;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
export declare interface RadioChangeEventTarget extends BRadioProps {
|
|
1008
|
+
checked: boolean;
|
|
1009
|
+
value: RadioValueType;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
export declare type RadioGroupButtonStyle = 'outline' | 'solid';
|
|
1013
|
+
|
|
1014
|
+
export declare type RadioGroupOptionType = 'default' | 'button';
|
|
1015
|
+
|
|
1016
|
+
export declare interface RadioOptionType {
|
|
1017
|
+
label: ReactNode;
|
|
1018
|
+
value: RadioValueType;
|
|
1019
|
+
style?: CSSProperties;
|
|
1020
|
+
disabled?: boolean;
|
|
1021
|
+
onChange?: (event: RadioChangeEvent) => void;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
export declare type RadioValueType = string | number | boolean;
|
|
1025
|
+
|
|
881
1026
|
export declare interface RenderedCell<RecordType> {
|
|
882
1027
|
children?: ReactNode;
|
|
883
1028
|
props?: CellType<RecordType>;
|
|
@@ -887,7 +1032,7 @@ declare type RowClassName<RecordType> = (record: RecordType, index: number, inde
|
|
|
887
1032
|
|
|
888
1033
|
declare type RowSelectMethod = 'all' | 'none' | 'invert' | 'single' | 'multiple';
|
|
889
1034
|
|
|
890
|
-
export declare function SkuInputCard({ id, name, onNameChange, mode, activeLang, onLangChange, showBody, error, onDelete, onPreviewImage, onDeleteImage, onUpload, onAssociate, images, labels, inputEvents, className, style, options, optionFilterProp, onSelect, onSearch, open: controlledOpen, onDropdownVisibleChange, }: SkuInputCardProps):
|
|
1035
|
+
export declare function SkuInputCard({ id, name, onNameChange, mode, activeLang, onLangChange, showBody, error, onDelete, onPreviewImage, onDeleteImage, onUpload, onAssociate, images, labels, inputEvents, className, style, options, optionFilterProp, onSelect, onSearch, open: controlledOpen, onDropdownVisibleChange, }: SkuInputCardProps): JSX_2.Element;
|
|
891
1036
|
|
|
892
1037
|
export declare interface SkuInputCardProps {
|
|
893
1038
|
/** Drag handle id, for external DnD libraries */
|
package/dist/web.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./web/Icon/Icon.js"),o=require("./web/Tooltip/ConfirmTooltip.js"),t=require("./web/Tooltip/ProgressTooltip.js"),r=require("./web/Tooltip/ContentTooltip.js"),n=require("./web/Tooltip/TooltipWrapper.js"),u=require("./web/SkuInputCard/SkuInputCard.js"),i=require("./web/Input/Input.js"),c=require("./web/BasicInput/BInput.js"),a=require("./web/Tabs/BTabs.js"),l=require("./web/Tabs/TabPane.js"),s=require("./web/EmptyInputBox/EmptyInputBox.js"),p=require("./web/Modal/Modal.js"),B=require("./web/ProductField/ProductField.js"),q=require("./web/CategoryDropdown/CategoryDropdown.js"),d=require("./web/Pagination/Pagination.js"),T=require("./web/FileCard/FileCard.js"),b=require("./web/Switch/Switch.js"),C=require("./web/InputNumber/BInputNumber.js"),I=require("./web/Table/BTable.js"),m=require("./web/Table/Column.js"),w=require("./web/Table/ColumnGroup.js"),P=require("./web/CheckBox/index.js"),g=require("./web/OverlayScrollbar/BOverlayScrollbar.js"),y=require("./web/Dropdown/BDropdown.js"),D=require("./web/MobileDrawer/BMobileDrawer.js"),S=require("./web/Radio/index.js");exports.BuIcon=e;exports.ConfirmTooltip=o;exports.ProgressTooltip=t;exports.BTooltip=r;exports.ContentTooltip=r;exports.TooltipWrapper=n;exports.SkuInputCard=u;exports.BuInput=i;exports.BInput=c;exports.BTabs=a.default;exports.TabPane=l.TabPane;exports.BuEmptyInputBox=s;exports.BuModal=p;exports.BuProductField=B;exports.BuCategoryDropdown=q;exports.Pagination=d;exports.FileCard=T;exports.BuSwitch=b;exports.BInputNumber=C;exports.BTable=I.BTable;exports.Column=m;exports.ColumnGroup=w;exports.BCheckBox=P.BCheckBox;exports.BOverlayScrollbar=g;exports.BDropdown=y.BDropdown;exports.BMobileDrawer=D.BMobileDrawer;exports.BRadio=S.BRadio;
|