tango-ui-cw 0.9.6 → 0.9.8
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 +2 -2
- package/dist/component/CSSFab/useTangoStyle.js +1 -0
- package/dist/component/CSSFab/useTangoStyle.mjs +1 -0
- package/dist/component/MaterialButton/index.js +1 -0
- package/dist/component/MaterialButton/index.mjs +1 -0
- package/dist/component/MaterialInput/index.js +1 -0
- package/dist/component/MaterialInput/index.mjs +1 -0
- package/dist/component/TBanner/index.js +1 -0
- package/dist/component/TBanner/index.mjs +1 -0
- package/dist/component/TButton/index.js +1 -0
- package/dist/component/TButton/index.mjs +1 -0
- package/dist/component/TColorPicker/TColorPicker.module.css.js +1 -1
- package/dist/component/TColorPicker/TColorPicker.module.css.mjs +7 -7
- package/dist/component/TColorPicker/index.js +1 -0
- package/dist/component/TColorPicker/index.mjs +1 -0
- package/dist/component/TDate/index.js +1 -0
- package/dist/component/TDate/index.mjs +1 -0
- package/dist/component/TDatePicker/TDatePicker.module.css.js +1 -1
- package/dist/component/TDatePicker/TDatePicker.module.css.mjs +40 -4
- package/dist/component/TDatePicker/index.js +2 -1
- package/dist/component/TDatePicker/index.mjs +160 -33
- package/dist/component/TDrawer/TDrawer.module.css.js +1 -1
- package/dist/component/TDrawer/TDrawer.module.css.mjs +37 -33
- package/dist/component/TDrawer/index.js +2 -1
- package/dist/component/TDrawer/index.mjs +34 -33
- package/dist/component/TInput/TInput.module.css.js +1 -1
- package/dist/component/TInput/TInput.module.css.mjs +10 -10
- package/dist/component/TInput/index.js +1 -0
- package/dist/component/TInput/index.mjs +1 -0
- package/dist/component/TLayout/index.js +1 -0
- package/dist/component/TLayout/index.mjs +1 -0
- package/dist/component/TLine/index.js +1 -0
- package/dist/component/TLine/index.mjs +1 -0
- package/dist/component/TMark/index.js +1 -0
- package/dist/component/TMark/index.mjs +1 -0
- package/dist/component/TModal/TModal.module.css.js +1 -1
- package/dist/component/TModal/TModal.module.css.mjs +22 -18
- package/dist/component/TModal/index.js +2 -1
- package/dist/component/TModal/index.mjs +12 -11
- package/dist/component/TNotice/index.js +1 -0
- package/dist/component/TNotice/index.mjs +1 -0
- package/dist/component/TNotice/useNotice.js +1 -0
- package/dist/component/TNotice/useNotice.mjs +1 -0
- package/dist/component/TSearch/TSearch.module.css.js +1 -1
- package/dist/component/TSearch/TSearch.module.css.mjs +1 -1
- package/dist/component/TSearch/index.js +1 -0
- package/dist/component/TSearch/index.mjs +1 -0
- package/dist/component/TSpace/index.js +1 -0
- package/dist/component/TSpace/index.mjs +1 -0
- package/dist/component/TTable/index.js +1 -0
- package/dist/component/TTable/index.mjs +1 -0
- package/dist/component/TTooltip/index.js +1 -0
- package/dist/component/TTooltip/index.mjs +1 -0
- package/dist/component/TUpload/index.js +1 -0
- package/dist/component/TUpload/index.mjs +1 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/dist/providers/NoticeProvider.js +1 -0
- package/dist/providers/NoticeProvider.mjs +1 -0
- package/dist/providers/ThemeProvider.js +1 -0
- package/dist/providers/ThemeProvider.mjs +1 -0
- package/dist/tango-ui-cw.css +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=s=>Object.entries(s).reduce((e,[b,r])=>{const t=`${r}px`;switch(b){case"mt":e.marginTop=typeof r=="number"?`${r}px`:r;break;case"mr":e.marginRight=typeof r=="number"?`${r}px`:r;break;case"mb":e.marginBottom=typeof r=="number"?`${r}px`:r;break;case"ml":e.marginLeft=typeof r=="number"?`${r}px`:r;break;case"m":e.margin=typeof r=="number"?`${r}px`:r;break;case"pt":e.paddingTop=t;break;case"pr":e.paddingRight=t;break;case"pb":e.paddingBottom=t;break;case"pl":e.paddingLeft=t;break;case"p":e.padding=t;break;case"px":e.paddingLeft=t,e.paddingRight=t;break;case"py":e.paddingTop=t,e.paddingBottom=t;break;case"br":e.borderRadius=typeof r=="number"?`${r}px`:r;break;case"bg":e.background=r;break;case"c":e.color=r;break;case"b":e.border=r===1?"1px solid red":r;break;case"center":e.position="absolute",e.inset=0,e.margin="auto";break;case"rel":e.position="relative";break;case"ab":e.position="absolute";break;case"fixed":e.position="fixed";break;case"w":e.width=t;break;case"h":e.height=t;break;case"vw":e.width=`${r}vw`;break;case"vh":e.height=`${r}vh`;break;case"presentw":e.width=`${r}%`;break;case"presenth":e.height=`${r}%`;break;case"mw":e.minWidth=t;break;case"mh":e.minHieght=t;break;case"fl":e.float="left";break;case"fr":e.float="right";break;case"size":e.fontSize=t;break;case"tac":e.textAlign="center";break;case"z":e.zIndex=r;break;case"tran":e.transition=`${r}s`;break;case"flex":e.display="flex";break;case"aic":e.alignItems="center";break;case"jcc":e.justifyContent="center";break;case"jc":e.justifyContent=r;break;case"oh":e.overflow="hidden";break;case"ohauto":e.overflow="auto";break;case"op":e.opacity=r;break;case"none":e.display="none";break;case"ar":e.aspectRatio=r;break;case"ls":e.letterSpacing=t;break;case"lh":e.lineHeight=t;break;case"fwb":e.fontWeight="bold";break;case"boxsizing":e.boxSizing="border-box";break;case"boxshadow":e.boxShadow=r;break;case"f":e.flex=typeof r=="number"?r:`${r}`;break;case"bColor":e.borderColor=r;break;case"bgSize":e.backgroundSize=r;break;case"bgPosition":e.backgroundPosition=r;break;case"bgRepeat":e.backgroundRepeat=r;break;default:e[b]=r}return e},{});exports.useTangoStyle=o;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const q=require("react/jsx-runtime"),C=require("react"),t=require("./MaterialButton.module.css.js"),N=require("../CSSFab/useTangoStyle.js");function M({size:n="medium",sx:a={},style:p={},className:d="",onClick:i=()=>{},children:m,disabled:s=!1,rippleColor:g="rgba(255, 255, 255, 0.6)",...y}){const r=C.useRef(null),b=typeof a=="object"?a:{},h=N.useTangoStyle(b),B=typeof a=="string"?a:"",x=[t.default.btn,t.default[`btn-${n}`],s&&t.default["btn-disabled"],B,d].filter(Boolean).join(" "),R=t.default[`materialBtn${w(n)}`],S=[t.default.materialBtn,R,s?t.default.materialBtnDisabled:"",x].filter(Boolean).join(" "),$={...h,...p};function j(l){if(s)return;const e=r.current,o=document.createElement("span"),c=Math.max(e.clientWidth,e.clientHeight),u=c/2;Object.assign(o.style,{width:`${c}px`,height:`${c}px`,left:`${l.clientX-e.getBoundingClientRect().left-u}px`,top:`${l.clientY-e.getBoundingClientRect().top-u}px`}),o.className=t.default.ripple,o.style.background=g;const f=e.querySelector(`.${t.default.ripple}`);f&&f.remove(),e.appendChild(o)}return q.jsx("button",{ref:r,className:S,style:$,onClick:l=>{j(l),i==null||i(l)},disabled:s,...y,children:m})}function w(n){return n.charAt(0).toUpperCase()+n.slice(1)}module.exports=M;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const t=require("react/jsx-runtime"),u=require("react"),e=require("./MaterialInput.module.css.js");function m({label:n,type:r="text",inputTextStyles:i={},inputFloatStyles:c={}}){const[o,l]=u.useState(!1),[s,d]=u.useState(""),a=o||s;return t.jsx("div",{className:e.default.materialInput,children:t.jsxs("div",{className:e.default.inputWrapper,children:[t.jsx("input",{type:r,className:`${e.default.materialInputField} ${a?e.default.filled:""}`,style:i,onFocus:()=>l(!0),onBlur:()=>l(!1),onChange:f=>d(f.target.value),value:s}),t.jsx("label",{className:`${e.default.materialLabel} ${a?e.default.float:""}`,style:a?c:{},children:n})]})})}module.exports=m;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const e=require("react/jsx-runtime");require("react");const r=require("./TBanner.module.css.js"),u=require("../TButton/index.js");function $(f){const{children:g="banner",onCancel:c=()=>{},onAction:p=()=>{},size:l="normal",cancelText:h="Cancel",actionText:x="Action",level:o="info",transparent:s=!1,bannerBgColor:C="",bannerBorderColor:w="",bannerIconColor:t=""}=f,m=()=>{switch(l){case"small":return r.default.smallBanner;case"large":return r.default.largeBanner;default:return r.default.banner}},n=()=>{switch(l){case"small":return r.default.smallInfoIcon;case"large":return r.default.largeInfoIcon;default:return r.default.infoIcon}},i=()=>{switch(l){case"small":return r.default.smallCloseIcon;case"large":return r.default.largeCloseIcon;default:return r.default.closeIcon}},v=()=>{switch(l){case"small":return`${s===!0?r.default.smallInfoTransparent:r.default.smallInfo}`;case"large":return`${s===!0?r.default.largeInfoTransparent:r.default.largeInfo}`;default:return`${s===!0?r.default.infoTransparent:r.default.info}`}},a=(()=>{switch(o){case"success":return{backgroundColor:`${s===!0?"transparent":"rgba(14, 43, 32, 0.8)"}`,borderColor:"#3cc29a",iconColor:`${t}`||"#3cc29a"};case"warning":return{backgroundColor:`${s===!0?"transparent":"rgba(121, 78, 8, 0.8)"}`,borderColor:"#ffcc00",iconColor:`${t}`||"#ff9900"};case"error":return{backgroundColor:`${s===!0?"transparent":"rgba(73, 20, 18,0.8)"}`,borderColor:"#ff6666",iconColor:`${t}`||"#ff3333"};case"info":default:return{backgroundColor:`${s===!0?"transparent":"rgba(18, 62, 116, 0.8)"}`,borderColor:"#64b4fa",iconColor:`${t}`||"#64b4fa"}}})(),b=e.jsxs("svg",{t:"1765636638756",className:n(),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5548",width:"200",height:"200",children:[e.jsx("path",{d:"M512.50142 958.397886c-119.320573 0-231.499491-46.465265-315.871087-130.837884C112.258737 743.188406 65.792449 631.010511 65.792449 511.688915c0-119.319549 46.466288-231.499491 130.837884-315.871087C281.002952 111.445208 393.180847 64.979944 512.50142 64.979944s231.499491 46.465265 315.871087 130.837884c84.372619 84.372619 130.837884 196.551538 130.837884 315.871087 0 119.321596-46.465265 231.499491-130.837884 315.871087C744.000911 911.932622 631.821993 958.397886 512.50142 958.397886zM512.50142 105.962334c-223.718271 0-405.726581 182.00831-405.726581 405.726581s182.00831 405.726581 405.726581 405.726581c223.718271 0 405.727605-182.00831 405.727605-405.726581S736.220714 105.962334 512.50142 105.962334z",fill:a.iconColor,"p-id":"5549"}),e.jsx("path",{d:"M510.150886 775.953647c-18.107403 0-32.745798-14.678304-32.745798-32.785707L477.405087 452.191846c0-18.108426 14.638395-32.785707 32.745798-32.785707 18.107403 0 32.745798 14.678304 32.745798 32.785707l0 290.976094C542.896684 761.275343 528.258289 775.953647 510.150886 775.953647z",fill:a.iconColor,"p-id":"5550"}),e.jsx("path",{d:"M511.357364 296.458969m-45.080731 0a44.054 44.054 0 1 0 90.161463 0 44.054 44.054 0 1 0-90.161463 0Z",fill:a.iconColor,"p-id":"5551"})]}),j=e.jsxs("svg",{t:"1766541516754",className:n(),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7130",width:"200",height:"200",children:[e.jsx("path",{d:"M869.472578 920.128281 154.906046 920.128281c-31.943526 0-60.545958-16.517185-76.514651-44.181245-15.968693-27.666106-15.96153-60.696384 0.016373-88.355327l357.283266-618.47194c15.971763-27.647687 44.568055-44.152593 76.496232-44.152593 31.930223-0.001023 60.527538 16.504906 76.499301 44.151569l357.283266 618.472963c15.977903 27.659967 15.984043 60.689221 0.017396 88.355327C930.018535 903.611096 901.416104 920.128281 869.472578 920.128281zM512.187265 169.139212c-15.962553 0-30.261211 8.251941-38.247092 22.075785l0 0L116.65793 809.686936c-7.989975 13.829983-7.993045 30.345122-0.008186 44.179199 7.983835 13.83203 22.285562 22.090111 38.257326 22.090111l714.566532 0c15.971763 0 30.273491-8.258081 38.256302-22.090111 7.984858-13.83203 7.980765-30.349215-0.008186-44.179199L550.437427 191.213973C542.452569 177.391153 528.152888 169.138188 512.187265 169.139212z",fill:"#f2990a","p-id":"7131"}),e.jsx("path",{d:"M513.732457 621.119233c-18.296715 0-33.257451-14.832823-33.257451-33.129538L480.475006 331.789639c0-18.296715 14.960737-33.129538 33.257451-33.129538 18.296715 0 33.257451 14.832823 33.257451 33.129538l0 256.200056C546.989909 606.28641 532.029172 621.119233 513.732457 621.119233z",fill:"#f2990a","p-id":"7132"}),e.jsx("path",{d:"M513.686409 737.619574m-49.991578 0a48.853 48.853 0 1 0 99.983155 0 48.853 48.853 0 1 0-99.983155 0Z",fill:"#f2990a","p-id":"7133"})]}),I=e.jsx("svg",{t:"1766542188417",className:n(),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"10967",width:"200",height:"200",children:e.jsx("path",{d:"M85.333333 512C85.333333 276.352 276.352 85.333333 512 85.333333s426.666667 191.018667 426.666667 426.666667-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512z m683.093334-256.426667a358.954667 358.954667 0 0 0-122.922667-80.768A359.466667 359.466667 0 0 0 512 149.333333c-46.08 0-90.624 8.490667-133.504 25.472A358.954667 358.954667 0 0 0 255.573333 255.573333c-35.413333 35.413333-62.336 76.373333-80.768 122.922667A359.466667 359.466667 0 0 0 149.333333 512c0 46.08 8.490667 90.624 25.472 133.504A358.954667 358.954667 0 0 0 255.573333 768.426667c35.413333 35.413333 76.373333 62.336 122.922667 80.768A359.466667 359.466667 0 0 0 512 874.666667c46.08 0 90.624-8.490667 133.504-25.472a358.954667 358.954667 0 0 0 122.922667-80.768c35.413333-35.413333 62.336-76.373333 80.768-122.922667A359.466667 359.466667 0 0 0 874.666667 512c0-46.08-8.490667-90.624-25.472-133.504A358.912 358.912 0 0 0 768.426667 255.573333zM338.517333 640.213333L466.773333 512 338.517333 383.786667l45.226667-45.226667L512 466.688l128.213333-128.213333 45.226667 45.226666L557.312 512l128.213333 128.213333-45.226666 45.226667L512 557.312l-128.213333 128.213333-45.226667-45.226666z",fill:"#f94c60","p-id":"10968"})}),L=e.jsxs("svg",{t:"1766542714832",className:n(),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"13471",width:"200",height:"200",children:[e.jsx("path",{d:"M512.3 961.3c-247.1 0-448.1-201-448.1-448.1s201-448.1 448.1-448.1 448.1 201 448.1 448.1-201 448.1-448.1 448.1z m0-849.7c-221.4 0-401.6 180.2-401.6 401.6s180.2 401.6 401.6 401.6 401.6-180.2 401.6-401.6-180.2-401.6-401.6-401.6z",fill:"#31d9a7","p-id":"13472"}),e.jsx("path",{d:"M441.2 676c-16.4 0-32.7-5.8-45.5-17.4l-151.3-138c-9.5-8.6-10.2-23.3-1.5-32.8 8.6-9.5 23.3-10.2 32.8-1.5L427 624.2c7.6 6.9 20.8 6.9 28.4 0l293.5-267.5c9.5-8.6 24.2-8 32.8 1.5 8.6 9.5 8 24.2-1.5 32.8L486.7 658.5c-12.8 11.7-29.1 17.5-45.5 17.5z",fill:"#31d9a7","p-id":"13473"})]}),B=e.jsx("svg",{t:"1765636877672",className:i(),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6359",width:"200",height:"200",children:e.jsx("path",{d:"M558.8 509.2l302.8-302.8c3.1-3.1 3.1-8.1 0-11.2l-30.8-30.8c-3.1-3.1-8.1-3.1-11.2 0L516.8 467.2c-1.5 1.5-4.1 1.5-5.6 0L208.3 164.3c-3.1-3.1-8.1-3.1-11.2 0l-30.8 30.8c-3.1 3.1-3.1 8.1 0 11.2l302.8 302.8c1.5 1.5 1.5 4.1 0 5.6l-302.8 303c-3.1 3.1-3.1 8.1 0 11.2l30.8 30.8c3.1 3.1 8.1 3.1 11.2 0l302.8-302.8c1.5-1.5 4.1-1.5 5.6 0l302.8 302.8c3.1 3.1 8.1 3.1 11.2 0l30.8-30.8c3.1-3.1 3.1-8.1 0-11.2L558.8 514.8c-1.5-1.5-1.5-4.1 0-5.6z",fill:"#ffffff","p-id":"6360"})}),z=()=>{switch(o){case"success":return L;case"warning":return j;case"error":return I;case"info":default:return b}},d=()=>{switch(l){case"small":return"0.8rem";case"large":return"1.2rem";default:return"1rem"}},M=()=>{switch(l){case"small":return"8px";case"large":return"12px";default:return"10px"}};return e.jsxs("div",{className:m(),style:{backgroundColor:C||a.backgroundColor,borderColor:w||a.borderColor},children:[e.jsx("div",{className:n(),children:z()}),e.jsx("div",{className:v(),children:g}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,gap:M()},children:[e.jsx(u,{type:"transparent",sx:{c:`${s===!0?"gray":"#e9e9e9"}`,br:d(),bColor:"transparent",s:l==="small"?"14px":l==="large"?"18px":"16px"},onClick:c,size:l,children:h}),e.jsx(u,{type:"transparent",sx:{c:`${s===!0?"gray":"#e9e9e9"}`,br:d(),b:1,bColor:"#797979",s:l==="small"?"14px":l==="large"?"18px":"16px"},onClick:p,size:l,children:x}),e.jsx("div",{className:i(),onClick:c,children:B})]})]})}module.exports=$;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const i=require("react/jsx-runtime"),c=require("react"),e=require("prop-types"),t=require("./TButton.module.css.js"),P=require("../CSSFab/useTangoStyle.js");function y(b){const{type:x="default",size:d="medium",sx:a={},style:w={},className:$="",onClick:j=()=>{},children:N,disabled:u=!1,outline:S=!1,enu:k=!1,icon:l=null,iconPosition:T=null,loading:n=!1,...v}=b,z=typeof a=="object"?a:{},C=P.useTangoStyle(z),q=typeof a=="string"?a.split(/\s+/).map(s=>s.startsWith("!")?s:`!${s}`).join(" "):"",g=()=>{switch(d){case"small":return 12;case"medium":return 14;case"large":return 16;case"huge":return 20;default:return 14}},o=()=>n===!0||n==="light"||n==="dark"?!0:Array.isArray(n)&&n.length>0?n[0]===!0||n[0]==="light"||n[0]==="dark":!1,A=()=>n==="light"?"light":n==="dark"||n===!0||Array.isArray(n)&&n.length>=2&&n[1]==="dark"?"dark":"light",f=()=>{const s=g(),r=A()==="dark"?L:I;return c.cloneElement(r,{className:`${r.props.className} ${o()?t.default["btn-loading-spin"]:""}`,style:{width:`${s}px`,height:`${s}px`,...r.props.style}})},B=[...[t.default.btn,t.default[`btn-${x}`],t.default[`btn-${d}`],u&&t.default["btn-disabled"],S&&t.default["btn-outline"],k&&t.default["btn-enu"],(l||o())&&t.default["btn-with-icon"],o()&&t.default["btn-loading"]].filter(Boolean),q,$].filter(Boolean).join(" "),O={...C,...w};y.propTypes={type:e.oneOf(["default","transparent","danger","success"]),size:e.oneOf(["small","medium","large","huge"]),sx:e.oneOfType([e.object,e.string]),style:e.object,onClick:e.func,className:e.string,children:e.node.isRequired,disabled:e.bool,outline:e.bool,enu:e.bool,icon:e.oneOfType([e.elementType,e.node,e.string]),iconPosition:e.string,loading:e.oneOfType([e.bool,e.oneOf(["light","dark"]),e.array])};const I=i.jsx("svg",{t:"1765518157795",className:`${t.default["btn-loading-icon"]} ${t.default["btn-loading-light"]}`,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",children:i.jsx("path",{d:"M512 1024A512 512 0 0 1 0 512a32 32 0 0 1 64 0 448 448 0 0 0 896 0 32 32 0 0 1 64 0 512 512 0 0 1-512 512z",fill:"#ffffff"})}),L=i.jsx("svg",{t:"1765518157795",className:`${t.default["btn-loading-icon"]} ${t.default["btn-loading-dark"]}`,viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",children:i.jsx("path",{d:"M512 1024A512 512 0 0 1 0 512a32 32 0 0 1 64 0 448 448 0 0 0 896 0 32 32 0 0 1 64 0 512 512 0 0 1-512 512z",fill:"#2c2c2c"})}),h=()=>{if(!l)return null;const s=g();if(typeof l=="string")return i.jsx("img",{src:l,alt:"icon",className:t.default["btn-icon"],style:{width:`${s}px`,height:`${s}px`}});if(c.isValidElement(l))return c.cloneElement(l,{className:`${t.default["btn-icon"]} ${l.props.className||""}`,style:{width:`${s}px`,height:`${s}px`,...l.props.style}});const m=l;return i.jsx(m,{className:t.default["btn-icon"],style:{fontSize:`${s}px`,width:`${s}px`,height:`${s}px`}})},p=T||(l||o()?"left":null);return i.jsxs("button",{className:B,style:O,onClick:j,disabled:u||o(),...v,children:[p==="left"&&i.jsxs(i.Fragment,{children:[o()&&f(),!o()&&l&&h()]}),N,p==="right"&&i.jsxs(i.Fragment,{children:[o()&&f(),!o()&&l&&h()]})]})}module.exports=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c="_colorPicker_ecbdc_1",e="_colorPickerDisabled_ecbdc_59",o="_colorPickerWrapper_ecbdc_69",r="_colorText_ecbdc_81",l={colorPicker:c,colorPickerDisabled:e,colorPickerWrapper:o,colorText:r};exports.colorPicker=c;exports.colorPickerDisabled=e;exports.colorPickerWrapper=o;exports.colorText=r;exports.default=l;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const
|
|
2
|
-
colorPicker:
|
|
3
|
-
colorPickerDisabled:
|
|
4
|
-
colorPickerWrapper:
|
|
1
|
+
const c = "_colorPicker_ecbdc_1", o = "_colorPickerDisabled_ecbdc_59", r = "_colorPickerWrapper_ecbdc_69", e = "_colorText_ecbdc_81", l = {
|
|
2
|
+
colorPicker: c,
|
|
3
|
+
colorPickerDisabled: o,
|
|
4
|
+
colorPickerWrapper: r,
|
|
5
5
|
colorText: e
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
c as colorPicker,
|
|
9
|
+
o as colorPickerDisabled,
|
|
10
|
+
r as colorPickerWrapper,
|
|
11
11
|
e as colorText,
|
|
12
12
|
l as default
|
|
13
13
|
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const a=require("react/jsx-runtime"),j=require("react"),h=require("prop-types"),d=require("./TColorPicker.module.css.js");function f(g){const{disabled:p=!1,onChange:b=()=>{},showText:m=!1}=g,[i,k]=j.useState("#000000"),v=s=>{const e=s.target.value;k(e),b&&b(e)},C=`${d.default.colorPicker} ${p?d.default.colorPickerDisabled:""}`,T=s=>{const e=parseInt(s.slice(1,3),16),r=parseInt(s.slice(3,5),16),t=parseInt(s.slice(5,7),16);return`rgb(${e}, ${r}, ${t})`},$=s=>{let e=parseInt(s.slice(1,3),16)/255,r=parseInt(s.slice(3,5),16)/255,t=parseInt(s.slice(5,7),16)/255,o=Math.max(e,r,t),c=Math.min(e,r,t),l,u,x=(o+c)/2;if(o===c)l=u=0;else{let n=o-c;switch(u=x>.5?n/(2-o-c):n/(o+c),o){case e:l=(r-t)/n+(r<t?6:0);break;case r:l=(t-e)/n+2;break;case t:l=(e-r)/n+4;break}l/=6}return`hsl(${Math.round(l*360)}, ${Math.round(u*100)}%, ${Math.round(x*100)}%)`};return a.jsxs("div",{className:d.default.colorPickerWrapper,children:[a.jsx("input",{type:"color",value:i,onChange:v,className:C,disabled:p}),m&&a.jsxs("div",{className:d.default.colorText,children:[a.jsx("div",{children:i.toUpperCase()}),a.jsx("div",{children:T(i)}),a.jsx("div",{children:$(i)})]})]})}f.propTypes={disabled:h.bool,onChange:h.func,showText:h.bool};module.exports=f;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const p=require("react/jsx-runtime");require("react");const n=require("prop-types"),L=require("../CSSFab/useTangoStyle.js");function l(s){const{type:c="default",single:g=!1,sx:r={},style:d={},className:u="",en:a=!1,...m}=s||{},o=typeof r=="object"&&r!==null&&!Array.isArray(r),y=L.useTangoStyle(o?r:{}),S=[o?"":r,u].filter(Boolean).join(" "),$={...y,...d},f=h=>{const e=new Date;let t=a?"en-US":"zh-CN",i=e.toLocaleString(t,{weekday:"long"});switch(!a&&g&&(i=i.replace("星期","周")),h){case"line":return e.toLocaleDateString(t,{year:"numeric",month:"2-digit",day:"2-digit"}).replaceAll("/","-");case"full":return`${e.toLocaleDateString(t,{year:"numeric",month:"2-digit",day:"2-digit"})} ${i} ${e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}`;case"full-line":return`${e.toLocaleDateString(t,{year:"numeric",month:"2-digit",day:"2-digit"}).replaceAll("/","-")} ${i} ${e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}`;case"year-week":return`${e.toLocaleDateString(t,{year:"numeric",month:"2-digit",day:"2-digit"})} ${i}`;case"year-week-line":return`${e.toLocaleDateString(t,{year:"numeric",month:"2-digit",day:"2-digit"}).replaceAll("/","-")} ${i}`;case"week-time":return`${i} ${e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}`;case"no-s":return`${e.toLocaleDateString(t,{year:"numeric",month:"2-digit",day:"2-digit"})} ${i} ${e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"})}`;case"no-s-line":return`${e.toLocaleDateString(t,{year:"numeric",month:"2-digit",day:"2-digit"}).replaceAll("/","-")} ${i} ${e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"})}`;case"us-full":return`${e.toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit"})} ${i} ${e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}`;case"us-full-line":return`${e.toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit"}).replaceAll("/","-")} ${i} ${e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}`;default:return e.toLocaleDateString(t,{year:"numeric",month:"2-digit",day:"2-digit"})}};return p.jsx("div",{className:S,style:$,...m,children:f(c)})}l.propTypes={type:n.oneOf(["line","full","full-line","year-week","year-week-line","week-time","no-s","no-s-line","us-full","us-full-line"]),single:n.bool,sx:n.oneOfType([n.object,n.string]),style:n.object,className:n.string,en:n.bool};module.exports=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t="_datePickerWrapper_1q3t5_1",e="_datePicker_1q3t5_1",n="_datePickerDisabled_1q3t5_53",a="_calendarPanel_1q3t5_65",o="_calendarHeader_1q3t5_93",c="_monthLabel_1q3t5_109",_="_navButton_1q3t5_121",l="_calendarDays_1q3t5_153",i="_weekDay_1q3t5_163",r="_emptyDay_1q3t5_165",d="_dayButton_1q3t5_167",s="_dayButtonSelected_1q3t5_215",m="_timeSection_1q3t5_225",u="_timeTitle_1q3t5_237",y="_timeControls_1q3t5_249",q="_timeSelect_1q3t5_261",B="_timeColon_1q3t5_291",p="_panelActions_1q3t5_301",P="_confirmButton_1q3t5_363",k="_cancelButton_1q3t5_373",D={datePickerWrapper:t,datePicker:e,datePickerDisabled:n,calendarPanel:a,calendarHeader:o,monthLabel:c,navButton:_,calendarDays:l,weekDay:i,emptyDay:r,dayButton:d,dayButtonSelected:s,timeSection:m,timeTitle:u,timeControls:y,timeSelect:q,timeColon:B,panelActions:p,confirmButton:P,cancelButton:k};exports.calendarDays=l;exports.calendarHeader=o;exports.calendarPanel=a;exports.cancelButton=k;exports.confirmButton=P;exports.datePicker=e;exports.datePickerDisabled=n;exports.datePickerWrapper=t;exports.dayButton=d;exports.dayButtonSelected=s;exports.default=D;exports.emptyDay=r;exports.monthLabel=c;exports.navButton=_;exports.panelActions=p;exports.timeColon=B;exports.timeControls=y;exports.timeSection=m;exports.timeSelect=q;exports.timeTitle=u;exports.weekDay=i;
|
|
@@ -1,9 +1,45 @@
|
|
|
1
|
-
const e = "
|
|
1
|
+
const t = "_datePickerWrapper_1q3t5_1", e = "_datePicker_1q3t5_1", n = "_datePickerDisabled_1q3t5_53", a = "_calendarPanel_1q3t5_65", o = "_calendarHeader_1q3t5_93", c = "_monthLabel_1q3t5_109", _ = "_navButton_1q3t5_121", l = "_calendarDays_1q3t5_153", i = "_weekDay_1q3t5_163", s = "_emptyDay_1q3t5_165", d = "_dayButton_1q3t5_167", r = "_dayButtonSelected_1q3t5_215", m = "_timeSection_1q3t5_225", q = "_timeTitle_1q3t5_237", y = "_timeControls_1q3t5_249", u = "_timeSelect_1q3t5_261", B = "_timeColon_1q3t5_291", p = "_panelActions_1q3t5_301", k = "_confirmButton_1q3t5_363", D = "_cancelButton_1q3t5_373", P = {
|
|
2
|
+
datePickerWrapper: t,
|
|
2
3
|
datePicker: e,
|
|
3
|
-
datePickerDisabled:
|
|
4
|
+
datePickerDisabled: n,
|
|
5
|
+
calendarPanel: a,
|
|
6
|
+
calendarHeader: o,
|
|
7
|
+
monthLabel: c,
|
|
8
|
+
navButton: _,
|
|
9
|
+
calendarDays: l,
|
|
10
|
+
weekDay: i,
|
|
11
|
+
emptyDay: s,
|
|
12
|
+
dayButton: d,
|
|
13
|
+
dayButtonSelected: r,
|
|
14
|
+
timeSection: m,
|
|
15
|
+
timeTitle: q,
|
|
16
|
+
timeControls: y,
|
|
17
|
+
timeSelect: u,
|
|
18
|
+
timeColon: B,
|
|
19
|
+
panelActions: p,
|
|
20
|
+
confirmButton: k,
|
|
21
|
+
cancelButton: D
|
|
4
22
|
};
|
|
5
23
|
export {
|
|
24
|
+
l as calendarDays,
|
|
25
|
+
o as calendarHeader,
|
|
26
|
+
a as calendarPanel,
|
|
27
|
+
D as cancelButton,
|
|
28
|
+
k as confirmButton,
|
|
6
29
|
e as datePicker,
|
|
7
|
-
|
|
8
|
-
|
|
30
|
+
n as datePickerDisabled,
|
|
31
|
+
t as datePickerWrapper,
|
|
32
|
+
d as dayButton,
|
|
33
|
+
r as dayButtonSelected,
|
|
34
|
+
P as default,
|
|
35
|
+
s as emptyDay,
|
|
36
|
+
c as monthLabel,
|
|
37
|
+
_ as navButton,
|
|
38
|
+
p as panelActions,
|
|
39
|
+
B as timeColon,
|
|
40
|
+
y as timeControls,
|
|
41
|
+
m as timeSection,
|
|
42
|
+
u as timeSelect,
|
|
43
|
+
q as timeTitle,
|
|
44
|
+
i as weekDay
|
|
9
45
|
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";const n=require("react/jsx-runtime"),r=require("react"),g=require("prop-types"),a=require("./TDatePicker.module.css.js"),v=require("../TButton/index.js");function N(j){const{className:C="",disabled:f=!1,onChange:S=()=>{},time:u=!1}=j,[o,Y]=r.useState(""),[i,w]=r.useState("00"),[d,b]=r.useState("00"),[k,m]=r.useState(!1),[s,p]=r.useState(()=>{const e=new Date;return new Date(e.getFullYear(),e.getMonth(),1)}),D=r.useRef(null);r.useEffect(()=>{const e=t=>{D.current&&!D.current.contains(t.target)&&m(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const F=e=>{const t=new Date(e),l=t.getFullYear(),c=(t.getMonth()+1).toString().padStart(2,"0"),h=t.getDate().toString().padStart(2,"0"),$=t.getHours().toString().padStart(2,"0"),x=t.getMinutes().toString().padStart(2,"0");return`${l}-${c}-${h} ${$}:${x}`},M=e=>{const t=e.getFullYear(),l=(e.getMonth()+1).toString().padStart(2,"0"),c=e.getDate().toString().padStart(2,"0");return`${t}-${l}-${c}`},H=r.useMemo(()=>{const e=s.getFullYear(),t=s.getMonth()+1;return`${e} 年 ${t} 月`},[s]),P=r.useMemo(()=>{const e=s.getFullYear(),t=s.getMonth(),l=new Date(e,t,1).getDay(),c=new Date(e,t+1,0).getDate(),h=Array.from({length:c},($,x)=>x+1);return[...Array(l).fill(null),...h]},[s]),B=r.useMemo(()=>o?u?`${o} ${i}:${d}`:o:"",[o,i,d,u]),y=(e,t,l)=>{if(e){if(u){const c=`${e}T${t}:${l}`,h=F(c);S(h,c);return}S(e,e)}},q=e=>{const t=new Date(s.getFullYear(),s.getMonth(),e),l=M(t);Y(l),y(l,i,d),u||m(!1)},A=()=>{const e=s.getFullYear(),t=s.getMonth();p(new Date(e,t-1,1))},T=()=>{const e=s.getFullYear(),t=s.getMonth();p(new Date(e,t+1,1))},L=`${a.default.datePicker} ${f?a.default.datePickerDisabled:""} ${C}`,O=e=>{const t=new Date(s.getFullYear(),s.getMonth(),e);return o===M(t)},R=()=>{if(!f){if(o){const[e,t]=o.split("-").map(Number);p(new Date(e,t-1,1))}m(!0)}},_=e=>{const t=e.target.value;w(t),y(o,t,d)},E=e=>{const t=e.target.value;b(t),y(o,i,t)},z=Array.from({length:24},(e,t)=>String(t).padStart(2,"0")),I=Array.from({length:60},(e,t)=>String(t).padStart(2,"0"));return n.jsxs("div",{className:a.default.datePickerWrapper,ref:D,children:[n.jsx("input",{type:"text",value:B,readOnly:!0,onClick:R,className:L,disabled:f,placeholder:u?"YYYY-MM-DD HH:mm":"YYYY-MM-DD"}),k&&!f&&n.jsxs("div",{className:a.default.calendarPanel,children:[n.jsxs("div",{className:a.default.calendarHeader,children:[n.jsx("button",{type:"button",className:a.default.navButton,onClick:A,children:"<"}),n.jsx("div",{className:a.default.monthLabel,children:H}),n.jsx("button",{type:"button",className:a.default.navButton,onClick:T,children:">"})]}),n.jsxs("div",{className:a.default.calendarDays,children:[["日","一","二","三","四","五","六"].map(e=>n.jsx("div",{className:a.default.weekDay,children:e},e)),P.map((e,t)=>e?n.jsx("button",{type:"button",className:`${a.default.dayButton} ${O(e)?a.default.dayButtonSelected:""}`,onClick:()=>q(e),children:e},`${s.getFullYear()}-${s.getMonth()}-${e}`):n.jsx("div",{className:a.default.emptyDay},`empty-${t}`))]}),u&&n.jsxs("div",{className:a.default.timeSection,children:[n.jsx("div",{className:a.default.timeTitle,children:"时间"}),n.jsxs("div",{className:a.default.timeControls,children:[n.jsx("select",{className:a.default.timeSelect,value:i,onChange:_,children:z.map(e=>n.jsx("option",{value:e,children:e},e))}),n.jsx("span",{className:a.default.timeColon,children:":"}),n.jsx("select",{className:a.default.timeSelect,value:d,onChange:E,children:I.map(e=>n.jsx("option",{value:e,children:e},e))})]}),n.jsxs("div",{className:a.default.panelActions,children:[n.jsx(v,{onClick:()=>m(!1),className:a.default.cancelButton,size:"small",children:"关闭"}),n.jsx(v,{onClick:()=>m(!1),className:a.default.confirmButton,size:"small",children:"确定"})]})]})]})]})}N.propTypes={className:g.string,disabled:g.bool,onChange:g.func,time:g.bool};module.exports=N;
|
|
@@ -1,40 +1,167 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as c, jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { useState as g, useRef as q, useEffect as G, useMemo as $ } from "react";
|
|
4
|
+
import f from "prop-types";
|
|
5
|
+
import n from "./TDatePicker.module.css.mjs";
|
|
6
|
+
import Y from "../TButton/index.mjs";
|
|
7
|
+
function J(w) {
|
|
6
8
|
const {
|
|
7
|
-
className:
|
|
8
|
-
disabled:
|
|
9
|
-
onChange:
|
|
9
|
+
className: b = "",
|
|
10
|
+
disabled: p = !1,
|
|
11
|
+
onChange: v = () => {
|
|
10
12
|
},
|
|
11
|
-
time:
|
|
12
|
-
} =
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
13
|
+
time: i = !1
|
|
14
|
+
} = w, [r, k] = g(""), [u, F] = g("00"), [m, H] = g("00"), [x, d] = g(!1), [a, D] = g(() => {
|
|
15
|
+
const e = /* @__PURE__ */ new Date();
|
|
16
|
+
return new Date(e.getFullYear(), e.getMonth(), 1);
|
|
17
|
+
}), y = q(null);
|
|
18
|
+
G(() => {
|
|
19
|
+
const e = (t) => {
|
|
20
|
+
y.current && !y.current.contains(t.target) && d(!1);
|
|
21
|
+
};
|
|
22
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
23
|
+
}, []);
|
|
24
|
+
const B = (e) => {
|
|
25
|
+
const t = new Date(e), o = t.getFullYear(), l = (t.getMonth() + 1).toString().padStart(2, "0"), h = t.getDate().toString().padStart(2, "0"), C = t.getHours().toString().padStart(2, "0"), S = t.getMinutes().toString().padStart(2, "0");
|
|
26
|
+
return `${o}-${l}-${h} ${C}:${S}`;
|
|
27
|
+
}, N = (e) => {
|
|
28
|
+
const t = e.getFullYear(), o = (e.getMonth() + 1).toString().padStart(2, "0"), l = e.getDate().toString().padStart(2, "0");
|
|
29
|
+
return `${t}-${o}-${l}`;
|
|
30
|
+
}, P = $(() => {
|
|
31
|
+
const e = a.getFullYear(), t = a.getMonth() + 1;
|
|
32
|
+
return `${e} 年 ${t} 月`;
|
|
33
|
+
}, [a]), A = $(() => {
|
|
34
|
+
const e = a.getFullYear(), t = a.getMonth(), o = new Date(e, t, 1).getDay(), l = new Date(e, t + 1, 0).getDate(), h = Array.from({ length: l }, (C, S) => S + 1);
|
|
35
|
+
return [...Array(o).fill(null), ...h];
|
|
36
|
+
}, [a]), L = $(() => r ? i ? `${r} ${u}:${m}` : r : "", [r, u, m, i]), M = (e, t, o) => {
|
|
37
|
+
if (e) {
|
|
38
|
+
if (i) {
|
|
39
|
+
const l = `${e}T${t}:${o}`, h = B(l);
|
|
40
|
+
v(h, l);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
v(e, e);
|
|
29
44
|
}
|
|
30
|
-
)
|
|
45
|
+
}, O = (e) => {
|
|
46
|
+
const t = new Date(
|
|
47
|
+
a.getFullYear(),
|
|
48
|
+
a.getMonth(),
|
|
49
|
+
e
|
|
50
|
+
), o = N(t);
|
|
51
|
+
k(o), M(o, u, m), i || d(!1);
|
|
52
|
+
}, T = () => {
|
|
53
|
+
const e = a.getFullYear(), t = a.getMonth();
|
|
54
|
+
D(new Date(e, t - 1, 1));
|
|
55
|
+
}, E = () => {
|
|
56
|
+
const e = a.getFullYear(), t = a.getMonth();
|
|
57
|
+
D(new Date(e, t + 1, 1));
|
|
58
|
+
}, _ = `${n.datePicker} ${p ? n.datePickerDisabled : ""} ${b}`, j = (e) => {
|
|
59
|
+
const t = new Date(
|
|
60
|
+
a.getFullYear(),
|
|
61
|
+
a.getMonth(),
|
|
62
|
+
e
|
|
63
|
+
);
|
|
64
|
+
return r === N(t);
|
|
65
|
+
}, z = () => {
|
|
66
|
+
if (!p) {
|
|
67
|
+
if (r) {
|
|
68
|
+
const [e, t] = r.split("-").map(Number);
|
|
69
|
+
D(new Date(e, t - 1, 1));
|
|
70
|
+
}
|
|
71
|
+
d(!0);
|
|
72
|
+
}
|
|
73
|
+
}, I = (e) => {
|
|
74
|
+
const t = e.target.value;
|
|
75
|
+
F(t), M(r, t, m);
|
|
76
|
+
}, R = (e) => {
|
|
77
|
+
const t = e.target.value;
|
|
78
|
+
H(t), M(r, u, t);
|
|
79
|
+
}, V = Array.from({ length: 24 }, (e, t) => String(t).padStart(2, "0")), W = Array.from({ length: 60 }, (e, t) => String(t).padStart(2, "0"));
|
|
80
|
+
return /* @__PURE__ */ c("div", { className: n.datePickerWrapper, ref: y, children: [
|
|
81
|
+
/* @__PURE__ */ s(
|
|
82
|
+
"input",
|
|
83
|
+
{
|
|
84
|
+
type: "text",
|
|
85
|
+
value: L,
|
|
86
|
+
readOnly: !0,
|
|
87
|
+
onClick: z,
|
|
88
|
+
className: _,
|
|
89
|
+
disabled: p,
|
|
90
|
+
placeholder: i ? "YYYY-MM-DD HH:mm" : "YYYY-MM-DD"
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
x && !p && /* @__PURE__ */ c("div", { className: n.calendarPanel, children: [
|
|
94
|
+
/* @__PURE__ */ c("div", { className: n.calendarHeader, children: [
|
|
95
|
+
/* @__PURE__ */ s("button", { type: "button", className: n.navButton, onClick: T, children: "<" }),
|
|
96
|
+
/* @__PURE__ */ s("div", { className: n.monthLabel, children: P }),
|
|
97
|
+
/* @__PURE__ */ s("button", { type: "button", className: n.navButton, onClick: E, children: ">" })
|
|
98
|
+
] }),
|
|
99
|
+
/* @__PURE__ */ c("div", { className: n.calendarDays, children: [
|
|
100
|
+
["日", "一", "二", "三", "四", "五", "六"].map((e) => /* @__PURE__ */ s("div", { className: n.weekDay, children: e }, e)),
|
|
101
|
+
A.map((e, t) => e ? /* @__PURE__ */ s(
|
|
102
|
+
"button",
|
|
103
|
+
{
|
|
104
|
+
type: "button",
|
|
105
|
+
className: `${n.dayButton} ${j(e) ? n.dayButtonSelected : ""}`,
|
|
106
|
+
onClick: () => O(e),
|
|
107
|
+
children: e
|
|
108
|
+
},
|
|
109
|
+
`${a.getFullYear()}-${a.getMonth()}-${e}`
|
|
110
|
+
) : /* @__PURE__ */ s("div", { className: n.emptyDay }, `empty-${t}`))
|
|
111
|
+
] }),
|
|
112
|
+
i && /* @__PURE__ */ c("div", { className: n.timeSection, children: [
|
|
113
|
+
/* @__PURE__ */ s("div", { className: n.timeTitle, children: "时间" }),
|
|
114
|
+
/* @__PURE__ */ c("div", { className: n.timeControls, children: [
|
|
115
|
+
/* @__PURE__ */ s(
|
|
116
|
+
"select",
|
|
117
|
+
{
|
|
118
|
+
className: n.timeSelect,
|
|
119
|
+
value: u,
|
|
120
|
+
onChange: I,
|
|
121
|
+
children: V.map((e) => /* @__PURE__ */ s("option", { value: e, children: e }, e))
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ s("span", { className: n.timeColon, children: ":" }),
|
|
125
|
+
/* @__PURE__ */ s(
|
|
126
|
+
"select",
|
|
127
|
+
{
|
|
128
|
+
className: n.timeSelect,
|
|
129
|
+
value: m,
|
|
130
|
+
onChange: R,
|
|
131
|
+
children: W.map((e) => /* @__PURE__ */ s("option", { value: e, children: e }, e))
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
] }),
|
|
135
|
+
/* @__PURE__ */ c("div", { className: n.panelActions, children: [
|
|
136
|
+
/* @__PURE__ */ s(
|
|
137
|
+
Y,
|
|
138
|
+
{
|
|
139
|
+
onClick: () => d(!1),
|
|
140
|
+
className: n.cancelButton,
|
|
141
|
+
size: "small",
|
|
142
|
+
children: "关闭"
|
|
143
|
+
}
|
|
144
|
+
),
|
|
145
|
+
/* @__PURE__ */ s(
|
|
146
|
+
Y,
|
|
147
|
+
{
|
|
148
|
+
onClick: () => d(!1),
|
|
149
|
+
className: n.confirmButton,
|
|
150
|
+
size: "small",
|
|
151
|
+
children: "确定"
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
] })
|
|
155
|
+
] })
|
|
156
|
+
] })
|
|
157
|
+
] });
|
|
31
158
|
}
|
|
32
|
-
|
|
33
|
-
className:
|
|
34
|
-
disabled:
|
|
35
|
-
onChange:
|
|
36
|
-
time:
|
|
159
|
+
J.propTypes = {
|
|
160
|
+
className: f.string,
|
|
161
|
+
disabled: f.bool,
|
|
162
|
+
onChange: f.func,
|
|
163
|
+
time: f.bool
|
|
37
164
|
};
|
|
38
165
|
export {
|
|
39
|
-
|
|
166
|
+
J as default
|
|
40
167
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_drawerOverlay_1j82z_1",t="_drawerContainer_1j82z_25",r="_drawerHeader_1j82z_43",o="_drawerHeaderTitle_1j82z_57",a="_drawerContent_1j82z_63",n="_drawerFooter_1j82z_73",d="_drawerCloseBtn_1j82z_93",_="_drawerRight_1j82z_111",c="_drawerLeft_1j82z_127",w="_drawerTop_1j82z_143",m="_drawerBottom_1j82z_159",u="_comeInRight_1j82z_353",s="_comeOutRight_1j82z_361",B="_comeInLeft_1j82z_369",O="_comeOutLeft_1j82z_377",i="_comeInTop_1j82z_385",j="_comeOutTop_1j82z_393",l="_comeInBottom_1j82z_401",z="_comeOutBottom_1j82z_409",T="_drawerButton_1j82z_415",C="_drawerButtonOk_1j82z_423",I="_drawerButtonCancel_1j82z_433",f={drawerOverlay:e,drawerContainer:t,drawerHeader:r,drawerHeaderTitle:o,drawerContent:a,drawerFooter:n,drawerCloseBtn:d,drawerRight:_,drawerLeft:c,drawerTop:w,drawerBottom:m,comeInRight:u,comeOutRight:s,comeInLeft:B,comeOutLeft:O,comeInTop:i,comeOutTop:j,comeInBottom:l,comeOutBottom:z,drawerButton:T,drawerButtonOk:C,drawerButtonCancel:I};exports.comeInBottom=l;exports.comeInLeft=B;exports.comeInRight=u;exports.comeInTop=i;exports.comeOutBottom=z;exports.comeOutLeft=O;exports.comeOutRight=s;exports.comeOutTop=j;exports.default=f;exports.drawerBottom=m;exports.drawerButton=T;exports.drawerButtonCancel=I;exports.drawerButtonOk=C;exports.drawerCloseBtn=d;exports.drawerContainer=t;exports.drawerContent=a;exports.drawerFooter=n;exports.drawerHeader=r;exports.drawerHeaderTitle=o;exports.drawerLeft=c;exports.drawerOverlay=e;exports.drawerRight=_;exports.drawerTop=w;
|
|
@@ -1,45 +1,49 @@
|
|
|
1
|
-
const
|
|
2
|
-
drawerOverlay:
|
|
3
|
-
drawerContainer:
|
|
4
|
-
drawerHeader:
|
|
1
|
+
const e = "_drawerOverlay_1j82z_1", t = "_drawerContainer_1j82z_25", r = "_drawerHeader_1j82z_43", o = "_drawerHeaderTitle_1j82z_57", _ = "_drawerContent_1j82z_63", n = "_drawerFooter_1j82z_73", a = "_drawerCloseBtn_1j82z_93", c = "_drawerRight_1j82z_111", d = "_drawerLeft_1j82z_127", w = "_drawerTop_1j82z_143", m = "_drawerBottom_1j82z_159", s = "_comeInRight_1j82z_353", j = "_comeOutRight_1j82z_361", u = "_comeInLeft_1j82z_369", z = "_comeOutLeft_1j82z_377", B = "_comeInTop_1j82z_385", O = "_comeOutTop_1j82z_393", i = "_comeInBottom_1j82z_401", l = "_comeOutBottom_1j82z_409", C = "_drawerButton_1j82z_415", I = "_drawerButtonOk_1j82z_423", T = "_drawerButtonCancel_1j82z_433", f = {
|
|
2
|
+
drawerOverlay: e,
|
|
3
|
+
drawerContainer: t,
|
|
4
|
+
drawerHeader: r,
|
|
5
5
|
drawerHeaderTitle: o,
|
|
6
6
|
drawerContent: _,
|
|
7
|
-
drawerFooter:
|
|
8
|
-
drawerCloseBtn:
|
|
9
|
-
drawerRight:
|
|
10
|
-
drawerLeft:
|
|
11
|
-
drawerTop:
|
|
12
|
-
drawerBottom:
|
|
13
|
-
comeInRight:
|
|
14
|
-
comeOutRight:
|
|
15
|
-
comeInLeft:
|
|
16
|
-
comeOutLeft:
|
|
7
|
+
drawerFooter: n,
|
|
8
|
+
drawerCloseBtn: a,
|
|
9
|
+
drawerRight: c,
|
|
10
|
+
drawerLeft: d,
|
|
11
|
+
drawerTop: w,
|
|
12
|
+
drawerBottom: m,
|
|
13
|
+
comeInRight: s,
|
|
14
|
+
comeOutRight: j,
|
|
15
|
+
comeInLeft: u,
|
|
16
|
+
comeOutLeft: z,
|
|
17
17
|
comeInTop: B,
|
|
18
18
|
comeOutTop: O,
|
|
19
|
-
comeInBottom:
|
|
20
|
-
comeOutBottom:
|
|
21
|
-
drawerButton:
|
|
19
|
+
comeInBottom: i,
|
|
20
|
+
comeOutBottom: l,
|
|
21
|
+
drawerButton: C,
|
|
22
|
+
drawerButtonOk: I,
|
|
23
|
+
drawerButtonCancel: T
|
|
22
24
|
};
|
|
23
25
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
i as comeInBottom,
|
|
27
|
+
u as comeInLeft,
|
|
28
|
+
s as comeInRight,
|
|
27
29
|
B as comeInTop,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
l as comeOutBottom,
|
|
31
|
+
z as comeOutLeft,
|
|
32
|
+
j as comeOutRight,
|
|
31
33
|
O as comeOutTop,
|
|
32
34
|
f as default,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
m as drawerBottom,
|
|
36
|
+
C as drawerButton,
|
|
37
|
+
T as drawerButtonCancel,
|
|
38
|
+
I as drawerButtonOk,
|
|
39
|
+
a as drawerCloseBtn,
|
|
40
|
+
t as drawerContainer,
|
|
37
41
|
_ as drawerContent,
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
n as drawerFooter,
|
|
43
|
+
r as drawerHeader,
|
|
40
44
|
o as drawerHeaderTitle,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
d as drawerLeft,
|
|
46
|
+
e as drawerOverlay,
|
|
47
|
+
c as drawerRight,
|
|
48
|
+
w as drawerTop
|
|
45
49
|
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";const s=require("react/jsx-runtime"),c=require("react"),e=require("prop-types"),t=require("./TDrawer.module.css.js"),T=require("../TButton/index.js");function x(k){const{children:p,title:y="基础标题",okText:m="确定",cancelText:w="取消",open:d=!1,onClose:l=()=>{},type:a="right",containerStyles:C,headerStyles:g,footerStyles:j,btnStyles:i,footerButtons:o,maskClosable:v=!0}=k,[u,f]=c.useState(!1),[h,n]=c.useState(!1);c.useEffect(()=>{d?(f(!0),n(!1)):u&&(n(!0),setTimeout(()=>{f(!1),n(!1)},300))},[d]);const S=s.jsx("svg",{t:"1770778790558",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5372",width:"25",height:"25",children:s.jsx("path",{d:"M512 466.944l233.472-233.472a31.744 31.744 0 0 1 45.056 45.056L557.056 512l233.472 233.472a31.744 31.744 0 0 1-45.056 45.056L512 557.056l-233.472 233.472a31.744 31.744 0 0 1-45.056-45.056L466.944 512 233.472 278.528a31.744 31.744 0 0 1 45.056-45.056z",fill:"#707070","p-id":"5373"})});return s.jsx(s.Fragment,{children:u&&s.jsx("div",{className:`${t.default.drawerOverlay} ${h?t.default.fadeOut:t.default.fadeIn}`,onClick:r=>{v&&r.target===r.currentTarget&&l()},children:s.jsxs("div",{className:`${t.default.drawerContainer} ${t.default[`drawer${a.charAt(0).toUpperCase()+a.slice(1)}`]} ${h?t.default[`comeOut${a.charAt(0).toUpperCase()+a.slice(1)}`]:t.default[`comeIn${a.charAt(0).toUpperCase()+a.slice(1)}`]}`,style:C,children:[s.jsxs("div",{className:t.default.drawerHeader,children:[s.jsx("h3",{className:t.default.drawerHeaderTitle,style:g,children:y}),s.jsx("div",{className:t.default.drawerCloseBtn,onClick:l,children:S})]}),s.jsx("div",{className:t.default.drawerContent,children:p}),s.jsx("div",{className:t.default.drawerFooter,style:j,children:(o!=null&&o.length?o:[{key:"cancel",text:w,onClick:l},{key:"ok",text:m,onClick:l}]).map(r=>s.jsx(T,{onClick:r.onClick,style:r.key==="ok"?(i==null?void 0:i[r.key])||{}:{},className:`${t.default.drawerButton} ${r.key==="ok"?t.default.drawerButtonOk:t.default.drawerButtonCancel}`,children:r.text},r.key))})]})})})}x.propTypes={children:e.node.isRequired,title:e.string,okText:e.string,cancelText:e.string,open:e.bool,onOk:e.func,onClose:e.func,type:e.oneOf(["top","bottom","left","right"]),containerStyles:e.object,headerStyles:e.object,footerStyles:e.object,btnStyles:e.object,footerButtons:e.arrayOf(e.shape({key:e.string.isRequired,text:e.string.isRequired,onClick:e.func.isRequired})),maskClosable:e.bool};module.exports=x;
|