@zjpcy/simple-design 1.2.2 → 1.2.10

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.
Files changed (58) hide show
  1. package/dist/cjs/index.css +1 -1
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/es/Button/Button.js +1 -1
  4. package/dist/es/Checkbox/index.js +1 -0
  5. package/dist/es/Drawer/index.js +1 -0
  6. package/dist/es/Grid/index.js +1 -0
  7. package/dist/es/Grid/styles.js +1 -0
  8. package/dist/es/Hooks/useClickOutside.js +1 -0
  9. package/dist/es/Input/InputBase.js +1 -1
  10. package/dist/es/Input/Password.js +1 -0
  11. package/dist/es/Input/Textarea.js +1 -0
  12. package/dist/es/Input/index.js +1 -1
  13. package/dist/es/Layout/LayoutContext.js +1 -0
  14. package/dist/es/Layout/index.js +1 -0
  15. package/dist/es/Layout/styles.js +1 -0
  16. package/dist/es/Menu/index.js +1 -1
  17. package/dist/es/Popconfirm/index.js +1 -0
  18. package/dist/es/Progress/index.js +1 -0
  19. package/dist/es/Table/SortableRow.js +1 -0
  20. package/dist/es/Table/index.js +1 -1
  21. package/dist/es/Tag/index.js +1 -0
  22. package/dist/es/index.css +1 -1
  23. package/dist/es/index.js +1 -1
  24. package/dist/types/components/Button/Button.d.ts +3 -2
  25. package/dist/types/components/Drawer/index.d.ts +6 -0
  26. package/dist/types/components/Drawer/styles.d.ts +0 -0
  27. package/dist/types/components/Drawer/types.d.ts +71 -0
  28. package/dist/types/components/Grid/index.d.ts +14 -0
  29. package/dist/types/components/Grid/styles.d.ts +22 -0
  30. package/dist/types/components/Grid/types.d.ts +49 -0
  31. package/dist/types/components/Input/AutoComplete.d.ts +0 -0
  32. package/dist/types/components/Input/InputBase.d.ts +2 -0
  33. package/dist/types/components/Input/Password.d.ts +11 -0
  34. package/dist/types/components/Input/Textarea.d.ts +51 -0
  35. package/dist/types/components/Input/index.d.ts +6 -2
  36. package/dist/types/components/Layout/LayoutContext.d.ts +15 -0
  37. package/dist/types/components/Layout/index.d.ts +86 -0
  38. package/dist/types/components/Layout/styles.d.ts +40 -0
  39. package/dist/types/components/Layout/types.d.ts +112 -0
  40. package/dist/types/components/Menu/index.d.ts +8 -1
  41. package/dist/types/components/Menu/styles.d.ts +7 -0
  42. package/dist/types/components/Menu/types.d.ts +56 -7
  43. package/dist/types/components/Popconfirm/index.d.ts +6 -0
  44. package/dist/types/components/Popconfirm/styles.d.ts +0 -0
  45. package/dist/types/components/Popconfirm/types.d.ts +28 -0
  46. package/dist/types/components/Progress/index.d.ts +6 -0
  47. package/dist/types/components/Progress/styles.d.ts +0 -0
  48. package/dist/types/components/Progress/types.d.ts +38 -0
  49. package/dist/types/components/Table/SortableRow.d.ts +26 -0
  50. package/dist/types/components/Table/index.d.ts +5 -1
  51. package/dist/types/components/Tag/index.d.ts +6 -0
  52. package/dist/types/components/Tag/styles.d.ts +52 -0
  53. package/dist/types/components/Tag/types.d.ts +46 -0
  54. package/dist/types/components/index.d.ts +12 -2
  55. package/package.json +1 -1
  56. package/dist/es/Navigation/index.js +0 -1
  57. package/dist/types/components/Navigation/index.d.ts +0 -5
  58. package/dist/types/components/Navigation/types.d.ts +0 -43
@@ -1 +1 @@
1
- import{jsxs as i,jsx as t}from"react/jsx-runtime";import n from"react";import e from"classnames";import a from"../Icon/Icon.js";var r=n.forwardRef(function(n,r){var o=n.children,l=n.variant,d=void 0===l?"primary":l,s=n.size,p=void 0===s?"medium":s,c=n.disabled,m=void 0!==c&&c,y=n.loading,f=void 0!==y&&y,g=n.onClick,u=n.className,b=n.style,v=n.icon,h=n.type,x=void 0===h?"button":h,R=e("idp-btn","idp-btn--".concat(d),"idp-btn--".concat(p),{"idp-btn--disabled":m||f},u);return i("button",{ref:r,type:x,className:R,onClick:function(){!m&&g&&g()},disabled:m,style:b,children:[f?t(a,{type:"loading",style:{marginRight:o?"2px":0}}):v?"string"==typeof v?t(a,{type:v,style:{marginRight:o?"2px":0}}):t("span",{style:{marginRight:o?"8px":0,display:"inline-flex",alignItems:"center"},children:v}):null,o]})});r.displayName="Button";var o=r;export{o as default};
1
+ import{__rest as i,__assign as e}from"../node_modules/tslib/tslib.es6.js";import{jsxs as n,jsx as t}from"react/jsx-runtime";import l from"react";import a from"classnames";import r from"../Icon/Icon.js";var o=l.forwardRef(function(l,o){var s=l.children,d=l.variant,c=void 0===d?"secondary":d,m=l.size,p=void 0===m?"medium":m,f=l.disabled,y=void 0!==f&&f,u=l.loading,b=void 0!==u&&u,v=l.onClick,g=l.className,h=l.style,x=l.icon,k=l.type,N=void 0===k?"button":k,C=l.href,R=i(l,["children","variant","size","disabled","loading","onClick","className","style","icon","type","href"]),j=a("idp-btn","idp-btn--".concat(c),"idp-btn--".concat(p),{"idp-btn--disabled":y||b},g),I=function(i){y||b?null==i||i.preventDefault():v&&v()},z=function(){return b?t(r,{type:"loading",style:{marginRight:s?"2px":0}}):x?"string"==typeof x?t(r,{type:x,style:{marginRight:s?"2px":0}}):t("span",{style:{marginRight:s?"8px":0,display:"inline-flex",alignItems:"center"},children:x}):null};return"link"===c&&C?n("a",e({ref:o,href:y?void 0:C,className:j,onClick:I,style:h},R,{children:[z(),s]})):n("button",e({ref:o,type:N,className:j,onClick:I,disabled:y,style:h},R,{children:[z(),s]}))});o.displayName="Button";var s=o;export{s as default};
@@ -0,0 +1 @@
1
+ import{__assign as e,__spreadArray as a}from"../node_modules/tslib/tslib.es6.js";import{jsx as l,jsxs as i}from"react/jsx-runtime";import{createContext as d,useContext as c,useState as n,useEffect as o}from"react";import r from"classnames";var t=d(void 0),s=function(d){var s,u=d.value,v=d.checked,p=d.defaultChecked,h=void 0!==p&&p,b=d.onChange,m=d.disabled,f=void 0!==m&&m,x=d.indeterminate,k=void 0!==x&&x,y=d.children,g=d.className,N=d.style,C=d.label,_=d.labelGap,G=void 0===_?8:_,j=d.labelClassName,z=void 0===j?"":j,I=d.labelStyle,w=c(t),P=!!w,R=n(h),S=R[0],V=R[1],q=P?null===(s=w.value)||void 0===s?void 0:s.includes(u):void 0!==v?v:S;o(function(){P||void 0===v||V(v)},[v,P]);var A=r("idp-checkbox",{"idp-checkbox--checked":q,"idp-checkbox--disabled":f||P&&w.disabled,"idp-checkbox--indeterminate":k},g);return l("label",{className:A,style:N,children:i("div",{className:"idp-checkbox-wrapper",style:{display:"flex",alignItems:"center"},children:[C&&l("div",{className:"idp-checkbox-label ".concat(z),style:e({marginRight:"number"==typeof G?"".concat(G,"px"):G},I),children:C}),i("div",{style:{display:"flex",alignItems:"center"},children:[l("input",{type:"checkbox",className:"idp-checkbox__input",checked:q,onChange:function(e){var l,i=e.target.checked;if(!(f||P&&w.disabled))if(P){var d=w.value||[],c=void 0;c=i?a(a([],d,!0),[u],!1):d.filter(function(e){return e!==u}),null===(l=w.onChange)||void 0===l||l.call(w,c)}else V(i),null==b||b(i,u)},disabled:f||P&&w.disabled,value:u,ref:function(e){e&&(e.indeterminate=k)}}),l("span",{className:"idp-checkbox__inner"}),y&&l("span",{className:"idp-checkbox__label",children:y})]})]})})};s.Group=function(a){var i=a.value,d=a.defaultValue,c=void 0===d?[]:d,u=a.onChange,v=a.disabled,p=void 0!==v&&v,h=a.options,b=a.children,m=a.className,f=a.style,x=a.layout,k=void 0===x?"vertical":x,y=a.gap,g=void 0===y?8:y,N=n(c||[]),C=N[0],_=N[1];o(function(){void 0!==i&&_(i)},[i]);var G=r("idp-checkbox-group",{"idp-checkbox-group--horizontal":"horizontal"===k},m),j=e(e({},f),{gap:"number"==typeof g?"".concat(g,"px"):g});return l(t.Provider,{value:{value:void 0!==i?i:C,onChange:function(e){_(e),null==u||u(e)},disabled:p},children:l("div",{className:G,style:j,children:h?h.map(function(e,a){var i;return l(s,{value:e.value,disabled:e.disabled||p,children:e.label},null!==(i=e.value)&&void 0!==i?i:a)}):b})})},s.displayName="Checkbox",s.Group.displayName="Checkbox.Group";var u=s;export{u as default};
@@ -0,0 +1 @@
1
+ import{__assign as e}from"../node_modules/tslib/tslib.es6.js";import{jsx as t,jsxs as r,Fragment as i}from"react/jsx-runtime";import{useState as n,useRef as a,useEffect as o,useCallback as d}from"react";import{createPortal as c}from"react-dom";import l from"classnames";import s from"../Icon/Icon.js";import h from"../Button/Button.js";var u=function(u){var m=u.open,p=u.title,f=u.width,v=void 0===f?460:f,w=u.height,g=void 0===w?300:w,y=u.placement,b=void 0===y?"right":y,x=u.maskClosable,C=void 0===x||x,z=u.mask,N=void 0===z||z,k=u.onClose,H=u.children,W=u.className,M=u.style,I=u.maskStyle,E=u.maskClassName,L=u.contentClassName,S=u.contentStyle,_=u.header,j=u.headerClassName,X=u.headerStyle,Y=u.footer,q=u.footerClassName,A=u.footerStyle,B=u.getContainer,D=void 0!==B&&B,F=u.destroyOnClose,P=void 0!==F&&F,T=u.closable,O=void 0===T||T,G=u.zIndex,J=void 0===G?1e3:G,K=u.loading,Q=void 0!==K&&K,R=u.loadingIcon,U=u.resizable,V=void 0!==U&&U,Z=u.resizeHandleSize,$=void 0===Z?8:Z,ee=u.minWidth,te=void 0===ee?460:ee,re=u.minHeight,ie=void 0===re?150:re,ne=u.onChange,ae=n(!1),oe=ae[0],de=ae[1],ce=n(!1),le=ce[0],se=ce[1],he=n(!1),ue=he[0],me=he[1],pe=window.innerWidth,fe=window.innerHeight,ve=n("number"==typeof v?v:460),we=ve[0],ge=ve[1],ye=n("number"==typeof g?g:300),be=ye[0],xe=ye[1],Ce=n(!1),ze=Ce[0],Ne=Ce[1],ke=a(null),He=a({x:0,y:0}),We=a({width:0,height:0}),Me=a({width:we,height:be}),Ie=a({placement:b,minWidth:te,maxWidth:pe,minHeight:ie,maxHeight:fe,onChange:ne});o(function(){Me.current={width:we,height:be}},[we,be]),o(function(){Ie.current={placement:b,minWidth:te,maxWidth:pe,minHeight:ie,maxHeight:fe,onChange:ne}},[b,te,pe,ie,fe,ne]),o(function(){"number"==typeof v&&ge(v)},[v]),o(function(){"number"==typeof g&&xe(g)},[g]),o(function(){if(!m){se(!1),me(!0);var e=setTimeout(function(){de(!1),me(!1)},300);return function(){return clearTimeout(e)}}return me(!1),de(!0),document.body.style.overflow="hidden",requestAnimationFrame(function(){requestAnimationFrame(function(){se(!0)})}),function(){document.body.style.overflow=""}},[m,300]);var Ee=function(){C&&k()},Le=function(){k()},Se=function(e){return"number"==typeof e?"".concat(e,"px"):e},_e=function(){var t=e(e({},M),{zIndex:J}),r=V?{width:we,height:be}:{width:v,height:g};switch(b){case"left":case"right":t.width=Se(r.width),t.height="100%";break;case"top":case"bottom":t.height=Se(r.height),t.width="100%"}return ze&&(t.transition="none"),t},je=V&&oe,Xe=function(){switch(b){case"left":return"idp-drawer-resize-handle--right";case"right":return"idp-drawer-resize-handle--left";case"top":return"idp-drawer-resize-handle--bottom";case"bottom":return"idp-drawer-resize-handle--top";default:return""}},Ye=function(){switch(b){case"left":case"right":return"col-resize";case"top":case"bottom":return"row-resize";default:return"default"}},qe=d(function(e){e.preventDefault(),e.stopPropagation();var t=Me.current.width,r=Me.current.height;if(ke.current){var i=Ie.current;"left"===i.placement||"right"===i.placement?ke.current.style.width="".concat(t,"px"):ke.current.style.height="".concat(r,"px")}Ne(!0),He.current={x:e.clientX,y:e.clientY},We.current={width:t,height:r}},[]),Ae=d(function(e){var t,r=Ie.current,i=e.clientX-He.current.x,n=e.clientY-He.current.y,a=We.current.width,o=We.current.height;if("left"===r.placement){var d=We.current.width+i;(a=Math.max(r.minWidth,Math.min(r.maxWidth,d)))!==d&&(He.current.x=e.clientX,We.current.width=a)}else if("right"===r.placement){d=We.current.width-i;(a=Math.max(r.minWidth,Math.min(r.maxWidth,d)))!==d&&(He.current.x=e.clientX,We.current.width=a)}else if("top"===r.placement){var c=We.current.height+n;(o=Math.max(r.minHeight,Math.min(r.maxHeight,c)))!==c&&(He.current.y=e.clientY,We.current.height=o)}else if("bottom"===r.placement){c=We.current.height-n;(o=Math.max(r.minHeight,Math.min(r.maxHeight,c)))!==c&&(He.current.y=e.clientY,We.current.height=o)}Me.current={width:a,height:o},ge(a),xe(o),null===(t=r.onChange)||void 0===t||t.call(r,{width:a,height:o})},[]),Be=d(function(){Ne(!1)},[]);o(function(){return ze?(document.addEventListener("mousemove",Ae),document.addEventListener("mouseup",Be)):(document.removeEventListener("mousemove",Ae),document.removeEventListener("mouseup",Be)),function(){document.removeEventListener("mousemove",Ae),document.removeEventListener("mouseup",Be)}},[ze,Ae,Be]);var De=function(){return Q?t("div",{className:"idp-drawer-loading",children:R||t(s,{type:"loading",size:"large",spin:!0})}):null},Fe=function(){return!1===_?null:_?t("div",{className:l("idp-drawer-header",j),style:X,children:_}):p||O?r("div",{className:l("idp-drawer-header",j),style:X,children:[t("div",{className:"idp-drawer-header__title",children:p}),O&&t("button",{className:"idp-drawer-header__close",onClick:Le,type:"button","aria-label":"Close",children:t(s,{type:"close",size:20})})]}):null},Pe=function(){var e;return je?t("div",{className:l("idp-drawer-resize-handle",Xe()),style:(e={cursor:Ye()},e["left"===b||"right"===b?"width":"height"]=$,e),onMouseDown:qe}):null},Te=function(){if(!oe&&!ue)return null;var n=t("div",{className:l("idp-drawer-overlay",{"idp-drawer-overlay--visible":le&&!ue,"idp-drawer-overlay--closing":ue,"idp-drawer-overlay--resizing":ze},E),style:e({zIndex:J},I),onClick:Ee,children:r("div",{ref:ke,className:l("idp-drawer","idp-drawer--".concat(b),{"idp-drawer--visible":le&&!ue,"idp-drawer--closing":ue,"idp-drawer--no-mask":!N,"idp-drawer--resizing":ze},W),style:_e(),onClick:function(e){return e.stopPropagation()},children:[De(),Fe(),t("div",{className:l("idp-drawer-content",L),style:S,children:P&&ue?null:H}),!1!==Y&&t("div",{className:l("idp-drawer-footer",q),style:A,children:Y||r(i,{children:[t(h,{onClick:Le,type:"button",children:"取消"}),t(h,{variant:"primary",onClick:Le,type:"button",children:"确认"})]})}),Pe()]})});return N?n:t("div",{className:l("idp-drawer-wrapper",{"idp-drawer-wrapper--visible":le&&!ue,"idp-drawer-wrapper--closing":ue}),style:{zIndex:J},children:r("div",{ref:ke,className:l("idp-drawer","idp-drawer--".concat(b),{"idp-drawer--visible":le&&!ue,"idp-drawer--closing":ue,"idp-drawer--no-mask":!N,"idp-drawer--resizing":ze},W),style:_e(),children:[De(),Fe(),t("div",{className:l("idp-drawer-content",L),style:S,children:P&&ue?null:H}),!1!==Y&&t("div",{className:l("idp-drawer-footer",q),style:A,children:Y||r(i,{children:[t("button",{onClick:Le,type:"button",children:"取消"}),t("button",{onClick:Le,type:"button",children:"确认"})]})}),Pe()]})})}();if(!Te)return null;if(!1===D)return Te;var Oe="function"==typeof D?D():D;return Oe?c(Te,Oe):Te};export{u as default};
@@ -0,0 +1 @@
1
+ import{jsx as r}from"react/jsx-runtime";import a,{createContext as e,useContext as i}from"react";import l from"classnames";import{ColWrapper as s,RowWrapper as d,GridWrapper as o}from"./styles.js";var p=e({}),n=e({}),t=a.forwardRef(function(a,e){var d=a.children,o=a.className,p=a.style,t=a.span,c=a.offset,f=a.push,g=a.pull,u=a.order,m=a.gap,h=i(n),v=null==h?void 0:h.gap,w=void 0!==m?m:v;return r(s,{ref:e,className:l("idp-grid-col",o),style:p,span:t,offset:c,push:f,pull:g,order:u,gap:w,children:d})});t.displayName="Grid.Col";var c=a.forwardRef(function(a,e){var s=a.children,o=a.className,t=a.style,c=a.span,f=a.gap,g=a.rowGap,u=a.align,m=a.justify,h=a.wrap,v=void 0===h||h,w=i(p),y=null==w?void 0:w.gap,N=void 0!==f?f:y;return r(n.Provider,{value:{gap:N},children:r(d,{ref:e,className:l("idp-grid-row",o),style:t,span:c,rowGap:g,align:u,justify:m,wrap:v,children:s})})});c.displayName="Grid.Row";var f=Object.assign(c,{Col:t}),g=a.forwardRef(function(a,e){var i=a.children,s=a.className,d=a.style,n=a.width,t=a.height,c=a.gap,f=a.padding,g=a.backgroundColor;return r(p.Provider,{value:{gap:c},children:r(o,{ref:e,className:l("idp-grid",s),style:d,width:n,height:t,gap:c,padding:f,backgroundColor:g,children:i})})});g.displayName="Grid";var u=Object.assign(g,{Row:f,Col:t});export{t as Col,f as Row,u as default};
@@ -0,0 +1 @@
1
+ import{__makeTemplateObject as n}from"../node_modules/tslib/tslib.es6.js";import o from"styled-components";var t,r,i,a=o.div.withConfig({shouldForwardProp:function(n){return!["width","height","gap","padding","backgroundColor"].includes(n)}})(t||(t=n(["\n width: ",";\n height: ",";\n gap: ",";\n padding: ",";\n background-color: ",";\n box-sizing: border-box;\n"],["\n width: ",";\n height: ",";\n gap: ",";\n padding: ",";\n background-color: ",";\n box-sizing: border-box;\n"])),function(n){return void 0!==n.width?"number"==typeof n.width?"".concat(n.width,"px"):n.width:"100%"},function(n){return void 0!==n.height?"number"==typeof n.height?"".concat(n.height,"px"):n.height:"auto"},function(n){return void 0!==n.gap?"number"==typeof n.gap?"".concat(n.gap,"px"):n.gap:"0"},function(n){return void 0!==n.padding?"number"==typeof n.padding?"".concat(n.padding,"px"):n.padding:"0"},function(n){return n.backgroundColor||"transparent"}),e=o.div.withConfig({shouldForwardProp:function(n){return!["span","rowGap","align","justify","wrap"].includes(n)}})(r||(r=n(["\n display: flex;\n width: ",";\n row-gap: ",";\n align-items: ",";\n justify-content: ",";\n flex-wrap: ",";\n box-sizing: border-box;\n"],["\n display: flex;\n width: ",";\n row-gap: ",";\n align-items: ",";\n justify-content: ",";\n flex-wrap: ",";\n box-sizing: border-box;\n"])),function(n){return void 0!==n.span?"calc(".concat(n.span," / 24 * 100%)"):"100%"},function(n){return void 0!==n.rowGap?"number"==typeof n.rowGap?"".concat(n.rowGap,"px"):n.rowGap:"0"},function(n){return n.align||"stretch"},function(n){return n.justify||"flex-start"},function(n){return!1!==n.wrap?"wrap":"nowrap"}),c=o.div.withConfig({shouldForwardProp:function(n){return!["span","offset","push","pull","order","gap"].includes(n)}})(i||(i=n(["\n flex: ",";\n max-width: ",";\n margin-left: ",";\n margin-right: ",";\n order: ",";\n padding-left: ",";\n padding-right: ",";\n box-sizing: border-box;\n"],["\n flex: ",";\n max-width: ",";\n margin-left: ",";\n margin-right: ",";\n order: ",";\n padding-left: ",";\n padding-right: ",";\n box-sizing: border-box;\n"])),function(n){return void 0!==n.span?"0 0 calc(".concat(n.span," / 24 * 100%)"):"1"},function(n){return void 0!==n.span?"calc(".concat(n.span," / 24 * 100%)"):"100%"},function(n){return void 0!==n.pull?"calc(-".concat(n.pull," / 24 * 100%)"):void 0!==n.offset?"calc(".concat(n.offset," / 24 * 100%)"):"0"},function(n){return void 0!==n.push?"calc(".concat(n.push," / 24 * 100%)"):"0"},function(n){return void 0!==n.order?n.order:"0"},function(n){return void 0!==n.gap?"number"==typeof n.gap?"".concat(n.gap/2,"px"):"calc(".concat(n.gap," / 2)"):"0"},function(n){return void 0!==n.gap?"number"==typeof n.gap?"".concat(n.gap/2,"px"):"calc(".concat(n.gap," / 2)"):"0"});export{c as ColWrapper,a as GridWrapper,e as RowWrapper};
@@ -0,0 +1 @@
1
+ import{useEffect as t}from"react";var e=function(e,n){t(function(){var t=function(t){e.current&&!e.current.contains(t.target)&&n(t)};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),function(){document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}},[e,n])};export{e as useClickOutside};
@@ -1 +1 @@
1
- import{__rest as e,__assign as l}from"../node_modules/tslib/tslib.es6.js";import{jsxs as a,jsx as n}from"react/jsx-runtime";import i from"react";import t from"../Icon/Icon.js";var o=function(o){var r=o.type,s=void 0===r?"text":r,c=o.placeholder,u=void 0===c?"":c,d=o.width,p=o.className,f=void 0===p?"":p,m=o.style,v=o.value,y=o.defaultValue,h=o.onChange,b=o.onBlur,x=o.onFocus,N=o.disabled,g=void 0!==N&&N,w=o.readOnly,C=void 0!==w&&w,S=o.onKeyDown,j=o.prefix,B=o.suffix,D=o.clear,F=void 0!==D&&D,I=o.extra,K=o.label,O=o.labelGap,z=void 0===O?8:O,G=o.labelClassName,V=void 0===G?"":G,k=o.labelStyle,R=e(o,["type","placeholder","width","className","style","value","defaultValue","onChange","onBlur","onFocus","disabled","readOnly","onKeyDown","prefix","suffix","clear","extra","label","labelGap","labelClassName","labelStyle"]),_=i.useState(y||""),q=_[0],A=_[1],E=i.useState(!1),H=E[0],J=E[1],L=function(e){return e?"string"==typeof e?n(t,{type:e,size:"medium",color:"#909399"}):e:null},M=void 0!==v?v:q,P=F&&!g&&!C&&H&&null!=M&&M.toString().length>0;return a("div",{className:"input-base-container",children:[a("div",{className:"input-label-wrapper",style:{display:"flex",alignItems:"center"},children:[K&&n("div",{className:"input-label ".concat(V),style:l({marginRight:"number"==typeof z?"".concat(z,"px"):z},k),children:K}),a("div",{className:"input-wrapper ".concat(f," ").concat(g?"input-disabled":""," ").concat(C?"input-readonly":""),style:l({width:d},m),children:[j&&n("div",{className:"input-prefix",children:L(j)}),n("input",l({type:s,placeholder:u,className:"input-inner",value:null!=v?String(v):M,onChange:function(e){void 0===v&&A(e.target.value),null==h||h(e)},onBlur:function(e){J(!1),null==b||b(e)},onFocus:function(e){J(!0),null==x||x(e)},disabled:g,readOnly:C,onKeyDown:S},R)),a("div",{className:"input-suffix-group",children:[n("div",{className:"input-suffix-clear ".concat(P?"visible":""),onClick:function(){g||C||(void 0!==v||A(""),h&&h({target:{value:""}}))},children:n(t,{type:"close",size:"medium",color:"#1890ff"})}),B&&n("div",{className:"input-suffix-content",children:L(B)})]})]})]}),I&&n("div",{className:"input-extra",children:I})]})};export{o as default};
1
+ import{__rest as e,__assign as l}from"../node_modules/tslib/tslib.es6.js";import{jsxs as a,jsx as n}from"react/jsx-runtime";import i from"react";import t from"../Icon/Icon.js";var o=function(o){var r=o.type,s=void 0===r?"text":r,c=o.placeholder,u=void 0===c?"":c,d=o.width,p=o.className,f=void 0===p?"":p,m=o.style,v=o.value,y=o.defaultValue,h=o.onChange,b=o.onBlur,x=o.onFocus,N=o.disabled,g=void 0!==N&&N,w=o.readOnly,C=void 0!==w&&w,S=o.onKeyDown,j=o.prefix,B=o.suffix,D=o.clear,F=void 0!==D&&D,I=o.extra,K=o.label,O=o.labelGap,z=void 0===O?8:O,G=o.labelClassName,V=void 0===G?"":G,k=o.labelStyle,R=e(o,["type","placeholder","width","className","style","value","defaultValue","onChange","onBlur","onFocus","disabled","readOnly","onKeyDown","prefix","suffix","clear","extra","label","labelGap","labelClassName","labelStyle","error"]),_=i.useState(y||""),q=_[0],A=_[1],E=i.useState(!1),H=E[0],J=E[1],L=function(e){return e?"string"==typeof e?n(t,{type:e,size:"medium",color:"#909399"}):e:null},M=void 0!==v?v:q,P=F&&!g&&!C&&H&&null!=M&&M.toString().length>0;return a("div",{className:"input-base-container",children:[a("div",{className:"input-label-wrapper",style:{display:"flex",alignItems:"center"},children:[K&&n("div",{className:"input-label ".concat(V),style:l({marginRight:"number"==typeof z?"".concat(z,"px"):z},k),children:K}),a("div",{className:"input-wrapper ".concat(f," ").concat(g?"input-disabled":""," ").concat(C?"input-readonly":""),style:l({width:d},m),children:[j&&n("div",{className:"input-prefix",children:L(j)}),n("input",l({type:s,placeholder:u,className:"input-inner",value:null!=v?String(v):M,onChange:function(e){void 0===v&&A(e.target.value),null==h||h(e)},onBlur:function(e){J(!1),null==b||b(e)},onFocus:function(e){J(!0),null==x||x(e)},disabled:g,readOnly:C,onKeyDown:S},R)),a("div",{className:"input-suffix-group",children:[n("div",{className:"input-suffix-clear ".concat(P?"visible":""),onClick:function(){g||C||(void 0!==v||A(""),h&&h({target:{value:""}}))},children:n(t,{type:"close",size:"medium",color:"#1890ff"})}),B&&n("div",{className:"input-suffix-content",children:L(B)})]})]})]}),I&&n("div",{className:"input-extra",children:I})]})};export{o as default};
@@ -0,0 +1 @@
1
+ import{__rest as e,__assign as t}from"../node_modules/tslib/tslib.es6.js";import{jsx as i}from"react/jsx-runtime";import o from"react";import r from"./InputBase.js";import s from"../Icon/Icon.js";var n=function(n){var l=n.defaultVisible,a=void 0!==l&&l,f=n.onVisibleChange,u=e(n,["defaultVisible","onVisibleChange"]),m=o.useState(a),c=m[0],p=m[1];return i(r,t({type:c?"text":"password",suffix:i("div",{className:"input-suffix-content",onClick:function(){var e=!c;p(e),null==f||f(e)},style:{cursor:"pointer"},children:i(s,{type:c?"eye":"eyeOff",size:"medium",color:"#909399"})})},u))};export{n as default};
@@ -0,0 +1 @@
1
+ import{__assign as e}from"../node_modules/tslib/tslib.es6.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";import i from"react";import r from"../Icon/Icon.js";var a=function(a){var o=a.placeholder,l=void 0===o?"":o,s=a.width,c=a.height,u=a.className,d=void 0===u?"":u,m=a.style,p=a.value,f=a.defaultValue,h=a.onChange,v=a.onBlur,x=a.onFocus,g=a.onKeyDown,y=a.disabled,b=void 0!==y&&y,w=a.readOnly,z=void 0!==w&&w,N=a.rows,S=void 0===N?4:N,I=a.cols,C=a.maxLength,E=a.showCount,L=void 0!==E&&E,R=a.clear,j=void 0!==R&&R,D=a.extra,M=a.label,B=a.labelGap,H=void 0===B?8:B,W=a.labelClassName,X=void 0===W?"":W,Y=a.labelStyle,F=a.resizable,K=void 0!==F&&F,O=a.resizeHandleSize,V=void 0===O?10:O,$=a.minWidth,k=void 0===$?200:$,G=a.maxWidth,P=void 0===G?2e3:G,T=a.minHeight,_=void 0===T?80:T,q=a.maxHeight,A=void 0===q?800:q,J=a.onResize,Q=i.useState(f||""),U=Q[0],Z=Q[1],ee=i.useState(!1),te=ee[0],ne=ee[1],ie=i.useState(!1),re=ie[0],ae=ie[1],oe=i.useRef(null),le=i.useRef(null),se=i.useRef(null),ce=function(e){if(void 0===e)return 0;if("number"==typeof e)return e;var t=String(e).match(/^(\d+)px$/);return t?parseInt(t[1],10):0},ue=function(e){if(void 0===e)return 0;if("number"==typeof e)return e;var t=String(e).match(/^(\d+)px$/);return t?parseInt(t[1],10):0},de=i.useState(ce(s)||0),me=de[0],pe=de[1],fe=i.useState(ue(c)||24*S||80),he=fe[0],ve=fe[1];i.useEffect(function(){if(le.current){var e=ce(s)||le.current.offsetWidth||0,t=ue(c)||24*S||80;pe(e),ve(t)}},[]);var xe=void 0!==p,ge=xe?p:U,ye=(null==ge?void 0:ge.length)||0;i.useEffect(function(){var e=function(e){if(re&&se.current){var t=e.clientX-se.current.mouseX,n=e.clientY-se.current.mouseY,i=se.current.width+t,r=se.current.height+n;i=Math.max(k,Math.min(P,i)),r=Math.max(_,Math.min(A,r)),pe(i),ve(r),null==J||J({width:i,height:r})}},t=function(){se.current=null,ae(!1)};return re&&(document.addEventListener("mousemove",e),document.addEventListener("mouseup",t)),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[re,k,P,_,A,J]);var be={display:"inline-flex",flexDirection:"column",width:s?"number"==typeof s?"".concat(s,"px"):s:"100%"},we={position:"relative",display:"flex",alignItems:"flex-start",flex:1,width:K?"number"==typeof me?"".concat(me,"px"):me:void 0},ze=e({width:"100%",height:c?"number"==typeof c?"".concat(c,"px"):c:void 0,resize:"none"},m),Ne=j&&ge&&!b&&!z,Se=K?e(e({},ze),{width:"100%",height:K?"number"==typeof he?"".concat(he,"px"):he:void 0}):ze;return t("div",{className:"textarea-wrapper ".concat(d),style:be,ref:le,children:[(M||L||Ne)&&t("div",{className:"textarea-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[M?n("label",{className:"input-label ".concat(X),style:e({marginRight:"number"==typeof H?"".concat(H,"px"):H},Y),children:M}):null,t("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[Ne&&n("span",{className:"textarea-clear",onClick:function(){if(!b&&!z){xe||Z(""),null==h||h({target:{value:""}})}},style:{cursor:"pointer"},children:n(r,{type:"close-circle",size:"small",color:"#909399"})}),L&&C&&t("span",{className:"textarea-count",style:{fontSize:"12px",color:"#909399"},children:[ye,"/",C]})]})]}),t("div",{className:"input-wrapper textarea-input-wrapper ".concat(te?"focused":""," ").concat(b?"disabled":""," ").concat(re?"resizing":""),style:we,children:[n("textarea",{ref:oe,className:"input-base textarea-base",placeholder:l,value:ge,defaultValue:xe?void 0:f,onChange:function(e){var t=e.target.value;xe||Z(t),null==h||h(e)},onBlur:function(e){ne(!1),null==v||v(e)},onFocus:function(e){ne(!0),null==x||x(e)},onKeyDown:g,disabled:b,readOnly:z,rows:S,cols:I,maxLength:C,style:Se}),K&&n("div",{className:"textarea-resize-handle",onMouseDown:function(e){K&&!b&&!z&&le.current&&(e.preventDefault(),e.stopPropagation(),se.current={mouseX:e.clientX,mouseY:e.clientY,width:le.current.offsetWidth,height:le.current.offsetHeight},ae(!0))},style:{position:"absolute",bottom:"0",right:"0",width:"".concat(V,"px"),height:"".concat(V,"px"),cursor:"nwse-resize",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:n("div",{style:{width:"8px",height:"8px",borderRight:"2px solid #909399",borderBottom:"2px solid #909399"}})})]}),D&&n("div",{className:"input-extra",style:{marginTop:"4px"},children:D})]})};export{a as default};
@@ -1 +1 @@
1
- import r from"./InputBase.js";import m from"./Search.js";import a from"./Number.js";var e=r;e.Search=m,e.Number=a;var o=e;export{a as NumberInput,m as Search,o as default};
1
+ import r from"./InputBase.js";import a from"./Search.js";import o from"./Number.js";import m from"./Textarea.js";import e from"./Password.js";var s=r;s.Search=a,s.Number=o,s.Textarea=m,s.Password=e;var t=s;export{o as NumberInput,e as Password,a as Search,m as Textarea,t as default};
@@ -0,0 +1 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{createContext as e,useState as t,useContext as o}from"react";var n=e(void 0),i=function(e){var o=e.children,i=t(!1),d=i[0],u=i[1],a=t(!1),s=a[0],c=a[1],f=t(function(){return function(){}}),l=f[0],p=f[1];return r(n.Provider,{value:{siderCollapsed:d,setSiderCollapsed:u,zeroWidthMode:s,setZeroWidthMode:c,onExpand:l,setOnExpand:p},children:o})},d=function(){var r=o(n);if(!r)throw new Error("useLayoutContext must be used within a LayoutProvider");return r};export{n as LayoutContext,i as LayoutProvider,d as useLayoutContext};
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import o from"react";import i from"../Icon/Icon.js";import{LayoutWrapper as r,HeaderWrapper as d,SiderWrapper as l,SiderContentWrapper as a,SiderTrigger as n,ContentWrapper as c,ZeroWidthTriggerInContent as s,FooterWrapper as h}from"./styles.js";import{LayoutProvider as m,useLayoutContext as f}from"./LayoutContext.js";var u=function(t){var o=t.className,i=void 0===o?"":o,r=t.style,l=void 0===r?{}:r,a=t.children,n=t.height,c=t.fixed,s=void 0!==c&&c,h=t.theme,m=void 0===h?"light":h,f=(null==l?void 0:l.background)||"#3030302b";return e(d,{className:"layout-header layout-header-".concat(m," ").concat(i),style:l,$height:n,$fixed:s,$theme:m,$bgColor:f,children:a})},v=function(r){var d=r.className,c=void 0===d?"":d,s=r.style,h=void 0===s?{}:s,m=r.children,u=r.width,v=void 0===u?200:u,p=r.collapsedWidth,y=void 0===p?64:p,$=r.collapsible,g=void 0!==$&&$,x=r.collapsed,N=void 0!==x&&x,C=r.onCollapse,b=r.trigger,W=r.triggerPlacement,w=void 0===W?"bottom":W,z=r.zeroWidthMode,E=void 0!==z&&z,j=r.fixed,k=void 0!==j&&j,M=r.theme,S=void 0===M?"light":M,I=f(),L=I.setSiderCollapsed,A=I.setZeroWidthMode,F=I.setOnExpand;o.useEffect(function(){L(N),A(E)},[N,E,L,A]);var H=function(){null==C||C(!N)};o.useEffect(function(){F(function(){return H})},[N,C,F]);var O=E&&N?0:y;return t(l,{className:"layout-sider ".concat(c),style:h,$width:v,$collapsedWidth:O,$collapsed:N,$fixed:k,$theme:S,children:[e(a,{children:m}),g&&e(n,{className:"layout-sider-trigger",$collapsed:N,$placement:E?"top":w,onClick:H,$zeroWidthMode:E,$theme:S,children:b||e(i,{type:N?"arrowRight":"arrowLeft",size:20,color:"dark"===S?"#fff":"rgba(0, 0, 0, 0.65)"})})]})},p=function(o){var r=o.className,d=void 0===r?"":r,l=o.style,a=void 0===l?{}:l,n=o.children,h=o.theme,m=void 0===h?"light":h,u=f(),v=u.siderCollapsed,p=u.zeroWidthMode,y=u.onExpand;return t(c,{className:"layout-content ".concat(d),style:a,$theme:m,children:[p&&v&&e(s,{onClick:y,children:e(i,{type:"menu",size:24,color:"#fff"})}),n]})},y=function(t){var o=t.className,i=void 0===o?"":o,r=t.style,d=void 0===r?{}:r,l=t.children,a=t.height,n=t.fixed,c=void 0!==n&&n,s=t.theme;return e(h,{className:"layout-footer ".concat(i),style:d,$height:a,$fixed:c,$theme:s,children:l})},$=function(t){var i=t.className,d=void 0===i?"":i,l=t.style,a=void 0===l?{}:l,n=t.children,c=t.hasSider,s=t.theme,h=void 0!==c?c:function(e){return!!e&&o.Children.toArray(e).some(function(e){return o.isValidElement(e)&&e.type===v})}(n);return e(m,{children:e(r,{className:"layout-wrapper ".concat(d),style:a,$hasSider:h,$theme:s,children:n})})};$.Header=u,$.Sider=v,$.Content=p,$.Footer=y;var g=$;export{p as Content,y as Footer,u as Header,v as Sider,g as default};
@@ -0,0 +1 @@
1
+ import{__makeTemplateObject as n}from"../node_modules/tslib/tslib.es6.js";import o from"styled-components";var r=function(n,o){return"var(".concat(n,", ").concat(o,")")},t=o.div(c||(c=n(["\n display: flex;\n flex-direction: column;\n min-height: ",";\n max-height: 100vh;\n background-color: ",";\n box-sizing: border-box;\n position: relative;\n overflow: hidden;\n\n &.layout-wrapper {\n /* 外部可通过 .layout-wrapper 选择器覆盖样式 */\n }\n\n ","\n"],["\n display: flex;\n flex-direction: column;\n min-height: ",";\n max-height: 100vh;\n background-color: ",";\n box-sizing: border-box;\n position: relative;\n overflow: hidden;\n\n &.layout-wrapper {\n /* 外部可通过 .layout-wrapper 选择器覆盖样式 */\n }\n\n ","\n"])),r("--layout-min-height","100vh"),function(n){return"dark"===n.$theme?r("--layout-bg-dark","#000"):r("--layout-bg-light","#f5f5f5")},function(n){return n.$hasSider&&"\n flex-direction: row;\n "}),e=o.header(u||(u=n(["\n display: flex;\n align-items: center;\n flex-shrink: 0;\n padding: ",";\n background-color: ",";\n color: ",";\n height: ",";\n z-index: ",";\n transition: ",";\n box-sizing: border-box;\n\n &.layout-header-light {\n border-bottom: ",";\n }\n\n &.layout-header-dark {\n border-bottom: 1px solid transition;\n }\n\n &.layout-header {\n /* 外部可通过 .layout-header 选择器覆盖样式 */\n }\n\n ","\n"],["\n display: flex;\n align-items: center;\n flex-shrink: 0;\n padding: ",";\n background-color: ",";\n color: ",";\n height: ",";\n z-index: ",";\n transition: ",";\n box-sizing: border-box;\n\n &.layout-header-light {\n border-bottom: ",";\n }\n\n &.layout-header-dark {\n border-bottom: 1px solid transition;\n }\n\n &.layout-header {\n /* 外部可通过 .layout-header 选择器覆盖样式 */\n }\n\n ","\n"])),r("--layout-header-padding","0 24px"),function(n){return"dark"===n.$theme?r("--layout-header-bg-dark","#001529"):r("--layout-header-bg-light","#fff")},function(n){return"dark"===n.$theme?r("--layout-header-color-dark","#fff"):r("--layout-header-color-light","#000")},function(n){var o=n.$height;return"number"==typeof o?"".concat(o,"px"):o||r("--layout-header-height","64px")},r("--layout-header-z-index","10"),r("--layout-header-transition","all 0.3s ease"),function(n){var o=n.$bgColor;return"1px solid ".concat(o)},function(n){return n.$fixed&&"\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n box-shadow: ".concat(r("--layout-header-box-shadow","0 2px 8px rgba(0, 0, 0, 0.15)"),";\n ")}),a=o.aside(s||(s=n(["\n display: flex;\n flex-direction: column;\n background-color: ",";\n color: ",";\n z-index: ",";\n transition: ",";\n flex: ",";\n box-sizing: border-box;\n border-right: ",";\n box-shadow: ",";\n\n /* Sider 高度 = 浏览器高度 - Header 高度 */\n height: calc(100vh - var(--layout-header-height, 64px));\n min-height: calc(100vh - var(--layout-header-height, 64px));\n\n &.layout-sider {\n /* 外部可通过 .layout-sider 选择器覆盖样式 */\n }\n\n /* 让子元素占据剩余空间,使 trigger 可以固定在底部 */\n & > *:not(.layout-sider-trigger) {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n }\n\n ","\n\n ","\n\n /* 菜单项样式 */\n .layout-menu-item {\n color: ",";\n transition: all 0.3s ease;\n\n &:hover {\n background-color: ",";\n color: ",";\n }\n\n &.active {\n background-color: ",";\n color: ",";\n }\n }\n"],["\n display: flex;\n flex-direction: column;\n background-color: ",";\n color: ",";\n z-index: ",";\n transition: ",";\n flex: ",";\n box-sizing: border-box;\n border-right: ",";\n box-shadow: ",";\n\n /* Sider 高度 = 浏览器高度 - Header 高度 */\n height: calc(100vh - var(--layout-header-height, 64px));\n min-height: calc(100vh - var(--layout-header-height, 64px));\n\n &.layout-sider {\n /* 外部可通过 .layout-sider 选择器覆盖样式 */\n }\n\n /* 让子元素占据剩余空间,使 trigger 可以固定在底部 */\n & > *:not(.layout-sider-trigger) {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n }\n\n ","\n\n ","\n\n /* 菜单项样式 */\n .layout-menu-item {\n color: ",";\n transition: all 0.3s ease;\n\n &:hover {\n background-color: ",";\n color: ",";\n }\n\n &.active {\n background-color: ",";\n color: ",";\n }\n }\n"])),function(n){return"dark"===n.$theme?r("--layout-sider-bg-dark","#001529"):r("--layout-sider-bg-light","#fff")},function(n){return"dark"===n.$theme?r("--layout-sider-color-dark","#fff"):r("--layout-sider-color-light","#000")},r("--layout-sider-z-index","10"),r("--layout-sider-transition","all 0.3s ease"),r("--layout-sider-flex","0 0 200px"),function(n){return"dark"===n.$theme?"var(--layout-sider-border, 1px solid #303030)":"var(--layout-sider-border, 1px solid transparent)"},function(n){return"dark"===n.$theme?"2px 0 8px rgba(0, 0, 0, 0.3)":"2px 0 8px rgba(0, 0, 0, 0.08)"},function(n){var o=n.$width,t=n.$collapsedWidth,e=n.$collapsed,a="number"==typeof o?"".concat(o,"px"):o||r("--layout-sider-width","200px"),i=void 0!==t?"".concat(t,"px"):r("--layout-sider-collapsed-width","64px");return"\n width: ".concat(e?i:a,";\n min-width: ").concat(e?i:a,";\n max-width: ").concat(e?i:a,";\n ")},function(n){return n.$fixed&&"\n position: fixed;\n top: ".concat(r("--layout-header-height","64px"),";\n left: 0;\n bottom: 0;\n overflow-y: auto;\n box-shadow: ").concat(r("--layout-sider-box-shadow","2px 0 8px rgba(0, 0, 0, 0.15)"),";\n ")},function(n){return"dark"===n.$theme?r("--layout-sider-color-dark","#fff"):r("--layout-sider-color-light","#000")},r("--layout-menu-hover-bg-light","#1890ff"),r("--layout-menu-hover-color-light","#fff"),r("--layout-menu-active-bg-light","#1890ff"),r("--layout-menu-active-color-light","#fff")),i=o.div(h||(h=n(["\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n\n /* 内容过渡动画 */\n & > * {\n transition: all 0.3s ease;\n }\n\n /* 收缩状态下的内容样式 */\n ","\n"],["\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n\n /* 内容过渡动画 */\n & > * {\n transition: all 0.3s ease;\n }\n\n /* 收缩状态下的内容样式 */\n ","\n"])),function(n){return n.$collapsed&&"\n & > * {\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n "}),l=o.div(f||(f=n(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: ",";\n background-color: ",";\n color: ",";\n cursor: pointer;\n transition: ",";\n user-select: none;\n order: ",";\n\n &.layout-sider-trigger {\n /* 外部可通过 .layout-sider-trigger 选择器覆盖样式 */\n }\n\n &:hover {\n background-color: ",";\n color: ",";\n }\n\n /* 分割线 */\n ","\n\n ","\n\n /* 零宽度模式下,收缩时隐藏触发器 */\n ","\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n height: ",";\n background-color: ",";\n color: ",";\n cursor: pointer;\n transition: ",";\n user-select: none;\n order: ",";\n\n &.layout-sider-trigger {\n /* 外部可通过 .layout-sider-trigger 选择器覆盖样式 */\n }\n\n &:hover {\n background-color: ",";\n color: ",";\n }\n\n /* 分割线 */\n ","\n\n ","\n\n /* 零宽度模式下,收缩时隐藏触发器 */\n ","\n"])),r("--layout-trigger-height","48px"),function(n){return"dark"===n.$theme?r("--layout-sider-bg-dark","#001529"):r("--layout-sider-bg-light","#fff")},function(n){return"dark"===n.$theme?r("--layout-sider-color-dark","#fff"):r("--layout-sider-color-light","#000")},r("--layout-trigger-transition","all 0.3s ease"),function(n){return"top"===n.$placement?"-1":"auto"},r("--layout-menu-hover-bg-light","#1890ff"),r("--layout-menu-hover-color-light","#fff"),function(n){var o=n.$placement,r=n.$theme;return"top"===o&&"\n border-bottom: 1px solid ".concat("dark"===r?"#303030":"transparent",";\n ")},function(n){var o=n.$placement,r=n.$theme;return"top"!==o&&"\n border-top: 1px solid ".concat("dark"===r?"#303030":"transparent",";\n ")},function(n){var o=n.$zeroWidthMode,r=n.$collapsed;return o&&r&&"\n display: none;\n "}),d=o.div(g||(g=n(["\n position: absolute;\n top: 16px;\n left: 16px;\n width: 40px;\n height: 40px;\n border-radius: 50%;\n background-color: #1890ff;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n z-index: 100;\n transition: all 0.3s ease;\n\n &:hover {\n background-color: #40a9ff;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);\n transform: scale(1.05);\n }\n"],["\n position: absolute;\n top: 16px;\n left: 16px;\n width: 40px;\n height: 40px;\n border-radius: 50%;\n background-color: #1890ff;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n z-index: 100;\n transition: all 0.3s ease;\n\n &:hover {\n background-color: #40a9ff;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);\n transform: scale(1.05);\n }\n"])));o.div(x||(x=n(["\n display: flex;\n flex: 1;\n flex-direction: column;\n overflow: hidden;\n\n ","\n"],["\n display: flex;\n flex: 1;\n flex-direction: column;\n overflow: hidden;\n\n ","\n"])),function(n){return n.$hasSider&&"\n flex-direction: row;\n "});var c,u,s,h,f,g,x,p,b,y=o.main(p||(p=n(["\n flex: 1;\n padding: ",";\n background-color: ",";\n min-height: ",";\n transition: ",";\n overflow-y: auto;\n box-sizing: border-box;\n position: relative;\n\n &.layout-content {\n /* 外部可通过 .layout-content 选择器覆盖样式 */\n }\n\n ","\n\n /* Dark 主题滚动条样式 */\n ","\n"],["\n flex: 1;\n padding: ",";\n background-color: ",";\n min-height: ",";\n transition: ",";\n overflow-y: auto;\n box-sizing: border-box;\n position: relative;\n\n &.layout-content {\n /* 外部可通过 .layout-content 选择器覆盖样式 */\n }\n\n ","\n\n /* Dark 主题滚动条样式 */\n ","\n"])),r("--layout-content-padding","24px"),r("--layout-content-bg","transparent"),r("--layout-content-min-height","280px"),r("--layout-content-transition","all 0.3s ease"),function(n){return n.$fixed&&"\n overflow-y: auto;\n "},function(n){return"dark"===n.$theme&&"\n &::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n }\n\n &::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: color-mix(in srgb, var(--idp-primary-color, #1890ff) 50%, transparent);\n border-radius: 3px;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background-color: color-mix(in srgb, var(--idp-primary-color, #1890ff) 70%, transparent);\n }\n\n scrollbar-width: thin;\n scrollbar-color: color-mix(in srgb, var(--idp-primary-color, #1890ff) 50%, transparent) transparent;\n "}),m=o.footer(b||(b=n(["\n display: flex;\n align-items: center;\n flex-shrink: 0;\n padding: ",";\n background-color: ",";\n color: ",";\n height: ",";\n border-top: ",";\n z-index: ",";\n transition: ",";\n box-sizing: border-box;\n\n &.layout-footer {\n /* 外部可通过 .layout-footer 选择器覆盖样式 */\n }\n\n ","\n"],["\n display: flex;\n align-items: center;\n flex-shrink: 0;\n padding: ",";\n background-color: ",";\n color: ",";\n height: ",";\n border-top: ",";\n z-index: ",";\n transition: ",";\n box-sizing: border-box;\n\n &.layout-footer {\n /* 外部可通过 .layout-footer 选择器覆盖样式 */\n }\n\n ","\n"])),r("--layout-footer-padding","24px 50px"),function(n){return"dark"===n.$theme?r("--layout-footer-bg-dark","#001529"):r("--layout-footer-bg-light","#fff")},function(n){return"dark"===n.$theme?r("--layout-footer-color-dark","#fff"):r("--layout-footer-color-light","#000")},function(n){var o=n.$height;return"number"==typeof o?"".concat(o,"px"):o||r("--layout-footer-height","48px")},function(n){return"dark"===n.$theme?"var(--layout-footer-border, 1px solid #303030)":"var(--layout-footer-border, 1px solid transparent)"},r("--layout-footer-z-index","10"),r("--layout-footer-transition","all 0.3s ease"),function(n){return n.$fixed&&"\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);\n "});export{y as ContentWrapper,m as FooterWrapper,e as HeaderWrapper,t as LayoutWrapper,i as SiderContentWrapper,l as SiderTrigger,a as SiderWrapper,d as ZeroWidthTriggerInContent};
@@ -1 +1 @@
1
- import{__spreadArray as e,__assign as n}from"../node_modules/tslib/tslib.es6.js";import{jsx as i,jsxs as t}from"react/jsx-runtime";import{useState as o,useEffect as l,createContext as r,Fragment as c}from"react";import a from"../Icon/Icon.js";import s from"../Divider/index.js";var d=function(d){var u=d.mode,m=void 0===u?"vertical":u,p=d.items,h=void 0===p?[]:p,v=d.className,f=d.style,y=d.menuItemStyle,k=void 0===y?{}:y,g=d.selectedKey,b=d.collapsed,x=void 0!==b&&b,w=d.onChange,N=o(""),z=N[0],C=N[1],E=o([]),L=E[0],I=E[1],R=o(!1),S=R[0],T=R[1],j=o({left:0,top:0}),A=j[0],B=j[1],D=o(null),M=D[0],U=D[1],W=o(!1),q=W[0],X=W[1],K=o({left:0,top:0}),P=K[0],_=K[1],F=o(null),G=F[0],H=F[1],J=o(!1),O=J[0],Q=J[1],V=o(!1),Y=V[0],Z=V[1],$=void 0!==g?g:z;l(function(){if($){var n=function(i,t,o){void 0===o&&(o=[]);for(var l=0,r=i;l<r.length;l++){var c=r[l];if(c.key===t)return o;if(c.childrens&&c.childrens.length>0){var a=n(c.childrens,t,e(e([],o,!0),[c.key],!1));if(a)return a}}return null},i=n(h,$);i&&I(function(n){return Array.from(new Set(e(e([],n,!0),i,!0)))})}},[$,h]);var ee={},ne=r(ee);l(function(){if(S){var e=setTimeout(function(){return Q(!0)},10);return function(){return clearTimeout(e)}}Q(!1)},[S]),l(function(){if(q){var e=setTimeout(function(){return Z(!0)},10);return function(){return clearTimeout(e)}}Z(!1)},[q]),l(function(){var e=function(){S&&(T(!1),X(!1)),q&&X(!1)};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),function(){window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[S,q]),l(function(){var e=function(e){var n=document.querySelectorAll(".idp-menu-item"),i=document.querySelectorAll(".menu-popup, .sub-menu-popup"),t=!1,o=!1;n.forEach(function(n){n.contains(e.target)&&(t=!0)}),i.forEach(function(n){n.contains(e.target)&&(o=!0)}),"horizontal"!==m&&"inline-flex"!==m&&"inline-block"!==m||!S&&!q||t||o||(T(!1),X(!1))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[S,q,m]);var ie=function(n){I(function(i){return i.includes(n)?i.filter(function(e){return e!==n}):e(e([],i,!0),[n],!1)})};function te(e){var o;return null===(o=e.childrens)||void 0===o?void 0:o.map(function(e){return t("div",{className:"vertical-menu-item",children:[t("div",{style:n({},k),className:"common-item vertical-menu-item-content ".concat($===e.key?"menu-".concat(m,"-selected"):""),"data-title":e.label,onClick:function(){void 0===g&&C(e.key),w&&w(e,e.key),e.childrens&&!x&&ie(e.key)},children:[(null==e?void 0:e.icon)||i("span",{style:{width:"16px",height:"16px",display:"inline-block"},children:e.label.charAt(0)}),i("span",{children:e.label}),e.childrens&&!x&&i(a,{type:L.includes(e.key)?"arrowUp":"arrowDown",size:16,color:"#666",style:{transition:"transform 0.3s ease"},className:"common-menu-item-icon"})]}),e.childrens&&i("div",{className:"sub-menu-container ".concat(L.includes(e.key)?"open":""),children:te(e)})]},e.key)})}var oe=function(){return i("div",{className:"idp-menu-item inline-menu",children:h.map(function(e,n){return t(c,{children:[t("div",{onClick:function(n){if(void 0===g&&C(e.key),w&&w(e,e.key),e.childrens)if(S&&(null==M?void 0:M.key)===e.key)T(!1),X(!1);else{var i=n.currentTarget.getBoundingClientRect();B({left:i.left+i.width/2,top:i.bottom+8}),U(e),T(!0)}else T(!1)},className:"common-item inline-menu-item ".concat($===e.key?"menu-inline-selected":""),children:[null==e?void 0:e.icon,i("span",{children:e.label}),e.childrens&&i(a,{type:"arrowDown",size:12,color:$===e.key?"#339af0":"#666",style:{transform:S&&(null==M?void 0:M.key)===e.key?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease",marginLeft:"4px",opacity:.7}})]}),n<h.length-1&&i(s,{color:"#e1e1e1",orientation:"vertical",style:{height:"24px",margin:"0 4px",alignSelf:"center"}})]},e.key)})})},le={horizontal:function(){return i("div",{className:"idp-menu-item horizontal-menu",id:"idp-horizontal",children:h.map(function(e){return i("div",{className:"horizontal-menu-item",children:t("div",{className:"common-item horizontal-menu-item-content ".concat($===e.key?"menu-".concat(m,"-selected"):""),onClick:function(n){var i;if(void 0===g&&C(e.key),w&&w(e,e.key),e.childrens)if(S&&(null==M?void 0:M.key)===e.key)T(!1),X(!1);else{var t=n.currentTarget.getBoundingClientRect(),o=t.right+1;if("horizontal"===m){var l=document.getElementById("idp-horizontal");o=(null!==(i=null==l?void 0:l.getBoundingClientRect())&&void 0!==i?i:{right:0,top:0}).right+62}B({left:o,top:t.top}),U(e),T(!0)}else T(!1)},children:[null==e?void 0:e.icon,i("span",{children:e.label}),e.childrens&&i(a,{type:"arrowRight",size:16,color:"#666",style:{transform:S&&(null==M?void 0:M.key)===e.key?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s ease"},className:"common-menu-item-icon"})]})},e.key)})})},vertical:function(){return i("div",{className:"idp-menu-item vertical-menu ".concat(x?"collapsed":""),children:h.map(function(e){return t("div",{className:"vertical-menu-item",children:[t("div",{className:"common-item vertical-menu-item-content ".concat($===e.key?"menu-".concat(m,"-selected"):""),"data-title":e.label,onClick:function(){void 0===g&&C(e.key),w&&w(e,e.key),e.childrens&&!x&&ie(e.key)},children:[(null==e?void 0:e.icon)||i("span",{style:{width:"16px",height:"16px",display:"inline-block"},children:e.label.charAt(0)}),i("span",{children:e.label}),e.childrens&&!x&&i(a,{type:L.includes(e.key)?"arrowUp":"arrowDown",size:16,color:"#666",style:{transition:"transform 0.3s ease"},className:"common-menu-item-icon"})]}),e.childrens&&i("div",{className:"sub-menu-container ".concat(L.includes(e.key)?"open":""),children:te(e)})]},e.key)})})},"inline-flex":oe,"inline-block":oe};return i(ne.Provider,{value:ee,children:t("div",{className:"idp-menu ".concat(v||""),style:f,children:[le[m](),S&&M&&M.childrens?i("div","inline-block"===m?{className:"menu-popup ".concat(O?"visible":""),onMouseLeave:function(){T(!1),X(!1)},style:{position:"fixed",left:A.left,top:A.top,transform:"translateX(-50%)",backgroundColor:"white",border:"1px solid #e1e1e1",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",padding:"8px 0",minWidth:"200px",zIndex:1e3},children:i("div",{className:"vertical-menu",children:M.childrens.map(function(e){return t("div",{className:"vertical-menu-item",children:[t("div",{className:"vertical-menu-item-content ".concat($===e.key?"menu-vertical-selected":""),onClick:function(){e.childrens&&e.childrens.length>0?ie(e.key):(void 0===g&&C(e.key),w&&w(e,e.key),T(!1),X(!1))},children:[null==e?void 0:e.icon,i("span",{children:e.label}),e.childrens&&e.childrens.length>0&&i(a,{type:L.includes(e.key)?"arrowUp":"arrowDown",size:12,color:"#666",style:{transition:"transform 0.3s ease"}})]}),e.childrens&&e.childrens.length>0&&i("div",{className:"sub-menu-container ".concat(L.includes(e.key)?"open":""),children:e.childrens.map(function(e){return i("div",{className:"vertical-menu-item",children:t("div",{className:"vertical-menu-item-content ".concat($===e.key?"menu-vertical-selected":""),onClick:function(){void 0===g&&C(e.key),w&&w(e,e.key),T(!1),X(!1)},children:[null==e?void 0:e.icon,i("span",{children:e.label})]})},e.key)})})]},e.key)})})}:{className:"menu-popup ".concat(O?"visible":""),onMouseLeave:function(){"inline-flex"!==m&&"horizontal"!==m||(T(!1),X(!1))},style:{position:"fixed",left:A.left,top:A.top,transform:"translateX(-50%)",backgroundColor:"white",border:"1px solid #e1e1e1",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",padding:"8px 0",minWidth:"120px",zIndex:1e3},children:M.childrens.map(function(e){return t("div",{className:"common-item popup-menu-item popup-menu-item-content ".concat($===e.key?"menu-inline-selected":""," ").concat(e.childrens&&e.childrens.length>0?"has-children":""," ").concat((null==G?void 0:G.key)===e.key&&q?"sub-menu-active":""),onClick:function(){void 0===g&&C(e.key),w&&w(e,e.key),T(!1),X(!1)},onMouseEnter:function(n){if(e.childrens&&e.childrens.length>0){var i=n.currentTarget.getBoundingClientRect();_({left:i.right+1,top:i.top}),H(e),X(!0)}else X(!1)},style:{padding:"8px 16px",cursor:"pointer",transition:"background-color 0.2s ease",color:$===e.key?"#339af0":"#333",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[null==e?void 0:e.icon,i("span",{children:e.label})]}),e.childrens&&e.childrens.length>0&&i(a,{type:"arrowRight",size:12,color:"#666",className:"common-menu-item-icon"})]},e.key)})}):null,q&&G&&G.childrens?i("div",{className:"menu-popup ".concat(Y?"visible":""),onMouseLeave:function(){"inline-flex"===m&&X(!1)},style:{position:"fixed",left:P.left,top:P.top,backgroundColor:"white",border:"1px solid #e1e1e1",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",padding:"8px 0",minWidth:"120px",zIndex:1001},children:G.childrens.map(function(e){return t("div",{className:"popup-menu-item",onClick:function(){void 0===g&&C(e.key),T(!1),X(!1)},style:{padding:"8px 16px",cursor:"pointer",transition:"background-color 0.2s ease",color:$===e.key?"#339af0":"#333"},children:[null==e?void 0:e.icon,i("span",{children:e.label})]},e.key)})}):null,(S||q)&&i("div",{onClick:function(){T(!1),X(!1)}})]})})};export{d as default};
1
+ import{__spreadArray as e}from"../node_modules/tslib/tslib.es6.js";import{jsxs as n,jsx as l,Fragment as o}from"react/jsx-runtime";import t,{useCallback as i,useRef as c,useState as a,useMemo as r,useEffect as d}from"react";import{useClickOutside as s}from"../Hooks/useClickOutside.js";var m=t.memo(function(e){var t,c,a,r=e.item,d=e.level,s=e.mode,u=e.collapsed,p=e.theme,h=e.openKeySet,v=e.selectedKey,f=e.onItemClick,g=e.onToggleOpen,y=!!r.children&&r.children.length>0,k=h.has(r.key),b=v===r.key,N="horizontal"===s,C="inline"===s,K=0===d,z=i(function(e){e.stopPropagation(),r.disabled||(y&&g(r.key),f(r,r.key))},[r,f,g,y]),w=N&&K?16:C?12+24*d:u?0:12+16*d,O=k&&(!u||N),S=y&&(!u||!K),I=p||"light";return n("div",{className:"idp-menu-item-wrapper ".concat(K?"root":""),children:[l("div",{className:"\n idp-menu-item\n ".concat(b?"selected":"","\n ").concat(r.disabled?"disabled":"","\n ").concat(y?"has-children":"","\n ").concat(K?"root":"","\n ").concat(u&&K?"collapsed":"","\n ").concat(s,"\n ").concat(I,"\n "),style:{paddingLeft:w},title:u&&K?r.label:void 0,onClick:z,children:n("div",{className:"idp-menu-item-content",children:[r.icon&&l("span",{className:"idp-menu-item-icon ".concat(u&&K?"collapsed":""),children:r.icon}),(!u||!K)&&l(o,{children:l("span",{className:"idp-menu-item-label",children:r.label})}),u&&K&&!r.icon&&l("span",{className:"idp-menu-item-collapsed-label",children:(c=r.label,a||c.charAt(0).toUpperCase())}),S&&l("span",{className:"idp-menu-item-arrow ".concat(O?"open":""," ").concat(s),children:l("svg",{viewBox:"0 0 1024 1024",width:"10",height:"10",fill:"currentColor",children:l("path",{d:"M840.4 300H183.6c-19.7 0-30.7 25.7-18.5 40.5l328.4 402.4c9.4 11.6 26.7 11.6 36.1 0l328.4-402.4c12.2-14.8 1.2-40.5-18.5-40.5z"})})})]})}),y&&(!N||O)&&l("div",{className:"idp-menu-submenu ".concat(O?N&&K?"open horizontal-popup":C?"open inline":"open":""," ").concat(s," level-").concat(d),children:l("div",{className:"idp-menu-submenu-content",children:null===(t=r.children)||void 0===t?void 0:t.map(function(e){return l(m,{item:e,level:d+1,mode:s,collapsed:u,theme:p,openKeySet:h,selectedKey:v,onItemClick:f,onToggleOpen:g},e.key)})})})]})});m.displayName="MenuItemComponent";var u=function(n){var o=n.mode,t=void 0===o?"vertical":o,u=n.items,p=n.className,h=void 0===p?"":p,v=n.style,f=n.selectedKey,g=n.defaultOpenKeys,y=void 0===g?[]:g,k=n.openKeys,b=n.collapsed,N=void 0!==b&&b,C=n.open,K=n.theme,z=void 0===K?"light":K,w=n.onChange,O=n.onOpenChange,S=c(null),I=a(!0)[0],j=a(y),x=j[0],T=j[1],A=a(""),H=A[0],M=A[1],B=void 0!==k,L=void 0!==f,P=B?k:x,U=L?f:H,_=void 0!==C?C:I,q=r(function(){return new Set(P)},[P]);d(function(){void 0!==f&&M(f)},[f]),d(function(){if(U&&!B&&"horizontal"!==t){var n=function(l,o,t){void 0===t&&(t=[]);for(var i=0,c=l;i<c.length;i++){var a=c[i];if(a.key===o)return t;if(a.children&&a.children.length>0){var r=n(a.children,o,e(e([],t,!0),[a.key],!1));if(r.length>0)return r}}return[]},l=n(u,U);l.length>0&&T(function(n){var o=new Set(e(e([],n,!0),l,!0));return Array.from(o)})}},[U,u,B,t]);var D=i(function(e,n){L||M(n),null==w||w(e,n),"horizontal"===t&&(!e.children||0===e.children.length)&&P.length>0&&(B||T([]),null==O||O([]))},[w,L,t,P.length,B,O]),E=i(function(n){if(B){var l=q.has(n)?P.filter(function(e){return e!==n}):e(e([],P,!0),[n],!1);null==O||O(l)}else T(function(l){var o=l.includes(n)?l.filter(function(e){return e!==n}):e(e([],l,!0),[n],!1);return null==O||O(o),o})},[q,P,B,O]),F="horizontal"!==t&&N;return s(S,i(function(){"horizontal"===t&&P.length>0&&(B||T([]),null==O||O([]))},[t,P.length,B,O])),_?l("div",{ref:S,className:"idp-menu idp-menu-".concat(z," idp-menu-").concat(t," ").concat(F?"collapsed":""," ").concat(h),style:v,role:"menu",children:u.map(function(e){return l(m,{item:e,level:0,mode:t,collapsed:F,theme:z,openKeySet:q,selectedKey:U,onItemClick:D,onToggleOpen:E},e.key)})}):null};export{u as default};
@@ -0,0 +1 @@
1
+ import{__assign as t,__awaiter as o,__generator as i}from"../node_modules/tslib/tslib.es6.js";import{jsx as e,jsxs as n,Fragment as r}from"react/jsx-runtime";import{useState as c,useRef as p,useEffect as a,cloneElement as d}from"react";import{createPortal as l}from"react-dom";import s from"classnames";import f from"../Icon/Icon.js";import m from"../Button/Button.js";var h=function(h){var u=h.title,g=void 0===u?"确认删除吗?":u,v=h.description,b=h.okText,w=void 0===b?"确定":b,B=h.cancelText,T=void 0===B?"取消":B,y=h.okButtonProps,L=void 0===y?{}:y,R=h.cancelButtonProps,k=void 0===R?{}:R,C=h.onConfirm,N=h.onCancel,x=h.disabled,j=void 0!==x&&x,P=h.icon,z=void 0===P?e(f,{type:"warning-circle",size:16,color:"#faad14"}):P,D=h.placement,E=void 0===D?"top":D,I=h.showCancel,H=void 0===I||I,W=h.getContainer,_=void 0===W?function(){return document.body}:W,q=h.className,A=h.style,F=h.children,G=c(!1),J=G[0],K=G[1],M=c(!1),O=M[0],Q=M[1],S=c({top:0,left:0}),U=S[0],V=S[1],X=p(null),Y=p(null),Z={top:"idp-popconfirm-top",bottom:"idp-popconfirm-bottom",left:"idp-popconfirm-left",right:"idp-popconfirm-right",topLeft:"idp-popconfirm-topLeft",topRight:"idp-popconfirm-topRight",bottomLeft:"idp-popconfirm-bottomLeft",bottomRight:"idp-popconfirm-bottomRight",leftTop:"idp-popconfirm-leftTop",leftBottom:"idp-popconfirm-leftBottom",rightTop:"idp-popconfirm-rightTop",rightBottom:"idp-popconfirm-rightBottom"},$=function(t){j||(t&&t.preventDefault&&t.preventDefault(),t&&t.stopPropagation&&t.stopPropagation(),K(!0))},tt=function(){return o(void 0,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:if(!C)return[3,5];Q(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,C()];case 2:return t.sent(),K(!1),[3,4];case 3:return Q(!1),[7];case 4:return[3,6];case 5:K(!1),t.label=6;case 6:return[2]}})})},ot=function(){N&&N(),K(!1)},it=function(t){Y.current&&!Y.current.contains(t.target)&&X.current&&!X.current.contains(t.target)&&K(!1)};a(function(){if(J)return setTimeout(function(){!function(){if(X.current&&Y.current){var t=X.current.getBoundingClientRect(),o=Y.current.getBoundingClientRect(),i=0,e=0;switch(E){case"top":case"topLeft":case"topRight":i=t.top-o.height-8,e=t.left+(t.width-o.width)/2,"topLeft"===E?e=t.left:"topRight"===E&&(e=t.right-o.width);break;case"bottom":case"bottomLeft":case"bottomRight":i=t.bottom+8,e=t.left+(t.width-o.width)/2,"bottomLeft"===E?e=t.left:"bottomRight"===E&&(e=t.right-o.width);break;case"left":case"leftTop":case"leftBottom":i=t.top+(t.height-o.height)/2,e=t.left-o.width-8,"leftTop"===E?i=t.top:"leftBottom"===E&&(i=t.bottom-o.height);break;case"right":case"rightTop":case"rightBottom":i=t.top+(t.height-o.height)/2,e=t.right+8,"rightTop"===E?i=t.top:"rightBottom"===E&&(i=t.bottom-o.height)}var n=window.innerWidth,r=window.innerHeight;e<10&&(e=10),e+o.width>n-10&&(e=n-o.width-10),i<10&&(i=10),i+o.height>r-10&&(i=r-o.height-10),V({top:i,left:e})}}()},0),document.addEventListener("mousedown",it),function(){document.removeEventListener("mousedown",it)}},[J,E]);var et,nt;return n(r,{children:[(et=F,nt=et.props||{},e("span",{ref:X,style:{display:"inline-block"},children:d(et,t(t({},nt),{onClick:$}))})),function(){if(!J)return null;var o=n("div",{ref:Y,className:s("idp-popconfirm",Z[E],q),style:t({position:"fixed",top:"".concat(U.top,"px"),left:"".concat(U.left,"px")},A),children:[e("div",{className:"idp-popconfirm-arrow"}),n("div",{className:"idp-popconfirm-inner",children:[n("div",{className:"idp-popconfirm-header",children:[z&&e("span",{className:"idp-popconfirm-icon",children:z}),e("span",{className:"idp-popconfirm-title",children:g})]}),v&&e("div",{className:"idp-popconfirm-description",children:v}),n("div",{className:"idp-popconfirm-actions",children:[H&&e(m,{variant:k.variant||"secondary",onClick:ot,disabled:k.disabled||O,size:"small",children:T}),e(m,{variant:L.variant||"primary",onClick:tt,loading:L.loading||O,disabled:L.disabled,size:"small",children:w})]})]})]});if(!1===_)return o;var i="function"==typeof _?_():_;return i?l(o,i):o}()]})};export{h as default};
@@ -0,0 +1 @@
1
+ import{jsxs as s,jsx as e}from"react/jsx-runtime";import r from"classnames";import i from"../Icon/Icon.js";var o=function(o){var c=o.percent,t=void 0===c?0:c,n=o.type,a=void 0===n?"line":n,l=o.status,p=o.showInfo,d=void 0===p||p,f=o.format,h=o.strokeColor,u=void 0===h?"#1890ff":h,m=o.trailColor,g=void 0===m?"#f5f5f5":m,v=o.strokeWidth,x=o.size,y=void 0===x?"default":x,k=o.transition,N=void 0===k||k,b=o.icon,w=o.prefix,I=o.suffix,M=o.className,z=o.style,C=l||(t>=100?"success":t<0?"exception":"normal"),W=function(){return f?f(t):"".concat(Math.floor(t),"%")},j=function(){return"success"===C?"#52c41a":"exception"===C?"#ff4d4f":u},D=function(){return b||("success"===C?e(i,{type:"check-circle",style:{color:"#52c41a"}}):"exception"===C?e(i,{type:"close-circle",style:{color:"#ff4d4f"}}):null)};if("circle"===a||"dashboard"===a){var B=50-(v||6),L=2*Math.PI*B,P=L-t/100*L;return s("div",{className:r("idp-progress","idp-progress--circle",M),style:z,children:[s("svg",{width:120,height:120,viewBox:"0 0 120 120",style:{transform:"rotate(-90deg)"},children:[e("circle",{cx:60,cy:60,r:B,stroke:g,strokeWidth:v||6,fill:"none"}),e("circle",{cx:60,cy:60,r:B,stroke:j(),strokeWidth:v||6,fill:"none",strokeDasharray:L,strokeDashoffset:P,strokeLinecap:"round",style:{transition:N?"stroke-dashoffset 0.3s cubic-bezier(0.34, 0.69, 0.1, 1)":"none"}})]}),d&&s("div",{className:"idp-progress-info",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",margin:0},children:[D(),w,W(),I]})]})}return s("div",{className:r("idp-progress","idp-progress--".concat(y),"idp-progress--line",{"idp-progress--success":"success"===C},{"idp-progress--exception":"exception"===C},M),style:z,children:[e("div",{className:"idp-progress-wrapper",children:e("div",{className:"idp-progress-outer",children:e("div",{className:"idp-progress-inner",children:e("div",{className:r("idp-progress-bg",{"idp-progress-bg--success":"success"===C,"idp-progress-bg--exception":"exception"===C}),style:{width:"".concat(Math.min(100,Math.max(0,t)),"%"),backgroundColor:j(),transition:N?"width 0.3s cubic-bezier(0.34, 0.69, 0.1, 1)":"none"}})})})}),d&&s("div",{className:"idp-progress-info",children:[D()&&e("span",{className:"idp-progress-icon",children:D()}),w&&e("span",{className:"idp-progress-prefix",children:w}),e("span",{children:W()}),I&&e("span",{className:"idp-progress-suffix",children:I})]})]})};export{o as default};
@@ -0,0 +1 @@
1
+ import{__assign as r}from"../node_modules/tslib/tslib.es6.js";import{jsx as t}from"react/jsx-runtime";import{useSortable as i}from"@dnd-kit/sortable";import{CSS as e}from"@dnd-kit/utilities";var o=function(o){var a=o.id,n=o.record,s=o.rowIndex,d=o.allColumns,l=o.renderTableCell,m=i({id:a}),f=m.attributes,g=m.listeners,u=m.setNodeRef,c=m.transform,b=m.transition,p=m.isDragging,x={transform:e.Transform.toString(c),transition:b,opacity:p?.5:1,cursor:"grab"};return t("tr",r({ref:u,style:x},f,g,{className:"idp-table-sortable-row ".concat(p?"is-dragging":""),"data-dragging":p,children:d.map(function(r,t){return l(r,n,s,t,d)})}))};export{o as default};
@@ -1 +1 @@
1
- import{__assign as e,__spreadArray as t,__rest as n}from"../node_modules/tslib/tslib.es6.js";import{jsxs as i,jsx as o}from"react/jsx-runtime";import{useState as a,useRef as r,useEffect as l,useMemo as c}from"react";import d from"../Empty/index.js";import s from"../Pagination/index.js";import u from"../Icon/Icon.js";import f from"../Tooltip/Tooltip.js";var p=function(p){var m=p.dataSource,h=void 0===m?[]:m,x=p.columns,v=void 0===x?[]:x,g=p.bordered,b=void 0!==g&&g,y=p.scroll,w=void 0===y?{}:y,k=p.rowKey,N=void 0===k?"key":k,I=p.className,S=void 0===I?"":I,z=p.pagination,C=p.empty,L=p.loading,j=void 0!==L&&L,T=p.loadingText,_=void 0===T?"加载中...":T,A=p.loadingDelay,P=a([]),K=P[0],W=P[1],E=a([]),M=E[0],B=E[1],D=a([]),F=D[0],H=D[1],J=a([]),Q=J[0],X=J[1],Y=a(1),q=Y[0],G=Y[1],O=a(10),R=O[0],U=O[1],V=a(j),Z=V[0],$=V[1],ee=r(null),te=r(null),ne=r(null),ie=r(null),oe=a(null),ae=oe[0],re=oe[1],le=a(""),ce=le[0],de=le[1];l(function(){return ee.current&&(clearTimeout(ee.current),ee.current=null),j&&A&&A>0?($(!0),ee.current=setTimeout(function(){$(!1)},A)):$(j),function(){ee.current&&clearTimeout(ee.current)}},[j,A]),l(function(){z&&"object"==typeof z&&(void 0!==z.current&&G(z.current),void 0!==z.pageSize&&U(z.pageSize))},[z&&"object"==typeof z?z.current:void 0,z&&"object"==typeof z?z.pageSize:void 0]);l(function(){var t=[],n=[],i=[],o=[];v.forEach(function(a,r){var l,c=(l=a.width)?"number"==typeof l?l:parseInt(l,10)||0:0;o[r]=c;var d=e(e({},a),{_index:r});"start"===a.fixed||!0===a.fixed?t.push(d):"end"===a.fixed?n.push(d):i.push(d)}),W(t),B(n),H(i),X(o)},[v]);var se=function(e,t){var n=t||R,i=n!==R?1:e;G(i),U(n),z&&"function"==typeof z.onChange&&z.onChange(i,t)},ue=function(e){return null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(ue).join(""):"object"==typeof e&&e.props&&e.props.children?ue(e.props.children):""},fe=function(){re(null),de("")},pe=function(e,t,n,a,r){var l={width:e.width||"auto",textAlign:e.align||"left",backgroundColor:"white"};if("start"===e.fixed||!0===e.fixed){l.position="sticky";for(var c=0,d=0;d<a;d++)c+=Q[d]||0;l.left="".concat(c,"px"),l.zIndex=5}else if("end"===e.fixed){l.position="sticky";var s=0;for(d=r.length-1;d>a;d--)s+=Q[d]||0;l.right="".concat(s,"px"),l.zIndex=5}var p=K.length?K.length-1:-1,m=M.length?K.length+F.length:-1,h=("start"===e.fixed||!0===e.fixed)&&a===p,x="end"===e.fixed&&a===m,v=e.key||e.dataIndex||e._index,g=(null==ae?void 0:ae.rowIndex)===n&&(null==ae?void 0:ae.colKey)===String(v),b=e.dataIndex?t[e.dataIndex]:null;e.render&&(b=e.render(b,t,n));var y=e.maxLines&&e.maxLines>0,w="";if(e.tooltip&&!g&&!(w=ue(b))&&e.dataIndex&&(w=String(t[e.dataIndex]||"")),e.editable&&g)return o("td",{style:l,className:"".concat(h?"idp-table-fixed-left-shadow":"").concat(x?" idp-table-fixed-right-shadow":""),children:i("div",{className:"idp-table-edit-cell",onClick:function(e){return e.stopPropagation()},children:[o("input",{type:"text",className:"idp-table-edit-input",value:ce,onChange:function(e){return de(e.target.value)},autoFocus:!0,onClick:function(e){return e.stopPropagation()}}),i("div",{className:"idp-table-edit-actions",children:[o("span",{className:"idp-table-edit-icon idp-edit-submit",onClick:function(){return function(e,t){t.onSave&&t.onSave(e,ce),re(null),de("")}(t,e)},title:"保存",children:o(u,{type:"check",size:24,color:"#339af0"})}),o("span",{className:"idp-table-edit-icon idp-edit-cancel",onClick:fe,title:"取消",children:o(u,{type:"close",size:24,color:"#339af0"})})]})]})},e.key||e.dataIndex||e._index);var k=y?o("div",{className:"idp-table-cell-ellipsis",style:{WebkitLineClamp:e.maxLines},children:b}):b,N=w?o(f,{title:w,placement:"top",children:k}):k;return i("td",{style:l,onClick:e.editable?function(){return function(e,t,n){re({rowIndex:e,colKey:t}),de(String(n||""))}(n,String(v),b)}:void 0,className:"".concat(h?"idp-table-fixed-left-shadow":"").concat(x?" idp-table-fixed-right-shadow":"").concat(y?" idp-table-cell-has-ellipsis":"").concat(e.editable?" idp-table-editable-cell":""),children:[N,e.editable&&o("span",{className:"idp-table-edit-icon-wrapper",children:o(u,{type:"edit",size:16,color:"#339af0"})})]},e.key||e.dataIndex||e._index)},me={width:w.x?"number"==typeof w.x?"".concat(w.x,"px"):w.x:"100%"},he={maxHeight:w.y?"number"==typeof w.y?"".concat(w.y,"px"):w.y:"auto",overflowY:w.y?"auto":"visible",overflowX:w.x?"auto":"visible"},xe=t(t(t([],K,!0),F,!0),M,!0),ve=c(function(){return function(e,t){if(void 0===e&&(e=q),void 0===t&&(t=R),!1===z)return null;var n,i=void 0!==(null==z?void 0:z.total)?z.total:h.length,o=Math.ceil(i/t)||1,a=Math.min(e,o);if(void 0!==(null==z?void 0:z.total))n=h;else{var r=(a-1)*t,l=r+t;n=h.slice(r,l)}return{data:n,total:i,pageSize:t,current:a,totalPages:o}}()},[h,z,R,q]),ge=ve?ve.data:h;return i("div",{ref:te,className:"custom-table-container ".concat(b?"bordered":""," ").concat(S),style:me,children:[Z&&o("div",{className:"custom-table-loading-mask",children:i("div",{className:"custom-table-loading-content",children:[o("div",{className:"custom-table-loading-spinner",children:i("svg",{viewBox:"0 0 24 24",className:"custom-table-loading-icon",children:[o("circle",{className:"custom-table-loading-track",cx:"12",cy:"12",r:"10",fill:"none",strokeWidth:"2"}),o("circle",{className:"custom-table-loading-indicator",cx:"12",cy:"12",r:"10",fill:"none",strokeWidth:"2"})]})}),_&&o("div",{className:"custom-table-loading-text",children:_})]})}),o("div",{className:"custom-table-header",ref:ne,onScroll:function(e){if(ne.current&&ie.current){var t=e.target;t===ne.current&&ie.current.scrollLeft!==t.scrollLeft&&(ie.current.scrollLeft=t.scrollLeft)}},children:i("table",{className:"custom-table ".concat(b?"bordered":""),children:[o("colgroup",{children:xe.map(function(e,t){return o("col",{style:{width:e.width||"auto"}},"header-col-".concat(e.dataIndex||e.key||t))})}),o("thead",{children:o("tr",{children:xe.map(function(e,t){return function(e,t,n){var i={width:e.width||"auto",textAlign:e.align||"left",backgroundColor:"#fafafa !important",top:0};if("start"===e.fixed||!0===e.fixed){i.position="sticky";for(var a=0,r=0;r<t;r++)a+=Q[r]||0;i.left="".concat(a,"px"),i.zIndex=10}else if("end"===e.fixed){i.position="sticky";var l=0;for(r=n.length-1;r>t;r--)l+=Q[r]||0;i.right="".concat(l,"px"),i.zIndex=10}return o("th",{style:i,children:e.title||""},e.key||e.dataIndex||e._index)}(e,t,xe)})})})]})}),o("div",{className:"custom-table-body",ref:ie,style:he,onScroll:function(e){if(ne.current&&ie.current){var t=e.target;t===ie.current&&ne.current.scrollLeft!==t.scrollLeft&&(ne.current.scrollLeft=t.scrollLeft)}},children:i("table",{className:"custom-table ".concat(b?"bordered":""),children:[o("colgroup",{children:xe.map(function(e,t){return o("col",{style:{width:e.width||"auto"}},"body-col-".concat(e.dataIndex||e.key||t))})}),o("tbody",{children:ge.map(function(e,t){return o("tr",{children:xe.map(function(n,i){return pe(n,e,t,i,xe)})},function(e,t){return"function"==typeof N?N(e,t):e[N]||t}(e,t))})})]})}),0===ge.length&&o("div",{className:"custom-table-empty",children:C||o(d,{size:"small",description:"暂无数据"})}),function(){if(!1===z||!ve)return null;var t=ve.total,i=ve.current,a=ve.pageSize,r=n(z||{},["onChange","pageSize","current"]);return o("div",{className:"custom-table-pagination-wrapper",children:o(s,e({total:t,current:i,pageSize:a,onChange:se,showTotal:function(e,t){return"第 ".concat(t[0],"-").concat(t[1]," 条,共 ").concat(e," 条")},showSizeChanger:!0,showQuickJumper:!0,align:"flex-end"},r))})}()]})};export{p as default};
1
+ import{__assign as e,__spreadArray as t,__rest as n}from"../node_modules/tslib/tslib.es6.js";import{jsxs as i,jsx as o}from"react/jsx-runtime";import{useState as r,useRef as a,useEffect as l,useMemo as c}from"react";import{useSensors as d,useSensor as s,PointerSensor as u,KeyboardSensor as f,DndContext as p,closestCenter as m}from"@dnd-kit/core";import{sortableKeyboardCoordinates as h,SortableContext as g,verticalListSortingStrategy as v,arrayMove as x}from"@dnd-kit/sortable";import b from"../Empty/index.js";import y from"../Pagination/index.js";import w from"../Icon/Icon.js";import k from"./SortableRow.js";import S from"../Tooltip/Tooltip.js";var N=function(N){var C=N.dataSource,I=void 0===C?[]:C,z=N.columns,j=void 0===z?[]:z,L=N.bordered,T=void 0!==L&&L,E=N.scroll,_=void 0===E?{}:E,A=N.rowKey,D=void 0===A?"key":A,P=N.className,W=void 0===P?"":P,K=N.pagination,M=N.empty,R=N.loading,V=void 0!==R&&R,B=N.loadingText,F=void 0===B?"加载中...":B,G=N.loadingDelay,H=N.draggable,J=void 0!==H&&H,Q=N.onDragEnd,X=r([]),Y=X[0],q=X[1],O=r([]),U=O[0],Z=O[1],$=r([]),ee=$[0],te=$[1],ne=r([]),ie=ne[0],oe=ne[1],re=r(1),ae=re[0],le=re[1],ce=r(10),de=ce[0],se=ce[1],ue=r(V),fe=ue[0],pe=ue[1],me=r(I),he=me[0],ge=me[1],ve=a(null),xe=a(null),be=a(null),ye=a(null),we=r(null),ke=we[0],Se=we[1],Ne=r(""),Ce=Ne[0],Ie=Ne[1];l(function(){ge(I)},[I]),l(function(){return ve.current&&(clearTimeout(ve.current),ve.current=null),V&&G&&G>0?(pe(!0),ve.current=setTimeout(function(){pe(!1)},G)):pe(V),function(){ve.current&&clearTimeout(ve.current)}},[V,G]),l(function(){K&&"object"==typeof K&&(void 0!==K.current&&le(K.current),void 0!==K.pageSize&&se(K.pageSize))},[K&&"object"==typeof K?K.current:void 0,K&&"object"==typeof K?K.pageSize:void 0]);l(function(){var t=[],n=[],i=[],o=[];j.forEach(function(r,a){var l,c=(l=r.width)?"number"==typeof l?l:parseInt(l,10)||0:0;o[a]=c;var d=e(e({},r),{_index:a});"start"===r.fixed||!0===r.fixed?t.push(d):"end"===r.fixed?n.push(d):i.push(d)}),q(t),Z(n),te(i),oe(o)},[j]);var ze=function(e,t){var n=t||de,i=n!==de?1:e;le(i),se(n),K&&"function"==typeof K.onChange&&K.onChange(i,t)},je=function(e,t){if(void 0===e&&(e=ae),void 0===t&&(t=de),!1===K)return null;var n,i=void 0!==(null==K?void 0:K.total)?K.total:he.length,o=Math.ceil(i/t)||1,r=Math.min(e,o);if(void 0!==(null==K?void 0:K.total))n=he;else{var a=(r-1)*t,l=a+t;n=he.slice(a,l)}return{data:n,total:i,pageSize:t,current:r,totalPages:o}},Le=function(e,t){return"function"==typeof D?D(e,t):e[D]||t},Te=function(e){return null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Te).join(""):"object"==typeof e&&e.props&&e.props.children?Te(e.props.children):""},Ee=function(e,t,n){Se({rowIndex:e,colKey:t}),Ie(String(n||""))},_e=function(e,t){t.onSave&&t.onSave(e,Ce),Se(null),Ie("")},Ae=function(){Se(null),Ie("")},De=function(e,t,n,r,a){var l={width:e.width||"auto",textAlign:e.align||"left",backgroundColor:"white"};if("start"===e.fixed||!0===e.fixed){l.position="sticky";for(var c=0,d=0;d<r;d++)c+=ie[d]||0;l.left="".concat(c,"px"),l.zIndex=5}else if("end"===e.fixed){l.position="sticky";var s=0;for(d=a.length-1;d>r;d--)s+=ie[d]||0;l.right="".concat(s,"px"),l.zIndex=5}var u=Y.length?Y.length-1:-1,f=U.length?Y.length+ee.length:-1,p=("start"===e.fixed||!0===e.fixed)&&r===u,m="end"===e.fixed&&r===f,h=e.key||e.dataIndex||e._index,g=(null==ke?void 0:ke.rowIndex)===n&&(null==ke?void 0:ke.colKey)===String(h),v=e.dataIndex?t[e.dataIndex]:null;e.render&&(v=e.render(v,t,n));var x=e.maxLines&&e.maxLines>0,b="";if(e.tooltip&&!g&&!(b=Te(v))&&e.dataIndex&&(b=String(t[e.dataIndex]||"")),e.editable&&g)return o("td",{style:l,className:"".concat(p?"idp-table-fixed-left-shadow":"").concat(m?" idp-table-fixed-right-shadow":""),children:i("div",{className:"idp-table-edit-cell",onClick:function(e){return e.stopPropagation()},children:[o("input",{type:"text",className:"idp-table-edit-input",value:Ce,onChange:function(e){return Ie(e.target.value)},autoFocus:!0,onClick:function(e){return e.stopPropagation()}}),i("div",{className:"idp-table-edit-actions",children:[o("span",{className:"idp-table-edit-icon idp-edit-submit",onClick:function(){return _e(t,e)},title:"保存",children:o(w,{type:"check",size:24,color:"#339af0"})}),o("span",{className:"idp-table-edit-icon idp-edit-cancel",onClick:Ae,title:"取消",children:o(w,{type:"close",size:24,color:"#339af0"})})]})]})},e.key||e.dataIndex||e._index);var y=x?o("div",{className:"idp-table-cell-ellipsis",style:{WebkitLineClamp:e.maxLines},children:v}):v,k=b?o(S,{title:b,placement:"top",children:y}):y;return i("td",{style:l,onClick:e.editable?function(){return Ee(n,String(h),v)}:void 0,className:"".concat(p?"idp-table-fixed-left-shadow":"").concat(m?" idp-table-fixed-right-shadow":"").concat(x?" idp-table-cell-has-ellipsis":"").concat(e.editable?" idp-table-editable-cell":""),children:[k,e.editable&&o("span",{className:"idp-table-edit-icon-wrapper",children:o(w,{type:"edit",size:16,color:"#339af0"})})]},e.key||e.dataIndex||e._index)},Pe=d(s(u,{activationConstraint:{distance:8}}),s(f,{coordinateGetter:h})),We=function(e){var n=e.active,i=e.over;if(i&&n.id!==i.id){var o=je(),r=o?o.data:he,a=r.findIndex(function(e,t){return String(Le(e,t))===String(n.id)}),l=r.findIndex(function(e,t){return String(Le(e,t))===String(i.id)});if(-1!==a&&-1!==l){var c=x(r,a,l);if(o&&K&&"object"==typeof K&&void 0===K.total){var d=(o.current-1)*o.pageSize,s=t([],he,!0);c.forEach(function(e,t){s[d+t]=e}),ge(s),Q&&Q(s)}else ge(c),Q&&Q(c)}}},Ke={width:_.x?"number"==typeof _.x?"".concat(_.x,"px"):_.x:"100%"},Me={maxHeight:_.y?"number"==typeof _.y?"".concat(_.y,"px"):_.y:"auto",overflowY:_.y?"auto":"visible",overflowX:_.x?"auto":"visible"},Re=t(t(t([],Y,!0),ee,!0),U,!0),Ve=c(function(){return je()},[he,K,de,ae]),Be=Ve?Ve.data:he;return i("div",{ref:xe,className:"custom-table-container ".concat(T?"bordered":""," ").concat(W," ").concat(J?"draggable":""),style:Ke,children:[fe&&o("div",{className:"custom-table-loading-mask",children:i("div",{className:"custom-table-loading-content",children:[o("div",{className:"custom-table-loading-spinner",children:i("svg",{viewBox:"0 0 24 24",className:"custom-table-loading-icon",children:[o("circle",{className:"custom-table-loading-track",cx:"12",cy:"12",r:"10",fill:"none",strokeWidth:"2"}),o("circle",{className:"custom-table-loading-indicator",cx:"12",cy:"12",r:"10",fill:"none",strokeWidth:"2"})]})}),F&&o("div",{className:"custom-table-loading-text",children:F})]})}),o("div",{className:"custom-table-header",ref:be,onScroll:function(e){if(be.current&&ye.current){var t=e.target;t===be.current&&ye.current.scrollLeft!==t.scrollLeft&&(ye.current.scrollLeft=t.scrollLeft)}},children:i("table",{className:"custom-table ".concat(T?"bordered":""),children:[o("colgroup",{children:Re.map(function(e,t){return o("col",{style:{width:e.width||"auto"}},"header-col-".concat(e.dataIndex||e.key||t))})}),o("thead",{children:o("tr",{children:Re.map(function(e,t){return function(e,t,n){var i={width:e.width||"auto",textAlign:e.align||"left",backgroundColor:"#fafafa !important",top:0};if("start"===e.fixed||!0===e.fixed){i.position="sticky";for(var r=0,a=0;a<t;a++)r+=ie[a]||0;i.left="".concat(r,"px"),i.zIndex=10}else if("end"===e.fixed){i.position="sticky";var l=0;for(a=n.length-1;a>t;a--)l+=ie[a]||0;i.right="".concat(l,"px"),i.zIndex=10}return o("th",{style:i,children:e.title||""},e.key||e.dataIndex||e._index)}(e,t,Re)})})})]})}),o("div",{className:"custom-table-body",ref:ye,style:Me,onScroll:function(e){if(be.current&&ye.current){var t=e.target;t===ye.current&&be.current.scrollLeft!==t.scrollLeft&&(be.current.scrollLeft=t.scrollLeft)}},children:function(){var e=i("table",{className:"custom-table ".concat(T?"bordered":""),children:[o("colgroup",{children:Re.map(function(e,t){return o("col",{style:{width:e.width||"auto"}},"body-col-".concat(e.dataIndex||e.key||t))})}),o("tbody",{children:J?Be.map(function(e,t){return o(k,{id:String(Le(e,t)),record:e,rowIndex:t,columns:j,columnWidths:ie,fixedLeftColumns:Y,fixedRightColumns:U,normalColumns:ee,allColumns:Re,editingCell:ke,editingValue:Ce,handleEdit:Ee,handleSave:_e,handleCancel:Ae,setEditingValue:Ie,renderTableCell:De},Le(e,t))}):Be.map(function(e,t){return o("tr",{children:Re.map(function(n,i){return De(n,e,t,i,Re)})},Le(e,t))})})]});if(J){var t=Be.map(function(e,t){return String(Le(e,t))});return o(p,{sensors:Pe,collisionDetection:m,onDragEnd:We,children:o(g,{items:t,strategy:v,children:e})})}return e}()}),0===Be.length&&o("div",{className:"custom-table-empty",children:M||o(b,{size:"small",description:"暂无数据"})}),function(){if(!1===K||!Ve)return null;var t=Ve.total,i=Ve.current,r=Ve.pageSize,a=n(K||{},["onChange","pageSize","current"]);return o("div",{className:"custom-table-pagination-wrapper",children:o(y,e({total:t,current:i,pageSize:r,onChange:ze,showTotal:function(e,t){return"第 ".concat(t[0],"-").concat(t[1]," 条,共 ").concat(e," 条")},showSizeChanger:!0,showQuickJumper:!0,align:"flex-end"},a))})}()]})};export{N as default};
@@ -0,0 +1 @@
1
+ import{__rest as o,__assign as l}from"../node_modules/tslib/tslib.es6.js";import{jsxs as a,jsx as e}from"react/jsx-runtime";import c,{useState as n}from"react";import r from"classnames";import s from"../Icon/Icon.js";var i=c.forwardRef(function(c,i){var t=c.children,d=c.className,p=c.style,m=c.size,u=void 0===m?"medium":m,g=c.backgroundColor,f=c.color,b=c.icon,C=c.closable,_=void 0!==C&&C,k=c.onClose,N=c.onClick,h=o(c,["children","className","style","size","backgroundColor","color","icon","closable","onClose","onClick"]),y=n(!0),v=y[0],j=y[1];if(!v)return null;var x=r("idp-tag","idp-tag--".concat(u),{"idp-tag--clickable":N,"idp-tag--closable":_},d),I=l({backgroundColor:g,color:f},p);return a("span",l({ref:i,className:x,style:I,onClick:N},h,{children:[b?e("span","string"==typeof b?{className:"idp-tag__icon",children:e(s,{type:b})}:{className:"idp-tag__icon",children:b}):null,e("span",{className:"idp-tag__content",children:t}),_&&e("span",{className:"idp-tag__close",onClick:function(o){o.stopPropagation(),null==k||k(o),j(!1)},role:"button",tabIndex:0,"aria-label":"close",children:e(s,{type:"close"})})]}))});i.displayName="Tag";var t=i;export{t as default};