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,341 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import "react";
|
|
4
|
-
import e from "./TBanner.module.css.mjs";
|
|
5
|
-
import f from "../TButton/index.mjs";
|
|
6
|
-
function j(p) {
|
|
7
|
-
const {
|
|
8
|
-
children: u = "banner",
|
|
9
|
-
onCancel: s = () => {
|
|
10
|
-
},
|
|
11
|
-
onAction: h = () => {
|
|
12
|
-
},
|
|
13
|
-
size: l = "normal",
|
|
14
|
-
cancelText: C = "Cancel",
|
|
15
|
-
actionText: m = "Action",
|
|
16
|
-
level: i = "info",
|
|
17
|
-
// success,info, warning, error 四种形态(颜色)
|
|
18
|
-
transparent: n = !1,
|
|
19
|
-
bannerBgColor: w = "",
|
|
20
|
-
// 自定义banner背景颜色
|
|
21
|
-
bannerBorderColor: v = "",
|
|
22
|
-
// 自定义banner边框颜色
|
|
23
|
-
bannerIconColor: t = ""
|
|
24
|
-
// 自定义banner Icon颜色
|
|
25
|
-
} = p, x = () => {
|
|
26
|
-
switch (l) {
|
|
27
|
-
case "small":
|
|
28
|
-
return e.smallBanner;
|
|
29
|
-
case "large":
|
|
30
|
-
return e.largeBanner;
|
|
31
|
-
default:
|
|
32
|
-
return e.banner;
|
|
33
|
-
}
|
|
34
|
-
}, a = () => {
|
|
35
|
-
switch (l) {
|
|
36
|
-
case "small":
|
|
37
|
-
return e.smallInfoIcon;
|
|
38
|
-
case "large":
|
|
39
|
-
return e.largeInfoIcon;
|
|
40
|
-
default:
|
|
41
|
-
return e.infoIcon;
|
|
42
|
-
}
|
|
43
|
-
}, d = () => {
|
|
44
|
-
switch (l) {
|
|
45
|
-
case "small":
|
|
46
|
-
return e.smallCloseIcon;
|
|
47
|
-
case "large":
|
|
48
|
-
return e.largeCloseIcon;
|
|
49
|
-
default:
|
|
50
|
-
return e.closeIcon;
|
|
51
|
-
}
|
|
52
|
-
}, b = () => {
|
|
53
|
-
switch (l) {
|
|
54
|
-
case "small":
|
|
55
|
-
return `${n === !0 ? e.smallInfoTransparent : e.smallInfo}`;
|
|
56
|
-
case "large":
|
|
57
|
-
return `${n === !0 ? e.largeInfoTransparent : e.largeInfo}`;
|
|
58
|
-
default:
|
|
59
|
-
return `${n === !0 ? e.infoTransparent : e.info}`;
|
|
60
|
-
}
|
|
61
|
-
}, o = (() => {
|
|
62
|
-
switch (i) {
|
|
63
|
-
case "success":
|
|
64
|
-
return {
|
|
65
|
-
backgroundColor: `${n === !0 ? "transparent" : "rgba(14, 43, 32, 0.8)"}`,
|
|
66
|
-
// 绿色背景
|
|
67
|
-
borderColor: "#3cc29a",
|
|
68
|
-
// 亮橙色边框
|
|
69
|
-
iconColor: `${t}` || "#3cc29a"
|
|
70
|
-
// 图标颜色
|
|
71
|
-
};
|
|
72
|
-
case "warning":
|
|
73
|
-
return {
|
|
74
|
-
backgroundColor: `${n === !0 ? "transparent" : "rgba(121, 78, 8, 0.8)"}`,
|
|
75
|
-
// 橙色背景
|
|
76
|
-
borderColor: "#ffcc00",
|
|
77
|
-
// 亮橙色边框
|
|
78
|
-
iconColor: `${t}` || "#ff9900"
|
|
79
|
-
// 图标颜色
|
|
80
|
-
};
|
|
81
|
-
case "error":
|
|
82
|
-
return {
|
|
83
|
-
backgroundColor: `${n === !0 ? "transparent" : "rgba(73, 20, 18,0.8)"}`,
|
|
84
|
-
// 红色背景
|
|
85
|
-
borderColor: "#ff6666",
|
|
86
|
-
// 亮红色边框
|
|
87
|
-
iconColor: `${t}` || "#ff3333"
|
|
88
|
-
// 图标颜色
|
|
89
|
-
};
|
|
90
|
-
case "info":
|
|
91
|
-
default:
|
|
92
|
-
return {
|
|
93
|
-
backgroundColor: `${n === !0 ? "transparent" : "rgba(18, 62, 116, 0.8)"}`,
|
|
94
|
-
// 默认蓝色背景
|
|
95
|
-
borderColor: "#64b4fa",
|
|
96
|
-
// 蓝色边框
|
|
97
|
-
iconColor: `${t}` || "#64b4fa"
|
|
98
|
-
// 图标颜色
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
})(), I = /* @__PURE__ */ c(
|
|
102
|
-
"svg",
|
|
103
|
-
{
|
|
104
|
-
t: "1765636638756",
|
|
105
|
-
className: a(),
|
|
106
|
-
viewBox: "0 0 1024 1024",
|
|
107
|
-
version: "1.1",
|
|
108
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
109
|
-
"p-id": "5548",
|
|
110
|
-
width: "200",
|
|
111
|
-
height: "200",
|
|
112
|
-
children: [
|
|
113
|
-
/* @__PURE__ */ r(
|
|
114
|
-
"path",
|
|
115
|
-
{
|
|
116
|
-
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",
|
|
117
|
-
fill: o.iconColor,
|
|
118
|
-
"p-id": "5549"
|
|
119
|
-
}
|
|
120
|
-
),
|
|
121
|
-
/* @__PURE__ */ r(
|
|
122
|
-
"path",
|
|
123
|
-
{
|
|
124
|
-
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",
|
|
125
|
-
fill: o.iconColor,
|
|
126
|
-
"p-id": "5550"
|
|
127
|
-
}
|
|
128
|
-
),
|
|
129
|
-
/* @__PURE__ */ r(
|
|
130
|
-
"path",
|
|
131
|
-
{
|
|
132
|
-
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",
|
|
133
|
-
fill: o.iconColor,
|
|
134
|
-
"p-id": "5551"
|
|
135
|
-
}
|
|
136
|
-
)
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
), L = /* @__PURE__ */ c(
|
|
140
|
-
"svg",
|
|
141
|
-
{
|
|
142
|
-
t: "1766541516754",
|
|
143
|
-
className: a(),
|
|
144
|
-
viewBox: "0 0 1024 1024",
|
|
145
|
-
version: "1.1",
|
|
146
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
147
|
-
"p-id": "7130",
|
|
148
|
-
width: "200",
|
|
149
|
-
height: "200",
|
|
150
|
-
children: [
|
|
151
|
-
/* @__PURE__ */ r(
|
|
152
|
-
"path",
|
|
153
|
-
{
|
|
154
|
-
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",
|
|
155
|
-
fill: "#f2990a",
|
|
156
|
-
"p-id": "7131"
|
|
157
|
-
}
|
|
158
|
-
),
|
|
159
|
-
/* @__PURE__ */ r(
|
|
160
|
-
"path",
|
|
161
|
-
{
|
|
162
|
-
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",
|
|
163
|
-
fill: "#f2990a",
|
|
164
|
-
"p-id": "7132"
|
|
165
|
-
}
|
|
166
|
-
),
|
|
167
|
-
/* @__PURE__ */ r(
|
|
168
|
-
"path",
|
|
169
|
-
{
|
|
170
|
-
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",
|
|
171
|
-
fill: "#f2990a",
|
|
172
|
-
"p-id": "7133"
|
|
173
|
-
}
|
|
174
|
-
)
|
|
175
|
-
]
|
|
176
|
-
}
|
|
177
|
-
), B = /* @__PURE__ */ r(
|
|
178
|
-
"svg",
|
|
179
|
-
{
|
|
180
|
-
t: "1766542188417",
|
|
181
|
-
className: a(),
|
|
182
|
-
viewBox: "0 0 1024 1024",
|
|
183
|
-
version: "1.1",
|
|
184
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
185
|
-
"p-id": "10967",
|
|
186
|
-
width: "200",
|
|
187
|
-
height: "200",
|
|
188
|
-
children: /* @__PURE__ */ r(
|
|
189
|
-
"path",
|
|
190
|
-
{
|
|
191
|
-
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",
|
|
192
|
-
fill: "#f94c60",
|
|
193
|
-
"p-id": "10968"
|
|
194
|
-
}
|
|
195
|
-
)
|
|
196
|
-
}
|
|
197
|
-
), z = /* @__PURE__ */ c(
|
|
198
|
-
"svg",
|
|
199
|
-
{
|
|
200
|
-
t: "1766542714832",
|
|
201
|
-
className: a(),
|
|
202
|
-
viewBox: "0 0 1024 1024",
|
|
203
|
-
version: "1.1",
|
|
204
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
205
|
-
"p-id": "13471",
|
|
206
|
-
width: "200",
|
|
207
|
-
height: "200",
|
|
208
|
-
children: [
|
|
209
|
-
/* @__PURE__ */ r(
|
|
210
|
-
"path",
|
|
211
|
-
{
|
|
212
|
-
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",
|
|
213
|
-
fill: "#31d9a7",
|
|
214
|
-
"p-id": "13472"
|
|
215
|
-
}
|
|
216
|
-
),
|
|
217
|
-
/* @__PURE__ */ r(
|
|
218
|
-
"path",
|
|
219
|
-
{
|
|
220
|
-
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",
|
|
221
|
-
fill: "#31d9a7",
|
|
222
|
-
"p-id": "13473"
|
|
223
|
-
}
|
|
224
|
-
)
|
|
225
|
-
]
|
|
226
|
-
}
|
|
227
|
-
), M = /* @__PURE__ */ r(
|
|
228
|
-
"svg",
|
|
229
|
-
{
|
|
230
|
-
t: "1765636877672",
|
|
231
|
-
className: d(),
|
|
232
|
-
viewBox: "0 0 1024 1024",
|
|
233
|
-
version: "1.1",
|
|
234
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
235
|
-
"p-id": "6359",
|
|
236
|
-
width: "200",
|
|
237
|
-
height: "200",
|
|
238
|
-
children: /* @__PURE__ */ r(
|
|
239
|
-
"path",
|
|
240
|
-
{
|
|
241
|
-
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",
|
|
242
|
-
fill: "#ffffff",
|
|
243
|
-
"p-id": "6360"
|
|
244
|
-
}
|
|
245
|
-
)
|
|
246
|
-
}
|
|
247
|
-
), $ = () => {
|
|
248
|
-
switch (i) {
|
|
249
|
-
case "success":
|
|
250
|
-
return z;
|
|
251
|
-
case "warning":
|
|
252
|
-
return L;
|
|
253
|
-
case "error":
|
|
254
|
-
return B;
|
|
255
|
-
case "info":
|
|
256
|
-
default:
|
|
257
|
-
return I;
|
|
258
|
-
}
|
|
259
|
-
}, g = () => {
|
|
260
|
-
switch (l) {
|
|
261
|
-
case "small":
|
|
262
|
-
return "0.8rem";
|
|
263
|
-
case "large":
|
|
264
|
-
return "1.2rem";
|
|
265
|
-
default:
|
|
266
|
-
return "1rem";
|
|
267
|
-
}
|
|
268
|
-
}, k = () => {
|
|
269
|
-
switch (l) {
|
|
270
|
-
case "small":
|
|
271
|
-
return "8px";
|
|
272
|
-
case "large":
|
|
273
|
-
return "12px";
|
|
274
|
-
default:
|
|
275
|
-
return "10px";
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
return /* @__PURE__ */ c(
|
|
279
|
-
"div",
|
|
280
|
-
{
|
|
281
|
-
className: x(),
|
|
282
|
-
style: {
|
|
283
|
-
backgroundColor: w || o.backgroundColor,
|
|
284
|
-
borderColor: v || o.borderColor
|
|
285
|
-
},
|
|
286
|
-
children: [
|
|
287
|
-
/* @__PURE__ */ r("div", { className: a(), children: $() }),
|
|
288
|
-
/* @__PURE__ */ r("div", { className: b(), children: u }),
|
|
289
|
-
/* @__PURE__ */ c(
|
|
290
|
-
"div",
|
|
291
|
-
{
|
|
292
|
-
style: {
|
|
293
|
-
display: "flex",
|
|
294
|
-
alignItems: "center",
|
|
295
|
-
justifyContent: "flex-end",
|
|
296
|
-
flex: 1,
|
|
297
|
-
gap: k()
|
|
298
|
-
},
|
|
299
|
-
children: [
|
|
300
|
-
/* @__PURE__ */ r(
|
|
301
|
-
f,
|
|
302
|
-
{
|
|
303
|
-
type: "transparent",
|
|
304
|
-
sx: {
|
|
305
|
-
c: `${n === !0 ? "gray" : "#e9e9e9"}`,
|
|
306
|
-
br: g(),
|
|
307
|
-
bColor: "transparent",
|
|
308
|
-
s: l === "small" ? "14px" : l === "large" ? "18px" : "16px"
|
|
309
|
-
},
|
|
310
|
-
onClick: s,
|
|
311
|
-
size: l,
|
|
312
|
-
children: C
|
|
313
|
-
}
|
|
314
|
-
),
|
|
315
|
-
/* @__PURE__ */ r(
|
|
316
|
-
f,
|
|
317
|
-
{
|
|
318
|
-
type: "transparent",
|
|
319
|
-
sx: {
|
|
320
|
-
c: `${n === !0 ? "gray" : "#e9e9e9"}`,
|
|
321
|
-
br: g(),
|
|
322
|
-
b: 1,
|
|
323
|
-
bColor: "#797979",
|
|
324
|
-
s: l === "small" ? "14px" : l === "large" ? "18px" : "16px"
|
|
325
|
-
},
|
|
326
|
-
onClick: h,
|
|
327
|
-
size: l,
|
|
328
|
-
children: m
|
|
329
|
-
}
|
|
330
|
-
),
|
|
331
|
-
/* @__PURE__ */ r("div", { className: d(), onClick: s, children: M })
|
|
332
|
-
]
|
|
333
|
-
}
|
|
334
|
-
)
|
|
335
|
-
]
|
|
336
|
-
}
|
|
337
|
-
);
|
|
338
|
-
}
|
|
339
|
-
export {
|
|
340
|
-
j as default
|
|
341
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n="_btn_1w9w4_5",t={btn:n,"btn-content":"_btn-content_1w9w4_1","btn-default":"_btn-default_1w9w4_45","btn-transparent":"_btn-transparent_1w9w4_63","btn-danger":"_btn-danger_1w9w4_81","btn-success":"_btn-success_1w9w4_101","btn-outline":"_btn-outline_1w9w4_121","btn-enu":"_btn-enu_1w9w4_205","btn-small":"_btn-small_1w9w4_351","btn-medium":"_btn-medium_1w9w4_361","btn-large":"_btn-large_1w9w4_371","btn-huge":"_btn-huge_1w9w4_381","btn-disabled":"_btn-disabled_1w9w4_391","btn-with-icon":"_btn-with-icon_1w9w4_417","btn-icon":"_btn-icon_1w9w4_433","btn-loading":"_btn-loading_1w9w4_507","btn-loading-icon":"_btn-loading-icon_1w9w4_517","btn-loading-spin":"_btn-loading-spin_1w9w4_527","btn-loading-light":"_btn-loading-light_1w9w4_631","btn-loading-dark":"_btn-loading-dark_1w9w4_639"};exports.btn=n;exports.default=t;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const n = "_btn_1w9w4_5", t = {
|
|
2
|
-
btn: n,
|
|
3
|
-
"btn-content": "_btn-content_1w9w4_1",
|
|
4
|
-
"btn-default": "_btn-default_1w9w4_45",
|
|
5
|
-
"btn-transparent": "_btn-transparent_1w9w4_63",
|
|
6
|
-
"btn-danger": "_btn-danger_1w9w4_81",
|
|
7
|
-
"btn-success": "_btn-success_1w9w4_101",
|
|
8
|
-
"btn-outline": "_btn-outline_1w9w4_121",
|
|
9
|
-
"btn-enu": "_btn-enu_1w9w4_205",
|
|
10
|
-
"btn-small": "_btn-small_1w9w4_351",
|
|
11
|
-
"btn-medium": "_btn-medium_1w9w4_361",
|
|
12
|
-
"btn-large": "_btn-large_1w9w4_371",
|
|
13
|
-
"btn-huge": "_btn-huge_1w9w4_381",
|
|
14
|
-
"btn-disabled": "_btn-disabled_1w9w4_391",
|
|
15
|
-
"btn-with-icon": "_btn-with-icon_1w9w4_417",
|
|
16
|
-
"btn-icon": "_btn-icon_1w9w4_433",
|
|
17
|
-
"btn-loading": "_btn-loading_1w9w4_507",
|
|
18
|
-
"btn-loading-icon": "_btn-loading-icon_1w9w4_517",
|
|
19
|
-
"btn-loading-spin": "_btn-loading-spin_1w9w4_527",
|
|
20
|
-
"btn-loading-light": "_btn-loading-light_1w9w4_631",
|
|
21
|
-
"btn-loading-dark": "_btn-loading-dark_1w9w4_639"
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
n as btn,
|
|
25
|
-
t as default
|
|
26
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
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,186 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as c, Fragment as y, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import d from "react";
|
|
4
|
-
import e from "prop-types";
|
|
5
|
-
import t from "./TButton.module.css.mjs";
|
|
6
|
-
import { useTangoStyle as E } from "../CSSFab/useTangoStyle.mjs";
|
|
7
|
-
function M(b) {
|
|
8
|
-
const {
|
|
9
|
-
type: x = "default",
|
|
10
|
-
size: g = "medium",
|
|
11
|
-
sx: l = {},
|
|
12
|
-
style: w = {},
|
|
13
|
-
className: $ = "",
|
|
14
|
-
onClick: S = () => {
|
|
15
|
-
},
|
|
16
|
-
children: N,
|
|
17
|
-
disabled: u = !1,
|
|
18
|
-
outline: k = !1,
|
|
19
|
-
enu: v = !1,
|
|
20
|
-
icon: s = null,
|
|
21
|
-
iconPosition: T = null,
|
|
22
|
-
loading: n = !1,
|
|
23
|
-
...z
|
|
24
|
-
} = b, C = E(typeof l == "object" ? l : {}), j = typeof l == "string" ? l.split(/\s+/).map((o) => o.startsWith("!") ? o : `!${o}`).join(" ") : "", p = () => {
|
|
25
|
-
switch (g) {
|
|
26
|
-
case "small":
|
|
27
|
-
return 12;
|
|
28
|
-
case "medium":
|
|
29
|
-
return 14;
|
|
30
|
-
case "large":
|
|
31
|
-
return 16;
|
|
32
|
-
case "huge":
|
|
33
|
-
return 20;
|
|
34
|
-
default:
|
|
35
|
-
return 14;
|
|
36
|
-
}
|
|
37
|
-
}, i = () => 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 = () => {
|
|
38
|
-
const o = p(), a = A() === "dark" ? L : B;
|
|
39
|
-
return d.cloneElement(a, {
|
|
40
|
-
className: `${a.props.className} ${i() ? t["btn-loading-spin"] : ""}`,
|
|
41
|
-
style: {
|
|
42
|
-
width: `${o}px`,
|
|
43
|
-
height: `${o}px`,
|
|
44
|
-
...a.props.style
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}, I = [...[
|
|
48
|
-
t.btn,
|
|
49
|
-
t[`btn-${x}`],
|
|
50
|
-
t[`btn-${g}`],
|
|
51
|
-
u && t["btn-disabled"],
|
|
52
|
-
k && t["btn-outline"],
|
|
53
|
-
v && t["btn-enu"],
|
|
54
|
-
(s || i()) && t["btn-with-icon"],
|
|
55
|
-
// 修改这里,loading 时也添加图标类
|
|
56
|
-
i() && t["btn-loading"]
|
|
57
|
-
// 添加 loading 状态类
|
|
58
|
-
].filter(Boolean), j, $].filter(Boolean).join(" "), O = { ...C, ...w };
|
|
59
|
-
M.propTypes = {
|
|
60
|
-
type: e.oneOf(["default", "transparent", "danger", "success"]),
|
|
61
|
-
// 按钮类型:默认、透明、警告、成功
|
|
62
|
-
size: e.oneOf(["small", "medium", "large", "huge"]),
|
|
63
|
-
// 按钮大小
|
|
64
|
-
sx: e.oneOfType([e.object, e.string]),
|
|
65
|
-
// 自定义样式对象
|
|
66
|
-
style: e.object,
|
|
67
|
-
// 用户传入的 style 属性,保证style属性优先级最高
|
|
68
|
-
onClick: e.func,
|
|
69
|
-
// 点击事件
|
|
70
|
-
className: e.string,
|
|
71
|
-
// 添加 className PropTypes
|
|
72
|
-
children: e.node.isRequired,
|
|
73
|
-
// 按钮内容
|
|
74
|
-
disabled: e.bool,
|
|
75
|
-
// 是否禁用
|
|
76
|
-
outline: e.bool,
|
|
77
|
-
// 是否为轮廓按钮
|
|
78
|
-
enu: e.bool,
|
|
79
|
-
// 是否为新拟态风格按钮
|
|
80
|
-
icon: e.oneOfType([
|
|
81
|
-
e.elementType,
|
|
82
|
-
e.node,
|
|
83
|
-
e.string
|
|
84
|
-
// 允许传入字符串(图片路径)
|
|
85
|
-
]),
|
|
86
|
-
iconPosition: e.string,
|
|
87
|
-
loading: e.oneOfType([
|
|
88
|
-
e.bool,
|
|
89
|
-
e.oneOf(["light", "dark"]),
|
|
90
|
-
e.array
|
|
91
|
-
])
|
|
92
|
-
};
|
|
93
|
-
const B = /* @__PURE__ */ r(
|
|
94
|
-
"svg",
|
|
95
|
-
{
|
|
96
|
-
t: "1765518157795",
|
|
97
|
-
className: `${t["btn-loading-icon"]} ${t["btn-loading-light"]}`,
|
|
98
|
-
viewBox: "0 0 1024 1024",
|
|
99
|
-
version: "1.1",
|
|
100
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
101
|
-
width: "200",
|
|
102
|
-
height: "200",
|
|
103
|
-
children: /* @__PURE__ */ r(
|
|
104
|
-
"path",
|
|
105
|
-
{
|
|
106
|
-
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",
|
|
107
|
-
fill: "#ffffff"
|
|
108
|
-
}
|
|
109
|
-
)
|
|
110
|
-
}
|
|
111
|
-
), L = /* @__PURE__ */ r(
|
|
112
|
-
"svg",
|
|
113
|
-
{
|
|
114
|
-
t: "1765518157795",
|
|
115
|
-
className: `${t["btn-loading-icon"]} ${t["btn-loading-dark"]}`,
|
|
116
|
-
viewBox: "0 0 1024 1024",
|
|
117
|
-
version: "1.1",
|
|
118
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
119
|
-
width: "200",
|
|
120
|
-
height: "200",
|
|
121
|
-
children: /* @__PURE__ */ r(
|
|
122
|
-
"path",
|
|
123
|
-
{
|
|
124
|
-
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",
|
|
125
|
-
fill: "#2c2c2c"
|
|
126
|
-
}
|
|
127
|
-
)
|
|
128
|
-
}
|
|
129
|
-
), h = () => {
|
|
130
|
-
if (!s) return null;
|
|
131
|
-
const o = p();
|
|
132
|
-
return typeof s == "string" ? /* @__PURE__ */ r(
|
|
133
|
-
"img",
|
|
134
|
-
{
|
|
135
|
-
src: s,
|
|
136
|
-
alt: "icon",
|
|
137
|
-
className: t["btn-icon"],
|
|
138
|
-
style: {
|
|
139
|
-
width: `${o}px`,
|
|
140
|
-
height: `${o}px`
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
) : d.isValidElement(s) ? d.cloneElement(s, {
|
|
144
|
-
className: `${t["btn-icon"]} ${s.props.className || ""}`,
|
|
145
|
-
style: {
|
|
146
|
-
width: `${o}px`,
|
|
147
|
-
height: `${o}px`,
|
|
148
|
-
...s.props.style
|
|
149
|
-
}
|
|
150
|
-
}) : /* @__PURE__ */ r(
|
|
151
|
-
s,
|
|
152
|
-
{
|
|
153
|
-
className: t["btn-icon"],
|
|
154
|
-
style: {
|
|
155
|
-
fontSize: `${o}px`,
|
|
156
|
-
width: `${o}px`,
|
|
157
|
-
height: `${o}px`
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
);
|
|
161
|
-
}, m = T || (s || i() ? "left" : null);
|
|
162
|
-
return /* @__PURE__ */ c(
|
|
163
|
-
"button",
|
|
164
|
-
{
|
|
165
|
-
className: I,
|
|
166
|
-
style: O,
|
|
167
|
-
onClick: S,
|
|
168
|
-
disabled: u || i(),
|
|
169
|
-
...z,
|
|
170
|
-
children: [
|
|
171
|
-
m === "left" && /* @__PURE__ */ c(y, { children: [
|
|
172
|
-
i() && f(),
|
|
173
|
-
!i() && s && h()
|
|
174
|
-
] }),
|
|
175
|
-
N,
|
|
176
|
-
m === "right" && /* @__PURE__ */ c(y, { children: [
|
|
177
|
-
i() && f(),
|
|
178
|
-
!i() && s && h()
|
|
179
|
-
] })
|
|
180
|
-
]
|
|
181
|
-
}
|
|
182
|
-
);
|
|
183
|
-
}
|
|
184
|
-
export {
|
|
185
|
-
M as default
|
|
186
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c="_colorPicker_ecbdc_1",e="_colorPickerDisabled_ecbdc_59",o="_colorPickerWrapper_ecbdc_69",r="_colorText_ecbdc_81",l={colorPicker:c,colorPickerDisabled:e,colorPickerWrapper:o,colorText:r};exports.colorPicker=c;exports.colorPickerDisabled=e;exports.colorPickerWrapper=o;exports.colorText=r;exports.default=l;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const c = "_colorPicker_ecbdc_1", o = "_colorPickerDisabled_ecbdc_59", r = "_colorPickerWrapper_ecbdc_69", e = "_colorText_ecbdc_81", l = {
|
|
2
|
-
colorPicker: c,
|
|
3
|
-
colorPickerDisabled: o,
|
|
4
|
-
colorPickerWrapper: r,
|
|
5
|
-
colorText: e
|
|
6
|
-
};
|
|
7
|
-
export {
|
|
8
|
-
c as colorPicker,
|
|
9
|
-
o as colorPickerDisabled,
|
|
10
|
-
r as colorPickerWrapper,
|
|
11
|
-
e as colorText,
|
|
12
|
-
l as default
|
|
13
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
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,62 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as f, jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import { useState as I } from "react";
|
|
4
|
-
import h from "prop-types";
|
|
5
|
-
import p from "./TColorPicker.module.css.mjs";
|
|
6
|
-
function M(g) {
|
|
7
|
-
const { disabled: m = !1, onChange: u = () => {
|
|
8
|
-
}, showText: v = !1 } = g, [c, $] = I("#000000"), k = (s) => {
|
|
9
|
-
const e = s.target.value;
|
|
10
|
-
$(e), u && u(e);
|
|
11
|
-
}, C = `${p.colorPicker} ${m ? p.colorPickerDisabled : ""}`, T = (s) => {
|
|
12
|
-
const e = parseInt(s.slice(1, 3), 16), o = parseInt(s.slice(3, 5), 16), r = parseInt(s.slice(5, 7), 16);
|
|
13
|
-
return `rgb(${e}, ${o}, ${r})`;
|
|
14
|
-
}, x = (s) => {
|
|
15
|
-
let e = parseInt(s.slice(1, 3), 16) / 255, o = parseInt(s.slice(3, 5), 16) / 255, r = parseInt(s.slice(5, 7), 16) / 255, t = Math.max(e, o, r), a = Math.min(e, o, r), l, d, b = (t + a) / 2;
|
|
16
|
-
if (t === a)
|
|
17
|
-
l = d = 0;
|
|
18
|
-
else {
|
|
19
|
-
let n = t - a;
|
|
20
|
-
switch (d = b > 0.5 ? n / (2 - t - a) : n / (t + a), t) {
|
|
21
|
-
case e:
|
|
22
|
-
l = (o - r) / n + (o < r ? 6 : 0);
|
|
23
|
-
break;
|
|
24
|
-
case o:
|
|
25
|
-
l = (r - e) / n + 2;
|
|
26
|
-
break;
|
|
27
|
-
case r:
|
|
28
|
-
l = (e - o) / n + 4;
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
l /= 6;
|
|
32
|
-
}
|
|
33
|
-
return `hsl(${Math.round(l * 360)}, ${Math.round(d * 100)}%, ${Math.round(
|
|
34
|
-
b * 100
|
|
35
|
-
)}%)`;
|
|
36
|
-
};
|
|
37
|
-
return /* @__PURE__ */ f("div", { className: p.colorPickerWrapper, children: [
|
|
38
|
-
/* @__PURE__ */ i(
|
|
39
|
-
"input",
|
|
40
|
-
{
|
|
41
|
-
type: "color",
|
|
42
|
-
value: c,
|
|
43
|
-
onChange: k,
|
|
44
|
-
className: C,
|
|
45
|
-
disabled: m
|
|
46
|
-
}
|
|
47
|
-
),
|
|
48
|
-
v && /* @__PURE__ */ f("div", { className: p.colorText, children: [
|
|
49
|
-
/* @__PURE__ */ i("div", { children: c.toUpperCase() }),
|
|
50
|
-
/* @__PURE__ */ i("div", { children: T(c) }),
|
|
51
|
-
/* @__PURE__ */ i("div", { children: x(c) })
|
|
52
|
-
] })
|
|
53
|
-
] });
|
|
54
|
-
}
|
|
55
|
-
M.propTypes = {
|
|
56
|
-
disabled: h.bool,
|
|
57
|
-
onChange: h.func,
|
|
58
|
-
showText: h.bool
|
|
59
|
-
};
|
|
60
|
-
export {
|
|
61
|
-
M as default
|
|
62
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
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;
|