tango-ui-cw 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/assets/Notice//345/244/261/350/264/245.png.js +1 -0
- package/dist/assets/Notice//345/244/261/350/264/245.png.mjs +4 -0
- package/dist/assets/Notice//346/210/220/345/212/237.png.js +1 -0
- package/dist/assets/Notice//346/210/220/345/212/237.png.mjs +4 -0
- package/dist/assets/Notice//350/255/246/345/221/212.png.js +1 -0
- package/dist/assets/Notice//350/255/246/345/221/212.png.mjs +4 -0
- package/dist/assets/Upload/delLogo.png.js +1 -0
- package/dist/assets/Upload/delLogo.png.mjs +4 -0
- package/dist/assets/Upload/fileslogo.png.js +1 -0
- package/dist/assets/Upload/fileslogo.png.mjs +4 -0
- package/dist/client.mjs +3 -0
- package/dist/component/CSSFab/useTangoStyle.js +1 -0
- package/dist/component/CSSFab/useTangoStyle.mjs +170 -0
- package/dist/component/MaterialButton/MaterialButton.module.css.js +1 -0
- package/dist/component/MaterialButton/MaterialButton.module.css.mjs +17 -0
- package/dist/component/MaterialButton/index.js +1 -0
- package/dist/component/MaterialButton/index.mjs +61 -0
- package/dist/component/MaterialInput/MaterialInput.module.css.js +1 -0
- package/dist/component/MaterialInput/MaterialInput.module.css.mjs +17 -0
- package/dist/component/MaterialInput/index.js +1 -0
- package/dist/component/MaterialInput/index.mjs +36 -0
- package/dist/component/TBanner/TBanner.module.css.js +1 -0
- package/dist/component/TBanner/TBanner.module.css.mjs +35 -0
- package/dist/component/TBanner/index.js +1 -0
- package/dist/component/TBanner/index.mjs +340 -0
- package/dist/component/TButton/TButton.module.css.js +1 -0
- package/dist/component/TButton/TButton.module.css.mjs +26 -0
- package/dist/component/TButton/index.js +1 -0
- package/dist/component/TButton/index.mjs +185 -0
- package/dist/component/TColorPicker/TColorPicker.module.css.js +1 -0
- package/dist/component/TColorPicker/TColorPicker.module.css.mjs +13 -0
- package/dist/component/TColorPicker/index.js +1 -0
- package/dist/component/TColorPicker/index.mjs +61 -0
- package/dist/component/TDate/index.js +1 -0
- package/dist/component/TDate/index.mjs +144 -0
- package/dist/component/TDatePicker/TDatePicker.module.css.js +1 -0
- package/dist/component/TDatePicker/TDatePicker.module.css.mjs +9 -0
- package/dist/component/TDatePicker/index.js +1 -0
- package/dist/component/TDatePicker/index.mjs +40 -0
- package/dist/component/TDrawer/TDrawer.module.css.js +1 -0
- package/dist/component/TDrawer/TDrawer.module.css.mjs +45 -0
- package/dist/component/TDrawer/index.js +1 -0
- package/dist/component/TDrawer/index.mjs +110 -0
- package/dist/component/TInput/TInput.module.css.js +1 -0
- package/dist/component/TInput/TInput.module.css.mjs +21 -0
- package/dist/component/TInput/index.js +1 -0
- package/dist/component/TInput/index.mjs +74 -0
- package/dist/component/TLayout/index.js +1 -0
- package/dist/component/TLayout/index.mjs +52 -0
- package/dist/component/TLine/TLine.module.css.js +1 -0
- package/dist/component/TLine/TLine.module.css.mjs +19 -0
- package/dist/component/TLine/index.js +1 -0
- package/dist/component/TLine/index.mjs +34 -0
- package/dist/component/TMark/TMark.module.css.js +1 -0
- package/dist/component/TMark/TMark.module.css.mjs +7 -0
- package/dist/component/TMark/index.js +1 -0
- package/dist/component/TMark/index.mjs +51 -0
- package/dist/component/TModal/TModal.module.css.js +1 -0
- package/dist/component/TModal/TModal.module.css.mjs +29 -0
- package/dist/component/TModal/index.js +1 -0
- package/dist/component/TModal/index.mjs +109 -0
- package/dist/component/TNotice/NoticeProvider.js +1 -0
- package/dist/component/TNotice/NoticeProvider.mjs +47 -0
- package/dist/component/TNotice/TNotice.module.css.js +1 -0
- package/dist/component/TNotice/TNotice.module.css.mjs +27 -0
- package/dist/component/TNotice/index.js +3 -0
- package/dist/component/TNotice/index.mjs +39 -0
- package/dist/component/TNotice/useNotice.js +1 -0
- package/dist/component/TNotice/useNotice.mjs +18 -0
- package/dist/component/TSearch/TSearch.module.css.js +1 -0
- package/dist/component/TSearch/TSearch.module.css.mjs +21 -0
- package/dist/component/TSearch/index.js +1 -0
- package/dist/component/TSearch/index.mjs +72 -0
- package/dist/component/TSpace/TSpace.module.css.js +1 -0
- package/dist/component/TSpace/TSpace.module.css.mjs +23 -0
- package/dist/component/TSpace/index.js +1 -0
- package/dist/component/TSpace/index.mjs +45 -0
- package/dist/component/TTable/TTable.module.css.js +1 -0
- package/dist/component/TTable/TTable.module.css.mjs +25 -0
- package/dist/component/TTable/index.js +7 -0
- package/dist/component/TTable/index.mjs +153 -0
- package/dist/component/TTooltip/TTooltip.module.css.js +1 -0
- package/dist/component/TTooltip/TTooltip.module.css.mjs +17 -0
- package/dist/component/TTooltip/index.js +1 -0
- package/dist/component/TTooltip/index.mjs +33 -0
- package/dist/component/TUpload/TUpload.module.css.js +1 -0
- package/dist/component/TUpload/TUpload.module.css.mjs +15 -0
- package/dist/component/TUpload/index.js +1 -0
- package/dist/component/TUpload/index.mjs +151 -0
- package/dist/index.js +1 -9
- package/dist/index.mjs +47 -2071
- package/dist/styles/ThemeProvider.js +1 -0
- package/dist/styles/ThemeProvider.mjs +20 -0
- package/dist/tango-ui-cw.css +1 -0
- package/package.json +15 -11
- package/dist/index.css +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import e from "prop-types";
|
|
4
|
+
import s from "./TLine.module.css.mjs";
|
|
5
|
+
import { useTangoStyle as C } from "../CSSFab/useTangoStyle.mjs";
|
|
6
|
+
function S(r) {
|
|
7
|
+
const {
|
|
8
|
+
sx: t = {},
|
|
9
|
+
style: a = {},
|
|
10
|
+
className: c = "",
|
|
11
|
+
onClick: m = () => {
|
|
12
|
+
},
|
|
13
|
+
children: o,
|
|
14
|
+
size: l = "medium"
|
|
15
|
+
} = r, p = C(typeof t == "object" ? t : {}), y = typeof t == "string" ? t : "", n = !!o, x = s[`line${l.charAt(0).toUpperCase() + l.slice(1)}`] || "", d = n ? s.lineHasText : s.lineNoText, f = [
|
|
16
|
+
s.line,
|
|
17
|
+
x,
|
|
18
|
+
d,
|
|
19
|
+
y,
|
|
20
|
+
c
|
|
21
|
+
].filter(Boolean).join(" "), u = { ...p, ...a };
|
|
22
|
+
return /* @__PURE__ */ i("div", { style: u, onClick: m, className: f, children: n && /* @__PURE__ */ i("div", { className: s.lineText, children: o }) });
|
|
23
|
+
}
|
|
24
|
+
S.propTypes = {
|
|
25
|
+
sx: e.oneOfType([e.object, e.string]),
|
|
26
|
+
size: e.oneOf(["small", "medium", "large", "huge"]),
|
|
27
|
+
style: e.object,
|
|
28
|
+
onClick: e.func,
|
|
29
|
+
className: e.string,
|
|
30
|
+
children: e.node.isRequired
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
S as default
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_mark_nbq0k_1",t={mark:e};exports.default=t;exports.mark=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"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;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import e from "prop-types";
|
|
4
|
+
import u from "./TMark.module.css.mjs";
|
|
5
|
+
import { useTangoStyle as f } from "../CSSFab/useTangoStyle.mjs";
|
|
6
|
+
function m(s) {
|
|
7
|
+
const {
|
|
8
|
+
sx: t = {},
|
|
9
|
+
style: l = {},
|
|
10
|
+
className: r = "",
|
|
11
|
+
onClick: n = () => {
|
|
12
|
+
},
|
|
13
|
+
children: a,
|
|
14
|
+
color: o = "default",
|
|
15
|
+
beauty: c = !1
|
|
16
|
+
} = s, i = f(typeof t == "object" ? t : {}), y = typeof t == "string" ? t : "", d = {
|
|
17
|
+
backgroundColor: o === "default" ? "#ffe28d" : o,
|
|
18
|
+
...{
|
|
19
|
+
width: "auto",
|
|
20
|
+
height: "auto",
|
|
21
|
+
display: "inline-block"
|
|
22
|
+
},
|
|
23
|
+
...c ? {
|
|
24
|
+
padding: "4px 8px",
|
|
25
|
+
borderRadius: "4px"
|
|
26
|
+
} : {},
|
|
27
|
+
...i,
|
|
28
|
+
...l
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ p(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
style: d,
|
|
34
|
+
onClick: n,
|
|
35
|
+
className: `${u.mark} ${y} ${r}`.trim(),
|
|
36
|
+
children: a
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
m.propTypes = {
|
|
41
|
+
color: e.string,
|
|
42
|
+
sx: e.oneOfType([e.object, e.string]),
|
|
43
|
+
style: e.object,
|
|
44
|
+
onClick: e.func,
|
|
45
|
+
className: e.string,
|
|
46
|
+
children: e.node.isRequired,
|
|
47
|
+
beauty: e.bool
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
m as default
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o="_modalOverlay_17rup_1",e="_modalContainer_17rup_27",a="_modalHeader_17rup_49",t="_modalHeaderTitle_17rup_65",l="_modalContent_17rup_73",d="_modalFooter_17rup_83",n="_modalCloseBtn_17rup_97",_="_fadeIn_17rup_195",r="_fadeOut_17rup_205",m="_scaleIn_17rup_215",s="_scaleOut_17rup_225",u="_modalButton_17rup_233",c={modalOverlay:o,modalContainer:e,modalHeader:a,modalHeaderTitle:t,modalContent:l,modalFooter:d,modalCloseBtn:n,fadeIn:_,fadeOut:r,scaleIn:m,scaleOut:s,modalButton:u};exports.default=c;exports.fadeIn=_;exports.fadeOut=r;exports.modalButton=u;exports.modalCloseBtn=n;exports.modalContainer=e;exports.modalContent=l;exports.modalFooter=d;exports.modalHeader=a;exports.modalHeaderTitle=t;exports.modalOverlay=o;exports.scaleIn=m;exports.scaleOut=s;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const o = "_modalOverlay_17rup_1", a = "_modalContainer_17rup_27", t = "_modalHeader_17rup_49", e = "_modalHeaderTitle_17rup_65", l = "_modalContent_17rup_73", d = "_modalFooter_17rup_83", n = "_modalCloseBtn_17rup_97", _ = "_fadeIn_17rup_195", r = "_fadeOut_17rup_205", s = "_scaleIn_17rup_215", m = "_scaleOut_17rup_225", u = "_modalButton_17rup_233", c = {
|
|
2
|
+
modalOverlay: o,
|
|
3
|
+
modalContainer: a,
|
|
4
|
+
modalHeader: t,
|
|
5
|
+
modalHeaderTitle: e,
|
|
6
|
+
modalContent: l,
|
|
7
|
+
modalFooter: d,
|
|
8
|
+
modalCloseBtn: n,
|
|
9
|
+
fadeIn: _,
|
|
10
|
+
fadeOut: r,
|
|
11
|
+
scaleIn: s,
|
|
12
|
+
scaleOut: m,
|
|
13
|
+
modalButton: u
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
c as default,
|
|
17
|
+
_ as fadeIn,
|
|
18
|
+
r as fadeOut,
|
|
19
|
+
u as modalButton,
|
|
20
|
+
n as modalCloseBtn,
|
|
21
|
+
a as modalContainer,
|
|
22
|
+
l as modalContent,
|
|
23
|
+
d as modalFooter,
|
|
24
|
+
t as modalHeader,
|
|
25
|
+
e as modalHeaderTitle,
|
|
26
|
+
o as modalOverlay,
|
|
27
|
+
s as scaleIn,
|
|
28
|
+
m as scaleOut
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"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;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { jsx as l, Fragment as w, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useEffect as N } from "react";
|
|
3
|
+
import e from "prop-types";
|
|
4
|
+
import t from "./TModal.module.css.mjs";
|
|
5
|
+
import j from "../TButton/index.mjs";
|
|
6
|
+
function O(u) {
|
|
7
|
+
const {
|
|
8
|
+
children: y,
|
|
9
|
+
title: k = "基础标题",
|
|
10
|
+
okText: p = "确定",
|
|
11
|
+
cancelText: g = "取消",
|
|
12
|
+
open: r = !1,
|
|
13
|
+
onOk: b,
|
|
14
|
+
onClose: s = () => {
|
|
15
|
+
},
|
|
16
|
+
containerStyles: C,
|
|
17
|
+
headerStyles: x,
|
|
18
|
+
footerStyles: v,
|
|
19
|
+
btnStyles: i,
|
|
20
|
+
footerButtons: a,
|
|
21
|
+
maskClosable: S = !0
|
|
22
|
+
} = u, [c, d] = h(!1), [m, n] = h(!1);
|
|
23
|
+
N(() => {
|
|
24
|
+
r ? (d(!0), n(!1)) : c && (n(!0), setTimeout(() => {
|
|
25
|
+
d(!1), n(!1);
|
|
26
|
+
}, 300));
|
|
27
|
+
}, [r]);
|
|
28
|
+
const T = /* @__PURE__ */ l(
|
|
29
|
+
"svg",
|
|
30
|
+
{
|
|
31
|
+
t: "1770778790558",
|
|
32
|
+
class: "icon",
|
|
33
|
+
viewBox: "0 0 1024 1024",
|
|
34
|
+
version: "1.1",
|
|
35
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
36
|
+
"p-id": "5372",
|
|
37
|
+
width: "25",
|
|
38
|
+
height: "25",
|
|
39
|
+
children: /* @__PURE__ */ l(
|
|
40
|
+
"path",
|
|
41
|
+
{
|
|
42
|
+
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",
|
|
43
|
+
fill: "#707070",
|
|
44
|
+
"p-id": "5373"
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
return /* @__PURE__ */ l(w, { children: c && /* @__PURE__ */ l(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: `${t.modalOverlay} ${m ? t.fadeOut : t.fadeIn}`,
|
|
53
|
+
onClick: (o) => {
|
|
54
|
+
S && o.target === o.currentTarget && s();
|
|
55
|
+
},
|
|
56
|
+
children: /* @__PURE__ */ f(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: `${t.modalContainer} ${m ? t.scaleOut : t.scaleIn}`,
|
|
60
|
+
style: C,
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ f("div", { className: t.modalHeader, children: [
|
|
63
|
+
/* @__PURE__ */ l("h3", { className: t.modalHeaderTitle, style: x, children: k }),
|
|
64
|
+
/* @__PURE__ */ l("div", { className: t.modalCloseBtn, onClick: s, children: T })
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ l("div", { className: t.modalContent, children: y }),
|
|
67
|
+
/* @__PURE__ */ l("div", { className: t.modalFooter, style: v, children: (a != null && a.length ? a : [
|
|
68
|
+
{ key: "cancel", text: g, onClick: s },
|
|
69
|
+
{ key: "ok", text: p, onClick: s }
|
|
70
|
+
]).map((o) => /* @__PURE__ */ l(
|
|
71
|
+
j,
|
|
72
|
+
{
|
|
73
|
+
onClick: o.onClick,
|
|
74
|
+
style: (i == null ? void 0 : i[o.key]) || {},
|
|
75
|
+
className: t.modalButton,
|
|
76
|
+
children: o.text
|
|
77
|
+
},
|
|
78
|
+
o.key
|
|
79
|
+
)) })
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
) });
|
|
85
|
+
}
|
|
86
|
+
O.propTypes = {
|
|
87
|
+
children: e.node.isRequired,
|
|
88
|
+
title: e.string,
|
|
89
|
+
okText: e.string,
|
|
90
|
+
cancelText: e.string,
|
|
91
|
+
open: e.bool,
|
|
92
|
+
onOk: e.func,
|
|
93
|
+
onClose: e.func,
|
|
94
|
+
containerStyles: e.object,
|
|
95
|
+
headerStyles: e.object,
|
|
96
|
+
footerStyles: e.object,
|
|
97
|
+
btnStyles: e.object,
|
|
98
|
+
footerButtons: e.arrayOf(
|
|
99
|
+
e.shape({
|
|
100
|
+
key: e.string.isRequired,
|
|
101
|
+
text: e.string.isRequired,
|
|
102
|
+
onClick: e.func.isRequired
|
|
103
|
+
})
|
|
104
|
+
),
|
|
105
|
+
maskClosable: e.bool
|
|
106
|
+
};
|
|
107
|
+
export {
|
|
108
|
+
O as default
|
|
109
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),t=require("react"),m=require("react-dom"),v=require("./index.js"),C=require("../../assets/Notice/成功.png.js"),N=require("../../assets/Notice/失败.png.js"),q=require("../../assets/Notice/警告.png.js"),s=t.createContext(null);function b({children:o}){const[u,r]=t.useState([]),a=t.useCallback(e=>{r(i=>i.filter(c=>c.id!==e))},[]),d=t.useCallback((e,i,c="default")=>{const l={success:C,fail:N,caution:q},x=Date.now()+Math.random();r(f=>[...f,{id:x,type:e,message:i,variant:c,icon:l[e]}])},[]);return n.jsxs(s.Provider,{value:{add:d},children:[o,m.createPortal(n.jsx("div",{id:"notification-container",children:u.map(e=>n.jsx(v,{...e,onClose:()=>a(e.id)},e.id))}),document.body)]})}function P(){const o=t.useContext(s);if(!o)throw new Error("useNotice must be used inside <NoticeProvider />");return o}exports.NoticeProvider=b;exports.useNoticeContext=P;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsxs as p, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as x, useState as N, useCallback as n, useContext as v } from "react";
|
|
3
|
+
import { createPortal as C } from "react-dom";
|
|
4
|
+
import h from "./index.mjs";
|
|
5
|
+
import P from "../../assets/Notice/成功.png.mjs";
|
|
6
|
+
import b from "../../assets/Notice/失败.png.mjs";
|
|
7
|
+
import w from "../../assets/Notice/警告.png.mjs";
|
|
8
|
+
const s = x(null);
|
|
9
|
+
function g({ children: t }) {
|
|
10
|
+
const [a, r] = N([]), d = n((o) => {
|
|
11
|
+
r((e) => e.filter((i) => i.id !== o));
|
|
12
|
+
}, []), m = n((o, e, i = "default") => {
|
|
13
|
+
const u = {
|
|
14
|
+
success: P,
|
|
15
|
+
fail: b,
|
|
16
|
+
caution: w
|
|
17
|
+
}, f = Date.now() + Math.random();
|
|
18
|
+
r((l) => [
|
|
19
|
+
...l,
|
|
20
|
+
{ id: f, type: o, message: e, variant: i, icon: u[o] }
|
|
21
|
+
]);
|
|
22
|
+
}, []);
|
|
23
|
+
return /* @__PURE__ */ p(s.Provider, { value: { add: m }, children: [
|
|
24
|
+
t,
|
|
25
|
+
C(
|
|
26
|
+
/* @__PURE__ */ c("div", { id: "notification-container", children: a.map((o) => /* @__PURE__ */ c(
|
|
27
|
+
h,
|
|
28
|
+
{
|
|
29
|
+
...o,
|
|
30
|
+
onClose: () => d(o.id)
|
|
31
|
+
},
|
|
32
|
+
o.id
|
|
33
|
+
)) }),
|
|
34
|
+
document.body
|
|
35
|
+
)
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
function q() {
|
|
39
|
+
const t = v(s);
|
|
40
|
+
if (!t)
|
|
41
|
+
throw new Error("useNotice must be used inside <NoticeProvider />");
|
|
42
|
+
return t;
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
g as NoticeProvider,
|
|
46
|
+
q as useNoticeContext
|
|
47
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o="_notice_1pn1d_1",t="_slideDown_1pn1d_1",d="_defaultNotice_1pn1d_67",e="_fadeOut_1pn1d_85",_="_slideUpFade_1pn1d_1",s="_mdNotice_1pn1d_95",i="_slideFromBottom_1pn1d_1",c="_slideToBottom_1pn1d_1",n="_md_fail_1pn1d_129",l="_md_caution_1pn1d_139",m="_md_success_1pn1d_149",a={notice:o,slideDown:t,defaultNotice:d,fadeOut:e,slideUpFade:_,mdNotice:s,slideFromBottom:i,slideToBottom:c,md_fail:n,md_caution:l,md_success:m};exports.default=a;exports.defaultNotice=d;exports.fadeOut=e;exports.mdNotice=s;exports.md_caution=l;exports.md_fail=n;exports.md_success=m;exports.notice=o;exports.slideDown=t;exports.slideFromBottom=i;exports.slideToBottom=c;exports.slideUpFade=_;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const o = "_notice_1pn1d_1", d = "_slideDown_1pn1d_1", t = "_defaultNotice_1pn1d_67", _ = "_fadeOut_1pn1d_85", e = "_slideUpFade_1pn1d_1", s = "_mdNotice_1pn1d_95", n = "_slideFromBottom_1pn1d_1", c = "_slideToBottom_1pn1d_1", i = "_md_fail_1pn1d_129", m = "_md_caution_1pn1d_139", l = "_md_success_1pn1d_149", a = {
|
|
2
|
+
notice: o,
|
|
3
|
+
slideDown: d,
|
|
4
|
+
defaultNotice: t,
|
|
5
|
+
fadeOut: _,
|
|
6
|
+
slideUpFade: e,
|
|
7
|
+
mdNotice: s,
|
|
8
|
+
slideFromBottom: n,
|
|
9
|
+
slideToBottom: c,
|
|
10
|
+
md_fail: i,
|
|
11
|
+
md_caution: m,
|
|
12
|
+
md_success: l
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
a as default,
|
|
16
|
+
t as defaultNotice,
|
|
17
|
+
_ as fadeOut,
|
|
18
|
+
s as mdNotice,
|
|
19
|
+
m as md_caution,
|
|
20
|
+
i as md_fail,
|
|
21
|
+
l as md_success,
|
|
22
|
+
o as notice,
|
|
23
|
+
d as slideDown,
|
|
24
|
+
n as slideFromBottom,
|
|
25
|
+
c as slideToBottom,
|
|
26
|
+
e as slideUpFade
|
|
27
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),a=require("react"),e=require("prop-types"),s=require("./TNotice.module.css.js");function n({type:u="success",icon:o,message:d,variant:t="default",onClose:c,duration:r=3e3}){return a.useEffect(()=>{const m=setTimeout(c,r);return()=>clearTimeout(m)},[c,r]),i.jsxs("div",{className:`${s.default.notice}
|
|
2
|
+
${t==="md"?s.default.mdNotice:s.default.defaultNotice}
|
|
3
|
+
${t==="md"?s.default[`md_${u}`]:""}`,children:[t!=="md"&&i.jsx("img",{src:o,alt:u}),i.jsx("span",{children:d})]})}n.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=n;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as n, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as f } from "react";
|
|
3
|
+
import e from "prop-types";
|
|
4
|
+
import s from "./TNotice.module.css.mjs";
|
|
5
|
+
function a({
|
|
6
|
+
type: t = "success",
|
|
7
|
+
icon: c,
|
|
8
|
+
message: u,
|
|
9
|
+
variant: i = "default",
|
|
10
|
+
onClose: r,
|
|
11
|
+
duration: o = 3e3
|
|
12
|
+
}) {
|
|
13
|
+
return f(() => {
|
|
14
|
+
const d = setTimeout(r, o);
|
|
15
|
+
return () => clearTimeout(d);
|
|
16
|
+
}, [r, o]), /* @__PURE__ */ n(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
className: `${s.notice}
|
|
20
|
+
${i === "md" ? s.mdNotice : s.defaultNotice}
|
|
21
|
+
${i === "md" ? s[`md_${t}`] : ""}`,
|
|
22
|
+
children: [
|
|
23
|
+
i !== "md" && /* @__PURE__ */ m("img", { src: c, alt: t }),
|
|
24
|
+
/* @__PURE__ */ m("span", { children: u })
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
a.propTypes = {
|
|
30
|
+
type: e.oneOf(["success", "fail", "caution"]),
|
|
31
|
+
icon: e.string.isRequired,
|
|
32
|
+
message: e.string.isRequired,
|
|
33
|
+
variant: e.oneOf(["default", "md"]),
|
|
34
|
+
onClose: e.func.isRequired,
|
|
35
|
+
duration: e.number
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
a as default
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react");const t=require("./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;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { useNoticeContext as t } from "./NoticeProvider.mjs";
|
|
3
|
+
function u() {
|
|
4
|
+
const { add: s } = t();
|
|
5
|
+
return {
|
|
6
|
+
success: (c) => s("success", c),
|
|
7
|
+
fail: (c) => s("fail", c),
|
|
8
|
+
caution: (c) => s("caution", c),
|
|
9
|
+
md: {
|
|
10
|
+
success: (c) => s("success", c, "md"),
|
|
11
|
+
fail: (c) => s("fail", c, "md"),
|
|
12
|
+
caution: (c) => s("caution", c, "md")
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
u as useNotice
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_searchContainer_1mhm8_1",s="_searchInput_1mhm8_11",t="_searchInput_small_1mhm8_55",a="_searchInput_medium_1mhm8_67",n="_searchInput_large_1mhm8_77",r="_searchInput_huge_1mhm8_89",h="_searchInputDisabled_1mhm8_101",c="_searchButton_1mhm8_117",u={searchContainer:e,searchInput:s,searchInput_small:t,searchInput_medium:a,searchInput_large:n,searchInput_huge:r,searchInputDisabled:h,searchButton:c};exports.default=u;exports.searchButton=c;exports.searchContainer=e;exports.searchInput=s;exports.searchInputDisabled=h;exports.searchInput_huge=r;exports.searchInput_large=n;exports.searchInput_medium=a;exports.searchInput_small=t;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const e = "_searchContainer_1mhm8_1", s = "_searchInput_1mhm8_11", t = "_searchInput_small_1mhm8_55", a = "_searchInput_medium_1mhm8_67", n = "_searchInput_large_1mhm8_77", _ = "_searchInput_huge_1mhm8_89", h = "_searchInputDisabled_1mhm8_101", c = "_searchButton_1mhm8_117", r = {
|
|
2
|
+
searchContainer: e,
|
|
3
|
+
searchInput: s,
|
|
4
|
+
searchInput_small: t,
|
|
5
|
+
searchInput_medium: a,
|
|
6
|
+
searchInput_large: n,
|
|
7
|
+
searchInput_huge: _,
|
|
8
|
+
searchInputDisabled: h,
|
|
9
|
+
searchButton: c
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
r as default,
|
|
13
|
+
c as searchButton,
|
|
14
|
+
e as searchContainer,
|
|
15
|
+
s as searchInput,
|
|
16
|
+
h as searchInputDisabled,
|
|
17
|
+
_ as searchInput_huge,
|
|
18
|
+
n as searchInput_large,
|
|
19
|
+
a as searchInput_medium,
|
|
20
|
+
t as searchInput_small
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"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;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsxs as T, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as C } from "react";
|
|
3
|
+
import e from "prop-types";
|
|
4
|
+
import s from "./TSearch.module.css.mjs";
|
|
5
|
+
import { useTangoStyle as $ } from "../CSSFab/useTangoStyle.mjs";
|
|
6
|
+
import j from "../TButton/index.mjs";
|
|
7
|
+
function w(u) {
|
|
8
|
+
const {
|
|
9
|
+
size: m = "medium",
|
|
10
|
+
sx: o = {},
|
|
11
|
+
style: p = {},
|
|
12
|
+
className: d = "",
|
|
13
|
+
onSearch: l = () => {
|
|
14
|
+
},
|
|
15
|
+
value: a,
|
|
16
|
+
defaultValue: f = "",
|
|
17
|
+
disabled: r = !1,
|
|
18
|
+
placeholder: y = "请输入内容",
|
|
19
|
+
path: c = "",
|
|
20
|
+
btnText: h = "搜索",
|
|
21
|
+
btnStyles: g = {}
|
|
22
|
+
} = u, n = C(null), S = $(typeof o == "object" ? o : {}), b = typeof o == "string" ? o : "", t = a !== void 0 && l !== void 0, v = `${s.searchInput} ${s[`searchInput_${m}`]} ${r ? s.searchInputDisabled : ""} ${b} ${d}`, x = { ...S, ...p };
|
|
23
|
+
return /* @__PURE__ */ T("div", { className: s.searchContainer, children: [
|
|
24
|
+
/* @__PURE__ */ i(
|
|
25
|
+
"input",
|
|
26
|
+
{
|
|
27
|
+
className: v,
|
|
28
|
+
style: x,
|
|
29
|
+
ref: t ? void 0 : n,
|
|
30
|
+
onKeyDown: (N) => N.key === "Enter" && l(t ? a : n.current.value),
|
|
31
|
+
value: t ? a : void 0,
|
|
32
|
+
defaultValue: t ? void 0 : f,
|
|
33
|
+
disabled: r,
|
|
34
|
+
placeholder: y
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
/* @__PURE__ */ i(
|
|
38
|
+
j,
|
|
39
|
+
{
|
|
40
|
+
className: s.searchButton,
|
|
41
|
+
onClick: () => l(t ? a : n.current.value),
|
|
42
|
+
style: g,
|
|
43
|
+
size: "small",
|
|
44
|
+
disabled: r,
|
|
45
|
+
children: c ? /* @__PURE__ */ i(
|
|
46
|
+
"img",
|
|
47
|
+
{
|
|
48
|
+
src: c,
|
|
49
|
+
alt: "search-icon",
|
|
50
|
+
style: { width: 16, height: 16, marginTop: 2, marginBottom: -3 }
|
|
51
|
+
}
|
|
52
|
+
) : h
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
] });
|
|
56
|
+
}
|
|
57
|
+
w.propTypes = {
|
|
58
|
+
size: e.oneOf(["small", "medium", "large", "huge"]),
|
|
59
|
+
sx: e.oneOfType([e.object, e.string]),
|
|
60
|
+
style: e.object,
|
|
61
|
+
onSearch: e.func.isRequired,
|
|
62
|
+
className: e.string,
|
|
63
|
+
value: e.string,
|
|
64
|
+
defaultValue: e.string,
|
|
65
|
+
disabled: e.bool,
|
|
66
|
+
placeholder: e.string,
|
|
67
|
+
path: e.string,
|
|
68
|
+
btnText: e.string
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
w as default
|
|
72
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_space_15nmk_1",_="_space_default_15nmk_3",a="_space_inline_15nmk_17",c="_space_fixed_15nmk_25",s="_space_absolute_15nmk_33",l="_space_relative_15nmk_41",p="_space_circle_15nmk_49",t="_space_triangle_15nmk_57",n="_space_halfCircle_15nmk_73",i={space:e,space_default:_,space_inline:a,space_fixed:c,space_absolute:s,space_relative:l,space_circle:p,space_triangle:t,space_halfCircle:n};exports.default=i;exports.space=e;exports.space_absolute=s;exports.space_circle=p;exports.space_default=_;exports.space_fixed=c;exports.space_halfCircle=n;exports.space_inline=a;exports.space_relative=l;exports.space_triangle=t;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const e = "_space_15nmk_1", _ = "_space_default_15nmk_3", c = "_space_inline_15nmk_17", a = "_space_fixed_15nmk_25", s = "_space_absolute_15nmk_33", n = "_space_relative_15nmk_41", p = "_space_circle_15nmk_49", l = "_space_triangle_15nmk_57", t = "_space_halfCircle_15nmk_73", i = {
|
|
2
|
+
space: e,
|
|
3
|
+
space_default: _,
|
|
4
|
+
space_inline: c,
|
|
5
|
+
space_fixed: a,
|
|
6
|
+
space_absolute: s,
|
|
7
|
+
space_relative: n,
|
|
8
|
+
space_circle: p,
|
|
9
|
+
space_triangle: l,
|
|
10
|
+
space_halfCircle: t
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
i as default,
|
|
14
|
+
e as space,
|
|
15
|
+
s as space_absolute,
|
|
16
|
+
p as space_circle,
|
|
17
|
+
_ as space_default,
|
|
18
|
+
a as space_fixed,
|
|
19
|
+
t as space_halfCircle,
|
|
20
|
+
c as space_inline,
|
|
21
|
+
n as space_relative,
|
|
22
|
+
l as space_triangle
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const S=require("react/jsx-runtime");require("react");const e=require("prop-types"),t=require("./TSpace.module.css.js"),m=require("../CSSFab/useTangoStyle.js");function c(n,l){const{sx:s={},style:o={},className:r="",onClick:i,children:a,type:u="default"}=n,y=typeof s=="object"?s:{},p=m.useTangoStyle(y),d=typeof s=="string"?s:"",f={...p,...o},x=`${d} ${t.default.space} ${t.default[`space_${u}`]||""} ${r}`;return S.jsx("div",{ref:l,style:f,onClick:i,className:x,children:a})}c.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};module.exports=c;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import e from "prop-types";
|
|
4
|
+
import s from "./TSpace.module.css.mjs";
|
|
5
|
+
import { useTangoStyle as d } from "../CSSFab/useTangoStyle.mjs";
|
|
6
|
+
function x(o, l) {
|
|
7
|
+
const {
|
|
8
|
+
sx: t = {},
|
|
9
|
+
style: r = {},
|
|
10
|
+
className: c = "",
|
|
11
|
+
onClick: n,
|
|
12
|
+
children: i,
|
|
13
|
+
type: a = "default"
|
|
14
|
+
} = o, p = d(typeof t == "object" ? t : {}), y = typeof t == "string" ? t : "", f = { ...p, ...r }, m = `${y} ${s.space} ${s[`space_${a}`] || ""} ${c}`;
|
|
15
|
+
return /* @__PURE__ */ u(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
ref: l,
|
|
19
|
+
style: f,
|
|
20
|
+
onClick: n,
|
|
21
|
+
className: m,
|
|
22
|
+
children: i
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
x.propTypes = {
|
|
27
|
+
type: e.oneOf([
|
|
28
|
+
"default",
|
|
29
|
+
"inline",
|
|
30
|
+
"circle",
|
|
31
|
+
"triangle",
|
|
32
|
+
"halfCircle",
|
|
33
|
+
"fixed",
|
|
34
|
+
"absolute",
|
|
35
|
+
"relative"
|
|
36
|
+
]),
|
|
37
|
+
sx: e.oneOfType([e.string, e.object]),
|
|
38
|
+
style: e.object,
|
|
39
|
+
onClick: e.func,
|
|
40
|
+
className: e.string,
|
|
41
|
+
children: e.node.isRequired
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
x as default
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_wrapper_1g73i_1",t="_table_1g73i_33",a="_thead_1g73i_51",l="_tableHeader_1g73i_83",_="_headerContent_1g73i_147",n="_tableRow_1g73i_159",o="_tableCell_1g73i_187",r="_cellContent_1g73i_255",b="_empty_1g73i_267",c="_emptyState_1g73i_279",p={wrapper:e,table:t,thead:a,tableHeader:l,headerContent:_,tableRow:n,tableCell:o,cellContent:r,empty:b,emptyState:c};exports.cellContent=r;exports.default=p;exports.empty=b;exports.emptyState=c;exports.headerContent=_;exports.table=t;exports.tableCell=o;exports.tableHeader=l;exports.tableRow=n;exports.thead=a;exports.wrapper=e;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const e = "_wrapper_1g73i_1", t = "_table_1g73i_33", _ = "_thead_1g73i_51", a = "_tableHeader_1g73i_83", l = "_headerContent_1g73i_147", n = "_tableRow_1g73i_159", o = "_tableCell_1g73i_187", c = "_cellContent_1g73i_255", s = "_empty_1g73i_267", p = "_emptyState_1g73i_279", r = {
|
|
2
|
+
wrapper: e,
|
|
3
|
+
table: t,
|
|
4
|
+
thead: _,
|
|
5
|
+
tableHeader: a,
|
|
6
|
+
headerContent: l,
|
|
7
|
+
tableRow: n,
|
|
8
|
+
tableCell: o,
|
|
9
|
+
cellContent: c,
|
|
10
|
+
empty: s,
|
|
11
|
+
emptyState: p
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
c as cellContent,
|
|
15
|
+
r as default,
|
|
16
|
+
s as empty,
|
|
17
|
+
p as emptyState,
|
|
18
|
+
l as headerContent,
|
|
19
|
+
t as table,
|
|
20
|
+
o as tableCell,
|
|
21
|
+
a as tableHeader,
|
|
22
|
+
n as tableRow,
|
|
23
|
+
_ as thead,
|
|
24
|
+
e as wrapper
|
|
25
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"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
|
+
.${i.default.table} tbody tr:hover {
|
|
3
|
+
background-color: ${o} !important;
|
|
4
|
+
transform: translateY(-1px);
|
|
5
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
|
6
|
+
}
|
|
7
|
+
`}),a.jsxs("table",{className:`${i.default.table} ${C}`,style:$,children:[a.jsx("thead",{className:`${i.default.thead} ${R}`,style:v,children:a.jsx("tr",{className:T,style:q,children:p.map(e=>a.jsx("th",{style:e.width?{width:e.width}:{},className:i.default.tableHeader,children:a.jsx("div",{className:i.default.headerContent,children:e.title})},e.key||e.dataIndex))})}),a.jsx("tbody",{children:m.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:p.length,className:i.default.empty,children:a.jsx("div",{className:i.default.emptyState,children:a.jsx("div",{children:"暂无数据"})})})}):m.map((e,s)=>{const n=s%2===0?"even":"odd";return a.jsx("tr",{className:`${i.default.tableRow} ${P(e,s,n)}`,style:O(e,s,n),children:p.map((r,d)=>{const l=d%2===0?"even":"odd";return a.jsx("td",{className:`${i.default.tableCell} ${S(e,r,s,d,n,l)}`,style:{...r.width?{width:r.width}:{},...A(e,r,s,d,n,l)},children:a.jsx("div",{className:i.default.cellContent,children:r.render?r.render(e[r.dataIndex],e,s):e[r.dataIndex]})},r.key||r.dataIndex||d)})},e.key||s)})})]})]})}g.propTypes={dataSource:t.array.isRequired,columns:t.arrayOf(t.shape({title:t.string.isRequired,dataIndex:t.string.isRequired,key:t.oneOfType([t.string,t.number]),render:t.func})).isRequired,className:t.string,tableWrapperClassName:t.string,containerClassName:t.string,theadClassName:t.string,trClassName:t.string,rowClassName:t.func,rowStyle:t.func,cellClassName:t.func,cellStyle:t.func,hoverColor:t.string,hide:t.oneOfType([t.arrayOf(t.string),t.string])};module.exports=g;
|