ysyt-react-agent-lib 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { default as YsytBarPhone } from './es/YsytBarPhone';
2
+ export { makeCall as YsytMakeCall } from './es/YsytBarPhone/globalPhoneMethods';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BgOW05N2.js");exports.YsytBarPhone=e.YsytBarPhone;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-C4ov1ntc.js");exports.YsytBarPhone=e.YsytBarPhone;exports.YsytMakeCall=e.makeCall;
@@ -1,4 +1,5 @@
1
- import { ao as r } from "./index-rDsuHieQ.mjs";
1
+ import { ao as s, ap as e } from "./index-DR5IRftL.mjs";
2
2
  export {
3
- r as YsytBarPhone
3
+ s as YsytBarPhone,
4
+ e as YsytMakeCall
4
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ysyt-react-agent-lib",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "",
5
5
  "main": "dist/ysyt-react-agent-lib.cjs.js",
6
6
  "module": "dist/ysyt-react-agent-lib.es.js",
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "antd": "5.24.0",
31
31
  "styled-components": "^6.1.13",
32
- "ysyt-agent-sdk": "1.0.61"
32
+ "ysyt-agent-sdk": "1.0.64"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": "^18.2.0",
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-BgOW05N2.js"),j=require("react"),A=require("./index-BRDd3kLq.js");function J(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const t=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,t.get?t:{enumerable:!0,get:()=>e[i]})}}return n.default=e,Object.freeze(n)}const a=J(j),H=a.createContext(null),K=H.Provider,W=a.createContext(null),Q=W.Provider;var Z=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],ee=j.forwardRef(function(e,n){var i=e.prefixCls,t=i===void 0?"rc-checkbox":i,o=e.className,l=e.style,C=e.checked,g=e.disabled,d=e.defaultChecked,$=d===void 0?!1:d,f=e.type,s=f===void 0?"checkbox":f,O=e.title,k=e.onChange,w=r._objectWithoutProperties(e,Z),x=j.useRef(null),u=j.useRef(null),R=r.useMergedState($,{value:C}),h=r._slicedToArray(R,2),S=h[0],y=h[1];j.useImperativeHandle(n,function(){return{focus:function(v){var b;(b=x.current)===null||b===void 0||b.focus(v)},blur:function(){var v;(v=x.current)===null||v===void 0||v.blur()},input:x.current,nativeElement:u.current}});var P=r.classNames(t,o,r._defineProperty(r._defineProperty({},"".concat(t,"-checked"),S),"".concat(t,"-disabled"),g)),c=function(v){g||("checked"in e||y(v.target.checked),k==null||k({target:r._objectSpread2(r._objectSpread2({},e),{},{type:s,checked:v.target.checked}),stopPropagation:function(){v.stopPropagation()},preventDefault:function(){v.preventDefault()},nativeEvent:v.nativeEvent}))};return a.createElement("span",{className:P,title:O,style:l,ref:u},a.createElement("input",r._extends({},w,{className:"".concat(t,"-input"),ref:x,onChange:c,disabled:g,checked:!!S,type:s})),a.createElement("span",{className:"".concat(t,"-inner")}))});function te(e){const n=j.useRef(null),i=()=>{r.wrapperRaf.cancel(n.current),n.current=null};return[()=>{i(),n.current=r.wrapperRaf(()=>{n.current=null})},l=>{n.current&&(l.stopPropagation(),i()),e==null||e(l)}]}const oe=e=>{const{componentCls:n,antCls:i}=e,t=`${n}-group`;return{[t]:Object.assign(Object.assign({},r.resetComponent(e)),{display:"inline-block",fontSize:0,[`&${t}-rtl`]:{direction:"rtl"},[`&${t}-block`]:{display:"flex"},[`${i}-badge ${i}-badge-count`]:{zIndex:1},[`> ${i}-badge:not(:first-child) > ${i}-button-wrapper`]:{borderInlineStart:"none"}})}},re=e=>{const{componentCls:n,wrapperMarginInlineEnd:i,colorPrimary:t,radioSize:o,motionDurationSlow:l,motionDurationMid:C,motionEaseInOutCirc:g,colorBgContainer:d,colorBorder:$,lineWidth:f,colorBgContainerDisabled:s,colorTextDisabled:O,paddingXS:k,dotColorDisabled:w,lineType:x,radioColor:u,radioBgColor:R,calc:h}=e,S=`${n}-inner`,P=h(o).sub(h(4).mul(2)),c=h(1).mul(o).equal({unit:!0});return{[`${n}-wrapper`]:Object.assign(Object.assign({},r.resetComponent(e)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:i,cursor:"pointer","&:last-child":{marginInlineEnd:0},[`&${n}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:e.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},"&-block":{flex:1,justifyContent:"center"},[`${n}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${r.unit(f)} ${x} ${t}`,borderRadius:"50%",visibility:"hidden",opacity:0,content:'""'},[n]:Object.assign(Object.assign({},r.resetComponent(e)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${n}-wrapper:hover &,
2
- &:hover ${S}`]:{borderColor:t},[`${n}-input:focus-visible + ${S}`]:Object.assign({},r.genFocusOutline(e)),[`${n}:hover::after, ${n}-wrapper:hover &::after`]:{visibility:"visible"},[`${n}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:c,height:c,marginBlockStart:h(1).mul(o).div(-2).equal({unit:!0}),marginInlineStart:h(1).mul(o).div(-2).equal({unit:!0}),backgroundColor:u,borderBlockStart:0,borderInlineStart:0,borderRadius:c,transform:"scale(0)",opacity:0,transition:`all ${l} ${g}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:c,height:c,backgroundColor:d,borderColor:$,borderStyle:"solid",borderWidth:f,borderRadius:"50%",transition:`all ${C}`},[`${n}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${n}-checked`]:{[S]:{borderColor:t,backgroundColor:R,"&::after":{transform:`scale(${e.calc(e.dotSize).div(o).equal()})`,opacity:1,transition:`all ${l} ${g}`}}},[`${n}-disabled`]:{cursor:"not-allowed",[S]:{backgroundColor:s,borderColor:$,cursor:"not-allowed","&::after":{backgroundColor:w}},[`${n}-input`]:{cursor:"not-allowed"},[`${n}-disabled + span`]:{color:O,cursor:"not-allowed"},[`&${n}-checked`]:{[S]:{"&::after":{transform:`scale(${h(P).div(o).equal()})`}}}},[`span${n} + *`]:{paddingInlineStart:k,paddingInlineEnd:k}})}},ne=e=>{const{buttonColor:n,controlHeight:i,componentCls:t,lineWidth:o,lineType:l,colorBorder:C,motionDurationSlow:g,motionDurationMid:d,buttonPaddingInline:$,fontSize:f,buttonBg:s,fontSizeLG:O,controlHeightLG:k,controlHeightSM:w,paddingXS:x,borderRadius:u,borderRadiusSM:R,borderRadiusLG:h,buttonCheckedBg:S,buttonSolidCheckedColor:y,colorTextDisabled:P,colorBgContainerDisabled:c,buttonCheckedBgDisabled:_,buttonCheckedColorDisabled:v,colorPrimary:b,colorPrimaryHover:z,colorPrimaryActive:p,buttonSolidCheckedBg:I,buttonSolidCheckedHoverBg:B,buttonSolidCheckedActiveBg:N,calc:E}=e;return{[`${t}-button-wrapper`]:{position:"relative",display:"inline-block",height:i,margin:0,paddingInline:$,paddingBlock:0,color:n,fontSize:f,lineHeight:r.unit(E(i).sub(E(o).mul(2)).equal()),background:s,border:`${r.unit(o)} ${l} ${C}`,borderBlockStartWidth:E(o).add(.02).equal(),borderInlineStartWidth:0,borderInlineEndWidth:o,cursor:"pointer",transition:[`color ${d}`,`background ${d}`,`box-shadow ${d}`].join(","),a:{color:n},[`> ${t}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:E(o).mul(-1).equal(),insetInlineStart:E(o).mul(-1).equal(),display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:o,paddingInline:0,backgroundColor:C,transition:`background-color ${g}`,content:'""'}},"&:first-child":{borderInlineStart:`${r.unit(o)} ${l} ${C}`,borderStartStartRadius:u,borderEndStartRadius:u},"&:last-child":{borderStartEndRadius:u,borderEndEndRadius:u},"&:first-child:last-child":{borderRadius:u},[`${t}-group-large &`]:{height:k,fontSize:O,lineHeight:r.unit(E(k).sub(E(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:h,borderEndStartRadius:h},"&:last-child":{borderStartEndRadius:h,borderEndEndRadius:h}},[`${t}-group-small &`]:{height:w,paddingInline:E(x).sub(o).equal(),paddingBlock:0,lineHeight:r.unit(E(w).sub(E(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:R,borderEndStartRadius:R},"&:last-child":{borderStartEndRadius:R,borderEndEndRadius:R}},"&:hover":{position:"relative",color:b},"&:has(:focus-visible)":Object.assign({},r.genFocusOutline(e)),[`${t}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${t}-button-wrapper-disabled)`]:{zIndex:1,color:b,background:S,borderColor:b,"&::before":{backgroundColor:b},"&:first-child":{borderColor:b},"&:hover":{color:z,borderColor:z,"&::before":{backgroundColor:z}},"&:active":{color:p,borderColor:p,"&::before":{backgroundColor:p}}},[`${t}-group-solid &-checked:not(${t}-button-wrapper-disabled)`]:{color:y,background:I,borderColor:I,"&:hover":{color:y,background:B,borderColor:B},"&:active":{color:y,background:N,borderColor:N}},"&-disabled":{color:P,backgroundColor:c,borderColor:C,cursor:"not-allowed","&:first-child, &:hover":{color:P,backgroundColor:c,borderColor:C}},[`&-disabled${t}-button-wrapper-checked`]:{color:v,backgroundColor:_,borderColor:C,boxShadow:"none"},"&-block":{flex:1,textAlign:"center"}}}},ie=e=>{const{wireframe:n,padding:i,marginXS:t,lineWidth:o,fontSizeLG:l,colorText:C,colorBgContainer:g,colorTextDisabled:d,controlItemBgActiveDisabled:$,colorTextLightSolid:f,colorPrimary:s,colorPrimaryHover:O,colorPrimaryActive:k,colorWhite:w}=e,x=4,u=l,R=n?u-x*2:u-(x+o)*2;return{radioSize:u,dotSize:R,dotColorDisabled:d,buttonSolidCheckedColor:f,buttonSolidCheckedBg:s,buttonSolidCheckedHoverBg:O,buttonSolidCheckedActiveBg:k,buttonBg:g,buttonCheckedBg:g,buttonColor:C,buttonCheckedBgDisabled:$,buttonCheckedColorDisabled:d,buttonPaddingInline:i-o,wrapperMarginInlineEnd:t,radioColor:n?s:w,radioBgColor:n?g:s}},F=r.genStyleHooks("Radio",e=>{const{controlOutline:n,controlOutlineWidth:i}=e,t=`0 0 0 ${r.unit(i)} ${n}`,o=t,l=r.merge(e,{radioFocusShadow:t,radioButtonFocusShadow:o});return[oe(l),re(l),ne(l)]},ie,{unitless:{radioSize:!0,dotSize:!0}});var ae=function(e,n){var i={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(i[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(i[t[o]]=e[t[o]]);return i};const le=(e,n)=>{var i,t;const o=a.useContext(H),l=a.useContext(W),{getPrefixCls:C,direction:g,radio:d}=a.useContext(r.ConfigContext),$=a.useRef(null),f=r.composeRef(n,$),{isFormItemInput:s}=a.useContext(r.FormItemInputContext);if(process.env.NODE_ENV!=="production"){const D=r.devUseWarning("Radio");process.env.NODE_ENV!=="production"&&D(!("optionType"in e),"usage","`optionType` is only support in Radio.Group.")}const O=D=>{var M,T;(M=e.onChange)===null||M===void 0||M.call(e,D),(T=o==null?void 0:o.onChange)===null||T===void 0||T.call(o,D)},{prefixCls:k,className:w,rootClassName:x,children:u,style:R,title:h}=e,S=ae(e,["prefixCls","className","rootClassName","children","style","title"]),y=C("radio",k),P=((o==null?void 0:o.optionType)||l)==="button",c=P?`${y}-button`:y,_=r.useCSSVarCls(y),[v,b,z]=F(y,_),p=Object.assign({},S),I=a.useContext(r.DisabledContext);o&&(p.name=o.name,p.onChange=O,p.checked=e.value===o.value,p.disabled=(i=p.disabled)!==null&&i!==void 0?i:o.disabled),p.disabled=(t=p.disabled)!==null&&t!==void 0?t:I;const B=r.classNames(`${c}-wrapper`,{[`${c}-wrapper-checked`]:p.checked,[`${c}-wrapper-disabled`]:p.disabled,[`${c}-wrapper-rtl`]:g==="rtl",[`${c}-wrapper-in-form-item`]:s,[`${c}-wrapper-block`]:!!(o!=null&&o.block)},d==null?void 0:d.className,w,x,b,z,_),[N,E]=te(p.onClick);return v(a.createElement(r.Wave,{component:"Radio",disabled:p.disabled},a.createElement("label",{className:B,style:Object.assign(Object.assign({},d==null?void 0:d.style),R),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:h,onClick:N},a.createElement(ee,Object.assign({},p,{className:r.classNames(p.className,{[r.TARGET_CLS]:!P}),type:"radio",prefixCls:c,ref:f,onClick:E})),u!==void 0?a.createElement("span",{className:`${c}-label`},u):null)))},V=a.forwardRef(le);process.env.NODE_ENV!=="production"&&(V.displayName="Radio");const se=a.forwardRef((e,n)=>{const{getPrefixCls:i,direction:t}=a.useContext(r.ConfigContext),o=r.useId(),{prefixCls:l,className:C,rootClassName:g,options:d,buttonStyle:$="outline",disabled:f,children:s,size:O,style:k,id:w,optionType:x,name:u=o,defaultValue:R,value:h,block:S=!1,onChange:y,onMouseEnter:P,onMouseLeave:c,onFocus:_,onBlur:v}=e,[b,z]=r.useMergedState(R,{value:h}),p=a.useCallback(m=>{const Y=b,G=m.target.value;"value"in e||z(G),G!==Y&&(y==null||y(m))},[b,z,y]),I=i("radio",l),B=`${I}-group`,N=r.useCSSVarCls(I),[E,D,M]=F(I,N);let T=s;d&&d.length>0&&(T=d.map(m=>typeof m=="string"||typeof m=="number"?a.createElement(V,{key:m.toString(),prefixCls:I,disabled:f,value:m,checked:b===m},m):a.createElement(V,{key:`radio-group-value-options-${m.value}`,prefixCls:I,disabled:m.disabled||f,value:m.value,checked:b===m.value,title:m.title,style:m.style,id:m.id,required:m.required},m.label)));const L=r.useSize(O),X=r.classNames(B,`${B}-${$}`,{[`${B}-${L}`]:L,[`${B}-rtl`]:t==="rtl",[`${B}-block`]:S},C,g,D,M,N),U=a.useMemo(()=>({onChange:p,value:b,disabled:f,name:u,optionType:x,block:S}),[p,b,f,u,x,S]);return E(a.createElement("div",Object.assign({},r.pickAttrs(e,{aria:!0,data:!0}),{className:X,style:k,onMouseEnter:P,onMouseLeave:c,onFocus:_,onBlur:v,id:w,ref:n}),a.createElement(K,{value:U},T)))}),de=a.memo(se);var ce=function(e,n){var i={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(i[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(i[t[o]]=e[t[o]]);return i};const ue=(e,n)=>{const{getPrefixCls:i}=a.useContext(r.ConfigContext),{prefixCls:t}=e,o=ce(e,["prefixCls"]),l=i("radio",t);return a.createElement(Q,{value:"button"},a.createElement(V,Object.assign({prefixCls:l},o,{type:"radio",ref:n})))},be=a.forwardRef(ue),q=V;q.Button=be;q.Group=de;q.__ANT_RADIO=!0;const pe=j.memo(({open:e,onCallBack:n,queryFetch:i})=>{const[t,o]=j.useState([]),[l,C]=j.useState(0),[g,d]=j.useState(""),[$,f]=j.useState(!1);return j.useEffect(()=>{(async()=>{f(!0);try{await i({success:s=>{o(s.data||[])}})}catch{}f(!1)})()},[e]),r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:r.jsxRuntimeExports.jsx(A.Modal,{open:e,title:"转接",footer:!1,onCancel:()=>n(),children:r.jsxRuntimeExports.jsxs(r.ModelBody,{children:[r.jsxRuntimeExports.jsx("div",{children:r.jsxRuntimeExports.jsx(q.Group,{options:[{label:"转接坐席",value:0},{label:"转接外线",value:1}],value:l,onChange:s=>C(s.target.value)})}),r.jsxRuntimeExports.jsx(r.Spin,{spinning:$,children:r.jsxRuntimeExports.jsxs("div",{style:{borderTop:"1px solid #eee",marginTop:10,paddingTop:10},children:[l===0&&r.jsxRuntimeExports.jsx(r.Space,{wrap:!0,children:t.map(s=>r.jsxRuntimeExports.jsxs(A.Tag,{color:"processing",onClick:()=>n(s.agent_no,0),children:[r.jsxRuntimeExports.jsxs("span",{style:{marginRight:10},children:["咨询坐席: ",s.agent_name]}),r.jsxRuntimeExports.jsx(r.YsytIconSvg,{name:"zixun"})]},s.agent_no))}),l===1&&r.jsxRuntimeExports.jsx(r.Input,{value:g,onChange:s=>d(s.target.value),placeholder:"请输入外线号码, 回车转接",onPressEnter:()=>{n(g,1)}})]})})]})})})});exports.default=pe;