zy-react-library 1.1.5 → 1.1.7

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 e,Form as t,Row as n,Col as i,Space as r,Button as o,message as s}from"antd";import{useState as l,useEffect as a}from"react";import d from"./FormItemsRenderer.js";import{jsx as u,jsxs as c,Fragment as p}from"react/jsx-runtime";const m=m=>{const{values:h,options:g,gutter:w=24,span:x=12,labelCol:b={span:4},useAutoGenerateRequired:y=!0,showActionButtons:f=!0,submitButtonText:B="提交",cancelButtonText:A="取消",showSubmitButton:C=!0,showCancelButton:T=!0,customActionButtons:v,extraActionButtons:F,loading:k=!1,...q}=m,[E,R]=l(window.innerWidth),j=()=>{const e=document.querySelector("#page");e&&R(e.offsetWidth)};return a(()=>{const e=setTimeout(()=>{j()},0);return f&&window.addEventListener("resize",j),()=>{f&&window.removeEventListener("resize",j),clearTimeout(e)}},[f]),u(e,{spinning:k,children:c(t,{labelCol:b,scrollToFirstError:!0,wrapperCol:{span:24-b.span},initialValues:h,onFinishFailed:()=>{s.error("请补全必填项")},style:{width:`calc(100% - ${2*w}px)`,margin:"0 auto"},...q,children:[u(n,{gutter:w,children:u(d,{options:g,labelCol:b,span:x,gutter:w,useAutoGenerateRequired:y,initialValues:h})}),f&&c(p,{children:[u("div",{style:{height:"32px"}}),u(n,{style:{textAlign:"center",backgroundColor:"rgb(241, 241, 242)",padding:"10px 0",position:"fixed",bottom:"0",width:E,margin:"0 -44px"},children:u(i,{span:24,style:{textAlign:"center"},children:v||c(r,{children:[C&&u(o,{type:"primary",htmlType:"submit",children:B}),F,T&&u(o,{onClick:()=>{window.history.back()},children:A})]})})})]})]})})};m.displayName="FormBuilder";export{m as default};
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};
@@ -5,7 +5,7 @@
5
5
  position: sticky;
6
6
  top: 0;
7
7
  background-color: #fff;
8
- z-index: 1;
8
+ z-index: 9;
9
9
 
10
10
  .action {
11
11
  display: flex;
@@ -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 n,jsx as d,Fragment as s}from"react/jsx-runtime";function a(a){const{headerTitle:c,history:l,isShowHeader:h=!0,headerPrevious:m=!0,isShowFooter:p=!0,isShowAllAction:u=!0,backButtonText:g="关闭",contentPadding:w="20px",customActionButtons:x,extraActionButtons:f}=a,[v,y]=i(window.innerWidth),k=()=>{const e=document.querySelector("#page");e&&y(e.offsetWidth)};return o(()=>{const e=setTimeout(()=>{k()},0);return u&&p&&window.addEventListener("resize",k),()=>{u&&p&&window.removeEventListener("resize",k),clearTimeout(e)}},[u,p]),n("div",{className:"page",id:"page",children:[u&&h&&d(r,{title:c,history:l,previous:m}),n("div",{style:{padding:w},children:[a.children,u&&p&&n(s,{children:[d("div",{style:{height:"52px"}}),d("div",{style:{textAlign:"center",backgroundColor:"rgb(241, 241, 242)",padding:"10px 0",position:"fixed",bottom:"0",width:v,margin:"0px -20px"},children:x||n(e,{children:[f,d(t,{onClick:()=>l?.goBack?.()||window.history.back(),children:g})]})})]})]})]})}a.displayName="Page";export{a as default};
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 from"@cqsjjb/jjb-react-admin-component/Table";import{getIndexColumn as t}from"../../utils/index.js";import o from"dayjs";import"./index.less";import{jsx as l}from"react/jsx-runtime";const n="tableLocalStorageLastCleanup";function a(a){const{columns:i=[],showIndexColumn:r=!0,ellipsis:s=!0,align:c="center",indexColumnFixed:m="left",rowKey:d="id",...u}=a;return function(){const e=o(),t=localStorage.getItem(n),l=t?o(t):null;if(!l||e.diff(l,"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(n,e.toISOString())}}(),l("div",{className:"table-layout card-layout",children:l(e,{rowKey:d,columns:function(){r&&i.unshift({...t(a.pagination),fixed:m});const e=t=>({align:c,ellipsis:s,...t,...t.children?{children:t.children.map(e)}:{}});return i.map(e)}(),bordered:!0,size:"small",...u})})}a.displayName="Table";export{a as default};
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};
@@ -12,9 +12,3 @@
12
12
  padding-top: 0 !important;
13
13
  padding-bottom: 16px;
14
14
  }
15
-
16
- .search-layout {
17
- + .table-layout .@{ant-prefix}-pro-table-list-toolbar-container {
18
- padding-top: 26px !important;
19
- }
20
- }
package/css/common.less CHANGED
@@ -21,7 +21,7 @@
21
21
  background-color: rgb(241, 241, 242);
22
22
  }
23
23
 
24
- + .table-layout .@{ant-prefix}-pro-table-list-toolbar-container {
24
+ + .table-layout {
25
25
  padding-top: 26px !important;
26
26
  }
27
27
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zy-react-library",
3
3
  "private": false,
4
- "version": "1.1.5",
4
+ "version": "1.1.7",
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",