zy-react-library 1.1.5 → 1.1.6
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{Spin as
|
|
1
|
+
import{Spin as t,Form as e,Row as i,Col as n,Space as o,Button as r,message as l}from"antd";import{useState as s,useEffect as a}from"react";import{throttle as d}from"throttle-debounce";import u from"./FormItemsRenderer.js";import{jsx as c,jsxs as p}from"react/jsx-runtime";const m=m=>{const{values:h,options:g,gutter:w=24,span:x=12,labelCol:y={span:4},useAutoGenerateRequired:b=!0,showActionButtons:f=!0,submitButtonText:B="提交",cancelButtonText:v="取消",showSubmitButton:A=!0,showCancelButton:C=!0,customActionButtons:T,extraActionButtons:F,loading:k=!1,...q}=m,[z,E]=s(window.innerWidth),R=d(50,()=>{const t=document.querySelector("#page-layout");t&&E(t.offsetWidth)});return a(()=>{const t=setTimeout(()=>{R()},0);return f&&window.addEventListener("resize",R),()=>{f&&window.removeEventListener("resize",R),clearTimeout(t)}},[f]),c(t,{spinning:k,children:p(e,{labelCol:y,scrollToFirstError:!0,wrapperCol:{span:24-y.span},initialValues:h,onFinishFailed:()=>{l.error("请补全必填项")},style:{width:`calc(100% - ${2*w}px)`,margin:"0 auto"},...q,children:[c(i,{gutter:w,children:c(u,{options:g,labelCol:y,span:x,gutter:w,useAutoGenerateRequired:b,initialValues:h})}),f&&p("div",{style:{position:"relative",zIndex:"9"},children:[c("div",{style:{height:"32px"}}),c(i,{style:{textAlign:"center",backgroundColor:"rgb(241, 241, 242)",padding:"10px 0",position:"fixed",bottom:"0",width:z,margin:"0 -44px"},children:c(n,{span:24,style:{textAlign:"center"},children:T||p(o,{children:[A&&c(r,{type:"primary",htmlType:"submit",children:B}),F,C&&c(r,{onClick:()=>{window.history.back()},children:v})]})})})]})]})})};m.displayName="FormBuilder";export{m as default};
|
package/components/Page/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Space as e,Button as t}from"antd";import{useState as i,useEffect as o}from"react";import r from"../HeaderBack/index.js";import{jsxs as
|
|
1
|
+
import{Space as e,Button as t}from"antd";import{useState as i,useEffect as o}from"react";import{throttle as r}from"throttle-debounce";import n from"../HeaderBack/index.js";import{jsxs as d,jsx as a}from"react/jsx-runtime";function s(s){const{headerTitle:c,history:l,isShowHeader:h=!0,headerPrevious:m=!0,isShowFooter:p=!0,isShowAllAction:u=!0,backButtonText:g="关闭",contentPadding:x="20px",customActionButtons:y,extraActionButtons:w}=s,[f,v]=i(window.innerWidth),b=r(50,()=>{const e=document.querySelector("#page-layout");e&&v(e.offsetWidth)});return o(()=>{const e=setTimeout(()=>{b()},0);return u&&p&&window.addEventListener("resize",b),()=>{u&&p&&window.removeEventListener("resize",b),clearTimeout(e)}},[u,p]),d("div",{className:"page-layout",id:"page-layout",children:[u&&h&&a(n,{title:c,history:l,previous:m}),d("div",{style:{padding:x},children:[s.children,u&&p&&d("div",{className:"page-layout-footer",style:{position:"relative",zIndex:"9"},children:[a("div",{style:{height:"52px"}}),a("div",{style:{textAlign:"center",backgroundColor:"rgb(241, 241, 242)",padding:"10px 0",position:"fixed",bottom:"0",width:f,margin:"0px -20px"},children:y||d(e,{children:[w,a(t,{onClick:()=>l?.goBack?.()||window.history.back(),children:g})]})})]})]})]})}s.displayName="Page";export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e
|
|
1
|
+
import{ProTable as e}from"@ant-design/pro-components";import t from"dayjs";import{useState as o,useEffect as n,useMemo as r}from"react";import{throttle as s}from"throttle-debounce";import{useAntdResizableHeader as a}from"use-antd-resizable-header";import{getDataType as i,getIndexColumn as l}from"../../utils/index.js";import"use-antd-resizable-header/dist/style.css";import"./index.less";import{jsx as c}from"react/jsx-runtime";const d="tableLocalStorageLastCleanup";function m(e){const t=process.env?.app?.basename,o=decodeURIComponent(window.location.pathname),n="Undefined"===i(e)?"":`#{${e}}`;return{size:`${t}#${o}${n}#size`,resizable:`${t}#${o}${n}#resizable`,columnState:`${t}#${o}${n}#columnState`}}function u(i){const{columns:u=[],showIndexColumn:p=!0,ellipsis:b=!0,align:f="center",indexColumnFixed:g="left",rowKey:h="id",storeIndex:y,disabledResizer:S=!1,...w}=i,z=process.env.app.antd["ant-prefix"],$=`.${z||"ant"}-table`,x=`${$}-wrapper`,v=`${$}-body`,[C,I]=o((R=y,window.localStorage.getItem(m(R).size)||"default"));var R;const[_,E]=o(0),K=m(y),N=!S,{components:T,resizableColumns:W,tableWidth:j,resetColumns:k}=a({columns:u,columnsState:{persistenceKey:K.resizable,persistenceType:"localStorage"}}),q=s(50,()=>{try{const e=document.querySelector(x),t=document.querySelector(v),o=document.querySelector(".page-layout-footer"),n=o?o.offsetHeight:0;if(t&&e){const o=e.getBoundingClientRect(),r=t.getBoundingClientRect(),s=o.bottom-r.bottom;E(innerHeight-r.top-s-(window.__IN_BASE__?38:22)-n)}}catch(e){window.console.error(e)}});n(()=>{let e,o;return N&&(e=new MutationObserver(e=>e.forEach(()=>q())),o=new ResizeObserver(e=>e.forEach(()=>q())),setTimeout(()=>q(),500),o.observe(document.body),e.observe(document.body,{subtree:!0,childList:!0})),function(){const e=t(),o=localStorage.getItem(d),n=o?t(o):null;if(!n||e.diff(n,"day")>=10){const t=[];for(let e=0;e<localStorage.length;e++){const o=localStorage.key(e);o&&(o.endsWith("#columnState")||o.endsWith("#size")||o.endsWith("#resizable"))&&t.push(o)}t.forEach(e=>{localStorage.removeItem(e)}),localStorage.setItem(d,e.toISOString())}}(),()=>{e&&o&&N&&(o.unobserve(document.body),e.disconnect(document.body))}},[]),n(()=>{!function(e,t){window.localStorage.setItem(m(t).size,e)}(C,y)},[C]);const B=r(()=>(()=>{const e=[...W];p&&e.unshift({...l(i.pagination),fixed:g});const t=e=>({align:f,ellipsis:b,...e,...e.children?{children:e.children.map(t)}:{}});return e.map(t)})(),[W,p,f,b,g,i.pagination]);return c("div",{className:"table-layout card-layout",children:c(e,{ghost:!0,search:!1,scroll:{x:j,y:N?_:void 0},options:{reload:!1,fullScreen:!0,setting:{checkedReset:!0,extra:c("a",{className:`${z}-pro-table-column-setting-action-rest-button`,onClick:k,children:"重置列宽"})}},components:T,columnsState:{persistenceKey:K.columnState,persistenceType:"localStorage"},onSizeChange:I,columns:B,bordered:!0,size:"small",rowKey:h,...w})})}u.displayName="Table";export{u 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.1.
|
|
4
|
+
"version": "1.1.6",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "",
|
|
7
7
|
"author": "LiuJiaNan",
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
"@ant-design/icons": "^6.1.0",
|
|
34
34
|
"@ant-design/pro-components": "^2.8.10",
|
|
35
35
|
"@cqsjjb/jjb-common-lib": "latest",
|
|
36
|
-
"@cqsjjb/jjb-react-admin-component": "latest",
|
|
37
36
|
"@wangeditor/editor": "^5.1.23",
|
|
38
37
|
"@wangeditor/editor-for-react": "^1.0.6",
|
|
39
38
|
"ahooks": "^3.9.5",
|
|
@@ -42,7 +41,9 @@
|
|
|
42
41
|
"lodash-es": "^4.17.21",
|
|
43
42
|
"react": "^18.3.1",
|
|
44
43
|
"react-pdf": "^10.2.0",
|
|
45
|
-
"react-signature-canvas": "^1.1.0-alpha.2"
|
|
44
|
+
"react-signature-canvas": "^1.1.0-alpha.2",
|
|
45
|
+
"throttle-debounce": "^5.0.2",
|
|
46
|
+
"use-antd-resizable-header": "^3.2.2"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"@babel/core": "^7.28.5",
|