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,716 +0,0 @@
1
- import * as V from "react";
2
- import d, { useRef as pe, cloneElement as Je, forwardRef as $e, useState as _e, useImperativeHandle as De, useEffect as xe, useContext as et } from "react";
3
- import { C as Be } from "./CloseCircleFilled-bIgIULWb.js";
4
- import { c as C } from "./index-NQd_zMf0.js";
5
- import { g as Fe, N as J, e as he, _ as X, x as Ce, b as le, i as Me, D as Ae, C as ke, a1 as Le, G as tt, z as Pe, y as Ve } from "./index-1KQbTQJ2.js";
6
- import { u as Oe } from "./useMergedState-qUafLuUa.js";
7
- import { R as at } from "./index--6VfGMUo.js";
8
- import { u as We, g as Ie, a as He } from "./useVariants-s0IcneBD.js";
9
- import { a as nt, b as Ke, N as Te } from "./Compact-fdEKV_mF.js";
10
- import { F as Ge, N as je } from "./context-h3WSVDPz.js";
11
- import { o as ot } from "./omit-ylWA0ZLZ.js";
12
- import { u as Ye } from "./index-GgkQrebz.js";
13
- import { u as Ze } from "./useCSSVarCls-GwZT_WiF.js";
14
- function rt(e) {
15
- return !!(e.addonBefore || e.addonAfter);
16
- }
17
- function st(e) {
18
- return !!(e.prefix || e.suffix || e.allowClear);
19
- }
20
- function Se(e, t, n, a) {
21
- if (n) {
22
- var o = t;
23
- if (t.type === "click") {
24
- var f = e.cloneNode(!0);
25
- o = Object.create(t, {
26
- target: {
27
- value: f
28
- },
29
- currentTarget: {
30
- value: f
31
- }
32
- }), f.value = "", n(o);
33
- return;
34
- }
35
- if (e.type !== "file" && a !== void 0) {
36
- var s = e.cloneNode(!0);
37
- o = Object.create(t, {
38
- target: {
39
- value: s
40
- },
41
- currentTarget: {
42
- value: s
43
- }
44
- }), s.value = a, n(o);
45
- return;
46
- }
47
- n(o);
48
- }
49
- }
50
- function lt(e, t) {
51
- if (e) {
52
- e.focus(t);
53
- var n = t || {}, a = n.cursor;
54
- if (a) {
55
- var o = e.value.length;
56
- switch (a) {
57
- case "start":
58
- e.setSelectionRange(0, 0);
59
- break;
60
- case "end":
61
- e.setSelectionRange(o, o);
62
- break;
63
- default:
64
- e.setSelectionRange(0, o);
65
- }
66
- }
67
- }
68
- }
69
- var Ue = function(t) {
70
- var n, a, o = t.inputElement, f = t.children, s = t.prefixCls, m = t.prefix, g = t.suffix, v = t.addonBefore, b = t.addonAfter, T = t.className, y = t.style, j = t.disabled, O = t.readOnly, B = t.focused, D = t.triggerFocus, _ = t.allowClear, Y = t.value, E = t.handleReset, $ = t.hidden, S = t.classes, i = t.classNames, p = t.dataAttrs, r = t.styles, l = t.components, k = f ?? o, Q = (l == null ? void 0 : l.affixWrapper) || "span", A = (l == null ? void 0 : l.groupWrapper) || "span", P = (l == null ? void 0 : l.wrapper) || "span", x = (l == null ? void 0 : l.groupAddon) || "span", Z = pe(null), L = function(I) {
71
- var U;
72
- (U = Z.current) !== null && U !== void 0 && U.contains(I.target) && (D == null || D());
73
- }, N = st(t), w = /* @__PURE__ */ Je(k, {
74
- value: Y,
75
- className: C(k.props.className, !N && (i == null ? void 0 : i.variant)) || null
76
- });
77
- if (N) {
78
- var R, q = null;
79
- if (_) {
80
- var W, ie = !j && !O && Y, H = "".concat(s, "-clear-icon"), F = Fe(_) === "object" && _ !== null && _ !== void 0 && _.clearIcon ? _.clearIcon : "✖";
81
- q = /* @__PURE__ */ d.createElement("span", {
82
- onClick: E,
83
- onMouseDown: function(I) {
84
- return I.preventDefault();
85
- },
86
- className: C(H, (W = {}, J(W, "".concat(H, "-hidden"), !ie), J(W, "".concat(H, "-has-suffix"), !!g), W)),
87
- role: "button",
88
- tabIndex: -1
89
- }, F);
90
- }
91
- var u = "".concat(s, "-affix-wrapper"), K = C(u, (R = {}, J(R, "".concat(s, "-disabled"), j), J(R, "".concat(u, "-disabled"), j), J(R, "".concat(u, "-focused"), B), J(R, "".concat(u, "-readonly"), O), J(R, "".concat(u, "-input-with-clear-btn"), g && _ && Y), R), S == null ? void 0 : S.affixWrapper, i == null ? void 0 : i.affixWrapper, i == null ? void 0 : i.variant), oe = (g || _) && /* @__PURE__ */ d.createElement("span", {
92
- className: C("".concat(s, "-suffix"), i == null ? void 0 : i.suffix),
93
- style: r == null ? void 0 : r.suffix
94
- }, q, g);
95
- w = /* @__PURE__ */ d.createElement(Q, he({
96
- className: K,
97
- style: r == null ? void 0 : r.affixWrapper,
98
- onClick: L
99
- }, p == null ? void 0 : p.affixWrapper, {
100
- ref: Z
101
- }), m && /* @__PURE__ */ d.createElement("span", {
102
- className: C("".concat(s, "-prefix"), i == null ? void 0 : i.prefix),
103
- style: r == null ? void 0 : r.prefix
104
- }, m), w, oe);
105
- }
106
- if (rt(t)) {
107
- var ee = "".concat(s, "-group"), te = "".concat(ee, "-addon"), de = "".concat(ee, "-wrapper"), M = C("".concat(s, "-wrapper"), ee, S == null ? void 0 : S.wrapper, i == null ? void 0 : i.wrapper), ae = C(de, J({}, "".concat(de, "-disabled"), j), S == null ? void 0 : S.group, i == null ? void 0 : i.groupWrapper);
108
- w = /* @__PURE__ */ d.createElement(A, {
109
- className: ae
110
- }, /* @__PURE__ */ d.createElement(P, {
111
- className: M
112
- }, v && /* @__PURE__ */ d.createElement(x, {
113
- className: te
114
- }, v), w, b && /* @__PURE__ */ d.createElement(x, {
115
- className: te
116
- }, b)));
117
- }
118
- return /* @__PURE__ */ d.cloneElement(w, {
119
- className: C((n = w.props) === null || n === void 0 ? void 0 : n.className, T) || null,
120
- style: X(X({}, (a = w.props) === null || a === void 0 ? void 0 : a.style), y),
121
- hidden: $
122
- });
123
- }, it = ["show"];
124
- function Xe(e, t) {
125
- return V.useMemo(function() {
126
- var n = {};
127
- t && (n.show = Fe(t) === "object" && t.formatter ? t.formatter : !!t), n = X(X({}, n), e);
128
- var a = n, o = a.show, f = Ce(a, it);
129
- return X(X({}, f), {}, {
130
- show: !!o,
131
- showFormatter: typeof o == "function" ? o : void 0,
132
- strategy: f.strategy || function(s) {
133
- return s.length;
134
- }
135
- });
136
- }, [e, t]);
137
- }
138
- var ut = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnter", "onKeyDown", "prefixCls", "disabled", "htmlSize", "className", "maxLength", "suffix", "showCount", "count", "type", "classes", "classNames", "styles", "onCompositionStart", "onCompositionEnd"], ct = /* @__PURE__ */ $e(function(e, t) {
139
- var n = e.autoComplete, a = e.onChange, o = e.onFocus, f = e.onBlur, s = e.onPressEnter, m = e.onKeyDown, g = e.prefixCls, v = g === void 0 ? "rc-input" : g, b = e.disabled, T = e.htmlSize, y = e.className, j = e.maxLength, O = e.suffix, B = e.showCount, D = e.count, _ = e.type, Y = _ === void 0 ? "text" : _, E = e.classes, $ = e.classNames, S = e.styles, i = e.onCompositionStart, p = e.onCompositionEnd, r = Ce(e, ut), l = _e(!1), k = le(l, 2), Q = k[0], A = k[1], P = pe(!1), x = pe(null), Z = function(c) {
140
- x.current && lt(x.current, c);
141
- }, L = Oe(e.defaultValue, {
142
- value: e.value
143
- }), N = le(L, 2), w = N[0], R = N[1], q = w == null ? "" : String(w), W = _e(null), ie = le(W, 2), H = ie[0], F = ie[1], u = Xe(D, B), K = u.max || j, oe = u.strategy(q), ee = !!K && oe > K;
144
- De(t, function() {
145
- return {
146
- focus: Z,
147
- blur: function() {
148
- var c;
149
- (c = x.current) === null || c === void 0 || c.blur();
150
- },
151
- setSelectionRange: function(c, re, me) {
152
- var ue;
153
- (ue = x.current) === null || ue === void 0 || ue.setSelectionRange(c, re, me);
154
- },
155
- select: function() {
156
- var c;
157
- (c = x.current) === null || c === void 0 || c.select();
158
- },
159
- input: x.current
160
- };
161
- }), xe(function() {
162
- A(function(z) {
163
- return z && b ? !1 : z;
164
- });
165
- }, [b]);
166
- var te = function(c, re, me) {
167
- var ue = re;
168
- if (!P.current && u.exceedFormatter && u.max && u.strategy(re) > u.max) {
169
- if (ue = u.exceedFormatter(re, {
170
- max: u.max
171
- }), re !== ue) {
172
- var ge, ce;
173
- F([((ge = x.current) === null || ge === void 0 ? void 0 : ge.selectionStart) || 0, ((ce = x.current) === null || ce === void 0 ? void 0 : ce.selectionEnd) || 0]);
174
- }
175
- } else if (me.source === "compositionEnd")
176
- return;
177
- R(ue), x.current && Se(x.current, c, a, ue);
178
- };
179
- xe(function() {
180
- if (H) {
181
- var z;
182
- (z = x.current) === null || z === void 0 || z.setSelectionRange.apply(z, Me(H));
183
- }
184
- }, [H]);
185
- var de = function(c) {
186
- te(c, c.target.value, {
187
- source: "change"
188
- });
189
- }, M = function(c) {
190
- P.current = !1, te(c, c.currentTarget.value, {
191
- source: "compositionEnd"
192
- }), p == null || p(c);
193
- }, ae = function(c) {
194
- s && c.key === "Enter" && s(c), m == null || m(c);
195
- }, fe = function(c) {
196
- A(!0), o == null || o(c);
197
- }, I = function(c) {
198
- A(!1), f == null || f(c);
199
- }, U = function(c) {
200
- R(""), Z(), x.current && Se(x.current, c, a);
201
- }, be = ee && "".concat(v, "-out-of-range"), ye = function() {
202
- var c = ot(e, [
203
- "prefixCls",
204
- "onPressEnter",
205
- "addonBefore",
206
- "addonAfter",
207
- "prefix",
208
- "suffix",
209
- "allowClear",
210
- // Input elements must be either controlled or uncontrolled,
211
- // specify either the value prop, or the defaultValue prop, but not both.
212
- "defaultValue",
213
- "showCount",
214
- "count",
215
- "classes",
216
- "htmlSize",
217
- "styles",
218
- "classNames"
219
- ]);
220
- return /* @__PURE__ */ d.createElement("input", he({
221
- autoComplete: n
222
- }, c, {
223
- onChange: de,
224
- onFocus: fe,
225
- onBlur: I,
226
- onKeyDown: ae,
227
- className: C(v, J({}, "".concat(v, "-disabled"), b), $ == null ? void 0 : $.input),
228
- style: S == null ? void 0 : S.input,
229
- ref: x,
230
- size: T,
231
- type: Y,
232
- onCompositionStart: function(me) {
233
- P.current = !0, i == null || i(me);
234
- },
235
- onCompositionEnd: M
236
- }));
237
- }, we = function() {
238
- var c = Number(K) > 0;
239
- if (O || u.show) {
240
- var re = u.showFormatter ? u.showFormatter({
241
- value: q,
242
- count: oe,
243
- maxLength: K
244
- }) : "".concat(oe).concat(c ? " / ".concat(K) : "");
245
- return /* @__PURE__ */ d.createElement(d.Fragment, null, u.show && /* @__PURE__ */ d.createElement("span", {
246
- className: C("".concat(v, "-show-count-suffix"), J({}, "".concat(v, "-show-count-has-suffix"), !!O), $ == null ? void 0 : $.count),
247
- style: X({}, S == null ? void 0 : S.count)
248
- }, re), O);
249
- }
250
- return null;
251
- };
252
- return /* @__PURE__ */ d.createElement(Ue, he({}, r, {
253
- prefixCls: v,
254
- className: C(y, be),
255
- handleReset: U,
256
- value: q,
257
- focused: Q,
258
- triggerFocus: Z,
259
- suffix: we(),
260
- disabled: b,
261
- classes: E,
262
- classNames: $,
263
- styles: S
264
- }), ye());
265
- });
266
- function dt(e, t) {
267
- const n = pe([]), a = () => {
268
- n.current.push(setTimeout(() => {
269
- var o, f, s, m;
270
- !((o = e.current) === null || o === void 0) && o.input && ((f = e.current) === null || f === void 0 ? void 0 : f.input.getAttribute("type")) === "password" && (!((s = e.current) === null || s === void 0) && s.input.hasAttribute("value")) && ((m = e.current) === null || m === void 0 || m.input.removeAttribute("value"));
271
- }));
272
- };
273
- return xe(() => (t && a(), () => n.current.forEach((o) => {
274
- o && clearTimeout(o);
275
- })), []), a;
276
- }
277
- function ft(e) {
278
- return !!(e.prefix || e.suffix || e.allowClear || e.showCount);
279
- }
280
- const vt = (e) => {
281
- let t;
282
- return typeof e == "object" && (e != null && e.clearIcon) ? t = e : e && (t = {
283
- clearIcon: /* @__PURE__ */ d.createElement(Be, null)
284
- }), t;
285
- };
286
- var mt = function(e, t) {
287
- var n = {};
288
- for (var a in e)
289
- Object.prototype.hasOwnProperty.call(e, a) && t.indexOf(a) < 0 && (n[a] = e[a]);
290
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
291
- for (var o = 0, a = Object.getOwnPropertySymbols(e); o < a.length; o++)
292
- t.indexOf(a[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, a[o]) && (n[a[o]] = e[a[o]]);
293
- return n;
294
- };
295
- function gt(e, t) {
296
- if (!e)
297
- return;
298
- e.focus(t);
299
- const {
300
- cursor: n
301
- } = t || {};
302
- if (n) {
303
- const a = e.value.length;
304
- switch (n) {
305
- case "start":
306
- e.setSelectionRange(0, 0);
307
- break;
308
- case "end":
309
- e.setSelectionRange(a, a);
310
- break;
311
- default:
312
- e.setSelectionRange(0, a);
313
- break;
314
- }
315
- }
316
- }
317
- const Dt = /* @__PURE__ */ $e((e, t) => {
318
- var n;
319
- const {
320
- prefixCls: a,
321
- bordered: o = !0,
322
- status: f,
323
- size: s,
324
- disabled: m,
325
- onBlur: g,
326
- onFocus: v,
327
- suffix: b,
328
- allowClear: T,
329
- addonAfter: y,
330
- addonBefore: j,
331
- className: O,
332
- style: B,
333
- styles: D,
334
- rootClassName: _,
335
- onChange: Y,
336
- classNames: E,
337
- variant: $
338
- } = e, S = mt(e, ["prefixCls", "bordered", "status", "size", "disabled", "onBlur", "onFocus", "suffix", "allowClear", "addonAfter", "addonBefore", "className", "style", "styles", "rootClassName", "onChange", "classNames", "variant"]);
339
- if (process.env.NODE_ENV !== "production") {
340
- const {
341
- deprecated: I
342
- } = Ae("Input");
343
- I(!("bordered" in e), "bordered", "variant");
344
- }
345
- const {
346
- getPrefixCls: i,
347
- direction: p,
348
- input: r
349
- } = d.useContext(ke), l = i("input", a), k = pe(null), Q = Ze(l), [A, P, x] = Ye(l, Q), {
350
- compactSize: Z,
351
- compactItemClassnames: L
352
- } = nt(l, p), N = Ke((I) => {
353
- var U;
354
- return (U = s ?? Z) !== null && U !== void 0 ? U : I;
355
- }), w = d.useContext(Le), R = m ?? w, {
356
- status: q,
357
- hasFeedback: W,
358
- feedbackIcon: ie
359
- } = et(Ge), H = He(q, f), F = ft(e) || !!W, u = pe(F);
360
- if (process.env.NODE_ENV !== "production") {
361
- const I = Ae("Input");
362
- xe(() => {
363
- var U;
364
- F && !u.current && process.env.NODE_ENV !== "production" && I(document.activeElement === ((U = k.current) === null || U === void 0 ? void 0 : U.input), "usage", "When Input is focused, dynamic add or remove prefix / suffix will make it lose focus caused by dom structure change. Read more: https://ant.design/components/input/#FAQ"), u.current = F;
365
- }, [F]);
366
- }
367
- const K = dt(k, !0), oe = (I) => {
368
- K(), g == null || g(I);
369
- }, ee = (I) => {
370
- K(), v == null || v(I);
371
- }, te = (I) => {
372
- K(), Y == null || Y(I);
373
- }, de = (W || b) && /* @__PURE__ */ d.createElement(d.Fragment, null, b, W && ie), M = vt(T), [ae, fe] = We($, o);
374
- return A(/* @__PURE__ */ d.createElement(ct, Object.assign({
375
- ref: tt(t, k),
376
- prefixCls: l,
377
- autoComplete: r == null ? void 0 : r.autoComplete
378
- }, S, {
379
- disabled: R,
380
- onBlur: oe,
381
- onFocus: ee,
382
- style: Object.assign(Object.assign({}, r == null ? void 0 : r.style), B),
383
- styles: Object.assign(Object.assign({}, r == null ? void 0 : r.styles), D),
384
- suffix: de,
385
- allowClear: M,
386
- className: C(O, _, x, Q, L, r == null ? void 0 : r.className),
387
- onChange: te,
388
- addonAfter: y && /* @__PURE__ */ d.createElement(Te, null, /* @__PURE__ */ d.createElement(je, {
389
- override: !0,
390
- status: !0
391
- }, y)),
392
- addonBefore: j && /* @__PURE__ */ d.createElement(Te, null, /* @__PURE__ */ d.createElement(je, {
393
- override: !0,
394
- status: !0
395
- }, j)),
396
- classNames: Object.assign(Object.assign(Object.assign({}, E), r == null ? void 0 : r.classNames), {
397
- input: C({
398
- [`${l}-sm`]: N === "small",
399
- [`${l}-lg`]: N === "large",
400
- [`${l}-rtl`]: p === "rtl"
401
- }, E == null ? void 0 : E.input, (n = r == null ? void 0 : r.classNames) === null || n === void 0 ? void 0 : n.input, P),
402
- variant: C({
403
- [`${l}-${ae}`]: fe
404
- }, Ie(l, H)),
405
- affixWrapper: C({
406
- [`${l}-affix-wrapper-sm`]: N === "small",
407
- [`${l}-affix-wrapper-lg`]: N === "large",
408
- [`${l}-affix-wrapper-rtl`]: p === "rtl"
409
- }, P),
410
- wrapper: C({
411
- [`${l}-group-rtl`]: p === "rtl"
412
- }, P),
413
- groupWrapper: C({
414
- [`${l}-group-wrapper-sm`]: N === "small",
415
- [`${l}-group-wrapper-lg`]: N === "large",
416
- [`${l}-group-wrapper-rtl`]: p === "rtl",
417
- [`${l}-group-wrapper-${ae}`]: fe
418
- }, Ie(`${l}-group-wrapper`, H, W), P)
419
- })
420
- })));
421
- });
422
- var pt = `
423
- min-height:0 !important;
424
- max-height:none !important;
425
- height:0 !important;
426
- visibility:hidden !important;
427
- overflow:hidden !important;
428
- position:absolute !important;
429
- z-index:-1000 !important;
430
- top:0 !important;
431
- right:0 !important;
432
- pointer-events: none !important;
433
- `, xt = ["letter-spacing", "line-height", "padding-top", "padding-bottom", "font-family", "font-weight", "font-size", "font-variant", "text-rendering", "text-transform", "width", "text-indent", "padding-left", "padding-right", "border-width", "box-sizing", "word-break", "white-space"], Ee = {}, ne;
434
- function ht(e) {
435
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = e.getAttribute("id") || e.getAttribute("data-reactid") || e.getAttribute("name");
436
- if (t && Ee[n])
437
- return Ee[n];
438
- var a = window.getComputedStyle(e), o = a.getPropertyValue("box-sizing") || a.getPropertyValue("-moz-box-sizing") || a.getPropertyValue("-webkit-box-sizing"), f = parseFloat(a.getPropertyValue("padding-bottom")) + parseFloat(a.getPropertyValue("padding-top")), s = parseFloat(a.getPropertyValue("border-bottom-width")) + parseFloat(a.getPropertyValue("border-top-width")), m = xt.map(function(v) {
439
- return "".concat(v, ":").concat(a.getPropertyValue(v));
440
- }).join(";"), g = {
441
- sizingStyle: m,
442
- paddingSize: f,
443
- borderSize: s,
444
- boxSizing: o
445
- };
446
- return t && n && (Ee[n] = g), g;
447
- }
448
- function bt(e) {
449
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
450
- ne || (ne = document.createElement("textarea"), ne.setAttribute("tab-index", "-1"), ne.setAttribute("aria-hidden", "true"), document.body.appendChild(ne)), e.getAttribute("wrap") ? ne.setAttribute("wrap", e.getAttribute("wrap")) : ne.removeAttribute("wrap");
451
- var o = ht(e, t), f = o.paddingSize, s = o.borderSize, m = o.boxSizing, g = o.sizingStyle;
452
- ne.setAttribute("style", "".concat(g, ";").concat(pt)), ne.value = e.value || e.placeholder || "";
453
- var v = void 0, b = void 0, T, y = ne.scrollHeight;
454
- if (m === "border-box" ? y += s : m === "content-box" && (y -= f), n !== null || a !== null) {
455
- ne.value = " ";
456
- var j = ne.scrollHeight - f;
457
- n !== null && (v = j * n, m === "border-box" && (v = v + f + s), y = Math.max(v, y)), a !== null && (b = j * a, m === "border-box" && (b = b + f + s), T = y > b ? "" : "hidden", y = Math.min(b, y));
458
- }
459
- var O = {
460
- height: y,
461
- overflowY: T,
462
- resize: "none"
463
- };
464
- return v && (O.minHeight = v), b && (O.maxHeight = b), O;
465
- }
466
- var St = ["prefixCls", "onPressEnter", "defaultValue", "value", "autoSize", "onResize", "className", "style", "disabled", "onChange", "onInternalAutoSize"], Re = 0, Ne = 1, ze = 2, Ct = /* @__PURE__ */ V.forwardRef(function(e, t) {
467
- var n = e, a = n.prefixCls;
468
- n.onPressEnter;
469
- var o = n.defaultValue, f = n.value, s = n.autoSize, m = n.onResize, g = n.className, v = n.style, b = n.disabled, T = n.onChange, y = n.onInternalAutoSize, j = Ce(n, St), O = Oe(o, {
470
- value: f,
471
- postState: function(u) {
472
- return u ?? "";
473
- }
474
- }), B = le(O, 2), D = B[0], _ = B[1], Y = function(u) {
475
- _(u.target.value), T == null || T(u);
476
- }, E = V.useRef();
477
- V.useImperativeHandle(t, function() {
478
- return {
479
- textArea: E.current
480
- };
481
- });
482
- var $ = V.useMemo(function() {
483
- return s && Fe(s) === "object" ? [s.minRows, s.maxRows] : [];
484
- }, [s]), S = le($, 2), i = S[0], p = S[1], r = !!s, l = function() {
485
- try {
486
- if (document.activeElement === E.current) {
487
- var u = E.current, K = u.selectionStart, oe = u.selectionEnd, ee = u.scrollTop;
488
- E.current.setSelectionRange(K, oe), E.current.scrollTop = ee;
489
- }
490
- } catch {
491
- }
492
- }, k = V.useState(ze), Q = le(k, 2), A = Q[0], P = Q[1], x = V.useState(), Z = le(x, 2), L = Z[0], N = Z[1], w = function() {
493
- P(Re), process.env.NODE_ENV === "test" && (y == null || y());
494
- };
495
- Pe(function() {
496
- r && w();
497
- }, [f, i, p, r]), Pe(function() {
498
- if (A === Re)
499
- P(Ne);
500
- else if (A === Ne) {
501
- var F = bt(E.current, !1, i, p);
502
- P(ze), N(F);
503
- } else
504
- l();
505
- }, [A]);
506
- var R = V.useRef(), q = function() {
507
- Ve.cancel(R.current);
508
- }, W = function(u) {
509
- A === ze && (m == null || m(u), s && (q(), R.current = Ve(function() {
510
- w();
511
- })));
512
- };
513
- V.useEffect(function() {
514
- return q;
515
- }, []);
516
- var ie = r ? L : null, H = X(X({}, v), ie);
517
- return (A === Re || A === Ne) && (H.overflowY = "hidden", H.overflowX = "hidden"), /* @__PURE__ */ V.createElement(at, {
518
- onResize: W,
519
- disabled: !(s || m)
520
- }, /* @__PURE__ */ V.createElement("textarea", he({}, j, {
521
- ref: E,
522
- style: H,
523
- className: C(a, g, J({}, "".concat(a, "-disabled"), b)),
524
- disabled: b,
525
- value: D,
526
- onChange: Y
527
- })));
528
- }), yt = ["defaultValue", "value", "onFocus", "onBlur", "onChange", "allowClear", "maxLength", "onCompositionStart", "onCompositionEnd", "suffix", "prefixCls", "showCount", "count", "className", "style", "disabled", "hidden", "classNames", "styles", "onResize"], wt = /* @__PURE__ */ d.forwardRef(function(e, t) {
529
- var n, a, o = e.defaultValue, f = e.value, s = e.onFocus, m = e.onBlur, g = e.onChange, v = e.allowClear, b = e.maxLength, T = e.onCompositionStart, y = e.onCompositionEnd, j = e.suffix, O = e.prefixCls, B = O === void 0 ? "rc-textarea" : O, D = e.showCount, _ = e.count, Y = e.className, E = e.style, $ = e.disabled, S = e.hidden, i = e.classNames, p = e.styles, r = e.onResize, l = Ce(e, yt), k = Oe(o, {
530
- value: f,
531
- defaultValue: o
532
- }), Q = le(k, 2), A = Q[0], P = Q[1], x = A == null ? "" : String(A), Z = d.useState(!1), L = le(Z, 2), N = L[0], w = L[1], R = d.useRef(!1), q = d.useState(null), W = le(q, 2), ie = W[0], H = W[1], F = pe(null), u = function() {
533
- var h;
534
- return (h = F.current) === null || h === void 0 ? void 0 : h.textArea;
535
- }, K = function() {
536
- u().focus();
537
- };
538
- De(t, function() {
539
- return {
540
- resizableTextArea: F.current,
541
- focus: K,
542
- blur: function() {
543
- u().blur();
544
- }
545
- };
546
- }), xe(function() {
547
- w(function(G) {
548
- return !$ && G;
549
- });
550
- }, [$]);
551
- var oe = d.useState(null), ee = le(oe, 2), te = ee[0], de = ee[1];
552
- d.useEffect(function() {
553
- if (te) {
554
- var G;
555
- (G = u()).setSelectionRange.apply(G, Me(te));
556
- }
557
- }, [te]);
558
- var M = Xe(_, D), ae = (n = M.max) !== null && n !== void 0 ? n : b, fe = Number(ae) > 0, I = M.strategy(x), U = !!ae && I > ae, be = function(h, se) {
559
- var ve = se;
560
- !R.current && M.exceedFormatter && M.max && M.strategy(se) > M.max && (ve = M.exceedFormatter(se, {
561
- max: M.max
562
- }), se !== ve && de([u().selectionStart || 0, u().selectionEnd || 0])), P(ve), Se(h.currentTarget, h, g, ve);
563
- }, ye = function(h) {
564
- R.current = !0, T == null || T(h);
565
- }, we = function(h) {
566
- R.current = !1, be(h, h.currentTarget.value), y == null || y(h);
567
- }, z = function(h) {
568
- be(h, h.target.value);
569
- }, c = function(h) {
570
- var se = l.onPressEnter, ve = l.onKeyDown;
571
- h.key === "Enter" && se && se(h), ve == null || ve(h);
572
- }, re = function(h) {
573
- w(!0), s == null || s(h);
574
- }, me = function(h) {
575
- w(!1), m == null || m(h);
576
- }, ue = function(h) {
577
- P(""), K(), Se(u(), h, g);
578
- }, ge = j, ce;
579
- M.show && (M.showFormatter ? ce = M.showFormatter({
580
- value: x,
581
- count: I,
582
- maxLength: ae
583
- }) : ce = "".concat(I).concat(fe ? " / ".concat(ae) : ""), ge = /* @__PURE__ */ d.createElement(d.Fragment, null, ge, /* @__PURE__ */ d.createElement("span", {
584
- className: C("".concat(B, "-data-count"), i == null ? void 0 : i.count),
585
- style: p == null ? void 0 : p.count
586
- }, ce)));
587
- var Qe = function(h) {
588
- var se;
589
- r == null || r(h), (se = u()) !== null && se !== void 0 && se.style.height && H(!0);
590
- }, qe = !l.autoSize && !D && !v;
591
- return /* @__PURE__ */ d.createElement(Ue, {
592
- value: x,
593
- allowClear: v,
594
- handleReset: ue,
595
- suffix: ge,
596
- prefixCls: B,
597
- classNames: X(X({}, i), {}, {
598
- affixWrapper: C(i == null ? void 0 : i.affixWrapper, (a = {}, J(a, "".concat(B, "-show-count"), D), J(a, "".concat(B, "-textarea-allow-clear"), v), a))
599
- }),
600
- disabled: $,
601
- focused: N,
602
- className: C(Y, U && "".concat(B, "-out-of-range")),
603
- style: X(X({}, E), ie && !qe ? {
604
- height: "auto"
605
- } : {}),
606
- dataAttrs: {
607
- affixWrapper: {
608
- "data-count": typeof ce == "string" ? ce : void 0
609
- }
610
- },
611
- hidden: S
612
- }, /* @__PURE__ */ d.createElement(Ct, he({}, l, {
613
- maxLength: b,
614
- onKeyDown: c,
615
- onChange: z,
616
- onFocus: re,
617
- onBlur: me,
618
- onCompositionStart: ye,
619
- onCompositionEnd: we,
620
- className: C(i == null ? void 0 : i.textarea),
621
- style: X(X({}, p == null ? void 0 : p.textarea), {}, {
622
- resize: E == null ? void 0 : E.resize
623
- }),
624
- disabled: $,
625
- prefixCls: B,
626
- onResize: Qe,
627
- ref: F
628
- })));
629
- }), Et = function(e, t) {
630
- var n = {};
631
- for (var a in e)
632
- Object.prototype.hasOwnProperty.call(e, a) && t.indexOf(a) < 0 && (n[a] = e[a]);
633
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
634
- for (var o = 0, a = Object.getOwnPropertySymbols(e); o < a.length; o++)
635
- t.indexOf(a[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, a[o]) && (n[a[o]] = e[a[o]]);
636
- return n;
637
- };
638
- const Rt = /* @__PURE__ */ $e((e, t) => {
639
- var n;
640
- const {
641
- prefixCls: a,
642
- bordered: o = !0,
643
- size: f,
644
- disabled: s,
645
- status: m,
646
- allowClear: g,
647
- classNames: v,
648
- rootClassName: b,
649
- className: T,
650
- variant: y
651
- } = e, j = Et(e, ["prefixCls", "bordered", "size", "disabled", "status", "allowClear", "classNames", "rootClassName", "className", "variant"]);
652
- if (process.env.NODE_ENV !== "production") {
653
- const {
654
- deprecated: L
655
- } = Ae("TextArea");
656
- L(!("bordered" in e), "bordered", "variant");
657
- }
658
- const {
659
- getPrefixCls: O,
660
- direction: B
661
- } = V.useContext(ke), D = Ke(f), _ = V.useContext(Le), Y = s ?? _, {
662
- status: E,
663
- hasFeedback: $,
664
- feedbackIcon: S
665
- } = V.useContext(Ge), i = He(E, m), p = V.useRef(null);
666
- V.useImperativeHandle(t, () => {
667
- var L;
668
- return {
669
- resizableTextArea: (L = p.current) === null || L === void 0 ? void 0 : L.resizableTextArea,
670
- focus: (N) => {
671
- var w, R;
672
- gt((R = (w = p.current) === null || w === void 0 ? void 0 : w.resizableTextArea) === null || R === void 0 ? void 0 : R.textArea, N);
673
- },
674
- blur: () => {
675
- var N;
676
- return (N = p.current) === null || N === void 0 ? void 0 : N.blur();
677
- }
678
- };
679
- });
680
- const r = O("input", a);
681
- let l;
682
- typeof g == "object" && (g != null && g.clearIcon) ? l = g : g && (l = {
683
- clearIcon: /* @__PURE__ */ V.createElement(Be, null)
684
- });
685
- const k = Ze(r), [Q, A, P] = Ye(r, k), [x, Z] = We(y, o);
686
- return Q(/* @__PURE__ */ V.createElement(wt, Object.assign({}, j, {
687
- disabled: Y,
688
- allowClear: l,
689
- className: C(P, k, T, b),
690
- classNames: Object.assign(Object.assign({}, v), {
691
- textarea: C({
692
- [`${r}-sm`]: D === "small",
693
- [`${r}-lg`]: D === "large"
694
- }, A, v == null ? void 0 : v.textarea),
695
- variant: C({
696
- [`${r}-${x}`]: Z
697
- }, Ie(r, i)),
698
- affixWrapper: C(`${r}-textarea-affix-wrapper`, {
699
- [`${r}-affix-wrapper-rtl`]: B === "rtl",
700
- [`${r}-affix-wrapper-sm`]: D === "small",
701
- [`${r}-affix-wrapper-lg`]: D === "large",
702
- [`${r}-textarea-show-count`]: e.showCount || ((n = e.count) === null || n === void 0 ? void 0 : n.show)
703
- }, A)
704
- }),
705
- prefixCls: r,
706
- suffix: $ && /* @__PURE__ */ V.createElement("span", {
707
- className: `${r}-textarea-suffix`
708
- }, S),
709
- ref: p
710
- })));
711
- }), Bt = Rt;
712
- export {
713
- Dt as I,
714
- Bt as T,
715
- dt as u
716
- };