tango-ui-cw 0.9.8 → 1.0.0
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 +124 -39
- package/dist/component/CSSFab/index.d.ts +55 -0
- package/dist/component/CSSFab/useTangoStyle.d.ts +1 -0
- package/dist/component/TBanner/index.d.ts +50 -0
- package/dist/component/TButton/index.d.ts +107 -0
- package/dist/component/TColorPicker/index.d.ts +41 -0
- package/dist/component/TDate/index.d.ts +41 -0
- package/dist/component/TDatePicker/index.d.ts +49 -0
- package/dist/component/TDrawer/index.d.ts +58 -0
- package/dist/component/TInput/index.d.ts +81 -0
- package/dist/component/TLayout/index.d.ts +133 -0
- package/dist/component/TLine/index.d.ts +33 -0
- package/dist/component/TMark/index.d.ts +38 -0
- package/dist/component/TModal/index.d.ts +52 -0
- package/dist/component/TNotice/index.d.ts +30 -0
- package/dist/component/TSearch/index.d.ts +42 -0
- package/dist/component/TSpace/index.d.ts +56 -0
- package/dist/component/TTable/index.d.ts +76 -0
- package/dist/component/TTooltip/index.d.ts +31 -0
- package/dist/component/TUpload/index.d.ts +45 -0
- package/dist/component/index.d.ts +147 -0
- package/dist/index.cjs +12 -0
- package/dist/index.d.cts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +3648 -2
- package/dist/providers/NoticeProvider/NoticeProvider.d.ts +19 -0
- package/dist/providers/TangoI18nProvider/TangoI18nProvider.d.ts +28 -0
- package/dist/providers/ThemeProvider/ThemeProvider.d.ts +22 -0
- package/dist/scripts/check-peers.js +75 -0
- package/dist/styles/global.css +372 -0
- package/dist/styles/theme.css +13 -0
- package/package.json +65 -48
- package/dist/assets/Upload/delLogo.png.js +0 -1
- package/dist/assets/Upload/delLogo.png.mjs +0 -4
- package/dist/assets/Upload/fileslogo.png.js +0 -1
- package/dist/assets/Upload/fileslogo.png.mjs +0 -4
- package/dist/component/CSSFab/useTangoStyle.js +0 -2
- package/dist/component/CSSFab/useTangoStyle.mjs +0 -171
- package/dist/component/MaterialButton/MaterialButton.module.css.js +0 -1
- package/dist/component/MaterialButton/MaterialButton.module.css.mjs +0 -17
- package/dist/component/MaterialButton/index.js +0 -2
- package/dist/component/MaterialButton/index.mjs +0 -62
- package/dist/component/MaterialInput/MaterialInput.module.css.js +0 -1
- package/dist/component/MaterialInput/MaterialInput.module.css.mjs +0 -17
- package/dist/component/MaterialInput/index.js +0 -2
- package/dist/component/MaterialInput/index.mjs +0 -37
- package/dist/component/TBanner/TBanner.module.css.js +0 -1
- package/dist/component/TBanner/TBanner.module.css.mjs +0 -35
- package/dist/component/TBanner/index.js +0 -2
- package/dist/component/TBanner/index.mjs +0 -341
- package/dist/component/TButton/TButton.module.css.js +0 -1
- package/dist/component/TButton/TButton.module.css.mjs +0 -26
- package/dist/component/TButton/index.js +0 -2
- package/dist/component/TButton/index.mjs +0 -186
- package/dist/component/TColorPicker/TColorPicker.module.css.js +0 -1
- package/dist/component/TColorPicker/TColorPicker.module.css.mjs +0 -13
- package/dist/component/TColorPicker/index.js +0 -2
- package/dist/component/TColorPicker/index.mjs +0 -62
- package/dist/component/TDate/index.js +0 -2
- package/dist/component/TDate/index.mjs +0 -145
- package/dist/component/TDatePicker/TDatePicker.module.css.js +0 -1
- package/dist/component/TDatePicker/TDatePicker.module.css.mjs +0 -45
- package/dist/component/TDatePicker/index.js +0 -2
- package/dist/component/TDatePicker/index.mjs +0 -167
- package/dist/component/TDrawer/TDrawer.module.css.js +0 -1
- package/dist/component/TDrawer/TDrawer.module.css.mjs +0 -49
- package/dist/component/TDrawer/index.js +0 -2
- package/dist/component/TDrawer/index.mjs +0 -111
- package/dist/component/TInput/TInput.module.css.js +0 -1
- package/dist/component/TInput/TInput.module.css.mjs +0 -21
- package/dist/component/TInput/index.js +0 -2
- package/dist/component/TInput/index.mjs +0 -75
- package/dist/component/TLayout/index.js +0 -2
- package/dist/component/TLayout/index.mjs +0 -53
- package/dist/component/TLine/TLine.module.css.js +0 -1
- package/dist/component/TLine/TLine.module.css.mjs +0 -19
- package/dist/component/TLine/index.js +0 -2
- package/dist/component/TLine/index.mjs +0 -35
- package/dist/component/TMark/TMark.module.css.js +0 -1
- package/dist/component/TMark/TMark.module.css.mjs +0 -7
- package/dist/component/TMark/index.js +0 -2
- package/dist/component/TMark/index.mjs +0 -52
- package/dist/component/TModal/TModal.module.css.js +0 -1
- package/dist/component/TModal/TModal.module.css.mjs +0 -33
- package/dist/component/TModal/index.js +0 -2
- package/dist/component/TModal/index.mjs +0 -110
- package/dist/component/TNotice/TNotice.module.css.js +0 -1
- package/dist/component/TNotice/TNotice.module.css.mjs +0 -27
- package/dist/component/TNotice/index.js +0 -4
- package/dist/component/TNotice/index.mjs +0 -40
- package/dist/component/TNotice/useNotice.js +0 -2
- package/dist/component/TNotice/useNotice.mjs +0 -19
- package/dist/component/TSearch/TSearch.module.css.js +0 -1
- package/dist/component/TSearch/TSearch.module.css.mjs +0 -21
- package/dist/component/TSearch/index.js +0 -2
- package/dist/component/TSearch/index.mjs +0 -73
- package/dist/component/TSpace/TSpace.module.css.js +0 -1
- package/dist/component/TSpace/TSpace.module.css.mjs +0 -23
- package/dist/component/TSpace/index.js +0 -2
- package/dist/component/TSpace/index.mjs +0 -49
- package/dist/component/TTable/TTable.module.css.js +0 -1
- package/dist/component/TTable/TTable.module.css.mjs +0 -25
- package/dist/component/TTable/index.js +0 -8
- package/dist/component/TTable/index.mjs +0 -154
- package/dist/component/TTooltip/TTooltip.module.css.js +0 -1
- package/dist/component/TTooltip/TTooltip.module.css.mjs +0 -17
- package/dist/component/TTooltip/index.js +0 -2
- package/dist/component/TTooltip/index.mjs +0 -34
- package/dist/component/TUpload/TUpload.module.css.js +0 -1
- package/dist/component/TUpload/TUpload.module.css.mjs +0 -15
- package/dist/component/TUpload/index.js +0 -2
- package/dist/component/TUpload/index.mjs +0 -152
- package/dist/index.mjs +0 -50
- package/dist/providers/NoticeProvider.js +0 -2
- package/dist/providers/NoticeProvider.mjs +0 -117
- package/dist/providers/ThemeProvider.js +0 -2
- package/dist/providers/ThemeProvider.mjs +0 -21
- package/dist/tango-ui-cw.css +0 -1
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as $ } from "react/jsx-runtime";
|
|
3
|
-
import "react";
|
|
4
|
-
import n from "prop-types";
|
|
5
|
-
import { useTangoStyle as p } from "../CSSFab/useTangoStyle.mjs";
|
|
6
|
-
function h(l) {
|
|
7
|
-
const {
|
|
8
|
-
type: s = "default",
|
|
9
|
-
single: c = !1,
|
|
10
|
-
sx: r = {},
|
|
11
|
-
style: d = {},
|
|
12
|
-
className: g = "",
|
|
13
|
-
en: a = !1,
|
|
14
|
-
...u
|
|
15
|
-
} = l || {}, o = typeof r == "object" && r !== null && !Array.isArray(r), m = p(o ? r : {}), y = [o ? "" : r, g].filter(Boolean).join(" "), f = { ...m, ...d };
|
|
16
|
-
return /* @__PURE__ */ $("div", { className: y, style: f, ...u, children: ((S) => {
|
|
17
|
-
const e = /* @__PURE__ */ new Date();
|
|
18
|
-
let t = a ? "en-US" : "zh-CN", i = e.toLocaleString(t, { weekday: "long" });
|
|
19
|
-
switch (!a && c && (i = i.replace("星期", "周")), S) {
|
|
20
|
-
case "line":
|
|
21
|
-
return e.toLocaleDateString(t, {
|
|
22
|
-
year: "numeric",
|
|
23
|
-
month: "2-digit",
|
|
24
|
-
day: "2-digit"
|
|
25
|
-
}).replaceAll("/", "-");
|
|
26
|
-
case "full":
|
|
27
|
-
return `${e.toLocaleDateString(t, {
|
|
28
|
-
year: "numeric",
|
|
29
|
-
month: "2-digit",
|
|
30
|
-
day: "2-digit"
|
|
31
|
-
})} ${i} ${e.toLocaleTimeString(t, {
|
|
32
|
-
hour: "2-digit",
|
|
33
|
-
minute: "2-digit",
|
|
34
|
-
second: "2-digit"
|
|
35
|
-
})}`;
|
|
36
|
-
case "full-line":
|
|
37
|
-
return `${e.toLocaleDateString(t, {
|
|
38
|
-
year: "numeric",
|
|
39
|
-
month: "2-digit",
|
|
40
|
-
day: "2-digit"
|
|
41
|
-
}).replaceAll("/", "-")} ${i} ${e.toLocaleTimeString(
|
|
42
|
-
t,
|
|
43
|
-
{
|
|
44
|
-
hour: "2-digit",
|
|
45
|
-
minute: "2-digit",
|
|
46
|
-
second: "2-digit"
|
|
47
|
-
}
|
|
48
|
-
)}`;
|
|
49
|
-
case "year-week":
|
|
50
|
-
return `${e.toLocaleDateString(t, {
|
|
51
|
-
year: "numeric",
|
|
52
|
-
month: "2-digit",
|
|
53
|
-
day: "2-digit"
|
|
54
|
-
})} ${i}`;
|
|
55
|
-
case "year-week-line":
|
|
56
|
-
return `${e.toLocaleDateString(t, {
|
|
57
|
-
year: "numeric",
|
|
58
|
-
month: "2-digit",
|
|
59
|
-
day: "2-digit"
|
|
60
|
-
}).replaceAll("/", "-")} ${i}`;
|
|
61
|
-
case "week-time":
|
|
62
|
-
return `${i} ${e.toLocaleTimeString(t, {
|
|
63
|
-
hour: "2-digit",
|
|
64
|
-
minute: "2-digit",
|
|
65
|
-
second: "2-digit"
|
|
66
|
-
})}`;
|
|
67
|
-
case "no-s":
|
|
68
|
-
return `${e.toLocaleDateString(t, {
|
|
69
|
-
year: "numeric",
|
|
70
|
-
month: "2-digit",
|
|
71
|
-
day: "2-digit"
|
|
72
|
-
})} ${i} ${e.toLocaleTimeString(t, {
|
|
73
|
-
hour: "2-digit",
|
|
74
|
-
minute: "2-digit"
|
|
75
|
-
})}`;
|
|
76
|
-
case "no-s-line":
|
|
77
|
-
return `${e.toLocaleDateString(t, {
|
|
78
|
-
year: "numeric",
|
|
79
|
-
month: "2-digit",
|
|
80
|
-
day: "2-digit"
|
|
81
|
-
}).replaceAll("/", "-")} ${i} ${e.toLocaleTimeString(
|
|
82
|
-
t,
|
|
83
|
-
{
|
|
84
|
-
hour: "2-digit",
|
|
85
|
-
minute: "2-digit"
|
|
86
|
-
}
|
|
87
|
-
)}`;
|
|
88
|
-
case "us-full":
|
|
89
|
-
return `${e.toLocaleDateString("en-US", {
|
|
90
|
-
year: "numeric",
|
|
91
|
-
month: "2-digit",
|
|
92
|
-
day: "2-digit"
|
|
93
|
-
})} ${i} ${e.toLocaleTimeString(t, {
|
|
94
|
-
hour: "2-digit",
|
|
95
|
-
minute: "2-digit",
|
|
96
|
-
second: "2-digit"
|
|
97
|
-
})}`;
|
|
98
|
-
case "us-full-line":
|
|
99
|
-
return `${e.toLocaleDateString("en-US", {
|
|
100
|
-
year: "numeric",
|
|
101
|
-
month: "2-digit",
|
|
102
|
-
day: "2-digit"
|
|
103
|
-
}).replaceAll("/", "-")} ${i} ${e.toLocaleTimeString(
|
|
104
|
-
t,
|
|
105
|
-
{
|
|
106
|
-
hour: "2-digit",
|
|
107
|
-
minute: "2-digit",
|
|
108
|
-
second: "2-digit"
|
|
109
|
-
}
|
|
110
|
-
)}`;
|
|
111
|
-
default:
|
|
112
|
-
return e.toLocaleDateString(t, {
|
|
113
|
-
year: "numeric",
|
|
114
|
-
month: "2-digit",
|
|
115
|
-
day: "2-digit"
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
})(s) });
|
|
119
|
-
}
|
|
120
|
-
h.propTypes = {
|
|
121
|
-
type: n.oneOf([
|
|
122
|
-
"line",
|
|
123
|
-
"full",
|
|
124
|
-
"full-line",
|
|
125
|
-
"year-week",
|
|
126
|
-
"year-week-line",
|
|
127
|
-
"week-time",
|
|
128
|
-
"no-s",
|
|
129
|
-
"no-s-line",
|
|
130
|
-
"us-full",
|
|
131
|
-
"us-full-line"
|
|
132
|
-
]),
|
|
133
|
-
single: n.bool,
|
|
134
|
-
// 控制显示“周”或“星期”
|
|
135
|
-
sx: n.oneOfType([n.object, n.string]),
|
|
136
|
-
// 自定义样式对象
|
|
137
|
-
style: n.object,
|
|
138
|
-
// 用户传入的 style 属性
|
|
139
|
-
className: n.string,
|
|
140
|
-
en: n.bool
|
|
141
|
-
// 控制英文格式
|
|
142
|
-
};
|
|
143
|
-
export {
|
|
144
|
-
h as default
|
|
145
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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,45 +0,0 @@
|
|
|
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,
|
|
3
|
-
datePicker: e,
|
|
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
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
l as calendarDays,
|
|
25
|
-
o as calendarHeader,
|
|
26
|
-
a as calendarPanel,
|
|
27
|
-
D as cancelButton,
|
|
28
|
-
k as confirmButton,
|
|
29
|
-
e as datePicker,
|
|
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
|
|
45
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
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,167 +0,0 @@
|
|
|
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) {
|
|
8
|
-
const {
|
|
9
|
-
className: b = "",
|
|
10
|
-
disabled: p = !1,
|
|
11
|
-
onChange: v = () => {
|
|
12
|
-
},
|
|
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);
|
|
44
|
-
}
|
|
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
|
-
] });
|
|
158
|
-
}
|
|
159
|
-
J.propTypes = {
|
|
160
|
-
className: f.string,
|
|
161
|
-
disabled: f.bool,
|
|
162
|
-
onChange: f.func,
|
|
163
|
-
time: f.bool
|
|
164
|
-
};
|
|
165
|
-
export {
|
|
166
|
-
J as default
|
|
167
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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,49 +0,0 @@
|
|
|
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
|
-
drawerHeaderTitle: o,
|
|
6
|
-
drawerContent: _,
|
|
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
|
-
comeInTop: B,
|
|
18
|
-
comeOutTop: O,
|
|
19
|
-
comeInBottom: i,
|
|
20
|
-
comeOutBottom: l,
|
|
21
|
-
drawerButton: C,
|
|
22
|
-
drawerButtonOk: I,
|
|
23
|
-
drawerButtonCancel: T
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
i as comeInBottom,
|
|
27
|
-
u as comeInLeft,
|
|
28
|
-
s as comeInRight,
|
|
29
|
-
B as comeInTop,
|
|
30
|
-
l as comeOutBottom,
|
|
31
|
-
z as comeOutLeft,
|
|
32
|
-
j as comeOutRight,
|
|
33
|
-
O as comeOutTop,
|
|
34
|
-
f as default,
|
|
35
|
-
m as drawerBottom,
|
|
36
|
-
C as drawerButton,
|
|
37
|
-
T as drawerButtonCancel,
|
|
38
|
-
I as drawerButtonOk,
|
|
39
|
-
a as drawerCloseBtn,
|
|
40
|
-
t as drawerContainer,
|
|
41
|
-
_ as drawerContent,
|
|
42
|
-
n as drawerFooter,
|
|
43
|
-
r as drawerHeader,
|
|
44
|
-
o as drawerHeaderTitle,
|
|
45
|
-
d as drawerLeft,
|
|
46
|
-
e as drawerOverlay,
|
|
47
|
-
c as drawerRight,
|
|
48
|
-
w as drawerTop
|
|
49
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
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;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as o, Fragment as T, jsxs as h } from "react/jsx-runtime";
|
|
3
|
-
import { useState as p, useEffect as N } from "react";
|
|
4
|
-
import e from "prop-types";
|
|
5
|
-
import t from "./TDrawer.module.css.mjs";
|
|
6
|
-
import B from "../TButton/index.mjs";
|
|
7
|
-
function O(u) {
|
|
8
|
-
const {
|
|
9
|
-
children: y,
|
|
10
|
-
title: k = "基础标题",
|
|
11
|
-
okText: w = "确定",
|
|
12
|
-
cancelText: C = "取消",
|
|
13
|
-
open: c = !1,
|
|
14
|
-
onClose: l = () => {
|
|
15
|
-
},
|
|
16
|
-
type: s = "right",
|
|
17
|
-
containerStyles: g,
|
|
18
|
-
headerStyles: x,
|
|
19
|
-
footerStyles: v,
|
|
20
|
-
btnStyles: i,
|
|
21
|
-
footerButtons: a,
|
|
22
|
-
maskClosable: $ = !0
|
|
23
|
-
} = u, [d, f] = p(!1), [m, n] = p(!1);
|
|
24
|
-
N(() => {
|
|
25
|
-
c ? (f(!0), n(!1)) : d && (n(!0), setTimeout(() => {
|
|
26
|
-
f(!1), n(!1);
|
|
27
|
-
}, 300));
|
|
28
|
-
}, [c]);
|
|
29
|
-
const S = /* @__PURE__ */ o(
|
|
30
|
-
"svg",
|
|
31
|
-
{
|
|
32
|
-
t: "1770778790558",
|
|
33
|
-
class: "icon",
|
|
34
|
-
viewBox: "0 0 1024 1024",
|
|
35
|
-
version: "1.1",
|
|
36
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
37
|
-
"p-id": "5372",
|
|
38
|
-
width: "25",
|
|
39
|
-
height: "25",
|
|
40
|
-
children: /* @__PURE__ */ o(
|
|
41
|
-
"path",
|
|
42
|
-
{
|
|
43
|
-
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",
|
|
44
|
-
fill: "#707070",
|
|
45
|
-
"p-id": "5373"
|
|
46
|
-
}
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
return /* @__PURE__ */ o(T, { children: d && /* @__PURE__ */ o(
|
|
51
|
-
"div",
|
|
52
|
-
{
|
|
53
|
-
className: `${t.drawerOverlay} ${m ? t.fadeOut : t.fadeIn}`,
|
|
54
|
-
onClick: (r) => {
|
|
55
|
-
$ && r.target === r.currentTarget && l();
|
|
56
|
-
},
|
|
57
|
-
children: /* @__PURE__ */ h(
|
|
58
|
-
"div",
|
|
59
|
-
{
|
|
60
|
-
className: `${t.drawerContainer} ${t[`drawer${s.charAt(0).toUpperCase() + s.slice(1)}`]} ${m ? t[`comeOut${s.charAt(0).toUpperCase() + s.slice(1)}`] : t[`comeIn${s.charAt(0).toUpperCase() + s.slice(1)}`]}`,
|
|
61
|
-
style: g,
|
|
62
|
-
children: [
|
|
63
|
-
/* @__PURE__ */ h("div", { className: t.drawerHeader, children: [
|
|
64
|
-
/* @__PURE__ */ o("h3", { className: t.drawerHeaderTitle, style: x, children: k }),
|
|
65
|
-
/* @__PURE__ */ o("div", { className: t.drawerCloseBtn, onClick: l, children: S })
|
|
66
|
-
] }),
|
|
67
|
-
/* @__PURE__ */ o("div", { className: t.drawerContent, children: y }),
|
|
68
|
-
/* @__PURE__ */ o("div", { className: t.drawerFooter, style: v, children: (a != null && a.length ? a : [
|
|
69
|
-
{ key: "cancel", text: C, onClick: l },
|
|
70
|
-
{ key: "ok", text: w, onClick: l }
|
|
71
|
-
]).map((r) => /* @__PURE__ */ o(
|
|
72
|
-
B,
|
|
73
|
-
{
|
|
74
|
-
onClick: r.onClick,
|
|
75
|
-
style: r.key === "ok" ? (i == null ? void 0 : i[r.key]) || {} : {},
|
|
76
|
-
className: `${t.drawerButton} ${r.key === "ok" ? t.drawerButtonOk : t.drawerButtonCancel}`,
|
|
77
|
-
children: r.text
|
|
78
|
-
},
|
|
79
|
-
r.key
|
|
80
|
-
)) })
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
) });
|
|
86
|
-
}
|
|
87
|
-
O.propTypes = {
|
|
88
|
-
children: e.node.isRequired,
|
|
89
|
-
title: e.string,
|
|
90
|
-
okText: e.string,
|
|
91
|
-
cancelText: e.string,
|
|
92
|
-
open: e.bool,
|
|
93
|
-
onOk: e.func,
|
|
94
|
-
onClose: e.func,
|
|
95
|
-
type: e.oneOf(["top", "bottom", "left", "right"]),
|
|
96
|
-
containerStyles: e.object,
|
|
97
|
-
headerStyles: e.object,
|
|
98
|
-
footerStyles: e.object,
|
|
99
|
-
btnStyles: e.object,
|
|
100
|
-
footerButtons: e.arrayOf(
|
|
101
|
-
e.shape({
|
|
102
|
-
key: e.string.isRequired,
|
|
103
|
-
text: e.string.isRequired,
|
|
104
|
-
onClick: e.func.isRequired
|
|
105
|
-
})
|
|
106
|
-
),
|
|
107
|
-
maskClosable: e.bool
|
|
108
|
-
};
|
|
109
|
-
export {
|
|
110
|
-
O as default
|
|
111
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t="_input_1cwtp_1",u="_inputSmall_1cwtp_45",i="_inputMedium_1cwtp_57",n="_inputLarge_1cwtp_67",p="_inputHuge_1cwtp_79",e="_inputDisabled_1cwtp_91",_="_inputTextarea_1cwtp_107",r="_inputError_1cwtp_117",a={input:t,inputSmall:u,inputMedium:i,inputLarge:n,inputHuge:p,inputDisabled:e,inputTextarea:_,inputError:r};exports.default=a;exports.input=t;exports.inputDisabled=e;exports.inputError=r;exports.inputHuge=p;exports.inputLarge=n;exports.inputMedium=i;exports.inputSmall=u;exports.inputTextarea=_;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const t = "_input_1cwtp_1", n = "_inputSmall_1cwtp_45", p = "_inputMedium_1cwtp_57", u = "_inputLarge_1cwtp_67", i = "_inputHuge_1cwtp_79", _ = "_inputDisabled_1cwtp_91", e = "_inputTextarea_1cwtp_107", a = "_inputError_1cwtp_117", c = {
|
|
2
|
-
input: t,
|
|
3
|
-
inputSmall: n,
|
|
4
|
-
inputMedium: p,
|
|
5
|
-
inputLarge: u,
|
|
6
|
-
inputHuge: i,
|
|
7
|
-
inputDisabled: _,
|
|
8
|
-
inputTextarea: e,
|
|
9
|
-
inputError: a
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
c as default,
|
|
13
|
-
t as input,
|
|
14
|
-
_ as inputDisabled,
|
|
15
|
-
a as inputError,
|
|
16
|
-
i as inputHuge,
|
|
17
|
-
u as inputLarge,
|
|
18
|
-
p as inputMedium,
|
|
19
|
-
n as inputSmall,
|
|
20
|
-
e as inputTextarea
|
|
21
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
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,75 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import "react";
|
|
4
|
-
import e from "prop-types";
|
|
5
|
-
import a from "./TInput.module.css.mjs";
|
|
6
|
-
import { useTangoStyle as V } from "../CSSFab/useTangoStyle.mjs";
|
|
7
|
-
function p(c) {
|
|
8
|
-
const {
|
|
9
|
-
type: l = "default",
|
|
10
|
-
size: o = "medium",
|
|
11
|
-
sx: s = {},
|
|
12
|
-
style: m = {},
|
|
13
|
-
className: f = "",
|
|
14
|
-
onClick: y = () => {
|
|
15
|
-
},
|
|
16
|
-
onChange: n = () => {
|
|
17
|
-
},
|
|
18
|
-
value: i,
|
|
19
|
-
defaultValue: g = "",
|
|
20
|
-
disabled: r = !1,
|
|
21
|
-
placeholder: x = "",
|
|
22
|
-
maxlength: C = 524288
|
|
23
|
-
} = c, h = a.input, b = a[`input${o.charAt(0).toUpperCase() + o.slice(1)}`] || "", v = r ? a.inputDisabled : "", S = V(typeof s == "object" ? s : {}), N = typeof s == "string" ? s : "", d = i !== void 0, j = [
|
|
24
|
-
h,
|
|
25
|
-
b,
|
|
26
|
-
v,
|
|
27
|
-
N,
|
|
28
|
-
// sx 为 className 字符串
|
|
29
|
-
f
|
|
30
|
-
// 额外 className
|
|
31
|
-
].filter(Boolean).join(" "), w = { ...S, ...m }, T = l === "password" ? "password" : "text", u = {
|
|
32
|
-
className: j,
|
|
33
|
-
style: w,
|
|
34
|
-
onClick: y,
|
|
35
|
-
onChange: n ? (z) => n(z.target.value) : void 0,
|
|
36
|
-
value: d ? i : void 0,
|
|
37
|
-
defaultValue: d ? void 0 : g,
|
|
38
|
-
disabled: r,
|
|
39
|
-
placeholder: x,
|
|
40
|
-
maxLength: C
|
|
41
|
-
};
|
|
42
|
-
return /* @__PURE__ */ t("div", { children: l === "textarea" ? /* @__PURE__ */ t("textarea", { ...u }) : /* @__PURE__ */ t("input", { ...u, type: T }) });
|
|
43
|
-
}
|
|
44
|
-
p.propTypes = {
|
|
45
|
-
type: e.oneOf(["default", "textarea", "password"]),
|
|
46
|
-
size: e.oneOf(["small", "medium", "large", "huge"]),
|
|
47
|
-
sx: e.oneOfType([e.object, e.string]),
|
|
48
|
-
style: e.object,
|
|
49
|
-
onClick: e.func,
|
|
50
|
-
onChange: e.func,
|
|
51
|
-
className: e.string,
|
|
52
|
-
value: e.string,
|
|
53
|
-
defaultValue: e.string,
|
|
54
|
-
disabled: e.bool,
|
|
55
|
-
placeholder: e.string,
|
|
56
|
-
maxlength: e.number
|
|
57
|
-
};
|
|
58
|
-
p.defaultProps = {
|
|
59
|
-
type: "default",
|
|
60
|
-
size: "medium",
|
|
61
|
-
sx: {},
|
|
62
|
-
style: {},
|
|
63
|
-
onClick: () => {
|
|
64
|
-
},
|
|
65
|
-
className: "",
|
|
66
|
-
onChange: void 0,
|
|
67
|
-
value: void 0,
|
|
68
|
-
defaultValue: "",
|
|
69
|
-
disabled: !1,
|
|
70
|
-
placeholder: "",
|
|
71
|
-
maxlength: 524288
|
|
72
|
-
};
|
|
73
|
-
export {
|
|
74
|
-
p as default
|
|
75
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
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;
|