denwa-react-shared 1.0.21 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-C9_FuY9g.cjs"),A=require("react");function ue(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,o.get?o:{enumerable:!0,get:()=>e[a]})}}return n.default=e,Object.freeze(n)}const i=ue(A);var U=function(e,n){if(!e)return null;var a={left:e.offsetLeft,right:e.parentElement.clientWidth-e.clientWidth-e.offsetLeft,width:e.clientWidth,top:e.offsetTop,bottom:e.parentElement.clientHeight-e.clientHeight-e.offsetTop,height:e.clientHeight};return n?{left:0,right:0,width:0,top:a.top,bottom:a.bottom,height:a.height}:{left:a.left,right:a.right,width:a.width,top:0,bottom:0,height:0}},H=function(e){return e!==void 0?"".concat(e,"px"):void 0};function me(e){var n=e.prefixCls,a=e.containerRef,o=e.value,r=e.getValueIndex,l=e.motionName,p=e.onMotionStart,h=e.onMotionEnd,f=e.direction,S=e.vertical,s=S===void 0?!1:S,w=i.useRef(null),$=i.useState(o),C=t.Fe($,2),v=C[0],M=C[1],E=function(d){var j,m=r(d),B=(j=a.current)===null||j===void 0?void 0:j.querySelectorAll(".".concat(n,"-item"))[m];return(B==null?void 0:B.offsetParent)&&B},k=i.useState(null),g=t.Fe(k,2),c=g[0],N=g[1],P=i.useState(null),x=t.Fe(P,2),u=x[0],R=x[1];t.ur(function(){if(v!==o){var d=E(v),j=E(o),m=U(d,s),B=U(j,s);M(o),N(m),R(B),d&&j?p():h()}},[o]);var y=i.useMemo(function(){if(s){var d;return H((d=c==null?void 0:c.top)!==null&&d!==void 0?d:0)}return H(f==="rtl"?-(c==null?void 0:c.right):c==null?void 0:c.left)},[s,f,c]),O=i.useMemo(function(){if(s){var d;return H((d=u==null?void 0:u.top)!==null&&d!==void 0?d:0)}return H(f==="rtl"?-(u==null?void 0:u.right):u==null?void 0:u.left)},[s,f,u]),I=function(){return s?{transform:"translateY(var(--thumb-start-top))",height:"var(--thumb-start-height)"}:{transform:"translateX(var(--thumb-start-left))",width:"var(--thumb-start-width)"}},T=function(){return s?{transform:"translateY(var(--thumb-active-top))",height:"var(--thumb-active-height)"}:{transform:"translateX(var(--thumb-active-left))",width:"var(--thumb-active-width)"}},V=function(){N(null),R(null),h()};return!c||!u?null:i.createElement(t.ks,{visible:!0,motionName:l,motionAppear:!0,onAppearStart:I,onAppearActive:T,onVisibleChanged:V},function(d,j){var m=d.className,B=d.style,z=t.Ee(t.Ee({},B),{},{"--thumb-start-left":y,"--thumb-start-width":H(c==null?void 0:c.width),"--thumb-active-left":O,"--thumb-active-width":H(u==null?void 0:u.width),"--thumb-start-top":y,"--thumb-start-height":H(c==null?void 0:c.height),"--thumb-active-top":O,"--thumb-active-height":H(u==null?void 0:u.height)}),F={ref:t.Ki(w,j),style:z,className:t.Be("".concat(n,"-thumb"),m)};return process.env.NODE_ENV==="test"&&(F["data-test-style"]=JSON.stringify(z)),i.createElement("div",F)})}var he=["prefixCls","direction","vertical","options","disabled","defaultValue","value","name","onChange","className","motionName"];function ge(e){if(typeof e.title<"u")return e.title;if(t.hn(e.label)!=="object"){var n;return(n=e.label)===null||n===void 0?void 0:n.toString()}}function be(e){return e.map(function(n){if(t.hn(n)==="object"&&n!==null){var a=ge(n);return t.Ee(t.Ee({},n),{},{title:a})}return{label:n==null?void 0:n.toString(),title:n==null?void 0:n.toString(),value:n}})}var fe=function(e){var n=e.prefixCls,a=e.className,o=e.disabled,r=e.checked,l=e.label,p=e.title,h=e.value,f=e.name,S=e.onChange,s=e.onFocus,w=e.onBlur,$=e.onKeyDown,C=e.onKeyUp,v=e.onMouseDown,M=function(E){o||S(E,h)};return i.createElement("label",{className:t.Be(a,t.be({},"".concat(n,"-item-disabled"),o)),onMouseDown:v},i.createElement("input",{name:f,className:"".concat(n,"-item-input"),type:"radio",disabled:o,checked:r,onChange:M,onFocus:s,onBlur:w,onKeyDown:$,onKeyUp:C}),i.createElement("div",{className:"".concat(n,"-item-label"),title:p,"aria-selected":r},l))},Q=i.forwardRef(function(e,n){var a,o,r=e.prefixCls,l=r===void 0?"rc-segmented":r,p=e.direction,h=e.vertical,f=e.options,S=f===void 0?[]:f,s=e.disabled,w=e.defaultValue,$=e.value,C=e.name,v=e.onChange,M=e.className,E=M===void 0?"":M,k=e.motionName,g=k===void 0?"thumb-motion":k,c=t.Mn(e,he),N=i.useRef(null),P=i.useMemo(function(){return t.Ki(N,n)},[N,n]),x=i.useMemo(function(){return be(S)},[S]),u=t.fo((a=x[0])===null||a===void 0?void 0:a.value,{value:$,defaultValue:w}),R=t.Fe(u,2),y=R[0],O=R[1],I=i.useState(!1),T=t.Fe(I,2),V=T[0],d=T[1],j=function(b,D){O(D),v==null||v(D)},m=t.Po(c,["children"]),B=i.useState(!1),z=t.Fe(B,2),F=z[0],q=z[1],ne=i.useState(!1),X=t.Fe(ne,2),oe=X[0],J=X[1],ae=function(){J(!0)},ie=function(){J(!1)},re=function(){q(!1)},le=function(b){b.key==="Tab"&&q(!0)},K=function(b){var D=x.findIndex(function(de){return de.value===y}),_=x.length,ce=(D+b+_)%_,L=x[ce];L&&(O(L.value),v==null||v(L.value))},se=function(b){switch(b.key){case"ArrowLeft":case"ArrowUp":K(-1);break;case"ArrowRight":case"ArrowDown":K(1);break}};return i.createElement("div",t.bt({role:"radiogroup","aria-label":"segmented control",tabIndex:s?void 0:0},m,{className:t.Be(l,(o={},t.be(o,"".concat(l,"-rtl"),p==="rtl"),t.be(o,"".concat(l,"-disabled"),s),t.be(o,"".concat(l,"-vertical"),h),o),E),ref:P}),i.createElement("div",{className:"".concat(l,"-group")},i.createElement(me,{vertical:h,prefixCls:l,value:y,containerRef:N,motionName:"".concat(l,"-").concat(g),direction:p,getValueIndex:function(b){return x.findIndex(function(D){return D.value===b})},onMotionStart:function(){d(!0)},onMotionEnd:function(){d(!1)}}),x.map(function(b){var D;return i.createElement(fe,t.bt({},b,{name:C,key:b.value,prefixCls:l,className:t.Be(b.className,"".concat(l,"-item"),(D={},t.be(D,"".concat(l,"-item-selected"),b.value===y&&!V),t.be(D,"".concat(l,"-item-focused"),oe&&F&&b.value===y),D)),checked:b.value===y,onChange:j,onFocus:ae,onBlur:ie,onKeyDown:se,onKeyUp:le,onMouseDown:re,disabled:!!s||!!b.disabled}))})))});process.env.NODE_ENV!=="production"&&(Q.displayName="Segmented");var pe=Q;function Y(e,n){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:n.colorTextDisabled,cursor:"not-allowed"}}}function G(e){return{backgroundColor:e.itemSelectedBg,boxShadow:e.boxShadowTertiary}}const ve=Object.assign({overflow:"hidden"},t.Al),xe=e=>{const{componentCls:n}=e,a=e.calc(e.controlHeight).sub(e.calc(e.trackPadding).mul(2)).equal(),o=e.calc(e.controlHeightLG).sub(e.calc(e.trackPadding).mul(2)).equal(),r=e.calc(e.controlHeightSM).sub(e.calc(e.trackPadding).mul(2)).equal();return{[n]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},t.uo(e)),{display:"inline-block",padding:e.trackPadding,color:e.itemColor,background:e.trackBg,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`}),t.Rc(e)),{[`${n}-group`]:{position:"relative",display:"flex",alignItems:"stretch",justifyItems:"flex-start",flexDirection:"row",width:"100%"},[`&${n}-rtl`]:{direction:"rtl"},[`&${n}-vertical`]:{[`${n}-group`]:{flexDirection:"column"},[`${n}-thumb`]:{width:"100%",height:0,padding:`0 ${t.De(e.paddingXXS)}`}},[`&${n}-block`]:{display:"flex"},[`&${n}-block ${n}-item`]:{flex:1,minWidth:0},[`${n}-item`]:{position:"relative",textAlign:"center",cursor:"pointer",transition:`color ${e.motionDurationMid} ${e.motionEaseInOut}`,borderRadius:e.borderRadiusSM,transform:"translateZ(0)","&-selected":Object.assign(Object.assign({},G(e)),{color:e.itemSelectedColor}),"&-focused":Object.assign({},t.Su(e)),"&::after":{content:'""',position:"absolute",zIndex:-1,width:"100%",height:"100%",top:0,insetInlineStart:0,borderRadius:"inherit",opacity:0,transition:`opacity ${e.motionDurationMid}`,pointerEvents:"none"},[`&:hover:not(${n}-item-selected):not(${n}-item-disabled)`]:{color:e.itemHoverColor,"&::after":{opacity:1,backgroundColor:e.itemHoverBg}},[`&:active:not(${n}-item-selected):not(${n}-item-disabled)`]:{color:e.itemHoverColor,"&::after":{opacity:1,backgroundColor:e.itemActiveBg}},"&-label":Object.assign({minHeight:a,lineHeight:t.De(a),padding:`0 ${t.De(e.segmentedPaddingHorizontal)}`},ve),"&-icon + *":{marginInlineStart:e.calc(e.marginSM).div(2).equal()},"&-input":{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:"none"}},[`${n}-thumb`]:Object.assign(Object.assign({},G(e)),{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:"100%",padding:`${t.De(e.paddingXXS)} 0`,borderRadius:e.borderRadiusSM,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, height ${e.motionDurationSlow} ${e.motionEaseInOut}`,[`& ~ ${n}-item:not(${n}-item-selected):not(${n}-item-disabled)::after`]:{backgroundColor:"transparent"}}),[`&${n}-lg`]:{borderRadius:e.borderRadiusLG,[`${n}-item-label`]:{minHeight:o,lineHeight:t.De(o),padding:`0 ${t.De(e.segmentedPaddingHorizontal)}`,fontSize:e.fontSizeLG},[`${n}-item, ${n}-thumb`]:{borderRadius:e.borderRadius}},[`&${n}-sm`]:{borderRadius:e.borderRadiusSM,[`${n}-item-label`]:{minHeight:r,lineHeight:t.De(r),padding:`0 ${t.De(e.segmentedPaddingHorizontalSM)}`},[`${n}-item, ${n}-thumb`]:{borderRadius:e.borderRadiusXS}}}),Y(`&-disabled ${n}-item`,e)),Y(`${n}-item-disabled`,e)),{[`${n}-thumb-motion-appear-active`]:{transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, width ${e.motionDurationSlow} ${e.motionEaseInOut}`,willChange:"transform, width"},[`&${n}-shape-round`]:{borderRadius:9999,[`${n}-item, ${n}-thumb`]:{borderRadius:9999}}})}},Se=e=>{const{colorTextLabel:n,colorText:a,colorFillSecondary:o,colorBgElevated:r,colorFill:l,lineWidthBold:p,colorBgLayout:h}=e;return{trackPadding:p,trackBg:h,itemColor:n,itemHoverColor:a,itemHoverBg:o,itemSelectedBg:r,itemActiveBg:l,itemSelectedColor:a}},ye=t.Jr("Segmented",e=>{const{lineWidth:n,calc:a}=e,o=t.gr(e,{segmentedPaddingHorizontal:a(e.controlPaddingHorizontal).sub(n).equal(),segmentedPaddingHorizontalSM:a(e.controlPaddingHorizontalSM).sub(n).equal()});return[xe(o)]},Se);var Z=function(e,n){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(a[o[r]]=e[o[r]]);return a};function we(e){return typeof e=="object"&&!!(e!=null&&e.icon)}const $e=i.forwardRef((e,n)=>{const a=t.PL(),{prefixCls:o,className:r,rootClassName:l,block:p,options:h=[],size:f="middle",style:S,vertical:s,shape:w="default",name:$=a}=e,C=Z(e,["prefixCls","className","rootClassName","block","options","size","style","vertical","shape","name"]),{getPrefixCls:v,direction:M,className:E,style:k}=t._s("segmented"),g=v("segmented",o),[c,N,P]=ye(g),x=t.Oi(f),u=i.useMemo(()=>h.map(O=>{if(we(O)){const{icon:I,label:T}=O,V=Z(O,["icon","label"]);return Object.assign(Object.assign({},V),{label:i.createElement(i.Fragment,null,i.createElement("span",{className:`${g}-item-icon`},I),T&&i.createElement("span",null,T))})}return O}),[h,g]),R=t.Be(r,l,E,{[`${g}-block`]:p,[`${g}-sm`]:x==="small",[`${g}-lg`]:x==="large",[`${g}-vertical`]:s,[`${g}-shape-${w}`]:w==="round"},N,P),y=Object.assign(Object.assign({},k),S);return c(i.createElement(pe,Object.assign({},C,{name:$,className:R,style:y,options:u,ref:n,prefixCls:g,direction:M,vertical:s})))}),ee=$e;process.env.NODE_ENV!=="production"&&(ee.displayName="Segmented");var Ce={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"}}]},name:"redo",theme:"outlined"};function W(){return W=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e},W.apply(this,arguments)}const Oe=(e,n)=>i.createElement(t.Ni,W({},e,{ref:n,icon:Ce})),te=i.forwardRef(Oe);process.env.NODE_ENV!=="production"&&(te.displayName="RedoOutlined");const je=({datePickerComponent:e,searchText:n,noDateText:a,emptyText:o,searchSelect:r,radioOptions:l,searchOptions:p,searchType:h,textSearchValue:f="",dateSearchValue:S,numberSearchValue:s,multiselectSearchValue:w,multiselectOptions:$,onChangeSearch:C,onChangeTextSearch:v,onChangeRadioSearch:M,onChangeDateSearch:E,onChangeNumberSearch:k,onChangeMultiselectSearch:g})=>{const[c,N]=A.useState(f),{token:{borderRadius:P,colorBgBase:x,paddingXXS:u}}=t.wIt.useToken(),{isMobileMaxWidth:R}=t.een(),{isSmallMaxWidth:y}=t.ten(),O=A.useMemo(()=>y?2:R?5:15,[R,y]);t.IJt(()=>{v==null||v(c)},t.JJt.milliseconds.milliseconds500,[c]);const I=()=>{N("")},T=m=>{C(m),I()},V=m=>{N(m.target.value.replace(/"/g,""))},d=m=>{E==null||E(m)},j=m=>{!m&&m!==0||k==null||k(+m)};return t.ed.jsxs(t.d2t,{className:t.ien.flex,gap:"small",style:{padding:u,borderRadius:P,background:x},children:[t.ed.jsx(t.ig,{defaultValue:r,value:r,style:{width:120,minWidth:120},options:p,onChange:T}),{text:t.ed.jsx(t.jw,{placeholder:n,value:c,allowClear:!0,onChange:V}),radio:t.ed.jsx(ee,{options:l,defaultValue:t.RJt,onChange:M}),date:A.cloneElement(e,{noDateText:a,currentValue:S??"",onChangeDate:d}),number:t.ed.jsx(t.oen,{emptyText:o,value:s,placeholder:n,min:0,max:2147483647,onChange:j}),multiselect:t.ed.jsx(t.ig,{className:t.ien.select,mode:"multiple",placeholder:n,maxTagCount:1,maxTagTextLength:O,showSearch:!1,allowClear:!0,options:$,value:w,onChange:g})}[h]]})},Ee=({sortTooltipText:e,updateDataText:n,refreshText:a,createText:o,createNewElementText:r,order:l,orderOptions:p,createButtonTooltip:h,searchProps:f,isCanCreate:S,isHiddenCreate:s,onCreate:w,onRefetch:$,onChangeOrder:C})=>t.ed.jsxs(t.d2t,{gap:"middle",justify:"space-between",wrap:"wrap",style:{marginBottom:t.e4.OFFSET[1]},children:[t.ed.jsxs(t.d2t,{align:"center",gap:"middle",wrap:"wrap",children:[t.ed.jsx(je,{...f}),t.ed.jsx(t.Mc,{title:e,children:t.ed.jsx(t.ig,{className:t.ien.sort,value:l,options:p,onChange:C})})]}),t.ed.jsxs(t.d2t,{className:t.ien.buttonsContainer,gap:"small",align:"center",children:[$&&t.ed.jsx(t.Mc,{title:n,children:t.ed.jsx(t.Es,{className:t.ien.button,icon:t.ed.jsx(te,{}),onClick:$,children:a})}),!s&&S&&t.ed.jsx(t.Mc,{title:h??r,children:t.ed.jsx(t.Es,{className:t.ien.button,type:"primary",icon:t.ed.jsx(t.yPt,{}),onClick:w,children:o})})]})]});exports.TableHead=Ee;