tango-ui-cw 0.9.5 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/index.js +1 -0
- package/dist/component/TDatePicker/index.mjs +1 -0
- package/dist/component/TDrawer/index.js +1 -0
- package/dist/component/TDrawer/index.mjs +1 -0
- 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/index.js +1 -0
- package/dist/component/TModal/index.mjs +1 -0
- package/dist/component/TNotice/index.js +2 -1
- package/dist/component/TNotice/index.mjs +2 -1
- package/dist/component/TNotice/useNotice.js +1 -0
- package/dist/component/TNotice/useNotice.mjs +1 -0
- 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/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,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,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const b=require("react/jsx-runtime"),C=require("react"),e=require("prop-types"),c=require("./TDatePicker.module.css.js");function i(u){const{className:l="",disabled:n=!1,onChange:o=()=>{},time:r=!1}=u,[d,g]=C.useState(""),p=a=>{const t=new Date(a),s=t.getFullYear(),h=(t.getMonth()+1).toString().padStart(2,"0"),$=t.getDate().toString().padStart(2,"0"),y=t.getHours().toString().padStart(2,"0"),D=t.getMinutes().toString().padStart(2,"0");return`${s}-${h}-${$} ${y}:${D}`},m=a=>{const t=a.target.value;g(t);const s=r?p(t):t;o&&o(s,t)},f=r?"datetime-local":"date",S=`${c.default.datePicker} ${n?c.default.datePickerDisabled:""} ${l}`;return b.jsx("input",{type:f,value:d,onChange:m,className:S,disabled:n})}i.propTypes={className:e.string,disabled:e.bool,onChange:e.func,time:e.bool};module.exports=i;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
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(p){const{children:m,title:y="基础标题",okText:w="确定",cancelText:g="取消",open:d=!1,onClose:a=()=>{},type:l="right",containerStyles:k,headerStyles:C,footerStyles:j,btnStyles:o,footerButtons:i,maskClosable:v=!0}=p,[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&&a()},children:s.jsxs("div",{className:`${t.default.drawerContainer} ${t.default[`drawer${l.charAt(0).toUpperCase()+l.slice(1)}`]} ${h?t.default[`comeOut${l.charAt(0).toUpperCase()+l.slice(1)}`]:t.default[`comeIn${l.charAt(0).toUpperCase()+l.slice(1)}`]}`,style:k,children:[s.jsxs("div",{className:t.default.drawerHeader,children:[s.jsx("h3",{className:t.default.drawerHeaderTitle,style:C,children:y}),s.jsx("div",{className:t.default.drawerCloseBtn,onClick:a,children:S})]}),s.jsx("div",{className:t.default.drawerContent,children:m}),s.jsx("div",{className:t.default.drawerFooter,style:j,children:(i!=null&&i.length?i:[{key:"cancel",text:g,onClick:a},{key:"ok",text:w,onClick:a}]).map(r=>s.jsx(T,{onClick:r.onClick,style:(o==null?void 0:o[r.key])||{},className:t.default.drawerButton,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;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const t=require("react/jsx-runtime");require("react");const e=require("prop-types"),a=require("./TInput.module.css.js"),V=require("../CSSFab/useTangoStyle.js");function l(p){const{type:o="default",size:n="medium",sx:s={},style:m={},className:f="",onClick:y=()=>{},onChange:i=()=>{},value:u,defaultValue:g="",disabled:r=!1,placeholder:x="",maxlength:C=524288}=p,h=a.default.input,b=a.default[`input${n.charAt(0).toUpperCase()+n.slice(1)}`]||"",v=r?a.default.inputDisabled:"",j=typeof s=="object"?s:{},S=V.useTangoStyle(j),T=typeof s=="string"?s:"",d=u!==void 0,N=[h,b,v,T,f].filter(Boolean).join(" "),q={...S,...m},w=o==="password"?"password":"text",c={className:N,style:q,onClick:y,onChange:i?z=>i(z.target.value):void 0,value:d?u:void 0,defaultValue:d?void 0:g,disabled:r,placeholder:x,maxLength:C};return t.jsx("div",{children:o==="textarea"?t.jsx("textarea",{...c}):t.jsx("input",{...c,type:w})})}l.propTypes={type:e.oneOf(["default","textarea","password"]),size:e.oneOf(["small","medium","large","huge"]),sx:e.oneOfType([e.object,e.string]),style:e.object,onClick:e.func,onChange:e.func,className:e.string,value:e.string,defaultValue:e.string,disabled:e.bool,placeholder:e.string,maxlength:e.number};l.defaultProps={type:"default",size:"medium",sx:{},style:{},onClick:()=>{},className:"",onChange:void 0,value:void 0,defaultValue:"",disabled:!1,placeholder:"",maxlength:524288};module.exports=l;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const e=require("react/jsx-runtime"),l=require("prop-types");;/* empty css */function c(r){const{children:s,type:a,className:i=""}=r,t=`clay-layout clay-layout-${a} ${i}`;return e.jsxs("div",{className:t,children:[a==="top-middle-bottom"&&e.jsxs("div",{className:"ultra",children:[e.jsx("header",{className:"clay-header",children:s[0]}),e.jsx("main",{className:"clay-main",children:s[1]}),e.jsx("footer",{className:"clay-footer",children:s[2]})]}),a==="top-bottom-split"&&e.jsxs("div",{className:"ultra",children:[e.jsx("header",{className:"clay-header",children:s[0]}),e.jsxs("main",{className:"clay-main",children:[e.jsx("aside",{className:"clay-aside",children:s[1]}),e.jsx("div",{className:"clay-content",children:s[2]})]})]}),a==="left-right-top-bottom"&&e.jsxs(e.Fragment,{children:[e.jsx("header",{className:"clay-header",children:s[0]}),e.jsxs("div",{className:"clay-main",children:[e.jsx("aside",{className:"clay-aside",children:s[1]}),e.jsxs("div",{className:"clay-right",children:[e.jsx("header",{className:"clay-header",children:s[2]}),e.jsx("div",{className:"clay-content",children:s[3]})]})]})]}),a==="left-right-three-parts"&&e.jsxs("div",{className:"ultra",children:[e.jsx("aside",{className:"clay-aside",children:s[0]}),e.jsxs("div",{className:"clay-right",children:[e.jsx("header",{className:"clay-header",children:s[1]}),e.jsx("main",{className:"clay-main",children:s[2]}),e.jsx("footer",{className:"clay-footer",children:s[3]})]})]})]})}c.propTypes={children:l.node.isRequired,className:l.string,type:l.oneOf(["top-middle-bottom","top-bottom-split","left-right-top-bottom","left-right-three-parts"]).isRequired};module.exports=c;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const o=require("react/jsx-runtime");require("react");const e=require("prop-types"),s=require("./TLine.module.css.js"),g=require("../CSSFab/useTangoStyle.js");function c(a){const{sx:t={},style:r={},className:u="",onClick:d=()=>{},children:n,size:l="medium"}=a,m=typeof t=="object"?t:{},x=g.useTangoStyle(m),y=typeof t=="string"?t:"",i=!!n,f=s.default[`line${l.charAt(0).toUpperCase()+l.slice(1)}`]||"",p=i?s.default.lineHasText:s.default.lineNoText,T=[s.default.line,f,p,y,u].filter(Boolean).join(" "),C={...x,...r};return o.jsx("div",{style:C,onClick:d,className:T,children:i&&o.jsx("div",{className:s.default.lineText,children:n})})}c.propTypes={sx:e.oneOfType([e.object,e.string]),size:e.oneOf(["small","medium","large","huge"]),style:e.object,onClick:e.func,className:e.string,children:e.node.isRequired};module.exports=c;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const f=require("react/jsx-runtime");require("react");const e=require("prop-types"),b=require("./TMark.module.css.js"),x=require("../CSSFab/useTangoStyle.js");function o(r){const{sx:t={},style:l={},className:n="",onClick:c=()=>{},children:a,color:s="default",beauty:i=!1}=r,u=typeof t=="object"?t:{},d=x.useTangoStyle(u),y=typeof t=="string"?t:"",p={backgroundColor:s==="default"?"#ffe28d":s,...{width:"auto",height:"auto",display:"inline-block"},...i?{padding:"4px 8px",borderRadius:"4px"}:{},...d,...l};return f.jsx("div",{style:p,onClick:c,className:`${b.default.mark} ${y} ${n}`.trim(),children:a})}o.propTypes={color:e.string,sx:e.oneOfType([e.object,e.string]),style:e.object,onClick:e.func,className:e.string,children:e.node.isRequired,beauty:e.bool};module.exports=o;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const t=require("react/jsx-runtime"),c=require("react"),e=require("prop-types"),s=require("./TModal.module.css.js"),T=require("../TButton/index.js");function m(x){const{children:h,title:k="基础标题",okText:y="确定",cancelText:g="取消",open:r=!1,onOk:q,onClose:a=()=>{},containerStyles:j,headerStyles:C,footerStyles:p,btnStyles:n,footerButtons:o,maskClosable:v=!0}=x,[d,u]=c.useState(!1),[f,i]=c.useState(!1);c.useEffect(()=>{r?(u(!0),i(!1)):d&&(i(!0),setTimeout(()=>{u(!1),i(!1)},300))},[r]);const S=t.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:t.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 t.jsx(t.Fragment,{children:d&&t.jsx("div",{className:`${s.default.modalOverlay} ${f?s.default.fadeOut:s.default.fadeIn}`,onClick:l=>{v&&l.target===l.currentTarget&&a()},children:t.jsxs("div",{className:`${s.default.modalContainer} ${f?s.default.scaleOut:s.default.scaleIn}`,style:j,children:[t.jsxs("div",{className:s.default.modalHeader,children:[t.jsx("h3",{className:s.default.modalHeaderTitle,style:C,children:k}),t.jsx("div",{className:s.default.modalCloseBtn,onClick:a,children:S})]}),t.jsx("div",{className:s.default.modalContent,children:h}),t.jsx("div",{className:s.default.modalFooter,style:p,children:(o!=null&&o.length?o:[{key:"cancel",text:g,onClick:a},{key:"ok",text:y,onClick:a}]).map(l=>t.jsx(T,{onClick:l.onClick,style:(n==null?void 0:n[l.key])||{},className:s.default.modalButton,children:l.text},l.key))})]})})})}m.propTypes={children:e.node.isRequired,title:e.string,okText:e.string,cancelText:e.string,open:e.bool,onOk:e.func,onClose:e.func,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=m;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
"use
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";const i=require("react/jsx-runtime"),l=require("react"),e=require("prop-types"),s=require("./TNotice.module.css.js");function c({type:n="success",icon:d,message:o,variant:t="default",onClose:r,duration:u=3e3}){return l.useEffect(()=>{const a=setTimeout(r,u);return()=>clearTimeout(a)},[r,u]),i.jsxs("div",{className:`${s.default.notice}
|
|
2
3
|
${t==="md"?s.default.mdNotice:s.default.defaultNotice}
|
|
3
4
|
${t==="md"?s.default[`md_${n}`]:""}`,children:[t!=="md"&&i.jsx("div",{className:s.default.iconWrapper,style:{marginRight:"8px"},children:d}),i.jsx("span",{children:o})]})}c.propTypes={type:e.oneOf(["success","fail","caution"]),icon:e.string.isRequired,message:e.string.isRequired,variant:e.oneOf(["default","md"]),onClose:e.func.isRequired,duration:e.number};module.exports=c;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsxs as u, jsx as o } from "react/jsx-runtime";
|
|
2
3
|
import { useEffect as f } from "react";
|
|
3
4
|
import e from "prop-types";
|
|
@@ -8,7 +9,7 @@ function p({
|
|
|
8
9
|
message: n,
|
|
9
10
|
variant: s = "default",
|
|
10
11
|
onClose: r,
|
|
11
|
-
duration: t =
|
|
12
|
+
duration: t = 3e3
|
|
12
13
|
}) {
|
|
13
14
|
return f(() => {
|
|
14
15
|
const d = setTimeout(r, t);
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react");const t=require("../../providers/NoticeProvider.js");function i(){const{add:c}=t.useNoticeContext();return{success:e=>c("success",e),fail:e=>c("fail",e),caution:e=>c("caution",e),md:{success:e=>c("success",e,"md"),fail:e=>c("fail",e,"md"),caution:e=>c("caution",e,"md")}}}exports.useNotice=i;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const l=require("react/jsx-runtime"),N=require("react"),e=require("prop-types"),t=require("./TSearch.module.css.js"),C=require("../CSSFab/useTangoStyle.js"),$=require("../TButton/index.js");function c(d){const{size:h="medium",sx:a={},style:m={},className:p="",onSearch:r=()=>{},value:n,defaultValue:y="",disabled:o=!1,placeholder:f="请输入内容",path:u="",btnText:g="搜索",btnStyles:x={}}=d,i=N.useRef(null),S=typeof a=="object"?a:{},b=C.useTangoStyle(S),v=typeof a=="string"?a:"",s=n!==void 0&&r!==void 0,T=`${t.default.searchInput} ${t.default[`searchInput_${h}`]} ${o?t.default.searchInputDisabled:""} ${v} ${p}`,j={...b,...m};return l.jsxs("div",{className:t.default.searchContainer,children:[l.jsx("input",{className:T,style:j,ref:s?void 0:i,onKeyDown:q=>q.key==="Enter"&&r(s?n:i.current.value),value:s?n:void 0,defaultValue:s?void 0:y,disabled:o,placeholder:f}),l.jsx($,{className:t.default.searchButton,onClick:()=>r(s?n:i.current.value),style:x,size:"small",disabled:o,children:u?l.jsx("img",{src:u,alt:"search-icon",style:{width:16,height:16,marginTop:2,marginBottom:-3}}):g})]})}c.propTypes={size:e.oneOf(["small","medium","large","huge"]),sx:e.oneOfType([e.object,e.string]),style:e.object,onSearch:e.func.isRequired,className:e.string,value:e.string,defaultValue:e.string,disabled:e.bool,placeholder:e.string,path:e.string,btnText:e.string};module.exports=c;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const m=require("react/jsx-runtime"),T=require("react"),e=require("prop-types"),o=require("./TSpace.module.css.js"),g=require("../CSSFab/useTangoStyle.js");function t(r,n){const{sx:s={},style:a={},className:l="",onClick:i,children:p,type:u="default"}=r,y=typeof s=="object"?s:{},d=g.useTangoStyle(y),f=typeof s=="string"?s:"",S={...d,...a},x=`${f} ${o.default.space} ${o.default[`space_${u}`]||""} ${l}`;return m.jsx("div",{ref:n,style:S,onClick:i,className:x,children:p})}t.propTypes={type:e.oneOf(["default","inline","circle","triangle","halfCircle","fixed","absolute","relative"]),sx:e.oneOfType([e.string,e.object]),style:e.object,onClick:e.func,className:e.string,children:e.node.isRequired};const c=T.forwardRef(t);c.propTypes=t.propTypes;c.displayName="Space";module.exports=c;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const a=require("react/jsx-runtime");require("react");const t=require("prop-types"),i=require("./TTable.module.css.js");function g({dataSource:m=[],columns:x,className:b="",tableWapperStyles:j={},tableWrapperClassName:N="",containerStyles:$={},containerClassName:C="",theadStyles:v={},theadClassName:R="",trStyles:q={},trClassName:T="",rowClassName:c=()=>"",rowStyle:f=()=>({}),cellClassName:h=()=>"",cellStyle:y=()=>({}),hoverColor:o="",hide:u=[]}){const k=Array.isArray(u)?u:typeof u=="string"?[u]:[],p=x.filter(e=>!e.hide&&!k.includes(e.dataIndex)),O=(e,s,n)=>typeof f=="function"?f(e,s,n):f||{},A=(e,s,n,r,d,l)=>typeof y=="function"?y(e,s,n,r,d,l):y||{},P=(e,s,n)=>typeof c=="function"?c(e,s,n):c||"",S=(e,s,n,r,d,l)=>typeof h=="function"?h(e,s,n,r,d,l):h||"";return a.jsxs("div",{className:`${i.default.wrapper} ${b} ${N}`,style:{overflow:"hidden",borderRadius:"12px",boxShadow:"0 0 20px rgba(0, 0, 0, 0.08)",...j},children:[o&&a.jsx("style",{children:`
|
|
2
3
|
.${i.default.table} tbody tr:hover {
|
|
3
4
|
background-color: ${o} !important;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const r=require("react/jsx-runtime"),a=require("react"),e=require("prop-types"),t=require("./TTooltip.module.css.js");function i({children:l,tooltipText:n,placement:o="top",tooltipClassName:p=""}){const[u,s]=a.useState(!1);return r.jsxs("div",{className:`${t.default.tooltipWrapper} ${t.default[`tooltip${o[0].toUpperCase()+o.slice(1)}`]}`,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[l,u&&r.jsx("div",{className:`${t.default.tooltip} ${p}`,children:n})]})}i.propTypes={children:e.node.isRequired,tooltipText:e.string.isRequired,placement:e.oneOf(["top","bottom","right","left"]),tooltipClassName:e.string};module.exports=i;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";const s=require("react/jsx-runtime"),R=require("react"),e=require("prop-types"),t=require("./TUpload.module.css.js"),k=require("../CSSFab/useTangoStyle.js"),F=require("../../assets/Upload/fileslogo.png.js"),S=require("../../assets/Upload/delLogo.png.js"),K=require("../TButton/index.js");function m(w){const{sx:u={},style:I={},className:N="",accept:C="image/*",multiple:f=!1,onChange:p=()=>{},beforeUpload:h=()=>{},files:x=[],showUploadList:z=!0,maxCount:B=20,maxSize:y=100,btnText:P="选择文件",btnStyle:T={},showSize:g=!0,...O}=w,b=R.useId(),o=x||[],q=typeof u=="object"?u:{},U=k.useTangoStyle(q),L=[typeof u=="string"?u:"",N].filter(Boolean).join(" "),_={...U,...I};async function v(l,i){if(h)try{const n=await h(l,i);return n===void 0?!0:n}catch{return!1}return!0}const $=async l=>{const n=Array.from(l.target.files||[]).filter(a=>a.size/1024/1024>y?(console.warn(`${a.name} 超过 ${y}MB,已被过滤`),!1):!0);let d=f?n.slice(0,B):n.slice(0,1);const c=[];for(const a of d){const r=await v(a,d);if(r!==!1&&r!==m.LIST_IGNORE)if(r instanceof Blob){const M=r instanceof File?r:new File([r],a.name,{type:a.type});c.push(M)}else c.push(a)}p(c)};function j(l,i){const n=x.filter((d,c)=>c!==i);p(n)}return s.jsxs("div",{style:{padding:20},children:[s.jsx("input",{id:b,type:"file",accept:C,multiple:f,className:t.default.hiddenInput,onChange:$}),s.jsx(K,{style:T,children:s.jsx("label",{htmlFor:b,children:P})}),z&&s.jsx("ul",{className:[t.default.fileListPhoto,L,o.length===0?t.default.noBorder:""].filter(Boolean).join(" "),style:_,children:o.length>0&&(f?o.map((l,i)=>s.jsxs("li",{className:t.default.fileItemPhoto,children:[s.jsx("img",{src:F,alt:"file icon",className:t.default.fileIconPhoto}),s.jsxs("span",{children:[l.name,g?` (${(l.size/1024).toFixed(2)} KB)`:null]}),s.jsx("img",{src:S,alt:"file icon2",className:t.default.fileIconPhoto,onClick:()=>j(l,i)})]},i)):s.jsxs("li",{className:t.default.fileItemPhoto,children:[s.jsx("img",{src:F,alt:"file icon",className:t.default.fileIconPhoto}),o.length>0&&s.jsxs("span",{children:[o[0].name,g?` (${(o[0].size/1024).toFixed(2)} KB)`:null]}),s.jsx("img",{src:S,alt:"file icon2",className:t.default.fileIconPhoto,onClick:()=>j(o[0],0)})]}))})]})}m.propTypes={sx:e.oneOfType([e.object,e.string]),style:e.object,className:e.string,accept:e.string,multiple:e.bool,onChange:e.func,beforeUpload:e.func,files:e.array,showUploadList:e.bool,maxCount:e.number,maxSize:e.number,btnText:e.string,btnStyle:e.object,showSize:e.bool};module.exports=m;
|
package/dist/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */;/* empty css */const e=require("./providers/ThemeProvider.js"),r=require("./component/TButton/index.js"),i=require("./component/MaterialButton/index.js"),n=require("./component/MaterialInput/index.js"),o=require("./component/TColorPicker/index.js"),t=require("./component/TDate/index.js"),u=require("./component/TDatePicker/index.js"),c=require("./component/TDrawer/index.js"),d=require("./component/TInput/index.js"),s=require("./component/TLayout/index.js"),q=require("./component/TLine/index.js"),x=require("./component/TMark/index.js"),a=require("./component/TModal/index.js"),$=require("./component/TNotice/index.js"),l=require("./component/TNotice/useNotice.js"),P=require("./providers/NoticeProvider.js"),T=require("./component/TSearch/index.js"),h=require("./component/TSpace/index.js"),v=require("./component/TTable/index.js"),N=require("./component/TTooltip/index.js"),m=require("./component/TUpload/index.js"),p=require("./component/TBanner/index.js");exports.ThemeProvider=e.ThemeProvider;exports.useTheme=e.useTheme;exports.Button=r;exports.MaterialButton=i;exports.MaterialInput=n;exports.ColorPicker=o;exports.Date=t;exports.DatePicker=u;exports.Drawer=c;exports.Input=d;exports.Layout=s;exports.Line=q;exports.Mark=x;exports.Modal=a;exports.Notice=$;exports.useNotice=l.useNotice;exports.NoticeProvider=P.NoticeProvider;exports.Search=T;exports.Space=h;exports.Table=v;exports.Tooltip=N;exports.Upload=m;exports.Banner=p;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),g=require("react-dom"),M=require("../component/TNotice/index.js"),a=i.createContext(null);function N({children:o}){const[r,n]=i.useState([]),[d,l]=i.useState(!1);i.useEffect(()=>{l(!0)},[]);const u=e.jsx("svg",{t:"1772605923154",className:"TangoIcon",viewBox:"0 0 1024 1024",version:"1.1","p-id":"5323",width:"1.2em",height:"1.2em",children:e.jsx("path",{d:"M874.119618 149.859922A510.816461 510.816461 0 0 0 511.997 0.00208a509.910462 509.910462 0 0 0-362.119618 149.857842c-199.817789 199.679789-199.817789 524.581447 0 724.260236a509.969462 509.969462 0 0 0 362.119618 149.857842A508.872463 508.872463 0 0 0 874.119618 874.120158c199.836789-199.679789 199.836789-524.581447 0-724.260236zM814.94268 378.210681L470.999043 744.132295a15.359984 15.359984 0 0 1-5.887994 4.095996c-1.751998 1.180999-2.913997 2.362998-5.276994 2.913997a34.499964 34.499964 0 0 1-13.469986 2.914997 45.547952 45.547952 0 0 1-12.897986-2.303998l-4.095996-2.363997a45.291952 45.291952 0 0 1-7.009992-4.095996l-196.902793-193.789796a34.126964 34.126964 0 0 1-10.555989-25.186973c0-9.37399 3.583996-18.74698 9.98399-25.186974a36.429962 36.429962 0 0 1 50.372947 0l169.98382 167.423824L763.389735 330.220732a37.059961 37.059961 0 0 1 50.371947-1.732998 33.647965 33.647965 0 0 1 11.165988 25.186973 35.544963 35.544963 0 0 1-9.98399 24.575974v-0.04z m0 0",fill:"#52C41A","p-id":"5324"})}),x=e.jsx("svg",{t:"1772605974217",className:"TangoIcon",viewBox:"0 0 1024 1024",version:"1.1","p-id":"6333",width:"1.2em",height:"1.2em",children:e.jsx("path",{d:"M549.044706 512l166.189176-166.249412a26.383059 26.383059 0 0 0 0-36.98447 26.383059 26.383059 0 0 0-37.044706 0L512 475.015529l-166.249412-166.249411a26.383059 26.383059 0 0 0-36.98447 0 26.383059 26.383059 0 0 0 0 37.044706L475.015529 512l-166.249411 166.249412a26.383059 26.383059 0 0 0 0 36.98447 26.383059 26.383059 0 0 0 37.044706 0L512 548.984471l166.249412 166.249411a26.383059 26.383059 0 0 0 36.98447 0 26.383059 26.383059 0 0 0 0-37.044706L548.984471 512zM512 1024a512 512 0 1 1 0-1024 512 512 0 0 1 0 1024z",fill:"#E84335","p-id":"6334"})}),h=e.jsxs("svg",{t:"1772606035823",className:"TangoIcon",viewBox:"0 0 1024 1024",version:"1.1","p-id":"10722",width:"1.2em",height:"1.2em",children:[e.jsx("path",{d:"M512 909.061224c-218.906122 0-397.061224-178.155102-397.061224-397.061224s178.155102-397.061224 397.061224-397.061224 397.061224 178.155102 397.061224 397.061224-178.155102 397.061224-397.061224 397.061224z",fill:"#F2CB51","p-id":"10723"}),e.jsx("path",{d:"M512 690.677551m-31.346939 0a31.346939 31.346939 0 1 0 62.693878 0 31.346939 31.346939 0 1 0-62.693878 0Z",fill:"#E5404F","p-id":"10724"}),e.jsx("path",{d:"M512 584.097959c-11.493878 0-20.897959-9.404082-20.897959-20.897959v-261.22449c0-11.493878 9.404082-20.897959 20.897959-20.897959s20.897959 9.404082 20.897959 20.897959v261.22449c0 12.016327-9.404082 20.897959-20.897959 20.897959z",fill:"#E5404F","p-id":"10725"})]}),m=i.useCallback(t=>{n(c=>c.filter(s=>s.id!==t))},[]),v=i.useCallback((t,c,s="default")=>{const f={success:u,fail:x,caution:h},p=Date.now()+Math.random();n(j=>[...j,{id:p,type:t,message:c,variant:s,icon:f[t]}])},[]);return e.jsxs(a.Provider,{value:{add:v},children:[o,d&&g.createPortal(e.jsx("div",{id:"notification-container",children:r.map(t=>e.jsx(M,{...t,onClose:()=>m(t.id)},t.id))}),document.body)]})}function C(){const o=i.useContext(a);if(!o)throw new Error("useNotice must be used inside <NoticeProvider />");return o}exports.NoticeProvider=N;exports.useNoticeContext=C;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),e=require("react"),r=e.createContext(null);function m({children:o}){const[t,n]=e.useState("light");e.useEffect(()=>{document.documentElement.dataset.theme=t},[t]);const u=()=>{n(s=>s==="dark"?"light":"dark")};return c.jsx(r.Provider,{value:{theme:t,setTheme:n,toggleTheme:u},children:o})}function i(){return e.useContext(r)}exports.ThemeProvider=m;exports.useTheme=i;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-ui-cw",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
4
4
|
"description": "A lightweight ui library with ClayW",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@vitejs/plugin-react": "^4.4.1",
|
|
15
15
|
"copyfiles": "^2.4.1",
|
|
16
|
+
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
16
17
|
"vite": "^6.3.5"
|
|
17
18
|
},
|
|
18
19
|
"peerDependencies": {
|