neko-ui 1.0.6 → 1.0.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.
Files changed (77) hide show
  1. package/es/back-top/index.global.less +2 -2
  2. package/es/back-top/index.js +1 -1
  3. package/es/back-top/index.js.map +1 -1
  4. package/es/button/index.global.less +2 -2
  5. package/es/button/index.js +1 -1
  6. package/es/button/index.js.map +1 -1
  7. package/es/input/index.d.ts +2 -1
  8. package/es/input/index.js.map +1 -1
  9. package/es/marquee/index.global.less +41 -0
  10. package/es/tooltip/index.d.ts +7 -0
  11. package/es/tooltip/index.global.less +39 -0
  12. package/es/tooltip/index.js +2 -0
  13. package/es/tooltip/index.js.map +1 -0
  14. package/es/use-theme/index.js +1 -1
  15. package/es/use-theme/index.js.map +1 -1
  16. package/es/utils/document.d.ts +0 -10
  17. package/es/utils/document.js +1 -1
  18. package/es/utils/document.js.map +1 -1
  19. package/es/utils/download.d.ts +0 -1
  20. package/es/utils/download.js +1 -1
  21. package/es/utils/download.js.map +1 -1
  22. package/es/utils/index.d.ts +2 -2
  23. package/es/utils/index.js +1 -1
  24. package/es/utils/index.js.map +1 -1
  25. package/lib/avatar/index.global.css +0 -0
  26. package/lib/avatar/index.js +1 -1
  27. package/lib/back-top/index.global.css +0 -0
  28. package/lib/back-top/index.global.less +2 -2
  29. package/lib/back-top/index.js +1 -1
  30. package/lib/back-top/index.js.map +1 -1
  31. package/lib/button/index.global.css +0 -0
  32. package/lib/button/index.global.less +2 -2
  33. package/lib/button/index.js +1 -1
  34. package/lib/button/index.js.map +1 -1
  35. package/lib/capture-screen/index.global.css +0 -0
  36. package/lib/capture-screen/index.js +1 -1
  37. package/lib/cron-editor/index.global.css +0 -0
  38. package/lib/highlight-text/index.global.css +0 -0
  39. package/lib/highlight-text/index.js +1 -1
  40. package/lib/input/index.d.ts +2 -1
  41. package/lib/input/index.global.css +0 -0
  42. package/lib/input/index.js +1 -1
  43. package/lib/input/index.js.map +1 -1
  44. package/lib/markdown/copy.css +0 -0
  45. package/lib/markdown/icon.css +0 -0
  46. package/lib/markdown/index.global.css +0 -0
  47. package/lib/markdown/index.js +1 -1
  48. package/lib/markdown/md.css +0 -0
  49. package/lib/markdown/pre-code.css +0 -0
  50. package/lib/markdown/pre-viewer.css +0 -0
  51. package/lib/markdown/prism.js +1 -1
  52. package/lib/markdown/vars.css +0 -0
  53. package/lib/marquee/index.global.css +0 -0
  54. package/lib/marquee/index.global.less +41 -0
  55. package/lib/tag/index.global.css +0 -0
  56. package/lib/tag/index.js +1 -1
  57. package/lib/tooltip/index.d.ts +7 -0
  58. package/lib/tooltip/index.global.css +0 -0
  59. package/lib/tooltip/index.global.less +39 -0
  60. package/lib/tooltip/index.js +2 -0
  61. package/lib/tooltip/index.js.map +1 -0
  62. package/lib/use-theme/index.js +1 -1
  63. package/lib/use-theme/index.js.map +1 -1
  64. package/lib/utils/classname.js +1 -1
  65. package/lib/utils/document.d.ts +0 -10
  66. package/lib/utils/document.js +1 -1
  67. package/lib/utils/document.js.map +1 -1
  68. package/lib/utils/download.d.ts +0 -1
  69. package/lib/utils/download.js +1 -1
  70. package/lib/utils/download.js.map +1 -1
  71. package/lib/utils/index.d.ts +2 -2
  72. package/lib/utils/index.js +1 -1
  73. package/lib/utils/index.js.map +1 -1
  74. package/lib/variables.css +0 -0
  75. package/lib/wave-circle/index.global.css +0 -0
  76. package/lib/wave-circle/index.js +1 -1
  77. package/package.json +7 -3
@@ -2,7 +2,7 @@
2
2
 
3
3
  :root {
4
4
  --back-top-color: #fff;
5
- --back-top-bg: var(--text-color-secondary, @text-color-secondary);
5
+ --back-top-bg: var(--text-color-secondary);
6
6
  --back-top-hover-bg: var(--text-color, @text-color);
7
7
  }
8
8
 
@@ -45,7 +45,7 @@
45
45
  }
46
46
  }
47
47
 
48
- .@{prefix-cls}-out {
48
+ .@{prefix-cls}-back-top-out {
49
49
  animation: back-top-fade-out 1s forwards;
50
50
  }
51
51
 
@@ -1,2 +1,2 @@
1
- function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};return _extends.apply(this,arguments)}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key]}return target}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}import React,{memo,useCallback,useEffect,useMemo,useRef,useState}from"react";import{classNames,getMaxZindex,getPrefixCls,getScrollTop,isEqual,isFunction}from"../utils";import"./index.global.less";var BackTop=function(_param){var _target=_param.target,target=_target===void 0?function(){return window}:_target,_visibilityHeight=_param.visibilityHeight,visibilityHeight=_visibilityHeight===void 0?400:_visibilityHeight,className=_param.className,props=_objectWithoutProperties(_param,["target","visibilityHeight","className"]);var ref=useRef(null);var ref1=_slicedToArray(useState(null),2),show=ref1[0],setShow=ref1[1];var ref2=_slicedToArray(useState(false),2),init=ref2[0],setInit=ref2[1];var handleScrollY=useCallback(function(){var scrollTop=0;var offsetHeight=0;if(isFunction(target)){var ele=target();if(ele){scrollTop=getScrollTop(ele);offsetHeight=ele.offsetHeight}ele=null}else{scrollTop=getScrollTop();offsetHeight=document.documentElement.offsetHeight||document.body.offsetHeight}var nextShow=scrollTop>offsetHeight/3||scrollTop>visibilityHeight;if(Boolean(show)!==nextShow){setShow(nextShow)}},[show,target,visibilityHeight]);var handleBackTop=useCallback(function(){var ref;(ref=target())===null||ref===void 0?void 0:ref.scrollTo({top:0,behavior:"smooth"})},[target]);React.useEffect(function(){var timer;var outing=show===false;if(show&&ref.current){ref.current.style.zIndex=getMaxZindex().toString()}if(init){if(outing){timer=setTimeout(function(){setShow(null);clearTimeout(timer)},1e3)}}else{if(outing){setShow(null)}setInit(true)}return function(){clearTimeout(timer)}},[init,show]);useEffect(function(){if(isFunction(target)){var ref;(ref=target())===null||ref===void 0?void 0:ref.addEventListener("scroll",handleScrollY,false)}return function(){if(isFunction(target)){var ref;(ref=target())===null||ref===void 0?void 0:ref.removeEventListener("scroll",handleScrollY,false)}}},[handleScrollY,target]);var cls=useMemo(function(){return classNames([getPrefixCls("back-top"),className,!show&&getPrefixCls("out")])},[className,show]);return show===null?null:React.createElement("div",_extends({},props,{ref:ref,className:cls,onClick:handleBackTop}))};export default memo(BackTop,isEqual);
1
+ function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};return _extends.apply(this,arguments)}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key]}return target}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}import React,{memo,useCallback,useEffect,useMemo,useRef,useState}from"react";import ReactDOM from"react-dom";import{classNames,getMaxZindex,getPrefixCls,getScrollTop,isEqual,isFunction}from"../utils";import"./index.global.less";var BackTop=function(_param){var _target=_param.target,target=_target===void 0?function(){return window}:_target,_visibilityHeight=_param.visibilityHeight,visibilityHeight=_visibilityHeight===void 0?400:_visibilityHeight,className=_param.className,props=_objectWithoutProperties(_param,["target","visibilityHeight","className"]);var ref=useRef(null);var ref1=_slicedToArray(useState(null),2),show=ref1[0],setShow=ref1[1];var handleScrollY=useCallback(function(){var scrollTop=0;var offsetHeight=0;if(isFunction(target)){var ele=target();if(ele){scrollTop=getScrollTop(ele);offsetHeight=ele.offsetHeight}}var nextShow=scrollTop>offsetHeight/3||scrollTop>visibilityHeight;if(Boolean(show)!==nextShow){setShow(nextShow)}},[show,target,visibilityHeight]);var handleBackTop=useCallback(function(){var ref;(ref=target())===null||ref===void 0?void 0:ref.scrollTo({top:0,behavior:"smooth"})},[target]);useEffect(function(){if(show&&ref.current){ref.current.style.zIndex=getMaxZindex().toString()}},[show]);useEffect(function(){if(isFunction(target)){var ref;(ref=target())===null||ref===void 0?void 0:ref.addEventListener("scroll",handleScrollY,false)}return function(){if(isFunction(target)){var ref;(ref=target())===null||ref===void 0?void 0:ref.removeEventListener("scroll",handleScrollY,false)}}},[handleScrollY,target]);var cls=useMemo(function(){return classNames([getPrefixCls("back-top"),className,!show&&getPrefixCls("back-top-out")])},[className,show]);var exit=useCallback(function(){if(show===false){setShow(null)}},[show]);var el=useMemo(function(){return React.createElement("div",_extends({},props,{ref:ref,onAnimationEnd:exit,className:cls,onClick:handleBackTop}))},[cls,exit,handleBackTop,props]);return show===null?null:ReactDOM.createPortal(el,target())};export default memo(BackTop,isEqual);
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../components/back-top/index.tsx"],"sourcesContent":["import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n classNames,\n getMaxZindex,\n getPrefixCls,\n getScrollTop,\n isEqual,\n isFunction,\n} from '../utils';\nimport './index.global.less';\n\nexport interface BackTopProps extends React.HTMLAttributes<HTMLDivElement> {\n /** 设置需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 */\n target?: () => HTMLElement;\n /** 滚动高度达到此参数值才出现 BackTop */\n visibilityHeight?: number;\n}\n\nconst BackTop: React.FC<BackTopProps> = ({\n target = () => window as unknown as HTMLElement,\n visibilityHeight = 400,\n className,\n ...props\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n const [show, setShow] = useState<boolean | null>(null);\n const [init, setInit] = useState<boolean>(false);\n const handleScrollY = useCallback(() => {\n let scrollTop: number | null = 0;\n let offsetHeight: number | null = 0;\n\n if (isFunction(target)) {\n let ele: HTMLElement | null = target();\n\n if (ele) {\n scrollTop = getScrollTop(ele);\n offsetHeight = ele.offsetHeight;\n }\n ele = null;\n } else {\n scrollTop = getScrollTop();\n offsetHeight = document.documentElement.offsetHeight || document.body.offsetHeight;\n }\n const nextShow: boolean = scrollTop > offsetHeight / 3 || scrollTop > visibilityHeight;\n\n if (Boolean(show) !== nextShow) {\n setShow(nextShow);\n }\n }, [show, target, visibilityHeight]);\n const handleBackTop = useCallback(() => {\n target()?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }, [target]);\n\n React.useEffect(() => {\n let timer: NodeJS.Timeout;\n const outing = show === false;\n\n if (show && ref.current) {\n ref.current.style.zIndex = getMaxZindex().toString();\n }\n if (init) {\n if (outing) {\n timer = setTimeout(() => {\n setShow(null);\n clearTimeout(timer);\n }, 1000);\n }\n } else {\n if (outing) {\n setShow(null);\n }\n setInit(true);\n }\n return () => {\n clearTimeout(timer);\n };\n }, [init, show]);\n useEffect(() => {\n if (isFunction(target)) {\n target()?.addEventListener('scroll', handleScrollY, false);\n }\n return () => {\n if (isFunction(target)) {\n target()?.removeEventListener('scroll', handleScrollY, false);\n }\n };\n }, [handleScrollY, target]);\n\n const cls = useMemo(\n () => classNames([getPrefixCls('back-top'), className, !show && getPrefixCls('out')]),\n [className, show]\n );\n\n return show === null ? null : (\n <div {...props} ref={ref} className={cls} onClick={handleBackTop} />\n );\n};\n\nexport default memo(BackTop, isEqual);\n"],"names":["React","memo","useCallback","useEffect","useMemo","useRef","useState","classNames","getMaxZindex","getPrefixCls","getScrollTop","isEqual","isFunction","BackTop","target","window","visibilityHeight","className","props","ref","show","setShow","init","setInit","handleScrollY","scrollTop","offsetHeight","ele","document","documentElement","body","nextShow","Boolean","handleBackTop","scrollTo","top","behavior","timer","outing","current","style","zIndex","toString","setTimeout","clearTimeout","addEventListener","removeEventListener","cls","div","onClick"],"mappings":"AAAA,mxEAAA,OAAOA,OAASC,IAAI,CAAEC,WAAW,CAAEC,SAAS,CAAEC,OAAO,CAAEC,MAAM,CAAEC,QAAQ,KAAQ,OAAQ,AACvF,QACEC,UAAU,CACVC,YAAY,CACZC,YAAY,CACZC,YAAY,CACZC,OAAO,CACPC,UAAU,KACL,UAAW,AAClB,OAAO,qBAAsB,CAS7B,IAAMC,QAAkC,gBAKlC,oBAJJC,OAAAA,wBAAS,kBAAMC,yCACfC,iBAAAA,4CAAmB,sBACnBC,iBAAAA,UACGC,uCAHHJ,SACAE,mBACAC,cAGA,IAAME,IAAMd,OAAuB,IAAI,EACvC,IAAwBC,oBAAAA,SAAyB,IAAI,KAA9Cc,KAAiBd,QAAXe,QAAWf,QACxB,IAAwBA,oBAAAA,SAAkB,KAAK,KAAxCgB,KAAiBhB,QAAXiB,QAAWjB,QACxB,IAAMkB,cAAgBtB,YAAY,UAAM,CACtC,IAAIuB,UAA2B,EAC/B,IAAIC,aAA8B,EAElC,GAAId,WAAWE,QAAS,CACtB,IAAIa,IAA0Bb,SAE9B,GAAIa,IAAK,CACPF,UAAYf,aAAaiB,KACzBD,aAAeC,IAAID,YAAY,AACjC,CAAC,AACDC,IAAM,IAAI,AACZ,KAAO,CACLF,UAAYf,eACZgB,aAAeE,SAASC,eAAe,CAACH,YAAY,EAAIE,SAASE,IAAI,CAACJ,YAAY,AACpF,CAAC,AACD,IAAMK,SAAoBN,UAAYC,aAAe,GAAKD,UAAYT,iBAEtE,GAAIgB,QAAQZ,QAAUW,SAAU,CAC9BV,QAAQU,SACV,CAAC,AACH,EAAG,CAACX,KAAMN,OAAQE,iBAAiB,EACnC,IAAMiB,cAAgB/B,YAAY,UAAM,KACtCY,GAAAA,EAAAA,IAAAA,kBAAAA,aAAAA,KAAAA,EAAAA,IAAUoB,SAAS,CACjBC,IAAK,EACLC,SAAU,QACZ,EACF,EAAG,CAACtB,OAAO,EAEXd,MAAMG,SAAS,CAAC,UAAM,CACpB,IAAIkC,MACJ,IAAMC,OAASlB,OAAS,KAAK,CAE7B,GAAIA,MAAQD,IAAIoB,OAAO,CAAE,CACvBpB,IAAIoB,OAAO,CAACC,KAAK,CAACC,MAAM,CAAGjC,eAAekC,QAAQ,EACpD,CAAC,AACD,GAAIpB,KAAM,CACR,GAAIgB,OAAQ,CACVD,MAAQM,WAAW,UAAM,CACvBtB,QAAQ,IAAI,EACZuB,aAAaP,MACf,EAAG,IACL,CAAC,AACH,KAAO,CACL,GAAIC,OAAQ,CACVjB,QAAQ,IAAI,CACd,CAAC,AACDE,QAAQ,IAAI,CACd,CAAC,AACD,OAAO,UAAM,CACXqB,aAAaP,MACf,CACF,EAAG,CAACf,KAAMF,KAAK,EACfjB,UAAU,UAAM,CACd,GAAIS,WAAWE,QAAS,KACtBA,GAAAA,EAAAA,IAAAA,kBAAAA,aAAAA,KAAAA,EAAAA,IAAU+B,iBAAiB,SAAUrB,cAAe,KAAK,CAC3D,CAAC,AACD,OAAO,UAAM,CACX,GAAIZ,WAAWE,QAAS,KACtBA,GAAAA,EAAAA,IAAAA,kBAAAA,aAAAA,KAAAA,EAAAA,IAAUgC,oBAAoB,SAAUtB,cAAe,KAAK,CAC9D,CAAC,AACH,CACF,EAAG,CAACA,cAAeV,OAAO,EAE1B,IAAMiC,IAAM3C,QACV,kBAAMG,WAAW,CAACE,aAAa,YAAaQ,UAAW,CAACG,MAAQX,aAAa,OAAO,GACpF,CAACQ,UAAWG,KAAK,EAGnB,OAAOA,OAAS,IAAI,CAAG,IAAI,CACzB,oBAAC4B,kBAAQ9B,OAAOC,IAAKA,IAAKF,UAAW8B,IAAKE,QAAShB,gBACpD,AACH,CAEA,gBAAehC,KAAKY,QAASF,QAAS"}
1
+ {"version":3,"sources":["../../components/back-top/index.tsx"],"sourcesContent":["import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport ReactDOM from 'react-dom';\nimport {\n classNames,\n getMaxZindex,\n getPrefixCls,\n getScrollTop,\n isEqual,\n isFunction,\n} from '../utils';\nimport './index.global.less';\n\nexport interface BackTopProps extends React.HTMLAttributes<HTMLDivElement> {\n /** 设置需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 */\n target?: () => HTMLElement;\n /** 滚动高度达到此参数值才出现 BackTop */\n visibilityHeight?: number;\n}\n\nconst BackTop: React.FC<BackTopProps> = ({\n target = () => window as unknown as HTMLElement,\n visibilityHeight = 400,\n className,\n ...props\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n const [show, setShow] = useState<boolean | null>(null);\n const handleScrollY = useCallback(() => {\n let scrollTop: number | null = 0;\n let offsetHeight: number | null = 0;\n\n if (isFunction(target)) {\n const ele: HTMLElement = target() as HTMLElement;\n\n if (ele) {\n scrollTop = getScrollTop(ele);\n offsetHeight = ele.offsetHeight;\n }\n }\n const nextShow: boolean = scrollTop > offsetHeight / 3 || scrollTop > visibilityHeight;\n\n if (Boolean(show) !== nextShow) {\n setShow(nextShow);\n }\n }, [show, target, visibilityHeight]);\n const handleBackTop = useCallback(() => {\n target()?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }, [target]);\n\n useEffect(() => {\n if (show && ref.current) {\n ref.current.style.zIndex = getMaxZindex().toString();\n }\n }, [show]);\n useEffect(() => {\n if (isFunction(target)) {\n target()?.addEventListener('scroll', handleScrollY, false);\n }\n return () => {\n if (isFunction(target)) {\n target()?.removeEventListener('scroll', handleScrollY, false);\n }\n };\n }, [handleScrollY, target]);\n\n const cls = useMemo(\n () => classNames([getPrefixCls('back-top'), className, !show && getPrefixCls('back-top-out')]),\n [className, show]\n );\n const exit = useCallback(() => {\n if (show === false) {\n setShow(null);\n }\n }, [show]);\n const el = useMemo(\n () => (\n <div {...props} ref={ref} onAnimationEnd={exit} className={cls} onClick={handleBackTop} />\n ),\n [cls, exit, handleBackTop, props]\n );\n\n return show === null ? null : ReactDOM.createPortal(el, target());\n};\n\nexport default memo(BackTop, isEqual);\n"],"names":["React","memo","useCallback","useEffect","useMemo","useRef","useState","ReactDOM","classNames","getMaxZindex","getPrefixCls","getScrollTop","isEqual","isFunction","BackTop","target","window","visibilityHeight","className","props","ref","show","setShow","handleScrollY","scrollTop","offsetHeight","ele","nextShow","Boolean","handleBackTop","scrollTo","top","behavior","current","style","zIndex","toString","addEventListener","removeEventListener","cls","exit","el","div","onAnimationEnd","onClick","createPortal"],"mappings":"AAAA,mxEAAA,OAAOA,OAASC,IAAI,CAAEC,WAAW,CAAEC,SAAS,CAAEC,OAAO,CAAEC,MAAM,CAAEC,QAAQ,KAAQ,OAAQ,AACvF,QAAOC,aAAc,WAAY,AACjC,QACEC,UAAU,CACVC,YAAY,CACZC,YAAY,CACZC,YAAY,CACZC,OAAO,CACPC,UAAU,KACL,UAAW,AAClB,OAAO,qBAAsB,CAS7B,IAAMC,QAAkC,gBAKlC,oBAJJC,OAAAA,wBAAS,kBAAMC,yCACfC,iBAAAA,4CAAmB,sBACnBC,iBAAAA,UACGC,uCAHHJ,SACAE,mBACAC,cAGA,IAAME,IAAMf,OAAuB,IAAI,EACvC,IAAwBC,oBAAAA,SAAyB,IAAI,KAA9Ce,KAAiBf,QAAXgB,QAAWhB,QACxB,IAAMiB,cAAgBrB,YAAY,UAAM,CACtC,IAAIsB,UAA2B,EAC/B,IAAIC,aAA8B,EAElC,GAAIZ,WAAWE,QAAS,CACtB,IAAMW,IAAmBX,SAEzB,GAAIW,IAAK,CACPF,UAAYb,aAAae,KACzBD,aAAeC,IAAID,YAAY,AACjC,CAAC,AACH,CAAC,AACD,IAAME,SAAoBH,UAAYC,aAAe,GAAKD,UAAYP,iBAEtE,GAAIW,QAAQP,QAAUM,SAAU,CAC9BL,QAAQK,SACV,CAAC,AACH,EAAG,CAACN,KAAMN,OAAQE,iBAAiB,EACnC,IAAMY,cAAgB3B,YAAY,UAAM,KACtCa,GAAAA,EAAAA,IAAAA,kBAAAA,aAAAA,KAAAA,EAAAA,IAAUe,SAAS,CACjBC,IAAK,EACLC,SAAU,QACZ,EACF,EAAG,CAACjB,OAAO,EAEXZ,UAAU,UAAM,CACd,GAAIkB,MAAQD,IAAIa,OAAO,CAAE,CACvBb,IAAIa,OAAO,CAACC,KAAK,CAACC,MAAM,CAAG1B,eAAe2B,QAAQ,EACpD,CAAC,AACH,EAAG,CAACf,KAAK,EACTlB,UAAU,UAAM,CACd,GAAIU,WAAWE,QAAS,KACtBA,GAAAA,EAAAA,IAAAA,kBAAAA,aAAAA,KAAAA,EAAAA,IAAUsB,iBAAiB,SAAUd,cAAe,KAAK,CAC3D,CAAC,AACD,OAAO,UAAM,CACX,GAAIV,WAAWE,QAAS,KACtBA,GAAAA,EAAAA,IAAAA,kBAAAA,aAAAA,KAAAA,EAAAA,IAAUuB,oBAAoB,SAAUf,cAAe,KAAK,CAC9D,CAAC,AACH,CACF,EAAG,CAACA,cAAeR,OAAO,EAE1B,IAAMwB,IAAMnC,QACV,kBAAMI,WAAW,CAACE,aAAa,YAAaQ,UAAW,CAACG,MAAQX,aAAa,gBAAgB,GAC7F,CAACQ,UAAWG,KAAK,EAEnB,IAAMmB,KAAOtC,YAAY,UAAM,CAC7B,GAAImB,OAAS,KAAK,CAAE,CAClBC,QAAQ,IAAI,CACd,CAAC,AACH,EAAG,CAACD,KAAK,EACT,IAAMoB,GAAKrC,QACT,kBACE,oBAACsC,kBAAQvB,OAAOC,IAAKA,IAAKuB,eAAgBH,KAAMtB,UAAWqB,IAAKK,QAASf,kBAE3E,CAACU,IAAKC,KAAMX,cAAeV,MAAM,EAGnC,OAAOE,OAAS,IAAI,CAAG,IAAI,CAAGd,SAASsC,YAAY,CAACJ,GAAI1B,SAAS,AACnE,CAEA,gBAAed,KAAKa,QAASF,QAAS"}
@@ -36,6 +36,7 @@
36
36
  }
37
37
  .@{prefix-cls}-btn {
38
38
  --wave-shadow-color: var(--primary-color-outline);
39
+ outline-offset: 4px;
39
40
  display: inline-block;
40
41
  width: fit-content;
41
42
  min-width: 22px;
@@ -134,7 +135,7 @@
134
135
  border-radius: 50% !important;
135
136
  text-align: center;
136
137
 
137
- span {
138
+ .@{prefix-cls}-btn-text {
138
139
  display: block;
139
140
  white-space: nowrap;
140
141
  text-overflow: ellipsis;
@@ -172,7 +173,6 @@
172
173
  &:last-child {
173
174
  margin-right: 0;
174
175
  }
175
-
176
176
  }
177
177
 
178
178
  @keyframes wave-effect {
@@ -1,2 +1,2 @@
1
- function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};return _extends.apply(this,arguments)}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key]}return target}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}import React,{useCallback,useMemo,useRef}from"react";import{classNames,getPrefixCls,isFunction}from"../utils";import"./index.global.less";var Button=function(_param){var infinite=_param.infinite,ghost=_param.ghost,fill=_param.fill,circle=_param.circle,dashed=_param.dashed,float=_param.float,link=_param.link,className=_param.className,children=_param.children,disabled=_param.disabled,onClick=_param.onClick,type=_param.type,props=_objectWithoutProperties(_param,["infinite","ghost","fill","circle","dashed","float","link","className","children","disabled","onClick","type"]);var ref=useRef(null);var ref1=_slicedToArray(React.useState(false),2),animating=ref1[0],setAnimating=ref1[1];var handleClick=useCallback(function(e){if(disabled)return;setAnimating(true);if(isFunction(onClick)){onClick(e)}},[disabled,onClick]);var cls=useMemo(function(){return classNames([getPrefixCls("btn"),type&&getPrefixCls("btn-".concat(type)),infinite&&getPrefixCls("btn-infinite"),ghost&&getPrefixCls("btn-ghost"),fill&&getPrefixCls("btn-fill"),circle&&getPrefixCls("btn-circle"),dashed&&getPrefixCls("btn-dashed"),float&&getPrefixCls("btn-float"),animating&&getPrefixCls("btn-without"),disabled&&getPrefixCls("btn-disabled"),link&&getPrefixCls("btn-link"),className])},[type,infinite,ghost,fill,circle,dashed,float,animating,disabled,link,className]);var handleAnimationEnd=useCallback(function(){setAnimating(false)},[]);return React.createElement("div",_extends({},props,{className:cls,onClick:handleClick,onAnimationEnd:handleAnimationEnd,ref:ref}),React.createElement("span",null,children))};export default Button;
1
+ function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};return _extends.apply(this,arguments)}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key]}return target}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}import React,{useCallback,useMemo,useRef}from"react";import{classNames,getPrefixCls,isFunction}from"../utils";import"./index.global.less";var Button=function(_param){var infinite=_param.infinite,ghost=_param.ghost,fill=_param.fill,circle=_param.circle,dashed=_param.dashed,float=_param.float,link=_param.link,className=_param.className,children=_param.children,disabled=_param.disabled,onClick=_param.onClick,type=_param.type,props=_objectWithoutProperties(_param,["infinite","ghost","fill","circle","dashed","float","link","className","children","disabled","onClick","type"]);var ref=useRef(null);var ref1=_slicedToArray(React.useState(false),2),animating=ref1[0],setAnimating=ref1[1];var handleClick=useCallback(function(e){if(disabled)return;setAnimating(true);if(isFunction(onClick)){onClick(e)}},[disabled,onClick]);var cls=useMemo(function(){return classNames([getPrefixCls("btn"),type&&getPrefixCls("btn-".concat(type)),infinite&&getPrefixCls("btn-infinite"),ghost&&getPrefixCls("btn-ghost"),fill&&getPrefixCls("btn-fill"),circle&&getPrefixCls("btn-circle"),dashed&&getPrefixCls("btn-dashed"),float&&getPrefixCls("btn-float"),animating&&getPrefixCls("btn-without"),disabled&&getPrefixCls("btn-disabled"),link&&getPrefixCls("btn-link"),className])},[type,infinite,ghost,fill,circle,dashed,float,animating,disabled,link,className]);var handleAnimationEnd=useCallback(function(){setAnimating(false)},[]);return React.createElement("div",_extends({},props,{className:cls,onClick:handleClick,onAnimationEnd:handleAnimationEnd,ref:ref}),React.createElement("span",{className:getPrefixCls("btn-text")},children))};export default Button;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../components/button/index.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useRef } from 'react';\nimport { classNames, getPrefixCls, isFunction } from '../utils';\nimport './index.global.less';\n\nexport type ButtonType = 'success' | 'error' | 'danger' | 'primary' | 'warning' | 'default';\n\nexport interface ButtonProps extends React.HTMLAttributes<HTMLDivElement> {\n /** 按钮类型 */\n type?: ButtonType;\n /** 无限动画 */\n infinite?: boolean;\n /** 透明背景 */\n ghost?: boolean;\n /** 实色背景 */\n fill?: boolean;\n /** 圆形按钮 */\n circle?: boolean;\n /** 虚线按钮 */\n dashed?: boolean;\n /** 只有文字的按钮 */\n float?: boolean;\n /** 禁用按钮 */\n disabled?: boolean;\n /** 链接按钮 */\n link?: boolean;\n}\n\nconst Button: React.FC<ButtonProps> = ({\n infinite,\n ghost,\n fill,\n circle,\n dashed,\n float,\n link,\n className,\n children,\n disabled,\n onClick,\n type,\n ...props\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n const [animating, setAnimating] = React.useState(false);\n\n const handleClick: React.MouseEventHandler<HTMLDivElement> = useCallback(\n (e) => {\n if (disabled) return;\n setAnimating(true);\n if (isFunction(onClick)) {\n onClick(e);\n }\n },\n [disabled, onClick]\n );\n const cls = useMemo(\n () =>\n classNames([\n getPrefixCls('btn'),\n type && getPrefixCls(`btn-${type}`),\n infinite && getPrefixCls('btn-infinite'),\n ghost && getPrefixCls('btn-ghost'),\n fill && getPrefixCls('btn-fill'),\n circle && getPrefixCls('btn-circle'),\n dashed && getPrefixCls('btn-dashed'),\n float && getPrefixCls('btn-float'),\n animating && getPrefixCls('btn-without'),\n disabled && getPrefixCls('btn-disabled'),\n link && getPrefixCls('btn-link'),\n className,\n ]),\n [type, infinite, ghost, fill, circle, dashed, float, animating, disabled, link, className]\n );\n const handleAnimationEnd = useCallback(() => {\n setAnimating(false);\n }, []);\n\n return (\n <div\n {...props}\n className={cls}\n onClick={handleClick}\n onAnimationEnd={handleAnimationEnd}\n ref={ref}\n >\n <span>{children}</span>\n </div>\n );\n};\n\nexport default Button;\n"],"names":["React","useCallback","useMemo","useRef","classNames","getPrefixCls","isFunction","Button","infinite","ghost","fill","circle","dashed","float","link","className","children","disabled","onClick","type","props","ref","useState","animating","setAnimating","handleClick","e","cls","handleAnimationEnd","div","onAnimationEnd","span"],"mappings":"AAAA,mxEAAA,OAAOA,OAASC,WAAW,CAAEC,OAAO,CAAEC,MAAM,KAAQ,OAAQ,AAC5D,QAASC,UAAU,CAAEC,YAAY,CAAEC,UAAU,KAAQ,UAAW,AAChE,OAAO,qBAAsB,CAyB7B,IAAMC,OAAgC,gBAchC,KAbJC,gBAAAA,SACAC,aAAAA,MACAC,YAAAA,KACAC,cAAAA,OACAC,cAAAA,OACAC,aAAAA,MACAC,YAAAA,KACAC,iBAAAA,UACAC,gBAAAA,SACAC,gBAAAA,SACAC,eAAAA,QACAC,YAAAA,KACGC,uCAZHZ,WACAC,QACAC,OACAC,SACAC,SACAC,QACAC,OACAC,YACAC,WACAC,WACAC,UACAC,SAGA,IAAME,IAAMlB,OAAuB,IAAI,EACvC,IAAkCH,oBAAAA,MAAMsB,QAAQ,CAAC,KAAK,KAA/CC,UAA2BvB,QAAhBwB,aAAgBxB,QAElC,IAAMyB,YAAuDxB,YAC3D,SAACyB,EAAM,CACL,GAAIT,SAAU,MAAO,CACrBO,aAAa,IAAI,EACjB,GAAIlB,WAAWY,SAAU,CACvBA,QAAQQ,EACV,CAAC,AACH,EACA,CAACT,SAAUC,QAAQ,EAErB,IAAMS,IAAMzB,QACV,kBACEE,WAAW,CACTC,aAAa,OACbc,MAAQd,aAAa,AAAC,OAAW,OAALc,OAC5BX,UAAYH,aAAa,gBACzBI,OAASJ,aAAa,aACtBK,MAAQL,aAAa,YACrBM,QAAUN,aAAa,cACvBO,QAAUP,aAAa,cACvBQ,OAASR,aAAa,aACtBkB,WAAalB,aAAa,eAC1BY,UAAYZ,aAAa,gBACzBS,MAAQT,aAAa,YACrBU,UACD,GACH,CAACI,KAAMX,SAAUC,MAAOC,KAAMC,OAAQC,OAAQC,MAAOU,UAAWN,SAAUH,KAAMC,UAAU,EAE5F,IAAMa,mBAAqB3B,YAAY,UAAM,CAC3CuB,aAAa,KAAK,CACpB,EAAG,EAAE,EAEL,OACE,oBAACK,kBACKT,OACJL,UAAWY,IACXT,QAASO,YACTK,eAAgBF,mBAChBP,IAAKA,MAEL,oBAACU,YAAMf,UAGb,CAEA,gBAAeT,MAAO"}
1
+ {"version":3,"sources":["../../components/button/index.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useRef } from 'react';\nimport { classNames, getPrefixCls, isFunction } from '../utils';\nimport './index.global.less';\n\nexport type ButtonType = 'success' | 'error' | 'danger' | 'primary' | 'warning' | 'default';\n\nexport interface ButtonProps extends React.HTMLAttributes<HTMLDivElement> {\n /** 按钮类型 */\n type?: ButtonType;\n /** 无限动画 */\n infinite?: boolean;\n /** 透明背景 */\n ghost?: boolean;\n /** 实色背景 */\n fill?: boolean;\n /** 圆形按钮 */\n circle?: boolean;\n /** 虚线按钮 */\n dashed?: boolean;\n /** 只有文字的按钮 */\n float?: boolean;\n /** 禁用按钮 */\n disabled?: boolean;\n /** 链接按钮 */\n link?: boolean;\n}\n\nconst Button: React.FC<ButtonProps> = ({\n infinite,\n ghost,\n fill,\n circle,\n dashed,\n float,\n link,\n className,\n children,\n disabled,\n onClick,\n type,\n ...props\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n const [animating, setAnimating] = React.useState(false);\n\n const handleClick: React.MouseEventHandler<HTMLDivElement> = useCallback(\n (e) => {\n if (disabled) return;\n setAnimating(true);\n if (isFunction(onClick)) {\n onClick(e);\n }\n },\n [disabled, onClick]\n );\n const cls = useMemo(\n () =>\n classNames([\n getPrefixCls('btn'),\n type && getPrefixCls(`btn-${type}`),\n infinite && getPrefixCls('btn-infinite'),\n ghost && getPrefixCls('btn-ghost'),\n fill && getPrefixCls('btn-fill'),\n circle && getPrefixCls('btn-circle'),\n dashed && getPrefixCls('btn-dashed'),\n float && getPrefixCls('btn-float'),\n animating && getPrefixCls('btn-without'),\n disabled && getPrefixCls('btn-disabled'),\n link && getPrefixCls('btn-link'),\n className,\n ]),\n [type, infinite, ghost, fill, circle, dashed, float, animating, disabled, link, className]\n );\n const handleAnimationEnd = useCallback(() => {\n setAnimating(false);\n }, []);\n\n return (\n <div\n {...props}\n className={cls}\n onClick={handleClick}\n onAnimationEnd={handleAnimationEnd}\n ref={ref}\n >\n <span className={getPrefixCls('btn-text')}>{children}</span>\n </div>\n );\n};\n\nexport default Button;\n"],"names":["React","useCallback","useMemo","useRef","classNames","getPrefixCls","isFunction","Button","infinite","ghost","fill","circle","dashed","float","link","className","children","disabled","onClick","type","props","ref","useState","animating","setAnimating","handleClick","e","cls","handleAnimationEnd","div","onAnimationEnd","span"],"mappings":"AAAA,mxEAAA,OAAOA,OAASC,WAAW,CAAEC,OAAO,CAAEC,MAAM,KAAQ,OAAQ,AAC5D,QAASC,UAAU,CAAEC,YAAY,CAAEC,UAAU,KAAQ,UAAW,AAChE,OAAO,qBAAsB,CAyB7B,IAAMC,OAAgC,gBAchC,KAbJC,gBAAAA,SACAC,aAAAA,MACAC,YAAAA,KACAC,cAAAA,OACAC,cAAAA,OACAC,aAAAA,MACAC,YAAAA,KACAC,iBAAAA,UACAC,gBAAAA,SACAC,gBAAAA,SACAC,eAAAA,QACAC,YAAAA,KACGC,uCAZHZ,WACAC,QACAC,OACAC,SACAC,SACAC,QACAC,OACAC,YACAC,WACAC,WACAC,UACAC,SAGA,IAAME,IAAMlB,OAAuB,IAAI,EACvC,IAAkCH,oBAAAA,MAAMsB,QAAQ,CAAC,KAAK,KAA/CC,UAA2BvB,QAAhBwB,aAAgBxB,QAElC,IAAMyB,YAAuDxB,YAC3D,SAACyB,EAAM,CACL,GAAIT,SAAU,MAAO,CACrBO,aAAa,IAAI,EACjB,GAAIlB,WAAWY,SAAU,CACvBA,QAAQQ,EACV,CAAC,AACH,EACA,CAACT,SAAUC,QAAQ,EAErB,IAAMS,IAAMzB,QACV,kBACEE,WAAW,CACTC,aAAa,OACbc,MAAQd,aAAa,AAAC,OAAW,OAALc,OAC5BX,UAAYH,aAAa,gBACzBI,OAASJ,aAAa,aACtBK,MAAQL,aAAa,YACrBM,QAAUN,aAAa,cACvBO,QAAUP,aAAa,cACvBQ,OAASR,aAAa,aACtBkB,WAAalB,aAAa,eAC1BY,UAAYZ,aAAa,gBACzBS,MAAQT,aAAa,YACrBU,UACD,GACH,CAACI,KAAMX,SAAUC,MAAOC,KAAMC,OAAQC,OAAQC,MAAOU,UAAWN,SAAUH,KAAMC,UAAU,EAE5F,IAAMa,mBAAqB3B,YAAY,UAAM,CAC3CuB,aAAa,KAAK,CACpB,EAAG,EAAE,EAEL,OACE,oBAACK,kBACKT,OACJL,UAAWY,IACXT,QAASO,YACTK,eAAgBF,mBAChBP,IAAKA,MAEL,oBAACU,QAAKhB,UAAWV,aAAa,aAAcW,UAGlD,CAEA,gBAAeT,MAAO"}
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import './index.global.less';
3
- export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
3
+ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix'> {
4
4
  className?: string;
5
5
  suffix?: React.ReactNode;
6
+ prefix?: React.ReactNode;
6
7
  }
7
8
  declare const Input: React.FC<InputProps>;
8
9
  export default Input;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../components/input/index.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, getPrefixCls } from '../utils';\nimport './index.global.less';\n\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n className?: string;\n suffix?: React.ReactNode;\n}\n\nconst Input: React.FC<InputProps> = ({\n className,\n type = 'text',\n suffix,\n prefix,\n value,\n ...prpos\n}) => {\n return (\n <span\n className={classNames([\n getPrefixCls('input-wrapper'),\n getPrefixCls(`input-${type}`),\n className,\n ])}\n >\n {prefix && <span className={getPrefixCls('input-prefix')}>{prefix}</span>}\n <input value={value} className={getPrefixCls('input')} type={type} {...prpos} />\n {suffix && <span className={getPrefixCls('input-suffix')}>{suffix}</span>}\n </span>\n );\n};\n\nexport default Input;\n"],"names":["React","classNames","getPrefixCls","Input","className","type","suffix","prefix","value","prpos","span","input"],"mappings":"AAAA,w9BAAA,OAAOA,UAAW,OAAQ,AAC1B,QAASC,UAAU,CAAEC,YAAY,KAAQ,UAAW,AACpD,OAAO,qBAAsB,CAO7B,IAAMC,MAA8B,gBAO9B,KANJC,iBAAAA,uBACAC,KAAAA,oBAAO,aACPC,cAAAA,OACAC,cAAAA,OACAC,aAAAA,MACGC,uCALHL,YACAC,OACAC,SACAC,SACAC,UAGA,OACE,oBAACE,QACCN,UAAWH,WAAW,CACpBC,aAAa,iBACbA,aAAa,AAAC,SAAa,OAALG,OACtBD,UACD,GAEAG,QAAU,oBAACG,QAAKN,UAAWF,aAAa,iBAAkBK,QAC3D,oBAACI,kBAAMH,MAAOA,MAAOJ,UAAWF,aAAa,SAAUG,KAAMA,MAAUI,QACtEH,QAAU,oBAACI,QAAKN,UAAWF,aAAa,iBAAkBI,QAGjE,CAEA,gBAAeH,KAAM"}
1
+ {"version":3,"sources":["../../components/input/index.tsx"],"sourcesContent":["import React from 'react';\nimport { classNames, getPrefixCls } from '../utils';\nimport './index.global.less';\n\nexport interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix'> {\n className?: string;\n suffix?: React.ReactNode;\n prefix?: React.ReactNode;\n}\n\nconst Input: React.FC<InputProps> = ({\n className,\n type = 'text',\n suffix,\n prefix,\n value,\n ...prpos\n}) => {\n return (\n <span\n className={classNames([\n getPrefixCls('input-wrapper'),\n getPrefixCls(`input-${type}`),\n className,\n ])}\n >\n {prefix && <span className={getPrefixCls('input-prefix')}>{prefix}</span>}\n <input value={value} className={getPrefixCls('input')} type={type} {...prpos} />\n {suffix && <span className={getPrefixCls('input-suffix')}>{suffix}</span>}\n </span>\n );\n};\n\nexport default Input;\n"],"names":["React","classNames","getPrefixCls","Input","className","type","suffix","prefix","value","prpos","span","input"],"mappings":"AAAA,w9BAAA,OAAOA,UAAW,OAAQ,AAC1B,QAASC,UAAU,CAAEC,YAAY,KAAQ,UAAW,AACpD,OAAO,qBAAsB,CAQ7B,IAAMC,MAA8B,gBAO9B,KANJC,iBAAAA,uBACAC,KAAAA,oBAAO,aACPC,cAAAA,OACAC,cAAAA,OACAC,aAAAA,MACGC,uCALHL,YACAC,OACAC,SACAC,SACAC,UAGA,OACE,oBAACE,QACCN,UAAWH,WAAW,CACpBC,aAAa,iBACbA,aAAa,AAAC,SAAa,OAALG,OACtBD,UACD,GAEAG,QAAU,oBAACG,QAAKN,UAAWF,aAAa,iBAAkBK,QAC3D,oBAACI,kBAAMH,MAAOA,MAAOJ,UAAWF,aAAa,SAAUG,KAAMA,MAAUI,QACtEH,QAAU,oBAACI,QAAKN,UAAWF,aAAa,iBAAkBI,QAGjE,CAEA,gBAAeH,KAAM"}
@@ -0,0 +1,41 @@
1
+ .wrap {
2
+ position: relative;
3
+ width: 100%;
4
+ height: 32px;
5
+ margin: 10% auto;
6
+ font-size: 0;
7
+ overflow: hidden;
8
+ box-sizing: border-box;
9
+
10
+ .cont {
11
+ position: absolute;
12
+ top: 0;
13
+ left: 0;
14
+ width: 200%;
15
+ animation: 5s move infinite linear;
16
+ }
17
+
18
+ .txt {
19
+ display: inline-block;
20
+ width: 50%;
21
+ border-left: 1px solid #fff;
22
+ text-align: center;
23
+ margin-top: 5px;
24
+ }
25
+
26
+ &:hover {
27
+ .cont {
28
+ animation-play-state: paused;
29
+ }
30
+ }
31
+ }
32
+
33
+ @keyframes move {
34
+ 0% {
35
+ left: 0;
36
+ }
37
+
38
+ 100% {
39
+ left: -100%;
40
+ }
41
+ }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import './index.global.less';
3
+ export interface TooltipProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ className?: string;
5
+ }
6
+ declare const _default: React.NamedExoticComponent<TooltipProps>;
7
+ export default _default;
@@ -0,0 +1,39 @@
1
+ .tooltip {
2
+ position: relative;
3
+ background: #000;
4
+ color: #fff;
5
+ padding: 8px 16px;
6
+ border-radius: 4px;
7
+ font-size: 14px;
8
+ filter:
9
+ drop-shadow(
10
+ 1px 2px 8px hsla(220deg, 0%, 0%, 0.3)
11
+ )
12
+ drop-shadow(
13
+ 2px 4px 16px hsla(220deg, 0%, 0%, 0.3)
14
+ )
15
+ drop-shadow(
16
+ 4px 8px 32px hsla(220deg, 0%, 0%, 0.3)
17
+ );
18
+
19
+ &::before {
20
+ content: '';
21
+ position: absolute;
22
+ bottom: 0;
23
+ left: 0;
24
+ right: 0;
25
+ margin: auto;
26
+ width: 16px;
27
+ height: 10px;
28
+ background: inherit;
29
+ clip-path: polygon(
30
+ 0% 0%,
31
+ 50% 100%,
32
+ 100% 0%
33
+ );
34
+ transform: translateY(
35
+ calc(+100% - 1px)
36
+ );
37
+ }
38
+
39
+ }
@@ -0,0 +1,2 @@
1
+ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};return _extends.apply(this,arguments)}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key]}return target}import React,{memo,useMemo}from"react";import{classNames,getPrefixCls,isEqual}from"../utils";import"./index.global.less";var Tooltip=function(_param){var className=_param.className,children=_param.children,props=_objectWithoutProperties(_param,["className","children"]);var cls=useMemo(function(){return classNames([getPrefixCls("tooltip"),className])},[className]);return React.createElement("div",_extends({className:cls,role:"tooltip"},props),children)};export default memo(Tooltip,isEqual);
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../components/tooltip/index.tsx"],"sourcesContent":["import React, { memo, useMemo } from 'react';\nimport { classNames, getPrefixCls, isEqual } from '../utils';\nimport './index.global.less';\n\nexport interface TooltipProps extends React.HTMLAttributes<HTMLDivElement> {\n className?: string;\n}\n\nconst Tooltip: React.FC<TooltipProps> = ({ className, children, ...props }) => {\n const cls = useMemo(() => classNames([getPrefixCls('tooltip'), className]), [className]);\n\n return (\n <div className={cls} role=\"tooltip\" {...props}>\n {children}\n </div>\n );\n};\n\nexport default memo(Tooltip, isEqual);\n"],"names":["React","memo","useMemo","classNames","getPrefixCls","isEqual","Tooltip","className","children","props","cls","div","role"],"mappings":"AAAA,w9BAAA,OAAOA,OAASC,IAAI,CAAEC,OAAO,KAAQ,OAAQ,AAC7C,QAASC,UAAU,CAAEC,YAAY,CAAEC,OAAO,KAAQ,UAAW,AAC7D,OAAO,qBAAsB,CAM7B,IAAMC,QAAkC,gBAAuC,KAApCC,iBAAAA,UAAWC,gBAAAA,SAAaC,uCAAxBF,YAAWC,aACpD,IAAME,IAAMR,QAAQ,kBAAMC,WAAW,CAACC,aAAa,WAAYG,UAAU,GAAG,CAACA,UAAU,EAEvF,OACE,oBAACI,gBAAIJ,UAAWG,IAAKE,KAAK,WAAcH,OACrCD,SAGP,CAEA,gBAAeP,KAAKK,QAASD,QAAS"}
@@ -1,2 +1,2 @@
1
- function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}import{useEffect,useState,useCallback}from"react";var themeMedia=window.matchMedia("(prefers-color-scheme: light)");var useTheme=function(){var ref=_slicedToArray(useState(themeMedia.matches?"light":"dark"),2),theme=ref[0],setTheme=ref[1];var handleTheme=useCallback(function(param){var matches=param.matches;var type=matches?"light":"dark";setTheme(type)},[setTheme]);var changeTheme=useCallback(function(color){handleTheme({matches:color==="light"})},[handleTheme]);useEffect(function(){themeMedia.addEventListener("change",handleTheme);return function(){themeMedia.removeEventListener("change",handleTheme)}},[handleTheme]);useEffect(function(){if(document.documentElement.getAttribute("data-theme")!==theme){document.documentElement.setAttribute("data-theme",theme)}},[theme]);return[theme,changeTheme]};export default useTheme;
1
+ function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}import{useEffect,useState,useCallback,useRef}from"react";var useTheme=function(){var themeMedia=useRef(window.matchMedia("(prefers-color-scheme: light)"));var ref=_slicedToArray(useState(function(){var ref;return((ref=themeMedia.current)===null||ref===void 0?void 0:ref.matches)?"light":"dark"}),2),theme=ref[0],setTheme=ref[1];var handleTheme=useCallback(function(param){var matches=param.matches;var type=matches?"light":"dark";setTheme(type)},[setTheme]);var changeTheme=useCallback(function(color){handleTheme({matches:color==="light"})},[handleTheme]);useEffect(function(){var mediaQueryList=themeMedia.current;themeMedia.current.addEventListener("change",handleTheme);return function(){mediaQueryList===null||mediaQueryList===void 0?void 0:mediaQueryList.removeEventListener("change",handleTheme)}},[handleTheme]);useEffect(function(){if(document.documentElement.getAttribute("data-theme")!==theme){document.documentElement.setAttribute("data-theme",theme)}},[theme]);return[theme,changeTheme]};export default useTheme;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../components/use-theme/index.ts"],"sourcesContent":["import { useEffect, useState, useCallback } from 'react';\n\nexport interface ThemeTypes {\n type: 'light' | 'dark';\n}\n\n// eslint-disable-next-line no-unused-vars\ntype UseThemeType = [ThemeTypes['type'], (type: ThemeTypes['type']) => void];\n\nconst themeMedia = window.matchMedia('(prefers-color-scheme: light)');\n/**\n * 主题 hooks\n * @returns {UseThemeType} theme and setTheme\n */\nconst useTheme = (): UseThemeType => {\n const [theme, setTheme] = useState<ThemeTypes['type']>(themeMedia.matches ? 'light' : 'dark');\n const handleTheme = useCallback(\n ({ matches }: { matches: boolean }) => {\n const type = matches ? 'light' : 'dark';\n\n setTheme(type);\n },\n [setTheme]\n );\n\n const changeTheme = useCallback(\n (color: ThemeTypes['type']) => {\n handleTheme({ matches: color === 'light' });\n },\n [handleTheme]\n );\n\n useEffect(() => {\n themeMedia.addEventListener('change', handleTheme);\n return () => {\n themeMedia.removeEventListener('change', handleTheme);\n };\n }, [handleTheme]);\n useEffect(() => {\n if (document.documentElement.getAttribute('data-theme') !== theme) {\n document.documentElement.setAttribute('data-theme', theme);\n }\n }, [theme]);\n return [theme, changeTheme];\n};\n\nexport default useTheme;\n"],"names":["useEffect","useState","useCallback","themeMedia","window","matchMedia","useTheme","matches","theme","setTheme","handleTheme","type","changeTheme","color","addEventListener","removeEventListener","document","documentElement","getAttribute","setAttribute"],"mappings":"AAAA,2zCAAA,OAASA,SAAS,CAAEC,QAAQ,CAAEC,WAAW,KAAQ,OAAQ,CASzD,IAAMC,WAAaC,OAAOC,UAAU,CAAC,iCAKrC,IAAMC,SAAW,UAAoB,CACnC,IAA0BL,mBAAAA,SAA6BE,WAAWI,OAAO,CAAG,QAAU,MAAM,KAArFC,MAAmBP,OAAZQ,SAAYR,OAC1B,IAAMS,YAAcR,YAClB,eAAuC,KAApCK,cAAAA,QACD,IAAMI,KAAOJ,QAAU,QAAU,MAAM,CAEvCE,SAASE,KACX,EACA,CAACF,SAAS,EAGZ,IAAMG,YAAcV,YAClB,SAACW,MAA8B,CAC7BH,YAAY,CAAEH,QAASM,QAAU,OAAQ,EAC3C,EACA,CAACH,YAAY,EAGfV,UAAU,UAAM,CACdG,WAAWW,gBAAgB,CAAC,SAAUJ,aACtC,OAAO,UAAM,CACXP,WAAWY,mBAAmB,CAAC,SAAUL,YAC3C,CACF,EAAG,CAACA,YAAY,EAChBV,UAAU,UAAM,CACd,GAAIgB,SAASC,eAAe,CAACC,YAAY,CAAC,gBAAkBV,MAAO,CACjEQ,SAASC,eAAe,CAACE,YAAY,CAAC,aAAcX,MACtD,CAAC,AACH,EAAG,CAACA,MAAM,EACV,MAAO,CAACA,MAAOI,YAAY,AAC7B,CAEA,gBAAeN,QAAS"}
1
+ {"version":3,"sources":["../../components/use-theme/index.ts"],"sourcesContent":["import { useEffect, useState, useCallback, useRef } from 'react';\n\nexport interface ThemeTypes {\n type: 'light' | 'dark';\n}\n\n// eslint-disable-next-line no-unused-vars\ntype UseThemeType = [ThemeTypes['type'], (type: ThemeTypes['type']) => void];\n\n/**\n * 主题 hooks\n * @returns {UseThemeType} theme and setTheme\n */\nconst useTheme = (): UseThemeType => {\n const themeMedia = useRef(window.matchMedia('(prefers-color-scheme: light)'));\n const [theme, setTheme] = useState<ThemeTypes['type']>(() =>\n themeMedia.current?.matches ? 'light' : 'dark'\n );\n const handleTheme = useCallback(\n ({ matches }: { matches: boolean }) => {\n const type = matches ? 'light' : 'dark';\n\n setTheme(type);\n },\n [setTheme]\n );\n\n const changeTheme = useCallback(\n (color: ThemeTypes['type']) => {\n handleTheme({ matches: color === 'light' });\n },\n [handleTheme]\n );\n\n useEffect(() => {\n const mediaQueryList = themeMedia.current;\n\n themeMedia.current.addEventListener('change', handleTheme);\n return () => {\n mediaQueryList?.removeEventListener('change', handleTheme);\n };\n }, [handleTheme]);\n useEffect(() => {\n if (document.documentElement.getAttribute('data-theme') !== theme) {\n document.documentElement.setAttribute('data-theme', theme);\n }\n }, [theme]);\n return [theme, changeTheme];\n};\n\nexport default useTheme;\n"],"names":["useEffect","useState","useCallback","useRef","useTheme","themeMedia","window","matchMedia","current","matches","theme","setTheme","handleTheme","type","changeTheme","color","mediaQueryList","addEventListener","removeEventListener","document","documentElement","getAttribute","setAttribute"],"mappings":"AAAA,2zCAAA,OAASA,SAAS,CAAEC,QAAQ,CAAEC,WAAW,CAAEC,MAAM,KAAQ,OAAQ,CAajE,IAAMC,SAAW,UAAoB,CACnC,IAAMC,WAAaF,OAAOG,OAAOC,UAAU,CAAC,kCAC5C,IAA0BN,mBAAAA,SAA6B,eACrDI,IAAAA,MAAAA,CAAAA,CAAAA,IAAAA,WAAWG,OAAO,UAAlBH,aAAAA,KAAAA,EAAAA,IAAoBI,OAAO,AAAD,EAAI,QAAU,MAAM,MADzCC,MAAmBT,OAAZU,SAAYV,OAG1B,IAAMW,YAAcV,YAClB,eAAuC,KAApCO,cAAAA,QACD,IAAMI,KAAOJ,QAAU,QAAU,MAAM,CAEvCE,SAASE,KACX,EACA,CAACF,SAAS,EAGZ,IAAMG,YAAcZ,YAClB,SAACa,MAA8B,CAC7BH,YAAY,CAAEH,QAASM,QAAU,OAAQ,EAC3C,EACA,CAACH,YAAY,EAGfZ,UAAU,UAAM,CACd,IAAMgB,eAAiBX,WAAWG,OAAO,CAEzCH,WAAWG,OAAO,CAACS,gBAAgB,CAAC,SAAUL,aAC9C,OAAO,UAAM,CACXI,uBAAAA,wBAAAA,KAAAA,EAAAA,eAAgBE,mBAAmB,CAAC,SAAUN,YAChD,CACF,EAAG,CAACA,YAAY,EAChBZ,UAAU,UAAM,CACd,GAAImB,SAASC,eAAe,CAACC,YAAY,CAAC,gBAAkBX,MAAO,CACjES,SAASC,eAAe,CAACE,YAAY,CAAC,aAAcZ,MACtD,CAAC,AACH,EAAG,CAACA,MAAM,EACV,MAAO,CAACA,MAAOI,YAAY,AAC7B,CAEA,gBAAeV,QAAS"}
@@ -1,12 +1,3 @@
1
- interface ClientSizeTypes {
2
- width: number;
3
- height: number;
4
- }
5
- /**
6
- * 获取可视区域大小
7
- * @return {ClientSizeTypes} clientWidth and clientHeight
8
- */
9
- export declare const getClientSize: () => ClientSizeTypes;
10
1
  /**
11
2
  * 获取最大 z-index
12
3
  * @returns {number} z-index
@@ -32,4 +23,3 @@ export declare const entityToString: (entity: string) => string;
32
23
  * @returns {Promise<void>} Promise<void>
33
24
  */
34
25
  export declare const setClipboard: (text: string, target?: Element, onError?: () => void) => void;
35
- export {};
@@ -1,2 +1,2 @@
1
- import{isNull,isUndefined,isFunction}from"../utils";export var getClientSize=function(){if(!isNull(window.innerWidth)){return{width:window.innerWidth,height:window.innerHeight}}else if(document.compatMode==="CSS1Compat"){return{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}}return{width:document.body.clientWidth,height:document.body.clientHeight}};export var getMaxZindex=function(){return(Array.prototype.slice.call(document.body.querySelectorAll("*"))||[]).reduce(function(r,e){return Math.max(r,+window.getComputedStyle(e).zIndex||0)},0)};export var getScrollTop=function(ele){if(ele){return ele.scrollTop}else if(!isUndefined(window.pageXOffset)){return window.pageYOffset}else if((document.compatMode||"")==="CSS1Compat"){return document.documentElement.scrollTop}return document.body.scrollTop};export var entityToString=function(entity){var div=document.createElement("div");div.innerHTML=entity;var res=div.innerText||div.textContent;div=null;return res||""};export var setClipboard=function(text,target,onError){var clipboardTimer=function(_target){var _clipboardTimer=window.setTimeout(function(){_target.setAttribute("data-copy-exit","");if(_clipboardTimer!==null){window.clearTimeout(_clipboardTimer);_clipboardTimer=null}var _clipboardTimerExit=window.setTimeout(function(){_target.removeAttribute("data-copy-exit");_target.removeAttribute("data-copy");if(_clipboardTimerExit!==null){window.clearTimeout(_clipboardTimerExit);_clipboardTimerExit=null}},300)},4e3)};if(typeof navigator.clipboard==="undefined"){if(target){target.setAttribute("data-copy","failure");clipboardTimer(target)}if(isFunction(onError)){onError()}return}if(target){navigator.clipboard.writeText(text).then(function(){target.setAttribute("data-copy","success")},function(){target.setAttribute("data-copy","failure")}).finally(function(){return clipboardTimer(target)})}else{navigator.clipboard.writeText(text)}};
1
+ import{isUndefined,isFunction}from"../utils";export var getMaxZindex=function(){return(Array.prototype.slice.call(document.body.querySelectorAll("*"))||[]).reduce(function(r,e){return Math.max(r,+window.getComputedStyle(e).zIndex||0)},0)};export var getScrollTop=function(ele){if(ele){return ele.scrollTop}else if(!isUndefined(window.pageXOffset)){return window.pageYOffset}else if((document.compatMode||"")==="CSS1Compat"){return document.documentElement.scrollTop}return document.body.scrollTop};export var entityToString=function(entity){var div=document.createElement("div");div.innerHTML=entity;var res=div.innerText||div.textContent;div=null;return res||""};export var setClipboard=function(text,target,onError){var clipboardTimer=function(_target){var _clipboardTimer=window.setTimeout(function(){_target.setAttribute("data-copy-exit","");if(_clipboardTimer!==null){window.clearTimeout(_clipboardTimer);_clipboardTimer=null}var _clipboardTimerExit=window.setTimeout(function(){_target.removeAttribute("data-copy-exit");_target.removeAttribute("data-copy");if(_clipboardTimerExit!==null){window.clearTimeout(_clipboardTimerExit);_clipboardTimerExit=null}},300)},4e3)};if(typeof navigator.clipboard==="undefined"){if(target){target.setAttribute("data-copy","failure");clipboardTimer(target)}if(isFunction(onError)){onError()}return}if(target){navigator.clipboard.writeText(text).then(function(){target.setAttribute("data-copy","success")},function(){target.setAttribute("data-copy","failure")}).finally(function(){return clipboardTimer(target)})}else{navigator.clipboard.writeText(text)}};
2
2
  //# sourceMappingURL=document.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../components/utils/document.ts"],"sourcesContent":["import { isNull, isUndefined, isFunction } from '../utils';\n\ninterface ClientSizeTypes {\n width: number;\n height: number;\n}\n/**\n * 获取可视区域大小\n * @return {ClientSizeTypes} clientWidth and clientHeight\n */\nexport const getClientSize = (): ClientSizeTypes => {\n if (!isNull(window.innerWidth)) {\n // ie9 + 最新浏览器\n return {\n width: window.innerWidth,\n height: window.innerHeight,\n };\n } else if (document.compatMode === 'CSS1Compat') {\n // 标准浏览器\n return {\n width: document.documentElement.clientWidth,\n height: document.documentElement.clientHeight,\n };\n }\n return {\n // 怪异浏览器\n width: document.body.clientWidth,\n height: document.body.clientHeight,\n };\n};\n\n/**\n * 获取最大 z-index\n * @returns {number} z-index\n */\nexport const getMaxZindex = (): number => {\n return (Array.prototype.slice.call(document.body.querySelectorAll('*')) || []).reduce(\n (r, e) => Math.max(r, +window.getComputedStyle(e).zIndex || 0),\n 0\n );\n};\n\n/**\n * 获取滚动条距离顶端的距离\n * @param {HTMLElement} ele HTMLElement\n * @return {Number} scrollTop\n */\nexport const getScrollTop = (ele?: HTMLElement): number => {\n if (ele) {\n return ele.scrollTop;\n } else if (!isUndefined(window.pageXOffset)) {\n return window.pageYOffset;\n } else if ((document.compatMode || '') === 'CSS1Compat') {\n return document.documentElement.scrollTop;\n }\n return document.body.scrollTop;\n};\n\n/**\n * HTML实体字符转string\n * @param {string} entity HTML实体字符\n * @returns {string} string\n */\nexport const entityToString = (entity: string): string => {\n let div: HTMLDivElement | null = document.createElement('div');\n\n div.innerHTML = entity;\n const res = div.innerText || div.textContent;\n\n div = null;\n return res || '';\n};\n\n/**\n * 复制文本到剪切板\n * @param {string} text 内容\n * @param {Element} target 提示的节点\n * @param {Function} onError 失败的回调\n * @returns {Promise<void>} Promise<void>\n */\nexport const setClipboard = (text: string, target?: Element, onError?: () => void): void => {\n const clipboardTimer = (_target: HTMLElement | Element) => {\n let _clipboardTimer: number | null = window.setTimeout(() => {\n _target.setAttribute('data-copy-exit', '');\n if (_clipboardTimer !== null) {\n window.clearTimeout(_clipboardTimer);\n _clipboardTimer = null;\n }\n let _clipboardTimerExit: number | null = window.setTimeout(() => {\n _target.removeAttribute('data-copy-exit');\n _target.removeAttribute('data-copy');\n if (_clipboardTimerExit !== null) {\n window.clearTimeout(_clipboardTimerExit);\n _clipboardTimerExit = null;\n }\n }, 300);\n }, 4000);\n };\n\n if (typeof navigator.clipboard === 'undefined') {\n if (target) {\n target.setAttribute('data-copy', 'failure');\n clipboardTimer(target);\n }\n if (isFunction(onError)) {\n onError();\n }\n return;\n }\n\n if (target) {\n navigator.clipboard\n .writeText(text)\n .then(\n () => {\n target.setAttribute('data-copy', 'success');\n },\n () => {\n target.setAttribute('data-copy', 'failure');\n }\n )\n .finally(() => clipboardTimer(target));\n } else {\n navigator.clipboard.writeText(text);\n }\n};\n"],"names":["isNull","isUndefined","isFunction","getClientSize","window","innerWidth","width","height","innerHeight","document","compatMode","documentElement","clientWidth","clientHeight","body","getMaxZindex","Array","prototype","slice","call","querySelectorAll","reduce","r","e","Math","max","getComputedStyle","zIndex","getScrollTop","ele","scrollTop","pageXOffset","pageYOffset","entityToString","entity","div","createElement","innerHTML","res","innerText","textContent","setClipboard","text","target","onError","clipboardTimer","_target","_clipboardTimer","setTimeout","setAttribute","clearTimeout","_clipboardTimerExit","removeAttribute","navigator","clipboard","writeText","then","finally"],"mappings":"AAAA,OAASA,MAAM,CAAEC,WAAW,CAAEC,UAAU,KAAQ,UAAW,AAU3D,QAAO,IAAMC,cAAgB,UAAuB,CAClD,GAAI,CAACH,OAAOI,OAAOC,UAAU,EAAG,CAE9B,MAAO,CACLC,MAAOF,OAAOC,UAAU,CACxBE,OAAQH,OAAOI,WAAW,AAC5B,CACF,MAAO,GAAIC,SAASC,UAAU,GAAK,aAAc,CAE/C,MAAO,CACLJ,MAAOG,SAASE,eAAe,CAACC,WAAW,CAC3CL,OAAQE,SAASE,eAAe,CAACE,YAAY,AAC/C,CACF,CAAC,AACD,MAAO,CAELP,MAAOG,SAASK,IAAI,CAACF,WAAW,CAChCL,OAAQE,SAASK,IAAI,CAACD,YAAY,AACpC,CACF,CAAE,AAMF,QAAO,IAAME,aAAe,UAAc,CACxC,MAAO,AAACC,CAAAA,MAAMC,SAAS,CAACC,KAAK,CAACC,IAAI,CAACV,SAASK,IAAI,CAACM,gBAAgB,CAAC,OAAS,EAAE,AAAD,EAAGC,MAAM,CACnF,SAACC,EAAGC,UAAMC,KAAKC,GAAG,CAACH,EAAG,CAAClB,OAAOsB,gBAAgB,CAACH,GAAGI,MAAM,EAAI,IAC5D,EAEJ,CAAE,AAOF,QAAO,IAAMC,aAAe,SAACC,IAA8B,CACzD,GAAIA,IAAK,CACP,OAAOA,IAAIC,SAAS,AACtB,MAAO,GAAI,CAAC7B,YAAYG,OAAO2B,WAAW,EAAG,CAC3C,OAAO3B,OAAO4B,WAAW,AAC3B,MAAO,GAAI,AAACvB,CAAAA,SAASC,UAAU,EAAI,EAAC,IAAO,aAAc,CACvD,OAAOD,SAASE,eAAe,CAACmB,SAAS,AAC3C,CAAC,AACD,OAAOrB,SAASK,IAAI,CAACgB,SAAS,AAChC,CAAE,AAOF,QAAO,IAAMG,eAAiB,SAACC,OAA2B,CACxD,IAAIC,IAA6B1B,SAAS2B,aAAa,CAAC,MAExDD,CAAAA,IAAIE,SAAS,CAAGH,OAChB,IAAMI,IAAMH,IAAII,SAAS,EAAIJ,IAAIK,WAAW,CAE5CL,IAAM,IAAI,CACV,OAAOG,KAAO,EAChB,CAAE,AASF,QAAO,IAAMG,aAAe,SAACC,KAAcC,OAAkBC,QAA+B,CAC1F,IAAMC,eAAiB,SAACC,QAAmC,CACzD,IAAIC,gBAAiC3C,OAAO4C,UAAU,CAAC,UAAM,CAC3DF,QAAQG,YAAY,CAAC,iBAAkB,IACvC,GAAIF,kBAAoB,IAAI,CAAE,CAC5B3C,OAAO8C,YAAY,CAACH,iBACpBA,gBAAkB,IAAI,AACxB,CAAC,AACD,IAAII,oBAAqC/C,OAAO4C,UAAU,CAAC,UAAM,CAC/DF,QAAQM,eAAe,CAAC,kBACxBN,QAAQM,eAAe,CAAC,aACxB,GAAID,sBAAwB,IAAI,CAAE,CAChC/C,OAAO8C,YAAY,CAACC,qBACpBA,oBAAsB,IAAI,AAC5B,CAAC,AACH,EAAG,IACL,EAAG,IACL,EAEA,GAAI,OAAOE,UAAUC,SAAS,GAAK,YAAa,CAC9C,GAAIX,OAAQ,CACVA,OAAOM,YAAY,CAAC,YAAa,WACjCJ,eAAeF,OACjB,CAAC,AACD,GAAIzC,WAAW0C,SAAU,CACvBA,SACF,CAAC,AACD,MACF,CAAC,AAED,GAAID,OAAQ,CACVU,UAAUC,SAAS,CAChBC,SAAS,CAACb,MACVc,IAAI,CACH,UAAM,CACJb,OAAOM,YAAY,CAAC,YAAa,UACnC,EACA,UAAM,CACJN,OAAOM,YAAY,CAAC,YAAa,UACnC,GAEDQ,OAAO,CAAC,kBAAMZ,eAAeF,SAClC,KAAO,CACLU,UAAUC,SAAS,CAACC,SAAS,CAACb,KAChC,CAAC,AACH,CAAE"}
1
+ {"version":3,"sources":["../../components/utils/document.ts"],"sourcesContent":["import { isUndefined, isFunction } from '../utils';\n\n// interface ClientSizeTypes {\n// width: number;\n// height: number;\n// }\n// /**\n// * 获取可视区域大小\n// * @return {ClientSizeTypes} clientWidth and clientHeight\n// */\n// export const getClientSize = (): ClientSizeTypes => {\n// if (!isNull(window.innerWidth)) {\n// // ie9 + 最新浏览器\n// return {\n// width: window.innerWidth,\n// height: window.innerHeight,\n// };\n// } else if (document.compatMode === 'CSS1Compat') {\n// // 标准浏览器\n// return {\n// width: document.documentElement.clientWidth,\n// height: document.documentElement.clientHeight,\n// };\n// }\n// return {\n// // 怪异浏览器\n// width: document.body.clientWidth,\n// height: document.body.clientHeight,\n// };\n// };\n\n/**\n * 获取最大 z-index\n * @returns {number} z-index\n */\nexport const getMaxZindex = (): number => {\n return (Array.prototype.slice.call(document.body.querySelectorAll('*')) || []).reduce(\n (r, e) => Math.max(r, +window.getComputedStyle(e).zIndex || 0),\n 0\n );\n};\n\n/**\n * 获取滚动条距离顶端的距离\n * @param {HTMLElement} ele HTMLElement\n * @return {Number} scrollTop\n */\nexport const getScrollTop = (ele?: HTMLElement): number => {\n if (ele) {\n return ele.scrollTop;\n } else if (!isUndefined(window.pageXOffset)) {\n return window.pageYOffset;\n } else if ((document.compatMode || '') === 'CSS1Compat') {\n return document.documentElement.scrollTop;\n }\n return document.body.scrollTop;\n};\n\n/**\n * HTML实体字符转string\n * @param {string} entity HTML实体字符\n * @returns {string} string\n */\nexport const entityToString = (entity: string): string => {\n let div: HTMLDivElement | null = document.createElement('div');\n\n div.innerHTML = entity;\n const res = div.innerText || div.textContent;\n\n div = null;\n return res || '';\n};\n\n/**\n * 复制文本到剪切板\n * @param {string} text 内容\n * @param {Element} target 提示的节点\n * @param {Function} onError 失败的回调\n * @returns {Promise<void>} Promise<void>\n */\nexport const setClipboard = (text: string, target?: Element, onError?: () => void): void => {\n const clipboardTimer = (_target: HTMLElement | Element) => {\n let _clipboardTimer: number | null = window.setTimeout(() => {\n _target.setAttribute('data-copy-exit', '');\n if (_clipboardTimer !== null) {\n window.clearTimeout(_clipboardTimer);\n _clipboardTimer = null;\n }\n let _clipboardTimerExit: number | null = window.setTimeout(() => {\n _target.removeAttribute('data-copy-exit');\n _target.removeAttribute('data-copy');\n if (_clipboardTimerExit !== null) {\n window.clearTimeout(_clipboardTimerExit);\n _clipboardTimerExit = null;\n }\n }, 300);\n }, 4000);\n };\n\n if (typeof navigator.clipboard === 'undefined') {\n if (target) {\n target.setAttribute('data-copy', 'failure');\n clipboardTimer(target);\n }\n if (isFunction(onError)) {\n onError();\n }\n return;\n }\n\n if (target) {\n navigator.clipboard\n .writeText(text)\n .then(\n () => {\n target.setAttribute('data-copy', 'success');\n },\n () => {\n target.setAttribute('data-copy', 'failure');\n }\n )\n .finally(() => clipboardTimer(target));\n } else {\n navigator.clipboard.writeText(text);\n }\n};\n"],"names":["isUndefined","isFunction","getMaxZindex","Array","prototype","slice","call","document","body","querySelectorAll","reduce","r","e","Math","max","window","getComputedStyle","zIndex","getScrollTop","ele","scrollTop","pageXOffset","pageYOffset","compatMode","documentElement","entityToString","entity","div","createElement","innerHTML","res","innerText","textContent","setClipboard","text","target","onError","clipboardTimer","_target","_clipboardTimer","setTimeout","setAttribute","clearTimeout","_clipboardTimerExit","removeAttribute","navigator","clipboard","writeText","then","finally"],"mappings":"AAAA,OAASA,WAAW,CAAEC,UAAU,KAAQ,UAAW,AAmCnD,QAAO,IAAMC,aAAe,UAAc,CACxC,MAAO,AAACC,CAAAA,MAAMC,SAAS,CAACC,KAAK,CAACC,IAAI,CAACC,SAASC,IAAI,CAACC,gBAAgB,CAAC,OAAS,EAAE,AAAD,EAAGC,MAAM,CACnF,SAACC,EAAGC,UAAMC,KAAKC,GAAG,CAACH,EAAG,CAACI,OAAOC,gBAAgB,CAACJ,GAAGK,MAAM,EAAI,IAC5D,EAEJ,CAAE,AAOF,QAAO,IAAMC,aAAe,SAACC,IAA8B,CACzD,GAAIA,IAAK,CACP,OAAOA,IAAIC,SAAS,AACtB,MAAO,GAAI,CAACpB,YAAYe,OAAOM,WAAW,EAAG,CAC3C,OAAON,OAAOO,WAAW,AAC3B,MAAO,GAAI,AAACf,CAAAA,SAASgB,UAAU,EAAI,EAAC,IAAO,aAAc,CACvD,OAAOhB,SAASiB,eAAe,CAACJ,SAAS,AAC3C,CAAC,AACD,OAAOb,SAASC,IAAI,CAACY,SAAS,AAChC,CAAE,AAOF,QAAO,IAAMK,eAAiB,SAACC,OAA2B,CACxD,IAAIC,IAA6BpB,SAASqB,aAAa,CAAC,MAExDD,CAAAA,IAAIE,SAAS,CAAGH,OAChB,IAAMI,IAAMH,IAAII,SAAS,EAAIJ,IAAIK,WAAW,CAE5CL,IAAM,IAAI,CACV,OAAOG,KAAO,EAChB,CAAE,AASF,QAAO,IAAMG,aAAe,SAACC,KAAcC,OAAkBC,QAA+B,CAC1F,IAAMC,eAAiB,SAACC,QAAmC,CACzD,IAAIC,gBAAiCxB,OAAOyB,UAAU,CAAC,UAAM,CAC3DF,QAAQG,YAAY,CAAC,iBAAkB,IACvC,GAAIF,kBAAoB,IAAI,CAAE,CAC5BxB,OAAO2B,YAAY,CAACH,iBACpBA,gBAAkB,IAAI,AACxB,CAAC,AACD,IAAII,oBAAqC5B,OAAOyB,UAAU,CAAC,UAAM,CAC/DF,QAAQM,eAAe,CAAC,kBACxBN,QAAQM,eAAe,CAAC,aACxB,GAAID,sBAAwB,IAAI,CAAE,CAChC5B,OAAO2B,YAAY,CAACC,qBACpBA,oBAAsB,IAAI,AAC5B,CAAC,AACH,EAAG,IACL,EAAG,IACL,EAEA,GAAI,OAAOE,UAAUC,SAAS,GAAK,YAAa,CAC9C,GAAIX,OAAQ,CACVA,OAAOM,YAAY,CAAC,YAAa,WACjCJ,eAAeF,OACjB,CAAC,AACD,GAAIlC,WAAWmC,SAAU,CACvBA,SACF,CAAC,AACD,MACF,CAAC,AAED,GAAID,OAAQ,CACVU,UAAUC,SAAS,CAChBC,SAAS,CAACb,MACVc,IAAI,CACH,UAAM,CACJb,OAAOM,YAAY,CAAC,YAAa,UACnC,EACA,UAAM,CACJN,OAAOM,YAAY,CAAC,YAAa,UACnC,GAEDQ,OAAO,CAAC,kBAAMZ,eAAeF,SAClC,KAAO,CACLU,UAAUC,SAAS,CAACC,SAAS,CAACb,KAChC,CAAC,AACH,CAAE"}
@@ -8,4 +8,3 @@ export interface Navigator {
8
8
  * @param {string} fileName 文件名
9
9
  */
10
10
  export declare const downloadBlob: (blob: Blob, fileName: string) => void;
11
- export default downloadBlob;
@@ -1,2 +1,2 @@
1
- export var downloadBlob=function(blob,fileName){var navigator=window.navigator;if(typeof navigator.msSaveBlob!=="undefined"){navigator.msSaveBlob(blob,fileName)}else{var URL=window.URL||window.webkitURL;var objectUrl=URL.createObjectURL(blob);var a=document.createElement("a");a.href=objectUrl;a.download=fileName;document.body.appendChild(a);a.click();a.remove();URL.revokeObjectURL(objectUrl)}};export default downloadBlob;
1
+ export var downloadBlob=function(blob,fileName){var navigator=window.navigator;if(typeof navigator.msSaveBlob!=="undefined"){navigator.msSaveBlob(blob,fileName)}else{var URL=window.URL||window.webkitURL;var objectUrl=URL.createObjectURL(blob);var a=document.createElement("a");a.href=objectUrl;a.download=fileName;document.body.appendChild(a);a.click();a.remove();URL.revokeObjectURL(objectUrl)}};
2
2
  //# sourceMappingURL=download.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../components/utils/download.ts"],"sourcesContent":["export interface Navigator {\n // eslint-disable-next-line no-unused-vars\n msSaveBlob?: (blob: Blob, defaultName?: string) => string;\n}\n\n/**\n * 保存Blob对象到本地\n * @constructor\n * @param {Blob} blob Blob\n * @param {string} fileName 文件名\n */\nexport const downloadBlob = (blob: Blob, fileName: string): void => {\n const navigator = window.navigator as Navigator;\n\n // window.navigator.msSaveBlob:以本地方式保存文件\n if (typeof navigator.msSaveBlob !== 'undefined') {\n navigator.msSaveBlob(blob, fileName);\n } else {\n // 创建新的URL表示指定的File对象或者Blob对象\n const URL = window.URL || window.webkitURL;\n const objectUrl = URL.createObjectURL(blob);\n const a = document.createElement('a');\n\n a.href = objectUrl;\n a.download = fileName;\n document.body.appendChild(a);\n a.click();\n a.remove();\n // 清除对象\n URL.revokeObjectURL(objectUrl);\n }\n};\n\nexport default downloadBlob;\n"],"names":["downloadBlob","blob","fileName","navigator","window","msSaveBlob","URL","webkitURL","objectUrl","createObjectURL","a","document","createElement","href","download","body","appendChild","click","remove","revokeObjectURL"],"mappings":"AAWA,OAAO,IAAMA,aAAe,SAACC,KAAYC,SAA2B,CAClE,IAAMC,UAAYC,OAAOD,SAAS,CAGlC,GAAI,OAAOA,UAAUE,UAAU,GAAK,YAAa,CAC/CF,UAAUE,UAAU,CAACJ,KAAMC,SAC7B,KAAO,CAEL,IAAMI,IAAMF,OAAOE,GAAG,EAAIF,OAAOG,SAAS,CAC1C,IAAMC,UAAYF,IAAIG,eAAe,CAACR,MACtC,IAAMS,EAAIC,SAASC,aAAa,CAAC,IAEjCF,CAAAA,EAAEG,IAAI,CAAGL,SACTE,CAAAA,EAAEI,QAAQ,CAAGZ,SACbS,SAASI,IAAI,CAACC,WAAW,CAACN,GAC1BA,EAAEO,KAAK,GACPP,EAAEQ,MAAM,GAERZ,IAAIa,eAAe,CAACX,UACtB,CAAC,AACH,CAAE,AAEF,gBAAeR,YAAa"}
1
+ {"version":3,"sources":["../../components/utils/download.ts"],"sourcesContent":["export interface Navigator {\n // eslint-disable-next-line no-unused-vars\n msSaveBlob?: (blob: Blob, defaultName?: string) => string;\n}\n\n/**\n * 保存Blob对象到本地\n * @constructor\n * @param {Blob} blob Blob\n * @param {string} fileName 文件名\n */\nexport const downloadBlob = (blob: Blob, fileName: string): void => {\n const navigator = window.navigator as Navigator;\n\n // window.navigator.msSaveBlob:以本地方式保存文件\n if (typeof navigator.msSaveBlob !== 'undefined') {\n navigator.msSaveBlob(blob, fileName);\n } else {\n // 创建新的URL表示指定的File对象或者Blob对象\n const URL = window.URL || window.webkitURL;\n const objectUrl = URL.createObjectURL(blob);\n const a = document.createElement('a');\n\n a.href = objectUrl;\n a.download = fileName;\n document.body.appendChild(a);\n a.click();\n a.remove();\n // 清除对象\n URL.revokeObjectURL(objectUrl);\n }\n};\n"],"names":["downloadBlob","blob","fileName","navigator","window","msSaveBlob","URL","webkitURL","objectUrl","createObjectURL","a","document","createElement","href","download","body","appendChild","click","remove","revokeObjectURL"],"mappings":"AAWA,OAAO,IAAMA,aAAe,SAACC,KAAYC,SAA2B,CAClE,IAAMC,UAAYC,OAAOD,SAAS,CAGlC,GAAI,OAAOA,UAAUE,UAAU,GAAK,YAAa,CAC/CF,UAAUE,UAAU,CAACJ,KAAMC,SAC7B,KAAO,CAEL,IAAMI,IAAMF,OAAOE,GAAG,EAAIF,OAAOG,SAAS,CAC1C,IAAMC,UAAYF,IAAIG,eAAe,CAACR,MACtC,IAAMS,EAAIC,SAASC,aAAa,CAAC,IAEjCF,CAAAA,EAAEG,IAAI,CAAGL,SACTE,CAAAA,EAAEI,QAAQ,CAAGZ,SACbS,SAASI,IAAI,CAACC,WAAW,CAACN,GAC1BA,EAAEO,KAAK,GACPP,EAAEQ,MAAM,GAERZ,IAAIa,eAAe,CAACX,UACtB,CAAC,AACH,CAAE"}
@@ -1,5 +1,5 @@
1
1
  export { classNames, getPrefixCls } from './classname';
2
2
  export { isFullscreen, exitFullscreen, toggleFullscreen, requestFullscreen } from './fullscreen';
3
- export { default as downloadBlob } from './download';
4
- export { getClientSize, getMaxZindex, getScrollTop, entityToString, setClipboard, } from './document';
3
+ export { downloadBlob } from './download';
4
+ export { getMaxZindex, getScrollTop, entityToString, setClipboard, } from './document';
5
5
  export * from './type';
package/es/utils/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{classNames,getPrefixCls}from"./classname";export{isFullscreen,exitFullscreen,toggleFullscreen,requestFullscreen}from"./fullscreen";export{default as downloadBlob}from"./download";export{getClientSize,getMaxZindex,getScrollTop,entityToString,setClipboard}from"./document";export*from"./type";
1
+ export{classNames,getPrefixCls}from"./classname";export{isFullscreen,exitFullscreen,toggleFullscreen,requestFullscreen}from"./fullscreen";export{downloadBlob}from"./download";export{getMaxZindex,getScrollTop,entityToString,setClipboard}from"./document";export*from"./type";
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../components/utils/index.ts"],"sourcesContent":["export { classNames, getPrefixCls } from './classname';\nexport { isFullscreen, exitFullscreen, toggleFullscreen, requestFullscreen } from './fullscreen';\nexport { default as downloadBlob } from './download';\nexport {\n getClientSize,\n getMaxZindex,\n getScrollTop,\n entityToString,\n setClipboard,\n} from './document';\nexport * from './type';\n"],"names":["classNames","getPrefixCls","isFullscreen","exitFullscreen","toggleFullscreen","requestFullscreen","default","downloadBlob","getClientSize","getMaxZindex","getScrollTop","entityToString","setClipboard"],"mappings":"AAAA,OAASA,UAAU,CAAEC,YAAY,KAAQ,aAAc,AACvD,QAASC,YAAY,CAAEC,cAAc,CAAEC,gBAAgB,CAAEC,iBAAiB,KAAQ,cAAe,AACjG,QAASC,WAAWC,YAAY,KAAQ,YAAa,AACrD,QACEC,aAAa,CACbC,YAAY,CACZC,YAAY,CACZC,cAAc,CACdC,YAAY,KACP,YAAa,AACpB,YAAc,QAAS"}
1
+ {"version":3,"sources":["../../components/utils/index.ts"],"sourcesContent":["export { classNames, getPrefixCls } from './classname';\nexport { isFullscreen, exitFullscreen, toggleFullscreen, requestFullscreen } from './fullscreen';\nexport { downloadBlob } from './download';\nexport {\n // getClientSize,\n getMaxZindex,\n getScrollTop,\n entityToString,\n setClipboard,\n} from './document';\nexport * from './type';\n"],"names":["classNames","getPrefixCls","isFullscreen","exitFullscreen","toggleFullscreen","requestFullscreen","downloadBlob","getMaxZindex","getScrollTop","entityToString","setClipboard"],"mappings":"AAAA,OAASA,UAAU,CAAEC,YAAY,KAAQ,aAAc,AACvD,QAASC,YAAY,CAAEC,cAAc,CAAEC,gBAAgB,CAAEC,iBAAiB,KAAQ,cAAe,AACjG,QAASC,YAAY,KAAQ,YAAa,AAC1C,QAEEC,YAAY,CACZC,YAAY,CACZC,cAAc,CACdC,YAAY,KACP,YAAa,AACpB,YAAc,QAAS"}
File without changes
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return _default}});var _react=_interopRequireWildcard(require("react"));var _utils=require("../utils");require("./index.global.less");function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};return _extends.apply(this,arguments)}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key]}return target}var Avatar=function(_param){var className=_param.className,_src=_param.src,src=_src===void 0?"https://gw.alipayobjects.com/zos/alicdn/HJtErOC0O/avatar.png":_src,alt=_param.alt,_imgProps=_param.imgProps,imgProps=_imgProps===void 0?{}:_imgProps,props=_objectWithoutProperties(_param,["className","src","alt","imgProps"]);var cls=(0,_react.useMemo)(function(){return(0,_utils.classNames)([(0,_utils.getPrefixCls)("avatar"),className])},[className]);return _react.default.createElement("div",_extends({className:cls},props),_react.default.createElement("img",_extends({},imgProps,{src:src,alt:alt})))};var _default=Avatar;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return _default}});var _react=_interopRequireWildcard(require("react"));var _utils=require("../utils");require("./index.global.css");function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};return _extends.apply(this,arguments)}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key]}return target}var Avatar=function(_param){var className=_param.className,_src=_param.src,src=_src===void 0?"https://gw.alipayobjects.com/zos/alicdn/HJtErOC0O/avatar.png":_src,alt=_param.alt,_imgProps=_param.imgProps,imgProps=_imgProps===void 0?{}:_imgProps,props=_objectWithoutProperties(_param,["className","src","alt","imgProps"]);var cls=(0,_react.useMemo)(function(){return(0,_utils.classNames)([(0,_utils.getPrefixCls)("avatar"),className])},[className]);return _react.default.createElement("div",_extends({className:cls},props),_react.default.createElement("img",_extends({},imgProps,{src:src,alt:alt})))};var _default=Avatar;
2
2
  //# sourceMappingURL=index.js.map
File without changes
@@ -2,7 +2,7 @@
2
2
 
3
3
  :root {
4
4
  --back-top-color: #fff;
5
- --back-top-bg: var(--text-color-secondary, @text-color-secondary);
5
+ --back-top-bg: var(--text-color-secondary);
6
6
  --back-top-hover-bg: var(--text-color, @text-color);
7
7
  }
8
8
 
@@ -45,7 +45,7 @@
45
45
  }
46
46
  }
47
47
 
48
- .@{prefix-cls}-out {
48
+ .@{prefix-cls}-back-top-out {
49
49
  animation: back-top-fade-out 1s forwards;
50
50
  }
51
51
 
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return _default}});var _react=_interopRequireWildcard(require("react"));var _utils=require("../utils");require("./index.global.less");function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};return _extends.apply(this,arguments)}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key]}return target}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}var BackTop=function(_param){var _target=_param.target,target=_target===void 0?function(){return window}:_target,_visibilityHeight=_param.visibilityHeight,visibilityHeight=_visibilityHeight===void 0?400:_visibilityHeight,className=_param.className,props=_objectWithoutProperties(_param,["target","visibilityHeight","className"]);var ref=(0,_react.useRef)(null);var ref1=_slicedToArray((0,_react.useState)(null),2),show=ref1[0],setShow=ref1[1];var ref2=_slicedToArray((0,_react.useState)(false),2),init=ref2[0],setInit=ref2[1];var handleScrollY=(0,_react.useCallback)(function(){var scrollTop=0;var offsetHeight=0;if((0,_utils.isFunction)(target)){var ele=target();if(ele){scrollTop=(0,_utils.getScrollTop)(ele);offsetHeight=ele.offsetHeight}ele=null}else{scrollTop=(0,_utils.getScrollTop)();offsetHeight=document.documentElement.offsetHeight||document.body.offsetHeight}var nextShow=scrollTop>offsetHeight/3||scrollTop>visibilityHeight;if(Boolean(show)!==nextShow){setShow(nextShow)}},[show,target,visibilityHeight]);var handleBackTop=(0,_react.useCallback)(function(){var ref;(ref=target())===null||ref===void 0?void 0:ref.scrollTo({top:0,behavior:"smooth"})},[target]);_react.default.useEffect(function(){var timer;var outing=show===false;if(show&&ref.current){ref.current.style.zIndex=(0,_utils.getMaxZindex)().toString()}if(init){if(outing){timer=setTimeout(function(){setShow(null);clearTimeout(timer)},1e3)}}else{if(outing){setShow(null)}setInit(true)}return function(){clearTimeout(timer)}},[init,show]);(0,_react.useEffect)(function(){if((0,_utils.isFunction)(target)){var ref;(ref=target())===null||ref===void 0?void 0:ref.addEventListener("scroll",handleScrollY,false)}return function(){if((0,_utils.isFunction)(target)){var ref;(ref=target())===null||ref===void 0?void 0:ref.removeEventListener("scroll",handleScrollY,false)}}},[handleScrollY,target]);var cls=(0,_react.useMemo)(function(){return(0,_utils.classNames)([(0,_utils.getPrefixCls)("back-top"),className,!show&&(0,_utils.getPrefixCls)("out")])},[className,show]);return show===null?null:_react.default.createElement("div",_extends({},props,{ref:ref,className:cls,onClick:handleBackTop}))};var _default=(0,_react.memo)(BackTop,_utils.isEqual);
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return _default}});var _react=_interopRequireWildcard(require("react"));var _reactDom=_interopRequireDefault(require("react-dom"));var _utils=require("../utils");require("./index.global.css");function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};return _extends.apply(this,arguments)}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key]}return target}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}var BackTop=function(_param){var _target=_param.target,target=_target===void 0?function(){return window}:_target,_visibilityHeight=_param.visibilityHeight,visibilityHeight=_visibilityHeight===void 0?400:_visibilityHeight,className=_param.className,props=_objectWithoutProperties(_param,["target","visibilityHeight","className"]);var ref=(0,_react.useRef)(null);var ref1=_slicedToArray((0,_react.useState)(null),2),show=ref1[0],setShow=ref1[1];var handleScrollY=(0,_react.useCallback)(function(){var scrollTop=0;var offsetHeight=0;if((0,_utils.isFunction)(target)){var ele=target();if(ele){scrollTop=(0,_utils.getScrollTop)(ele);offsetHeight=ele.offsetHeight}}var nextShow=scrollTop>offsetHeight/3||scrollTop>visibilityHeight;if(Boolean(show)!==nextShow){setShow(nextShow)}},[show,target,visibilityHeight]);var handleBackTop=(0,_react.useCallback)(function(){var ref;(ref=target())===null||ref===void 0?void 0:ref.scrollTo({top:0,behavior:"smooth"})},[target]);(0,_react.useEffect)(function(){if(show&&ref.current){ref.current.style.zIndex=(0,_utils.getMaxZindex)().toString()}},[show]);(0,_react.useEffect)(function(){if((0,_utils.isFunction)(target)){var ref;(ref=target())===null||ref===void 0?void 0:ref.addEventListener("scroll",handleScrollY,false)}return function(){if((0,_utils.isFunction)(target)){var ref;(ref=target())===null||ref===void 0?void 0:ref.removeEventListener("scroll",handleScrollY,false)}}},[handleScrollY,target]);var cls=(0,_react.useMemo)(function(){return(0,_utils.classNames)([(0,_utils.getPrefixCls)("back-top"),className,!show&&(0,_utils.getPrefixCls)("back-top-out")])},[className,show]);var exit=(0,_react.useCallback)(function(){if(show===false){setShow(null)}},[show]);var el=(0,_react.useMemo)(function(){return _react.default.createElement("div",_extends({},props,{ref:ref,onAnimationEnd:exit,className:cls,onClick:handleBackTop}))},[cls,exit,handleBackTop,props]);return show===null?null:_reactDom.default.createPortal(el,target())};var _default=(0,_react.memo)(BackTop,_utils.isEqual);
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../components/back-top/index.tsx"],"sourcesContent":["import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n classNames,\n getMaxZindex,\n getPrefixCls,\n getScrollTop,\n isEqual,\n isFunction,\n} from '../utils';\nimport './index.global.less';\n\nexport interface BackTopProps extends React.HTMLAttributes<HTMLDivElement> {\n /** 设置需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 */\n target?: () => HTMLElement;\n /** 滚动高度达到此参数值才出现 BackTop */\n visibilityHeight?: number;\n}\n\nconst BackTop: React.FC<BackTopProps> = ({\n target = () => window as unknown as HTMLElement,\n visibilityHeight = 400,\n className,\n ...props\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n const [show, setShow] = useState<boolean | null>(null);\n const [init, setInit] = useState<boolean>(false);\n const handleScrollY = useCallback(() => {\n let scrollTop: number | null = 0;\n let offsetHeight: number | null = 0;\n\n if (isFunction(target)) {\n let ele: HTMLElement | null = target();\n\n if (ele) {\n scrollTop = getScrollTop(ele);\n offsetHeight = ele.offsetHeight;\n }\n ele = null;\n } else {\n scrollTop = getScrollTop();\n offsetHeight = document.documentElement.offsetHeight || document.body.offsetHeight;\n }\n const nextShow: boolean = scrollTop > offsetHeight / 3 || scrollTop > visibilityHeight;\n\n if (Boolean(show) !== nextShow) {\n setShow(nextShow);\n }\n }, [show, target, visibilityHeight]);\n const handleBackTop = useCallback(() => {\n target()?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }, [target]);\n\n React.useEffect(() => {\n let timer: NodeJS.Timeout;\n const outing = show === false;\n\n if (show && ref.current) {\n ref.current.style.zIndex = getMaxZindex().toString();\n }\n if (init) {\n if (outing) {\n timer = setTimeout(() => {\n setShow(null);\n clearTimeout(timer);\n }, 1000);\n }\n } else {\n if (outing) {\n setShow(null);\n }\n setInit(true);\n }\n return () => {\n clearTimeout(timer);\n };\n }, [init, show]);\n useEffect(() => {\n if (isFunction(target)) {\n target()?.addEventListener('scroll', handleScrollY, false);\n }\n return () => {\n if (isFunction(target)) {\n target()?.removeEventListener('scroll', handleScrollY, false);\n }\n };\n }, [handleScrollY, target]);\n\n const cls = useMemo(\n () => classNames([getPrefixCls('back-top'), className, !show && getPrefixCls('out')]),\n [className, show]\n );\n\n return show === null ? null : (\n <div {...props} ref={ref} className={cls} onClick={handleBackTop} />\n );\n};\n\nexport default memo(BackTop, isEqual);\n"],"names":["BackTop","target","window","visibilityHeight","className","props","ref","useRef","useState","show","setShow","init","setInit","handleScrollY","useCallback","scrollTop","offsetHeight","isFunction","ele","getScrollTop","document","documentElement","body","nextShow","Boolean","handleBackTop","scrollTo","top","behavior","React","useEffect","timer","outing","current","style","zIndex","getMaxZindex","toString","setTimeout","clearTimeout","addEventListener","removeEventListener","cls","useMemo","classNames","getPrefixCls","div","onClick","memo","isEqual"],"mappings":"AAAA,oGAqGA,iDAAA,uDArG+E,6BAQxE,oBACA,8vGASP,IAAMA,QAAkC,gBAKlC,oBAJJC,OAAAA,wBAAS,kBAAMC,yCACfC,iBAAAA,4CAAmB,sBACnBC,iBAAAA,UACGC,uCAHHJ,SACAE,mBACAC,cAGA,IAAME,IAAMC,GAAAA,aAAM,EAAiB,IAAI,EACvC,IAAwBC,oBAAAA,GAAAA,eAAQ,EAAiB,IAAI,KAA9CC,KAAiBD,QAAXE,QAAWF,QACxB,IAAwBA,oBAAAA,GAAAA,eAAQ,EAAU,KAAK,KAAxCG,KAAiBH,QAAXI,QAAWJ,QACxB,IAAMK,cAAgBC,GAAAA,kBAAW,EAAC,UAAM,CACtC,IAAIC,UAA2B,EAC/B,IAAIC,aAA8B,EAElC,GAAIC,GAAAA,iBAAU,EAAChB,QAAS,CACtB,IAAIiB,IAA0BjB,SAE9B,GAAIiB,IAAK,CACPH,UAAYI,GAAAA,mBAAY,EAACD,KACzBF,aAAeE,IAAIF,YAAY,AACjC,CAAC,AACDE,IAAM,IAAI,AACZ,KAAO,CACLH,UAAYI,GAAAA,mBAAY,IACxBH,aAAeI,SAASC,eAAe,CAACL,YAAY,EAAII,SAASE,IAAI,CAACN,YAAY,AACpF,CAAC,AACD,IAAMO,SAAoBR,UAAYC,aAAe,GAAKD,UAAYZ,iBAEtE,GAAIqB,QAAQf,QAAUc,SAAU,CAC9Bb,QAAQa,SACV,CAAC,AACH,EAAG,CAACd,KAAMR,OAAQE,iBAAiB,EACnC,IAAMsB,cAAgBX,GAAAA,kBAAW,EAAC,UAAM,KACtCb,GAAAA,EAAAA,IAAAA,kBAAAA,aAAAA,KAAAA,EAAAA,IAAUyB,SAAS,CACjBC,IAAK,EACLC,SAAU,QACZ,EACF,EAAG,CAAC3B,OAAO,EAEX4B,cAAK,CAACC,SAAS,CAAC,UAAM,CACpB,IAAIC,MACJ,IAAMC,OAASvB,OAAS,KAAK,CAE7B,GAAIA,MAAQH,IAAI2B,OAAO,CAAE,CACvB3B,IAAI2B,OAAO,CAACC,KAAK,CAACC,MAAM,CAAGC,GAAAA,mBAAY,IAAGC,QAAQ,EACpD,CAAC,AACD,GAAI1B,KAAM,CACR,GAAIqB,OAAQ,CACVD,MAAQO,WAAW,UAAM,CACvB5B,QAAQ,IAAI,EACZ6B,aAAaR,MACf,EAAG,IACL,CAAC,AACH,KAAO,CACL,GAAIC,OAAQ,CACVtB,QAAQ,IAAI,CACd,CAAC,AACDE,QAAQ,IAAI,CACd,CAAC,AACD,OAAO,UAAM,CACX2B,aAAaR,MACf,CACF,EAAG,CAACpB,KAAMF,KAAK,EACfqB,GAAAA,gBAAS,EAAC,UAAM,CACd,GAAIb,GAAAA,iBAAU,EAAChB,QAAS,KACtBA,GAAAA,EAAAA,IAAAA,kBAAAA,aAAAA,KAAAA,EAAAA,IAAUuC,iBAAiB,SAAU3B,cAAe,KAAK,CAC3D,CAAC,AACD,OAAO,UAAM,CACX,GAAII,GAAAA,iBAAU,EAAChB,QAAS,KACtBA,GAAAA,EAAAA,IAAAA,kBAAAA,aAAAA,KAAAA,EAAAA,IAAUwC,oBAAoB,SAAU5B,cAAe,KAAK,CAC9D,CAAC,AACH,CACF,EAAG,CAACA,cAAeZ,OAAO,EAE1B,IAAMyC,IAAMC,GAAAA,cAAO,EACjB,iBAAMC,GAAAA,iBAAU,EAAC,CAACC,GAAAA,mBAAY,EAAC,YAAazC,UAAW,CAACK,MAAQoC,GAAAA,mBAAY,EAAC,OAAO,GACpF,CAACzC,UAAWK,KAAK,EAGnB,OAAOA,OAAS,IAAI,CAAG,IAAI,CACzB,6BAACqC,kBAAQzC,OAAOC,IAAKA,IAAKF,UAAWsC,IAAKK,QAAStB,gBACpD,AACH,MAEA,SAAeuB,GAAAA,WAAI,EAAChD,QAASiD,cAAO"}
1
+ {"version":3,"sources":["../../components/back-top/index.tsx"],"sourcesContent":["import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport ReactDOM from 'react-dom';\nimport {\n classNames,\n getMaxZindex,\n getPrefixCls,\n getScrollTop,\n isEqual,\n isFunction,\n} from '../utils';\nimport './index.global.less';\n\nexport interface BackTopProps extends React.HTMLAttributes<HTMLDivElement> {\n /** 设置需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 */\n target?: () => HTMLElement;\n /** 滚动高度达到此参数值才出现 BackTop */\n visibilityHeight?: number;\n}\n\nconst BackTop: React.FC<BackTopProps> = ({\n target = () => window as unknown as HTMLElement,\n visibilityHeight = 400,\n className,\n ...props\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n const [show, setShow] = useState<boolean | null>(null);\n const handleScrollY = useCallback(() => {\n let scrollTop: number | null = 0;\n let offsetHeight: number | null = 0;\n\n if (isFunction(target)) {\n const ele: HTMLElement = target() as HTMLElement;\n\n if (ele) {\n scrollTop = getScrollTop(ele);\n offsetHeight = ele.offsetHeight;\n }\n }\n const nextShow: boolean = scrollTop > offsetHeight / 3 || scrollTop > visibilityHeight;\n\n if (Boolean(show) !== nextShow) {\n setShow(nextShow);\n }\n }, [show, target, visibilityHeight]);\n const handleBackTop = useCallback(() => {\n target()?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }, [target]);\n\n useEffect(() => {\n if (show && ref.current) {\n ref.current.style.zIndex = getMaxZindex().toString();\n }\n }, [show]);\n useEffect(() => {\n if (isFunction(target)) {\n target()?.addEventListener('scroll', handleScrollY, false);\n }\n return () => {\n if (isFunction(target)) {\n target()?.removeEventListener('scroll', handleScrollY, false);\n }\n };\n }, [handleScrollY, target]);\n\n const cls = useMemo(\n () => classNames([getPrefixCls('back-top'), className, !show && getPrefixCls('back-top-out')]),\n [className, show]\n );\n const exit = useCallback(() => {\n if (show === false) {\n setShow(null);\n }\n }, [show]);\n const el = useMemo(\n () => (\n <div {...props} ref={ref} onAnimationEnd={exit} className={cls} onClick={handleBackTop} />\n ),\n [cls, exit, handleBackTop, props]\n );\n\n return show === null ? null : ReactDOM.createPortal(el, target());\n};\n\nexport default memo(BackTop, isEqual);\n"],"names":["BackTop","target","window","visibilityHeight","className","props","ref","useRef","useState","show","setShow","handleScrollY","useCallback","scrollTop","offsetHeight","isFunction","ele","getScrollTop","nextShow","Boolean","handleBackTop","scrollTo","top","behavior","useEffect","current","style","zIndex","getMaxZindex","toString","addEventListener","removeEventListener","cls","useMemo","classNames","getPrefixCls","exit","el","div","onAnimationEnd","onClick","ReactDOM","createPortal","memo","isEqual"],"mappings":"AAAA,oGAuFA,iDAAA,uDAvF+E,uDAC1D,iCAQd,oBACA,g1GASP,IAAMA,QAAkC,gBAKlC,oBAJJC,OAAAA,wBAAS,kBAAMC,yCACfC,iBAAAA,4CAAmB,sBACnBC,iBAAAA,UACGC,uCAHHJ,SACAE,mBACAC,cAGA,IAAME,IAAMC,GAAAA,aAAM,EAAiB,IAAI,EACvC,IAAwBC,oBAAAA,GAAAA,eAAQ,EAAiB,IAAI,KAA9CC,KAAiBD,QAAXE,QAAWF,QACxB,IAAMG,cAAgBC,GAAAA,kBAAW,EAAC,UAAM,CACtC,IAAIC,UAA2B,EAC/B,IAAIC,aAA8B,EAElC,GAAIC,GAAAA,iBAAU,EAACd,QAAS,CACtB,IAAMe,IAAmBf,SAEzB,GAAIe,IAAK,CACPH,UAAYI,GAAAA,mBAAY,EAACD,KACzBF,aAAeE,IAAIF,YAAY,AACjC,CAAC,AACH,CAAC,AACD,IAAMI,SAAoBL,UAAYC,aAAe,GAAKD,UAAYV,iBAEtE,GAAIgB,QAAQV,QAAUS,SAAU,CAC9BR,QAAQQ,SACV,CAAC,AACH,EAAG,CAACT,KAAMR,OAAQE,iBAAiB,EACnC,IAAMiB,cAAgBR,GAAAA,kBAAW,EAAC,UAAM,KACtCX,GAAAA,EAAAA,IAAAA,kBAAAA,aAAAA,KAAAA,EAAAA,IAAUoB,SAAS,CACjBC,IAAK,EACLC,SAAU,QACZ,EACF,EAAG,CAACtB,OAAO,EAEXuB,GAAAA,gBAAS,EAAC,UAAM,CACd,GAAIf,MAAQH,IAAImB,OAAO,CAAE,CACvBnB,IAAImB,OAAO,CAACC,KAAK,CAACC,MAAM,CAAGC,GAAAA,mBAAY,IAAGC,QAAQ,EACpD,CAAC,AACH,EAAG,CAACpB,KAAK,EACTe,GAAAA,gBAAS,EAAC,UAAM,CACd,GAAIT,GAAAA,iBAAU,EAACd,QAAS,KACtBA,GAAAA,EAAAA,IAAAA,kBAAAA,aAAAA,KAAAA,EAAAA,IAAU6B,iBAAiB,SAAUnB,cAAe,KAAK,CAC3D,CAAC,AACD,OAAO,UAAM,CACX,GAAII,GAAAA,iBAAU,EAACd,QAAS,KACtBA,GAAAA,EAAAA,IAAAA,kBAAAA,aAAAA,KAAAA,EAAAA,IAAU8B,oBAAoB,SAAUpB,cAAe,KAAK,CAC9D,CAAC,AACH,CACF,EAAG,CAACA,cAAeV,OAAO,EAE1B,IAAM+B,IAAMC,GAAAA,cAAO,EACjB,iBAAMC,GAAAA,iBAAU,EAAC,CAACC,GAAAA,mBAAY,EAAC,YAAa/B,UAAW,CAACK,MAAQ0B,GAAAA,mBAAY,EAAC,gBAAgB,GAC7F,CAAC/B,UAAWK,KAAK,EAEnB,IAAM2B,KAAOxB,GAAAA,kBAAW,EAAC,UAAM,CAC7B,GAAIH,OAAS,KAAK,CAAE,CAClBC,QAAQ,IAAI,CACd,CAAC,AACH,EAAG,CAACD,KAAK,EACT,IAAM4B,GAAKJ,GAAAA,cAAO,EAChB,kBACE,6BAACK,kBAAQjC,OAAOC,IAAKA,IAAKiC,eAAgBH,KAAMhC,UAAW4B,IAAKQ,QAASpB,kBAE3E,CAACY,IAAKI,KAAMhB,cAAef,MAAM,EAGnC,OAAOI,OAAS,IAAI,CAAG,IAAI,CAAGgC,iBAAQ,CAACC,YAAY,CAACL,GAAIpC,SAAS,AACnE,MAEA,SAAe0C,GAAAA,WAAI,EAAC3C,QAAS4C,cAAO"}
File without changes
@@ -36,6 +36,7 @@
36
36
  }
37
37
  .@{prefix-cls}-btn {
38
38
  --wave-shadow-color: var(--primary-color-outline);
39
+ outline-offset: 4px;
39
40
  display: inline-block;
40
41
  width: fit-content;
41
42
  min-width: 22px;
@@ -134,7 +135,7 @@
134
135
  border-radius: 50% !important;
135
136
  text-align: center;
136
137
 
137
- span {
138
+ .@{prefix-cls}-btn-text {
138
139
  display: block;
139
140
  white-space: nowrap;
140
141
  text-overflow: ellipsis;
@@ -172,7 +173,6 @@
172
173
  &:last-child {
173
174
  margin-right: 0;
174
175
  }
175
-
176
176
  }
177
177
 
178
178
  @keyframes wave-effect {