gasp-components 1.0.10 → 1.0.12

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.
Files changed (86) hide show
  1. package/dist/UploadOutlined-9WKjHsqa.js +878 -0
  2. package/dist/components/ag-grid-table/index.js +57877 -38314
  3. package/dist/components/button/index.js +18 -18
  4. package/dist/components/checklist/checklist-item.js +3 -3
  5. package/dist/components/checklist/index.js +5 -5
  6. package/dist/components/date-picker/index.js +9 -5022
  7. package/dist/components/dragger/index.js +28 -28
  8. package/dist/components/dropdown/index.js +10 -11
  9. package/dist/components/form/index.js +8 -9
  10. package/dist/components/form-item/index.js +10 -10
  11. package/dist/components/input/index.js +8 -8
  12. package/dist/components/modal/index.js +18 -20
  13. package/dist/components/password-input/index.js +2 -2
  14. package/dist/components/progress/index.js +16 -18
  15. package/dist/components/progress-circle/index.js +3 -3
  16. package/dist/components/radio-button/index.js +8 -8
  17. package/dist/components/result-popup/index.js +13 -14
  18. package/dist/components/select/index.js +1 -1
  19. package/dist/components/side-menu/index.js +2 -2
  20. package/dist/components/side-menu/menu-item.js +4 -6
  21. package/dist/components/steps/index.js +9 -9
  22. package/dist/components/table/index.js +16 -9298
  23. package/dist/components/tabs/index.js +10 -10
  24. package/dist/components/tabs/tab.js +7 -8
  25. package/dist/components/tag/index.js +9 -258
  26. package/dist/components/timeline-horizontal/index.js +7 -7
  27. package/dist/components/upload/index.js +62 -77
  28. package/dist/index-WlPrqxgY.js +87 -0
  29. package/dist/main.js +69 -457
  30. package/package.json +1 -1
  31. package/dist/CheckCircleFilled-xt-0R96Z.js +0 -16
  32. package/dist/CheckOutlined-EgxCAgj_.js +0 -16
  33. package/dist/CloseCircleFilled-bIgIULWb.js +0 -16
  34. package/dist/CloseOutlined-Q3kC3EZS.js +0 -16
  35. package/dist/Compact-fdEKV_mF.js +0 -180
  36. package/dist/ExclamationCircleFilled-XzDBEGmA.js +0 -16
  37. package/dist/KeyCode-qFRXB1-n.js +0 -517
  38. package/dist/LoadingOutlined-6Ipqn0og.js +0 -16
  39. package/dist/Overflow-JFdXKgCr.js +0 -231
  40. package/dist/PurePanel-hLGnXbul.js +0 -60
  41. package/dist/SearchOutlined-rJTFGXUi.js +0 -16
  42. package/dist/TextArea-n3dknzTq.js +0 -716
  43. package/dist/UploadOutlined-D8jfLEgv.js +0 -27
  44. package/dist/asyncToGenerator-t4sKr8R4.js +0 -340
  45. package/dist/button-LN5ZDad8.js +0 -819
  46. package/dist/collapse-ilv4Tji1.js +0 -20
  47. package/dist/colors-opGg9oSz.js +0 -25
  48. package/dist/compact-item-jjuVmDBH.js +0 -61
  49. package/dist/context-h3WSVDPz.js +0 -2087
  50. package/dist/createFormattedComponent-FcpICAm8.js +0 -3260
  51. package/dist/index--6VfGMUo.js +0 -402
  52. package/dist/index-0mpuHoS5.js +0 -996
  53. package/dist/index-1KQbTQJ2.js +0 -4405
  54. package/dist/index-5Uo03BMk.js +0 -681
  55. package/dist/index-BFgxz47K.js +0 -89
  56. package/dist/index-D3LMPWyJ.js +0 -1437
  57. package/dist/index-DVS_nWxv.js +0 -3026
  58. package/dist/index-ELHBhuK9.js +0 -100
  59. package/dist/index-Fn8q8B3V.js +0 -107
  60. package/dist/index-GgkQrebz.js +0 -950
  61. package/dist/index-L-MzVDcK.js +0 -616
  62. package/dist/index-M3WnMjiA.js +0 -230
  63. package/dist/index-NQd_zMf0.js +0 -69
  64. package/dist/index-ZT64Ec6u.js +0 -267
  65. package/dist/index-aawDqn9q.js +0 -3337
  66. package/dist/index-k04G4nlS.js +0 -1416
  67. package/dist/index-s3u4YBl4.js +0 -8
  68. package/dist/index-vtDVJV8q.js +0 -19571
  69. package/dist/isVisible-Qi9l15Ty.js +0 -232
  70. package/dist/motion-0ToOu81j.js +0 -226
  71. package/dist/motion-NQme0FJ_.js +0 -32
  72. package/dist/omit-ylWA0ZLZ.js +0 -10
  73. package/dist/pickAttrs-zaQzRTqh.js +0 -42
  74. package/dist/progress-a1_pwKVT.js +0 -722
  75. package/dist/reactNode-R20zZQk1.js +0 -18
  76. package/dist/responsiveObserver-V1_1G14X.js +0 -71
  77. package/dist/roundedArrow-p1Pmd9av.js +0 -64
  78. package/dist/row-sPFiFm0C.js +0 -230
  79. package/dist/slide-mFXPRHku.js +0 -265
  80. package/dist/styleChecker-pZ3k2IiY.js +0 -37
  81. package/dist/useCSSVarCls-GwZT_WiF.js +0 -9
  82. package/dist/useClosable-4G12n4Bp.js +0 -15
  83. package/dist/useLocale-eThlLZJw.js +0 -16
  84. package/dist/useMergedState-qUafLuUa.js +0 -23
  85. package/dist/useVariants-s0IcneBD.js +0 -25
  86. package/dist/zoom-Ps8y0jNW.js +0 -174
@@ -1,34 +1,34 @@
1
- import { jsxs as m, Fragment as h, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as m, Fragment as h, jsx as s } from "react/jsx-runtime";
2
2
  import { useState as p, useEffect as k } from "react";
3
3
  import { Tab as x } from "./tab.js";
4
- import { c as b } from "../../index-NQd_zMf0.js";
4
+ import b from "classnames";
5
5
  import { tabsContext as u } from "./context.js";
6
6
  const C = ({
7
7
  items: n,
8
8
  current: t,
9
9
  onChange: r,
10
- className: l,
10
+ className: a,
11
11
  tabClassName: d
12
12
  }) => {
13
- const [c, s] = p(), f = n.reduce((e, a) => ({
13
+ const [c, o] = p(), f = n.reduce((e, l) => ({
14
14
  ...e,
15
- [a.key]: a.content
15
+ [l.key]: l.content
16
16
  }), {});
17
17
  k(() => {
18
- t && s(t);
19
- }, [t, s]);
18
+ t && o(t);
19
+ }, [t, o]);
20
20
  const i = (e) => {
21
- s(e), r && r(e);
21
+ o(e), r && r(e);
22
22
  };
23
23
  return /* @__PURE__ */ m(h, { children: [
24
- /* @__PURE__ */ o("div", { className: b(l, "flex bg-white"), children: n.map((e) => /* @__PURE__ */ o(
24
+ /* @__PURE__ */ s("div", { className: b(a, "flex bg-white"), children: n.map((e) => /* @__PURE__ */ s(
25
25
  u.Provider,
26
26
  {
27
27
  value: {
28
28
  selected: c === e.key,
29
29
  checked: e.checked || !1
30
30
  },
31
- children: /* @__PURE__ */ o(
31
+ children: /* @__PURE__ */ s(
32
32
  x,
33
33
  {
34
34
  className: d,
@@ -1,21 +1,20 @@
1
1
  import { jsx as l, jsxs as d } from "react/jsx-runtime";
2
2
  import s, { useContext as i } from "react";
3
3
  import { tabsContext as u } from "./context.js";
4
- import { c as r } from "../../index-NQd_zMf0.js";
5
- import { libTheme as f } from "../../theme.js";
6
- import { t as x } from "../../index-Fn8q8B3V.js";
7
- import { T as g } from "../../index-0mpuHoS5.js";
8
- const D = ({
4
+ import r from "classnames";
5
+ import { theme as x, Typography as f } from "antd";
6
+ import { libTheme as g } from "../../theme.js";
7
+ const v = ({
9
8
  className: c,
10
9
  icon: a,
11
10
  title: o,
12
11
  onClick: m
13
12
  }) => {
14
13
  const { selected: e, checked: t } = i(u), n = a && s.cloneElement(a, {
15
- color: t ? x.getDesignToken(f).colorSuccess : "#BDBDBD"
14
+ color: t ? x.getDesignToken(g).colorSuccess : "#BDBDBD"
16
15
  }), p = typeof o == "string" ? s.cloneElement(
17
16
  /* @__PURE__ */ l(
18
- g.Text,
17
+ f.Text,
19
18
  {
20
19
  className: r("font-medium", {
21
20
  "text-dodgerBlue": e || t,
@@ -57,5 +56,5 @@ const D = ({
57
56
  );
58
57
  };
59
58
  export {
60
- D as Tab
59
+ v as Tab
61
60
  };
@@ -1,266 +1,17 @@
1
- import { jsx as A } from "react/jsx-runtime";
2
- import { c as x } from "../../index-NQd_zMf0.js";
3
- import * as l from "react";
4
- import { C as X } from "../../CloseOutlined-Q3kC3EZS.js";
5
- import { g as U, i as Q, a as G } from "../../colors-opGg9oSz.js";
6
- import { u as J } from "../../useClosable-4G12n4Bp.js";
7
- import { h as K, r as Y, d as B, m as Z, T as ee, C as H, B as _, D as oe } from "../../index-1KQbTQJ2.js";
8
- import { W as re } from "../../index-ZT64Ec6u.js";
9
- const te = (e) => {
10
- const {
11
- paddingXXS: r,
12
- lineWidth: n,
13
- tagPaddingHorizontal: o,
14
- componentCls: t,
15
- calc: c
16
- } = e, s = c(o).sub(n).equal(), p = c(r).sub(n).equal();
17
- return {
18
- // Result
19
- [t]: Object.assign(Object.assign({}, Y(e)), {
20
- display: "inline-block",
21
- height: "auto",
22
- marginInlineEnd: e.marginXS,
23
- paddingInline: s,
24
- fontSize: e.tagFontSize,
25
- lineHeight: e.tagLineHeight,
26
- whiteSpace: "nowrap",
27
- background: e.defaultBg,
28
- border: `${B(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,
29
- borderRadius: e.borderRadiusSM,
30
- opacity: 1,
31
- transition: `all ${e.motionDurationMid}`,
32
- textAlign: "start",
33
- position: "relative",
34
- // RTL
35
- [`&${t}-rtl`]: {
36
- direction: "rtl"
37
- },
38
- "&, a, a:hover": {
39
- color: e.defaultColor
40
- },
41
- [`${t}-close-icon`]: {
42
- marginInlineStart: p,
43
- fontSize: e.tagIconSize,
44
- color: e.colorTextDescription,
45
- cursor: "pointer",
46
- transition: `all ${e.motionDurationMid}`,
47
- "&:hover": {
48
- color: e.colorTextHeading
49
- }
50
- },
51
- [`&${t}-has-color`]: {
52
- borderColor: "transparent",
53
- [`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]: {
54
- color: e.colorTextLightSolid
55
- }
56
- },
57
- "&-checkable": {
58
- backgroundColor: "transparent",
59
- borderColor: "transparent",
60
- cursor: "pointer",
61
- [`&:not(${t}-checkable-checked):hover`]: {
62
- color: e.colorPrimary,
63
- backgroundColor: e.colorFillSecondary
64
- },
65
- "&:active, &-checked": {
66
- color: e.colorTextLightSolid
67
- },
68
- "&-checked": {
69
- backgroundColor: e.colorPrimary,
70
- "&:hover": {
71
- backgroundColor: e.colorPrimaryHover
72
- }
73
- },
74
- "&:active": {
75
- backgroundColor: e.colorPrimaryActive
76
- }
77
- },
78
- "&-hidden": {
79
- display: "none"
80
- },
81
- // To ensure that a space will be placed between character and `Icon`.
82
- [`> ${e.iconCls} + span, > span + ${e.iconCls}`]: {
83
- marginInlineStart: s
84
- }
85
- }),
86
- [`${t}-borderless`]: {
87
- borderColor: "transparent",
88
- background: e.tagBorderlessBg
89
- }
90
- };
91
- }, T = (e) => {
92
- const {
93
- lineWidth: r,
94
- fontSizeIcon: n,
95
- calc: o
96
- } = e, t = e.fontSizeSM;
97
- return Z(e, {
98
- tagFontSize: t,
99
- tagLineHeight: B(o(e.lineHeightSM).mul(t).equal()),
100
- tagIconSize: o(n).sub(o(r).mul(2)).equal(),
101
- // Tag icon is much smaller
102
- tagPaddingHorizontal: 8,
103
- // Fixed padding.
104
- tagBorderlessBg: e.colorFillTertiary
105
- });
106
- }, O = (e) => ({
107
- defaultBg: new ee(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),
108
- defaultColor: e.colorText
109
- }), W = K("Tag", (e) => {
110
- const r = T(e);
111
- return te(r);
112
- }, O);
113
- var ne = function(e, r) {
114
- var n = {};
115
- for (var o in e)
116
- Object.prototype.hasOwnProperty.call(e, o) && r.indexOf(o) < 0 && (n[o] = e[o]);
117
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
118
- for (var t = 0, o = Object.getOwnPropertySymbols(e); t < o.length; t++)
119
- r.indexOf(o[t]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[t]) && (n[o[t]] = e[o[t]]);
120
- return n;
121
- };
122
- const le = /* @__PURE__ */ l.forwardRef((e, r) => {
123
- const {
124
- prefixCls: n,
125
- style: o,
126
- className: t,
127
- checked: c,
128
- onChange: s,
129
- onClick: p
130
- } = e, i = ne(e, ["prefixCls", "style", "className", "checked", "onChange", "onClick"]), {
131
- getPrefixCls: f,
132
- tag: d
133
- } = l.useContext(H), h = (S) => {
134
- s == null || s(!c), p == null || p(S);
135
- }, m = f("tag", n), [g, y, v] = W(m), u = x(m, `${m}-checkable`, {
136
- [`${m}-checkable-checked`]: c
137
- }, d == null ? void 0 : d.className, t, y, v);
138
- return g(/* @__PURE__ */ l.createElement("span", Object.assign({}, i, {
139
- ref: r,
140
- style: Object.assign(Object.assign({}, o), d == null ? void 0 : d.style),
141
- className: u,
142
- onClick: h
143
- })));
144
- }), se = le, ae = (e) => U(e, (r, n) => {
145
- let {
146
- textColor: o,
147
- lightBorderColor: t,
148
- lightColor: c,
149
- darkColor: s
150
- } = n;
151
- return {
152
- [`${e.componentCls}${e.componentCls}-${r}`]: {
153
- color: o,
154
- background: c,
155
- borderColor: t,
156
- // Inverse color
157
- "&-inverse": {
158
- color: e.colorTextLightSolid,
159
- background: s,
160
- borderColor: s
161
- },
162
- [`&${e.componentCls}-borderless`]: {
163
- borderColor: "transparent"
164
- }
165
- }
166
- };
167
- }), ce = _(["Tag", "preset"], (e) => {
168
- const r = T(e);
169
- return ae(r);
170
- }, O);
171
- function ie(e) {
172
- return typeof e != "string" ? e : e.charAt(0).toUpperCase() + e.slice(1);
173
- }
174
- const b = (e, r, n) => {
175
- const o = ie(n);
176
- return {
177
- [`${e.componentCls}${e.componentCls}-${r}`]: {
178
- color: e[`color${n}`],
179
- background: e[`color${o}Bg`],
180
- borderColor: e[`color${o}Border`],
181
- [`&${e.componentCls}-borderless`]: {
182
- borderColor: "transparent"
183
- }
184
- }
185
- };
186
- }, de = _(["Tag", "status"], (e) => {
187
- const r = T(e);
188
- return [b(r, "success", "Success"), b(r, "processing", "Info"), b(r, "error", "Error"), b(r, "warning", "Warning")];
189
- }, O);
190
- var ge = function(e, r) {
191
- var n = {};
192
- for (var o in e)
193
- Object.prototype.hasOwnProperty.call(e, o) && r.indexOf(o) < 0 && (n[o] = e[o]);
194
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
195
- for (var t = 0, o = Object.getOwnPropertySymbols(e); t < o.length; t++)
196
- r.indexOf(o[t]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[t]) && (n[o[t]] = e[o[t]]);
197
- return n;
198
- };
199
- const ue = (e, r) => {
200
- const {
201
- prefixCls: n,
202
- className: o,
203
- rootClassName: t,
204
- style: c,
205
- children: s,
206
- icon: p,
207
- color: i,
208
- onClose: f,
209
- closeIcon: d,
210
- closable: h,
211
- bordered: m = !0
212
- } = e, g = ge(e, ["prefixCls", "className", "rootClassName", "style", "children", "icon", "color", "onClose", "closeIcon", "closable", "bordered"]), {
213
- getPrefixCls: y,
214
- direction: v,
215
- tag: u
216
- } = l.useContext(H), [S, N] = l.useState(!0);
217
- process.env.NODE_ENV !== "production" && oe("Tag").deprecated(!("visible" in g), "visible", "visible && <Tag />"), l.useEffect(() => {
218
- "visible" in g && N(g.visible);
219
- }, [g.visible]);
220
- const j = Q(i), E = G(i), $ = j || E, V = Object.assign(Object.assign({
221
- backgroundColor: i && !$ ? i : void 0
222
- }, u == null ? void 0 : u.style), c), a = y("tag", n), [D, F, M] = W(a), L = x(a, u == null ? void 0 : u.className, {
223
- [`${a}-${i}`]: $,
224
- [`${a}-has-color`]: i && !$,
225
- [`${a}-hidden`]: !S,
226
- [`${a}-rtl`]: v === "rtl",
227
- [`${a}-borderless`]: !m
228
- }, o, t, F, M), I = (C) => {
229
- C.stopPropagation(), f == null || f(C), !C.defaultPrevented && N(!1);
230
- }, [, R] = J(h, d, (C) => C === null ? /* @__PURE__ */ l.createElement(X, {
231
- className: `${a}-close-icon`,
232
- onClick: I
233
- }) : /* @__PURE__ */ l.createElement("span", {
234
- className: `${a}-close-icon`,
235
- onClick: I
236
- }, C), null, !1), k = typeof g.onClick == "function" || s && s.type === "a", w = p || null, q = w ? /* @__PURE__ */ l.createElement(l.Fragment, null, w, s && /* @__PURE__ */ l.createElement("span", null, s)) : s, z = /* @__PURE__ */ l.createElement("span", Object.assign({}, g, {
237
- ref: r,
238
- className: L,
239
- style: V
240
- }), q, R, j && /* @__PURE__ */ l.createElement(ce, {
241
- key: "preset",
242
- prefixCls: a
243
- }), E && /* @__PURE__ */ l.createElement(de, {
244
- key: "status",
245
- prefixCls: a
246
- }));
247
- return D(k ? /* @__PURE__ */ l.createElement(re, {
248
- component: "Tag"
249
- }, z) : z);
250
- }, P = /* @__PURE__ */ l.forwardRef(ue);
251
- process.env.NODE_ENV !== "production" && (P.displayName = "Tag");
252
- P.CheckableTag = se;
253
- const pe = P, Se = ({ children: e, className: r, ...n }) => /* @__PURE__ */ A(
254
- pe,
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { Tag as o } from "antd";
3
+ import s from "classnames";
4
+ const f = ({ children: e, className: t, ...r }) => /* @__PURE__ */ m(
5
+ o,
255
6
  {
256
- ...n,
257
- className: x(
258
- r,
7
+ ...r,
8
+ className: s(
9
+ t,
259
10
  "flex items-center justify-center border-0 rounded-md p-2 font-medium text-xs text-center"
260
11
  ),
261
12
  children: e
262
13
  }
263
14
  );
264
15
  export {
265
- Se as Tag
16
+ f as Tag
266
17
  };
@@ -1,12 +1,12 @@
1
- import { jsxs as s, jsx as l } from "react/jsx-runtime";
2
- import { c as r } from "../../index-NQd_zMf0.js";
3
- import o from "react";
4
- import { T as c } from "../../index-0mpuHoS5.js";
1
+ import { jsxs as o, jsx as l } from "react/jsx-runtime";
2
+ import { Typography as s } from "antd";
3
+ import r from "classnames";
4
+ import c from "react";
5
5
  const m = ({
6
6
  items: t = []
7
- }) => /* @__PURE__ */ s("div", { className: "relative", children: [
8
- /* @__PURE__ */ l("div", { className: "flex justify-between", children: t.map((e, a) => /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-y-3", children: [
9
- typeof e.label == "string" ? /* @__PURE__ */ l(c.Text, { className: "font-semibold text-xs", children: e.label }) : o.cloneElement(e.label, {
7
+ }) => /* @__PURE__ */ o("div", { className: "relative", children: [
8
+ /* @__PURE__ */ l("div", { className: "flex justify-between", children: t.map((e, a) => /* @__PURE__ */ o("div", { className: "flex flex-col items-center gap-y-3", children: [
9
+ typeof e.label == "string" ? /* @__PURE__ */ l(s.Text, { className: "font-semibold text-xs", children: e.label }) : c.cloneElement(e.label, {
10
10
  className: r([
11
11
  e.label.props.className,
12
12
  "font-semibold text-xs"
@@ -1,127 +1,112 @@
1
- import { jsxs as g, jsx as l, Fragment as _ } from "react/jsx-runtime";
2
- import { c as v } from "../../index-NQd_zMf0.js";
3
- import * as f from "react";
4
- import { useState as A, useRef as k, useEffect as y } from "react";
5
- import E from "../../icons/file-icon/index.js";
6
- import "../../index-s3u4YBl4.js";
7
- import { T as x } from "../../index-0mpuHoS5.js";
8
- import { _ as b, s as N, u as O, F as j } from "../../createFormattedComponent-FcpICAm8.js";
9
- import { D as z, U as F } from "../../UploadOutlined-D8jfLEgv.js";
10
- function C(e, s) {
11
- var o = e.values, r = b(e, ["values"]), c = s.values, n = b(s, ["values"]);
12
- return N(c, o) && N(r, n);
13
- }
14
- function M(e) {
15
- var s = O(), o = s.formatMessage, r = s.textComponent, c = r === void 0 ? f.Fragment : r, n = e.id, h = e.description, p = e.defaultMessage, t = e.values, i = e.children, a = e.tagName, m = a === void 0 ? c : a, d = e.ignoreTag, T = { id: n, description: h, defaultMessage: p }, u = o(T, t, {
16
- ignoreTag: d
17
- });
18
- return typeof i == "function" ? i(Array.isArray(u) ? u : [u]) : m ? f.createElement(m, null, f.Children.toArray(u)) : f.createElement(f.Fragment, null, u);
19
- }
20
- M.displayName = "FormattedMessage";
21
- var w = f.memo(M, C);
22
- w.displayName = "MemoizedFormattedMessage";
23
- const D = w, S = ({
24
- multiple: e = !1,
25
- onChange: s,
26
- value: o
1
+ import { jsxs as c, jsx as r, Fragment as b } from "react/jsx-runtime";
2
+ import { Typography as p } from "antd";
3
+ import h from "classnames";
4
+ import { useState as N, useRef as v, useEffect as x } from "react";
5
+ import w from "../../icons/file-icon/index.js";
6
+ import { FormattedNumberParts as F, FormattedMessage as k } from "react-intl";
7
+ import { D as j, U as u } from "../../UploadOutlined-9WKjHsqa.js";
8
+ const B = ({
9
+ multiple: l = !1,
10
+ onChange: a,
11
+ value: f
27
12
  }) => {
28
- const [r, c] = A([]), n = k(null), h = (t) => {
13
+ const [s, d] = N([]), o = v(null), g = (e) => {
29
14
  var i;
30
- (i = t.target.files) != null && i.length && c(e ? [
31
- ...r,
32
- ...Array.from(Array(t.target.files.length)).map(
33
- (a, m) => {
34
- var d;
35
- return (d = t.target.files) == null ? void 0 : d.item(m);
15
+ (i = e.target.files) != null && i.length && d(l ? [
16
+ ...s,
17
+ ...Array.from(Array(e.target.files.length)).map(
18
+ (t, m) => {
19
+ var n;
20
+ return (n = e.target.files) == null ? void 0 : n.item(m);
36
21
  }
37
22
  )
38
- ] : Array.from(Array(t.target.files.length)).map(
39
- (a, m) => {
40
- var d;
41
- return (d = t.target.files) == null ? void 0 : d.item(m);
23
+ ] : Array.from(Array(e.target.files.length)).map(
24
+ (t, m) => {
25
+ var n;
26
+ return (n = e.target.files) == null ? void 0 : n.item(m);
42
27
  }
43
28
  ));
44
- }, p = (t, i) => {
45
- t.stopPropagation();
46
- const a = [
47
- ...r.slice(0, i),
48
- ...r.slice(i + 1)
29
+ }, y = (e, i) => {
30
+ e.stopPropagation();
31
+ const t = [
32
+ ...s.slice(0, i),
33
+ ...s.slice(i + 1)
49
34
  ];
50
- c(a), s && s(a.length === 0 ? null : a), n.current && (n.current.value = "");
35
+ d(t), a && a(t.length === 0 ? null : t), o.current && (o.current.value = "");
51
36
  };
52
- return y(() => {
53
- o && o.length > 0 && c(o);
54
- }, [o]), y(() => {
55
- r.length > 0 && s && s(r);
56
- }, [r, s]), /* @__PURE__ */ g("div", { className: "flex flex-wrap gap-4", children: [
57
- r.map((t, i) => /* @__PURE__ */ g(
37
+ return x(() => {
38
+ f && f.length > 0 && d(f);
39
+ }, [f]), x(() => {
40
+ s.length > 0 && a && a(s);
41
+ }, [s, a]), /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-4", children: [
42
+ s.map((e, i) => /* @__PURE__ */ c(
58
43
  "div",
59
44
  {
60
- className: v(
45
+ className: h(
61
46
  "max-w-[258px] relative group flex items-center gap-x-3 py-2 pe-2 ps-4 bg-lightBlue rounded-2xl hover:cursor-pointer",
62
- { "basis-full": !e, "basis-1/3": e }
47
+ { "basis-full": !l, "basis-1/3": l }
63
48
  ),
64
49
  role: "button",
65
50
  onClick: () => {
66
- var a;
67
- return (a = n.current) == null ? void 0 : a.click();
51
+ var t;
52
+ return (t = o.current) == null ? void 0 : t.click();
68
53
  },
69
54
  children: [
70
- /* @__PURE__ */ l(
55
+ /* @__PURE__ */ r(
71
56
  "div",
72
57
  {
73
58
  className: "absolute opacity-0 group-hover:opacity-100 transition-opacity -left-2 -top-2 flex items-center justify-center text-ghostWhite bg-coral rounded-full w-6 h-6",
74
- onClick: (a) => p(a, i),
75
- children: /* @__PURE__ */ l(z, { size: 4 })
59
+ onClick: (t) => y(t, i),
60
+ children: /* @__PURE__ */ r(j, { size: 4 })
76
61
  }
77
62
  ),
78
- /* @__PURE__ */ l(F, { className: "flex-1 text-slateGray" }),
79
- /* @__PURE__ */ g("div", { className: "flex flex-col items-end gap-y-1", children: [
80
- /* @__PURE__ */ l(x.Text, { className: "text-xs font-semibold text-ellipsis overflow-hidden whitespace-nowrap max-w-[170px]", children: t.name }),
81
- /* @__PURE__ */ l(x.Text, { className: "text-xs", children: /* @__PURE__ */ l(j, { value: t.size, children: (a) => /* @__PURE__ */ g(_, { children: [
82
- a[0].value,
63
+ /* @__PURE__ */ r(u, { className: "flex-1 text-slateGray" }),
64
+ /* @__PURE__ */ c("div", { className: "flex flex-col items-end gap-y-1", children: [
65
+ /* @__PURE__ */ r(p.Text, { className: "text-xs font-semibold text-ellipsis overflow-hidden whitespace-nowrap max-w-[170px]", children: e.name }),
66
+ /* @__PURE__ */ r(p.Text, { className: "text-xs", children: /* @__PURE__ */ r(F, { value: e.size, children: (t) => /* @__PURE__ */ c(b, { children: [
67
+ t[0].value,
83
68
  " Kb"
84
69
  ] }) }) })
85
70
  ] }),
86
- /* @__PURE__ */ l(E, {})
71
+ /* @__PURE__ */ r(w, {})
87
72
  ]
88
73
  },
89
- t.name
74
+ e.name
90
75
  )),
91
- /* @__PURE__ */ g(
76
+ /* @__PURE__ */ c(
92
77
  "div",
93
78
  {
94
- className: v(
79
+ className: h(
95
80
  "max-w-[258px] flex flex-col items-center justify-center py-2 bg-lightBlue rounded-2xl hover:cursor-pointer",
96
81
  {
97
- hidden: !e && r.length > 0,
98
- "basis-full": !e,
99
- "basis-1/3": e
82
+ hidden: !l && s.length > 0,
83
+ "basis-full": !l,
84
+ "basis-1/3": l
100
85
  }
101
86
  ),
102
87
  role: "button",
103
88
  onClick: () => {
104
- var t;
105
- return (t = n.current) == null ? void 0 : t.click();
89
+ var e;
90
+ return (e = o.current) == null ? void 0 : e.click();
106
91
  },
107
92
  children: [
108
- /* @__PURE__ */ l(
93
+ /* @__PURE__ */ r(
109
94
  "input",
110
95
  {
111
- ref: n,
96
+ ref: o,
112
97
  type: "file",
113
- multiple: e,
98
+ multiple: l,
114
99
  className: "!hidden",
115
- onChange: h
100
+ onChange: g
116
101
  }
117
102
  ),
118
- /* @__PURE__ */ l(F, {}),
119
- /* @__PURE__ */ l(x.Text, { children: /* @__PURE__ */ l(D, { id: "upload_file" }) })
103
+ /* @__PURE__ */ r(u, {}),
104
+ /* @__PURE__ */ r(p.Text, { children: /* @__PURE__ */ r(k, { id: "upload_file" }) })
120
105
  ]
121
106
  }
122
107
  )
123
108
  ] });
124
109
  };
125
110
  export {
126
- S as Upload
111
+ B as Upload
127
112
  };
@@ -0,0 +1,87 @@
1
+ import { jsx as o, jsxs as p } from "react/jsx-runtime";
2
+ import { theme as g, Typography as x, Space as m } from "antd";
3
+ import c from "classnames";
4
+ import n, { useContext as y, createContext as f, useState as v } from "react";
5
+ import N from "./icons/dashboard-icon/index.js";
6
+ import { libTheme as k } from "./theme.js";
7
+ const d = ({
8
+ icon: t = /* @__PURE__ */ o(N, {}),
9
+ content: l,
10
+ onClick: s,
11
+ className: a
12
+ }) => {
13
+ const r = y(i), e = c(
14
+ "text-sm leading-none",
15
+ {
16
+ "text-dodgerBlue": r,
17
+ "font-bold": r
18
+ },
19
+ typeof l == "string" ? null : l.props.className
20
+ ), h = n.cloneElement(t, {
21
+ color: r ? g.getDesignToken(k).colorPrimary : "#64748B"
22
+ }), u = typeof l == "string" ? n.cloneElement(
23
+ /* @__PURE__ */ o(x.Text, { className: e, children: l })
24
+ ) : n.cloneElement(l, {
25
+ ...l.props,
26
+ className: e
27
+ });
28
+ return /* @__PURE__ */ p(
29
+ m,
30
+ {
31
+ size: 16,
32
+ onClick: s,
33
+ className: c(
34
+ "w-full leading-[0px] py-3 px-4 rounded-xl hover:cursor-pointer transition-colors duration-300 hover:bg-ghostWhite",
35
+ {
36
+ "bg-ghostWhite": r
37
+ },
38
+ a
39
+ ),
40
+ children: [
41
+ h,
42
+ u
43
+ ]
44
+ }
45
+ );
46
+ }, i = f(!1), M = ({ items: t, footerItems: l }) => {
47
+ const [s, a] = v();
48
+ return /* @__PURE__ */ p("div", { className: "w-full h-full flex flex-col gap-y-2", children: [
49
+ t.map(({ onClick: r, ...e }) => /* @__PURE__ */ o(
50
+ i.Provider,
51
+ {
52
+ value: s === e.key,
53
+ children: /* @__PURE__ */ o(
54
+ d,
55
+ {
56
+ ...e,
57
+ onClick: () => {
58
+ a(e.key), r && r();
59
+ }
60
+ }
61
+ )
62
+ },
63
+ e.key
64
+ )),
65
+ /* @__PURE__ */ o(m, { direction: "vertical", className: "mt-auto", children: l == null ? void 0 : l.map(({ onClick: r, ...e }) => /* @__PURE__ */ o(
66
+ i.Provider,
67
+ {
68
+ value: s === e.key,
69
+ children: /* @__PURE__ */ o(
70
+ d,
71
+ {
72
+ ...e,
73
+ onClick: () => {
74
+ a(e.key), r && r();
75
+ }
76
+ }
77
+ )
78
+ },
79
+ e.key
80
+ )) })
81
+ ] });
82
+ };
83
+ export {
84
+ i as H,
85
+ M as S,
86
+ d as a
87
+ };