@gobolt/genesis 0.0.11 → 0.1.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 +6 -0
- package/dist/ClockCircleOutlined-BaXQuLIn.js +13 -0
- package/dist/{Compact-DBh6nSYB.js → Compact-Du9689ax.js} +8 -8
- package/dist/{ContextIsolator-CwuJooYf.js → ContextIsolator-BmfhJgG0.js} +2 -2
- package/dist/{DownOutlined-5-15jS0h.js → DownOutlined-Dcq69ZKM.js} +9 -9
- package/dist/{EllipsisOutlined-CJ2pgE2d.js → EllipsisOutlined-DGMph0Bj.js} +110 -110
- package/dist/{Keyframes-sPZXYuXt.js → Keyframes-C9_aCDvn.js} +1 -1
- package/dist/{Overflow-DdNKJLQh.js → Overflow-DWf4XIal.js} +31 -31
- package/dist/{Skeleton-B3vg9CbL.js → Skeleton-BVN4pcVe.js} +2 -2
- package/dist/TextArea-Bkf9hh7l.js +708 -0
- package/dist/{Typography-DqI7RslA.js → Typography-CoZ5qD-t.js} +3 -3
- package/dist/{button-B2Rgggx2.js → button-BwqpCxVM.js} +5 -5
- package/dist/components/Avatar/Avatar.js +3 -3
- package/dist/components/Avatar/__tests__/Avatar.test.js +1 -1
- package/dist/components/Avatar/styles.js +42 -42
- package/dist/components/Badge/Badge.js +3 -3
- package/dist/components/Badge/__tests__/Badge.test.js +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/__tests__/Breadcrumb.test.js +1 -1
- package/dist/components/Breadcrumb/styles.js +4 -4
- package/dist/components/Button/__tests__/Button.test.js +1 -1
- package/dist/components/Button/styles.js +1 -1
- package/dist/components/Card/__tests__/Card.test.js +1 -1
- package/dist/components/Card/styles.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +3 -3
- package/dist/components/Checkbox/__tests__/Checkbox.test.js +1 -1
- package/dist/components/Checkbox/styles.js +1 -1
- package/dist/components/Dashboard/__stories__/DashboardLayoutContent.js +8 -8
- package/dist/components/Dashboard/__stories__/DashboardLayoutHeader.js +4 -4
- package/dist/components/Dashboard/__tests__/Dashboard.test.js +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +6 -0
- package/dist/components/DatePicker/DatePicker.js +5 -0
- package/dist/components/DatePicker/__stories__/DatePicker.stories.d.ts +10 -0
- package/dist/components/DatePicker/__tests__/DatePicker.test.d.ts +1 -0
- package/dist/components/DatePicker/__tests__/DatePicker.test.js +19 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/index.js +4 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +5 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +5 -0
- package/dist/components/DateRangePicker/__stories__/DateRangePicker.stories.d.ts +9 -0
- package/dist/components/DateRangePicker/__tests__/DateRangePicker.test.d.ts +1 -0
- package/dist/components/DateRangePicker/__tests__/DateRangePicker.test.js +23 -0
- package/dist/components/DateRangePicker/index.d.ts +2 -0
- package/dist/components/DateRangePicker/index.js +4 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.js +3 -3
- package/dist/components/ErrorBoundary/__tests__/ErrorBoundary.test.js +1 -1
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.js +3 -3
- package/dist/components/ErrorBoundaryFallback/styles.js +1 -1
- package/dist/components/Form/Form.js +2 -2
- package/dist/components/Form/__stories__/FormStory.js +4 -4
- package/dist/components/Form/__tests__/form.test.js +2 -2
- package/dist/components/Form/index.js +1 -1
- package/dist/components/Form/styles.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/__tests__/Input.test.js +1 -1
- package/dist/components/Input/styles.js +1 -1
- package/dist/components/Layout/Content/ResponsiveContent.js +3 -3
- package/dist/components/Layout/MainLayout/MainLayout.js +1 -1
- package/dist/components/Layout/__tests__/Layout.test.js +1 -1
- package/dist/components/Message/Message.js +3 -3
- package/dist/components/Message/__tests__/Message.test.js +1 -1
- package/dist/components/Notification/Notification.js +3 -3
- package/dist/components/Notification/NotificationBadge/__tests__/NotificationBadge.test.js +1 -1
- package/dist/components/Notification/__tests__/Notification.test.js +1 -1
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/Popover/__tests__/Popover.test.js +1 -1
- package/dist/components/Popover/styles.js +1 -1
- package/dist/components/Progress/Progress.js +3 -3
- package/dist/components/Progress/Progress.util.js +3 -3
- package/dist/components/Progress/ProgressText.js +3 -3
- package/dist/components/Progress/__tests__/Progress.test.js +1 -1
- package/dist/components/Progress/styles.js +3 -3
- package/dist/components/Radio/Radio.js +3 -3
- package/dist/components/Radio/RadioGroup.js +1 -1
- package/dist/components/Radio/__tests__/RadioGroup.test.js +1 -1
- package/dist/components/Row/Row.js +1 -1
- package/dist/components/Row/RowActions/RowActions.js +3 -3
- package/dist/components/Row/RowLabelValue/RowLabelValue.js +3 -3
- package/dist/components/Row/RowLabelValue/styles.js +1 -1
- package/dist/components/Row/__tests__/Row.test.js +1 -1
- package/dist/components/SegmentedControls/__tests__/SegmentedControls.test.js +1 -1
- package/dist/components/SegmentedControls/styles.js +27 -27
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Select/__tests__/Select.test.js +1 -1
- package/dist/components/Select/styles.js +1 -1
- package/dist/components/Shapes/__tests__/Shapes.test.js +1 -1
- package/dist/components/Switch/__tests__/Switch.test.js +1 -1
- package/dist/components/Switch/styles.js +15 -15
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Table/__mocks__/table-mocks.js +3 -3
- package/dist/components/Table/__tests__/Table.test.js +1 -1
- package/dist/components/Table/styles.js +1 -1
- package/dist/components/Tabs/__tests__/Tabs.test.js +1 -1
- package/dist/components/Tabs/styles.js +1 -1
- package/dist/components/Tile/__tests__/Tile.test.js +1 -1
- package/dist/components/Toast/Toast.js +3 -3
- package/dist/components/Toast/__tests__/Toast.test.js +2 -2
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +3 -3
- package/dist/components/Tooltip/__tests__/Tooltip.test.js +1 -1
- package/dist/components/Tooltip/styles.js +1 -1
- package/dist/components/Typography/Typography.js +1 -1
- package/dist/components/Typography/__tests__/Typography.test.js +2 -2
- package/dist/components/Typography/index.js +1 -1
- package/dist/components/Typography/styles.js +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +46 -42
- package/dist/{context-Cx7GtZpz.js → context-DIFtNa4d.js} +70 -70
- package/dist/{dropdown-zGGFIyJ_.js → dropdown-Dp_PTQ2u.js} +60 -59
- package/dist/genesis/GenesisThemeBreakdown.js +86 -44
- package/dist/genesis/labs/Lab.stories.d.ts +6 -0
- package/dist/genesis/styles.js +2 -2
- package/dist/{index-CdiHBmVe.js → index-BPVue1Yd.js} +44 -44
- package/dist/{index-CRotrkWm.js → index-BQM5OniU.js} +7 -7
- package/dist/{index-BTGF--50.js → index-B_1Ge8na.js} +20 -19
- package/dist/{index-ByspLxrB.js → index-BbTV2Cw5.js} +32 -31
- package/dist/index-BeGv28kJ.js +5173 -0
- package/dist/{index-Dyl-ddV6.js → index-BpZSuIUV.js} +16 -16
- package/dist/{index-CodMmNWv.js → index-BvOLXELm.js} +3 -3
- package/dist/{index-hoPiccJv.js → index-CLSrpQRW.js} +9 -8
- package/dist/{index-D0P16DlX.js → index-CbVOl2U6.js} +26 -24
- package/dist/{index-DWUXwgXK.js → index-D0U6r5O7.js} +265 -294
- package/dist/{index-BW_7pvTr.js → index-DEu2PVzQ.js} +4 -4
- package/dist/{index-DmZOkMjs.js → index-DNQ-jnBx.js} +1207 -1514
- package/dist/index-DOsPeIWJ.js +1000 -0
- package/dist/{index-CSPlXIlA.js → index-DRGX1Wem.js} +7 -7
- package/dist/index-DWjq9XYj.js +899 -0
- package/dist/index.js +53 -49
- package/dist/motion-CUN72xsH.js +33 -0
- package/dist/providers/GenesisProvider.js +1 -1
- package/dist/providers/ToastProvider.js +3 -3
- package/dist/providers/index.js +1 -1
- package/dist/providers/useGenesis.js +1 -1
- package/dist/{responsiveObserver-O1kw80RG.js → responsiveObserver-dCkpy7Cb.js} +1 -1
- package/dist/roundedArrow-DI_Q-xdU.js +65 -0
- package/dist/{setup-CKu7-AfI.js → setup-CUbCc8fQ.js} +2 -2
- package/dist/styles/design-tokens/border-tokens/BorderTokenList.js +7 -7
- package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.js +3 -3
- package/dist/styles/theme/genesis-theme.js +211 -349
- package/dist/styles/theme/theme-tree/ThemeTree.js +114 -113
- package/dist/{styles-BSD221S5.js → styles-CWdUpZom.js} +12 -12
- package/dist/{styles-BDbHpHsc.js → styles-D1vKDy9V.js} +9 -9
- package/dist/{styles-D9iYILpv.js → styles-qerRs7Rn.js} +493 -492
- package/dist/test/setup.js +2 -2
- package/dist/{toArray-DGvPoJP_.js → toArray-U3Az44CO.js} +1 -1
- package/dist/{useBreakpoint-CAMzKscx.js → useBreakpoint-TkMv121M.js} +2 -2
- package/dist/{useCSSVarCls-C-MlZC6a.js → useCSSVarCls-Dau77fzS.js} +1 -1
- package/dist/useIcons-Ck4JP1m9.js +321 -0
- package/dist/{useLocale-DWRfeMSS.js → useLocale-CTfNpakL.js} +1 -1
- package/dist/{useMergedState-BoELfaU9.js → useMergedState-D6toxSxh.js} +1 -1
- package/dist/{useSize-CPo2bUE3.js → useSize-DSq4r6zy.js} +1 -1
- package/dist/{useVariants-Cin23jEC.js → useVariants-DrLzUVLU.js} +2 -2
- package/dist/{useZIndex-D81lkWy4.js → useZIndex-DhyHuZTN.js} +1 -1
- package/dist/utils/icon-util.js +38 -44
- package/package.json +2 -1
- package/dist/TextArea-CKWbFr0u.js +0 -1698
- package/dist/index-CqqwGTME.js +0 -956
|
@@ -0,0 +1,708 @@
|
|
|
1
|
+
import * as K from "react";
|
|
2
|
+
import f, { useRef as le, cloneElement as un, forwardRef as Pe, useState as De, useImperativeHandle as Le, useEffect as ye, useContext as ln } from "react";
|
|
3
|
+
import { e as C, f as Te, b as re, d as Ce, _ as J, g as Re, a as ie } from "./presets-Djh_L_6R.js";
|
|
4
|
+
import { o as We, g as Fe, C as He, D as Ue, t as on, h as Be, F as Me } from "./index-BbTV2Cw5.js";
|
|
5
|
+
import { u as je } from "./useMergedState-D6toxSxh.js";
|
|
6
|
+
import { R as sn } from "./index-BQM5OniU.js";
|
|
7
|
+
import { R as dn } from "./CloseCircleFilled-B9e7yFwo.js";
|
|
8
|
+
import { u as Ye, a as Ve, g as Ge } from "./useVariants-DrLzUVLU.js";
|
|
9
|
+
import { u as Ze } from "./useCSSVarCls-Dau77fzS.js";
|
|
10
|
+
import { u as Xe } from "./useSize-DSq4r6zy.js";
|
|
11
|
+
import { F as Qe } from "./context-DIFtNa4d.js";
|
|
12
|
+
import { o as fn } from "./omit-B_u6A-HL.js";
|
|
13
|
+
import { C as ke } from "./ContextIsolator-BmfhJgG0.js";
|
|
14
|
+
import { u as cn } from "./Compact-Du9689ax.js";
|
|
15
|
+
import { u as qe } from "./index-DOsPeIWJ.js";
|
|
16
|
+
function mn(e) {
|
|
17
|
+
return !!(e.addonBefore || e.addonAfter);
|
|
18
|
+
}
|
|
19
|
+
function gn(e) {
|
|
20
|
+
return !!(e.prefix || e.suffix || e.allowClear);
|
|
21
|
+
}
|
|
22
|
+
function Ke(e, r, t) {
|
|
23
|
+
var n = r.cloneNode(!0), a = Object.create(e, {
|
|
24
|
+
target: {
|
|
25
|
+
value: n
|
|
26
|
+
},
|
|
27
|
+
currentTarget: {
|
|
28
|
+
value: n
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return n.value = t, typeof r.selectionStart == "number" && typeof r.selectionEnd == "number" && (n.selectionStart = r.selectionStart, n.selectionEnd = r.selectionEnd), n.setSelectionRange = function() {
|
|
32
|
+
r.setSelectionRange.apply(r, arguments);
|
|
33
|
+
}, a;
|
|
34
|
+
}
|
|
35
|
+
function Ee(e, r, t, n) {
|
|
36
|
+
if (t) {
|
|
37
|
+
var a = r;
|
|
38
|
+
if (r.type === "click") {
|
|
39
|
+
a = Ke(r, e, ""), t(a);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (e.type !== "file" && n !== void 0) {
|
|
43
|
+
a = Ke(r, e, n), t(a);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
t(a);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function Je(e, r) {
|
|
50
|
+
if (e) {
|
|
51
|
+
e.focus(r);
|
|
52
|
+
var t = r || {}, n = t.cursor;
|
|
53
|
+
if (n) {
|
|
54
|
+
var a = e.value.length;
|
|
55
|
+
switch (n) {
|
|
56
|
+
case "start":
|
|
57
|
+
e.setSelectionRange(0, 0);
|
|
58
|
+
break;
|
|
59
|
+
case "end":
|
|
60
|
+
e.setSelectionRange(a, a);
|
|
61
|
+
break;
|
|
62
|
+
default:
|
|
63
|
+
e.setSelectionRange(0, a);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
var en = /* @__PURE__ */ f.forwardRef(function(e, r) {
|
|
69
|
+
var t, n, a, p = e.inputElement, o = e.children, i = e.prefixCls, N = e.prefix, x = e.suffix, c = e.addonBefore, w = e.addonAfter, A = e.className, Z = e.style, O = e.disabled, L = e.readOnly, ue = e.focused, ee = e.triggerFocus, E = e.allowClear, u = e.value, X = e.handleReset, y = e.hidden, g = e.classes, l = e.classNames, s = e.dataAttrs, d = e.styles, S = e.components, F = e.onClear, v = o ?? p, D = (S == null ? void 0 : S.affixWrapper) || "span", ne = (S == null ? void 0 : S.groupWrapper) || "span", V = (S == null ? void 0 : S.wrapper) || "span", h = (S == null ? void 0 : S.groupAddon) || "span", B = le(null), Q = function(Y) {
|
|
70
|
+
var G;
|
|
71
|
+
(G = B.current) !== null && G !== void 0 && G.contains(Y.target) && (ee == null || ee());
|
|
72
|
+
}, te = gn(e), R = /* @__PURE__ */ un(v, {
|
|
73
|
+
value: u,
|
|
74
|
+
className: C((t = v.props) === null || t === void 0 ? void 0 : t.className, !te && (l == null ? void 0 : l.variant)) || null
|
|
75
|
+
}), _ = le(null);
|
|
76
|
+
if (f.useImperativeHandle(r, function() {
|
|
77
|
+
return {
|
|
78
|
+
nativeElement: _.current || B.current
|
|
79
|
+
};
|
|
80
|
+
}), te) {
|
|
81
|
+
var W = null;
|
|
82
|
+
if (E) {
|
|
83
|
+
var P = !O && !L && u, T = "".concat(i, "-clear-icon"), I = Te(E) === "object" && E !== null && E !== void 0 && E.clearIcon ? E.clearIcon : "✖";
|
|
84
|
+
W = /* @__PURE__ */ f.createElement("button", {
|
|
85
|
+
type: "button",
|
|
86
|
+
onClick: function(Y) {
|
|
87
|
+
X == null || X(Y), F == null || F();
|
|
88
|
+
},
|
|
89
|
+
onMouseDown: function(Y) {
|
|
90
|
+
return Y.preventDefault();
|
|
91
|
+
},
|
|
92
|
+
className: C(T, re(re({}, "".concat(T, "-hidden"), !P), "".concat(T, "-has-suffix"), !!x))
|
|
93
|
+
}, I);
|
|
94
|
+
}
|
|
95
|
+
var H = "".concat(i, "-affix-wrapper"), oe = C(H, re(re(re(re(re({}, "".concat(i, "-disabled"), O), "".concat(H, "-disabled"), O), "".concat(H, "-focused"), ue), "".concat(H, "-readonly"), L), "".concat(H, "-input-with-clear-btn"), x && E && u), g == null ? void 0 : g.affixWrapper, l == null ? void 0 : l.affixWrapper, l == null ? void 0 : l.variant), $ = (x || E) && /* @__PURE__ */ f.createElement("span", {
|
|
96
|
+
className: C("".concat(i, "-suffix"), l == null ? void 0 : l.suffix),
|
|
97
|
+
style: d == null ? void 0 : d.suffix
|
|
98
|
+
}, W, x);
|
|
99
|
+
R = /* @__PURE__ */ f.createElement(D, Ce({
|
|
100
|
+
className: oe,
|
|
101
|
+
style: d == null ? void 0 : d.affixWrapper,
|
|
102
|
+
onClick: Q
|
|
103
|
+
}, s == null ? void 0 : s.affixWrapper, {
|
|
104
|
+
ref: B
|
|
105
|
+
}), N && /* @__PURE__ */ f.createElement("span", {
|
|
106
|
+
className: C("".concat(i, "-prefix"), l == null ? void 0 : l.prefix),
|
|
107
|
+
style: d == null ? void 0 : d.prefix
|
|
108
|
+
}, N), R, $);
|
|
109
|
+
}
|
|
110
|
+
if (mn(e)) {
|
|
111
|
+
var q = "".concat(i, "-group"), U = "".concat(q, "-addon"), se = "".concat(q, "-wrapper"), de = C("".concat(i, "-wrapper"), q, g == null ? void 0 : g.wrapper, l == null ? void 0 : l.wrapper), fe = C(se, re({}, "".concat(se, "-disabled"), O), g == null ? void 0 : g.group, l == null ? void 0 : l.groupWrapper);
|
|
112
|
+
R = /* @__PURE__ */ f.createElement(ne, {
|
|
113
|
+
className: fe,
|
|
114
|
+
ref: _
|
|
115
|
+
}, /* @__PURE__ */ f.createElement(V, {
|
|
116
|
+
className: de
|
|
117
|
+
}, c && /* @__PURE__ */ f.createElement(h, {
|
|
118
|
+
className: U
|
|
119
|
+
}, c), R, w && /* @__PURE__ */ f.createElement(h, {
|
|
120
|
+
className: U
|
|
121
|
+
}, w)));
|
|
122
|
+
}
|
|
123
|
+
return /* @__PURE__ */ f.cloneElement(R, {
|
|
124
|
+
className: C((n = R.props) === null || n === void 0 ? void 0 : n.className, A) || null,
|
|
125
|
+
style: J(J({}, (a = R.props) === null || a === void 0 ? void 0 : a.style), Z),
|
|
126
|
+
hidden: y
|
|
127
|
+
});
|
|
128
|
+
}), vn = ["show"];
|
|
129
|
+
function nn(e, r) {
|
|
130
|
+
return K.useMemo(function() {
|
|
131
|
+
var t = {};
|
|
132
|
+
r && (t.show = Te(r) === "object" && r.formatter ? r.formatter : !!r), t = J(J({}, t), e);
|
|
133
|
+
var n = t, a = n.show, p = Re(n, vn);
|
|
134
|
+
return J(J({}, p), {}, {
|
|
135
|
+
show: !!a,
|
|
136
|
+
showFormatter: typeof a == "function" ? a : void 0,
|
|
137
|
+
strategy: p.strategy || function(o) {
|
|
138
|
+
return o.length;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}, [e, r]);
|
|
142
|
+
}
|
|
143
|
+
var pn = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnter", "onKeyDown", "onKeyUp", "prefixCls", "disabled", "htmlSize", "className", "maxLength", "suffix", "showCount", "count", "type", "classes", "classNames", "styles", "onCompositionStart", "onCompositionEnd"], xn = /* @__PURE__ */ Pe(function(e, r) {
|
|
144
|
+
var t = e.autoComplete, n = e.onChange, a = e.onFocus, p = e.onBlur, o = e.onPressEnter, i = e.onKeyDown, N = e.onKeyUp, x = e.prefixCls, c = x === void 0 ? "rc-input" : x, w = e.disabled, A = e.htmlSize, Z = e.className, O = e.maxLength, L = e.suffix, ue = e.showCount, ee = e.count, E = e.type, u = E === void 0 ? "text" : E, X = e.classes, y = e.classNames, g = e.styles, l = e.onCompositionStart, s = e.onCompositionEnd, d = Re(e, pn), S = De(!1), F = ie(S, 2), v = F[0], D = F[1], ne = le(!1), V = le(!1), h = le(null), B = le(null), Q = function(m) {
|
|
145
|
+
h.current && Je(h.current, m);
|
|
146
|
+
}, te = je(e.defaultValue, {
|
|
147
|
+
value: e.value
|
|
148
|
+
}), R = ie(te, 2), _ = R[0], W = R[1], P = _ == null ? "" : String(_), T = De(null), I = ie(T, 2), H = I[0], oe = I[1], $ = nn(ee, ue), q = $.max || O, U = $.strategy(P), se = !!q && U > q;
|
|
149
|
+
Le(r, function() {
|
|
150
|
+
var z;
|
|
151
|
+
return {
|
|
152
|
+
focus: Q,
|
|
153
|
+
blur: function() {
|
|
154
|
+
var M;
|
|
155
|
+
(M = h.current) === null || M === void 0 || M.blur();
|
|
156
|
+
},
|
|
157
|
+
setSelectionRange: function(M, pe, me) {
|
|
158
|
+
var ce;
|
|
159
|
+
(ce = h.current) === null || ce === void 0 || ce.setSelectionRange(M, pe, me);
|
|
160
|
+
},
|
|
161
|
+
select: function() {
|
|
162
|
+
var M;
|
|
163
|
+
(M = h.current) === null || M === void 0 || M.select();
|
|
164
|
+
},
|
|
165
|
+
input: h.current,
|
|
166
|
+
nativeElement: ((z = B.current) === null || z === void 0 ? void 0 : z.nativeElement) || h.current
|
|
167
|
+
};
|
|
168
|
+
}), ye(function() {
|
|
169
|
+
V.current && (V.current = !1), D(function(z) {
|
|
170
|
+
return z && w ? !1 : z;
|
|
171
|
+
});
|
|
172
|
+
}, [w]);
|
|
173
|
+
var de = function(m, M, pe) {
|
|
174
|
+
var me = M;
|
|
175
|
+
if (!ne.current && $.exceedFormatter && $.max && $.strategy(M) > $.max) {
|
|
176
|
+
if (me = $.exceedFormatter(M, {
|
|
177
|
+
max: $.max
|
|
178
|
+
}), M !== me) {
|
|
179
|
+
var ce, xe;
|
|
180
|
+
oe([((ce = h.current) === null || ce === void 0 ? void 0 : ce.selectionStart) || 0, ((xe = h.current) === null || xe === void 0 ? void 0 : xe.selectionEnd) || 0]);
|
|
181
|
+
}
|
|
182
|
+
} else if (pe.source === "compositionEnd")
|
|
183
|
+
return;
|
|
184
|
+
W(me), h.current && Ee(h.current, m, n, me);
|
|
185
|
+
};
|
|
186
|
+
ye(function() {
|
|
187
|
+
if (H) {
|
|
188
|
+
var z;
|
|
189
|
+
(z = h.current) === null || z === void 0 || z.setSelectionRange.apply(z, We(H));
|
|
190
|
+
}
|
|
191
|
+
}, [H]);
|
|
192
|
+
var fe = function(m) {
|
|
193
|
+
de(m, m.target.value, {
|
|
194
|
+
source: "change"
|
|
195
|
+
});
|
|
196
|
+
}, j = function(m) {
|
|
197
|
+
ne.current = !1, de(m, m.currentTarget.value, {
|
|
198
|
+
source: "compositionEnd"
|
|
199
|
+
}), s == null || s(m);
|
|
200
|
+
}, Y = function(m) {
|
|
201
|
+
o && m.key === "Enter" && !V.current && (V.current = !0, o(m)), i == null || i(m);
|
|
202
|
+
}, G = function(m) {
|
|
203
|
+
m.key === "Enter" && (V.current = !1), N == null || N(m);
|
|
204
|
+
}, ve = function(m) {
|
|
205
|
+
D(!0), a == null || a(m);
|
|
206
|
+
}, ze = function(m) {
|
|
207
|
+
V.current && (V.current = !1), D(!1), p == null || p(m);
|
|
208
|
+
}, he = function(m) {
|
|
209
|
+
W(""), Q(), h.current && Ee(h.current, m, n);
|
|
210
|
+
}, Ne = se && "".concat(c, "-out-of-range"), Se = function() {
|
|
211
|
+
var m = fn(e, [
|
|
212
|
+
"prefixCls",
|
|
213
|
+
"onPressEnter",
|
|
214
|
+
"addonBefore",
|
|
215
|
+
"addonAfter",
|
|
216
|
+
"prefix",
|
|
217
|
+
"suffix",
|
|
218
|
+
"allowClear",
|
|
219
|
+
// Input elements must be either controlled or uncontrolled,
|
|
220
|
+
// specify either the value prop, or the defaultValue prop, but not both.
|
|
221
|
+
"defaultValue",
|
|
222
|
+
"showCount",
|
|
223
|
+
"count",
|
|
224
|
+
"classes",
|
|
225
|
+
"htmlSize",
|
|
226
|
+
"styles",
|
|
227
|
+
"classNames",
|
|
228
|
+
"onClear"
|
|
229
|
+
]);
|
|
230
|
+
return /* @__PURE__ */ f.createElement("input", Ce({
|
|
231
|
+
autoComplete: t
|
|
232
|
+
}, m, {
|
|
233
|
+
onChange: fe,
|
|
234
|
+
onFocus: ve,
|
|
235
|
+
onBlur: ze,
|
|
236
|
+
onKeyDown: Y,
|
|
237
|
+
onKeyUp: G,
|
|
238
|
+
className: C(c, re({}, "".concat(c, "-disabled"), w), y == null ? void 0 : y.input),
|
|
239
|
+
style: g == null ? void 0 : g.input,
|
|
240
|
+
ref: h,
|
|
241
|
+
size: A,
|
|
242
|
+
type: u,
|
|
243
|
+
onCompositionStart: function(pe) {
|
|
244
|
+
ne.current = !0, l == null || l(pe);
|
|
245
|
+
},
|
|
246
|
+
onCompositionEnd: j
|
|
247
|
+
}));
|
|
248
|
+
}, Ae = function() {
|
|
249
|
+
var m = Number(q) > 0;
|
|
250
|
+
if (L || $.show) {
|
|
251
|
+
var M = $.showFormatter ? $.showFormatter({
|
|
252
|
+
value: P,
|
|
253
|
+
count: U,
|
|
254
|
+
maxLength: q
|
|
255
|
+
}) : "".concat(U).concat(m ? " / ".concat(q) : "");
|
|
256
|
+
return /* @__PURE__ */ f.createElement(f.Fragment, null, $.show && /* @__PURE__ */ f.createElement("span", {
|
|
257
|
+
className: C("".concat(c, "-show-count-suffix"), re({}, "".concat(c, "-show-count-has-suffix"), !!L), y == null ? void 0 : y.count),
|
|
258
|
+
style: J({}, g == null ? void 0 : g.count)
|
|
259
|
+
}, M), L);
|
|
260
|
+
}
|
|
261
|
+
return null;
|
|
262
|
+
};
|
|
263
|
+
return /* @__PURE__ */ f.createElement(en, Ce({}, d, {
|
|
264
|
+
prefixCls: c,
|
|
265
|
+
className: C(Z, Ne),
|
|
266
|
+
handleReset: he,
|
|
267
|
+
value: P,
|
|
268
|
+
focused: v,
|
|
269
|
+
triggerFocus: Q,
|
|
270
|
+
suffix: Ae(),
|
|
271
|
+
disabled: w,
|
|
272
|
+
classes: X,
|
|
273
|
+
classNames: y,
|
|
274
|
+
styles: g
|
|
275
|
+
}), Se());
|
|
276
|
+
});
|
|
277
|
+
const tn = (e) => {
|
|
278
|
+
let r;
|
|
279
|
+
return typeof e == "object" && (e != null && e.clearIcon) ? r = e : e && (r = {
|
|
280
|
+
clearIcon: /* @__PURE__ */ f.createElement(dn, null)
|
|
281
|
+
}), r;
|
|
282
|
+
};
|
|
283
|
+
function hn(e, r) {
|
|
284
|
+
const t = le([]), n = () => {
|
|
285
|
+
t.current.push(setTimeout(() => {
|
|
286
|
+
var a, p, o, i;
|
|
287
|
+
!((a = e.current) === null || a === void 0) && a.input && ((p = e.current) === null || p === void 0 ? void 0 : p.input.getAttribute("type")) === "password" && (!((o = e.current) === null || o === void 0) && o.input.hasAttribute("value")) && ((i = e.current) === null || i === void 0 || i.input.removeAttribute("value"));
|
|
288
|
+
}));
|
|
289
|
+
};
|
|
290
|
+
return ye(() => (r && n(), () => t.current.forEach((a) => {
|
|
291
|
+
a && clearTimeout(a);
|
|
292
|
+
})), []), n;
|
|
293
|
+
}
|
|
294
|
+
function bn(e) {
|
|
295
|
+
return !!(e.prefix || e.suffix || e.allowClear || e.showCount);
|
|
296
|
+
}
|
|
297
|
+
var yn = function(e, r) {
|
|
298
|
+
var t = {};
|
|
299
|
+
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && r.indexOf(n) < 0 && (t[n] = e[n]);
|
|
300
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, n = Object.getOwnPropertySymbols(e); a < n.length; a++)
|
|
301
|
+
r.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[a]) && (t[n[a]] = e[n[a]]);
|
|
302
|
+
return t;
|
|
303
|
+
};
|
|
304
|
+
const Cn = /* @__PURE__ */ Pe((e, r) => {
|
|
305
|
+
var t;
|
|
306
|
+
const {
|
|
307
|
+
prefixCls: n,
|
|
308
|
+
bordered: a = !0,
|
|
309
|
+
status: p,
|
|
310
|
+
size: o,
|
|
311
|
+
disabled: i,
|
|
312
|
+
onBlur: N,
|
|
313
|
+
onFocus: x,
|
|
314
|
+
suffix: c,
|
|
315
|
+
allowClear: w,
|
|
316
|
+
addonAfter: A,
|
|
317
|
+
addonBefore: Z,
|
|
318
|
+
className: O,
|
|
319
|
+
style: L,
|
|
320
|
+
styles: ue,
|
|
321
|
+
rootClassName: ee,
|
|
322
|
+
onChange: E,
|
|
323
|
+
classNames: u,
|
|
324
|
+
variant: X
|
|
325
|
+
} = e, y = yn(e, ["prefixCls", "bordered", "status", "size", "disabled", "onBlur", "onFocus", "suffix", "allowClear", "addonAfter", "addonBefore", "className", "style", "styles", "rootClassName", "onChange", "classNames", "variant"]);
|
|
326
|
+
if (process.env.NODE_ENV !== "production") {
|
|
327
|
+
const {
|
|
328
|
+
deprecated: j
|
|
329
|
+
} = Fe("Input");
|
|
330
|
+
j(!("bordered" in e), "bordered", "variant");
|
|
331
|
+
}
|
|
332
|
+
const {
|
|
333
|
+
getPrefixCls: g,
|
|
334
|
+
direction: l,
|
|
335
|
+
input: s
|
|
336
|
+
} = f.useContext(He), d = g("input", n), S = le(null), F = Ze(d), [v, D, ne] = qe(d, F), {
|
|
337
|
+
compactSize: V,
|
|
338
|
+
compactItemClassnames: h
|
|
339
|
+
} = cn(d, l), B = Xe((j) => {
|
|
340
|
+
var Y;
|
|
341
|
+
return (Y = o ?? V) !== null && Y !== void 0 ? Y : j;
|
|
342
|
+
}), Q = f.useContext(Ue), te = i ?? Q, {
|
|
343
|
+
status: R,
|
|
344
|
+
hasFeedback: _,
|
|
345
|
+
feedbackIcon: W
|
|
346
|
+
} = ln(Qe), P = Ge(R, p), T = bn(e) || !!_, I = le(T);
|
|
347
|
+
if (process.env.NODE_ENV !== "production") {
|
|
348
|
+
const j = Fe("Input");
|
|
349
|
+
ye(() => {
|
|
350
|
+
var Y;
|
|
351
|
+
T && !I.current && process.env.NODE_ENV !== "production" && j(document.activeElement === ((Y = S.current) === null || Y === void 0 ? void 0 : Y.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"), I.current = T;
|
|
352
|
+
}, [T]);
|
|
353
|
+
}
|
|
354
|
+
const H = hn(S, !0), oe = (j) => {
|
|
355
|
+
H(), N == null || N(j);
|
|
356
|
+
}, $ = (j) => {
|
|
357
|
+
H(), x == null || x(j);
|
|
358
|
+
}, q = (j) => {
|
|
359
|
+
H(), E == null || E(j);
|
|
360
|
+
}, U = (_ || c) && /* @__PURE__ */ f.createElement(f.Fragment, null, c, _ && W), se = tn(w ?? (s == null ? void 0 : s.allowClear)), [de, fe] = Ye("input", X, a);
|
|
361
|
+
return v(/* @__PURE__ */ f.createElement(xn, Object.assign({
|
|
362
|
+
ref: on(r, S),
|
|
363
|
+
prefixCls: d,
|
|
364
|
+
autoComplete: s == null ? void 0 : s.autoComplete
|
|
365
|
+
}, y, {
|
|
366
|
+
disabled: te,
|
|
367
|
+
onBlur: oe,
|
|
368
|
+
onFocus: $,
|
|
369
|
+
style: Object.assign(Object.assign({}, s == null ? void 0 : s.style), L),
|
|
370
|
+
styles: Object.assign(Object.assign({}, s == null ? void 0 : s.styles), ue),
|
|
371
|
+
suffix: U,
|
|
372
|
+
allowClear: se,
|
|
373
|
+
className: C(O, ee, ne, F, h, s == null ? void 0 : s.className),
|
|
374
|
+
onChange: q,
|
|
375
|
+
addonBefore: Z && /* @__PURE__ */ f.createElement(ke, {
|
|
376
|
+
form: !0,
|
|
377
|
+
space: !0
|
|
378
|
+
}, Z),
|
|
379
|
+
addonAfter: A && /* @__PURE__ */ f.createElement(ke, {
|
|
380
|
+
form: !0,
|
|
381
|
+
space: !0
|
|
382
|
+
}, A),
|
|
383
|
+
classNames: Object.assign(Object.assign(Object.assign({}, u), s == null ? void 0 : s.classNames), {
|
|
384
|
+
input: C({
|
|
385
|
+
[`${d}-sm`]: B === "small",
|
|
386
|
+
[`${d}-lg`]: B === "large",
|
|
387
|
+
[`${d}-rtl`]: l === "rtl"
|
|
388
|
+
}, u == null ? void 0 : u.input, (t = s == null ? void 0 : s.classNames) === null || t === void 0 ? void 0 : t.input, D),
|
|
389
|
+
variant: C({
|
|
390
|
+
[`${d}-${de}`]: fe
|
|
391
|
+
}, Ve(d, P)),
|
|
392
|
+
affixWrapper: C({
|
|
393
|
+
[`${d}-affix-wrapper-sm`]: B === "small",
|
|
394
|
+
[`${d}-affix-wrapper-lg`]: B === "large",
|
|
395
|
+
[`${d}-affix-wrapper-rtl`]: l === "rtl"
|
|
396
|
+
}, D),
|
|
397
|
+
wrapper: C({
|
|
398
|
+
[`${d}-group-rtl`]: l === "rtl"
|
|
399
|
+
}, D),
|
|
400
|
+
groupWrapper: C({
|
|
401
|
+
[`${d}-group-wrapper-sm`]: B === "small",
|
|
402
|
+
[`${d}-group-wrapper-lg`]: B === "large",
|
|
403
|
+
[`${d}-group-wrapper-rtl`]: l === "rtl",
|
|
404
|
+
[`${d}-group-wrapper-${de}`]: fe
|
|
405
|
+
}, Ve(`${d}-group-wrapper`, P, _), D)
|
|
406
|
+
})
|
|
407
|
+
})));
|
|
408
|
+
});
|
|
409
|
+
process.env.NODE_ENV !== "production" && (Cn.displayName = "Input");
|
|
410
|
+
var Sn = `
|
|
411
|
+
min-height:0 !important;
|
|
412
|
+
max-height:none !important;
|
|
413
|
+
height:0 !important;
|
|
414
|
+
visibility:hidden !important;
|
|
415
|
+
overflow:hidden !important;
|
|
416
|
+
position:absolute !important;
|
|
417
|
+
z-index:-1000 !important;
|
|
418
|
+
top:0 !important;
|
|
419
|
+
right:0 !important;
|
|
420
|
+
pointer-events: none !important;
|
|
421
|
+
`, wn = ["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"], Oe = {}, ae;
|
|
422
|
+
function En(e) {
|
|
423
|
+
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, t = e.getAttribute("id") || e.getAttribute("data-reactid") || e.getAttribute("name");
|
|
424
|
+
if (r && Oe[t])
|
|
425
|
+
return Oe[t];
|
|
426
|
+
var n = window.getComputedStyle(e), a = n.getPropertyValue("box-sizing") || n.getPropertyValue("-moz-box-sizing") || n.getPropertyValue("-webkit-box-sizing"), p = parseFloat(n.getPropertyValue("padding-bottom")) + parseFloat(n.getPropertyValue("padding-top")), o = parseFloat(n.getPropertyValue("border-bottom-width")) + parseFloat(n.getPropertyValue("border-top-width")), i = wn.map(function(x) {
|
|
427
|
+
return "".concat(x, ":").concat(n.getPropertyValue(x));
|
|
428
|
+
}).join(";"), N = {
|
|
429
|
+
sizingStyle: i,
|
|
430
|
+
paddingSize: p,
|
|
431
|
+
borderSize: o,
|
|
432
|
+
boxSizing: a
|
|
433
|
+
};
|
|
434
|
+
return r && t && (Oe[t] = N), N;
|
|
435
|
+
}
|
|
436
|
+
function Rn(e) {
|
|
437
|
+
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
|
|
438
|
+
ae || (ae = document.createElement("textarea"), ae.setAttribute("tab-index", "-1"), ae.setAttribute("aria-hidden", "true"), ae.setAttribute("name", "hiddenTextarea"), document.body.appendChild(ae)), e.getAttribute("wrap") ? ae.setAttribute("wrap", e.getAttribute("wrap")) : ae.removeAttribute("wrap");
|
|
439
|
+
var a = En(e, r), p = a.paddingSize, o = a.borderSize, i = a.boxSizing, N = a.sizingStyle;
|
|
440
|
+
ae.setAttribute("style", "".concat(N, ";").concat(Sn)), ae.value = e.value || e.placeholder || "";
|
|
441
|
+
var x = void 0, c = void 0, w, A = ae.scrollHeight;
|
|
442
|
+
if (i === "border-box" ? A += o : i === "content-box" && (A -= p), t !== null || n !== null) {
|
|
443
|
+
ae.value = " ";
|
|
444
|
+
var Z = ae.scrollHeight - p;
|
|
445
|
+
t !== null && (x = Z * t, i === "border-box" && (x = x + p + o), A = Math.max(x, A)), n !== null && (c = Z * n, i === "border-box" && (c = c + p + o), w = A > c ? "" : "hidden", A = Math.min(c, A));
|
|
446
|
+
}
|
|
447
|
+
var O = {
|
|
448
|
+
height: A,
|
|
449
|
+
overflowY: w,
|
|
450
|
+
resize: "none"
|
|
451
|
+
};
|
|
452
|
+
return x && (O.minHeight = x), c && (O.maxHeight = c), O;
|
|
453
|
+
}
|
|
454
|
+
var zn = ["prefixCls", "defaultValue", "value", "autoSize", "onResize", "className", "style", "disabled", "onChange", "onInternalAutoSize"], Ie = 0, _e = 1, $e = 2, Nn = /* @__PURE__ */ K.forwardRef(function(e, r) {
|
|
455
|
+
var t = e, n = t.prefixCls, a = t.defaultValue, p = t.value, o = t.autoSize, i = t.onResize, N = t.className, x = t.style, c = t.disabled, w = t.onChange, A = t.onInternalAutoSize, Z = Re(t, zn), O = je(a, {
|
|
456
|
+
value: p,
|
|
457
|
+
postState: function(I) {
|
|
458
|
+
return I ?? "";
|
|
459
|
+
}
|
|
460
|
+
}), L = ie(O, 2), ue = L[0], ee = L[1], E = function(I) {
|
|
461
|
+
ee(I.target.value), w == null || w(I);
|
|
462
|
+
}, u = K.useRef();
|
|
463
|
+
K.useImperativeHandle(r, function() {
|
|
464
|
+
return {
|
|
465
|
+
textArea: u.current
|
|
466
|
+
};
|
|
467
|
+
});
|
|
468
|
+
var X = K.useMemo(function() {
|
|
469
|
+
return o && Te(o) === "object" ? [o.minRows, o.maxRows] : [];
|
|
470
|
+
}, [o]), y = ie(X, 2), g = y[0], l = y[1], s = !!o, d = function() {
|
|
471
|
+
try {
|
|
472
|
+
if (document.activeElement === u.current) {
|
|
473
|
+
var I = u.current, H = I.selectionStart, oe = I.selectionEnd, $ = I.scrollTop;
|
|
474
|
+
u.current.setSelectionRange(H, oe), u.current.scrollTop = $;
|
|
475
|
+
}
|
|
476
|
+
} catch {
|
|
477
|
+
}
|
|
478
|
+
}, S = K.useState($e), F = ie(S, 2), v = F[0], D = F[1], ne = K.useState(), V = ie(ne, 2), h = V[0], B = V[1], Q = function() {
|
|
479
|
+
D(Ie), process.env.NODE_ENV === "test" && (A == null || A());
|
|
480
|
+
};
|
|
481
|
+
Be(function() {
|
|
482
|
+
s && Q();
|
|
483
|
+
}, [p, g, l, s]), Be(function() {
|
|
484
|
+
if (v === Ie)
|
|
485
|
+
D(_e);
|
|
486
|
+
else if (v === _e) {
|
|
487
|
+
var T = Rn(u.current, !1, g, l);
|
|
488
|
+
D($e), B(T);
|
|
489
|
+
} else
|
|
490
|
+
d();
|
|
491
|
+
}, [v]);
|
|
492
|
+
var te = K.useRef(), R = function() {
|
|
493
|
+
Me.cancel(te.current);
|
|
494
|
+
}, _ = function(I) {
|
|
495
|
+
v === $e && (i == null || i(I), o && (R(), te.current = Me(function() {
|
|
496
|
+
Q();
|
|
497
|
+
})));
|
|
498
|
+
};
|
|
499
|
+
K.useEffect(function() {
|
|
500
|
+
return R;
|
|
501
|
+
}, []);
|
|
502
|
+
var W = s ? h : null, P = J(J({}, x), W);
|
|
503
|
+
return (v === Ie || v === _e) && (P.overflowY = "hidden", P.overflowX = "hidden"), /* @__PURE__ */ K.createElement(sn, {
|
|
504
|
+
onResize: _,
|
|
505
|
+
disabled: !(o || i)
|
|
506
|
+
}, /* @__PURE__ */ K.createElement("textarea", Ce({}, Z, {
|
|
507
|
+
ref: u,
|
|
508
|
+
style: P,
|
|
509
|
+
className: C(n, N, re({}, "".concat(n, "-disabled"), c)),
|
|
510
|
+
disabled: c,
|
|
511
|
+
value: ue,
|
|
512
|
+
onChange: E
|
|
513
|
+
})));
|
|
514
|
+
}), An = ["defaultValue", "value", "onFocus", "onBlur", "onChange", "allowClear", "maxLength", "onCompositionStart", "onCompositionEnd", "suffix", "prefixCls", "showCount", "count", "className", "style", "disabled", "hidden", "classNames", "styles", "onResize", "onClear", "onPressEnter", "readOnly", "autoSize", "onKeyDown"], On = /* @__PURE__ */ f.forwardRef(function(e, r) {
|
|
515
|
+
var t, n = e.defaultValue, a = e.value, p = e.onFocus, o = e.onBlur, i = e.onChange, N = e.allowClear, x = e.maxLength, c = e.onCompositionStart, w = e.onCompositionEnd, A = e.suffix, Z = e.prefixCls, O = Z === void 0 ? "rc-textarea" : Z, L = e.showCount, ue = e.count, ee = e.className, E = e.style, u = e.disabled, X = e.hidden, y = e.classNames, g = e.styles, l = e.onResize, s = e.onClear, d = e.onPressEnter, S = e.readOnly, F = e.autoSize, v = e.onKeyDown, D = Re(e, An), ne = je(n, {
|
|
516
|
+
value: a,
|
|
517
|
+
defaultValue: n
|
|
518
|
+
}), V = ie(ne, 2), h = V[0], B = V[1], Q = h == null ? "" : String(h), te = f.useState(!1), R = ie(te, 2), _ = R[0], W = R[1], P = f.useRef(!1), T = f.useState(null), I = ie(T, 2), H = I[0], oe = I[1], $ = le(null), q = le(null), U = function() {
|
|
519
|
+
var b;
|
|
520
|
+
return (b = q.current) === null || b === void 0 ? void 0 : b.textArea;
|
|
521
|
+
}, se = function() {
|
|
522
|
+
U().focus();
|
|
523
|
+
};
|
|
524
|
+
Le(r, function() {
|
|
525
|
+
var k;
|
|
526
|
+
return {
|
|
527
|
+
resizableTextArea: q.current,
|
|
528
|
+
focus: se,
|
|
529
|
+
blur: function() {
|
|
530
|
+
U().blur();
|
|
531
|
+
},
|
|
532
|
+
nativeElement: ((k = $.current) === null || k === void 0 ? void 0 : k.nativeElement) || U()
|
|
533
|
+
};
|
|
534
|
+
}), ye(function() {
|
|
535
|
+
W(function(k) {
|
|
536
|
+
return !u && k;
|
|
537
|
+
});
|
|
538
|
+
}, [u]);
|
|
539
|
+
var de = f.useState(null), fe = ie(de, 2), j = fe[0], Y = fe[1];
|
|
540
|
+
f.useEffect(function() {
|
|
541
|
+
if (j) {
|
|
542
|
+
var k;
|
|
543
|
+
(k = U()).setSelectionRange.apply(k, We(j));
|
|
544
|
+
}
|
|
545
|
+
}, [j]);
|
|
546
|
+
var G = nn(ue, L), ve = (t = G.max) !== null && t !== void 0 ? t : x, ze = Number(ve) > 0, he = G.strategy(Q), Ne = !!ve && he > ve, Se = function(b, ge) {
|
|
547
|
+
var we = ge;
|
|
548
|
+
!P.current && G.exceedFormatter && G.max && G.strategy(ge) > G.max && (we = G.exceedFormatter(ge, {
|
|
549
|
+
max: G.max
|
|
550
|
+
}), ge !== we && Y([U().selectionStart || 0, U().selectionEnd || 0])), B(we), Ee(b.currentTarget, b, i, we);
|
|
551
|
+
}, Ae = function(b) {
|
|
552
|
+
P.current = !0, c == null || c(b);
|
|
553
|
+
}, z = function(b) {
|
|
554
|
+
P.current = !1, Se(b, b.currentTarget.value), w == null || w(b);
|
|
555
|
+
}, m = function(b) {
|
|
556
|
+
Se(b, b.target.value);
|
|
557
|
+
}, M = function(b) {
|
|
558
|
+
b.key === "Enter" && d && d(b), v == null || v(b);
|
|
559
|
+
}, pe = function(b) {
|
|
560
|
+
W(!0), p == null || p(b);
|
|
561
|
+
}, me = function(b) {
|
|
562
|
+
W(!1), o == null || o(b);
|
|
563
|
+
}, ce = function(b) {
|
|
564
|
+
B(""), se(), Ee(U(), b, i);
|
|
565
|
+
}, xe = A, be;
|
|
566
|
+
G.show && (G.showFormatter ? be = G.showFormatter({
|
|
567
|
+
value: Q,
|
|
568
|
+
count: he,
|
|
569
|
+
maxLength: ve
|
|
570
|
+
}) : be = "".concat(he).concat(ze ? " / ".concat(ve) : ""), xe = /* @__PURE__ */ f.createElement(f.Fragment, null, xe, /* @__PURE__ */ f.createElement("span", {
|
|
571
|
+
className: C("".concat(O, "-data-count"), y == null ? void 0 : y.count),
|
|
572
|
+
style: g == null ? void 0 : g.count
|
|
573
|
+
}, be)));
|
|
574
|
+
var an = function(b) {
|
|
575
|
+
var ge;
|
|
576
|
+
l == null || l(b), (ge = U()) !== null && ge !== void 0 && ge.style.height && oe(!0);
|
|
577
|
+
}, rn = !F && !L && !N;
|
|
578
|
+
return /* @__PURE__ */ f.createElement(en, {
|
|
579
|
+
ref: $,
|
|
580
|
+
value: Q,
|
|
581
|
+
allowClear: N,
|
|
582
|
+
handleReset: ce,
|
|
583
|
+
suffix: xe,
|
|
584
|
+
prefixCls: O,
|
|
585
|
+
classNames: J(J({}, y), {}, {
|
|
586
|
+
affixWrapper: C(y == null ? void 0 : y.affixWrapper, re(re({}, "".concat(O, "-show-count"), L), "".concat(O, "-textarea-allow-clear"), N))
|
|
587
|
+
}),
|
|
588
|
+
disabled: u,
|
|
589
|
+
focused: _,
|
|
590
|
+
className: C(ee, Ne && "".concat(O, "-out-of-range")),
|
|
591
|
+
style: J(J({}, E), H && !rn ? {
|
|
592
|
+
height: "auto"
|
|
593
|
+
} : {}),
|
|
594
|
+
dataAttrs: {
|
|
595
|
+
affixWrapper: {
|
|
596
|
+
"data-count": typeof be == "string" ? be : void 0
|
|
597
|
+
}
|
|
598
|
+
},
|
|
599
|
+
hidden: X,
|
|
600
|
+
readOnly: S,
|
|
601
|
+
onClear: s
|
|
602
|
+
}, /* @__PURE__ */ f.createElement(Nn, Ce({}, D, {
|
|
603
|
+
autoSize: F,
|
|
604
|
+
maxLength: x,
|
|
605
|
+
onKeyDown: M,
|
|
606
|
+
onChange: m,
|
|
607
|
+
onFocus: pe,
|
|
608
|
+
onBlur: me,
|
|
609
|
+
onCompositionStart: Ae,
|
|
610
|
+
onCompositionEnd: z,
|
|
611
|
+
className: C(y == null ? void 0 : y.textarea),
|
|
612
|
+
style: J(J({}, g == null ? void 0 : g.textarea), {}, {
|
|
613
|
+
resize: E == null ? void 0 : E.resize
|
|
614
|
+
}),
|
|
615
|
+
disabled: u,
|
|
616
|
+
prefixCls: O,
|
|
617
|
+
onResize: an,
|
|
618
|
+
ref: q,
|
|
619
|
+
readOnly: S
|
|
620
|
+
})));
|
|
621
|
+
}), In = function(e, r) {
|
|
622
|
+
var t = {};
|
|
623
|
+
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && r.indexOf(n) < 0 && (t[n] = e[n]);
|
|
624
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, n = Object.getOwnPropertySymbols(e); a < n.length; a++)
|
|
625
|
+
r.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[a]) && (t[n[a]] = e[n[a]]);
|
|
626
|
+
return t;
|
|
627
|
+
};
|
|
628
|
+
const Hn = /* @__PURE__ */ Pe((e, r) => {
|
|
629
|
+
var t, n;
|
|
630
|
+
const {
|
|
631
|
+
prefixCls: a,
|
|
632
|
+
bordered: p = !0,
|
|
633
|
+
size: o,
|
|
634
|
+
disabled: i,
|
|
635
|
+
status: N,
|
|
636
|
+
allowClear: x,
|
|
637
|
+
classNames: c,
|
|
638
|
+
rootClassName: w,
|
|
639
|
+
className: A,
|
|
640
|
+
style: Z,
|
|
641
|
+
styles: O,
|
|
642
|
+
variant: L
|
|
643
|
+
} = e, ue = In(e, ["prefixCls", "bordered", "size", "disabled", "status", "allowClear", "classNames", "rootClassName", "className", "style", "styles", "variant"]);
|
|
644
|
+
if (process.env.NODE_ENV !== "production") {
|
|
645
|
+
const {
|
|
646
|
+
deprecated: R
|
|
647
|
+
} = Fe("TextArea");
|
|
648
|
+
R(!("bordered" in e), "bordered", "variant");
|
|
649
|
+
}
|
|
650
|
+
const {
|
|
651
|
+
getPrefixCls: ee,
|
|
652
|
+
direction: E,
|
|
653
|
+
textArea: u
|
|
654
|
+
} = K.useContext(He), X = Xe(o), y = K.useContext(Ue), g = i ?? y, {
|
|
655
|
+
status: l,
|
|
656
|
+
hasFeedback: s,
|
|
657
|
+
feedbackIcon: d
|
|
658
|
+
} = K.useContext(Qe), S = Ge(l, N), F = K.useRef(null);
|
|
659
|
+
K.useImperativeHandle(r, () => {
|
|
660
|
+
var R;
|
|
661
|
+
return {
|
|
662
|
+
resizableTextArea: (R = F.current) === null || R === void 0 ? void 0 : R.resizableTextArea,
|
|
663
|
+
focus: (_) => {
|
|
664
|
+
var W, P;
|
|
665
|
+
Je((P = (W = F.current) === null || W === void 0 ? void 0 : W.resizableTextArea) === null || P === void 0 ? void 0 : P.textArea, _);
|
|
666
|
+
},
|
|
667
|
+
blur: () => {
|
|
668
|
+
var _;
|
|
669
|
+
return (_ = F.current) === null || _ === void 0 ? void 0 : _.blur();
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
});
|
|
673
|
+
const v = ee("input", a), D = Ze(v), [ne, V, h] = qe(v, D), [B, Q] = Ye("textArea", L, p), te = tn(x ?? (u == null ? void 0 : u.allowClear));
|
|
674
|
+
return ne(/* @__PURE__ */ K.createElement(On, Object.assign({
|
|
675
|
+
autoComplete: u == null ? void 0 : u.autoComplete
|
|
676
|
+
}, ue, {
|
|
677
|
+
style: Object.assign(Object.assign({}, u == null ? void 0 : u.style), Z),
|
|
678
|
+
styles: Object.assign(Object.assign({}, u == null ? void 0 : u.styles), O),
|
|
679
|
+
disabled: g,
|
|
680
|
+
allowClear: te,
|
|
681
|
+
className: C(h, D, A, w, u == null ? void 0 : u.className),
|
|
682
|
+
classNames: Object.assign(Object.assign(Object.assign({}, c), u == null ? void 0 : u.classNames), {
|
|
683
|
+
textarea: C({
|
|
684
|
+
[`${v}-sm`]: X === "small",
|
|
685
|
+
[`${v}-lg`]: X === "large"
|
|
686
|
+
}, V, c == null ? void 0 : c.textarea, (t = u == null ? void 0 : u.classNames) === null || t === void 0 ? void 0 : t.textarea),
|
|
687
|
+
variant: C({
|
|
688
|
+
[`${v}-${B}`]: Q
|
|
689
|
+
}, Ve(v, S)),
|
|
690
|
+
affixWrapper: C(`${v}-textarea-affix-wrapper`, {
|
|
691
|
+
[`${v}-affix-wrapper-rtl`]: E === "rtl",
|
|
692
|
+
[`${v}-affix-wrapper-sm`]: X === "small",
|
|
693
|
+
[`${v}-affix-wrapper-lg`]: X === "large",
|
|
694
|
+
[`${v}-textarea-show-count`]: e.showCount || ((n = e.count) === null || n === void 0 ? void 0 : n.show)
|
|
695
|
+
}, V)
|
|
696
|
+
}),
|
|
697
|
+
prefixCls: v,
|
|
698
|
+
suffix: s && /* @__PURE__ */ K.createElement("span", {
|
|
699
|
+
className: `${v}-textarea-suffix`
|
|
700
|
+
}, d),
|
|
701
|
+
ref: F
|
|
702
|
+
})));
|
|
703
|
+
});
|
|
704
|
+
export {
|
|
705
|
+
Cn as I,
|
|
706
|
+
Hn as T,
|
|
707
|
+
hn as u
|
|
708
|
+
};
|