@zjpcy/simple-design 1.6.0 → 1.8.3
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.
- package/README.md +178 -26
- package/dist/cjs/components/Anchor/index.js +1 -0
- package/dist/cjs/components/Breadcrumb/index.js +1 -0
- package/dist/cjs/components/Button/Button.js +1 -0
- package/dist/cjs/components/Calendar/index.js +1 -0
- package/dist/cjs/components/Carousel/index.js +1 -0
- package/dist/cjs/components/Cascader/index.js +1 -0
- package/dist/cjs/components/Checkbox/index.js +1 -0
- package/dist/cjs/components/ColorPicker/ColorPickerPanel.js +1 -0
- package/dist/cjs/components/ColorPicker/index.js +1 -0
- package/dist/cjs/components/CopyToClipboard/index.js +1 -0
- package/dist/cjs/components/DatePicker/RangePicker.js +1 -0
- package/dist/cjs/components/DatePicker/index.js +1 -0
- package/dist/cjs/components/DatePicker/styles.js +1 -0
- package/dist/cjs/components/Divider/index.js +1 -0
- package/dist/cjs/components/Drawer/index.js +1 -0
- package/dist/cjs/components/Dropdown/index.js +1 -0
- package/dist/cjs/components/Empty/index.js +1 -0
- package/dist/cjs/components/Flex/index.js +1 -0
- package/dist/cjs/components/Form/index.js +1 -0
- package/dist/cjs/components/Form/styles.js +1 -0
- package/dist/cjs/components/Grid/index.js +1 -0
- package/dist/cjs/components/Grid/styles.js +1 -0
- package/dist/cjs/components/Hooks/useClickOutside.js +1 -0
- package/dist/cjs/components/Hooks/useCopy.js +1 -0
- package/dist/cjs/components/Icon/Icon.js +1 -0
- package/dist/cjs/components/Icon/index.js +1 -0
- package/dist/cjs/components/Icon/path.js +1 -0
- package/dist/cjs/components/Input/InputBase.js +1 -0
- package/dist/cjs/components/Input/Number.js +1 -0
- package/dist/cjs/components/Input/Password.js +1 -0
- package/dist/cjs/components/Input/Search.js +1 -0
- package/dist/cjs/components/Input/Textarea.js +1 -0
- package/dist/cjs/components/Input/index.js +1 -0
- package/dist/cjs/components/Label/index.js +1 -0
- package/dist/cjs/components/Label/styles.js +1 -0
- package/dist/cjs/components/Layout/LayoutContext.js +1 -0
- package/dist/cjs/components/Layout/index.js +1 -0
- package/dist/cjs/components/Layout/styles.js +1 -0
- package/dist/cjs/components/Marquee/index.js +1 -0
- package/dist/cjs/components/Masonry/index.js +1 -0
- package/dist/cjs/components/Menu/index.js +1 -0
- package/dist/cjs/components/Message/Message.js +1 -0
- package/dist/cjs/components/Message/index.js +1 -0
- package/dist/cjs/components/Modal/index.js +1 -0
- package/dist/cjs/components/Notification/Notification.js +1 -0
- package/dist/cjs/components/Pagination/index.js +1 -0
- package/dist/cjs/components/Popconfirm/index.js +1 -0
- package/dist/cjs/components/Progress/index.js +1 -0
- package/dist/cjs/components/Radio/index.js +1 -0
- package/dist/cjs/components/Rate/index.js +1 -0
- package/dist/cjs/components/Select/index.js +1 -0
- package/dist/cjs/components/Select/styles.js +1 -0
- package/dist/cjs/components/Slider/index.js +1 -0
- package/dist/cjs/components/Space/index.js +1 -0
- package/dist/cjs/components/Spin/index.js +1 -0
- package/dist/cjs/components/Splitter/index.js +1 -0
- package/dist/cjs/components/Splitter/styles.js +1 -0
- package/dist/cjs/components/Steps/index.js +1 -0
- package/dist/cjs/components/Switch/index.js +1 -0
- package/dist/cjs/components/Switch/styles.js +1 -0
- package/dist/cjs/components/Table/SortableRow.js +1 -0
- package/dist/cjs/components/Table/index.js +1 -0
- package/dist/cjs/components/Tabs/index.js +1 -0
- package/dist/cjs/components/Tag/index.js +1 -0
- package/dist/cjs/components/TimePicker/RangePicker.js +1 -0
- package/dist/cjs/components/TimePicker/TimePickerPanel.js +1 -0
- package/dist/cjs/components/TimePicker/index.js +1 -0
- package/dist/cjs/components/Tooltip/Tooltip.js +1 -0
- package/dist/cjs/components/Top/index.js +1 -0
- package/dist/cjs/components/Transfer/index.js +1 -0
- package/dist/cjs/components/Transfer/styles.js +1 -0
- package/dist/cjs/components/Tree/index.js +1 -0
- package/dist/cjs/components/TreeSelect/index.js +1 -0
- package/dist/cjs/components/TreeSelect/styles.js +1 -0
- package/dist/cjs/components/Typography/index.js +1 -0
- package/dist/cjs/components/Upload/index.js +1 -0
- package/dist/cjs/components/Upload/useChunkUpload.js +1 -0
- package/dist/cjs/components/index.js +1 -0
- package/dist/cjs/i18n/I18nProvider.js +1 -0
- package/dist/cjs/i18n/index.js +1 -0
- package/dist/cjs/i18n/locales/en-US.json.js +1 -0
- package/dist/cjs/i18n/locales/zh-CN.json.js +1 -0
- package/dist/cjs/index.css +11725 -6076
- package/dist/es/components/Anchor/index.js +1 -0
- package/dist/es/components/Button/Button.js +1 -0
- package/dist/es/components/Calendar/index.js +1 -0
- package/dist/es/components/Carousel/index.js +1 -0
- package/dist/es/components/Cascader/index.js +1 -0
- package/dist/es/components/Checkbox/index.js +1 -0
- package/dist/es/components/ColorPicker/ColorPickerPanel.js +1 -0
- package/dist/es/components/ColorPicker/index.js +1 -0
- package/dist/es/components/CopyToClipboard/index.js +1 -0
- package/dist/es/components/DatePicker/RangePicker.js +1 -0
- package/dist/es/components/DatePicker/index.js +1 -0
- package/dist/es/components/DatePicker/styles.js +1 -0
- package/dist/es/components/Divider/index.js +1 -0
- package/dist/es/components/Drawer/index.js +1 -0
- package/dist/es/components/Flex/index.js +1 -0
- package/dist/es/components/Form/index.js +1 -0
- package/dist/es/components/Form/styles.js +1 -0
- package/dist/es/components/Grid/index.js +1 -0
- package/dist/es/components/Grid/styles.js +1 -0
- package/dist/es/components/Hooks/useCopy.js +1 -0
- package/dist/es/components/Icon/Icon.js +1 -0
- package/dist/es/components/Input/InputBase.js +1 -0
- package/dist/es/components/Input/Number.js +1 -0
- package/dist/es/components/Input/Password.js +1 -0
- package/dist/es/components/Input/Search.js +1 -0
- package/dist/es/components/Input/Textarea.js +1 -0
- package/dist/es/components/Label/index.js +1 -0
- package/dist/es/components/Label/styles.js +1 -0
- package/dist/es/components/Layout/index.js +1 -0
- package/dist/es/components/Layout/styles.js +1 -0
- package/dist/es/components/Marquee/index.js +1 -0
- package/dist/es/components/Masonry/index.js +1 -0
- package/dist/es/components/Menu/index.js +1 -0
- package/dist/es/components/Message/index.js +1 -0
- package/dist/es/components/Modal/index.js +1 -0
- package/dist/es/components/Notification/Notification.js +1 -0
- package/dist/es/components/Popconfirm/index.js +1 -0
- package/dist/es/components/Progress/index.js +1 -0
- package/dist/es/components/Radio/index.js +1 -0
- package/dist/es/components/Select/index.js +1 -0
- package/dist/es/components/Select/styles.js +1 -0
- package/dist/es/components/Slider/index.js +1 -0
- package/dist/es/components/Space/index.js +1 -0
- package/dist/es/components/Splitter/index.js +1 -0
- package/dist/es/components/Splitter/styles.js +1 -0
- package/dist/es/components/Switch/index.js +1 -0
- package/dist/es/components/Switch/styles.js +1 -0
- package/dist/es/components/Table/SortableRow.js +1 -0
- package/dist/es/components/Table/index.js +1 -0
- package/dist/es/components/Tabs/index.js +1 -0
- package/dist/es/components/Tag/index.js +1 -0
- package/dist/es/components/TimePicker/RangePicker.js +1 -0
- package/dist/es/components/TimePicker/TimePickerPanel.js +1 -0
- package/dist/es/components/TimePicker/index.js +1 -0
- package/dist/es/components/Tooltip/Tooltip.js +1 -0
- package/dist/es/components/Top/index.js +1 -0
- package/dist/es/components/Transfer/index.js +1 -0
- package/dist/es/components/Transfer/styles.js +1 -0
- package/dist/es/components/Tree/index.js +1 -0
- package/dist/es/components/TreeSelect/index.js +1 -0
- package/dist/es/components/TreeSelect/styles.js +1 -0
- package/dist/es/components/Typography/index.js +1 -0
- package/dist/es/components/Upload/index.js +1 -0
- package/dist/es/components/Upload/useChunkUpload.js +1 -0
- package/dist/es/components/index.js +1 -0
- package/dist/es/i18n/I18nProvider.js +1 -0
- package/dist/es/i18n/index.js +1 -0
- package/dist/es/i18n/locales/en-US.json.js +1 -0
- package/dist/es/i18n/locales/zh-CN.json.js +1 -0
- package/dist/es/index.css +11725 -6076
- package/dist/i18n/locales/en-US.json +2 -3
- package/dist/i18n/locales/zh-CN.json +1 -1
- package/dist/types/components/ColorPicker/ColorPickerPanel.d.ts +21 -0
- package/dist/types/components/DatePicker/styles.d.ts +118 -152
- package/dist/types/components/Form/styles.d.ts +84 -22
- package/dist/types/components/Grid/styles.d.ts +36 -6
- package/dist/types/components/Label/styles.d.ts +16 -1
- package/dist/types/components/Label/types.d.ts +1 -0
- package/dist/types/components/Layout/styles.d.ts +131 -41
- package/dist/types/components/Marquee/index.d.ts +1 -1
- package/dist/types/components/Message/index.d.ts +1 -1
- package/dist/types/components/Select/styles.d.ts +254 -44
- package/dist/types/components/Splitter/styles.d.ts +39 -2
- package/dist/types/components/Splitter/types.d.ts +12 -12
- package/dist/types/components/Switch/index.d.ts +1 -0
- package/dist/types/components/Switch/styles.d.ts +116 -35
- package/dist/types/components/Switch/types.d.ts +4 -0
- package/dist/types/components/TimePicker/styles.d.ts +153 -25
- package/dist/types/components/Top/index.d.ts +1 -1
- package/dist/types/components/Transfer/styles.d.ts +205 -66
- package/dist/types/components/TreeSelect/index.d.ts +1 -0
- package/dist/types/components/TreeSelect/styles.d.ts +295 -55
- package/dist/types/components/TreeSelect/types.d.ts +3 -1
- package/dist/types/components/Upload/index.d.ts +2 -2
- package/dist/types/components/Upload/styles.d.ts +150 -24
- package/dist/types/components/Upload/types.d.ts +279 -15
- package/dist/types/components/Upload/useChunkUpload.d.ts +27 -0
- package/dist/types/components/index.d.ts +4 -3
- package/dist/types/i18n/index.d.ts +1 -1
- package/dist/types/utils/dnd-kit-adapter.d.ts +2 -0
- package/dist/types/utils/i18n-adapter.d.ts +5 -0
- package/dist/types/utils/lunar-adapter.d.ts +2 -0
- package/package.json +29 -13
- package/dist/cjs/index.js +0 -1
- package/dist/es/Anchor/index.js +0 -1
- package/dist/es/Button/Button.js +0 -1
- package/dist/es/Calendar/index.js +0 -1
- package/dist/es/Carousel/index.js +0 -1
- package/dist/es/Cascader/index.js +0 -1
- package/dist/es/Checkbox/index.js +0 -1
- package/dist/es/ColorPicker/index.js +0 -1
- package/dist/es/CopyToClipboard/index.js +0 -1
- package/dist/es/DatePicker/RangePicker.js +0 -1
- package/dist/es/DatePicker/index.js +0 -1
- package/dist/es/DatePicker/styles.js +0 -1
- package/dist/es/Divider/index.js +0 -1
- package/dist/es/Drawer/index.js +0 -1
- package/dist/es/Flex/index.js +0 -1
- package/dist/es/Form/index.js +0 -1
- package/dist/es/Form/styles.js +0 -1
- package/dist/es/Grid/index.js +0 -1
- package/dist/es/Grid/styles.js +0 -1
- package/dist/es/Hooks/useCopy.js +0 -1
- package/dist/es/Icon/Icon.js +0 -1
- package/dist/es/Input/InputBase.js +0 -1
- package/dist/es/Input/Number.js +0 -1
- package/dist/es/Input/Password.js +0 -1
- package/dist/es/Input/Search.js +0 -1
- package/dist/es/Input/Textarea.js +0 -1
- package/dist/es/Label/index.js +0 -1
- package/dist/es/Label/styles.js +0 -1
- package/dist/es/Layout/index.js +0 -1
- package/dist/es/Layout/styles.js +0 -1
- package/dist/es/Marquee/index.js +0 -1
- package/dist/es/Masonry/index.js +0 -1
- package/dist/es/Menu/index.js +0 -1
- package/dist/es/Message/index.js +0 -1
- package/dist/es/Modal/index.js +0 -1
- package/dist/es/Notice/Notice.js +0 -1
- package/dist/es/Notification/Notification.js +0 -1
- package/dist/es/Popconfirm/index.js +0 -1
- package/dist/es/Progress/index.js +0 -1
- package/dist/es/Radio/index.js +0 -1
- package/dist/es/Select/index.js +0 -1
- package/dist/es/Select/styles.js +0 -1
- package/dist/es/Slider/index.js +0 -1
- package/dist/es/Space/index.js +0 -1
- package/dist/es/Splitter/index.js +0 -1
- package/dist/es/Splitter/styles.js +0 -1
- package/dist/es/Switch/index.js +0 -1
- package/dist/es/Switch/styles.js +0 -1
- package/dist/es/Table/SortableRow.js +0 -1
- package/dist/es/Table/index.js +0 -1
- package/dist/es/Tabs/index.js +0 -1
- package/dist/es/Tag/index.js +0 -1
- package/dist/es/TimePicker/RangePicker.js +0 -1
- package/dist/es/TimePicker/TimePickerPanel.js +0 -1
- package/dist/es/TimePicker/index.js +0 -1
- package/dist/es/Tooltip/Tooltip.js +0 -1
- package/dist/es/Top/index.js +0 -1
- package/dist/es/Transfer/index.js +0 -1
- package/dist/es/Transfer/styles.js +0 -1
- package/dist/es/Tree/index.js +0 -1
- package/dist/es/TreeSelect/index.js +0 -1
- package/dist/es/TreeSelect/styles.js +0 -1
- package/dist/es/Typography/index.js +0 -1
- package/dist/es/Upload/index.js +0 -1
- package/dist/es/_virtual/index.js +0 -1
- package/dist/es/_virtual/index2.js +0 -1
- package/dist/es/_virtual/use-sync-external-store-shim.development.js +0 -1
- package/dist/es/_virtual/use-sync-external-store-shim.production.js +0 -1
- package/dist/es/index.js +0 -1
- package/dist/es/node_modules/i18next/dist/esm/i18next.js +0 -1
- package/dist/es/node_modules/react-fast-marquee/dist/index.js +0 -1
- package/dist/es/node_modules/react-i18next/dist/es/I18nextProvider.js +0 -1
- package/dist/es/node_modules/react-i18next/dist/es/context.js +0 -1
- package/dist/es/node_modules/react-i18next/dist/es/defaults.js +0 -1
- package/dist/es/node_modules/react-i18next/dist/es/i18nInstance.js +0 -1
- package/dist/es/node_modules/react-i18next/dist/es/initReactI18next.js +0 -1
- package/dist/es/node_modules/react-i18next/dist/es/unescape.js +0 -1
- package/dist/es/node_modules/react-i18next/dist/es/useTranslation.js +0 -1
- package/dist/es/node_modules/react-i18next/dist/es/utils.js +0 -1
- package/dist/es/node_modules/react-icons/fa/index.js +0 -1
- package/dist/es/node_modules/react-icons/io5/index.js +0 -1
- package/dist/es/node_modules/react-icons/lib/iconBase.js +0 -1
- package/dist/es/node_modules/react-icons/lib/iconContext.js +0 -1
- package/dist/es/node_modules/tslib/tslib.es6.js +0 -1
- package/dist/es/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -1
- package/dist/es/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -1
- package/dist/es/node_modules/use-sync-external-store/shim/index.js +0 -1
- package/dist/es/src/i18n/I18nProvider.js +0 -1
- package/dist/es/src/i18n/index.js +0 -1
- package/dist/es/src/i18n/locales/en-US.json.js +0 -1
- package/dist/es/src/i18n/locales/zh-CN.json.js +0 -1
- package/dist/types/components/Drawer/styles.d.ts +0 -0
- package/dist/types/components/Menu/styles.d.ts +0 -7
- package/dist/types/components/Notice/Notice.d.ts +0 -18
- package/dist/types/components/Progress/styles.d.ts +0 -0
- /package/dist/es/{Breadcrumb → components/Breadcrumb}/index.js +0 -0
- /package/dist/es/{Dropdown → components/Dropdown}/index.js +0 -0
- /package/dist/es/{Empty → components/Empty}/index.js +0 -0
- /package/dist/es/{Hooks → components/Hooks}/useClickOutside.js +0 -0
- /package/dist/es/{Icon → components/Icon}/index.js +0 -0
- /package/dist/es/{Icon → components/Icon}/path.js +0 -0
- /package/dist/es/{Input → components/Input}/index.js +0 -0
- /package/dist/es/{Layout → components/Layout}/LayoutContext.js +0 -0
- /package/dist/es/{Message → components/Message}/Message.js +0 -0
- /package/dist/es/{Pagination → components/Pagination}/index.js +0 -0
- /package/dist/es/{Rate → components/Rate}/index.js +0 -0
- /package/dist/es/{Spin → components/Spin}/index.js +0 -0
- /package/dist/es/{Steps → components/Steps}/index.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__assign as n,__spreadArray as r}from"tslib";import{jsx as e}from"react/jsx-runtime";import t,{useState as o,useRef as c,useEffect as i}from"react";var u=function(){return null},l=function(l){var a=l.className,f=l.style,s=l.children,d=l.offsetTop,p=void 0===d?0:d,m=l.affix,h=void 0===m||m,v=l.bounds,w=void 0===v?5:v,y=l.getContainer,g=void 0===y?function(){return window.document.documentElement}:y,E=l.onChange,T=o(""),b=T[0],z=T[1],C=o([]),j=C[0],k=C[1],B=c(null),L=c(null),N=c(""),R=c(!1),x=c("");i(function(){N.current=b},[b]);var A=function(){var r=g(),e=r===window.document.documentElement||r===document.body,t=!1,o=j.map(function(o){var c=document.querySelector(o.href);if(c){var i=c.getBoundingClientRect(),u=0;if(e)u=i.top+window.scrollY-p;else{var l=r.getBoundingClientRect();u=i.top-l.top+r.scrollTop-p}if(Math.abs(u-o.top)>1)return t=!0,n(n({},o),{top:u})}return o});t&&k(o)},Y=function(){if(!R.current&&0!==j.length){for(var n=g(),e=(n===window.document.documentElement||n===document.body?window.scrollY:n.scrollTop)+p+w,t="",o=r([],j,!0).sort(function(n,r){return n.top-r.top}),c=0;c<o.length&&e>=o[c].top;c+=1)t=o[c].href;if(x.current){var i=o.find(function(n){return n.href===x.current});if(i)return void(Math.abs(e-i.top)<50&&(x.current!==N.current&&(z(x.current),N.current=x.current,null==E||E(x.current)),x.current=""))}t!==N.current&&(z(t),N.current=t,null==E||E(t))}};i(function(){var n=function(n){var r=[],e=function(n){if(t.isValidElement(n)){var o=n;if(o.type===u&&o.props.href&&o.props.title&&r.push({href:o.props.href,title:o.props.title,top:0}),"children"in o.props&&o.props.children){var c=o.props.children;Array.isArray(c)?c.forEach(e):e(c)}}};return Array.isArray(n)?n.forEach(e):e(n),r}(s);k(n)},[s]),i(function(){A(),Y();var n=g();L.current=function(){Y()},n.addEventListener("scroll",L.current);var r=function(){A(),Y()};return window.addEventListener("resize",r),function(){L.current&&n.removeEventListener("scroll",L.current),window.removeEventListener("resize",r)}},[j,p,w,g,E]);var q="zjpcy-anchor ".concat(a||""," ").concat(h?"zjpcy-anchor-affix":"");return e("div",{ref:B,className:q,style:f,children:e("ul",{className:"zjpcy-anchor-list",children:j.map(function(n){return e("li",{className:"zjpcy-anchor-link ".concat(b===n.href?"zjpcy-anchor-link-active":""),children:e("a",{href:n.href,onClick:function(r){return function(n,r){n.preventDefault();var e=document.querySelector(r);if(e){var t=g();R.current=!0,x.current=r,z(r),N.current=r,E&&E(r),setTimeout(function(){if(t!==window.document.documentElement&&t!==document.body){var n=t.getBoundingClientRect(),r=(o=e.getBoundingClientRect()).top-n.top+t.scrollTop-p;t&&"function"==typeof t.scrollTo&&t.scrollTo({top:r,behavior:"smooth"})}else{var o=e.getBoundingClientRect(),c=window.pageYOffset||document.documentElement.scrollTop;r=o.top+c-p,window.scrollTo({top:r,behavior:"smooth"})}setTimeout(function(){R.current=!1},1500)},0)}}(r,n.href)},className:"zjpcy-anchor-link-a",children:n.title})},n.href)})})})};l.Link=u;var a=l;export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest as e,__assign as t}from"tslib";import{jsxs as i,jsx as n}from"react/jsx-runtime";import l from"react";import r from"classnames";import a from"../Icon/Icon.js";var o=l.forwardRef(function(l,o){var s=l.children,c=l.variant,d=l.type,m=l.size,p=void 0===m?"medium":m,y=l.disabled,f=void 0!==y&&y,u=l.loading,g=void 0!==u&&u,h=l.onClick,b=l.className,v=l.style,j=l.icon,k=l.htmlType,x=void 0===k?"button":k,z=l.href,N=l.title,C=e(l,["children","variant","type","size","disabled","loading","onClick","className","style","icon","htmlType","href","title"]),R=null!=c?c:d&&["primary","secondary","danger","success","warning","link"].includes(d)?d:"secondary",I=r("zjpcy-btn","zjpcy-btn--".concat(R),"zjpcy-btn--".concat(p),{"zjpcy-btn--disabled":f||g},b),w=function(e){f||g?null==e||e.preventDefault():h&&h()},T=function(){return g?n(a,{type:"loading",style:{marginRight:s?"2px":0}}):j?"string"==typeof j?n(a,{type:j,style:{marginRight:s?"2px":0}}):n("span",{style:{marginRight:s?"8px":0,display:"inline-flex",alignItems:"center"},children:j}):null};return"link"===R&&z?i("a",t({ref:o,href:f?void 0:z,className:I,onClick:w,style:v,title:N},C,{children:[T(),s]})):i("button",t({ref:o,type:x,className:I,onClick:w,disabled:f,style:v,title:N},C,{children:[T(),s]}))});o.displayName="Button";var s=o;export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__assign as a,__spreadArray as e}from"tslib";import{jsxs as n,jsx as l,Fragment as c}from"react/jsx-runtime";import r,{useState as i,useMemo as d,useCallback as t}from"react";import s from"classnames";import u from"../Icon/Icon.js";import o from"../Input/index.js";import _ from"../Input/Textarea.js";import p from"../Modal/index.js";import h from"../Button/Button.js";import m from"../Tooltip/Tooltip.js";import{Solar as y}from"lunar-typescript";var z=function(a){var e=y.fromYmd(a.getFullYear(),a.getMonth()+1,a.getDate()),n=e.getLunar(),l=n.getJieQi(),c=[],r=n.getFestivals();r&&c.push.apply(c,r);var i=n.getOtherFestivals();i&&c.push.apply(c,i);var d=n.getDay(),t={0:"建",1:"除",2:"满",3:"平",4:"定",5:"执",6:"破",7:"危",8:"成",9:"收",10:"开",11:"闭"}[d%12],s={0:{name:"青龙",luck:"吉"},1:{name:"明堂",luck:"吉"},2:{name:"天刑",luck:"凶"},3:{name:"朱雀",luck:"凶"},4:{name:"金匮",luck:"吉"},5:{name:"天德",luck:"吉"},6:{name:"白虎",luck:"凶"},7:{name:"玉堂",luck:"吉"},8:{name:"天牢",luck:"凶"},9:{name:"玄武",luck:"凶"},10:{name:"司命",luck:"吉"},11:{name:"勾陈",luck:"凶"}}[d%12],u=n.getBaZi(),o=[],_=[];"开"!==t&&"成"!==t&&"满"!==t&&"定"!==t||o.push("天德","月德","三合","六合"),"除"!==t&&"执"!==t&&"收"!==t||o.push("天恩","母仓","不将"),l&&o.push("节气","天赦"),"破"!==t&&"危"!==t&&"闭"!==t||_.push("月破","大耗","四击"),"凶"===s.luck&&_.push(s.name);var p=n.getXiu(),h=n.getXiuLuck(),m=n.getXiuSong(),z=n.getDayInGanZhi().charAt(0);return{year:n.getYear(),month:n.getMonth(),day:n.getDay(),monthName:n.getMonthInChinese(),dayName:n.getDayInChinese(),yearName:n.getYearInChinese(),isLeap:!1,julianDay:e.getJulianDay(),week:n.getWeekInChinese(),zodiac:n.getYearShengXiao(),ganZhiYear:n.getYearInGanZhi(),ganZhiMonth:n.getMonthInGanZhi(),ganZhiDay:n.getDayInGanZhi(),term:l||void 0,festivals:c,isTermDay:!!l,pengZuDay:n.getPengZuGan()+" "+n.getPengZuZhi(),pengZuHour:"",yi:"破"===t||"危"===t?["祭祀","沐浴","扫舍"]:["祭祀","祈福","嫁娶","出行","开市"],ji:"破"===t||"危"===t?["嫁娶","安葬","开市"]:["动土","开仓","纳采"],jiShen:o,xiongSha:_,xiGod:{name:{"甲":"东北","乙":"东北","丙":"西南","丁":"西南","戊":"东南","己":"东南","庚":"西北","辛":"西北","壬":"正南","癸":"正南"}[z]||"正南",description:"喜神方位"},fuGod:{name:"正东",description:"福神方位"},caiGod:{name:n.getDayPositionCai(),description:"财神方位"},yangGuiGod:{name:n.getDayPositionYangGui(),description:"阳贵神方位"},yinGuiGod:{name:n.getDayPositionYinGui(),description:"阴贵神方位"},taiShen:n.getDayPositionTai(),chongSha:n.getDayChongDesc(),sha:n.getDaySha(),naYin:"",yearNaYin:n.getYearNaYin(),monthNaYin:n.getMonthNaYin(),dayNaYin:n.getDayNaYin(),xiu:p||"",xiuAnimal:n.getAnimal()||"",xiuLuck:h||"",xiuSong:m||"",baZiYear:u[0]||"",baZiMonth:u[1]||"",baZiDay:u[2]||"",baZiHour:u[3]||"",baZi:u.join(" ")||"",yearWuXing:"",monthWuXing:"",dayWuXing:"",hourWuXing:"",yearShiShen:"",monthShiShen:"",hourShiShen:"",zhiXing:t,zhiXingDesc:{"建":"宜:出行、上任、会友、上书、见工。忌:动土、开仓、婚嫁、纳采。","除":"宜:除服、疗病、出行、拆卸、入宅。忌:求官、上任、开张、搬家。","满":"宜:修造、嫁娶、移徙、开市、交易。忌:栽种、下葬、求医、赴任。","平":"宜:修饰垣墙、平治道涂。忌:诸事不宜。","定":"宜:嫁娶、纳采、祭祀、祈福、出行。忌:求医、诉讼、赴任、出行。","执":"宜:祭祀、祈福、纳表、进章、捕捉。忌:开市、交易、纳财、出行。","破":"宜:破屋、求医、治病、坏垣。忌:嫁娶、安葬、纳采、出行。","危":"宜:祭祀、祈福、斋醮、酬神。忌:嫁娶、开市、安葬。","成":"宜:嫁娶、纳采、祭祀、祈福、开市。忌:安葬、出行、赴任。","收":"宜:祭祀、祈福、纳采、嫁娶、出行。忌:开市、动土、安葬。","开":"宜:嫁娶、纳采、开市、出行、动土。忌:安葬、祭祀、入殓。","闭":"宜:安葬、祭祀、祈福、纳采、嫁娶。忌:出行、动土、开市。"}[t]||"",shiErShen:s.name,shiErShenLuck:s.luck,isHuangDao:"吉"===s.luck,huangDaoName:s.name}},j=function(a){if(a.term)return a.term;var e=a.dayName;return"初一"===e?a.isLeap?"闰".concat(a.monthName):a.monthName:e},N=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],v=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],f=["日","一","二","三","四","五","六"],g={fields:[{name:"title",label:"标题",type:"text",placeholder:"请输入标题",required:!0},{name:"content",label:"内容",type:"textarea",placeholder:"请输入内容"}],submitText:"保存",cancelText:"取消"},b=function(a,e){return new Date(a,e+1,0).getDate()},k=function(a,e){return a.getFullYear()===e.getFullYear()&&a.getMonth()===e.getMonth()&&a.getDate()===e.getDate()},D=function(a,e){return e.some(function(e){return k(e,a)})},C=function(a){var e=a.getFullYear(),n=String(a.getMonth()+1).padStart(2,"0"),l=String(a.getDate()).padStart(2,"0");return"".concat(e,"-").concat(n,"-").concat(l)},S=function(a,e,n){for(var l=[],c=b(a,e),r=function(a,e){return new Date(a,e,1).getDay()}(a,e),i=r>=n?r-n:7-(n-r),d=0===e?11:e-1,t=0===e?a-1:a,s=b(t,d),u=i-1;u>=0;u--)l.push(new Date(t,d,s-u));for(u=1;u<=c;u++)l.push(new Date(a,e,u));var o=42-l.length,_=11===e?0:e+1,p=11===e?a+1:a;for(u=1;u<=o;u++)l.push(new Date(p,_,u));return l},x=function(y){var b=y.selectionMode,x=void 0===b?"single":b,Y=y.value,Z=y.defaultValue,w=y.onChange,M=y.dateCellRender,G=y.monthCellRender,A=y.disabledDate,L=y.headerRender,X=y.mode,I=y.onPanelChange,F=y.fullscreen,W=void 0===F||F,T=y.size,P=void 0===T?"default":T,E=y.layout,H=void 0===E?"horizontal":E,J=y.className,q=y.style,O=y.firstDayOfWeek,R=void 0===O?0:O,B=y.showWeekend,Q=void 0===B||B,V=y.editable,K=void 0!==V&&V,U=y.dateInfo,$=void 0===U?{}:U,aa=y.onDateInfoChange,ea=y.panelFormConfig,na=void 0===ea?g:ea,la=y.showLunar,ca=void 0!==la&&la,ra=y.lunarRender,ia=y.enableLunarDetail,da=void 0!==ia&&ia,ta=i(function(){return"multiple"===x?Z?Array.isArray(Z)?Z:[Z]:[]:Z||new Date}),sa=ta[0],ua=ta[1],oa=i("month"),_a=oa[0],pa=oa[1],ha=i(!1),ma=ha[0],ya=ha[1],za=i(null),ja=za[0],Na=za[1],va=i({}),fa=va[0],ga=va[1],ba=i(null),ka=ba[0],Da=ba[1],Ca=i(!1),Sa=Ca[0],xa=Ca[1],Ya=i(null),Za=Ya[0],wa=Ya[1],Ma=void 0!==Y?Y:sa,Ga=void 0!==X?X:_a,Aa=d(function(){return"multiple"===x?Array.isArray(Ma)&&Ma.length>0?Ma[0]:new Date:Ma},[x,Ma]),La=i(function(){return Aa}),Xa=La[0],Ia=La[1];r.useEffect(function(){Ia(function(a){return k(a,Aa)?a:Aa})},[Aa]);var Fa=Xa.getFullYear(),Wa=Xa.getMonth(),Ta=d(function(){return function(a){var n=f.map(function(a,e){return{label:a,index:e,isWeekend:0===e||6===e}});return 0===a?n:e(e([],n.slice(a),!0),n.slice(0,a),!0)}(R)},[R]),Pa=d(function(){return S(Fa,Wa,R)},[Fa,Wa,R]),Ea=t(function(a){var e=C(a);return $[e]||[]},[$]),Ha=t(function(a){if("multiple"===x){var e=Array.isArray(Ma)?Ma:[];return D(a,e)}return k(a,Ma)},[x,Ma]),Ja=t(function(a){if(!(null==A?void 0:A(a)))if("multiple"===x){var n=Array.isArray(Ma)?Ma:[],l=void 0;l=D(a,n)?function(a,e){return e.filter(function(e){return!k(e,a)})}(a,n):function(a,n){return D(a,n)?n:e(e([],n,!0),[a],!1)}(a,n),void 0===Y&&ua(l),null==w||w(l)}else void 0===Y&&ua(a),null==w||w(a),K&&(Na(a),Da(null),ga({}),ya(!0))},[A,w,Y,K,x,Ma]),qa=t(function(a){var e=new Date(Xa);e.setMonth(a),void 0===Y&&ua(e),null==w||w(e),Ia(e),pa("month")},[Xa,Y,w]),Oa=t(function(a){pa(a),null==I||I(Xa,a)},[Xa,I]),Ra=t(function(a){var e=new Date(Xa);e.setFullYear(e.getFullYear()+a),Ia(e),null==I||I(e,Ga)},[Xa,Ga,I]),Ba=t(function(a){var e=new Date(Xa);e.setMonth(e.getMonth()+a),Ia(e),null==I||I(e,Ga)},[Xa,Ga,I]),Qa=t(function(){ya(!1),Na(null),ga({}),Da(null)},[]),Va=t(function(a){wa(a),xa(!0)},[]),Ka=t(function(){xa(!1),wa(null)},[]),Ua=t(function(e,n){ga(function(l){var c;return a(a({},l),((c={})[e]=n,c))})},[]),$a=t(function(){var a;if(ja){for(var n=0,l=na.fields.filter(function(a){return a.required});n<l.length;n++){var c=l[n];if(!(null===(a=fa[c.name])||void 0===a?void 0:a.trim()))return}var r,i=C(ja),d=$[i]||[];null!==ka?(r=e([],d,!0))[ka]={title:fa.title||"",content:fa.content||"",color:fa.color||"#1890ff"}:r=e(e([],d,!0),[{title:fa.title||"",content:fa.content||"",color:fa.color||"#1890ff"}],!1),null==aa||aa(ja,r),Qa()}},[ja,fa,ka,$,aa,na.fields,Qa]),ae=t(function(a,e){Da(a),ga({title:e.title,content:e.content||"",color:e.color||"#1890ff"})},[]),ee=t(function(a){if(ja){var e=C(ja),n=($[e]||[]).filter(function(e,n){return n!==a});null==aa||aa(ja,n),ka===a&&(Da(null),ga({}))}},[ja,$,aa,ka]),ne=function(a,e){var c=e.slice(0,2),r=e.length-2;return n("div",{className:"zjpcy-calendar__date-info-list",children:[c.map(function(a,e){return n("div",{className:"zjpcy-calendar__date-info-item",style:{color:a.color||"#1890ff"},children:[l("span",{className:"zjpcy-calendar__date-info-dot",style:{backgroundColor:a.color||"#1890ff"}}),l("span",{className:"zjpcy-calendar__date-info-text",children:a.title})]},e)}),r>0&&n("div",{className:"zjpcy-calendar__date-info-more",children:["+",r," 更多"]})]})},le=function(a){return l("div",{className:"zjpcy-calendar__info-tooltip",children:a.map(function(a,e){return n("div",{className:"zjpcy-calendar__info-tooltip-item",children:[n("div",{className:"zjpcy-calendar__info-tooltip-title",style:{color:a.color||"#1890ff"},children:[l("span",{className:"zjpcy-calendar__info-tooltip-dot",style:{backgroundColor:a.color||"#1890ff"}}),a.title]}),a.content&&l("div",{className:"zjpcy-calendar__info-tooltip-content",children:a.content})]},e)})})},ce=s("zjpcy-calendar",{"zjpcy-calendar--fullscreen":W,"zjpcy-calendar--small":"small"===P,"zjpcy-calendar--layout-vertical":"vertical"===H,"zjpcy-calendar--small-vertical":"small"===P&&"vertical"===H},J);return n("div",{className:ce,style:q,children:[L?L({value:Xa,onChange:Ia,type:Ga,onTypeChange:Oa}):n("div",{className:"zjpcy-calendar__header",children:[n("div",{className:"zjpcy-calendar__header-left",children:[l(h,{className:"zjpcy-calendar__header-btn",onClick:function(){return Ra(-1)},title:"上一年",children:l(u,{type:"double-left",style:{fontSize:12}})}),"month"===Ga&&l(h,{className:"zjpcy-calendar__header-btn",onClick:function(){return Ba(-1)},title:"上个月",children:l(u,{type:"left",style:{fontSize:12}})})]}),n("div",{className:"zjpcy-calendar__header-title",children:[n(h,{className:"zjpcy-calendar__header-title-btn",onClick:function(){return Oa("year")},children:[Fa,"年"]}),"month"===Ga&&l(h,{className:"zjpcy-calendar__header-title-btn",onClick:function(){return Oa("year")},children:N[Wa]})]}),n("div",{className:"zjpcy-calendar__header-right",children:["month"===Ga&&l(h,{className:"zjpcy-calendar__header-btn",onClick:function(){return Ba(1)},title:"下个月",children:l(u,{type:"right",style:{fontSize:12}})}),l(h,{className:"zjpcy-calendar__header-btn",onClick:function(){return Ra(1)},title:"下一年",children:l(u,{type:"double-right",style:{fontSize:12}})})]})]}),l("div",{className:"zjpcy-calendar__body",children:"month"===Ga?n(c,{children:[l("div",{className:"zjpcy-calendar__weekday-header",children:Ta.map(function(a){var e=a.label,n=a.index,c=a.isWeekend;return l("div",{className:s("zjpcy-calendar__weekday-cell",{"zjpcy-calendar__weekday-cell--weekend":c}),children:e},n)})}),l("div",{className:"zjpcy-calendar__date-grid",children:Pa.map(function(a,e){var c=a.getMonth()===Wa,r=function(a){return k(a,new Date)}(a),i=Ha(a),d=(null==A?void 0:A(a))||!1,t=0===a.getDay()||6===a.getDay(),u=!Q&&t,o=Ea(a),_=o.length>0,p=ca?z(a):null,h=void 0!==(null==p?void 0:p.term)&&""!==p.term,y=n("div",{className:s("zjpcy-calendar__date-cell",{"zjpcy-calendar__date-cell--other-month":!c,"zjpcy-calendar__date-cell--today":r,"zjpcy-calendar__date-cell--selected":i,"zjpcy-calendar__date-cell--disabled":d,"zjpcy-calendar__date-cell--hidden":u,"zjpcy-calendar__date-cell--has-info":_,"zjpcy-calendar__date-cell--show-lunar":ca&&p}),onClick:function(){return Ja(a)},onDoubleClick:function(){return da&&ca&&p&&Va(a)},children:[n("div",{className:"zjpcy-calendar__date-cell-header",children:[l("span",{className:s("zjpcy-calendar__date-number",{"zjpcy-calendar__date-number--today":r}),children:a.getDate()}),ca&&p&&l("span",{className:s("zjpcy-calendar__lunar-text",{"zjpcy-calendar__lunar-text--term":h}),title:"".concat(p.ganZhiYear," ").concat(p.zodiac,"年 ").concat(p.monthName).concat(p.dayName),children:ra?ra(p):j(p)})]}),M&&l("div",{className:"zjpcy-calendar__date-content",children:M(a,p||void 0)}),_&&ne(0,o)]},e);return _&&o.length>2?l(m,{title:le(o),placement:"top",delay:200,children:y},e):y})})]}):l("div",{className:"zjpcy-calendar__month-grid",children:N.map(function(a,e){var r=new Date(Fa,e,1),i=function(){if("multiple"===x)return(Array.isArray(Ma)?Ma:[]).some(function(a){return a.getMonth()===e&&a.getFullYear()===Fa});var a=Ma;return a.getMonth()===e&&a.getFullYear()===Fa}();return l("div",{className:s("zjpcy-calendar__month-cell",{"zjpcy-calendar__month-cell--selected":i}),onClick:function(){return qa(e)},children:G?G(r):n(c,{children:[l("span",{className:"zjpcy-calendar__month-name",children:a}),l("span",{className:"zjpcy-calendar__month-subtitle",children:v[e]})]})},e)})})}),function(){if(!ma||!ja)return null;var a=C(ja),e=$[a]||[],r=na,i=n(c,{children:[null!==ka&&l(h,{className:"zjpcy-calendar__panel-btn is-secondary",onClick:function(){Da(null),ga({})},children:"取消编辑"}),l(h,{className:"zjpcy-calendar__panel-btn is-secondary",onClick:Qa,children:r.cancelText||"取消"}),l(h,{className:"zjpcy-calendar__panel-btn is-primary",onClick:$a,children:null!==ka?"保存修改":r.submitText||"保存"})]});return l(p,{visible:ma,title:"".concat(ja.toLocaleDateString("zh-CN")," 信息编辑"),width:480,onCancel:Qa,onOk:$a,footer:i,children:n("div",{className:"zjpcy-calendar__panel-body",children:[e.length>0&&n("div",{className:"zjpcy-calendar__panel-list",children:[l("h4",{className:"zjpcy-calendar__panel-section-title",children:"已有信息"}),e.map(function(a,e){return n("div",{className:s("zjpcy-calendar__panel-list-item",{"is-editing":ka===e}),children:[n("div",{className:"zjpcy-calendar__panel-list-content",children:[l("span",{className:"zjpcy-calendar__panel-list-dot",style:{backgroundColor:a.color||"#1890ff"}}),n("div",{className:"zjpcy-calendar__panel-list-text",children:[l("div",{className:"zjpcy-calendar__panel-list-title",children:a.title}),a.content&&l("div",{className:"zjpcy-calendar__panel-list-desc",children:a.content})]})]}),n("div",{className:"zjpcy-calendar__panel-list-actions",children:[l(h,{className:"zjpcy-calendar__panel-list-btn",onClick:function(){return ae(e,a)},children:"编辑"}),l(h,{className:"zjpcy-calendar__panel-list-btn is-danger",onClick:function(){return ee(e)},children:"删除"})]})]},e)})]}),n("div",{className:"zjpcy-calendar__panel-form",children:[l("h4",{className:"zjpcy-calendar__panel-section-title",children:null!==ka?"编辑信息":"添加新信息"}),r.fields.map(function(a){return n("div",{className:"zjpcy-calendar__panel-field",children:[n("label",{className:"zjpcy-calendar__panel-label",children:[a.label,a.required&&l("span",{className:"zjpcy-calendar__panel-required",children:"*"})]}),"textarea"===a.type?l(_,{className:"zjpcy-calendar__panel-textarea",value:fa[a.name]||"",onChange:function(e){return Ua(a.name,e.target.value)},placeholder:a.placeholder,rows:3}):l(o,{className:"zjpcy-calendar__panel-input",value:fa[a.name]||"",onChange:function(e){return Ua(a.name,e.target.value)},placeholder:a.placeholder})]},a.name)}),n("div",{className:"zjpcy-calendar__panel-color",children:[l("label",{className:"zjpcy-calendar__panel-label",children:"颜色标记"}),l("div",{className:"zjpcy-calendar__panel-color-picker",children:["#1890ff","#52c41a","#faad14","#f5222d","#722ed1","#13c2c2"].map(function(a){return l("button",{className:s("zjpcy-calendar__panel-color-option",{"is-active":fa.color===a||!fa.color&&"#1890ff"===a}),style:{backgroundColor:a},onClick:function(){return Ua("color",a)}},a)})})]})]})]})})}(),function(){if(!Sa||!Za)return null;var a=z(Za),e=Za.toLocaleDateString("zh-CN",{year:"numeric",month:"long",day:"numeric",weekday:"long"});return l("div",{className:"zjpcy-calendar__lunar-overlay",onClick:Ka,children:n("div",{className:"zjpcy-calendar__lunar-panel",onClick:function(a){return a.stopPropagation()},children:[n("div",{className:"zjpcy-calendar__lunar-header",children:[n("h3",{className:"zjpcy-calendar__lunar-title",children:[l("span",{className:"zjpcy-calendar__lunar-date",children:e}),n("span",{className:"zjpcy-calendar__lunar-tag",children:[a.ganZhiYear," ",a.zodiac,"年"]})]}),l(h,{className:"zjpcy-calendar__lunar-close",onClick:Ka,children:l(u,{type:"close",size:16})})]}),n("div",{className:"zjpcy-calendar__lunar-body",children:[n("div",{className:"zjpcy-calendar__lunar-section",children:[l("h4",{className:"zjpcy-calendar__lunar-section-title",children:"农历信息"}),n("div",{className:"zjpcy-calendar__lunar-grid",children:[n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"农历日期"}),n("span",{className:"zjpcy-calendar__lunar-value",children:[a.yearName," ",a.monthName,a.dayName]})]}),n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"星期"}),n("span",{className:"zjpcy-calendar__lunar-value",children:["星期",a.week]})]}),n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"儒略日"}),l("span",{className:"zjpcy-calendar__lunar-value",children:a.julianDay})]}),a.term&&n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"节气"}),l("span",{className:"zjpcy-calendar__lunar-value zjpcy-calendar__lunar-value--highlight",children:a.term})]}),a.festivals.length>0&&n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"节日"}),l("span",{className:"zjpcy-calendar__lunar-value zjpcy-calendar__lunar-value--highlight",children:a.festivals.join("、")})]})]})]}),n("div",{className:"zjpcy-calendar__lunar-section",children:[l("h4",{className:"zjpcy-calendar__lunar-section-title",children:"八字信息"}),n("div",{className:"zjpcy-calendar__lunar-bazi",children:[n("div",{className:"zjpcy-calendar__lunar-bazi-item",children:[l("span",{className:"zjpcy-calendar__lunar-bazi-label",children:"年柱"}),l("span",{className:"zjpcy-calendar__lunar-bazi-value",children:a.baZiYear}),l("span",{className:"zjpcy-calendar__lunar-bazy-na",children:a.yearNaYin})]}),n("div",{className:"zjpcy-calendar__lunar-bazi-item",children:[l("span",{className:"zjpcy-calendar__lunar-bazi-label",children:"月柱"}),l("span",{className:"zjpcy-calendar__lunar-bazi-value",children:a.baZiMonth}),l("span",{className:"zjpcy-calendar__lunar-bazy-na",children:a.monthNaYin})]}),n("div",{className:"zjpcy-calendar__lunar-bazi-item",children:[l("span",{className:"zjpcy-calendar__lunar-bazi-label",children:"日柱"}),l("span",{className:"zjpcy-calendar__lunar-bazi-value",children:a.baZiDay}),l("span",{className:"zjpcy-calendar__lunar-bazy-na",children:a.dayNaYin})]}),n("div",{className:"zjpcy-calendar__lunar-bazi-item",children:[l("span",{className:"zjpcy-calendar__lunar-bazi-label",children:"时柱"}),l("span",{className:"zjpcy-calendar__lunar-bazi-value",children:a.baZiHour||"待定"}),l("span",{className:"zjpcy-calendar__lunar-bazy-na",children:"-"})]})]}),n("div",{className:"zjpcy-calendar__lunar-item",style:{marginTop:12},children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"完整八字"}),l("span",{className:"zjpcy-calendar__lunar-value",children:a.baZi||"待定"})]})]}),n("div",{className:"zjpcy-calendar__lunar-section",children:[l("h4",{className:"zjpcy-calendar__lunar-section-title",children:"二十八宿"}),n("div",{className:"zjpcy-calendar__lunar-grid",children:[n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"星宿"}),n("span",{className:"zjpcy-calendar__lunar-value",children:[a.xiu," ",a.xiuAnimal]})]}),n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"星宿吉凶"}),l("span",{className:s("zjpcy-calendar__lunar-value",{"zjpcy-calendar__lunar-value--good":"吉"===a.xiuLuck,"zjpcy-calendar__lunar-value--bad":"凶"===a.xiuLuck}),children:a.xiuLuck})]})]}),a.xiuSong&&l("div",{className:"zjpcy-calendar__lunar-song",children:a.xiuSong})]}),n("div",{className:"zjpcy-calendar__lunar-section",children:[l("h4",{className:"zjpcy-calendar__lunar-section-title",children:"黄道日"}),n("div",{className:"zjpcy-calendar__lunar-grid",children:[n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"十二值星"}),l("span",{className:"zjpcy-calendar__lunar-value",children:a.zhiXing})]}),n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"十二神"}),n("span",{className:s("zjpcy-calendar__lunar-value",{"zjpcy-calendar__lunar-value--good":"吉"===a.shiErShenLuck,"zjpcy-calendar__lunar-value--bad":"凶"===a.shiErShenLuck}),children:[a.shiErShen,"(",a.shiErShenLuck,")"]})]}),n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"黄道吉日"}),l("span",{className:s("zjpcy-calendar__lunar-value",{"zjpcy-calendar__lunar-value--good":a.isHuangDao,"zjpcy-calendar__lunar-value--bad":!a.isHuangDao}),children:a.isHuangDao?"是":"否"})]})]}),a.zhiXingDesc&&l("div",{className:"zjpcy-calendar__lunar-desc",children:a.zhiXingDesc})]}),n("div",{className:"zjpcy-calendar__lunar-section",children:[l("h4",{className:"zjpcy-calendar__lunar-section-title",children:"彭祖百忌"}),l("div",{className:"zjpcy-calendar__lunar-text-content",children:l("p",{children:a.pengZuDay})})]}),n("div",{className:"zjpcy-calendar__lunar-section zjpcy-calendar__lunar-section--yiji",children:[n("div",{className:"zjpcy-calendar__lunar-yi",children:[l("h4",{className:"zjpcy-calendar__lunar-section-title",children:"宜"}),l("div",{className:"zjpcy-calendar__lunar-yiji-content",children:a.yi.length>0?a.yi.map(function(a,e){return l("span",{className:"zjpcy-calendar__lunar-yiji-item",children:a},e)}):l("span",{className:"zjpcy-calendar__lunar-yiji-empty",children:"诸事不宜"})})]}),n("div",{className:"zjpcy-calendar__lunar-ji",children:[l("h4",{className:"zjpcy-calendar__lunar-section-title",children:"忌"}),l("div",{className:"zjpcy-calendar__lunar-yiji-content",children:a.ji.length>0?a.ji.map(function(a,e){return l("span",{className:"zjpcy-calendar__lunar-yiji-item",children:a},e)}):l("span",{className:"zjpcy-calendar__lunar-yiji-empty",children:"无"})})]})]}),(a.jiShen.length>0||a.xiongSha.length>0)&&n("div",{className:"zjpcy-calendar__lunar-section",children:[l("h4",{className:"zjpcy-calendar__lunar-section-title",children:"神煞"}),a.jiShen.length>0&&n("div",{className:"zjpcy-calendar__lunar-shensha",children:[l("span",{className:"zjpcy-calendar__lunar-shensha-label",children:"吉神:"}),l("span",{className:"zjpcy-calendar__lunar-shensha-value zjpcy-calendar__lunar-shensha-value--good",children:a.jiShen.join("、")})]}),a.xiongSha.length>0&&n("div",{className:"zjpcy-calendar__lunar-shensha",children:[l("span",{className:"zjpcy-calendar__lunar-shensha-label",children:"凶煞:"}),l("span",{className:"zjpcy-calendar__lunar-shensha-value zjpcy-calendar__lunar-shensha-value--bad",children:a.xiongSha.join("、")})]})]}),n("div",{className:"zjpcy-calendar__lunar-section",children:[l("h4",{className:"zjpcy-calendar__lunar-section-title",children:"方位"}),n("div",{className:"zjpcy-calendar__lunar-grid zjpcy-calendar__lunar-grid--4",children:[n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"喜神"}),l("span",{className:"zjpcy-calendar__lunar-value",children:a.xiGod.name})]}),n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"福神"}),l("span",{className:"zjpcy-calendar__lunar-value",children:a.fuGod.name})]}),n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"财神"}),l("span",{className:"zjpcy-calendar__lunar-value",children:a.caiGod.name})]}),n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"阳贵"}),l("span",{className:"zjpcy-calendar__lunar-value",children:a.yangGuiGod.name})]}),n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"阴贵"}),l("span",{className:"zjpcy-calendar__lunar-value",children:a.yinGuiGod.name})]}),n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"胎神"}),l("span",{className:"zjpcy-calendar__lunar-value",children:a.taiShen})]}),n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"冲煞"}),l("span",{className:"zjpcy-calendar__lunar-value",children:a.chongSha})]}),n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"煞方"}),l("span",{className:"zjpcy-calendar__lunar-value",children:a.sha})]})]})]}),n("div",{className:"zjpcy-calendar__lunar-section",children:[l("h4",{className:"zjpcy-calendar__lunar-section-title",children:"五行"}),n("div",{className:"zjpcy-calendar__lunar-grid",children:[n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"年五行"}),l("span",{className:"zjpcy-calendar__lunar-value",children:a.yearWuXing})]}),n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"月五行"}),l("span",{className:"zjpcy-calendar__lunar-value",children:a.monthWuXing})]}),n("div",{className:"zjpcy-calendar__lunar-item",children:[l("span",{className:"zjpcy-calendar__lunar-label",children:"日五行"}),l("span",{className:"zjpcy-calendar__lunar-value",children:a.dayWuXing})]})]})]})]}),l("div",{className:"zjpcy-calendar__lunar-footer",children:l(h,{className:"zjpcy-calendar__lunar-btn",onClick:Ka,children:"关闭"})})]})})}()]})};x.displayName="Calendar";var Y=x;export{Y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__assign as t,__spreadArray as a}from"tslib";import{jsxs as r,jsx as n,Fragment as e}from"react/jsx-runtime";import{useState as c,useRef as o,useCallback as i,useEffect as l,useMemo as s}from"react";import u from"classnames";import d from"../Icon/Icon.js";var p=function(p){var f=p.items,m=p.currentIndex,y=p.defaultCurrentIndex,v=void 0===y?0:y,_=p.onChange,h=p.autoplay,z=void 0===h||h,g=p.interval,j=void 0===g?3e3:g,b=p.effect,x=void 0===b?"slide":b,w=p.direction,N=void 0===w?"horizontal":w,I=p.showIndicators,k=void 0===I||I,M=p.indicatorPosition,C=void 0===M?"bottom":M,X=p.showArrows,T=void 0===X||X,Y=p.loop,D=void 0===Y||Y,A=p.pauseOnHover,L=void 0===A||A,P=p.className,E=p.style,O=p.contentClassName,R=p.contentStyle,S=p.onItemClick,Z=p.duration,B=void 0===Z?500:Z,G=p.prevIcon,H=p.nextIcon,K=p.upIcon,U=p.downIcon,q=p.indicatorProgress,F=void 0!==q&&q,J=void 0!==m,Q=c(v),V=Q[0],W=Q[1],$=J?m:V,tt=c(!1),at=tt[0],rt=tt[1],nt=c(!1),et=nt[0],ct=nt[1],ot=c(!1),it=ot[0],lt=ot[1],st=c([]),ut=st[0],dt=st[1],pt=c([]),ft=pt[0],mt=pt[1],yt=o(null),vt=o(null),_t=o(null),ht=o(null),zt=f.length,gt="vertical"===N,jt="fade"===x,bt=["flip","cards","creative","coverflow","parallax","zoom","book","curtain","mosaic","rain"].includes(x),xt=i(function(t){if(D){if(t<0)return zt-1;if(t>=zt)return 0}else{if(t<0)return 0;if(t>=zt)return zt-1}return t},[D,zt]),wt=i(function(t,a){if(void 0===a&&(a=!1),!(et||zt<=1)){var r=xt(t);if(r!==$){if("rain"===x&&a&&!it)return lt(!0),dt(Xt()),void(yt.current=setTimeout(function(){ct(!0),J||W(r),null==_||_(r),setTimeout(function(){ct(!1),lt(!1),dt([])},B)},1500));ct(!0),J||W(r),null==_||_(r),setTimeout(function(){ct(!1)},B)}}},[$,J,et,_,xt,B,zt,x,it]),Nt=i(function(){wt($+1)},[$,wt]),It=i(function(){wt($-1)},[$,wt]);l(function(){if(z&&!(zt<=1)&&(!L||!at))return _t.current=setInterval(function(){Nt()},j),function(){_t.current&&clearInterval(_t.current)}},[z,j,at,L,Nt,zt]);var kt=s(function(){return jt||bt?0:100*-$},[$,jt,bt]),Mt=i(function(t,a,r){if(!D)return t-a;var n=t-a,e=n>0?n-r:n+r;return Math.abs(n)<=Math.abs(e)?n:e},[D]),Ct=function(t){if(!bt)return{};var a=t===$,r=Mt(t,$,zt);switch(x){case"flip":return{transform:"rotateY(".concat(c=180*r,"deg)"),opacity:Math.abs(r)<=1?a?1:.5:0,zIndex:a?10:1};case"cards":var n=a?0:-100,e=a?1:.9,c=5*r;return{transform:"translateX(".concat(s=30*r,"%) translateZ(").concat(n,"px) scale(").concat(e,") rotateY(").concat(c,"deg)"),opacity:a?1:Math.abs(r)<=2?.6-.2*Math.abs(r):0,zIndex:a?10:5-Math.abs(r)};case"coverflow":var o=Math.abs(r);c=-45*r,n=a?0:-200,e=a?1:.8;return{transform:"translateX(".concat(s=50*r,"%) translateZ(").concat(n,"px) rotateY(").concat(c,"deg) scale(").concat(e,")"),opacity:o<=2?1-.3*o:0,zIndex:a?10:5-o};case"parallax":e=a?1:.8;return{transform:"translateX(".concat(s=100*r,"%) scale(").concat(e,")"),opacity:Math.abs(r)<=1?1:0,zIndex:a?10:5};case"zoom":var i=a?1:0,l=a?0:10;return{transform:"scale(".concat(e=a?1:2,")"),opacity:i,filter:"blur(".concat(l,"px)"),zIndex:a?10:1};case"book":i=a?1:-1===r?.3:0;return{transform:"rotateY(".concat(c=r<0?-90:r>0?90:0,"deg)"),opacity:i,zIndex:a?10:5};case"mosaic":var s=20*r,u=5*r;return{transform:"scale(".concat(e=a?1:.8,") translateX(").concat(s,"%) rotate(").concat(u,"deg)"),opacity:a?1:0,filter:a?"blur(0)":"blur(5px)",zIndex:a?10:5};case"creative":default:return{};case"curtain":var d=a?1:0,p=r<0?"right":"left";return{transform:"translateX(".concat(s=a?0:r<0?-100:100,"%) scaleX(").concat(d,")"),opacity:a?1:0,zIndex:a?10:5,transformOrigin:p}}},Xt=i(function(){for(var t=[],a=0;a<80;a++){var r=Math.random()>.7;t.push({id:a,left:100*Math.random(),delay:1.5*Math.random(),duration:.4+.4*Math.random(),isLarge:r})}return t},[]),Tt=u("zjpcy-carousel","zjpcy-carousel--".concat(x),"zjpcy-carousel--".concat(N),{"zjpcy-carousel--hover":at,"zjpcy-carousel--raining":it},P),Yt=u("zjpcy-carousel__content",O),Dt=u("zjpcy-carousel__indicators","zjpcy-carousel__indicators--".concat(C));return 0===zt?null:r("div",{ref:vt,className:Tt,style:E,onMouseEnter:function(){return rt(!0)},onMouseLeave:function(){return rt(!1)},onTouchStart:function(t){var a=t.touches[0];ht.current={x:a.clientX,y:a.clientY}},onTouchEnd:function(t){if(ht.current){var a=t.changedTouches[0],r=a.clientX-ht.current.x,n=a.clientY-ht.current.y;gt?Math.abs(n)>50&&(n>0?It():Nt()):Math.abs(r)>50&&(r>0?It():Nt()),ht.current=null}},onKeyDown:function(t){"ArrowLeft"===t.key||"ArrowUp"===t.key?It():"ArrowRight"!==t.key&&"ArrowDown"!==t.key||Nt()},onClick:function(t){var r;if("rain"===x){var n=null===(r=vt.current)||void 0===r?void 0:r.getBoundingClientRect();if(n){var e=t.clientX-n.left,c=t.clientY-n.top,o={id:Date.now(),x:e,y:c};mt(function(t){return a(a([],t,!0),[o],!1)}),lt(!0),dt(Xt()),setTimeout(function(){Nt(),lt(!1),dt([])},1500),setTimeout(function(){mt(function(t){return t.filter(function(t){return t.id!==o.id})})},1e3)}}},tabIndex:0,role:"region","aria-roledescription":"carousel",children:[n("div",{className:Yt,style:t(t({},R),bt||jt?{}:{transform:gt?"translateY(".concat(kt,"%)"):"translateX(".concat(kt,"%)"),transitionDuration:"".concat(B,"ms")}),children:f.map(function(a,e){var c=e===$,o=e-$,i=u("zjpcy-carousel__item",{"zjpcy-carousel__item--active":c,"zjpcy-carousel__item--prev":-1===o,"zjpcy-carousel__item--next":1===o,"zjpcy-carousel__item--exit":"book"===x&&-1===o});return n("div",{className:i,style:t({},bt?Ct(e):jt?{opacity:c?1:0,zIndex:c?1:0,transitionDuration:"".concat(B,"ms")}:{}),role:"group","aria-roledescription":"slide","aria-label":"".concat(e+1," of ").concat(zt),"aria-hidden":!c,children:a.render?a.render():r("div",{className:"zjpcy-carousel__item-inner",onClick:function(){return function(t,a){t.link&&window.open(t.link,"_blank"),null==S||S(t,a)}(a,e)},style:{cursor:a.link||S?"pointer":"default"},children:[n("img",{src:a.image,alt:"string"==typeof a.title?a.title:"",className:"zjpcy-carousel__image",draggable:!1}),(a.title||a.description)&&r("div",{className:u("zjpcy-carousel__info","zjpcy-carousel__info--".concat(a.infoPosition||"bottom")),children:[a.title&&n("div",{className:"zjpcy-carousel__title",children:a.title}),a.description&&n("div",{className:"zjpcy-carousel__description",children:a.description})]})]})},a.key)})}),T&&zt>1&&r(e,{children:[n("button",{className:u("zjpcy-carousel__arrow","zjpcy-carousel__arrow--prev"),onClick:It,"aria-label":"Previous slide",type:"button",children:gt?null!=K?K:n(d,{type:"arrow-up",size:20}):null!=G?G:n(d,{type:"chevron-left",size:20})}),n("button",{className:u("zjpcy-carousel__arrow","zjpcy-carousel__arrow--next"),onClick:Nt,"aria-label":"Next slide",type:"button",children:gt?null!=U?U:n(d,{type:"arrow-down",size:20}):null!=H?H:n(d,{type:"chevron-right",size:20})})]}),k&&zt>1&&n("div",{className:Dt,role:"tablist",children:f.map(function(t,a){var r=a===$,e=F&&z&&r;return n("button",{className:u("zjpcy-carousel__indicator",{"zjpcy-carousel__indicator--active":r,"zjpcy-carousel__indicator--progress":e}),onClick:function(){return wt(a)},role:"tab","aria-selected":r,"aria-label":"Go to slide ".concat(a+1),type:"button",style:e?{"--progress-duration":"".concat(j,"ms")}:void 0,children:e&&n("span",{className:"zjpcy-carousel__indicator-progress-bar"},"progress-".concat($))},"".concat(t.key,"-").concat(e?"progress":"static"))})}),r("div",{className:"zjpcy-carousel__pagination",children:[n("span",{className:"zjpcy-carousel__pagination-current",children:$+1}),n("span",{className:"zjpcy-carousel__pagination-separator",children:"/"}),n("span",{className:"zjpcy-carousel__pagination-total",children:zt})]}),"rain"===x&&n("div",{className:"zjpcy-carousel__rain-overlay"}),"rain"===x&&ut.map(function(t){return n("span",{className:u("zjpcy-carousel__rain-drop",{"zjpcy-carousel__rain-drop--large":t.isLarge}),style:{left:"".concat(t.left,"%"),animationDelay:"".concat(t.delay,"s"),animationDuration:"".concat(t.duration,"s")}},t.id)}),"rain"===x&&ft.map(function(t){return n("span",{className:"zjpcy-carousel__ripple",style:{left:t.x-20,top:t.y-20,width:40,height:40}},t.id)})]})};export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__spreadArray as n,__assign as e}from"tslib";import{jsxs as r,jsx as t}from"react/jsx-runtime";import{useState as a,useRef as c,useCallback as i,useEffect as o}from"react";import u from"../Icon/Icon.js";import l from"../Empty/index.js";var s=function(s){var f,d=s.value,v=s.defaultValue,h=s.onChange,p=s.options,m=void 0===p?[]:p,g=s.placeholder,y=void 0===g?"请选择":g,b=s.disabled,x=void 0!==b&&b,N=s.size,A=void 0===N?"middle":N,k=s.style,w=s.className,j=void 0===w?"":w,C=s.allowClear,I=void 0===C||C,z=s.expandTrigger,E=void 0===z?"click":z,W=s.changeOnSelect,L=void 0!==W&&W,P=s.fieldNames,R=void 0===P?{}:P,T=s.width,B=s.dropdownWidth,H=s.dropdownHeight,O=s.dropdownStyle,S=void 0===O?{}:O,D=s.dropdownClassName,M=void 0===D?"":D,V=s.placement,q=void 0===V?"bottomLeft":V,F=s.checkbox,G=void 0!==F&&F,J=s.autoWidth,K=void 0!==J&&J,Q=a(!1),U=Q[0],X=Q[1],Y=a([]),Z=Y[0],$=Y[1],_=a([]),nn=_[0],en=_[1],rn=c(null),tn=c(null),an=R.label,cn=void 0===an?"label":an,on=R.value,un=void 0===on?"value":on,ln=R.children,sn=void 0===ln?"children":ln,fn=i(function(n){return n[un]||n.value},[un]),dn=i(function(n){return n[cn]||n.label},[cn]),vn=i(function(n){return n[sn]||n.children},[sn]),hn=i(function(n){for(var e=[],r=m,t=function(n){var t=r.find(function(e){return fn(e)===n});if(!t)return{value:e};e.push(t),r=vn(t)||[]},a=0,c=n;a<c.length;a++){var i=t(c[a]);if("object"==typeof i)return i.value}return e},[m,fn,vn]),pn=i(function(n){for(var e=[],r=m,t=function(n){var t=r.find(function(e){return fn(e)===n});if(!t)return{value:e};e.push(t),r=vn(t)||[]},a=0,c=n;a<c.length;a++){var i=t(c[a]);if("object"==typeof i)return i.value}return e},[m,fn,vn]),mn=i(function(){var n=void 0!==d?d:v;return!n||Array.isArray(n)&&0===n.length?[]:G?Array.isArray(n)&&Array.isArray(n[0])?n:[n]:Array.isArray(n)&&!Array.isArray(n[0])?[n]:[]},[d,v,G]),gn=a(mn()),yn=gn[0],bn=gn[1];o(function(){var n=void 0!==d?d:v;if(!n)return bn([]),void $([]);if(G){var e=void 0;e=Array.isArray(n)?0===n.length?[]:Array.isArray(n[0])?n:[n]:[],bn(e);var r=e.map(function(n){return pn(n)});$(r.map(function(n){return n&&0!==n.length?n[n.length-1]:null}).filter(function(n){return null!==n}))}else{(e=Array.isArray(n)&&!Array.isArray(n[0])?n:n[0])&&e.length>0?bn([e]):bn([])}},[d,v,G,pn]);var xn=i(function(n){var e=[],r=function(n,t){for(var a=0,c=n;a<c.length;a++){var i=c[a];if(fn(i)===fn(t))return e.push(dn(i)),!0;var o=vn(i);if(o&&o.length>0&&r(o,t))return e.unshift(dn(i)),!0}return!1};return r(m,n),e},[m,fn,dn,vn]),Nn=i(function(){if(G){if(!Z||0===Z.length)return y;var n=Z.filter(function(n){var e=vn(n);return!e||0===e.length}).map(function(n){return xn(n).join("/")});return n.length>3?n.slice(0,3).join(", ")+" +".concat(n.length-3):n.join(", ")}return 0!==yn.length&&yn[0]&&0!==yn[0].length?hn(yn[0]).map(function(n){return dn(n)}).join(" / "):y},[yn,Z,G,hn,dn,y,xn,vn]),An=i(function(e){var r=[],t=function(e,a,c){for(var i=0,o=e;i<o.length;i++){var u=o[i],l=n(n([],c,!0),[fn(u)],!1);if(fn(u)===fn(a))return r.push.apply(r,l),!0;var s=vn(u);if(s&&s.length>0&&t(s,a,l))return!0}return!1};return t(m,e,[]),r},[m,fn,vn]),kn=i(function(n,e){var r=An(e),t=An(n);if(t.length<=r.length)return!1;for(var a=0;a<r.length;a++)if(r[a]!==t[a])return!1;return!0},[An]),wn=i(function(e){var r=[],t=function(e,a,c){for(var i=0,o=e;i<o.length;i++){var u=o[i];if(fn(u)===fn(a))return r.unshift(u),!0;var l=vn(u);if(l&&l.length>0&&t(l,a,n(n([],c,!0),[u],!1)))return r.unshift(u),!0}return!1};return t(m,e,[]),r},[m,fn,vn]),jn=i(function(e,r,t){if(e.stopPropagation(),G){var a=n([],Z,!0),c=a.findIndex(function(n){return fn(n)===fn(r)});if(c>-1){a.splice(c,1);var i=a.filter(function(n){return!kn(n,r)});a.splice.apply(a,n([0,a.length],i,!1))}else{wn(r).forEach(function(n){-1===a.findIndex(function(e){return fn(e)===fn(n)})&&a.push(n)})}$(a);var o=a.map(function(n){return An(n)});null==h||h(o,a),void 0===d&&bn(o);var u=vn(r);if(u&&u.length>0){var l=n(n([],nn.slice(0,t),!0),[fn(r)],!1);en(l)}else{l=nn.slice(0,t+1);en(l)}}},[Z,G,fn,vn,An,wn,kn,h,d,nn]),Cn=i(function(e,r){if(G){var t=n([],Z,!0),a=t.findIndex(function(n){return fn(n)===fn(e)});if(a>-1){t.splice(a,1);var c=t.filter(function(n){return!kn(n,e)});t.splice.apply(t,n([0,t.length],c,!1))}else{wn(e).forEach(function(n){-1===t.findIndex(function(e){return fn(e)===fn(n)})&&t.push(n)})}$(t);var i=t.map(function(n){return An(n)});if(null==h||h(i,t),void 0===d&&bn(i),(u=vn(e))&&u.length>0){var o=n(n([],nn.slice(0,r),!0),[fn(e)],!1);en(o)}else{o=nn.slice(0,r+1);en(o)}}else{var u;o=n(n([],nn.slice(0,r),!0),[fn(e)],!1);if(en(o),(u=vn(e))&&u.length>0){if(L){var l=hn(o);null==h||h(o,l),void 0===d&&bn([o])}}else{var s=hn(o);null==h||h(o,s),void 0===d&&bn([o]),X(!1),en([])}}},[nn,Z,G,fn,dn,vn,L,hn,An,wn,kn,h,d]),In=i(function(e,r){if("hover"===E){var t=n(n([],nn.slice(0,r),!0),[fn(e)],!1);en(t)}},[nn,E,fn]),zn=i(function(e,r,t){if(e.stopPropagation(),G){var a=vn(r);if(a&&a.length>0){var c=n(n([],nn.slice(0,t),!0),[fn(r)],!1);en(c)}}else Cn(r,t)},[G,nn,fn,vn,Cn]),En=i(function(n){n.stopPropagation(),G?(null==h||h([],[]),$([]),void 0===d&&bn([])):(null==h||h([],[]),void 0===d&&bn([])),en([])},[h,d,G]),Wn=i(function(e,r){if(e.stopPropagation(),G){var t=n([],Z,!0),a=fn(r),c=t.findIndex(function(n){return fn(n)===a});if(c>-1){t.splice(c,1);var i=t.filter(function(n){return!kn(n,r)});t.splice.apply(t,n([0,t.length],i,!1));for(var o=wn(r),u=function(n){var e=o[n],r=fn(e);if(!t.some(function(n){return fn(n)!==r&&kn(n,e)})){var a=t.findIndex(function(n){return fn(n)===r});a>-1&&t.splice(a,1)}},l=o.length-2;l>=0;l--)u(l);$(t);var s=t.map(function(n){return An(n)});null==h||h(s,t),void 0===d&&bn(s)}}},[Z,G,fn,An,wn,kn,h,d]),Ln=i(function(){x||X(!U)},[U,x]);o(function(){var n=function(n){rn.current&&!rn.current.contains(n.target)&&(X(!1),en([]))};return U&&document.addEventListener("mousedown",n),function(){document.removeEventListener("mousedown",n)}},[U]);var Pn=i(function(n){if(0===n)return m;for(var e=nn.slice(0,n),r=m,t=function(n){var e=r.find(function(e){return fn(e)===n});if(!e)return{value:[]};r=vn(e)||[]},a=0,c=e;a<c.length;a++){var i=t(c[a]);if("object"==typeof i)return i.value}return r},[m,nn,fn,vn]);o(function(){G||(U&&yn.length>0&&yn[0]?en(yn[0]):U||en([]))},[U,yn,G]);var Rn=i(function(n){return!!G&&Z.some(function(e){return fn(e)===fn(n)})},[Z,G,fn]),Tn=i(function(n,e){return!G&&(!(e>=yn.length||!yn[0])&&yn[0][e]===fn(n))},[yn,G,fn]),Bn=i(function(n,e){return!(e>=nn.length)&&nn[e]===fn(n)},[nn,fn]),Hn=i(function(){if(0===nn.length)return 1;for(var n=nn.length,e=m,r=function(n){var r=e.find(function(e){return fn(e)===n});if(!r)return"break";e=vn(r)||[]},t=0,a=nn;t<a.length;t++){if("break"===r(a[t]))break}return e&&e.length>0&&n++,n},[nn,m,fn,vn]),On=i(function(){var n=e({},k);return T&&(n.width="number"==typeof T?"".concat(T,"px"):T),K||T?K&&!T?n.minWidth="180px":!K&&T&&(n.maxWidth="number"==typeof T?"".concat(T,"px"):T):(n.minWidth="180px",n.maxWidth="100%"),n},[T,k,K]),Sn=i(function(){var n=e({},S);switch(q){case"bottomLeft":n.top="100%",n.left="0",n.marginTop="4px";break;case"bottomRight":n.top="100%",n.right="0",n.marginTop="4px";break;case"topLeft":n.bottom="100%",n.left="0",n.marginBottom="4px";break;case"topRight":n.bottom="100%",n.right="0",n.marginBottom="4px"}return B&&(n.width="number"==typeof B?"".concat(B,"px"):B),H&&(n.maxHeight="number"==typeof H?"".concat(H,"px"):H),n},[B,H,S,q]),Dn=G?Z.filter(function(n){var e=vn(n);return!e||0===e.length}).length>0:yn.length>0&&(null===(f=yn[0])||void 0===f?void 0:f.length)>0;return r("div",{ref:rn,className:"cascader cascader-".concat(A," ").concat(j," ").concat(x?"cascader-disabled":""," ").concat(U?"cascader-open":""," ").concat(Dn?"cascader-has-value":""),style:On(),children:[r("div",{className:"cascader-trigger",onClick:Ln,children:[t("span",{className:"cascader-selection-placeholder ".concat(Dn?"cascader-selection-hidden":""),children:y}),G?t("div",{className:"cascader-selection-value ".concat(Dn?"":"cascader-selection-hidden"),children:Z.filter(function(n){var e=vn(n);return!e||0===e.length}).map(function(n){var e=xn(n);return r("span",{className:"cascader-tag",children:[t("span",{className:"cascader-tag-content",children:e.join("/")}),t("span",{className:"cascader-tag-close",onClick:function(e){return!x&&Wn(e,n)},children:t(u,{type:"close",size:10})})]},fn(n))})}):t("span",{className:"cascader-selection-value ".concat(Dn?"":"cascader-selection-hidden"),children:Nn()}),t("span",{className:"cascader-arrow",children:t(u,{type:"arrowDown",size:12})}),I&&Dn&&!x&&t("span",{className:"cascader-clear",onClick:En,children:t(u,{type:"close",size:12})})]}),U&&t("div",{className:"cascader-dropdown cascader-dropdown-".concat(q," ").concat(M),ref:tn,style:Sn(),children:t("div",{className:"cascader-menus",style:{width:B?void 0:"".concat(180*Hn(),"px")},children:Array.from({length:Hn()}).map(function(n,e){return function(n){var e=Pn(n);return e&&0!==e.length?t("ul",{className:"cascader-menu cascader-menu-".concat(n," ").concat(G?"cascader-menu-checkbox":""),children:e.map(function(e,a){var c=G?Rn(e):Tn(e,n),i=Bn(e,n),o=vn(e)&&vn(e).length>0,l=e.disabled;return r("li",{className:"cascader-menu-item ".concat(c?"cascader-menu-item-selected":""," ").concat(i?"cascader-menu-item-active":""," ").concat(c&&i?"cascader-menu-item-selected-active":""," ").concat(l?"cascader-menu-item-disabled":""),onClick:function(){return!l&&(G?void 0:Cn(e,n))},onMouseEnter:function(){return!l&&In(e,n)},children:[G&&t("span",{className:"cascader-menu-item-checkbox",onClick:function(r){return!l&&jn(r,e,n)},children:t("input",{type:"checkbox",checked:c,readOnly:!0})}),t("span",{className:"cascader-menu-item-content",onClick:function(r){return!l&&zn(r,e,n)},children:dn(e)}),o&&t("span",{className:"cascader-menu-item-expand-icon",children:t(u,{type:"arrowRight",size:12,color:"#bfbfbf"})})]},"".concat(fn(e),"-").concat(a))})}):t("div",{className:"cascader-menu cascader-menu-empty",children:t(l,{size:"small",description:"暂无数据"})})}(e)})})})]})};export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__assign as e,__spreadArray as a}from"tslib";import{jsx as l,jsxs as c}from"react/jsx-runtime";import{createContext as i,useContext as n,useState as d,useEffect as o}from"react";import r from"classnames";var t=i(void 0),s=function(i){var s,u=i.value,p=i.checked,v=i.defaultChecked,h=void 0!==v&&v,b=i.onChange,m=i.disabled,y=void 0!==m&&m,f=i.indeterminate,k=void 0!==f&&f,x=i.children,g=i.className,z=i.style,j=i.label,N=i.labelGap,C=void 0===N?8:N,_=i.labelClassName,G=void 0===_?"":_,I=i.labelStyle,w=n(t),P=!!w,R=d(h),S=R[0],V=R[1],q=P?null===(s=w.value)||void 0===s?void 0:s.includes(u):void 0!==p?p:S;o(function(){P||void 0===p||V(p)},[p,P]);var A=y||P&&w.disabled,B=r("zjpcy-checkbox",{"zjpcy-checkbox--checked":q,"zjpcy-checkbox--disabled":A,"zjpcy-checkbox--indeterminate":k,"zjpcy-checkbox--disabled-checked":A&&q,"zjpcy-checkbox--disabled-indeterminate":A&&k},g);return l("label",{className:B,style:z,children:c("div",{className:"zjpcy-checkbox-wrapper",style:{display:"flex",alignItems:"center"},children:[j&&l("div",{className:"zjpcy-checkbox-label ".concat(G),style:e({marginRight:"number"==typeof C?"".concat(C,"px"):C},I),children:j}),c("div",{style:{display:"flex",alignItems:"center",gap:6},children:[l("input",{type:"checkbox",className:"zjpcy-checkbox__input",checked:q,onChange:function(e){var l,c=e.target.checked;if(!(y||P&&w.disabled))if(P){var i=w.value||[],n=void 0;n=c?a(a([],i,!0),[u],!1):i.filter(function(e){return e!==u}),null===(l=w.onChange)||void 0===l||l.call(w,n)}else V(c),null==b||b(c,u)},disabled:y||P&&w.disabled,value:u,ref:function(e){e&&(e.indeterminate=k)}}),l("span",{className:"zjpcy-checkbox__inner"}),x&&l("span",{className:"zjpcy-checkbox__label",children:x})]})]})})};s.Group=function(a){var c=a.value,i=a.defaultValue,n=void 0===i?[]:i,u=a.onChange,p=a.disabled,v=void 0!==p&&p,h=a.options,b=a.children,m=a.className,y=a.style,f=a.layout,k=void 0===f?"vertical":f,x=a.gap,g=void 0===x?8:x,z=d(n||[]),j=z[0],N=z[1];o(function(){void 0!==c&&N(c)},[c]);var C=r("zjpcy-checkbox-group",{"zjpcy-checkbox-group--horizontal":"horizontal"===k},m),_=e(e({},y),{gap:"number"==typeof g?"".concat(g,"px"):g});return l(t.Provider,{value:{value:void 0!==c?c:j,onChange:function(e){N(e),null==u||u(e)},disabled:v},children:l("div",{className:C,style:_,children:h?h.map(function(e,a){var c;return l(s,{value:e.value,disabled:e.disabled||v,children:e.label},null!==(c=e.value)&&void 0!==c?c:a)}):b})})},s.displayName="Checkbox",s.Group.displayName="Checkbox.Group";var u=s;export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__assign as e}from"tslib";import{jsxs as r,jsx as a}from"react/jsx-runtime";import{useCallback as t,useState as c,useRef as n,useEffect as o}from"react";var i=function(e){var r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return r?{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}:null},l=function(e,r,a){var t=function(e){var r=Math.round(Math.max(0,Math.min(255,e))).toString(16);return 1===r.length?"0"+r:r};return"#".concat(t(e)).concat(t(r)).concat(t(a))},s=function(e,r,a){e/=255,r/=255,a/=255;var t=Math.max(e,r,a),c=t-Math.min(e,r,a),n=0,o=0===t?0:c/t,i=t;if(0!==c)switch(t){case e:n=((r-a)/c+(r<a?6:0))/6;break;case r:n=((a-e)/c+2)/6;break;case a:n=((e-r)/c+4)/6}return{h:360*n,s:o,v:i}},u=function(e,r,a){e=e%360/360;var t=Math.floor(6*e),c=6*e-t,n=a*(1-r),o=a*(1-c*r),i=a*(1-(1-c)*r),l=0,s=0,u=0;switch(t%6){case 0:l=a,s=i,u=n;break;case 1:l=o,s=a,u=n;break;case 2:l=n,s=a,u=i;break;case 3:l=n,s=o,u=a;break;case 4:l=i,s=n,u=a;break;case 5:l=a,s=n,u=o}return{r:Math.round(255*l),g:Math.round(255*s),b:Math.round(255*u)}},h=function(e){var r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(e);return r&&r[4]?parseInt(r[4],16)/255:1},p=function(p){var v=p.color,d=p.onChange,f=p.disableAlpha,m=void 0!==f&&f,g=t(function(){var e=v.startsWith("#")?v:"#ffffff",r=i(e)||{r:255,g:255,b:255};return{hex:e,rgb:r,hsv:s(r.r,r.g,r.b),alpha:h(e)}},[v]),b=c(g().hsv),k=b[0],y=b[1],M=c(g().alpha),j=M[0],x=M[1],z=c(g().hex),N=z[0],w=z[1],C=n(null),E=c(!1),I=E[0],L=E[1],A=n(null),B=c(!1),D=B[0],R=B[1],S=n(null),T=c(!1),X=T[0],$=T[1];o(function(){var e=g();y(e.hsv),x(e.alpha),w(e.hex)},[v,g]),o(function(){var e=u(k.h,k.s,k.v),r=l(e.r,e.g,e.b);!m&&j<1&&(r=function(e,r){var a=i(e);if(!a)return e;var t=Math.round(255*Math.max(0,Math.min(1,r)));return"#".concat(l(a.r,a.g,a.b).slice(1)).concat(t.toString(16).padStart(2,"0"))}(r,j)),w(r),d({hex:r,rgb:e,hsv:k})},[k,j,m,d]);var F=t(function(r,a){var t=a.getBoundingClientRect(),c=Math.max(0,Math.min(1,(r.clientX-t.left)/t.width)),n=Math.max(0,Math.min(1,(r.clientY-t.top)/t.height));y(function(r){return e(e({},r),{s:c,v:1-n})})},[]),U=t(function(r,a){var t=a.getBoundingClientRect(),c=Math.max(0,Math.min(1,(r.clientX-t.left)/t.width));y(function(r){return e(e({},r),{h:360*c})})},[]),W=t(function(e,r){var a=r.getBoundingClientRect(),t=Math.max(0,Math.min(1,(e.clientX-a.left)/a.width));x(t)},[]);o(function(){var e=function(e){I&&C.current?F(e,C.current):D&&A.current?U(e,A.current):X&&S.current&&W(e,S.current)},r=function(){L(!1),R(!1),$(!1)};return(I||D||X)&&(document.addEventListener("mousemove",e),document.addEventListener("mouseup",r)),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",r)}},[I,D,X,F,U,W]);var Y=u(k.h,k.s,k.v),q=l(Y.r,Y.g,Y.b),G=u(k.h,1,1),H=l(G.r,G.g,G.b);return r("div",{className:"zjpcy-color-picker-panel",children:[r("div",{ref:C,className:"zjpcy-color-picker-saturation",style:{backgroundColor:H},onMouseDown:function(e){L(!0),F(e,e.currentTarget)},children:[a("div",{className:"zjpcy-color-picker-saturation-white"}),a("div",{className:"zjpcy-color-picker-saturation-black"}),a("div",{className:"zjpcy-color-picker-pointer",style:{left:"".concat(100*k.s,"%"),top:"".concat(100*(1-k.v),"%"),backgroundColor:q}})]}),a("div",{ref:A,className:"zjpcy-color-picker-hue",onMouseDown:function(e){R(!0),U(e,e.currentTarget)},children:a("div",{className:"zjpcy-color-picker-hue-slider",style:{left:"".concat(k.h/360*100,"%")}})}),!m&&r("div",{ref:S,className:"zjpcy-color-picker-alpha",onMouseDown:function(e){$(!0),W(e,e.currentTarget)},children:[a("div",{className:"zjpcy-color-picker-alpha-bg"}),a("div",{className:"zjpcy-color-picker-alpha-gradient",style:{background:"linear-gradient(to right, transparent, ".concat(q,")")}}),a("div",{className:"zjpcy-color-picker-alpha-slider",style:{left:"".concat(100*j,"%")}})]}),r("div",{className:"zjpcy-color-picker-values",children:[r("div",{className:"zjpcy-color-picker-preview-small",children:[a("div",{className:"zjpcy-color-picker-preview-color",style:{backgroundColor:m?q:"rgba(".concat(Y.r,", ").concat(Y.g,", ").concat(Y.b,", ").concat(j,")")}}),a("div",{className:"zjpcy-color-picker-alpha-bg"})]}),a("input",{type:"text",className:"zjpcy-color-picker-hex-input",value:N.toUpperCase(),onChange:function(e){var r=e.target.value;if(w(r),/^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$/.test(r)){var a=i(r);if(a){var t=s(a.r,a.g,a.b);y(t),m||x(h(r))}}}})]})]})};export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__spreadArray as e}from"tslib";import{jsxs as c,jsx as r,Fragment as i}from"react/jsx-runtime";import{useState as n,useRef as o,useEffect as l}from"react";import a from"classnames";import t from"./ColorPickerPanel.js";import s from"../Button/Button.js";var d=function(d){var p=d.color,m=d.onChange,u=d.onColorChange,v=d.disabled,f=void 0!==v&&v,h=d.className,k=d.style,g=d.alpha,y=void 0!==g&&g,j=d.presetColors,z=void 0===j?[]:j,N=d.gradient,C=void 0!==N&&N,b=d.children,x=n(!1),A=x[0],w=x[1],P=n(p),B=P[0],E=P[1],F=n([p,"#ffffff"]),I=F[0],L=F[1],W=n(90),q=W[0],D=W[1],G=o(null),H=o(null),J=a("zjpcy-color-picker",{"zjpcy-color-picker--disabled":f,"zjpcy-color-picker--open":A},h),K=function(c,r){if(C&&void 0!==r){var i=e([],I,!0);i[r]=c.hex,L(i),M(i,q)}else E(c.hex),null==u||u(c.hex)},M=function(e,c){void 0===e&&(e=I),void 0===c&&(c=q);var r="linear-gradient(".concat(c,"deg, ").concat(e[0],", ").concat(e[1],")");E(r),null==u||u(r)},O=function(e){e.stopPropagation(),f||w(!A)};return l(function(){var e=function(e){var c=G.current&&G.current.contains(e.target),r=H.current&&H.current.contains(e.target);c||r||w(!1)};return A&&document.addEventListener("click",e),function(){document.removeEventListener("click",e)}},[A]),l(function(){if(C&&p&&p.startsWith("linear-gradient")){var e=p.match(/linear-gradient\((\d+)deg,\s*(#[0-9a-fA-F]+),\s*(#[0-9a-fA-F]+)\)/);e&&(D(parseInt(e[1])),L([e[2],e[3]]))}},[p,C]),c("div",{className:J,style:k,children:[r("div",b?{ref:H,className:"zjpcy-color-picker-trigger-container",onClick:O,children:b}:{ref:H,className:"zjpcy-color-picker-default-trigger",style:{background:p},onClick:O}),A&&c("div",{className:"zjpcy-color-picker-popup",children:[c("div",{className:"zjpcy-color-picker-content",ref:G,children:[C?c(i,{children:[c("div",{className:"zjpcy-color-picker-gradient",children:[c("div",{className:"zjpcy-color-picker-gradient-item",children:[r("div",{className:"zjpcy-color-picker-gradient-label",children:"起始颜色"}),r(t,{color:I[0],onChange:function(e){K({hex:e.hex},0)},disableAlpha:!y})]}),c("div",{className:"zjpcy-color-picker-gradient-item",children:[r("div",{className:"zjpcy-color-picker-gradient-label",children:"结束颜色"}),r(t,{color:I[1],onChange:function(e){K({hex:e.hex},1)},disableAlpha:!y})]})]}),c("div",{className:"zjpcy-color-picker-gradient-direction",children:[c("div",{className:"zjpcy-color-picker-gradient-direction-label",children:["渐变方向: ",q,"°"]}),r("input",{type:"range",min:"0",max:"360",value:q,onChange:function(e){var c=parseInt(e.target.value);D(c),M(I,c)},className:"zjpcy-color-picker-gradient-range"})]})]}):r(t,{color:B,onChange:function(e){K({hex:e.hex})},disableAlpha:!y}),z.length>0&&c("div",{children:[r("div",{className:"zjpcy-color-picker-presets-label",children:"预设颜色"}),r("div",{className:"zjpcy-color-picker-presets",children:z.map(function(e,c){return r("div",{className:"zjpcy-color-picker-preset",style:{backgroundColor:e},onClick:function(){return K({hex:e})},title:e},c)})})]}),c("div",{className:"zjpcy-color-picker-actions",children:[r("div",{className:"zjpcy-color-picker-preview-label",children:"参考值:"}),r("div",{className:"zjpcy-color-picker-preview ".concat(C?"zjpcy-color-picker-gradient-preview":"zjpcy-color-picker-solid-preview"),style:{background:B}}),c("div",{className:"zjpcy-color-picker-button-group",children:[r(s,{size:"small",onClick:function(){E(p),C&&(L([p,"#ffffff"]),D(90)),w(!1)},children:"取消"}),r(s,{variant:"primary",size:"small",onClick:function(){m(B),w(!1)},children:"确认"})]})]})]}),r("div",{className:"zjpcy-color-picker-overlay",onClick:function(){return w(!1)}})]})]})};export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as r,__generator as n}from"tslib";import{jsx as t}from"react/jsx-runtime";import e from"../Hooks/useCopy.js";var s=function(s){var o=s.url,u=s.onCopyStatusChange,i=s.children,a=e();return t("span",{style:{margin:"0px",padding:"0px"},onClick:function(){return r(void 0,void 0,void 0,function(){return n(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,a(o)];case 1:return r.sent(),null==u||u("success"),[3,3];case 2:return r.sent(),null==u||u("error"),[3,3];case 3:return[2]}})})},children:i})},o=e;export{s as default,o as useOnCopy};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{useState as r,useRef as a,useMemo as i,useEffect as c,useCallback as o}from"react";import l from"classnames";import s from"../Icon/Icon.js";import{getDateRangePickerTriggerClassName as d,getDateRangePickerInputClassName as u,getDateRangePickerValueClassName as p,getDateRangePickerFooterButtonClassName as h,getDateRangePickerContainerStyle as f,getDateRangePickerTriggerStyle as v,getDateRangePickerDateCellClassName as g,getDateRangePickerDropdownStyle as m}from"./styles.js";var y=function(e,t){if(!e)return"";var n=e.getFullYear(),r=(e.getMonth()+1).toString().padStart(2,"0"),a=e.getDate().toString().padStart(2,"0");switch(t){case"YYYY/MM/DD":return"".concat(n,"/").concat(r,"/").concat(a);case"DD-MM-YYYY":return"".concat(a,"-").concat(r,"-").concat(n);case"MM/DD/YYYY":return"".concat(r,"/").concat(a,"/").concat(n);default:return"".concat(n,"-").concat(r,"-").concat(a)}},k=function(e,t){var n,r,a,i,c,o,l;if(!e)return null;try{switch(t){case"YYYY/MM/DD":c=(n=e.split("/").map(Number))[0],o=n[1],l=n[2];break;case"DD-MM-YYYY":l=(r=e.split("-").map(Number))[0],o=r[1],c=r[2];break;case"MM/DD/YYYY":o=(a=e.split("/").map(Number))[0],l=a[1],c=a[2];break;default:c=(i=e.split("-").map(Number))[0],o=i[1],l=i[2]}if(isNaN(c)||isNaN(o)||isNaN(l))return null;var s=new Date(c,o-1,l);return s.getFullYear()!==c||s.getMonth()!==o-1||s.getDate()!==l?null:s}catch(e){return null}},M=function(e,t){return new Date(e,t+1,0).getDate()},N=function(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},w=function(e,t){var n=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(t.getFullYear(),t.getMonth(),t.getDate());return n.getTime()<r.getTime()},D=function(D){var z=D.size,b=void 0===z?"middle":z,Y=D.value,j=D.defaultValue,C=D.onChange,x=D.placeholder,F=void 0===x?["开始日期","结束日期"]:x,P=D.disabled,R=void 0!==P&&P,S=D.readOnly,B=void 0!==S&&S,I=D.className,A=void 0===I?"":I,E=D.style,H=D.width,L=void 0===H?"auto":H,O=D.format,T=void 0===O?"YYYY-MM-DD":O,W=D.allowClear,q=void 0===W||W,V=D.disabledDate,G=D.disabledDates,J=D.label,K=D.labelClassName,Q=void 0===K?"":K,U=D.labelStyle,X=D.onOpenChange,Z=D.open,$=D.showOk,_=void 0===$||$,ee=D.separator,te=r(j),ne=te[0],re=te[1],ae=r(!1),ie=ae[0],ce=ae[1],oe=r("start"),le=oe[0],se=oe[1],de=r(!1),ue=de[0],pe=de[1],he=r({top:0,left:0,width:0,isAbove:!1}),fe=he[0],ve=he[1],ge=r(!1),me=ge[0],ye=ge[1],ke=a(null),Me=a(null),Ne=void 0!==Y,we=Ne?Y:ne,De=void 0!==Z?Z:ie,ze=(null==we?void 0:we[0])||"",be=(null==we?void 0:we[1])||"",Ye=i(function(){return k(ze,T)},[ze,T]),je=i(function(){return k(be,T)},[be,T]),Ce=r(Ye||new Date),xe=Ce[0],Fe=Ce[1],Pe=r(function(){if(je)return je;if(Ye){var e=new Date(Ye);return e.setMonth(e.getMonth()+1),e}var t=new Date;return t.setMonth(t.getMonth()+1),t}),Re=Pe[0],Se=Pe[1];c(function(){Ye&&Fe(Ye),je&&Se(je)},[Ye,je]);var Be=o(function(){if(ke.current){var e=ke.current.getBoundingClientRect(),t=ke.current.closest(".zjpcy-datepicker-range-picker");if(t){var n=t.getBoundingClientRect(),r=Math.max(e.width,560),a=window.innerHeight-e.bottom,i=e.bottom-n.top+4,c=e.left-n.left,o=a<360&&e.top>360;o&&(i=e.top-n.top-360-4);var l=window.innerWidth;c+r>l&&(c=l-r-16),ve({top:i,left:c,width:r,isAbove:o})}}},[]);c(function(){if(De&&Me.current&&ke.current){return ye(!1),requestAnimationFrame(function(){var t=ke.current.getBoundingClientRect(),n=ke.current.closest(".zjpcy-datepicker-range-picker");if(n){var r=n.getBoundingClientRect(),a=Me.current.offsetHeight;if(window.innerHeight-t.bottom<360&&t.top>360){var i=t.top-r.top-a-4;ve(function(t){return e(e({},t),{top:i})})}ye(!0)}}),function(){ye(!1)}}},[De]),c(function(){var e=function(e){ke.current&&!ke.current.contains(e.target)&&Me.current&&!Me.current.contains(e.target)&&(void 0===Z&&ce(!1),null==X||X(!1),pe(!1))};if(De)return document.addEventListener("mousedown",e),Be(),function(){document.removeEventListener("mousedown",e)}},[De,Z,X,Be]);var Ie=o(function(e,t){var n=[0===e?t:(null==we?void 0:we[0])||"",1===e?t:(null==we?void 0:we[1])||""];Ne||re(n),null==C||C(n)},[Ne,C,we]),Ae=function(e){R||B||(se(e),void 0===Z&&ce(!0),null==X||X(!0),pe(!0))},Ee=function(){void 0===Z&&ce(!1),null==X||X(!1),pe(!1)},He=o(function(e){if(V&&V(e))return!0;if(G&&G.length>0){var t=y(e,T);return G.includes(t)}return!1},[V,G,T]),Le=function(e){for(var t=e.getFullYear(),n=e.getMonth(),r=M(t,n),a=function(e,t){return new Date(e,t,1).getDay()}(t,n),i=M(t,n-1),c=[],o=a-1;o>=0;o--)c.push({date:new Date(t,n-1,i-o),isCurrentMonth:!1});for(o=1;o<=r;o++)c.push({date:new Date(t,n,o),isCurrentMonth:!0});var l=42-c.length;for(o=1;o<=l;o++)c.push({date:new Date(t,n+1,o),isCurrentMonth:!1});return c},Oe=function(e){var r=e.viewDate,a=e.onPrevMonth,i=e.onNextMonth,c=e.label,o=r.getFullYear(),l=r.getMonth();return t("div",{className:"zjpcy-datepicker-range-calendar-header",children:[n("div",{className:"zjpcy-datepicker-range-header-left",children:n("button",{className:"zjpcy-datepicker-range-header-btn",onClick:a,title:"上个月",children:n(s,{type:"arrowLeft",size:14,color:"var(--zjpcy-text-color-secondary)"})})}),t("div",{className:"zjpcy-datepicker-range-header-center",children:[t("span",{children:[o,"年 ",["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"][l]]}),n("span",{className:"zjpcy-datepicker-range-header-label",children:c})]}),n("div",{className:"zjpcy-datepicker-range-header-right",children:n("button",{className:"zjpcy-datepicker-range-header-btn",onClick:i,title:"下个月",children:n(s,{type:"arrowRight",size:14,color:"var(--zjpcy-text-color-secondary)"})})})]})},Te=function(e){var r=e.viewDate,a=e.onPrevMonth,c=e.onNextMonth,o=e.label,l=i(function(){return Le(r)},[r]);return t("div",{className:"zjpcy-datepicker-range-calendar",children:[n(Oe,{viewDate:r,onPrevMonth:a,onNextMonth:c,label:o}),t("div",{className:"zjpcy-datepicker-range-calendar-body",children:[n("div",{className:"zjpcy-datepicker-range-week-header",children:["日","一","二","三","四","五","六"].map(function(e){return n("div",{className:"zjpcy-datepicker-range-week-day",children:e},e)})}),n("div",{className:"zjpcy-datepicker-range-date-grid",children:l.map(function(e,t){var r=e.date,a=e.isCurrentMonth,i=N(r,"start"===le?Ye:je),c=function(e){var t=new Date;return N(e,t)}(r),o=He(r),l=function(e){return!(!Ye||!je)&&w(Ye,e)&&w(e,je)}(r),s=function(e){return N(e,Ye)}(r),d=function(e){return N(e,je)}(r);return n("div",{className:g({isSelected:i,isToday:c,isCurrentMonth:a,isInRange:l,isRangeStart:s,isRangeEnd:d,disabled:o}),onClick:function(){return function(e){if(!He(e)){var t=y(e,T);"start"===le?(Ie(0,t),je&&w(je,e)&&Ie(1,""),se("end")):(Ye&&w(e,Ye)?(Ie(0,t),Ie(1,ze)):Ie(1,t),_||Ee())}}(r)},children:r.getDate()},t)})})]})]})},We=f({width:L}),qe=d({focused:ue,disabled:R,size:b}),Ve=v({size:b}),Ge=ze||be;return t("div",{className:l("zjpcy-datepicker-range-picker",A,{"zjpcy-datepicker-range-picker-with-label":J}),style:e(e({},We),E),children:[J&&n("span",{className:l("zjpcy-datepicker-range-picker-label",Q),style:U,children:J}),t("div",{ref:ke,className:qe,style:Ve,children:[n("div",{className:u({active:"start"===le&&De}),onClick:function(){return Ae("start")},children:n("span",{className:p({isPlaceholder:!ze}),children:ze||F[0]})}),n("span",{className:"zjpcy-datepicker-range-picker-separator",children:ee||n(s,{type:"arrow-right",size:"small"})}),n("div",{className:u({active:"end"===le&&De}),onClick:function(){return Ae("end")},children:n("span",{className:p({isPlaceholder:!be}),children:be||F[1]})}),t("span",{className:"zjpcy-datepicker-range-picker-suffix",children:[q&&Ge&&!R&&!B&&n("span",{className:"zjpcy-datepicker-range-picker-clear",onClick:function(e){e.stopPropagation(),Ne||re(void 0),null==C||C(["",""])},children:n(s,{type:"close",size:"small"})}),n(s,{type:"calendar",size:"small",className:l("zjpcy-datepicker-range-picker-icon",{"zjpcy-datepicker-range-picker-icon--has-clear":q&&Ge&&!R&&!B})})]})]}),function(){if(!De)return null;var r=m({top:fe.top,left:fe.left,minWidth:fe.width||("number"==typeof L?L:parseInt(L,10)||280)});return t("div",{ref:Me,className:"zjpcy-datepicker-range-dropdown",style:e(e({},r),{opacity:me?1:0,transition:"opacity 0.15s ease"}),children:[t("div",{className:"zjpcy-datepicker-range-panels",children:[n(Te,{viewDate:xe,onPrevMonth:function(){var e=new Date(xe);e.setMonth(e.getMonth()-1),Fe(e)},onNextMonth:function(){var e=new Date(xe);e.setMonth(e.getMonth()+1),Fe(e)},label:"开始日期"}),n(Te,{viewDate:Re,onPrevMonth:function(){var e=new Date(Re);e.setMonth(e.getMonth()-1),Se(e)},onNextMonth:function(){var e=new Date(Re);e.setMonth(e.getMonth()+1),Se(e)},label:"结束日期"})]}),_&&t("div",{className:"zjpcy-datepicker-range-footer",children:[n("div",{className:"zjpcy-datepicker-range-footer-spacer"}),n("div",{className:"zjpcy-datepicker-range-footer-actions",children:n("button",{className:h({variant:"primary"}),onClick:Ee,children:"确定"})})]})]})}()]})};export{D as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__spreadArray as e,__assign as t}from"tslib";import{jsxs as n,jsx as r,Fragment as a}from"react/jsx-runtime";import{useState as c,useRef as i,useEffect as o,useMemo as l,useCallback as d}from"react";import s from"./RangePicker.js";import u from"classnames";import p from"../Icon/Icon.js";import h from"../Tag/index.js";import f from"../TimePicker/TimePickerPanel.js";import{getDatePickerTriggerClassName as v,getDatePickerValueClassName as m,getDatePickerContainerStyle as y,getLabelContainerStyle as k,getDatePickerTriggerStyle as g,getDatePickerDropdownStyle as z,getDateCellClassName as N,getFooterButtonClassName as j,getMonthCellClassName as w,getQuarterCellClassName as S,getYearCellClassName as b}from"./styles.js";var C=function(e,t){if(!e)return"";var n=e.getFullYear(),r=(e.getMonth()+1).toString().padStart(2,"0"),a=e.getDate().toString().padStart(2,"0");switch(t){case"YYYY/MM/DD":return"".concat(n,"/").concat(r,"/").concat(a);case"DD-MM-YYYY":return"".concat(a,"-").concat(r,"-").concat(n);case"MM/DD/YYYY":return"".concat(r,"/").concat(a,"/").concat(n);default:return"".concat(n,"-").concat(r,"-").concat(a)}},Y=function(e,t){return new Date(e,t+1,0).getDate()},M=function(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},D=function(e){var t=e.currentYear,a=e.startYear,c=e.onYearSelect,i=e.onBack,o=e.onPrevPage,d=e.onNextPage,s=l(function(){for(var e=[],t=0;t<12;t++)e.push(a+t);return e},[a]),u=(new Date).getFullYear(),h=a+11;return n("div",{className:"zjpcy-datepicker-year-panel",children:[n("div",{className:"zjpcy-datepicker-header",children:[r("div",{className:"zjpcy-datepicker-header-left",children:r("button",{className:"zjpcy-datepicker-header-btn",onClick:o,title:"上一页",children:r(p,{type:"arrowLeft",size:14,color:"var(--zjpcy-text-color-secondary)"})})}),r("div",{className:"zjpcy-datepicker-header-center",children:n("span",{style:{cursor:"pointer"},onClick:i,children:[a," - ",h]})}),r("div",{className:"zjpcy-datepicker-header-right",children:r("button",{className:"zjpcy-datepicker-header-btn",onClick:d,title:"下一页",children:r(p,{type:"arrowRight",size:14,color:"var(--zjpcy-text-color-secondary)"})})})]}),r("div",{className:"zjpcy-datepicker-year-grid",children:s.map(function(e){return r("div",{className:b({isSelected:e===t,isCurrentYear:e===u}),onClick:function(){return c(e)},children:e},e)})})]})},x=function(e){var t=e.currentMonth,a=e.onMonthSelect,c=e.onBack,i=l(function(){return["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]},[]),o=(new Date).getMonth();return n("div",{className:"zjpcy-datepicker-month-panel",children:[n("div",{className:"zjpcy-datepicker-header",children:[r("div",{className:"zjpcy-datepicker-header-left",children:r("button",{className:"zjpcy-datepicker-header-btn",onClick:c,title:"返回",children:r(p,{type:"arrowLeft",size:14,color:"var(--zjpcy-text-color-secondary)"})})}),r("div",{className:"zjpcy-datepicker-header-center",children:r("span",{style:{cursor:"pointer"},onClick:c,children:"选择月份"})}),r("div",{className:"zjpcy-datepicker-header-right"})]}),r("div",{className:"zjpcy-datepicker-month-grid",children:i.map(function(e,n){return r("div",{className:w({isSelected:n===t,isCurrentMonth:n===o}),onClick:function(){return a(n)},children:e},n)})})]})},F=function(e){var t=e.currentMonth,a=e.onPrevMonth,c=e.onNextMonth,i=e.onYearClick,o=e.onMonthClick,l=t.getFullYear(),d=t.getMonth();return n("div",{className:"zjpcy-datepicker-header",children:[r("div",{className:"zjpcy-datepicker-header-left",children:r("button",{className:"zjpcy-datepicker-header-btn",onClick:a,title:"上个月",children:r(p,{type:"arrowLeft",size:14,color:"var(--zjpcy-text-color-secondary)"})})}),n("div",{className:"zjpcy-datepicker-header-center",children:[n("span",{style:{cursor:"pointer",fontWeight:500},onClick:i,children:[l,"年"]}),r("span",{style:{cursor:"pointer",fontWeight:500},onClick:o,children:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"][d]})]}),r("div",{className:"zjpcy-datepicker-header-right",children:r("button",{className:"zjpcy-datepicker-header-btn",onClick:c,title:"下个月",children:r(p,{type:"arrowRight",size:14,color:"var(--zjpcy-text-color-secondary)"})})})]})},P=function(e){var t=e.value,a=e.selectedValues,i=void 0===a?[]:a,s=e.onChange,p=e.format,h=e.disabledDate,v=e.disabledDates,m=e.showToday,y=void 0===m||m,k=e.showOk,g=void 0===k||k,z=e.onToday,w=e.onOk,S=e.showTime,b=e.onHasSelectedDateChange,P=l(function(){return function(e,t){var n,r,a,c;if(!e)return null;var i,o,l,d=e.split(" ")[0];try{switch(t){case"YYYY/MM/DD":i=(n=d.split("/").map(Number))[0],o=n[1],l=n[2];break;case"DD-MM-YYYY":l=(r=d.split("-").map(Number))[0],o=r[1],i=r[2];break;case"MM/DD/YYYY":o=(a=d.split("/").map(Number))[0],l=a[1],i=a[2];break;default:i=(c=d.split("-").map(Number))[0],o=c[1],l=c[2]}if(isNaN(i)||isNaN(o)||isNaN(l))return null;var s=new Date(i,o-1,l);return s.getFullYear()!==i||s.getMonth()!==o-1||s.getDate()!==l?null:s}catch(e){return null}}(t,p)},[t,p]),T=l(function(){return new Set(i)},[i]),I=c(P||new Date),R=I[0],Q=I[1],B=c("calendar"),H=B[0],L=B[1],O=function(e){return 12*Math.floor(e/12)},q=c(O((P||new Date).getFullYear())),$=q[0],W=q[1];o(function(){P&&Q(P)},[P]);var A=function(e){if(!e||!S)return{hour:0,minute:0,second:0};var t=e.split(" ");if(t.length>1){var n=t[1].split(":");return{hour:parseInt(n[0],10)||0,minute:parseInt(n[1],10)||0,second:parseInt(n[2],10)||0}}return{hour:0,minute:0,second:0}},V=A(t),E=c(V),G=E[0],J=E[1];o(function(){J(A(t))},[t]);var K=l(function(){for(var e=R.getFullYear(),t=R.getMonth(),n=Y(e,t),r=function(e,t){return new Date(e,t,1).getDay()}(e,t),a=Y(e,t-1),c=[],i=r-1;i>=0;i--)c.push({date:new Date(e,t-1,a-i),isCurrentMonth:!1});for(i=1;i<=n;i++)c.push({date:new Date(e,t,i),isCurrentMonth:!0});var o=42-c.length;for(i=1;i<=o;i++)c.push({date:new Date(e,t+1,i),isCurrentMonth:!1});return c},[R]),U=d(function(e){if(h&&h(e))return!0;if(v&&v.length>0){var t=C(e,p);return v.includes(t)}return!1},[h,v,p]),X=!!P;o(function(){null==b||b(X)},[X,b]);return"year"===H?r(D,{currentYear:R.getFullYear(),startYear:$,onYearSelect:function(e){var t=new Date(R);t.setFullYear(e),Q(t),L("month")},onBack:function(){return L("calendar")},onPrevPage:function(){return W(function(e){return e-12})},onNextPage:function(){return W(function(e){return e+12})}}):"month"===H?r(x,{currentMonth:R.getMonth(),onMonthSelect:function(e){var t=new Date(R);t.setMonth(e),Q(t),L("calendar")},onBack:function(){return L("calendar")}}):n("div",{className:"zjpcy-datepicker-panel",children:[n("div",{className:u("zjpcy-datepicker-content",{"zjpcy-datepicker-content-with-time":S&&X}),children:[n("div",{className:"zjpcy-datepicker-calendar-section",children:[r(F,{currentMonth:R,onPrevMonth:function(){var e=new Date(R);e.setMonth(e.getMonth()-1),Q(e)},onNextMonth:function(){var e=new Date(R);e.setMonth(e.getMonth()+1),Q(e)},onYearClick:function(){W(O(R.getFullYear())),L("year")},onMonthClick:function(){L("month")}}),n("div",{className:"zjpcy-datepicker-body",children:[r("div",{className:"zjpcy-datepicker-week-header",children:["日","一","二","三","四","五","六"].map(function(e){return r("div",{className:"zjpcy-datepicker-week-day",children:e},e)})}),r("div",{className:"zjpcy-datepicker-date-grid",children:K.map(function(e,t){var n=e.date,a=e.isCurrentMonth,c=C(n,p),i=M(n,P),o=T.has(c),l=function(e){var t=new Date;return M(e,t)}(n),d=U(n);return r("div",{className:N({isSelected:i,isInSelectedSet:o,isToday:l,disabled:d,isCurrentMonth:a}),onClick:function(){return function(e){if(!U(e)){var t=C(e,p);if(S){var n=X?"".concat(String(G.hour).padStart(2,"0"),":").concat(String(G.minute).padStart(2,"0"),":").concat(String(G.second).padStart(2,"0")):"00:00:00";null==s||s("".concat(t," ").concat(n))}else null==s||s(t)}}(n)},children:n.getDate()},t)})})]})]}),S&&X&&n("div",{className:"zjpcy-datepicker-time-section",children:[n("div",{className:"zjpcy-datepicker-time-header",children:[String(G.hour).padStart(2,"0"),":",String(G.minute).padStart(2,"0"),":",String(G.second).padStart(2,"0")]}),r(f,{value:"".concat(String(G.hour).padStart(2,"0"),":").concat(String(G.minute).padStart(2,"0"),":").concat(String(G.second).padStart(2,"0")),onChange:function(e){if(P){var t=e.split(":").map(Number),n=t[0],r=t[1],a=t[2];J({hour:n,minute:r,second:a});var c=C(P,p);null==s||s("".concat(c," ").concat(e))}},format:"HH:mm:ss",hourStep:1,minuteStep:1,secondStep:1,showNow:!1,showOk:!1})]})]}),(y||g)&&n("div",{className:"zjpcy-datepicker-footer",children:[y?r("button",{className:j({}),onClick:function(){var e=new Date;if(Q(e),S){var t="".concat(String(e.getHours()).padStart(2,"0"),":").concat(String(e.getMinutes()).padStart(2,"0"),":").concat(String(e.getSeconds()).padStart(2,"0"));null==s||s("".concat(C(e,p)," ").concat(t))}else null==s||s(C(e,p));null==z||z()},children:"今天"}):r("div",{className:"zjpcy-datepicker-footer-spacer"}),g&&r("div",{className:"zjpcy-datepicker-footer-actions",children:r("button",{className:j({variant:"primary"}),onClick:w,children:"确定"})})]})]})},T=function(s){var f=s.size,N=void 0===f?"middle":f,C=s.value,Y=s.defaultValue,M=s.onChange,D=s.placeholder,x=void 0===D?"请选择日期":D,F=s.disabled,T=void 0!==F&&F,I=s.readOnly,R=void 0!==I&&I,Q=s.className,B=void 0===Q?"":Q,H=s.style,L=s.width,O=void 0===L?160:L,q=s.format,$=void 0===q?"YYYY-MM-DD":q,W=s.allowClear,A=void 0===W||W,V=s.disabledDate,E=s.disabledDates,G=s.label,J=s.labelGap,K=void 0===J?8:J,U=s.labelClassName,X=void 0===U?"":U,Z=s.labelStyle,_=s.onOpenChange,ee=s.open,te=s.showToday,ne=void 0===te||te,re=s.showOk,ae=void 0===re||re,ce=s.picker,ie=void 0===ce?"date":ce,oe=s.multiple,le=void 0!==oe&&oe,de=s.maxTagCount,se=s.maxTagDisplayCount,ue=s.separator,pe=void 0===ue?",":ue,he=s.showTime,fe=void 0!==he&&he,ve=c(Y),me=ve[0],ye=ve[1],ke=c(!1),ge=ke[0],ze=ke[1],Ne=c(!1),je=Ne[0],we=Ne[1],Se=c({top:0,left:0,width:0,isAbove:!1}),be=Se[0],Ce=Se[1],Ye=c(!1),Me=Ye[0],De=Ye[1],xe=c(!1),Fe=xe[0],Pe=xe[1],Te=i(null),Ie=i(null),Re=i(Fe);o(function(){Re.current=Fe},[Fe]);var Qe=void 0!==C,Be=Qe?C:me,He=l(function(){return Be?Be.split(pe).filter(function(e){return e.trim()}):[]},[Be,pe]),Le=d(function(e){return He.includes(e)},[He]),Oe=d(function(t){return Le(t)?He.filter(function(e){return e!==t}).join(pe):void 0!==de&&He.length>=de?He.join(pe):e(e([],He,!0),[t],!1).join(pe)},[He,Le,pe,de]),qe=void 0!==ee?ee:ge,$e=d(function(){if(Te.current){var e=Te.current.getBoundingClientRect(),t=Te.current.closest(".zjpcy-datepicker");if(t){var n=t.getBoundingClientRect(),r=Re.current,a=fe&&r?480:280,c=Math.max(e.width,a),i=window.innerHeight-e.bottom,o=e.bottom-n.top+4,l=e.left-n.left,d=i<360&&e.top>360;d&&(o=e.top-n.top-360-4);var s=window.innerWidth;l+c>s&&(l=s-c-16),Ce({top:o,left:l,width:c,isAbove:d})}}},[fe]);o(function(){if(qe&&Ie.current&&Te.current){return De(!1),requestAnimationFrame(function(){var e=Te.current.getBoundingClientRect(),n=Te.current.closest(".zjpcy-datepicker");if(n){var r=n.getBoundingClientRect(),a=Ie.current.offsetHeight;if(window.innerHeight-e.bottom<360&&e.top>360){var c=e.top-r.top-a-4;Ce(function(e){return t(t({},e),{top:c})})}De(!0)}}),function(){De(!1)}}},[qe]),o(function(){var e=function(e){Te.current&&!Te.current.contains(e.target)&&Ie.current&&!Ie.current.contains(e.target)&&(void 0===ee&&ze(!1),null==_||_(!1),we(!1))};if(qe)return document.addEventListener("mousedown",e),$e(),function(){document.removeEventListener("mousedown",e)}},[qe,ee,_,$e]);var We=function(){if(!T&&!R){var e=!qe;void 0===ee&&ze(e),null==_||_(e),we(e)}},Ae=function(e){var t;t=le?Oe(e):e,Qe||ye(t),null==M||M(t),le||ae||(void 0===ee&&ze(!1),null==_||_(!1),we(!1))},Ve=function(e){e.stopPropagation(),Qe||ye(void 0),null==M||M("")},Ee=function(){void 0===ee&&ze(!1),null==_||_(!1),we(!1)},Ge=function(){var e,t,a=function(e){if(!e)return null;var t=e.match(/^(\d{4})-(\d{2})$/);return t?{year:parseInt(t[1],10),month:parseInt(t[2],10)-1}:null}(Be),i=new Date,o=c(null!==(e=null==a?void 0:a.year)&&void 0!==e?e:i.getFullYear()),d=o[0],s=o[1],u=null!==(t=null==a?void 0:a.month)&&void 0!==t?t:null,h=l(function(){return["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]},[]),f=i.getMonth(),v=i.getFullYear(),m=l(function(){return le?new Set(He.filter(function(e){return e.match(/^\d{4}-\d{2}$/)})):new Set},[He,le]),y=function(e){var t="".concat(d,"-").concat(String(e+1).padStart(2,"0"));return m.has(t)};return n("div",{className:"zjpcy-datepicker-month-picker-panel",children:[n("div",{className:"zjpcy-datepicker-header",children:[r("div",{className:"zjpcy-datepicker-header-left",children:r("button",{className:"zjpcy-datepicker-header-btn",onClick:function(){return s(function(e){return e-1})},title:"上一年",children:r(p,{type:"arrowLeft",size:14,color:"var(--zjpcy-text-color-secondary)"})})}),r("div",{className:"zjpcy-datepicker-header-center",children:n("span",{children:[d,"年"]})}),r("div",{className:"zjpcy-datepicker-header-right",children:r("button",{className:"zjpcy-datepicker-header-btn",onClick:function(){return s(function(e){return e+1})},title:"下一年",children:r(p,{type:"arrowRight",size:14,color:"var(--zjpcy-text-color-secondary)"})})})]}),r("div",{className:"zjpcy-datepicker-month-grid",children:h.map(function(e,t){var n=le?y(t):t===u&&d===(null==a?void 0:a.year),c=le&&y(t)&&!(t===u&&d===(null==a?void 0:a.year));return r("div",{className:w({isSelected:n,isInSelectedSet:c,isCurrentMonth:t===f&&d===v}),onClick:function(){return function(e){var t="".concat(d,"-").concat(String(e+1).padStart(2,"0"));if(le){var n=Oe(t);Qe||ye(n),null==M||M(n)}else Qe||ye(t),null==M||M(t),ae||Ee()}(t)},children:e},t)})}),ae&&n("div",{className:"zjpcy-datepicker-footer",children:[r("div",{className:"zjpcy-datepicker-footer-spacer"}),r("div",{className:"zjpcy-datepicker-footer-actions",children:r("button",{className:j({variant:"primary"}),onClick:Ee,children:"确定"})})]})]})},Je=function(){var e,t,a=function(e){if(!e)return null;var t=e.match(/^(\d{4})-Q(\d)$/);return t?{year:parseInt(t[1],10),quarter:parseInt(t[2],10)}:null}(Be),i=new Date,o=c(null!==(e=null==a?void 0:a.year)&&void 0!==e?e:i.getFullYear()),d=o[0],s=o[1],u=null!==(t=null==a?void 0:a.quarter)&&void 0!==t?t:null,h=i.getMonth(),f=Math.floor(h/3)+1,v=i.getFullYear(),m=l(function(){return le?new Set(He.filter(function(e){return e.match(/^\d{4}-Q\d$/)})):new Set},[He,le]),y=function(e){var t="".concat(d,"-Q").concat(e);return m.has(t)};return n("div",{className:"zjpcy-datepicker-quarter-panel",children:[n("div",{className:"zjpcy-datepicker-header",children:[r("div",{className:"zjpcy-datepicker-header-left",children:r("button",{className:"zjpcy-datepicker-header-btn",onClick:function(){return s(function(e){return e-1})},title:"上一年",children:r(p,{type:"arrowLeft",size:14,color:"var(--zjpcy-text-color-secondary)"})})}),r("div",{className:"zjpcy-datepicker-header-center",children:n("span",{children:[d,"年"]})}),r("div",{className:"zjpcy-datepicker-header-right",children:r("button",{className:"zjpcy-datepicker-header-btn",onClick:function(){return s(function(e){return e+1})},title:"下一年",children:r(p,{type:"arrowRight",size:14,color:"var(--zjpcy-text-color-secondary)"})})})]}),r("div",{className:"zjpcy-datepicker-quarter-grid",children:["Q1","Q2","Q3","Q4"].map(function(e,t){var n=t+1,c=d===v&&n===f,i=le?y(n):n===u&&d===(null==a?void 0:a.year),o=le&&y(n)&&!(n===u&&d===(null==a?void 0:a.year));return r("div",{className:S({isSelected:i,isInSelectedSet:o,isCurrentQuarter:c}),onClick:function(){return function(e,t){var n="".concat(e,"-Q").concat(t);if(le){var r=Oe(n);Qe||ye(r),null==M||M(r)}else Qe||ye(n),null==M||M(n),ae||Ee()}(d,n)},children:e},e)})}),ae&&n("div",{className:"zjpcy-datepicker-footer",children:[r("div",{className:"zjpcy-datepicker-footer-spacer"}),r("div",{className:"zjpcy-datepicker-footer-actions",children:r("button",{className:j({variant:"primary"}),onClick:Ee,children:"确定"})})]})]})},Ke=function(){var e,t=function(e){if(!e)return null;var t=e.match(/^(\d{4})$/);return t?parseInt(t[1],10):null}(Be),a=(new Date).getFullYear(),i=c((e=null!=t?t:a,12*Math.floor(e/12))),o=i[0],d=i[1],s=l(function(){for(var e=[],t=0;t<12;t++)e.push(o+t);return e},[o]),u=l(function(){return le?new Set(He.filter(function(e){return e.match(/^\d{4}$/)})):new Set},[He,le]);return n("div",{className:"zjpcy-datepicker-year-panel",children:[n("div",{className:"zjpcy-datepicker-header",children:[r("div",{className:"zjpcy-datepicker-header-left",children:r("button",{className:"zjpcy-datepicker-header-btn",onClick:function(){return d(function(e){return e-12})},title:"上一页",children:r(p,{type:"arrowLeft",size:14,color:"var(--zjpcy-text-color-secondary)"})})}),r("div",{className:"zjpcy-datepicker-header-center",children:n("span",{children:[o," - ",o+11]})}),r("div",{className:"zjpcy-datepicker-header-right",children:r("button",{className:"zjpcy-datepicker-header-btn",onClick:function(){return d(function(e){return e+12})},title:"下一页",children:r(p,{type:"arrowRight",size:14,color:"var(--zjpcy-text-color-secondary)"})})})]}),r("div",{className:"zjpcy-datepicker-year-grid",children:s.map(function(e){var n=le?u.has(String(e)):e===t,c=le&&u.has(String(e))&&e!==t;return r("div",{className:b({isSelected:n,isInSelectedSet:c,isCurrentYear:e===a}),onClick:function(){return function(e){var t=String(e);if(le){var n=Oe(t);Qe||ye(n),null==M||M(n)}else Qe||ye(t),null==M||M(t),ae||Ee()}(e)},children:e},e)})}),ae&&n("div",{className:"zjpcy-datepicker-footer",children:[r("div",{className:"zjpcy-datepicker-footer-spacer"}),r("div",{className:"zjpcy-datepicker-footer-actions",children:r("button",{className:j({variant:"primary"}),onClick:Ee,children:"确定"})})]})]})},Ue=d(function(e){return function(t){t.stopPropagation();var n=He.filter(function(t){return t!==e}).join(pe);Qe||ye(n||void 0),null==M||M(n)}},[He,pe,Qe,M]),Xe=function(){var e,c,i,o=l(function(){return Be||""},[Be]),d=v({focused:je,disabled:T,size:N}),s=g({size:N}),f=m({isPlaceholder:!Be,disabled:T,isTags:le&&He.length>0});return n("div",{ref:Te,className:u(d,B,{"zjpcy-datepicker-trigger--multiple":le}),style:t(t({},s),H),onClick:We,children:[le&&He.length>0?r("span",{className:f,children:(e=void 0!==se&&se>0,c=e?He.slice(0,se):He,i=e?He.length-se:0,n(a,{children:[c.map(function(e,t){return r(h,{size:"small",closable:!T,onClose:Ue(e),className:"zjpcy-datepicker-tag",children:e},"".concat(e,"-").concat(t))}),i>0&&n(h,{size:"small",className:"zjpcy-datepicker-tag zjpcy-datepicker-tag--more",children:["...+",i]},"more")]}))}):r("span",{className:f,children:o||x}),n("span",{className:"zjpcy-datepicker-suffix",children:[A&&Be&&!T&&r("span",{className:"zjpcy-datepicker-clear",onClick:Ve,children:r(p,{type:"close",style:{fontSize:10}})}),r("span",{className:u("zjpcy-datepicker-icon",{"has-clear":A&&Be&&!T}),children:r(p,{type:"calendar",style:{fontSize:14}})})]})]})},Ze=function(){switch(ie){case"month":return r(Ge,{});case"quarter":return r(Je,{});case"year":return r(Ke,{});default:return r(P,{value:Be,selectedValues:He,onChange:Ae,format:$,disabledDate:V,disabledDates:E,showToday:ne,showOk:ae,showTime:fe,onToday:function(){ae||Ee()},onOk:Ee,onHasSelectedDateChange:Pe})}},_e=function(){if(!qe)return null;var e=z({top:be.top,left:be.left,minWidth:be.width||(fe&&Re.current?480:280)});return r("div",{ref:Ie,className:"zjpcy-datepicker-dropdown",style:t(t({},e),{opacity:Me?1:0,transition:"opacity 0.15s ease"}),children:Ze()})},et=y({width:le?"auto":O,minWidth:le?O:void 0});if(G){var tt=k({gap:K});return n("div",{className:"zjpcy-datepicker-with-label",style:tt,children:["string"==typeof G?r("label",{className:u("zjpcy-datepicker-label",X),style:Z,children:G}):G,n("div",{className:"zjpcy-datepicker",style:et,children:[Xe(),_e()]})]})}return n("div",{className:"zjpcy-datepicker",style:et,children:[Xe(),_e()]})};T.RangePicker=s;var I=T;export{I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"classnames";var t=function(e){var t=e.width,r=e.minWidth;return{width:"number"==typeof t?"".concat(t,"px"):t||"auto",minWidth:r?"number"==typeof r?"".concat(r,"px"):r:void 0}},r=function(t){var r=t.focused,c=t.disabled,a=t.size;return e("zjpcy-datepicker-trigger","zjpcy-datepicker-trigger--".concat(a||"middle"),{"zjpcy-datepicker-trigger--focused":r,"zjpcy-datepicker-trigger--disabled":c})},c=function(e){var t,r;switch(e.size){case"small":t="24px",r="1px 12px";break;case"large":t="40px",r="3px 12px";break;default:t="34px",r="2px 12px"}return{minHeight:t,padding:r}},a=function(t){var r=t.isPlaceholder,c=t.disabled,a=t.isTags;return e("zjpcy-datepicker-value",{"zjpcy-datepicker-value--placeholder":r,"zjpcy-datepicker-value--disabled":c,"zjpcy-datepicker-value--tags":a})},i=function(e){var t=e.top,r=e.left,c=e.minWidth;return{position:"absolute",top:void 0!==t?"".concat(t,"px"):void 0,left:void 0!==r?"".concat(r,"px"):void 0,minWidth:c?"".concat(c,"px"):"280px"}},p=function(t){var r=t.isSelected,c=t.isInSelectedSet,a=t.isToday,i=t.disabled,p=t.isCurrentMonth;return e("zjpcy-datepicker-date-cell",{"zjpcy-datepicker-date-cell--selected":r,"zjpcy-datepicker-date-cell--in-selected-set":c,"zjpcy-datepicker-date-cell--today":a&&!r,"zjpcy-datepicker-date-cell--disabled":i,"zjpcy-datepicker-date-cell--other-month":!p})},n=function(t){var r=t.variant;return e("zjpcy-datepicker-btn",{"zjpcy-datepicker-btn--primary":"primary"===r})},d=function(t){var r=t.isSelected,c=t.isInSelectedSet,a=t.isCurrentYear;return e("zjpcy-datepicker-year-cell",{"zjpcy-datepicker-year-cell--selected":r,"zjpcy-datepicker-year-cell--in-selected-set":c,"zjpcy-datepicker-year-cell--current":a})},l=function(t){var r=t.isSelected,c=t.isInSelectedSet,a=t.isCurrentMonth;return e("zjpcy-datepicker-month-cell",{"zjpcy-datepicker-month-cell--selected":r,"zjpcy-datepicker-month-cell--in-selected-set":c,"zjpcy-datepicker-month-cell--current":a})},o=function(t){var r=t.isSelected,c=t.isInSelectedSet,a=t.isCurrentQuarter;return e("zjpcy-datepicker-quarter-cell",{"zjpcy-datepicker-quarter-cell--selected":r,"zjpcy-datepicker-quarter-cell--in-selected-set":c,"zjpcy-datepicker-quarter-cell--current":a})},s=function(e){var t=e.gap;return{display:"flex",alignItems:"center",gap:"number"==typeof t?"".concat(t,"px"):t||"8px"}},u=function(e){var t=e.width;return{width:"number"==typeof t?"".concat(t,"px"):t||"auto"}},y=function(t){var r=t.focused,c=t.disabled,a=t.size;return e("zjpcy-datepicker-range-picker-trigger","zjpcy-datepicker-range-picker-trigger--".concat(a||"middle"),{"zjpcy-datepicker-range-picker-trigger--focused":r,"zjpcy-datepicker-range-picker-trigger--disabled":c})},k=function(e){var t,r;switch(e.size){case"small":t="24px",r="1px 12px";break;case"large":t="40px",r="3px 12px";break;default:t="32px",r="2px 12px"}return{minHeight:t,padding:r}},g=function(t){var r=t.active;return e("zjpcy-datepicker-range-picker-input",{"zjpcy-datepicker-range-picker-input--active":r})},z=function(t){var r=t.isPlaceholder;return e("zjpcy-datepicker-range-picker-value",{"zjpcy-datepicker-range-picker-value--placeholder":r})},j=function(e){var t=e.top,r=e.left,c=e.minWidth;return{position:"absolute",top:void 0!==t?"".concat(t,"px"):void 0,left:void 0!==r?"".concat(r,"px"):void 0,minWidth:c?"".concat(c,"px"):"560px"}},v=function(t){var r=t.variant;return e("zjpcy-datepicker-range-btn",{"zjpcy-datepicker-range-btn--primary":"primary"===r})},f=function(t){var r=t.isSelected,c=t.isToday,a=t.isCurrentMonth,i=t.isInRange,p=t.isRangeStart,n=t.isRangeEnd,d=t.disabled;return e("zjpcy-datepicker-range-date-cell",{"zjpcy-datepicker-range-date-cell--selected":r,"zjpcy-datepicker-range-date-cell--today":c&&!r&&!i,"zjpcy-datepicker-range-date-cell--disabled":d,"zjpcy-datepicker-range-date-cell--other-month":!a,"zjpcy-datepicker-range-date-cell--in-range":i&&!p&&!n,"zjpcy-datepicker-range-date-cell--range-start":p,"zjpcy-datepicker-range-date-cell--range-end":n})};export{p as getDateCellClassName,t as getDatePickerContainerStyle,i as getDatePickerDropdownStyle,r as getDatePickerTriggerClassName,c as getDatePickerTriggerStyle,a as getDatePickerValueClassName,u as getDateRangePickerContainerStyle,f as getDateRangePickerDateCellClassName,j as getDateRangePickerDropdownStyle,v as getDateRangePickerFooterButtonClassName,g as getDateRangePickerInputClassName,y as getDateRangePickerTriggerClassName,k as getDateRangePickerTriggerStyle,z as getDateRangePickerValueClassName,n as getFooterButtonClassName,s as getLabelContainerStyle,l as getMonthCellClassName,o as getQuarterCellClassName,d as getYearCellClassName};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as i}from"tslib";import{jsx as r}from"react/jsx-runtime";import o from"classnames";var a=function(a){var t,d=a.orientation,e=void 0===d?"horizontal":d,s=a.type,c=void 0===s?"solid":s,v=a.color,m=void 0===v?"#339af0":v,n=a.className,l=void 0===n?"":n,f=a.style,p="#339af0"!==m&&void 0!==m,u=o("divider","divider-".concat(e),((t={})["divider-".concat(c,"-").concat(e)]="dashed"===c,t["divider-primary"]=p,t["divider-primary-with-text"]=p,t),l);return r("div",{className:u,style:i({backgroundColor:m},f)})};export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__assign as e}from"tslib";import{jsx as t,jsxs as r,Fragment as n}from"react/jsx-runtime";import{useState as i,useRef as c,useEffect as a,useCallback as o}from"react";import{createPortal as l}from"react-dom";import d from"classnames";import s from"../Icon/Icon.js";import h from"../Button/Button.js";var u=function(u){var m=u.open,p=u.title,y=u.width,w=void 0===y?460:y,f=u.height,v=void 0===f?300:f,g=u.placement,z=void 0===g?"right":g,j=u.maskClosable,b=void 0===j||j,x=u.mask,N=void 0===x||x,C=u.onClose,k=u.children,W=u.className,H=u.style,M=u.maskStyle,I=u.maskClassName,E=u.contentClassName,L=u.contentStyle,S=u.header,X=u.headerClassName,Y=u.headerStyle,_=u.footer,B=u.footerClassName,q=u.footerStyle,A=u.getContainer,D=void 0!==A&&A,F=u.destroyOnClose,P=void 0!==F&&F,T=u.closable,O=void 0===T||T,G=u.zIndex,J=void 0===G?1e3:G,K=u.loading,Q=void 0!==K&&K,R=u.loadingIcon,U=u.resizable,V=void 0!==U&&U,Z=u.resizeHandleSize,$=void 0===Z?8:Z,ee=u.minWidth,te=void 0===ee?460:ee,re=u.minHeight,ne=void 0===re?150:re,ie=u.onChange,ce=i(!1),ae=ce[0],oe=ce[1],le=i(!1),de=le[0],se=le[1],he=i(!1),ue=he[0],me=he[1],pe=window.innerWidth,ye=window.innerHeight,we=i("number"==typeof w?w:460),fe=we[0],ve=we[1],ge=i("number"==typeof v?v:300),ze=ge[0],je=ge[1],be=i(!1),xe=be[0],Ne=be[1],Ce=c(null),ke=c({x:0,y:0}),We=c({width:0,height:0}),He=c({width:fe,height:ze}),Me=c({placement:z,minWidth:te,maxWidth:pe,minHeight:ne,maxHeight:ye,onChange:ie});a(function(){He.current={width:fe,height:ze}},[fe,ze]),a(function(){Me.current={placement:z,minWidth:te,maxWidth:pe,minHeight:ne,maxHeight:ye,onChange:ie}},[z,te,pe,ne,ye,ie]),a(function(){"number"==typeof w&&ve(w)},[w]),a(function(){"number"==typeof v&&je(v)},[v]),a(function(){if(!m){se(!1),me(!0);var e=setTimeout(function(){oe(!1),me(!1)},300);return function(){return clearTimeout(e)}}return me(!1),oe(!0),document.body.style.overflow="hidden",requestAnimationFrame(function(){requestAnimationFrame(function(){se(!0)})}),function(){document.body.style.overflow=""}},[m,300]);var Ie=function(){b&&C()},Ee=function(){C()},Le=function(e){return"number"==typeof e?"".concat(e,"px"):e},Se=function(){var t=e(e({},H),{zIndex:J}),r=V?{width:fe,height:ze}:{width:w,height:v};switch(z){case"left":case"right":t.width=Le(r.width),t.height="100%";break;case"top":case"bottom":t.height=Le(r.height),t.width="100%"}return xe&&(t.transition="none"),t},Xe=V&&ae,Ye=function(){switch(z){case"left":return"zjpcy-drawer-resize-handle--right";case"right":return"zjpcy-drawer-resize-handle--left";case"top":return"zjpcy-drawer-resize-handle--bottom";case"bottom":return"zjpcy-drawer-resize-handle--top";default:return""}},_e=function(){switch(z){case"left":case"right":return"col-resize";case"top":case"bottom":return"row-resize";default:return"default"}},Be=o(function(e){e.preventDefault(),e.stopPropagation();var t=He.current.width,r=He.current.height;if(Ce.current){var n=Me.current;"left"===n.placement||"right"===n.placement?Ce.current.style.width="".concat(t,"px"):Ce.current.style.height="".concat(r,"px")}Ne(!0),ke.current={x:e.clientX,y:e.clientY},We.current={width:t,height:r}},[]),qe=o(function(e){var t,r=Me.current,n=e.clientX-ke.current.x,i=e.clientY-ke.current.y,c=We.current.width,a=We.current.height;if("left"===r.placement){var o=We.current.width+n;(c=Math.max(r.minWidth,Math.min(r.maxWidth,o)))!==o&&(ke.current.x=e.clientX,We.current.width=c)}else if("right"===r.placement){o=We.current.width-n;(c=Math.max(r.minWidth,Math.min(r.maxWidth,o)))!==o&&(ke.current.x=e.clientX,We.current.width=c)}else if("top"===r.placement){var l=We.current.height+i;(a=Math.max(r.minHeight,Math.min(r.maxHeight,l)))!==l&&(ke.current.y=e.clientY,We.current.height=a)}else if("bottom"===r.placement){l=We.current.height-i;(a=Math.max(r.minHeight,Math.min(r.maxHeight,l)))!==l&&(ke.current.y=e.clientY,We.current.height=a)}He.current={width:c,height:a},ve(c),je(a),null===(t=r.onChange)||void 0===t||t.call(r,{width:c,height:a})},[]),Ae=o(function(){Ne(!1)},[]);a(function(){return xe?(document.addEventListener("mousemove",qe),document.addEventListener("mouseup",Ae)):(document.removeEventListener("mousemove",qe),document.removeEventListener("mouseup",Ae)),function(){document.removeEventListener("mousemove",qe),document.removeEventListener("mouseup",Ae)}},[xe,qe,Ae]);var De=function(){return Q?t("div",R?{className:"zjpcy-drawer-loading",children:t("div",{className:"zjpcy-drawer-loading-content",children:R})}:{className:"zjpcy-drawer-loading",children:t("div",{className:"zjpcy-drawer-loading-content",children:t("div",{className:"zjpcy-drawer-loading-spinner",children:r("svg",{viewBox:"0 0 24 24",className:"zjpcy-drawer-loading-icon",children:[t("circle",{className:"zjpcy-drawer-loading-track",cx:"12",cy:"12",r:"10",fill:"none",strokeWidth:"2"}),t("circle",{className:"zjpcy-drawer-loading-indicator",cx:"12",cy:"12",r:"10",fill:"none",strokeWidth:"2"})]})})})}):null},Fe=function(){return!1===S?null:S?t("div",{className:d("zjpcy-drawer-header",X),style:Y,children:S}):p||O?r("div",{className:d("zjpcy-drawer-header",X),style:Y,children:[t("div",{className:"zjpcy-drawer-header__title",children:p}),O&&t("button",{className:"zjpcy-drawer-header__close",onClick:Ee,type:"button","aria-label":"Close",children:t(s,{type:"close",size:20})})]}):null},Pe=function(){var e;return Xe?t("div",{className:d("zjpcy-drawer-resize-handle",Ye()),style:(e={cursor:_e()},e["left"===z||"right"===z?"width":"height"]=$,e),onMouseDown:Be}):null},Te=function(){if(!ae&&!ue)return null;var i=t("div",{className:d("zjpcy-drawer-overlay",{"zjpcy-drawer-overlay--visible":de&&!ue,"zjpcy-drawer-overlay--closing":ue,"zjpcy-drawer-overlay--resizing":xe},I),style:e({zIndex:J},M),onClick:Ie,children:r("div",{ref:Ce,className:d("zjpcy-drawer","zjpcy-drawer--".concat(z),{"zjpcy-drawer--visible":de&&!ue,"zjpcy-drawer--closing":ue,"zjpcy-drawer--no-mask":!N,"zjpcy-drawer--resizing":xe},W),style:Se(),onClick:function(e){return e.stopPropagation()},children:[De(),Fe(),t("div",{className:d("zjpcy-drawer-content",E),style:L,children:P&&ue?null:k}),!1!==_&&t("div",{className:d("zjpcy-drawer-footer",B),style:q,children:_||r(n,{children:[t(h,{onClick:Ee,type:"button",children:"取消"}),t(h,{variant:"primary",onClick:Ee,type:"button",children:"确认"})]})}),Pe()]})});return N?i:t("div",{className:d("zjpcy-drawer-wrapper",{"zjpcy-drawer-wrapper--visible":de&&!ue,"zjpcy-drawer-wrapper--closing":ue,"zjpcy-drawer-wrapper--no-mask":!N}),style:{zIndex:J},children:r("div",{ref:Ce,className:d("zjpcy-drawer","zjpcy-drawer--".concat(z),{"zjpcy-drawer--visible":de&&!ue,"zjpcy-drawer--closing":ue,"zjpcy-drawer--no-mask":!N,"zjpcy-drawer--resizing":xe},W),style:Se(),children:[De(),Fe(),t("div",{className:d("zjpcy-drawer-content",E),style:L,children:P&&ue?null:k}),!1!==_&&t("div",{className:d("zjpcy-drawer-footer",B),style:q,children:_||r(n,{children:[t("button",{onClick:Ee,type:"button",children:"取消"}),t("button",{onClick:Ee,type:"button",children:"确认"})]})}),Pe()]})})}();if(!Te)return null;if(!1===D)return Te;var Oe="function"==typeof D?D():D;return Oe?l(Te,Oe):Te};export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as o}from"react/jsx-runtime";var r=function(r){var i=r.children,e=r.layout,a=void 0===e?"horizontal":e,n=r.direction,l=r.justify,c=void 0===l?"flex-start":l,s=r.align,f=void 0===s?"stretch":s,d=r.wrap,m=void 0===d?"nowrap":d,p=r.gap,u=r.style,v=void 0===u?{}:u,x=n||("column"===a?"column":"row");return o("div",{className:"flex",style:t({gap:"number"==typeof p?"".concat(p,"px"):p,justifyContent:c,alignItems:f,flexWrap:m,flexDirection:x},v),children:i})};export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__assign as e,__awaiter as r,__generator as t}from"tslib";import{jsx as n,jsxs as a}from"react/jsx-runtime";import l,{createContext as i,useState as s,useRef as o,useCallback as u,useEffect as c,useContext as d}from"react";import{getFormWrapperClassName as v,getFormWrapperStyle as f,getFormItemWrapperClassName as m,getFormItemWrapperStyle as p,getFormLabelClassName as y,getFormLabelStyle as h,getFormControlClassName as b,getFormControlStyle as g,getFormErrorClassName as F,getFormErrorStyle as w,getFormHelpClassName as V,getFormHelpStyle as N}from"./styles.js";import S from"classnames";var k=i(null),E=function(a){var i=a.children,d=a.className,m=void 0===d?"":d,p=a.style,y=a.layout,h=void 0===y?"horizontal":y,b=a.labelSpan,g=a.wrapperSpan,F=a.initialValues,w=void 0===F?{}:F,V=a.onFinish,N=a.onFinishFailed,S=a.colon,E=void 0===S||S,C=a.requiredMark,j=void 0===C||C,x=a.styles,z=a.formRef,A=a.form,I=s(w),M=I[0],L=I[1],P=s({}),W=P[0],$=P[1],D=o(null),O=o(new Map),R=o(null),B=u(function(r,t){L(function(n){var a;return e(e({},n),((a={})[r]=t,a))}),W[r]&&$(function(t){var n=e({},t);return delete n[r],n})},[W]),G=u(function(e){return M[e]},[M]),H=u(function(r){L(function(t){return e(e({},t),r)}),Object.keys(r).forEach(function(r){W[r]&&$(function(t){var n=e({},t);return delete n[r],n})})},[W]),J=u(function(n){return r(void 0,void 0,void 0,function(){var r,a,l,i,s,o,u,c;return t(this,function(d){switch(d.label){case 0:if(!(r=O.current.get(n)))return[2];if(a=r.rules,l=M[n],!a||0===a.length)return[2];i=function(r){var a,i,s,o,u,c,d,v,f;return t(this,function(t){switch(t.label){case 0:if(r.required&&(null==l||""===l))return a=r.message||"".concat(n," is required"),$(function(r){var t;return e(e({},r),((t={})[n]=a,t))}),[2,{value:a}];if(r.pattern&&!r.pattern.test(l))return i=r.message||"".concat(n," format is invalid"),$(function(r){var t;return e(e({},r),((t={})[n]=i,t))}),[2,{value:i}];if(r.type){switch(s=!0,r.type){case"email":s=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l);break;case"url":s=/^https?:\/\/.+$/.test(l);break;case"number":s=!isNaN(Number(l));break;case"integer":s=Number.isInteger(Number(l));break;case"float":s=!isNaN(parseFloat(l))&&isFinite(l);break;case"string":s="string"==typeof l;break;case"boolean":s="boolean"==typeof l;break;case"array":s=Array.isArray(l);break;case"object":s="object"==typeof l&&null!==l&&!Array.isArray(l)}if(!s)return o=r.message||"".concat(n," must be a ").concat(r.type),$(function(r){var t;return e(e({},r),((t={})[n]=o,t))}),[2,{value:o}]}if(void 0!==r.min&&l.length<r.min)return u=r.message||"".concat(n," must be at least ").concat(r.min," characters"),$(function(r){var t;return e(e({},r),((t={})[n]=u,t))}),[2,{value:u}];if(void 0!==r.max&&l.length>r.max)return c=r.message||"".concat(n," must be at most ").concat(r.max," characters"),$(function(r){var t;return e(e({},r),((t={})[n]=c,t))}),[2,{value:c}];if(void 0!==r.len&&l.length!==r.len)return d=r.message||"".concat(n," must be exactly ").concat(r.len," characters"),$(function(r){var t;return e(e({},r),((t={})[n]=d,t))}),[2,{value:d}];if(!r.validator)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,r.validator(r,l)];case 2:return t.sent(),[3,4];case 3:return v=t.sent(),f=v instanceof Error?v.message:r.message||"".concat(n," validation failed"),$(function(r){var t;return e(e({},r),((t={})[n]=f,t))}),[2,{value:f}];case 4:return[2]}})},s=0,o=a,d.label=1;case 1:return s<o.length?(u=o[s],[5,i(u)]):[3,4];case 2:if("object"==typeof(c=d.sent()))return[2,c.value];d.label=3;case 3:return s++,[3,1];case 4:return $(function(r){var t=e({},r);return delete t[n],t}),[2,null]}})})},[M]),K=u(function(e){return r(void 0,void 0,void 0,function(){var r,n;return t(this,function(t){switch(t.label){case 0:return r=e||Array.from(O.current.keys()),[4,Promise.all(r.map(function(e){return J(e)}))];case 1:if(n=t.sent(),n.some(function(e){return null!==e}))throw new Error("Validation failed");return[2,M]}})})},[J,M]),Q=u(function(r){if(r){var t=e({},M);r.forEach(function(e){t[e]=w[e]||void 0}),L(t)}else L(w);$({})},[M,w]),T={getFieldValue:G,getFieldsValue:function(e){if(!e)return M;var r={};return e.forEach(function(e){r[e]=M[e]}),r},setFieldValue:B,setFieldsValue:H,setFields:function(r){var t=e({},M),n=e({},W);r.forEach(function(e){void 0!==e.value&&(t[e.name]=e.value),e.errors&&e.errors.length>0?n[e.name]=e.errors[0]:delete n[e.name]}),L(t),$(n)},resetFields:Q,validateFields:K,submit:function(){K().then(function(){var e=document.querySelector("form");e&&e.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))})},destroy:function(){L({}),$({}),O.current.clear(),R.current=null}};c(function(){R.current=T,z&&(z.current=T),A&&(A.getFieldValue=T.getFieldValue,A.getFieldsValue=T.getFieldsValue,A.setFieldValue=T.setFieldValue,A.setFieldsValue=T.setFieldsValue,A.setFields=T.setFields,A.resetFields=T.resetFields,A.validateFields=T.validateFields,A.submit=T.submit,A.destroy=T.destroy)},[T,z,A]);var U=u(function(e,r){return O.current.set(e,r),function(){O.current.delete(e)}},[]),X={layout:h,labelSpan:b,wrapperSpan:g,colon:E,requiredMark:j,values:M,errors:W,setFieldValue:B,getFieldValue:G,setFieldValueList:H,validateField:J,validateFields:K,resetFields:Q},Y=v({className:m}),Z=f({style:p,customStyles:null==x?void 0:x.wrapper});return n(k.Provider,{value:X,children:n("form",{ref:D,className:Y,style:Z,onSubmit:function(e){return r(void 0,void 0,void 0,function(){var r;return t(this,function(t){switch(t.label){case 0:e.preventDefault(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,K()];case 2:return t.sent(),null==V||V(M),[3,4];case 3:return r=t.sent(),null==N||N({error:r,values:M}),[3,4];case 4:return[2]}})})},children:l.Children.map(i,function(e){return l.isValidElement(e)&&e.type===q?l.cloneElement(e,{registerItem:U}):e})})})},q=function(e){var r=e.name,t=e.label,i=e.required,o=e.rules,u=void 0===o?[]:o,v=e.className,f=void 0===v?"":v,E=e.style,q=e.help,C=e.validateStatus,j=e.colon,x=e.labelSpan,z=e.wrapperSpan,A=e.hidden,I=void 0!==A&&A,M=e.extra,L=e.styles,P=e.registerItem,W=e.children,$=d(k),D=s(r&&(null==$?void 0:$.values[r])?$.values[r]:""),O=D[0],R=D[1];P&&r&&P(r,{rules:u}),c(function(){$&&r&&R($.values[r])},[$,r,null==$?void 0:$.values]);var B=i||u.some(function(e){return e.required}),G=$&&r?$.errors[r]:"",H=!!G||"error"===C,J=void 0!==x?x:null==$?void 0:$.labelSpan,K=void 0!==z?z:null==$?void 0:$.wrapperSpan,Q=J?J/24*100:void 0,T=void 0;if(void 0!==J){var U=24-J,X=void 0!==K?K:U;X>U&&(X=U),X<1&&(X=1),T=X/24*100}if(I)return null;var Y=m({layout:(null==$?void 0:$.layout)||"horizontal",className:f}),Z=p({style:E,customStyles:null==L?void 0:L.wrapper}),_=y({required:B}),ee=h({labelAlign:"vertical"===(null==$?void 0:$.layout)?"start":"end",labelWidth:Q,style:void 0,customStyles:null==L?void 0:L.label}),re=b({}),te=g({controlWidth:T,style:void 0,customStyles:null==L?void 0:L.input}),ne=F({visible:H}),ae=w({style:void 0,customStyles:null==L?void 0:L.error}),le=V({}),ie=N({style:void 0,customStyles:null==L?void 0:L.help}),se=void 0!==j?j:null==$?void 0:$.colon;return a("div",{className:Y,style:Z,children:[t&&n("label",{className:S(_,se&&"zjpcy-form-label--colon"),style:ee,children:t}),a("div",{className:re,style:te,children:[l.Children.map(l.Children.toArray(W).filter(function(e){return l.isValidElement(e)}),function(e){var t=e.props,n=t.autoComplete||function(e){if(e)return{username:"username",email:"email",password:"current-password","new-password":"new-password","current-password":"current-password",name:"name","given-name":"given-name","family-name":"family-name",tel:"tel",phone:"tel",address:"street-address",city:"address-level2",country:"country-name",zipcode:"postal-code","postal-code":"postal-code",organization:"organization",company:"organization"}[e.toLowerCase()]}(r);return l.cloneElement(e,{value:O,onChange:function(e){var n,a;!function(e){R(e),r&&(null==$||$.setFieldValue(r,e))}(void 0!==(null===(n=null==e?void 0:e.target)||void 0===n?void 0:n.value)?e.target.value:e),null===(a=t.onChange)||void 0===a||a.call(t,e)},error:H||void 0,autoComplete:n})}),n("div",{className:ne,style:ae,children:G||""}),q&&!H&&n("div",{className:le,style:ie,children:q}),M&&!H&&n("div",{className:le,style:ie,children:M})]})]})};E.Item=q;var C=E;export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as r}from"tslib";import t from"classnames";var e=function(r){var e=r.className;return t("zjpcy-form-wrapper",e)},n=function(t){var e=t.style,n=t.customStyles;return r(r({},e),n)},o=function(r){var e=r.layout,n=r.className;return t("zjpcy-form-item","zjpcy-form-item--".concat(e),n)},c=function(t){var e=t.style,n=t.customStyles;return r(r({},e),n)},a=function(r){var e=r.required,n=r.className;return t("zjpcy-form-label",{"zjpcy-form-label--required":e},n)},l=function(t){var e=t.labelAlign,n=t.labelWidth,o=t.style,c=t.customStyles;return r(r(r({textAlign:e||"end"},void 0!==n?{width:"".concat(n,"%")}:{}),o),c)},s=function(r){var e=r.className;return t("zjpcy-form-control",e)},u=function(t){var e=t.controlWidth,n=t.style,o=t.customStyles;return r(r(r({},void 0!==e?{width:"".concat(e,"%")}:{}),n),o)},i=function(r){var e=r.visible,n=r.className;return t("zjpcy-form-error",{"zjpcy-form-error--visible":e},n)},m=function(t){var e=t.style,n=t.customStyles;return r(r({},e),n)},f=function(r){var e=r.className;return t("zjpcy-form-help",e)},y=function(t){var e=t.style,n=t.customStyles;return r(r({},e),n)};export{s as getFormControlClassName,u as getFormControlStyle,i as getFormErrorClassName,m as getFormErrorStyle,f as getFormHelpClassName,y as getFormHelpStyle,o as getFormItemWrapperClassName,c as getFormItemWrapperStyle,a as getFormLabelClassName,l as getFormLabelStyle,e as getFormWrapperClassName,n as getFormWrapperStyle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as a}from"react/jsx-runtime";import r,{createContext as e,useContext as s}from"react";import{getColWrapperClassName as l,getColWrapperStyle as i,getRowWrapperClassName as d,getRowWrapperStyle as o,getGridWrapperClassName as t,getGridWrapperStyle as n}from"./styles.js";var p=e({}),c=e({}),f=r.forwardRef(function(r,e){var d=r.children,o=r.className,t=r.style,n=r.span,p=r.offset,f=r.push,u=r.pull,g=r.order,m=r.gap,v=s(c),h=null==v?void 0:v.gap,y=void 0!==m?m:h;return a("div",{ref:e,className:l({className:o}),style:i({span:n,offset:p,push:f,pull:u,order:g,gap:y,style:t}),children:d})});f.displayName="Grid.Col";var u=r.forwardRef(function(r,e){var l=r.children,i=r.className,t=r.style,n=r.span,f=r.gap,u=r.rowGap,g=r.align,m=r.justify,v=r.wrap,h=void 0===v||v,y=s(p),N=null==y?void 0:y.gap,w=void 0!==f?f:N;return a(c.Provider,{value:{gap:w},children:a("div",{ref:e,className:d({className:i}),style:o({span:n,rowGap:u,align:g,justify:m,wrap:h,style:t}),children:l})})});u.displayName="Grid.Row";var g=Object.assign(u,{Col:f}),m=r.forwardRef(function(r,e){var s=r.children,l=r.className,i=r.style,d=r.width,o=r.height,c=r.gap,f=r.padding,u=r.backgroundColor;return a(p.Provider,{value:{gap:c},children:a("div",{ref:e,className:t({className:l}),style:n({width:d,height:o,gap:c,padding:f,backgroundColor:u,style:i}),children:s})})});m.displayName="Grid";var v=Object.assign(m,{Row:g,Col:f});export{f as Col,g as Row,v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as o}from"tslib";import a from"classnames";var t=function(o){var t=o.className;return a("zjpcy-grid",t)},c=function(a){var t=a.width,c=a.height,n=a.gap,r=a.padding,i=a.backgroundColor,e=a.style;return o({width:void 0!==t?"number"==typeof t?"".concat(t,"px"):t:"100%",height:void 0!==c?"number"==typeof c?"".concat(c,"px"):c:"auto",gap:void 0!==n?"number"==typeof n?"".concat(n,"px"):n:"0",padding:void 0!==r?"number"==typeof r?"".concat(r,"px"):r:"0",backgroundColor:i||"transparent",boxSizing:"border-box"},e)},n=function(o){var t=o.className;return a("zjpcy-grid-row",t)},r=function(a){var t=a.span,c=a.rowGap,n=a.align,r=a.justify,i=a.wrap,e=a.style;return o({display:"flex",width:void 0!==t?"calc(".concat(t," / 24 * 100%)"):"100%",rowGap:void 0!==c?"number"==typeof c?"".concat(c,"px"):c:"0",alignItems:n||"stretch",justifyContent:r||"flex-start",flexWrap:!1!==i?"wrap":"nowrap",boxSizing:"border-box"},e)},i=function(o){var t=o.className;return a("zjpcy-grid-col",t)},e=function(a){var t=a.span,c=a.offset,n=a.push,r=a.pull,i=a.order,e=a.gap,p=a.style,d=void 0!==r?"calc(-".concat(r," / 24 * 100%)"):void 0!==c?"calc(".concat(c," / 24 * 100%)"):"0";return o({flex:void 0!==t?"0 0 calc(".concat(t," / 24 * 100%)"):"1",maxWidth:void 0!==t?"calc(".concat(t," / 24 * 100%)"):"100%",marginLeft:d,marginRight:void 0!==n?"calc(".concat(n," / 24 * 100%)"):"0",order:void 0!==i?i:0,paddingLeft:void 0!==e?"number"==typeof e?"".concat(e/2,"px"):"calc(".concat(e," / 2)"):"0",paddingRight:void 0!==e?"number"==typeof e?"".concat(e/2,"px"):"calc(".concat(e," / 2)"):"0",boxSizing:"border-box"},p)};export{i as getColWrapperClassName,e as getColWrapperStyle,t as getGridWrapperClassName,c as getGridWrapperStyle,n as getRowWrapperClassName,r as getRowWrapperStyle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__awaiter as e,__generator as t}from"tslib";import n from"react";var r=function(n){return e(void 0,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return navigator.clipboard&&window.isSecureContext?[4,navigator.clipboard.writeText(n)]:[3,2];case 1:return t.sent(),[3,3];case 2:(e=document.createElement("textarea")).style.position="fixed",e.style.top=e.style.left="-100vh",e.style.opacity="0",e.value=n,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),t.label=3;case 3:return[2]}})})};function o(){var o=this;return n.useCallback(function(n){return e(o,void 0,void 0,function(){return t(this,function(e){switch(e.label){case 0:return[4,r(n)];case 1:return[2,e.sent()]}})})},[])}export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__assign as r}from"tslib";import{jsx as e}from"react/jsx-runtime";import{useMemo as t}from"react";import{presetIcons as o,searchIcon as i,loadingIcon as n,userIcon as a,closeIcon as l,checkIcon as c,plusIcon as u,minusIcon as s,arrowLeftIcon as f,arrowRightIcon as d,arrowUpIcon as v,arrowDownIcon as m,leftIcon as h,rightIcon as p,doubleLeftIcon as g,doubleRightIcon as w}from"./path.js";var y={search:i,loading:n,user:a,close:l,check:c,plus:u,minus:s,arrowLeft:f,arrowRight:d,arrowUp:v,arrowDown:m,left:h,right:p,"double-left":g,"double-right":w},x=function(r){return y[r]?y[r]:o[r]},b={small:12,medium:16,large:24},k=function(o){var i=o.type,n=o.path,a=o.viewBox,l=void 0===a?"0 0 24 24":a,c=o.size,u=void 0===c?"medium":c,s=o.color,f=void 0===s?"#339af0":s,d=o.hoverColor,v=o.spin,m=void 0!==v&&v,h=o.rotate,p=o.align,g=void 0===p?"center":p,w=o.className,y=void 0===w?"":w,k=o.style,B=o.onClick,C=t(function(){return"number"==typeof u?u:b[u]||16},[u]),N=t(function(){if(n)return n;if(i){var r=x(i);return(null==r?void 0:r.path)||""}return""},[i,n]),j=t(function(){if("0 0 24 24"!==l)return l;if(i){var r=x(i);return(null==r?void 0:r.viewBox)||"0 0 24 24"}return"0 0 24 24"},[i,l]);if(!N)return null;var L=r({width:C,height:C,fill:f,transform:h?"rotate(".concat(h,"deg)"):void 0},k);return e("div",{className:"icon-container icon-align-".concat(g," ").concat(y),children:e("svg",{viewBox:j,className:"icon ".concat(m?"icon-spin":""),style:L,onMouseEnter:function(r){d&&(r.currentTarget.style.fill=d)},onMouseLeave:function(r){d&&(r.currentTarget.style.fill=f)},onClick:B,children:e("path",{d:N})})})};export{k as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest as e,__assign as l}from"tslib";import{jsxs as a,jsx as n}from"react/jsx-runtime";import t from"react";import i from"../Icon/Icon.js";var o=function(o){var r=o.type,s=void 0===r?"text":r,c=o.placeholder,u=void 0===c?"":c,d=o.width,p=o.className,m=void 0===p?"":p,f=o.style,v=o.value,y=o.defaultValue,h=o.onChange,b=o.onBlur,x=o.onFocus,N=o.disabled,g=void 0!==N&&N,w=o.readOnly,C=void 0!==w&&w,S=o.onKeyDown,B=o.prefix,D=o.suffix,F=o.clear,I=void 0!==F&&F,K=o.extra,O=o.label,j=o.labelGap,z=void 0===j?8:j,G=o.labelClassName,V=void 0===G?"":G,k=o.labelStyle,R=o.autoComplete,q=e(o,["type","placeholder","width","className","style","value","defaultValue","onChange","onBlur","onFocus","disabled","readOnly","onKeyDown","prefix","suffix","clear","extra","label","labelGap","labelClassName","labelStyle","error","autoComplete"]),A=t.useState(y||""),E=A[0],H=A[1],J=t.useState(!1),L=J[0],M=J[1],P=function(e){return e?"string"==typeof e?n(i,{type:e,size:"medium",color:"#909399"}):e:null},Q=void 0!==v?v:E,T=I&&!g&&!C&&L&&null!=Q&&Q.toString().length>0;return a("div",{className:"input-base-container",children:[a("div",{className:"input-label-wrapper",style:{display:"flex",alignItems:"center"},children:[O&&n("div",{className:"input-label ".concat(V),style:l({marginRight:"number"==typeof z?"".concat(z,"px"):z},k),children:O}),a("div",{className:"input-wrapper ".concat(m," ").concat(g?"input-wrapper-disabled":""," ").concat(C?"input-wrapper-readonly":""),style:l({width:d},f),children:[B&&n("div",{className:"input-prefix",children:P(B)}),n("input",l({type:s,placeholder:u,className:"input-inner",value:null!=v?String(v):Q,onChange:function(e){void 0===v&&H(e.target.value),null==h||h(e)},onBlur:function(e){M(!1),null==b||b(e)},onFocus:function(e){M(!0),null==x||x(e)},disabled:g,readOnly:C,onKeyDown:S,autoComplete:null!=R?R:"password"===s?"current-password":void 0},q)),a("div",{className:"input-suffix-group",children:[n("div",{className:"input-suffix-clear ".concat(T?"visible":""),onClick:function(){g||C||(void 0!==v||H(""),h&&h({target:{value:""}}))},children:n(i,{type:"close",size:"medium",color:"#1890ff"})}),D&&n("div",{className:"input-suffix-content",children:P(D)})]})]})]}),K&&n("div",{className:"input-extra",children:K})]})};export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest as e,__assign as s}from"tslib";import{jsxs as a,jsx as i}from"react/jsx-runtime";import t from"react";import r from"./InputBase.js";var n=function(n){var l=n.nType,d=n.errorMessage,m=n.extra,g=n.value,c=n.onChange,o=n.clear,u=void 0!==o&&o,v=e(n,["nType","errorMessage","extra","value","onChange","clear"]),p=function(e){if(!e)return{isValid:!0,message:""};var s=("string"==typeof e?e:String(e)).trim(),a=parseFloat(s);if(isNaN(a))return{isValid:!1,message:"请输入有效的数字"};switch(l){case"positive-float":return/^\d+(\.\d+)?$/.test(s)&&a>0?{isValid:!0,message:""}:{isValid:!1,message:"请输入正浮点数"};case"negative-float":return/^-\d+(\.\d+)?$/.test(s)&&a<0?{isValid:!0,message:""}:{isValid:!1,message:"请输入负浮点数"};case"positive-integer":return/^\d+$/.test(s)&&a>0?{isValid:!0,message:""}:{isValid:!1,message:"请输入正整数"};case"negative-integer":return/^-\d+$/.test(s)&&a<0?{isValid:!0,message:""}:{isValid:!1,message:"请输入负整数"};case"integer":return/^-?\d+$/.test(s)?{isValid:!0,message:""}:{isValid:!1,message:"请输入整数"};case"negative":return/^-\d+(\.\d+)?$/.test(s)&&a<0?{isValid:!0,message:""}:{isValid:!1,message:"请输入负数"};case"positive":return/^\d+(\.\d+)?$/.test(s)&&a>0?{isValid:!0,message:""}:{isValid:!1,message:"请输入正数"};default:return{isValid:!0,message:""}}},f=t.useState({isValid:!0,message:""}),V=f[0],h=f[1];t.useEffect(function(){if(l&&g){var e=p(g);h(e)}},[l,g]);var N=d||V.message,$=!!N,x=!$&&m;return a("div",{className:"number-input-wrapper",children:[i(r,s({type:"text",value:g,onChange:function(e){var s=e.target.value;if(null==c||c(e),l){var a=p(s);h(a)}},clear:u},v,{className:"".concat(v.className||""," ").concat($?"input-error":"")})),$&&i("div",{className:"input-error-message ".concat($?"visible":""),children:N}),x&&i("div",{className:"input-extra",children:m})]})};export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest as e,__assign as t}from"tslib";import{jsx as o}from"react/jsx-runtime";import i from"react";import r from"./InputBase.js";import s from"../Icon/Icon.js";var n=function(n){var a=n.defaultVisible,u=void 0!==a&&a,l=n.onVisibleChange,m=n.autoComplete,f=void 0===m?"current-password":m,p=e(n,["defaultVisible","onVisibleChange","autoComplete"]),c=i.useState(u),d=c[0],v=c[1];return o(r,t({type:d?"text":"password",suffix:o("div",{className:"input-suffix-content",onClick:function(){var e=!d;v(e),null==l||l(e)},style:{cursor:"pointer"},children:o(s,{type:d?"eye":"eyeOff",size:"medium",color:"#909399"})}),autoComplete:f},p))};export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest as e,__assign as o}from"tslib";import{jsx as r,jsxs as l}from"react/jsx-runtime";import n from"./InputBase.js";import a from"../Icon/Icon.js";var i=function(i){var t=i.type,s=void 0===t?"text":t,c=i.placeholder,u=void 0===c?"搜索":c,d=i.width,p=i.className,h=void 0===p?"":p,f=i.style,y=i.value,m=i.onChange,v=i.onBlur,x=i.onFocus,C=i.disabled,g=void 0!==C&&C,w=i.readOnly,b=void 0!==w&&w,k=i.onSearch,B=i.onClear,N=i.clear,j=void 0!==N&&N,F=i.suffix,I=e(i,["type","placeholder","width","className","style","value","onChange","onBlur","onFocus","disabled","readOnly","onSearch","onClear","clear","suffix"]),O=function(){null==k||k()},S=j?r(a,{type:"search",onClick:O,style:{cursor:"pointer"}}):F;return l("div",{className:"search-input-wrapper ".concat(h),style:o({width:d},f),children:[r(n,o({type:s,placeholder:u,width:"100%",value:y,onChange:m,onBlur:v,onFocus:x,disabled:g,readOnly:b,onKeyDown:function(e){"Enter"===e.key&&(null==k||k())},clear:j,suffix:S},I)),!j&&l("div",{className:"search-input-suffix",children:[y&&r(a,{type:"clear",size:"small",onClick:function(){if(null==B||B(),!B&&m){m({target:{value:""}})}},style:{cursor:"pointer",marginRight:"8px"}}),r(a,{type:"search",onClick:O,style:{cursor:"pointer"}})]})]})};export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import r from"react";import i from"../Icon/Icon.js";var a=function(a){var o=a.placeholder,l=void 0===o?"":o,s=a.width,c=a.height,u=a.className,d=void 0===u?"":u,p=a.style,m=a.value,f=a.defaultValue,h=a.onChange,v=a.onBlur,x=a.onFocus,g=a.onKeyDown,y=a.disabled,b=void 0!==y&&y,w=a.readOnly,z=void 0!==w&&w,N=a.rows,S=void 0===N?4:N,I=a.cols,C=a.maxLength,E=a.showCount,L=void 0!==E&&E,R=a.clear,D=void 0!==R&&R,M=a.extra,j=a.label,B=a.labelGap,H=void 0===B?8:B,W=a.labelClassName,X=void 0===W?"":W,Y=a.labelStyle,F=a.resizable,K=void 0!==F&&F,O=a.resizeHandleSize,V=void 0===O?10:O,$=a.minWidth,k=void 0===$?200:$,G=a.maxWidth,P=void 0===G?2e3:G,T=a.minHeight,q=void 0===T?80:T,A=a.maxHeight,J=void 0===A?800:A,Q=a.onResize,U=r.useState(f||""),Z=U[0],_=U[1],ee=r.useState(!1),te=ee[0],ne=ee[1],re=r.useState(!1),ie=re[0],ae=re[1],oe=r.useRef(null),le=r.useRef(null),se=r.useRef(null),ce=function(e){if(void 0===e)return 0;if("number"==typeof e)return e;var t=String(e).match(/^(\d+)px$/);return t?parseInt(t[1],10):0},ue=function(e){if(void 0===e)return 0;if("number"==typeof e)return e;var t=String(e).match(/^(\d+)px$/);return t?parseInt(t[1],10):0},de=r.useState(ce(s)||0),pe=de[0],me=de[1],fe=r.useState(ue(c)||24*S||80),he=fe[0],ve=fe[1];r.useEffect(function(){if(le.current){var e=ce(s)||le.current.offsetWidth||0,t=ue(c)||24*S||80;me(e),ve(t)}},[]);var xe=void 0!==m,ge=xe?m:Z,ye=(null==ge?void 0:ge.length)||0;r.useEffect(function(){var e=function(e){if(ie&&se.current){var t=e.clientX-se.current.mouseX,n=e.clientY-se.current.mouseY,r=se.current.width+t,i=se.current.height+n;r=Math.max(k,Math.min(P,r)),i=Math.max(q,Math.min(J,i)),me(r),ve(i),null==Q||Q({width:r,height:i})}},t=function(){se.current=null,ae(!1)};return ie&&(document.addEventListener("mousemove",e),document.addEventListener("mouseup",t)),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[ie,k,P,q,J,Q]);var be={display:"inline-flex",flexDirection:"column",width:s?"number"==typeof s?"".concat(s,"px"):s:"100%"},we={position:"relative",display:"flex",alignItems:"flex-start",flex:1,width:K?"number"==typeof pe?"".concat(pe,"px"):pe:void 0},ze=e({width:"100%",height:c?"number"==typeof c?"".concat(c,"px"):c:void 0,resize:"none"},p),Ne=D&&ge&&!b&&!z,Se=K?e(e({},ze),{width:"100%",height:K?"number"==typeof he?"".concat(he,"px"):he:void 0}):ze;return t("div",{className:"textarea-wrapper ".concat(d),style:be,ref:le,children:[(j||L||Ne)&&t("div",{className:"textarea-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[j?n("label",{className:"input-label ".concat(X),style:e({marginRight:"number"==typeof H?"".concat(H,"px"):H},Y),children:j}):null,t("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[Ne&&n("span",{className:"textarea-clear",onClick:function(){if(!b&&!z){xe||_(""),null==h||h({target:{value:""}})}},style:{cursor:"pointer"},children:n(i,{type:"close-circle",size:"small",color:"#909399"})}),L&&C&&t("span",{className:"textarea-count",style:{fontSize:"12px",color:"#909399"},children:[ye,"/",C]})]})]}),t("div",{className:"input-wrapper textarea-input-wrapper ".concat(te?"textarea-input-wrapper-focused":""," ").concat(b?"textarea-input-wrapper-disabled":""," ").concat(ie?"textarea-input-wrapper-resizing":""),style:we,children:[n("textarea",{ref:oe,className:"input-base textarea-base",placeholder:l,value:ge,defaultValue:xe?void 0:f,onChange:function(e){var t=e.target.value;xe||_(t),null==h||h(e)},onBlur:function(e){ne(!1),null==v||v(e)},onFocus:function(e){ne(!0),null==x||x(e)},onKeyDown:g,disabled:b,readOnly:z,rows:S,cols:I,maxLength:C,style:Se}),K&&n("div",{className:"textarea-resize-handle",onMouseDown:function(e){K&&!b&&!z&&le.current&&(e.preventDefault(),e.stopPropagation(),se.current={mouseX:e.clientX,mouseY:e.clientY,width:le.current.offsetWidth,height:le.current.offsetHeight},ae(!0))},style:{position:"absolute",bottom:"0",right:"0",width:"".concat(V,"px"),height:"".concat(V,"px"),cursor:"nwse-resize",zIndex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:n("div",{style:{width:"8px",height:"8px",borderRight:"2px solid #909399",borderBottom:"2px solid #909399"}})})]}),M&&n("div",{className:"input-extra",style:{marginTop:"4px"},children:M})]})};export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{getLabelClassName as t,getLabelStyle as a}from"./styles.js";var o=function(o){var r=o.title,d=o.indicatorColor,e=void 0===d?"blue":d,l=o.indicatorWidth,n=void 0===l?"3px":l,s=o.indicatorHeight,c=void 0===s?"100%":s,m=o.paddingRight,h=void 0===m?"8px":m,p=o.style,g=o.className;return i("label",{className:t({className:g}),style:a({indicatorColor:e,indicatorWidth:n,indicatorHeight:c,paddingRight:h,style:p}),children:r||null})};export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as i}from"tslib";import r from"classnames";var t=function(i){var t=i.className;return r("zjpcy-label","label-wrapper",t)},a=function(r){var t=r.indicatorColor,a=r.indicatorWidth,o=r.indicatorHeight,n=r.paddingRight,e=r.style,l=function(i){return void 0===i?"":"number"==typeof i?"".concat(i,"px"):i},c={"--label-indicator-color":t,"--label-indicator-width":l(a),"--label-indicator-height":l(o),"--label-padding-right":l(n)};return i(i({},c),e)};export{t as getLabelClassName,a as getLabelStyle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import i from"react";import l from"../Icon/Icon.js";import{getLayoutClassName as d,getLayoutStyle as o,getHeaderClassName as s,getHeaderStyle as a,getSiderClassName as r,getSiderStyle as n,getSiderContentClassName as c,getSiderContentStyle as h,getSiderTriggerClassName as m,getSiderTriggerStyle as v,getContentClassName as f,getContentStyle as u,getZeroWidthTriggerClassName as p,getZeroWidthTriggerStyle as y,getFooterClassName as N,getFooterStyle as g}from"./styles.js";import{LayoutProvider as x,useLayoutContext as C}from"./LayoutContext.js";var E=i.createContext({isNested:!1}),W=function(t){var i=t.className,l=void 0===i?"":i,d=t.style,o=void 0===d?{}:d,r=t.children,n=t.height,c=t.fixed,h=void 0!==c&&c,m=t.theme,v=void 0===m?"light":m,f=null!=v?v:"light";return e("header",{className:s({fixed:h,theme:f,className:l}),style:a({height:n,style:o}),"data-theme":f,children:r})},z=function(d){var o=d.className,s=void 0===o?"":o,a=d.style,f=void 0===a?{}:a,u=d.children,p=d.width,y=void 0===p?200:p,N=d.collapsedWidth,g=void 0===N?60:N,x=d.collapsible,E=void 0!==x&&x,W=d.collapsed,z=void 0!==W&&W,S=d.onCollapse,j=d.trigger,w=d.triggerPlacement,M=void 0===w?"bottom":w,b=d.zeroWidthMode,k=void 0!==b&&b,I=d.fixed,L=void 0!==I&&I,P=d.theme,A=void 0===P?"light":P,F=null!=A?A:"light",H=C(),O=H.setSiderCollapsed,R=H.setZeroWidthMode,V=H.setOnExpand;i.useEffect(function(){O(z),R(k)},[z,k,O,R]);var Z=function(){null==S||S(!z)};i.useEffect(function(){V(function(){return Z})},[z,S,V]);var q=k&&z?0:g;return t("aside",{className:r({fixed:L,theme:F,collapsed:z,className:s}),style:n({width:y,collapsedWidth:q,collapsed:z,style:f}),"data-theme":F,children:[e("div",{className:c({collapsed:z}),style:h({}),children:u}),E&&e("div",{className:m({collapsed:z,placement:k?"top":M,zeroWidthMode:k,theme:F}),style:v({}),onClick:Z,children:j||e(l,{type:z?"arrowRight":"arrowLeft",size:20,color:"dark"===F?"#fff":"rgba(0, 0, 0, 0.65)"})})]})},S=function(i){var d=i.className,o=void 0===d?"":d,s=i.style,a=void 0===s?{}:s,r=i.children,n=i.theme,c=void 0===n?"light":n,h=null!=c?c:"light",m=C(),v=m.siderCollapsed,N=m.zeroWidthMode,g=m.onExpand;return t("main",{className:f({theme:h,className:o}),style:u({style:a}),"data-theme":h,children:[N&&v&&e("div",{className:p({}),style:y({}),onClick:g,children:e(l,{type:"menu",size:24,color:"#fff"})}),r]})},j=function(t){var i=t.className,l=void 0===i?"":i,d=t.style,o=void 0===d?{}:d,s=t.children,a=t.height,r=t.fixed,n=void 0!==r&&r,c=t.theme,h=void 0===c?"light":c,m=null!=h?h:"light";return e("footer",{className:N({fixed:n,theme:m,className:l}),style:g({height:a,style:o}),"data-theme":m,children:s})},w=function(t){var l=t.className,s=void 0===l?"":l,a=t.style,r=void 0===a?{}:a,n=t.children,c=t.hasSider,h=t.theme,m=void 0===h?"light":h,v=void 0!==c?c:function(e){return!!e&&i.Children.toArray(e).some(function(e){return i.isValidElement(e)&&e.type===z})}(n),f=i.useState(!1),u=f[0],p=f[1];return i.useEffect(function(){p(!0)},[]),e(x,{children:e(E.Provider,{value:{isNested:!0},children:e("div",{className:d({hasSider:v,theme:m,mounted:u,className:s}),style:o({style:r}),"data-theme":m,children:n})})})};w.Header=W,w.Sider=z,w.Content=S,w.Footer=j;var M=w;export{S as Content,j as Footer,W as Header,z as Sider,M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as t}from"tslib";import e from"classnames";var o=function(t){var o=t.hasSider,a=t.theme,r=t.mounted,c=t.className;return e("zjpcy-layout","zjpcy-layout--".concat(a||"light"),{"zjpcy-layout--has-sider":o,"layout-mounted":r},"layout-wrapper",c)},a=function(e){var o=e.style;return t({},o)},r=function(t){var o=t.fixed,a=t.theme,r=t.className;return e("zjpcy-layout-header","zjpcy-layout-header--".concat(a||"light"),{"zjpcy-layout-header--fixed":o},"layout-header","layout-header-".concat(a||"light"),r)},c=function(e){var o=e.height,a=e.style;return t({height:"number"==typeof o?"".concat(o,"px"):o||"var(--layout-header-height, 64px)"},a)},n=function(t){var o=t.fixed,a=t.theme,r=t.collapsed,c=t.className;return e("zjpcy-layout-sider","zjpcy-layout-sider--".concat(a||"light"),{"zjpcy-layout-sider--fixed":o,collapsed:r},"layout-sider","layout-sider-".concat(a||"light"),c)},l=function(e){var o=e.width,a=e.collapsedWidth,r=e.collapsed,c=e.style,n="number"==typeof o?"".concat(o,"px"):o||"var(--layout-sider-width, 200px)",l=void 0!==a?"".concat(a,"px"):"var(--layout-sider-collapsed-width, 60px)",i=r?l:n;return t({width:i,minWidth:i,maxWidth:i,flex:"0 0 ".concat(i)},c)},i=function(t){var o=t.collapsed,a=t.className;return e("zjpcy-layout-sider-content",{"zjpcy-layout-sider-content--collapsed":o},a)},u=function(e){var o=e.style;return t({},o)},y=function(t){var o=t.collapsed,a=t.placement,r=t.zeroWidthMode,c=t.theme,n=t.className;return e("zjpcy-layout-sider-trigger","zjpcy-layout-sider-trigger--".concat(c||"light"),"zjpcy-layout-sider-trigger--".concat(a||"bottom"),{"zjpcy-layout-sider-trigger--hidden":r&&o},"layout-sider-trigger",n)},d=function(e){var o=e.style;return t({},o)},s=function(t){var o=t.className;return e("zjpcy-layout-zero-width-trigger",o)},p=function(e){var o=e.style;return t({},o)},h=function(t){var o=t.fixed,a=t.theme,r=t.className;return e("zjpcy-layout-content",{"zjpcy-layout-content--fixed":o},"zjpcy-layout-content--".concat(a||"light"),"layout-content","layout-content-".concat(a||"light"),r)},f=function(e){var o=e.style;return t({},o)},g=function(t){var o=t.fixed,a=t.theme,r=t.className;return e("zjpcy-layout-footer","zjpcy-layout-footer--".concat(a||"light"),{"zjpcy-layout-footer--fixed":o},"layout-footer","layout-footer-".concat(a||"light"),r)},m=function(e){var o=e.height,a=e.style;return t({height:"number"==typeof o?"".concat(o,"px"):o||"var(--layout-footer-height, 48px)"},a)};export{h as getContentClassName,f as getContentStyle,g as getFooterClassName,m as getFooterStyle,r as getHeaderClassName,c as getHeaderStyle,o as getLayoutClassName,a as getLayoutStyle,n as getSiderClassName,i as getSiderContentClassName,u as getSiderContentStyle,l as getSiderStyle,y as getSiderTriggerClassName,d as getSiderTriggerStyle,s as getZeroWidthTriggerClassName,p as getZeroWidthTriggerStyle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useState as r,useRef as t,useEffect as i}from"react";import o from"../Icon/Icon.js";var c=function(c){var a=c.announcement,u=c.height,s=void 0===u?40:u,l=c.speed,f=void 0===l?50:l,d=c.backgroundColor,m=void 0===d?"linear-gradient(to right, #e8eaf6 0%, #f5f5f5 50%, #e8eaf6 100%)":d,v=c.visible,p=void 0===v||v,h=c.fixed,x=void 0!==h&&h,g=c.fixedTop,y=void 0===g?0:g,q=c.isIcon,A=void 0===q||q,L=c.onClose;if(!a)return null;var E=r(!0),F=E[0],b=E[1],k=p&&F,C=t(null),I=t(null),N=t(void 0),W=t(!1),j=t(!0);return i(function(){if(k&&C.current&&I.current){var e=C.current,n=I.current;n.style.left="".concat(e.offsetWidth,"px");var r=function(){if(j.current&&n)if(W.current)N.current=requestAnimationFrame(r);else{var t=parseFloat(n.style.left)||0;t<-n.offsetWidth?n.style.left="".concat(e.offsetWidth,"px"):n.style.left="".concat(t-f/100,"px"),N.current=requestAnimationFrame(r)}};N.current=requestAnimationFrame(r);var t=function(){W.current=!0},i=function(){W.current=!1};return e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",i),function(){N.current&&cancelAnimationFrame(N.current),e.removeEventListener("mouseenter",t),e.removeEventListener("mouseleave",i)}}},[f,a,k]),k?e("div",{ref:C,className:"marquee-container ".concat(x?"marquee-container-fixed":""),style:{height:"".concat(s,"px"),background:m,top:x?"".concat(y,"px"):void 0},children:[n("div",{ref:I,className:"marquee-text",children:Array.isArray(a)?n("span",{children:a.map(function(r,t){return e("span",{style:0==t?{}:{marginLeft:"100px"},children:[n("span",{style:{marginRight:"5px"},children:A?"📢":null}),r]},t)})}):a}),n("div",{className:"marquee-close",style:{height:"".concat(s,"px"),width:"45px",background:m},onClick:function(){j.current=!1,b(!1),L&&L()},onMouseEnter:function(){W.current=!0},onMouseLeave:function(){W.current=!1},children:n(o,{type:"close",size:18,color:"#666"})})]}):null};export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__assign as n}from"tslib";import{jsx as t}from"react/jsx-runtime";import{useRef as r,useState as e,useEffect as o,useMemo as c}from"react";var i=function(i){var u=i.items,a=i.columns,l=void 0===a?3:a,s=i.gutter,f=void 0===s?20:s,m=i.className,y=i.style,p=i.classNames,v=void 0===p?{}:p,d=i.styles,h=void 0===d?{}:d,x=i.onLayoutChange,w=r(null),g=e(3),j=g[0],N=g[1],z=e(20),b=z[0],A=z[1],E=function(n,t,r){if(null!==n&&"object"==typeof n&&!Array.isArray(n)){for(var e=n,o=0,c=Object.keys(e).map(Number).sort(function(n,t){return t-n});o<c.length;o++){var i=c[o];if(r>=i&&e.hasOwnProperty(i))return e[i]}return t}return n};o(function(){var n,t=function(){clearTimeout(n),n=window.setTimeout(function(){if(w.current){var n=w.current.offsetWidth,t=E(l,3,n),r=E(f,20,n);N(t),A(r),x&&x(t,u)}},100)};return t(),window.addEventListener("resize",t),function(){clearTimeout(n),window.removeEventListener("resize",t)}},[l,f,u,x]);var L=c(function(){var n=Array.from({length:j},function(){return[]});return u.filter(function(t){return!(void 0!==t.column&&t.column>=0&&t.column<j)||(n[t.column].push(t),!1)}).forEach(function(t,r){n[r%j].push(t)}),n},[u,j]),T=function(n,t){var r=v[n];return"function"==typeof r?r(t):r||""},k=function(n,t){var r=h[n];return"function"==typeof r?r(t):r||{}};return t("div",{ref:w,className:"zjpcy-masonry ".concat(m||""," ").concat(T("container",0)),style:n(n({display:"flex",gap:"".concat(b,"px")},y),k("container",0)),children:L.map(function(r,e){return t("div",{className:"zjpcy-masonry-column ".concat(T("column",e)),style:n({flex:1,display:"flex",flexDirection:"column",gap:"".concat(b,"px")},k("column",e)),children:r.map(function(r,e){return t("div",{className:"zjpcy-masonry-item ".concat(T("item",e)),style:n({},k("item",e)),children:r.content},r.key)})},"column-".concat(e))})})};export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__spreadArray as e}from"tslib";import{jsxs as n,jsx as i,Fragment as t}from"react/jsx-runtime";import l,{useCallback as c,useRef as r,useState as o,useMemo as a,useEffect as m}from"react";import u from"classnames";import{useClickOutside as p}from"../Hooks/useClickOutside.js";var s=function(e){var n,i=e.trim();return i&&(null===(n=Array.from(i)[0])||void 0===n?void 0:n.toUpperCase())||""},d=l.memo(function(e){var l,r,a,p=e.item,y=e.level,h=e.mode,v=e.collapsed,z=e.theme,f=e.openKeySet,j=e.selectedKey,b=e.onItemClick,g=e.onToggleOpen,k=!!p.children&&p.children.length>0,w=f.has(p.key),N=j===p.key,C="horizontal"===h,K="inline"===h,x="vertical-flat"===h,O=0===y,S=c(function(e){e.stopPropagation(),p.disabled||(k&&!x&&g(p.key),x&&k||b(p,p.key))},[p,b,g,k,x]),T=C&&O?16:K?12+24*y:v?0:12+16*y,A=w&&(!v||C),I=function(e){var n=o(e),i=n[0],t=n[1],l=o(e),c=l[0],r=l[1];return m(function(){var n;return e?(r(!0),n=requestAnimationFrame(function(){t(!0)})):(t(!1),n=setTimeout(function(){r(!1)},150)),function(){"number"==typeof n?cancelAnimationFrame(n):clearTimeout(n)}},[e]),{isVisible:i,shouldRender:c}}(A&&C&&O),F=I.isVisible,H=I.shouldRender,M=k&&(!v||!O)&&!x,R=z||"light",V=u("zjpcy-menu-item-wrapper",{"zjpcy-menu-item-wrapper-root":O,"zjpcy-menu-item-wrapper-collapsed":v&&O}),q=u("zjpcy-menu-item",((l={})["zjpcy-menu-item-".concat(R)]=!0,l["zjpcy-menu-item-".concat(R,"-selected")]=N,l["zjpcy-menu-item-".concat(R,"-selected-vertical")]=N&&("vertical"===h||"inline"===h||"vertical-flat"===h),l["zjpcy-menu-item-disabled"]=p.disabled,l["zjpcy-menu-item-has-children"]=k,l["zjpcy-menu-item-has-children-selected"]=k&&N,l["zjpcy-menu-item-".concat(R,"-has-children")]=k,l["zjpcy-menu-item-root"]=O,l["zjpcy-menu-item-collapsed"]=v&&O,l)),B=u("zjpcy-menu-item-icon",{"zjpcy-menu-item-icon-collapsed":v}),P=u("zjpcy-menu-item-arrow",{"zjpcy-menu-item-arrow-open":A,"zjpcy-menu-item-arrow-horizontal":C,"zjpcy-menu-item-arrow-horizontal-open":A&&C}),U=u("zjpcy-menu-submenu-wrapper",((r={})["zjpcy-menu-submenu-wrapper-".concat(h)]=!0,r["zjpcy-menu-submenu-wrapper-horizontal-popup"]=C&&O,r["zjpcy-menu-submenu-wrapper-vertical-flat"]=x,r["zjpcy-menu-submenu-wrapper-vertical-flat-container"]=x,r));return n("div",{className:V,children:[i("div",{className:q,style:{padding:"0px ".concat(T,"px")},title:v&&O?p.label:void 0,onClick:S,children:n("div",{className:"zjpcy-menu-item-content",children:[v?i(t,{children:p.icon?i("span",{className:B,children:p.icon}):i("span",{className:"zjpcy-menu-item-collapsed-label",children:s(p.label)})}):n(t,{children:[p.icon&&i("span",{className:"zjpcy-menu-item-icon",children:p.icon}),n("div",{className:"zjpcy-menu-item-text",children:[i("span",{className:"zjpcy-menu-item-label",children:p.label}),p.description&&!k&&i("span",{className:"zjpcy-menu-item-description",children:p.description})]})]}),M&&i("span",{className:P,children:i("svg",{viewBox:"0 0 1024 1024",width:"10",height:"10",fill:"currentColor",children:i("path",{d:"M840.4 300H183.6c-19.7 0-30.7 25.7-18.5 40.5l328.4 402.4c9.4 11.6 26.7 11.6 36.1 0l328.4-402.4c12.2-14.8 1.2-40.5-18.5-40.5z"})})})]})}),k&&(!C||!O||H)&&i("div",{className:U,children:i("div",{className:x?"zjpcy-menu-submenu-vertical-flat zjpcy-menu-submenu-vertical-flat-open":C&&O?u("zjpcy-menu-submenu-horizontal-popup",{"zjpcy-menu-submenu-horizontal-popup-open":F}):K?u("zjpcy-menu-submenu-inline",{"zjpcy-menu-submenu-inline-open":A}):u("zjpcy-menu-submenu-vertical",{"zjpcy-menu-submenu-vertical-open":A}),children:i("div",{className:"zjpcy-menu-submenu-content",children:null===(a=p.children)||void 0===a?void 0:a.map(function(e){return i(d,{item:e,level:y+1,mode:h,collapsed:v,theme:z,openKeySet:f,selectedKey:j,onItemClick:b,onToggleOpen:g},e.key)})})})})]})});d.displayName="MenuItemComponent";var y=function(n){var t,l=n.mode,s=void 0===l?"vertical":l,y=n.items,h=n.className,v=void 0===h?"":h,z=n.style,f=n.selectedKey,j=n.defaultOpenKeys,b=void 0===j?[]:j,g=n.openKeys,k=n.collapsed,w=void 0!==k&&k,N=n.open,C=n.theme,K=void 0===C?"light":C,x=n.onChange,O=n.onOpenChange,S=r(null),T=o(!0)[0],A=o(b),I=A[0],F=A[1],H=o(""),M=H[0],R=H[1],V=void 0!==g,q=void 0!==f,B=V?g:I,P=q?f:M,U=void 0!==N?N:T,D=a(function(){return new Set(B)},[B]);m(function(){void 0!==f&&R(f)},[f]),m(function(){if(P&&!V&&"horizontal"!==s&&"vertical-flat"!==s){var n=function(i,t,l){void 0===l&&(l=[]);for(var c=0,r=i;c<r.length;c++){var o=r[c];if(o.key===t)return l;if(o.children&&o.children.length>0){var a=n(o.children,t,e(e([],l,!0),[o.key],!1));if(a.length>0)return a}}return[]},i=n(y,P);i.length>0&&F(function(n){var t=new Set(e(e([],n,!0),i,!0));return Array.from(t)})}},[P,y,V,s]);var E=c(function(e,n){q||R(n),null==x||x(e,n),"horizontal"===s&&(!e.children||0===e.children.length)&&B.length>0&&(V||F([]),null==O||O([]))},[x,q,s,B.length,V,O]),G=c(function(n){if(V){var i=D.has(n)?B.filter(function(e){return e!==n}):e(e([],B,!0),[n],!1);null==O||O(i)}else F(function(i){var t=i.includes(n)?i.filter(function(e){return e!==n}):e(e([],i,!0),[n],!1);return null==O||O(t),t})},[D,B,V,O]),J="horizontal"!==s&&w;if(p(S,c(function(){"horizontal"===s&&B.length>0&&(V||F([]),null==O||O([]))},[s,B.length,V,O])),!U)return null;var L=u("zjpcy-menu","zjpcy-menu-".concat(K),((t={})["zjpcy-menu-".concat(s)]=!0,t["zjpcy-menu-".concat(s,"-collapsed")]=J,t["zjpcy-menu-dark-vertical-flat"]="dark"===K&&"vertical-flat"===s,t),v);return i("div",{ref:S,className:L,style:z,role:"menu",children:y.map(function(e){return i(d,{item:e,level:0,mode:s,collapsed:J,theme:K,openKeySet:D,selectedKey:P,onItemClick:E,onToggleOpen:G},e.key)})})};export{y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__spreadArray as n}from"tslib";import{jsxs as t,jsx as e}from"react/jsx-runtime";import{createContext as r,useState as o,useCallback as i,useContext as u}from"react";import{createRoot as c}from"react-dom/client";import f from"./Message.js";var s=0,a=new Map,l=function(n){var t=a.get(n);if(t){var e=t.container;t.root.unmount(),document.body.contains(e)&&document.body.removeChild(e),a.delete(n)}},d=function(n,t,r){void 0===r&&(r=3e3);var o=++s,i=function(){var n=document.createElement("div");return n.style.position="fixed",n.style.top="20px",n.style.left="50%",n.style.transform="translateX(-50%)",n.style.zIndex="1050",n.style.pointerEvents="none",document.body.appendChild(n),n}(),u=c(i);u.render(e(f,{type:n,content:t,duration:r,onClose:function(){l(o)}})),a.set(o,{container:i,root:u});var d=setTimeout(function(){l(o)},r);return{close:function(){clearTimeout(d),l(o)}}},m={success:function(n,t){d("success",n,t)},warning:function(n,t){d("warning",n,t)},error:function(n,t){d("error",n,t)},info:function(n,t){d("info",n,t)},close:function(){a.forEach(function(n,t){return l(t)})}},p=r({message:null}),v=function(r){var u=r.children,c=o([]),s=c[0],a=c[1],l=o(0),d=l[0],m=l[1],v=i(function(t,e,r){void 0===r&&(r=3e3);var o=d;m(function(n){return n+1}),a(function(i){return n(n([],i,!0),[{id:o,type:t,content:e,duration:r}],!1)});var i=setTimeout(function(){u(o)},r),u=function(n){a(function(t){return t.filter(function(t){return t.id!==n})})};return{close:function(){clearTimeout(i),u(o)}}},[d]),y={success:function(n,t){return v("success",n,t)},warning:function(n,t){return v("warning",n,t)},error:function(n,t){return v("error",n,t)},info:function(n,t){return v("info",n,t)},close:function(){return a([])}};return t(p.Provider,{value:{message:y},children:[u,s.map(function(n){return e(f,{type:n.type,content:n.content,duration:n.duration,onClose:function(){return a(function(t){return t.filter(function(t){return t.id!==n.id})})}},n.id)})]})},y=function(){var n=u(p);return(null==n?void 0:n.message)?n.message:m};export{v as MessageProvider,f as default,m as message,y as useMessage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__assign as o}from"tslib";import{jsx as n,jsxs as e}from"react/jsx-runtime";import{useState as i,useRef as t,useEffect as r}from"react";import{createPortal as c}from"react-dom";import a from"classnames";import l from"../Icon/Icon.js";import d from"../Flex/index.js";import m from"../Button/Button.js";var s=function(s){var u,p=s.visible,v=s.title,y=void 0===v?"标题":v,f=s.width,h=void 0===f?600:f,g=s.height,j=void 0===g?"auto":g,x=s.headerHeight,z=void 0===x?40:x,b=s.footerHeight,N=void 0===b?40:b,w=s.confirmLoading,k=void 0!==w&&w,C=s.direction,H=void 0===C?"normal":C,T=s.top,_=s.triggerRef,I=s.onCancel,B=s.onOk,W=s.children,L=s.footer,O=void 0===L?null:L,E=s.bordered,R=void 0!==E&&E,S=s.className,F=s.style,M=s.okText,P=void 0===M?"确认":M,X=s.cancelText,Y=void 0===X?"取消":X,$=s.getContainer,q=void 0===$?function(){return document.body}:$,A=s.maskStyle,D=s.maskClassName,G=s.zIndex,J=void 0===G?1e3:G,K=s.contentClassName,Q=s.contentStyle,U=s.destroyOnClose,V=void 0!==U&&U,Z=s.loading,oo=void 0!==Z&&Z,no=s.loadingIcon,eo=i(!1),io=eo[0],to=eo[1],ro=i(!1),co=ro[0],ao=ro[1],lo=i(!1),mo=lo[0],so=lo[1],uo=i({x:0,y:0}),po=uo[0],vo=uo[1],yo=t(null),fo=H,ho=function(o){if("number"==typeof o)return o;var n=o.match(/^(\d+)px$/);return n?parseInt(n[1],10):0},go=function(){var o=function(){if(null==_?void 0:_.current){var o=_.current.getBoundingClientRect();return{x:o.left+o.width/2,y:o.top+o.height/2}}return yo.current||null}();if(!o||"undefined"==typeof window)return{x:0,y:0};if(void 0!==T||"normal"===fo){var n=window.innerWidth/2,e=void 0!==T?T+(j?ho(j)/2:0):window.innerHeight/2;return{x:o.x-n,y:o.y-e}}if("center"===fo){n=window.innerWidth/2;var i=window.innerHeight/2;return{x:o.x-n,y:o.y-i}}return{x:0,y:0}};r(function(){var o=function(o){yo.current={x:o.clientX,y:o.clientY}};return document.addEventListener("mousedown",o,!0),function(){document.removeEventListener("mousedown",o,!0)}},[]),r(function(){if(p){var o=go();vo(o),ao(!1),to(!0);var n=setTimeout(function(){so(!0)},30);return function(){return clearTimeout(n)}}ao(!0),so(!1);var e=setTimeout(function(){to(!1),ao(!1)},400);return function(){return clearTimeout(e)}},[p,400,j,T,V]);var jo=function(){ao(!0);var o=setTimeout(function(){to(!1),ao(!1),null==I||I()},400);return function(){return clearTimeout(o)}},xo=function(){null==B||B()},zo=o(((u={width:"number"==typeof h?"".concat(h,"px"):h,top:void 0!==T?"".concat(T,"px"):void 0})["--zjpcy-modal-origin-x"]="".concat(po.x,"px"),u["--zjpcy-modal-origin-y"]="".concat(po.y,"px"),u.visibility=mo?"visible":"hidden",u),F),bo={height:"number"==typeof z?"".concat(z,"px"):z},No=j?ho(j):0,wo=ho(z),ko=ho(N),Co=No>0?Math.max(0,No-wo-ko):void 0,Ho=o({},Q);if(!Ho.maxHeight&&j){var To=ho(j);Ho.maxHeight="".concat(To,"px")}!Ho.maxHeight&&Co&&(Ho.maxHeight="".concat(Co,"px"));var _o={height:"number"==typeof N?"".concat(N,"px"):N},Io=function(){if(!io&&!co)return null;var i=o({zIndex:J},A);return n("div",{className:a("zjpcy-modal-overlay",{"zjpcy-modal-overlay--visible":io&&!co,"zjpcy-modal-overlay--closing":co,"zjpcy-modal-overlay--custom-top":void 0!==T},S,D),onClick:jo,style:i,children:e("div",{className:a("zjpcy-modal-container",{"zjpcy-modal-container--normal":mo&&!co&&("normal"===fo||void 0!==T),"zjpcy-modal-container--center":mo&&!co&&"center"===fo&&void 0===T,"zjpcy-modal-container--top-right":mo&&!co&&"top-right"===fo&&void 0===T,"zjpcy-modal-container--bottom-right":mo&&!co&&"bottom-right"===fo&&void 0===T,"zjpcy-modal-container--bottom-left":mo&&!co&&"bottom-left"===fo&&void 0===T,"zjpcy-modal-container--closing-normal":co&&("normal"===fo||void 0!==T),"zjpcy-modal-container--closing-center":co&&"center"===fo&&void 0===T,"zjpcy-modal-container--closing-top-right":co&&"top-right"===fo&&void 0===T,"zjpcy-modal-container--closing-bottom-right":co&&"bottom-right"===fo&&void 0===T,"zjpcy-modal-container--closing-bottom-left":co&&"bottom-left"===fo&&void 0===T,"zjpcy-modal-container--bordered":R,"zjpcy-modal-container--has-height":void 0!==j}),style:zo,onClick:function(o){return o.stopPropagation()},children:[oo?n("div",no?{className:"zjpcy-modal-loading",children:n("div",{className:"zjpcy-modal-loading-content",children:no})}:{className:"zjpcy-modal-loading",children:n("div",{className:"zjpcy-modal-loading-content",children:n("div",{className:"zjpcy-modal-loading-spinner",children:e("svg",{viewBox:"0 0 24 24",className:"zjpcy-modal-loading-icon",children:[n("circle",{className:"zjpcy-modal-loading-track",cx:"12",cy:"12",r:"10",fill:"none",strokeWidth:"2"}),n("circle",{className:"zjpcy-modal-loading-indicator",cx:"12",cy:"12",r:"10",fill:"none",strokeWidth:"2"})]})})})}):null,e("div",{className:"zjpcy-modal-header",style:bo,children:[n("div",{className:"zjpcy-modal-header__left",children:n("span",{className:"zjpcy-modal-header__title",children:y})}),n("div",{className:"zjpcy-modal-header__right",children:n("div",{className:"zjpcy-modal-close-btn",onClick:jo,children:n(l,{type:"close",size:20,color:"currentColor"})})})]}),io&&n("div",{className:a("zjpcy-modal-content",K),style:Ho,children:V&&co?null:W}),n(d,{className:"zjpcy-modal-footer",align:"center",justify:"flex-end",style:Object.assign({},_o,{padding:"0px 10px"}),gap:12,children:null===O?e(d,{className:"zjpcy-modal-footer__actions",justify:"flex-end",gap:12,children:[n(m,{variant:"secondary",onClick:jo,disabled:k,children:Y||"取消"}),n(m,{variant:"primary",onClick:xo,loading:k,children:P||"确认"})]}):O})]})})}();if(!Io)return null;if(!1===q)return Io;var Bo="function"==typeof q?q():q;return Bo?c(Io,Bo):Io};export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__assign as t}from"tslib";import{jsx as e,jsxs as n}from"react/jsx-runtime";import{useState as i,useRef as o,useEffect as c}from"react";var a=function(t){switch(t){case"success":return e("i",{className:"fas fa-check-circle"});case"warning":return e("i",{className:"fas fa-exclamation-triangle"});case"error":return e("i",{className:"fas fa-times-circle"});default:return e("i",{className:"fas fa-info-circle"})}},r=function(r){var s=r.message,u=r.duration,f=void 0===u?3e3:u,l=r.type,m=void 0===l?"info":l,d=r.position,p=void 0===d?"center":d,v=r.color,h=r.top,g=r.open,k=r.clickOutsideToClose,x=void 0!==k&&k,N=r.onClose,T=void 0!==g,b=i(!0),w=b[0],C=b[1],y=i(!0),E=y[0],L=y[1],j=o(null),O=T?g:w;if(c(function(){var t=function(t){x&&j.current&&!j.current.contains(t.target)&&(L(!1),setTimeout(function(){N&&N(),T||C(!1)},500))};return x&&O&&document.addEventListener("click",t),function(){document.removeEventListener("click",t)}},[x,O,T,N]),c(function(){T&&(g?L(!0):(L(!1),setTimeout(function(){N&&N()},500)))},[g,T,N]),c(function(){if(O){var t=setTimeout(function(){L(!1),setTimeout(function(){N&&N(),T||C(!1)},500)},f);return function(){return clearTimeout(t)}}},[f,O,T,N]),!O||!E)return null;var W="notification-".concat(m),X=v?"notification-custom":"",q=function(){var t={};if(void 0!==h)if(t.top="".concat(h,"px"),p.startsWith("top-"))switch(p){case"top-left":t.left="20px",t.right="auto";break;case"top-center":t.left="50%",t.transform="translateX(-50%)",t.right="auto";break;case"top-right":t.right="20px",t.left="auto"}else t.right="20px",t.left="auto",t.bottom="auto";return t}(),z=t({backgroundColor:v},q),A=void 0===h?"notification-".concat(p):"";return e("div",{ref:j,className:"notification ".concat(W," ").concat(A," ").concat(X," ").concat(E?"fade-in":"fade-out"),style:z,children:n("div",{className:"notification-content",children:[a(m),e("span",{children:s})]})})};export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{__assign as t,__awaiter as o,__generator as e}from"tslib";import{jsxs as i,Fragment as n,jsx as r}from"react/jsx-runtime";import{useState as c,useRef as p,useEffect as a,cloneElement as l}from"react";import{createPortal as s}from"react-dom";import f from"classnames";import d from"../Icon/Icon.js";import m from"../Button/Button.js";var h=function(h){var u=h.title,g=void 0===u?"确认删除吗?":u,v=h.description,y=h.okText,b=void 0===y?"确定":y,w=h.cancelText,z=void 0===w?"取消":w,j=h.okButtonProps,B=void 0===j?{}:j,L=h.cancelButtonProps,k=void 0===L?{}:L,T=h.onConfirm,R=h.onCancel,C=h.disabled,N=void 0!==C&&C,x=h.icon,E=h.type,P=void 0===E?"warning":E,D=h.placement,I=void 0===D?"top":D,H=h.showCancel,W=void 0===H||H,q=h.getContainer,A=void 0===q?function(){return document.body}:q,F=h.className,G=h.style,J=h.children,K=c(!1),M=K[0],O=K[1],Q=c(!1),S=Q[0],U=Q[1],V=c({top:0,left:0}),X=V[0],Y=V[1],Z=p(null),$=p(null),_={top:"zjpcy-popconfirm-top",bottom:"zjpcy-popconfirm-bottom",left:"zjpcy-popconfirm-left",right:"zjpcy-popconfirm-right",topLeft:"zjpcy-popconfirm-topLeft",topRight:"zjpcy-popconfirm-topRight",bottomLeft:"zjpcy-popconfirm-bottomLeft",bottomRight:"zjpcy-popconfirm-bottomRight",leftTop:"zjpcy-popconfirm-leftTop",leftBottom:"zjpcy-popconfirm-leftBottom",rightTop:"zjpcy-popconfirm-rightTop",rightBottom:"zjpcy-popconfirm-rightBottom"},tt=function(){if(Z.current&&$.current){var t=Z.current.getBoundingClientRect(),o=$.current.getBoundingClientRect(),e=0,i=0;switch(I){case"top":case"topLeft":case"topRight":e=t.top-o.height-8,i=t.left+(t.width-o.width)/2,"topLeft"===I?i=t.left:"topRight"===I&&(i=t.right-o.width);break;case"bottom":case"bottomLeft":case"bottomRight":e=t.bottom+8,i=t.left+(t.width-o.width)/2,"bottomLeft"===I?i=t.left:"bottomRight"===I&&(i=t.right-o.width);break;case"left":case"leftTop":case"leftBottom":e=t.top+(t.height-o.height)/2,i=t.left-o.width-8,"leftTop"===I?e=t.top:"leftBottom"===I&&(e=t.bottom-o.height);break;case"right":case"rightTop":case"rightBottom":e=t.top+(t.height-o.height)/2,i=t.right+8,"rightTop"===I?e=t.top:"rightBottom"===I&&(e=t.bottom-o.height)}var n=window.innerWidth,r=window.innerHeight;i<10&&(i=10),i+o.width>n-10&&(i=n-o.width-10),e<10&&(e=10),e+o.height>r-10&&(e=r-o.height-10),Y({top:e,left:i})}},ot=function(t){N||(t&&t.preventDefault&&t.preventDefault(),t&&t.stopPropagation&&t.stopPropagation(),O(!0))},et=function(){return o(void 0,void 0,void 0,function(){return e(this,function(t){switch(t.label){case 0:if(!T)return[3,5];U(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,T()];case 2:return t.sent(),O(!1),[3,4];case 3:return U(!1),[7];case 4:return[3,6];case 5:O(!1),t.label=6;case 6:return[2]}})})},it=function(){R&&R(),O(!1)},nt=function(t){$.current&&!$.current.contains(t.target)&&Z.current&&!Z.current.contains(t.target)&&O(!1)};a(function(){if(M){setTimeout(function(){tt()},0),document.addEventListener("mousedown",nt);var t=function(){return tt()},o=function(){return tt()};return window.addEventListener("scroll",t,!0),window.addEventListener("resize",o),function(){document.removeEventListener("mousedown",nt),window.removeEventListener("scroll",t,!0),window.removeEventListener("resize",o)}}},[M,I]);var rt,ct;return i(n,{children:[(rt=J,ct=rt.props||{},r("span",{ref:Z,style:{display:"inline-block"},children:l(rt,t(t({},ct),{onClick:ot}))})),function(){if(!M)return null;var o,e=i("div",{ref:$,className:f("zjpcy-popconfirm","zjpcy-popconfirm-visible",_[I],"zjpcy-popconfirm--".concat(P),F),style:t({position:"fixed",top:"".concat(X.top,"px"),left:"".concat(X.left,"px")},G),children:[r("div",{className:"zjpcy-popconfirm-arrow"}),i("div",{className:"zjpcy-popconfirm-inner",children:[i("div",{className:"zjpcy-popconfirm-header",children:[r("span",{style:{display:x?"inline-block":"none"},className:"zjpcy-popconfirm-icon",children:x||(o={info:{type:"info-circle",color:"#1890ff"},success:{type:"check-circle",color:"#52c41a"},warning:{type:"warning-circle",color:"#faad14"},error:{type:"close-circle",color:"#f5222d"},danger:{type:"close-circle",color:"#f5222d"}}[P],r(d,{type:o.type,size:18,color:o.color}))}),r("span",{className:"zjpcy-popconfirm-title",children:g})]}),v&&r("div",{className:"zjpcy-popconfirm-description",children:v}),i("div",{className:"zjpcy-popconfirm-actions",children:[W&&r(m,{variant:k.variant||"secondary",onClick:it,disabled:k.disabled||S,size:"small",children:z}),r(m,{variant:B.variant||"primary",onClick:et,loading:B.loading||S,disabled:B.disabled,size:"small",children:b})]})]})]});if(!1===A)return e;var n="function"==typeof A?A():A;return n?s(e,n):e}()]})};export{h as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as r}from"tslib";import{jsxs as e,jsx as s,Fragment as n}from"react/jsx-runtime";import c from"classnames";import o from"../Icon/Icon.js";var t=function(t){var i,a,p,l=t.percent,d=void 0===l?0:l,f=t.type,g=void 0===f?"line":f,u=t.status,m=t.showInfo,y=void 0===m||m,h=t.format,v=t.strokeColor,j=void 0===v?"#1890ff":v,z=t.trailColor,x=void 0===z?"gainsboro":z,b=t.strokeWidth,k=t.size,N=void 0===k?"default":k,w=t.transition,M=void 0===w||w,C=t.steps,I=t.segments,W=t.icon,D=t.prefix,A=t.suffix,B=t.children,G=t.className,L=t.style,P=u||(d>=100?"success":d<0?"exception":"normal"),q=function(){return h?h(d):"".concat(Math.floor(d),"%")},E=function(r){return"object"==typeof r&&"from"in r&&"to"in r},F=function(){return"success"===P?"#52c41a":"exception"===P?"#ff4d4f":E(j)?j.from:j},H=function(){return W||("success"===P?s(o,{type:"check-circle",style:{color:"#52c41a"}}):"exception"===P?s(o,{type:"close-circle",style:{color:"#ff4d4f"}}):null)};if("circle"===g||"dashboard"===g){var J=50-(b||6),K=2*Math.PI*J,O=K-d/100*K,Q="success"===P?"#52c41a":"exception"===P?"#ff4d4f":j,R=E(Q)?(a=(i=Q).from,p=i.to,"from-".concat(a.replace("#",""),"-to-").concat(p.replace("#",""))):null;return e("div",{className:c("zjpcy-progress","zjpcy-progress-circle",G),style:L,children:[e("svg",{width:120,height:120,viewBox:"0 0 120 120",style:{transform:"rotate(-90deg)"},children:[R&&s("defs",{children:e("linearGradient",{id:R,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[s("stop",{offset:"0%",stopColor:Q.from}),s("stop",{offset:"100%",stopColor:Q.to})]})}),s("circle",{cx:60,cy:60,r:J,stroke:x,strokeWidth:b||6,fill:"none"}),s("circle",{cx:60,cy:60,r:J,stroke:R?"url(#".concat(R,")"):F(),strokeWidth:b||6,fill:"none",strokeDasharray:K,strokeDashoffset:O,strokeLinecap:"round",style:{transition:M?"stroke-dashoffset 0.3s cubic-bezier(0.34, 0.69, 0.1, 1)":"none"}})]}),y&&s("div",{className:"zjpcy-progress-info",children:B||e(n,{children:[H(),D,q(),A]})})]})}var S=function(r){var e=r.color;if(E(e)){var s=e.from,n=e.to,c=e.direction;return{background:"linear-gradient(".concat(void 0===c?"to right":c,", ").concat(s,", ").concat(n,")")}}return{backgroundColor:e}};return e("div",{className:c("zjpcy-progress","zjpcy-progress-".concat(N),"zjpcy-progress-line",{"zjpcy-progress-success":"success"===P},{"zjpcy-progress-exception":"exception"===P},{"zjpcy-progress-steps":C&&C>0},{"zjpcy-progress-has-segments":I&&I.length>0},G),style:L,children:[s("div",{className:"zjpcy-progress-wrapper",children:s("div",{className:"zjpcy-progress-outer",children:C&&C>0?function(){if(!C||C<=0)return null;var r=d/100,e=Math.min(1,Math.max(0,r)),n=Array.from({length:C},function(r,n){var o=n/C,t=(n+1)/C;return s("div",{className:c("zjpcy-progress-step",{"zjpcy-progress-step--completed":e>=t,"zjpcy-progress-step--current":e>o&&e<t,"zjpcy-progress-step--pending":e<=o,"zjpcy-progress-step--success":e>=1}),style:{transition:M?"all var(--zjpcy-transition-duration) var(--zjpcy-transition-timing-function)":"none"}},n)});return s("div",{className:"zjpcy-progress-steps",children:n})}():I&&I.length>0?function(){if(!I||0===I.length)return null;var e=I.reduce(function(r,e){return r+e.percent},0),n=void 0===d||0===d?e:d,o=e>0?n/e:n/100,t=Math.min(1,Math.max(0,o)),i=0,a=I.map(function(n,o){var a=n.percent,p=i/e,l=(i+a)/e;i+=a;var d=t<=p;return s("div",{className:c("zjpcy-progress-segment",{"zjpcy-progress-segment--completed":t>=l,"zjpcy-progress-segment--current":t>p&&t<l,"zjpcy-progress-segment--pending":d}),style:r(r({width:"".concat(a,"%")},d?{}:S(n)),{transition:M?"all var(--zjpcy-transition-duration) var(--zjpcy-transition-timing-function)":"none"})},o)}),p=100-e;return p>0&&a.push(s("div",{className:"zjpcy-progress-segment zjpcy-progress-segment--remaining",style:{width:"".concat(p,"%"),backgroundColor:"gainsboro",transition:M?"all var(--zjpcy-transition-duration) var(--zjpcy-transition-timing-function)":"none"}},"remaining")),s("div",{className:"zjpcy-progress-segments",children:a})}():s("div",{className:"zjpcy-progress-inner",style:{background:x},children:s("div",{className:c("zjpcy-progress-bg",{"zjpcy-progress-bg--success":"success"===P,"zjpcy-progress-bg--exception":"exception"===P,"zjpcy-progress-bg--animated":function(){var r="success"===P?"#52c41a":"exception"===P?"#ff4d4f":j;return E(r)&&!0===r.animated}()}),style:r(r({width:"".concat(Math.min(100,Math.max(0,d)),"%"),backgroundColor:E(j)?void 0:F()},function(){var r="success"===P?"#52c41a":"exception"===P?"#ff4d4f":j;if(E(r)){var e=r.from,s=r.to,n=r.direction;return{background:"linear-gradient(".concat(void 0===n?"to right":n,", ").concat(e,", ").concat(s,")")}}return{}}()),{transition:M?"width 0.3s cubic-bezier(0.34, 0.69, 0.1, 1)":"none"})})})})}),y&&e("div",{className:"zjpcy-progress-info",children:[H()&&s("span",{className:"zjpcy-progress-icon",children:H()}),D&&s("span",{className:"zjpcy-progress-prefix",children:D}),s("span",{children:q()}),A&&s("span",{className:"zjpcy-progress-suffix",children:A})]})]})};export{t as default};
|