zy-react-library 2.0.14 → 2.0.15

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,22 +1,22 @@
1
- import type { FC } from "react";
2
-
3
- export interface ExcelProps {
4
- /** 是否显示弹窗 */
5
- visible?: boolean;
6
- /** 关闭回调 */
7
- onCancel?: () => void;
8
- /** xlsx 文件地址 */
9
- file?: string;
10
- /** xlsx 文件名 */
11
- name?: string;
12
- /** 是否内联展示 */
13
- inline?: boolean;
14
- /** 弹窗标题 */
15
- title?: string;
16
- /** 内容样式 */
17
- style?: Record<string, any>;
18
- }
19
-
20
- declare const Excel: FC<ExcelProps>;
21
-
22
- export default Excel;
1
+ import type { FC } from "react";
2
+
3
+ export interface ExcelProps {
4
+ /** 是否显示弹窗 */
5
+ visible?: boolean;
6
+ /** 关闭回调 */
7
+ onCancel?: () => void;
8
+ /** xlsx 文件地址 */
9
+ file?: string;
10
+ /** xlsx 文件名 */
11
+ name?: string;
12
+ /** 是否内联展示 */
13
+ inline?: boolean;
14
+ /** 弹窗标题 */
15
+ title?: string;
16
+ /** 内容样式 */
17
+ style?: Record<string, any>;
18
+ }
19
+
20
+ declare const Excel: FC<ExcelProps>;
21
+
22
+ export default Excel;
@@ -1,18 +1,18 @@
1
- import type { FC } from "react";
2
-
3
- export interface PreviewExcelProps {
4
- /** 文件列表,和 name、url 冲突 */
5
- files?: { filePath?: string; fileName?: string; name?: string; url?: string; [key: string]: string }[];
6
- /** 文件名字段名,传入 files 时会优先查找是否存在 name、fileName */
7
- nameKey?: string;
8
- /** 文件路径字段名,传入 files 时会优先查找是否存在 filePath、url */
9
- urlKey?: string;
10
- /** 单个文件名,和 files 冲突 */
11
- name?: string;
12
- /** 单个文件路径,和 files 冲突 */
13
- url?: string;
14
- }
15
-
16
- declare const PreviewExcel: FC<PreviewExcelProps>;
17
-
18
- export default PreviewExcel;
1
+ import type { FC } from "react";
2
+
3
+ export interface PreviewExcelProps {
4
+ /** 文件列表,和 name、url 冲突 */
5
+ files?: { filePath?: string; fileName?: string; name?: string; url?: string; [key: string]: string }[];
6
+ /** 文件名字段名,传入 files 时会优先查找是否存在 name、fileName */
7
+ nameKey?: string;
8
+ /** 文件路径字段名,传入 files 时会优先查找是否存在 filePath、url */
9
+ urlKey?: string;
10
+ /** 单个文件名,和 files 冲突 */
11
+ name?: string;
12
+ /** 单个文件路径,和 files 冲突 */
13
+ url?: string;
14
+ }
15
+
16
+ declare const PreviewExcel: FC<PreviewExcelProps>;
17
+
18
+ export default PreviewExcel;
@@ -1,18 +1,18 @@
1
- import type { FC } from "react";
2
-
3
- export interface PreviewWordProps {
4
- /** 文件列表,和 name、url 冲突 */
5
- files?: { filePath?: string; fileName?: string; name?: string; url?: string; [key: string]: string }[];
6
- /** 文件名字段名,传入 files 时会优先查找是否存在 name、fileName */
7
- nameKey?: string;
8
- /** 文件路径字段名,传入 files 时会优先查找是否存在 filePath、url */
9
- urlKey?: string;
10
- /** 单个文件名,和 files 冲突 */
11
- name?: string;
12
- /** 单个文件路径,和 files 冲突 */
13
- url?: string;
14
- }
15
-
16
- declare const PreviewWord: FC<PreviewWordProps>;
17
-
18
- export default PreviewWord;
1
+ import type { FC } from "react";
2
+
3
+ export interface PreviewWordProps {
4
+ /** 文件列表,和 name、url 冲突 */
5
+ files?: { filePath?: string; fileName?: string; name?: string; url?: string; [key: string]: string }[];
6
+ /** 文件名字段名,传入 files 时会优先查找是否存在 name、fileName */
7
+ nameKey?: string;
8
+ /** 文件路径字段名,传入 files 时会优先查找是否存在 filePath、url */
9
+ urlKey?: string;
10
+ /** 单个文件名,和 files 冲突 */
11
+ name?: string;
12
+ /** 单个文件路径,和 files 冲突 */
13
+ url?: string;
14
+ }
15
+
16
+ declare const PreviewWord: FC<PreviewWordProps>;
17
+
18
+ export default PreviewWord;
@@ -2,7 +2,7 @@ import type { ForwardRefExoticComponent, RefAttributes } from "react";
2
2
 
3
3
  export interface SeamlessScrollProps {
4
4
  /** 是否开启自动滚动,默认 true */
5
- value?: boolean;
5
+ isAutoScroll?: boolean;
6
6
  /** 原始数据列表 */
7
7
  list: unknown[];
8
8
  /** 步进速度,step 需是单步大小的约数,值越大滚动的越快,默认 1 */
@@ -1 +1 @@
1
- import{forwardRef as e,useRef as t,useState as r,useEffect as n,useImperativeHandle as l}from"react";import{throttle as o}from"throttle-debounce";import{jsx as i,jsxs as c,Fragment as u}from"react/jsx-runtime";const s=e((e,s)=>{const{value:a=!0,list:d=[],step:f=1,limitScrollNum:m=3,hover:h=!0,direction:p="up",singleHeight:y=0,singleWidth:g=0,singleWaitTime:w=1e3,isRemUnit:b=!1,isWatch:v=!0,delay:$=0,ease:x="ease-in",count:M=-1,copyNum:T=1,wheel:N=!1,singleLine:S=!1,children:W,className:A}=e,k=t(null),E=t(null),F=t(null),H=t(null),L=t(null),q=t(!1),[z,Y]=r(0),[j,C]=r(0),[I,R]=r(0),[U,B]=r(0),[D,G]=r(0),J=d.length>=m,K={width:z?`${z}px`:"auto",transform:`translate(${I}px,${U}px)`,transition:`all ${"string"==typeof x?x:`cubic-bezier(${x.x1}, ${x.y1}, ${x.x2}, ${x.y2})`} ${$}ms`,overflow:"hidden",display:S?"flex":"block"},O="left"===p||"right"===p,P=O?{float:"left",overflow:"hidden",display:S?"flex":"block",flexShrink:S?0:1}:{overflow:"hidden"},Q=b?Number.parseInt(window.getComputedStyle(document.documentElement,null).fontSize):1,V=g*Q,X=y*Q;n(()=>{X>0&&X%f>0&&console.error("如果设置了单步滚动,step 需是单步大小的约数,否则无法保证单步滚动结束的位置是否准确。~~~~~")},[X,f]);const Z=()=>{H.current&&(cancelAnimationFrame(H.current),H.current=null)},_=(e,t,r)=>{H.current=requestAnimationFrame(()=>{const n=j/2,l=z/2;if(("up"===e||"down"===e)&&n<=0)return;if(("left"===e||"right"===e)&&l<=0)return;let o=U,i=I;"up"===e?B(e=>Math.abs(e)>=n?(G(e=>e+1),o=-t,-t):(o=e-t,e-t)):"down"===e?B(e=>e>=0?(G(e=>e+1),o=-1*n+t,-1*n+t):(o=e+t,e+t)):"left"===e?R(e=>Math.abs(e)>=l?(G(e=>e+1),i=-t,-t):(i=e-t,e-t)):"right"===e&&R(e=>e>=0?(G(e=>e+1),i=-1*l+t,-1*l+t):(i=e+t,e+t)),r||(L.current&&clearTimeout(L.current),X?Math.abs(o)%X<t?L.current=window.setTimeout(()=>{ee()},w):ee():V&&Math.abs(i)%V<t?L.current=window.setTimeout(()=>{ee()},w):ee())})},ee=()=>{Z(),!q.current&&J&&D!==M?_(p,f,!1):G(0)},te=()=>{if(d&&"boolean"!=typeof d&&d.length>100&&console.warn(`数据达到了${d.length}条有点多哦~,可能会造成部分老旧浏览器卡顿。`),O){let e=E.current?.offsetWidth||0;e=2*e+1,Y(e)}J?requestAnimationFrame(()=>{const e=F.current?.offsetHeight||0;e>0?C(e):setTimeout(()=>{const e=F.current?.offsetHeight||0;e>0&&C(e)},100)}):(Z(),R(0),B(0))},re=()=>{q.current=!1,ee()},ne=()=>{q.current=!0,L.current&&clearTimeout(L.current),Z()},le=h&&a&&J,oe=()=>{Z(),te()},ie=o(30,e=>{Z();const t=X||15;e.deltaY<0&&_("down",t,!0),e.deltaY>0&&_("up",t,!0)});l(s,()=>({reset:oe})),n(()=>{J&&te()},[J]),n(()=>{J&&a&&(j>0||z>0)&&!q.current&&ee()},[j,z]),n(()=>{a?re():ne()},[a]),n(()=>{0!==M&&re()},[M]),n(()=>{v&&oe()},[d,v]),n(()=>()=>{Z(),L.current&&clearTimeout(L.current)},[]);const ce=()=>c(u,{children:[i("div",{ref:E,style:P,children:W&&"function"==typeof W?W():W}),J?Array.from({length:T}).map((e,t)=>i("div",{style:P,children:W&&"function"==typeof W?W():W},`copy-${t}`)):null]});return i("div",{ref:k,className:A,children:i("div",N&&h?{ref:F,style:K,onMouseEnter:()=>{le&&ne()},onMouseLeave:()=>{le&&re()},onWheel:e=>{le&&ie(e)},children:ce()}:{ref:F,style:K,onMouseEnter:()=>{le&&ne()},onMouseLeave:()=>{le&&re()},children:ce()})})});s.displayName="SeamlessScroll";export{s as default};
1
+ import{forwardRef as e,useRef as t,useState as r,useEffect as n,useImperativeHandle as l}from"react";import{throttle as o}from"throttle-debounce";import{jsx as i,jsxs as c,Fragment as u}from"react/jsx-runtime";const s=e((e,s)=>{const{isAutoScroll:a=!0,list:d=[],step:f=1,limitScrollNum:m=3,hover:h=!0,direction:p="up",singleHeight:y=0,singleWidth:g=0,singleWaitTime:w=1e3,isRemUnit:b=!1,isWatch:$=!0,delay:v=0,ease:x="ease-in",count:M=-1,copyNum:S=1,wheel:T=!1,singleLine:N=!1,children:A,className:W}=e,k=t(null),E=t(null),F=t(null),H=t(null),L=t(null),q=t(!1),[z,Y]=r(0),[j,C]=r(0),[I,R]=r(0),[U,B]=r(0),[D,G]=r(0),J=d.length>=m,K={width:z?`${z}px`:"auto",transform:`translate(${I}px,${U}px)`,transition:`all ${"string"==typeof x?x:`cubic-bezier(${x.x1}, ${x.y1}, ${x.x2}, ${x.y2})`} ${v}ms`,overflow:"hidden",display:N?"flex":"block"},O="left"===p||"right"===p,P=O?{float:"left",overflow:"hidden",display:N?"flex":"block",flexShrink:N?0:1}:{overflow:"hidden"},Q=b?Number.parseInt(window.getComputedStyle(document.documentElement,null).fontSize):1,V=g*Q,X=y*Q;n(()=>{X>0&&X%f>0&&console.error("如果设置了单步滚动,step 需是单步大小的约数,否则无法保证单步滚动结束的位置是否准确。~~~~~")},[X,f]);const Z=()=>{H.current&&(cancelAnimationFrame(H.current),H.current=null)},_=(e,t,r)=>{H.current=requestAnimationFrame(()=>{const n=j/2,l=z/2;if(("up"===e||"down"===e)&&n<=0)return;if(("left"===e||"right"===e)&&l<=0)return;let o=U,i=I;"up"===e?B(e=>Math.abs(e)>=n?(G(e=>e+1),o=-t,-t):(o=e-t,e-t)):"down"===e?B(e=>e>=0?(G(e=>e+1),o=-1*n+t,-1*n+t):(o=e+t,e+t)):"left"===e?R(e=>Math.abs(e)>=l?(G(e=>e+1),i=-t,-t):(i=e-t,e-t)):"right"===e&&R(e=>e>=0?(G(e=>e+1),i=-1*l+t,-1*l+t):(i=e+t,e+t)),r||(L.current&&clearTimeout(L.current),X?Math.abs(o)%X<t?L.current=window.setTimeout(()=>{ee()},w):ee():V&&Math.abs(i)%V<t?L.current=window.setTimeout(()=>{ee()},w):ee())})},ee=()=>{Z(),!q.current&&J&&D!==M?_(p,f,!1):G(0)},te=()=>{if(d&&"boolean"!=typeof d&&d.length>100&&console.warn(`数据达到了${d.length}条有点多哦~,可能会造成部分老旧浏览器卡顿。`),O){let e=E.current?.offsetWidth||0;e=2*e+1,Y(e)}J?requestAnimationFrame(()=>{const e=F.current?.offsetHeight||0;e>0?C(e):setTimeout(()=>{const e=F.current?.offsetHeight||0;e>0&&C(e)},100)}):(Z(),R(0),B(0))},re=()=>{q.current=!1,ee()},ne=()=>{q.current=!0,L.current&&clearTimeout(L.current),Z()},le=h&&a&&J,oe=()=>{Z(),te()},ie=o(30,e=>{Z();const t=X||15;e.deltaY<0&&_("down",t,!0),e.deltaY>0&&_("up",t,!0)});l(s,()=>({reset:oe})),n(()=>{J&&te()},[J]),n(()=>{J&&a&&(j>0||z>0)&&!q.current&&ee()},[j,z]),n(()=>{a?re():ne()},[a]),n(()=>{0!==M&&re()},[M]),n(()=>{$&&oe()},[d,$]),n(()=>()=>{Z(),L.current&&clearTimeout(L.current)},[]);const ce=()=>c(u,{children:[i("div",{ref:E,style:P,children:A&&"function"==typeof A?A():A}),J?Array.from({length:S}).map((e,t)=>i("div",{style:P,children:A&&"function"==typeof A?A():A},`copy-${t}`)):null]});return i("div",{ref:k,className:W,children:i("div",T&&h?{ref:F,style:K,onMouseEnter:()=>{le&&ne()},onMouseLeave:()=>{le&&re()},onWheel:e=>{le&&ie(e)},children:ce()}:{ref:F,style:K,onMouseEnter:()=>{le&&ne()},onMouseLeave:()=>{le&&re()},children:ce()})})});s.displayName="SeamlessScroll";export{s as default};
@@ -1,22 +1,22 @@
1
- import type { FC } from "react";
2
-
3
- export interface WordProps {
4
- /** 是否显示弹窗 */
5
- visible?: boolean;
6
- /** 关闭回调 */
7
- onCancel?: () => void;
8
- /** docx 文件地址 */
9
- file?: string;
10
- /** docx 文件名 */
11
- name?: string;
12
- /** 是否内联展示 */
13
- inline?: boolean;
14
- /** 弹窗标题 */
15
- title?: string;
16
- /** 内容样式 */
17
- style?: Record<string, any>;
18
- }
19
-
20
- declare const Word: FC<WordProps>;
21
-
22
- export default Word;
1
+ import type { FC } from "react";
2
+
3
+ export interface WordProps {
4
+ /** 是否显示弹窗 */
5
+ visible?: boolean;
6
+ /** 关闭回调 */
7
+ onCancel?: () => void;
8
+ /** docx 文件地址 */
9
+ file?: string;
10
+ /** docx 文件名 */
11
+ name?: string;
12
+ /** 是否内联展示 */
13
+ inline?: boolean;
14
+ /** 弹窗标题 */
15
+ title?: string;
16
+ /** 内容样式 */
17
+ style?: Record<string, any>;
18
+ }
19
+
20
+ declare const Word: FC<WordProps>;
21
+
22
+ export default Word;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zy-react-library",
3
3
  "private": false,
4
- "version": "2.0.14",
4
+ "version": "2.0.15",
5
5
  "type": "module",
6
6
  "description": "",
7
7
  "author": "LiuJiaNan",