zy-react-library 1.3.4 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{Button as r,Image as e,Modal as i,message as t}from"antd";import n from"dayjs";import{useState as o,useRef as c,useEffect as a}from"react";import d from"react-signature-canvas";import{base642File as l}from"../../utils/index.js";import{jsxs as h,Fragment as m,jsx as s}from"react/jsx-runtime";function p(p){const{onConfirm:u,width:f=752,height:y=300,url:g="",...C}=p,[k,b]=o(!1),v=c(null),[w,x]=o("");return a(()=>{x(g)},[g]),h(m,{children:[s("div",{children:s(r,{type:"primary",onClick:()=>{b(!0)},children:w?"重新签字":"手写签字"})}),w&&s("div",{style:{border:"1px dashed #d9d9d9",width:"100%",height:y,marginTop:16},children:s(e,{src:w,style:{width:"100%",height:y,objectFit:"contain"}})}),s(i,{title:"签字",width:800,open:k,maskClosable:!1,onCancel:()=>b(!1),footer:[s(r,{onClick:()=>v.current.clear(),children:"重签"},"clear"),s(r,{onClick:()=>{b(!1),v.current.clear()},children:"取消"},"cancel"),s(r,{type:"primary",onClick:()=>{if(v.current.isEmpty())return void t.warning("请签名");const r=v.current.toDataURL();x(r),u({time:n().format("YYYY-MM-DD HH:mm:ss"),base64:r,file:l(r)}),v.current.clear(),b(!1)},children:"确定"},"ok")],children:s("div",{style:{border:"1px dashed #d9d9d9"},children:s(d,{ref:v,penColor:"black",canvasProps:{width:f,height:y},...C})})})]})}p.displayName="Signature";export{p as default};
1
+ import{Button as r,Image as e,Modal as i,message as t}from"antd";import n from"dayjs";import{useState as o,useRef as c,useEffect as a}from"react";import d from"react-signature-canvas";import{base642File as l}from"../../utils/index.js";import{jsxs as h,Fragment as m,jsx as s}from"react/jsx-runtime";function p(p){const{onConfirm:u,width:f=752,height:g=300,url:y="",...C}=p,[b,k]=o(!1),v=c(null),[w,x]=o("");return a(()=>{x(y)},[y]),h(m,{children:[s("div",{children:s(r,{type:"primary",onClick:()=>{k(!0)},children:w?"重新签字":"手写签字"})}),w&&s("div",{style:{border:"1px dashed #d9d9d9",width:"100%",height:g,marginTop:16},children:s(e,{src:w,style:{width:"100%",height:g,objectFit:"contain"}})}),s(i,{title:"签字",width:800,open:b,maskClosable:!1,onCancel:()=>k(!1),footer:[s(r,{onClick:()=>v.current.clear(),children:"重签"},"clear"),s(r,{onClick:()=>{k(!1),v.current.clear()},children:"取消"},"cancel"),s(r,{type:"primary",onClick:()=>{if(v.current.isEmpty())return void t.warning("请签名");const r=v.current.toDataURL();x(r),u({time:n().format("YYYY-MM-DD HH:mm:ss"),base64:r,file:l(r)}),v.current.clear(),k(!1)},children:"确定"},"ok")],children:s("div",{style:{border:"1px dashed #d9d9d9"},children:s(d,{ref:v,penColor:"black",canvasProps:{width:f,height:g},backgroundColor:"rgb(255,255,255)",...C})})})]})}p.displayName="Signature";export{p as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zy-react-library",
3
3
  "private": false,
4
- "version": "1.3.4",
4
+ "version": "1.3.5",
5
5
  "type": "module",
6
6
  "description": "",
7
7
  "author": "LiuJiaNan",