@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.
Files changed (157) hide show
  1. package/README.md +6 -0
  2. package/dist/ClockCircleOutlined-BaXQuLIn.js +13 -0
  3. package/dist/{Compact-DBh6nSYB.js → Compact-Du9689ax.js} +8 -8
  4. package/dist/{ContextIsolator-CwuJooYf.js → ContextIsolator-BmfhJgG0.js} +2 -2
  5. package/dist/{DownOutlined-5-15jS0h.js → DownOutlined-Dcq69ZKM.js} +9 -9
  6. package/dist/{EllipsisOutlined-CJ2pgE2d.js → EllipsisOutlined-DGMph0Bj.js} +110 -110
  7. package/dist/{Keyframes-sPZXYuXt.js → Keyframes-C9_aCDvn.js} +1 -1
  8. package/dist/{Overflow-DdNKJLQh.js → Overflow-DWf4XIal.js} +31 -31
  9. package/dist/{Skeleton-B3vg9CbL.js → Skeleton-BVN4pcVe.js} +2 -2
  10. package/dist/TextArea-Bkf9hh7l.js +708 -0
  11. package/dist/{Typography-DqI7RslA.js → Typography-CoZ5qD-t.js} +3 -3
  12. package/dist/{button-B2Rgggx2.js → button-BwqpCxVM.js} +5 -5
  13. package/dist/components/Avatar/Avatar.js +3 -3
  14. package/dist/components/Avatar/__tests__/Avatar.test.js +1 -1
  15. package/dist/components/Avatar/styles.js +42 -42
  16. package/dist/components/Badge/Badge.js +3 -3
  17. package/dist/components/Badge/__tests__/Badge.test.js +1 -1
  18. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  19. package/dist/components/Breadcrumb/__tests__/Breadcrumb.test.js +1 -1
  20. package/dist/components/Breadcrumb/styles.js +4 -4
  21. package/dist/components/Button/__tests__/Button.test.js +1 -1
  22. package/dist/components/Button/styles.js +1 -1
  23. package/dist/components/Card/__tests__/Card.test.js +1 -1
  24. package/dist/components/Card/styles.js +1 -1
  25. package/dist/components/Checkbox/Checkbox.js +3 -3
  26. package/dist/components/Checkbox/__tests__/Checkbox.test.js +1 -1
  27. package/dist/components/Checkbox/styles.js +1 -1
  28. package/dist/components/Dashboard/__stories__/DashboardLayoutContent.js +8 -8
  29. package/dist/components/Dashboard/__stories__/DashboardLayoutHeader.js +4 -4
  30. package/dist/components/Dashboard/__tests__/Dashboard.test.js +1 -1
  31. package/dist/components/DatePicker/DatePicker.d.ts +6 -0
  32. package/dist/components/DatePicker/DatePicker.js +5 -0
  33. package/dist/components/DatePicker/__stories__/DatePicker.stories.d.ts +10 -0
  34. package/dist/components/DatePicker/__tests__/DatePicker.test.d.ts +1 -0
  35. package/dist/components/DatePicker/__tests__/DatePicker.test.js +19 -0
  36. package/dist/components/DatePicker/index.d.ts +2 -0
  37. package/dist/components/DatePicker/index.js +4 -0
  38. package/dist/components/DateRangePicker/DateRangePicker.d.ts +5 -0
  39. package/dist/components/DateRangePicker/DateRangePicker.js +5 -0
  40. package/dist/components/DateRangePicker/__stories__/DateRangePicker.stories.d.ts +9 -0
  41. package/dist/components/DateRangePicker/__tests__/DateRangePicker.test.d.ts +1 -0
  42. package/dist/components/DateRangePicker/__tests__/DateRangePicker.test.js +23 -0
  43. package/dist/components/DateRangePicker/index.d.ts +2 -0
  44. package/dist/components/DateRangePicker/index.js +4 -0
  45. package/dist/components/ErrorBoundary/ErrorBoundary.js +3 -3
  46. package/dist/components/ErrorBoundary/__tests__/ErrorBoundary.test.js +1 -1
  47. package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.js +3 -3
  48. package/dist/components/ErrorBoundaryFallback/styles.js +1 -1
  49. package/dist/components/Form/Form.js +2 -2
  50. package/dist/components/Form/__stories__/FormStory.js +4 -4
  51. package/dist/components/Form/__tests__/form.test.js +2 -2
  52. package/dist/components/Form/index.js +1 -1
  53. package/dist/components/Form/styles.js +1 -1
  54. package/dist/components/Input/Input.js +1 -1
  55. package/dist/components/Input/__tests__/Input.test.js +1 -1
  56. package/dist/components/Input/styles.js +1 -1
  57. package/dist/components/Layout/Content/ResponsiveContent.js +3 -3
  58. package/dist/components/Layout/MainLayout/MainLayout.js +1 -1
  59. package/dist/components/Layout/__tests__/Layout.test.js +1 -1
  60. package/dist/components/Message/Message.js +3 -3
  61. package/dist/components/Message/__tests__/Message.test.js +1 -1
  62. package/dist/components/Notification/Notification.js +3 -3
  63. package/dist/components/Notification/NotificationBadge/__tests__/NotificationBadge.test.js +1 -1
  64. package/dist/components/Notification/__tests__/Notification.test.js +1 -1
  65. package/dist/components/Popover/Popover.js +1 -1
  66. package/dist/components/Popover/__tests__/Popover.test.js +1 -1
  67. package/dist/components/Popover/styles.js +1 -1
  68. package/dist/components/Progress/Progress.js +3 -3
  69. package/dist/components/Progress/Progress.util.js +3 -3
  70. package/dist/components/Progress/ProgressText.js +3 -3
  71. package/dist/components/Progress/__tests__/Progress.test.js +1 -1
  72. package/dist/components/Progress/styles.js +3 -3
  73. package/dist/components/Radio/Radio.js +3 -3
  74. package/dist/components/Radio/RadioGroup.js +1 -1
  75. package/dist/components/Radio/__tests__/RadioGroup.test.js +1 -1
  76. package/dist/components/Row/Row.js +1 -1
  77. package/dist/components/Row/RowActions/RowActions.js +3 -3
  78. package/dist/components/Row/RowLabelValue/RowLabelValue.js +3 -3
  79. package/dist/components/Row/RowLabelValue/styles.js +1 -1
  80. package/dist/components/Row/__tests__/Row.test.js +1 -1
  81. package/dist/components/SegmentedControls/__tests__/SegmentedControls.test.js +1 -1
  82. package/dist/components/SegmentedControls/styles.js +27 -27
  83. package/dist/components/Select/Select.js +1 -1
  84. package/dist/components/Select/__tests__/Select.test.js +1 -1
  85. package/dist/components/Select/styles.js +1 -1
  86. package/dist/components/Shapes/__tests__/Shapes.test.js +1 -1
  87. package/dist/components/Switch/__tests__/Switch.test.js +1 -1
  88. package/dist/components/Switch/styles.js +15 -15
  89. package/dist/components/Table/Table.js +1 -1
  90. package/dist/components/Table/__mocks__/table-mocks.js +3 -3
  91. package/dist/components/Table/__tests__/Table.test.js +1 -1
  92. package/dist/components/Table/styles.js +1 -1
  93. package/dist/components/Tabs/__tests__/Tabs.test.js +1 -1
  94. package/dist/components/Tabs/styles.js +1 -1
  95. package/dist/components/Tile/__tests__/Tile.test.js +1 -1
  96. package/dist/components/Toast/Toast.js +3 -3
  97. package/dist/components/Toast/__tests__/Toast.test.js +2 -2
  98. package/dist/components/Toast/index.js +1 -1
  99. package/dist/components/Tooltip/Tooltip.js +3 -3
  100. package/dist/components/Tooltip/__tests__/Tooltip.test.js +1 -1
  101. package/dist/components/Tooltip/styles.js +1 -1
  102. package/dist/components/Typography/Typography.js +1 -1
  103. package/dist/components/Typography/__tests__/Typography.test.js +2 -2
  104. package/dist/components/Typography/index.js +1 -1
  105. package/dist/components/Typography/styles.js +1 -1
  106. package/dist/components/index.d.ts +4 -0
  107. package/dist/components/index.js +46 -42
  108. package/dist/{context-Cx7GtZpz.js → context-DIFtNa4d.js} +70 -70
  109. package/dist/{dropdown-zGGFIyJ_.js → dropdown-Dp_PTQ2u.js} +60 -59
  110. package/dist/genesis/GenesisThemeBreakdown.js +86 -44
  111. package/dist/genesis/labs/Lab.stories.d.ts +6 -0
  112. package/dist/genesis/styles.js +2 -2
  113. package/dist/{index-CdiHBmVe.js → index-BPVue1Yd.js} +44 -44
  114. package/dist/{index-CRotrkWm.js → index-BQM5OniU.js} +7 -7
  115. package/dist/{index-BTGF--50.js → index-B_1Ge8na.js} +20 -19
  116. package/dist/{index-ByspLxrB.js → index-BbTV2Cw5.js} +32 -31
  117. package/dist/index-BeGv28kJ.js +5173 -0
  118. package/dist/{index-Dyl-ddV6.js → index-BpZSuIUV.js} +16 -16
  119. package/dist/{index-CodMmNWv.js → index-BvOLXELm.js} +3 -3
  120. package/dist/{index-hoPiccJv.js → index-CLSrpQRW.js} +9 -8
  121. package/dist/{index-D0P16DlX.js → index-CbVOl2U6.js} +26 -24
  122. package/dist/{index-DWUXwgXK.js → index-D0U6r5O7.js} +265 -294
  123. package/dist/{index-BW_7pvTr.js → index-DEu2PVzQ.js} +4 -4
  124. package/dist/{index-DmZOkMjs.js → index-DNQ-jnBx.js} +1207 -1514
  125. package/dist/index-DOsPeIWJ.js +1000 -0
  126. package/dist/{index-CSPlXIlA.js → index-DRGX1Wem.js} +7 -7
  127. package/dist/index-DWjq9XYj.js +899 -0
  128. package/dist/index.js +53 -49
  129. package/dist/motion-CUN72xsH.js +33 -0
  130. package/dist/providers/GenesisProvider.js +1 -1
  131. package/dist/providers/ToastProvider.js +3 -3
  132. package/dist/providers/index.js +1 -1
  133. package/dist/providers/useGenesis.js +1 -1
  134. package/dist/{responsiveObserver-O1kw80RG.js → responsiveObserver-dCkpy7Cb.js} +1 -1
  135. package/dist/roundedArrow-DI_Q-xdU.js +65 -0
  136. package/dist/{setup-CKu7-AfI.js → setup-CUbCc8fQ.js} +2 -2
  137. package/dist/styles/design-tokens/border-tokens/BorderTokenList.js +7 -7
  138. package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.js +3 -3
  139. package/dist/styles/theme/genesis-theme.js +211 -349
  140. package/dist/styles/theme/theme-tree/ThemeTree.js +114 -113
  141. package/dist/{styles-BSD221S5.js → styles-CWdUpZom.js} +12 -12
  142. package/dist/{styles-BDbHpHsc.js → styles-D1vKDy9V.js} +9 -9
  143. package/dist/{styles-D9iYILpv.js → styles-qerRs7Rn.js} +493 -492
  144. package/dist/test/setup.js +2 -2
  145. package/dist/{toArray-DGvPoJP_.js → toArray-U3Az44CO.js} +1 -1
  146. package/dist/{useBreakpoint-CAMzKscx.js → useBreakpoint-TkMv121M.js} +2 -2
  147. package/dist/{useCSSVarCls-C-MlZC6a.js → useCSSVarCls-Dau77fzS.js} +1 -1
  148. package/dist/useIcons-Ck4JP1m9.js +321 -0
  149. package/dist/{useLocale-DWRfeMSS.js → useLocale-CTfNpakL.js} +1 -1
  150. package/dist/{useMergedState-BoELfaU9.js → useMergedState-D6toxSxh.js} +1 -1
  151. package/dist/{useSize-CPo2bUE3.js → useSize-DSq4r6zy.js} +1 -1
  152. package/dist/{useVariants-Cin23jEC.js → useVariants-DrLzUVLU.js} +2 -2
  153. package/dist/{useZIndex-D81lkWy4.js → useZIndex-DhyHuZTN.js} +1 -1
  154. package/dist/utils/icon-util.js +38 -44
  155. package/package.json +2 -1
  156. package/dist/TextArea-CKWbFr0u.js +0 -1698
  157. package/dist/index-CqqwGTME.js +0 -956
@@ -1,1698 +0,0 @@
1
- import * as K from "react";
2
- import f, { useRef as le, cloneElement as xn, forwardRef as We, useState as Me, useImperativeHandle as Ze, useEffect as $e, useContext as Sn } from "react";
3
- import { e as w, f as _e, b as ie, d as Ce, _ as ne, g as Re, a as de } from "./presets-Djh_L_6R.js";
4
- import { m as He, j as T, g as $n, r as Qe, s as Cn, h as Je, e as Te, C as ke, D as en, p as yn, f as Le, B as Ve } from "./index-ByspLxrB.js";
5
- import { u as Pe } from "./useMergedState-BoELfaU9.js";
6
- import { R as wn } from "./index-CRotrkWm.js";
7
- import { R as En } from "./CloseCircleFilled-B9e7yFwo.js";
8
- import { u as nn, a as Fe, g as rn } from "./useVariants-Cin23jEC.js";
9
- import { u as tn } from "./useCSSVarCls-C-MlZC6a.js";
10
- import { u as an } from "./useSize-CPo2bUE3.js";
11
- import { F as on } from "./context-Cx7GtZpz.js";
12
- import { o as Rn } from "./omit-B_u6A-HL.js";
13
- import { C as Ge } from "./ContextIsolator-CwuJooYf.js";
14
- import { u as In } from "./Compact-DBh6nSYB.js";
15
- import { g as zn } from "./compact-item-DH13cl8A.js";
16
- import "./index-DLdU7Tpd.js";
17
- function On(e) {
18
- return He(e, {
19
- inputAffixPadding: e.paddingXXS
20
- });
21
- }
22
- const Bn = (e) => {
23
- const {
24
- controlHeight: n,
25
- fontSize: r,
26
- lineHeight: t,
27
- lineWidth: a,
28
- controlHeightSM: s,
29
- controlHeightLG: i,
30
- fontSizeLG: l,
31
- lineHeightLG: S,
32
- paddingSM: g,
33
- controlPaddingHorizontalSM: p,
34
- controlPaddingHorizontal: C,
35
- colorFillAlter: E,
36
- colorPrimaryHover: G,
37
- colorPrimary: R,
38
- controlOutlineWidth: A,
39
- controlOutline: re,
40
- colorErrorOutline: ee,
41
- colorWarningOutline: y,
42
- colorBgContainer: o
43
- } = e;
44
- return {
45
- paddingBlock: Math.max(Math.round((n - r * t) / 2 * 10) / 10 - a, 0),
46
- paddingBlockSM: Math.max(Math.round((s - r * t) / 2 * 10) / 10 - a, 0),
47
- paddingBlockLG: Math.ceil((i - l * S) / 2 * 10) / 10 - a,
48
- paddingInline: g - a,
49
- paddingInlineSM: p - a,
50
- paddingInlineLG: C - a,
51
- addonBg: E,
52
- activeBorderColor: R,
53
- hoverBorderColor: G,
54
- activeShadow: `0 0 0 ${A}px ${re}`,
55
- errorActiveShadow: `0 0 0 ${A}px ${ee}`,
56
- warningActiveShadow: `0 0 0 ${A}px ${y}`,
57
- hoverBg: o,
58
- activeBg: o,
59
- inputFontSize: r,
60
- inputFontSizeLG: l,
61
- inputFontSizeSM: r
62
- };
63
- }, An = (e) => ({
64
- borderColor: e.hoverBorderColor,
65
- backgroundColor: e.hoverBg
66
- }), De = (e) => ({
67
- color: e.colorTextDisabled,
68
- backgroundColor: e.colorBgContainerDisabled,
69
- borderColor: e.colorBorder,
70
- boxShadow: "none",
71
- cursor: "not-allowed",
72
- opacity: 1,
73
- "input[disabled], textarea[disabled]": {
74
- cursor: "not-allowed"
75
- },
76
- "&:hover:not([disabled])": Object.assign({}, An(He(e, {
77
- hoverBorderColor: e.colorBorder,
78
- hoverBg: e.colorBgContainerDisabled
79
- })))
80
- }), ln = (e, n) => ({
81
- background: e.colorBgContainer,
82
- borderWidth: e.lineWidth,
83
- borderStyle: e.lineType,
84
- borderColor: n.borderColor,
85
- "&:hover": {
86
- borderColor: n.hoverBorderColor,
87
- backgroundColor: e.hoverBg
88
- },
89
- "&:focus, &:focus-within": {
90
- borderColor: n.activeBorderColor,
91
- boxShadow: n.activeShadow,
92
- outline: 0,
93
- backgroundColor: e.activeBg
94
- }
95
- }), Ke = (e, n) => ({
96
- [`&${e.componentCls}-status-${n.status}:not(${e.componentCls}-disabled)`]: Object.assign(Object.assign({}, ln(e, n)), {
97
- [`${e.componentCls}-prefix, ${e.componentCls}-suffix`]: {
98
- color: n.affixColor
99
- }
100
- }),
101
- [`&${e.componentCls}-status-${n.status}${e.componentCls}-disabled`]: {
102
- borderColor: n.borderColor
103
- }
104
- }), Nn = (e, n) => ({
105
- "&-outlined": Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, ln(e, {
106
- borderColor: e.colorBorder,
107
- hoverBorderColor: e.hoverBorderColor,
108
- activeBorderColor: e.activeBorderColor,
109
- activeShadow: e.activeShadow
110
- })), {
111
- [`&${e.componentCls}-disabled, &[disabled]`]: Object.assign({}, De(e))
112
- }), Ke(e, {
113
- status: "error",
114
- borderColor: e.colorError,
115
- hoverBorderColor: e.colorErrorBorderHover,
116
- activeBorderColor: e.colorError,
117
- activeShadow: e.errorActiveShadow,
118
- affixColor: e.colorError
119
- })), Ke(e, {
120
- status: "warning",
121
- borderColor: e.colorWarning,
122
- hoverBorderColor: e.colorWarningBorderHover,
123
- activeBorderColor: e.colorWarning,
124
- activeShadow: e.warningActiveShadow,
125
- affixColor: e.colorWarning
126
- })), n)
127
- }), Xe = (e, n) => ({
128
- [`&${e.componentCls}-group-wrapper-status-${n.status}`]: {
129
- [`${e.componentCls}-group-addon`]: {
130
- borderColor: n.addonBorderColor,
131
- color: n.addonColor
132
- }
133
- }
134
- }), jn = (e) => ({
135
- "&-outlined": Object.assign(Object.assign(Object.assign({
136
- [`${e.componentCls}-group`]: {
137
- "&-addon": {
138
- background: e.addonBg,
139
- border: `${T(e.lineWidth)} ${e.lineType} ${e.colorBorder}`
140
- },
141
- "&-addon:first-child": {
142
- borderInlineEnd: 0
143
- },
144
- "&-addon:last-child": {
145
- borderInlineStart: 0
146
- }
147
- }
148
- }, Xe(e, {
149
- status: "error",
150
- addonBorderColor: e.colorError,
151
- addonColor: e.colorErrorText
152
- })), Xe(e, {
153
- status: "warning",
154
- addonBorderColor: e.colorWarning,
155
- addonColor: e.colorWarningText
156
- })), {
157
- [`&${e.componentCls}-group-wrapper-disabled`]: {
158
- [`${e.componentCls}-group-addon`]: Object.assign({}, De(e))
159
- }
160
- })
161
- }), Tn = (e, n) => {
162
- const {
163
- componentCls: r
164
- } = e;
165
- return {
166
- "&-borderless": Object.assign({
167
- background: "transparent",
168
- border: "none",
169
- "&:focus, &:focus-within": {
170
- outline: "none"
171
- },
172
- // >>>>> Disabled
173
- [`&${r}-disabled, &[disabled]`]: {
174
- color: e.colorTextDisabled,
175
- cursor: "not-allowed"
176
- },
177
- // >>>>> Status
178
- [`&${r}-status-error`]: {
179
- "&, & input, & textarea": {
180
- color: e.colorError
181
- }
182
- },
183
- [`&${r}-status-warning`]: {
184
- "&, & input, & textarea": {
185
- color: e.colorWarning
186
- }
187
- }
188
- }, n)
189
- };
190
- }, dn = (e, n) => ({
191
- background: n.bg,
192
- borderWidth: e.lineWidth,
193
- borderStyle: e.lineType,
194
- borderColor: "transparent",
195
- "input&, & input, textarea&, & textarea": {
196
- color: n == null ? void 0 : n.inputColor
197
- },
198
- "&:hover": {
199
- background: n.hoverBg
200
- },
201
- "&:focus, &:focus-within": {
202
- outline: 0,
203
- borderColor: n.activeBorderColor,
204
- backgroundColor: e.activeBg
205
- }
206
- }), qe = (e, n) => ({
207
- [`&${e.componentCls}-status-${n.status}:not(${e.componentCls}-disabled)`]: Object.assign(Object.assign({}, dn(e, n)), {
208
- [`${e.componentCls}-prefix, ${e.componentCls}-suffix`]: {
209
- color: n.affixColor
210
- }
211
- })
212
- }), Fn = (e, n) => ({
213
- "&-filled": Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, dn(e, {
214
- bg: e.colorFillTertiary,
215
- hoverBg: e.colorFillSecondary,
216
- activeBorderColor: e.activeBorderColor
217
- })), {
218
- [`&${e.componentCls}-disabled, &[disabled]`]: Object.assign({}, De(e))
219
- }), qe(e, {
220
- status: "error",
221
- bg: e.colorErrorBg,
222
- hoverBg: e.colorErrorBgHover,
223
- activeBorderColor: e.colorError,
224
- inputColor: e.colorErrorText,
225
- affixColor: e.colorError
226
- })), qe(e, {
227
- status: "warning",
228
- bg: e.colorWarningBg,
229
- hoverBg: e.colorWarningBgHover,
230
- activeBorderColor: e.colorWarning,
231
- inputColor: e.colorWarningText,
232
- affixColor: e.colorWarning
233
- })), n)
234
- }), Ue = (e, n) => ({
235
- [`&${e.componentCls}-group-wrapper-status-${n.status}`]: {
236
- [`${e.componentCls}-group-addon`]: {
237
- background: n.addonBg,
238
- color: n.addonColor
239
- }
240
- }
241
- }), Wn = (e) => ({
242
- "&-filled": Object.assign(Object.assign(Object.assign({
243
- [`${e.componentCls}-group`]: {
244
- "&-addon": {
245
- background: e.colorFillTertiary
246
- },
247
- [`${e.componentCls}-filled:not(:focus):not(:focus-within)`]: {
248
- "&:not(:first-child)": {
249
- borderInlineStart: `${T(e.lineWidth)} ${e.lineType} ${e.colorSplit}`
250
- },
251
- "&:not(:last-child)": {
252
- borderInlineEnd: `${T(e.lineWidth)} ${e.lineType} ${e.colorSplit}`
253
- }
254
- }
255
- }
256
- }, Ue(e, {
257
- status: "error",
258
- addonBg: e.colorErrorBg,
259
- addonColor: e.colorErrorText
260
- })), Ue(e, {
261
- status: "warning",
262
- addonBg: e.colorWarningBg,
263
- addonColor: e.colorWarningText
264
- })), {
265
- [`&${e.componentCls}-group-wrapper-disabled`]: {
266
- [`${e.componentCls}-group`]: {
267
- "&-addon": {
268
- background: e.colorFillTertiary,
269
- color: e.colorTextDisabled
270
- },
271
- "&-addon:first-child": {
272
- borderInlineStart: `${T(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,
273
- borderTop: `${T(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,
274
- borderBottom: `${T(e.lineWidth)} ${e.lineType} ${e.colorBorder}`
275
- },
276
- "&-addon:last-child": {
277
- borderInlineEnd: `${T(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,
278
- borderTop: `${T(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,
279
- borderBottom: `${T(e.lineWidth)} ${e.lineType} ${e.colorBorder}`
280
- }
281
- }
282
- }
283
- })
284
- }), _n = (e) => ({
285
- // Firefox
286
- "&::-moz-placeholder": {
287
- opacity: 1
288
- },
289
- "&::placeholder": {
290
- color: e,
291
- userSelect: "none"
292
- // https://github.com/ant-design/ant-design/pull/32639
293
- },
294
- "&:placeholder-shown": {
295
- textOverflow: "ellipsis"
296
- }
297
- }), sn = (e) => {
298
- const {
299
- paddingBlockLG: n,
300
- lineHeightLG: r,
301
- borderRadiusLG: t,
302
- paddingInlineLG: a
303
- } = e;
304
- return {
305
- padding: `${T(n)} ${T(a)}`,
306
- fontSize: e.inputFontSizeLG,
307
- lineHeight: r,
308
- borderRadius: t
309
- };
310
- }, un = (e) => ({
311
- padding: `${T(e.paddingBlockSM)} ${T(e.paddingInlineSM)}`,
312
- fontSize: e.inputFontSizeSM,
313
- borderRadius: e.borderRadiusSM
314
- }), cn = (e) => Object.assign(Object.assign({
315
- position: "relative",
316
- display: "inline-block",
317
- width: "100%",
318
- minWidth: 0,
319
- padding: `${T(e.paddingBlock)} ${T(e.paddingInline)}`,
320
- color: e.colorText,
321
- fontSize: e.inputFontSize,
322
- lineHeight: e.lineHeight,
323
- borderRadius: e.borderRadius,
324
- transition: `all ${e.motionDurationMid}`
325
- }, _n(e.colorTextPlaceholder)), {
326
- // Reset height for `textarea`s
327
- "textarea&": {
328
- maxWidth: "100%",
329
- // prevent textarea resize from coming out of its container
330
- height: "auto",
331
- minHeight: e.controlHeight,
332
- lineHeight: e.lineHeight,
333
- verticalAlign: "bottom",
334
- transition: `all ${e.motionDurationSlow}, height 0s`,
335
- resize: "vertical"
336
- },
337
- // Size
338
- "&-lg": Object.assign({}, sn(e)),
339
- "&-sm": Object.assign({}, un(e)),
340
- // RTL
341
- "&-rtl, &-textarea-rtl": {
342
- direction: "rtl"
343
- }
344
- }), Hn = (e) => {
345
- const {
346
- componentCls: n,
347
- antCls: r
348
- } = e;
349
- return {
350
- position: "relative",
351
- display: "table",
352
- width: "100%",
353
- borderCollapse: "separate",
354
- borderSpacing: 0,
355
- // Undo padding and float of grid classes
356
- "&[class*='col-']": {
357
- paddingInlineEnd: e.paddingXS,
358
- "&:last-child": {
359
- paddingInlineEnd: 0
360
- }
361
- },
362
- // Sizing options
363
- [`&-lg ${n}, &-lg > ${n}-group-addon`]: Object.assign({}, sn(e)),
364
- [`&-sm ${n}, &-sm > ${n}-group-addon`]: Object.assign({}, un(e)),
365
- // Fix https://github.com/ant-design/ant-design/issues/5754
366
- [`&-lg ${r}-select-single ${r}-select-selector`]: {
367
- height: e.controlHeightLG
368
- },
369
- [`&-sm ${r}-select-single ${r}-select-selector`]: {
370
- height: e.controlHeightSM
371
- },
372
- [`> ${n}`]: {
373
- display: "table-cell",
374
- "&:not(:first-child):not(:last-child)": {
375
- borderRadius: 0
376
- }
377
- },
378
- [`${n}-group`]: {
379
- "&-addon, &-wrap": {
380
- display: "table-cell",
381
- width: 1,
382
- whiteSpace: "nowrap",
383
- verticalAlign: "middle",
384
- "&:not(:first-child):not(:last-child)": {
385
- borderRadius: 0
386
- }
387
- },
388
- "&-wrap > *": {
389
- display: "block !important"
390
- },
391
- "&-addon": {
392
- position: "relative",
393
- padding: `0 ${T(e.paddingInline)}`,
394
- color: e.colorText,
395
- fontWeight: "normal",
396
- fontSize: e.inputFontSize,
397
- textAlign: "center",
398
- borderRadius: e.borderRadius,
399
- transition: `all ${e.motionDurationSlow}`,
400
- lineHeight: 1,
401
- // Reset Select's style in addon
402
- [`${r}-select`]: {
403
- margin: `${T(e.calc(e.paddingBlock).add(1).mul(-1).equal())} ${T(e.calc(e.paddingInline).mul(-1).equal())}`,
404
- [`&${r}-select-single:not(${r}-select-customize-input):not(${r}-pagination-size-changer)`]: {
405
- [`${r}-select-selector`]: {
406
- backgroundColor: "inherit",
407
- border: `${T(e.lineWidth)} ${e.lineType} transparent`,
408
- boxShadow: "none"
409
- }
410
- }
411
- },
412
- // https://github.com/ant-design/ant-design/issues/31333
413
- [`${r}-cascader-picker`]: {
414
- margin: `-9px ${T(e.calc(e.paddingInline).mul(-1).equal())}`,
415
- backgroundColor: "transparent",
416
- [`${r}-cascader-input`]: {
417
- textAlign: "start",
418
- border: 0,
419
- boxShadow: "none"
420
- }
421
- }
422
- }
423
- },
424
- [n]: {
425
- width: "100%",
426
- marginBottom: 0,
427
- textAlign: "inherit",
428
- "&:focus": {
429
- zIndex: 1,
430
- // Fix https://gw.alipayobjects.com/zos/rmsportal/DHNpoqfMXSfrSnlZvhsJ.png
431
- borderInlineEndWidth: 1
432
- },
433
- "&:hover": {
434
- zIndex: 1,
435
- borderInlineEndWidth: 1,
436
- [`${n}-search-with-button &`]: {
437
- zIndex: 0
438
- }
439
- }
440
- },
441
- // Reset rounded corners
442
- [`> ${n}:first-child, ${n}-group-addon:first-child`]: {
443
- borderStartEndRadius: 0,
444
- borderEndEndRadius: 0,
445
- // Reset Select's style in addon
446
- [`${r}-select ${r}-select-selector`]: {
447
- borderStartEndRadius: 0,
448
- borderEndEndRadius: 0
449
- }
450
- },
451
- [`> ${n}-affix-wrapper`]: {
452
- [`&:not(:first-child) ${n}`]: {
453
- borderStartStartRadius: 0,
454
- borderEndStartRadius: 0
455
- },
456
- [`&:not(:last-child) ${n}`]: {
457
- borderStartEndRadius: 0,
458
- borderEndEndRadius: 0
459
- }
460
- },
461
- [`> ${n}:last-child, ${n}-group-addon:last-child`]: {
462
- borderStartStartRadius: 0,
463
- borderEndStartRadius: 0,
464
- // Reset Select's style in addon
465
- [`${r}-select ${r}-select-selector`]: {
466
- borderStartStartRadius: 0,
467
- borderEndStartRadius: 0
468
- }
469
- },
470
- [`${n}-affix-wrapper`]: {
471
- "&:not(:last-child)": {
472
- borderStartEndRadius: 0,
473
- borderEndEndRadius: 0,
474
- [`${n}-search &`]: {
475
- borderStartStartRadius: e.borderRadius,
476
- borderEndStartRadius: e.borderRadius
477
- }
478
- },
479
- [`&:not(:first-child), ${n}-search &:not(:first-child)`]: {
480
- borderStartStartRadius: 0,
481
- borderEndStartRadius: 0
482
- }
483
- },
484
- [`&${n}-group-compact`]: Object.assign(Object.assign({
485
- display: "block"
486
- }, Cn()), {
487
- [`${n}-group-addon, ${n}-group-wrap, > ${n}`]: {
488
- "&:not(:first-child):not(:last-child)": {
489
- borderInlineEndWidth: e.lineWidth,
490
- "&:hover, &:focus": {
491
- zIndex: 1
492
- }
493
- }
494
- },
495
- "& > *": {
496
- display: "inline-flex",
497
- float: "none",
498
- verticalAlign: "top",
499
- // https://github.com/ant-design/ant-design-pro/issues/139
500
- borderRadius: 0
501
- },
502
- [`
503
- & > ${n}-affix-wrapper,
504
- & > ${n}-number-affix-wrapper,
505
- & > ${r}-picker-range
506
- `]: {
507
- display: "inline-flex"
508
- },
509
- "& > *:not(:last-child)": {
510
- marginInlineEnd: e.calc(e.lineWidth).mul(-1).equal(),
511
- borderInlineEndWidth: e.lineWidth
512
- },
513
- // Undo float for .ant-input-group .ant-input
514
- [n]: {
515
- float: "none"
516
- },
517
- // reset border for Select, DatePicker, AutoComplete, Cascader, Mention, TimePicker, Input
518
- [`& > ${r}-select > ${r}-select-selector,
519
- & > ${r}-select-auto-complete ${n},
520
- & > ${r}-cascader-picker ${n},
521
- & > ${n}-group-wrapper ${n}`]: {
522
- borderInlineEndWidth: e.lineWidth,
523
- borderRadius: 0,
524
- "&:hover, &:focus": {
525
- zIndex: 1
526
- }
527
- },
528
- [`& > ${r}-select-focused`]: {
529
- zIndex: 1
530
- },
531
- // update z-index for arrow icon
532
- [`& > ${r}-select > ${r}-select-arrow`]: {
533
- zIndex: 1
534
- // https://github.com/ant-design/ant-design/issues/20371
535
- },
536
- [`& > *:first-child,
537
- & > ${r}-select:first-child > ${r}-select-selector,
538
- & > ${r}-select-auto-complete:first-child ${n},
539
- & > ${r}-cascader-picker:first-child ${n}`]: {
540
- borderStartStartRadius: e.borderRadius,
541
- borderEndStartRadius: e.borderRadius
542
- },
543
- [`& > *:last-child,
544
- & > ${r}-select:last-child > ${r}-select-selector,
545
- & > ${r}-cascader-picker:last-child ${n},
546
- & > ${r}-cascader-picker-focused:last-child ${n}`]: {
547
- borderInlineEndWidth: e.lineWidth,
548
- borderStartEndRadius: e.borderRadius,
549
- borderEndEndRadius: e.borderRadius
550
- },
551
- // https://github.com/ant-design/ant-design/issues/12493
552
- [`& > ${r}-select-auto-complete ${n}`]: {
553
- verticalAlign: "top"
554
- },
555
- [`${n}-group-wrapper + ${n}-group-wrapper`]: {
556
- marginInlineStart: e.calc(e.lineWidth).mul(-1).equal(),
557
- [`${n}-affix-wrapper`]: {
558
- borderRadius: 0
559
- }
560
- },
561
- [`${n}-group-wrapper:not(:last-child)`]: {
562
- [`&${n}-search > ${n}-group`]: {
563
- [`& > ${n}-group-addon > ${n}-search-button`]: {
564
- borderRadius: 0
565
- },
566
- [`& > ${n}`]: {
567
- borderStartStartRadius: e.borderRadius,
568
- borderStartEndRadius: 0,
569
- borderEndEndRadius: 0,
570
- borderEndStartRadius: e.borderRadius
571
- }
572
- }
573
- }
574
- })
575
- };
576
- }, Pn = (e) => {
577
- const {
578
- componentCls: n,
579
- controlHeightSM: r,
580
- lineWidth: t,
581
- calc: a
582
- } = e, i = a(r).sub(a(t).mul(2)).sub(16).div(2).equal();
583
- return {
584
- [n]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, Qe(e)), cn(e)), Nn(e)), Fn(e)), Tn(e)), {
585
- '&[type="color"]': {
586
- height: e.controlHeight,
587
- [`&${n}-lg`]: {
588
- height: e.controlHeightLG
589
- },
590
- [`&${n}-sm`]: {
591
- height: r,
592
- paddingTop: i,
593
- paddingBottom: i
594
- }
595
- },
596
- '&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration': {
597
- "-webkit-appearance": "none"
598
- }
599
- })
600
- };
601
- }, Dn = (e) => {
602
- const {
603
- componentCls: n
604
- } = e;
605
- return {
606
- // ========================= Input =========================
607
- [`${n}-clear-icon`]: {
608
- margin: 0,
609
- padding: 0,
610
- lineHeight: 0,
611
- color: e.colorTextQuaternary,
612
- fontSize: e.fontSizeIcon,
613
- verticalAlign: -1,
614
- // https://github.com/ant-design/ant-design/pull/18151
615
- // https://codesandbox.io/s/wizardly-sun-u10br
616
- cursor: "pointer",
617
- transition: `color ${e.motionDurationSlow}`,
618
- border: "none",
619
- outline: "none",
620
- backgroundColor: "transparent",
621
- "&:hover": {
622
- color: e.colorTextTertiary
623
- },
624
- "&:active": {
625
- color: e.colorText
626
- },
627
- "&-hidden": {
628
- visibility: "hidden"
629
- },
630
- "&-has-suffix": {
631
- margin: `0 ${T(e.inputAffixPadding)}`
632
- }
633
- }
634
- };
635
- }, Mn = (e) => {
636
- const {
637
- componentCls: n,
638
- inputAffixPadding: r,
639
- colorTextDescription: t,
640
- motionDurationSlow: a,
641
- colorIcon: s,
642
- colorIconHover: i,
643
- iconCls: l
644
- } = e, S = `${n}-affix-wrapper`, g = `${n}-affix-wrapper-disabled`;
645
- return {
646
- [S]: Object.assign(Object.assign(Object.assign(Object.assign({}, cn(e)), {
647
- display: "inline-flex",
648
- [`&:not(${n}-disabled):hover`]: {
649
- zIndex: 1,
650
- [`${n}-search-with-button &`]: {
651
- zIndex: 0
652
- }
653
- },
654
- "&-focused, &:focus": {
655
- zIndex: 1
656
- },
657
- [`> input${n}`]: {
658
- padding: 0
659
- },
660
- [`> input${n}, > textarea${n}`]: {
661
- fontSize: "inherit",
662
- border: "none",
663
- borderRadius: 0,
664
- outline: "none",
665
- background: "transparent",
666
- color: "inherit",
667
- "&::-ms-reveal": {
668
- display: "none"
669
- },
670
- "&:focus": {
671
- boxShadow: "none !important"
672
- }
673
- },
674
- "&::before": {
675
- display: "inline-block",
676
- width: 0,
677
- visibility: "hidden",
678
- content: '"\\a0"'
679
- },
680
- [n]: {
681
- "&-prefix, &-suffix": {
682
- display: "flex",
683
- flex: "none",
684
- alignItems: "center",
685
- "> *:not(:last-child)": {
686
- marginInlineEnd: e.paddingXS
687
- }
688
- },
689
- "&-show-count-suffix": {
690
- color: t
691
- },
692
- "&-show-count-has-suffix": {
693
- marginInlineEnd: e.paddingXXS
694
- },
695
- "&-prefix": {
696
- marginInlineEnd: r
697
- },
698
- "&-suffix": {
699
- marginInlineStart: r
700
- }
701
- }
702
- }), Dn(e)), {
703
- // password
704
- [`${l}${n}-password-icon`]: {
705
- color: s,
706
- cursor: "pointer",
707
- transition: `all ${a}`,
708
- "&:hover": {
709
- color: i
710
- }
711
- }
712
- }),
713
- [g]: {
714
- // password disabled
715
- [`${l}${n}-password-icon`]: {
716
- color: s,
717
- cursor: "not-allowed",
718
- "&:hover": {
719
- color: s
720
- }
721
- }
722
- }
723
- };
724
- }, Ln = (e) => {
725
- const {
726
- componentCls: n,
727
- borderRadiusLG: r,
728
- borderRadiusSM: t
729
- } = e;
730
- return {
731
- [`${n}-group`]: Object.assign(Object.assign(Object.assign({}, Qe(e)), Hn(e)), {
732
- "&-rtl": {
733
- direction: "rtl"
734
- },
735
- "&-wrapper": Object.assign(Object.assign(Object.assign({
736
- display: "inline-block",
737
- width: "100%",
738
- textAlign: "start",
739
- verticalAlign: "top",
740
- "&-rtl": {
741
- direction: "rtl"
742
- },
743
- // Size
744
- "&-lg": {
745
- [`${n}-group-addon`]: {
746
- borderRadius: r,
747
- fontSize: e.inputFontSizeLG
748
- }
749
- },
750
- "&-sm": {
751
- [`${n}-group-addon`]: {
752
- borderRadius: t
753
- }
754
- }
755
- }, jn(e)), Wn(e)), {
756
- // '&-disabled': {
757
- // [`${componentCls}-group-addon`]: {
758
- // ...genDisabledStyle(token),
759
- // },
760
- // },
761
- // Fix the issue of using icons in Space Compact mode
762
- // https://github.com/ant-design/ant-design/issues/42122
763
- [`&:not(${n}-compact-first-item):not(${n}-compact-last-item)${n}-compact-item`]: {
764
- [`${n}, ${n}-group-addon`]: {
765
- borderRadius: 0
766
- }
767
- },
768
- [`&:not(${n}-compact-last-item)${n}-compact-first-item`]: {
769
- [`${n}, ${n}-group-addon`]: {
770
- borderStartEndRadius: 0,
771
- borderEndEndRadius: 0
772
- }
773
- },
774
- [`&:not(${n}-compact-first-item)${n}-compact-last-item`]: {
775
- [`${n}, ${n}-group-addon`]: {
776
- borderStartStartRadius: 0,
777
- borderEndStartRadius: 0
778
- }
779
- },
780
- // Fix the issue of input use show-count param in space compact mode
781
- // https://github.com/ant-design/ant-design/issues/46872
782
- [`&:not(${n}-compact-last-item)${n}-compact-item`]: {
783
- [`${n}-affix-wrapper`]: {
784
- borderStartEndRadius: 0,
785
- borderEndEndRadius: 0
786
- }
787
- },
788
- // Fix the issue of input use `addonAfter` param in space compact mode
789
- // https://github.com/ant-design/ant-design/issues/52483
790
- [`&:not(${n}-compact-first-item)${n}-compact-item`]: {
791
- [`${n}-affix-wrapper`]: {
792
- borderStartStartRadius: 0,
793
- borderEndStartRadius: 0
794
- }
795
- }
796
- })
797
- })
798
- };
799
- }, Vn = (e) => {
800
- const {
801
- componentCls: n,
802
- antCls: r
803
- } = e, t = `${n}-search`;
804
- return {
805
- [t]: {
806
- [n]: {
807
- "&:hover, &:focus": {
808
- [`+ ${n}-group-addon ${t}-button:not(${r}-btn-primary)`]: {
809
- borderInlineStartColor: e.colorPrimaryHover
810
- }
811
- }
812
- },
813
- [`${n}-affix-wrapper`]: {
814
- height: e.controlHeight,
815
- borderRadius: 0
816
- },
817
- // fix slight height diff in Firefox:
818
- // https://ant.design/components/auto-complete-cn/#auto-complete-demo-certain-category
819
- [`${n}-lg`]: {
820
- lineHeight: e.calc(e.lineHeightLG).sub(2e-4).equal()
821
- },
822
- [`> ${n}-group`]: {
823
- [`> ${n}-group-addon:last-child`]: {
824
- insetInlineStart: -1,
825
- padding: 0,
826
- border: 0,
827
- [`${t}-button`]: {
828
- // Fix https://github.com/ant-design/ant-design/issues/47150
829
- marginInlineEnd: -1,
830
- borderStartStartRadius: 0,
831
- borderEndStartRadius: 0,
832
- boxShadow: "none"
833
- },
834
- [`${t}-button:not(${r}-btn-primary)`]: {
835
- color: e.colorTextDescription,
836
- "&:hover": {
837
- color: e.colorPrimaryHover
838
- },
839
- "&:active": {
840
- color: e.colorPrimaryActive
841
- },
842
- [`&${r}-btn-loading::before`]: {
843
- insetInlineStart: 0,
844
- insetInlineEnd: 0,
845
- insetBlockStart: 0,
846
- insetBlockEnd: 0
847
- }
848
- }
849
- }
850
- },
851
- [`${t}-button`]: {
852
- height: e.controlHeight,
853
- "&:hover, &:focus": {
854
- zIndex: 1
855
- }
856
- },
857
- "&-large": {
858
- [`${n}-affix-wrapper, ${t}-button`]: {
859
- height: e.controlHeightLG
860
- }
861
- },
862
- "&-small": {
863
- [`${n}-affix-wrapper, ${t}-button`]: {
864
- height: e.controlHeightSM
865
- }
866
- },
867
- "&-rtl": {
868
- direction: "rtl"
869
- },
870
- // ===================== Compact Item Customized Styles =====================
871
- [`&${n}-compact-item`]: {
872
- [`&:not(${n}-compact-last-item)`]: {
873
- [`${n}-group-addon`]: {
874
- [`${n}-search-button`]: {
875
- marginInlineEnd: e.calc(e.lineWidth).mul(-1).equal(),
876
- borderRadius: 0
877
- }
878
- }
879
- },
880
- [`&:not(${n}-compact-first-item)`]: {
881
- [`${n},${n}-affix-wrapper`]: {
882
- borderRadius: 0
883
- }
884
- },
885
- [`> ${n}-group-addon ${n}-search-button,
886
- > ${n},
887
- ${n}-affix-wrapper`]: {
888
- "&:hover, &:focus, &:active": {
889
- zIndex: 2
890
- }
891
- },
892
- [`> ${n}-affix-wrapper-focused`]: {
893
- zIndex: 2
894
- }
895
- }
896
- }
897
- };
898
- }, Gn = (e) => {
899
- const {
900
- componentCls: n,
901
- paddingLG: r
902
- } = e, t = `${n}-textarea`;
903
- return {
904
- [t]: {
905
- position: "relative",
906
- "&-show-count": {
907
- // https://github.com/ant-design/ant-design/issues/33049
908
- [`> ${n}`]: {
909
- height: "100%"
910
- },
911
- [`${n}-data-count`]: {
912
- position: "absolute",
913
- bottom: e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),
914
- insetInlineEnd: 0,
915
- color: e.colorTextDescription,
916
- whiteSpace: "nowrap",
917
- pointerEvents: "none"
918
- }
919
- },
920
- [`
921
- &-allow-clear > ${n},
922
- &-affix-wrapper${t}-has-feedback ${n}
923
- `]: {
924
- paddingInlineEnd: r
925
- },
926
- [`&-affix-wrapper${n}-affix-wrapper`]: {
927
- padding: 0,
928
- [`> textarea${n}`]: {
929
- fontSize: "inherit",
930
- border: "none",
931
- outline: "none",
932
- background: "transparent",
933
- "&:focus": {
934
- boxShadow: "none !important"
935
- }
936
- },
937
- [`${n}-suffix`]: {
938
- margin: 0,
939
- "> *:not(:last-child)": {
940
- marginInline: 0
941
- },
942
- // Clear Icon
943
- [`${n}-clear-icon`]: {
944
- position: "absolute",
945
- insetInlineEnd: e.paddingInline,
946
- insetBlockStart: e.paddingXS
947
- },
948
- // Feedback Icon
949
- [`${t}-suffix`]: {
950
- position: "absolute",
951
- top: 0,
952
- insetInlineEnd: e.paddingInline,
953
- bottom: 0,
954
- zIndex: 1,
955
- display: "inline-flex",
956
- alignItems: "center",
957
- margin: "auto",
958
- pointerEvents: "none"
959
- }
960
- }
961
- },
962
- [`&-affix-wrapper${n}-affix-wrapper-sm`]: {
963
- [`${n}-suffix`]: {
964
- [`${n}-clear-icon`]: {
965
- insetInlineEnd: e.paddingInlineSM
966
- }
967
- }
968
- }
969
- }
970
- };
971
- }, Kn = (e) => {
972
- const {
973
- componentCls: n
974
- } = e;
975
- return {
976
- [`${n}-out-of-range`]: {
977
- [`&, & input, & textarea, ${n}-show-count-suffix, ${n}-data-count`]: {
978
- color: e.colorError
979
- }
980
- }
981
- };
982
- }, fn = $n("Input", (e) => {
983
- const n = He(e, On(e));
984
- return [
985
- Pn(n),
986
- Gn(n),
987
- Mn(n),
988
- Ln(n),
989
- Vn(n),
990
- Kn(n),
991
- // =====================================================
992
- // == Space Compact ==
993
- // =====================================================
994
- zn(n)
995
- ];
996
- }, Bn, {
997
- resetFont: !1
998
- });
999
- function Xn(e) {
1000
- return !!(e.addonBefore || e.addonAfter);
1001
- }
1002
- function qn(e) {
1003
- return !!(e.prefix || e.suffix || e.allowClear);
1004
- }
1005
- function Ye(e, n, r) {
1006
- var t = n.cloneNode(!0), a = Object.create(e, {
1007
- target: {
1008
- value: t
1009
- },
1010
- currentTarget: {
1011
- value: t
1012
- }
1013
- });
1014
- return t.value = r, typeof n.selectionStart == "number" && typeof n.selectionEnd == "number" && (t.selectionStart = n.selectionStart, t.selectionEnd = n.selectionEnd), t.setSelectionRange = function() {
1015
- n.setSelectionRange.apply(n, arguments);
1016
- }, a;
1017
- }
1018
- function Ee(e, n, r, t) {
1019
- if (r) {
1020
- var a = n;
1021
- if (n.type === "click") {
1022
- a = Ye(n, e, ""), r(a);
1023
- return;
1024
- }
1025
- if (e.type !== "file" && t !== void 0) {
1026
- a = Ye(n, e, t), r(a);
1027
- return;
1028
- }
1029
- r(a);
1030
- }
1031
- }
1032
- function gn(e, n) {
1033
- if (e) {
1034
- e.focus(n);
1035
- var r = n || {}, t = r.cursor;
1036
- if (t) {
1037
- var a = e.value.length;
1038
- switch (t) {
1039
- case "start":
1040
- e.setSelectionRange(0, 0);
1041
- break;
1042
- case "end":
1043
- e.setSelectionRange(a, a);
1044
- break;
1045
- default:
1046
- e.setSelectionRange(0, a);
1047
- }
1048
- }
1049
- }
1050
- }
1051
- var pn = /* @__PURE__ */ f.forwardRef(function(e, n) {
1052
- var r, t, a, s = e.inputElement, i = e.children, l = e.prefixCls, S = e.prefix, g = e.suffix, p = e.addonBefore, C = e.addonAfter, E = e.className, G = e.style, R = e.disabled, A = e.readOnly, re = e.focused, ee = e.triggerFocus, y = e.allowClear, o = e.value, Q = e.handleReset, $ = e.hidden, b = e.classes, d = e.classNames, u = e.dataAttrs, c = e.styles, I = e.components, F = e.onClear, h = i ?? s, D = (I == null ? void 0 : I.affixWrapper) || "span", te = (I == null ? void 0 : I.groupWrapper) || "span", W = (I == null ? void 0 : I.wrapper) || "span", v = (I == null ? void 0 : I.groupAddon) || "span", M = le(null), J = function(Y) {
1053
- var Z;
1054
- (Z = M.current) !== null && Z !== void 0 && Z.contains(Y.target) && (ee == null || ee());
1055
- }, ae = qn(e), z = /* @__PURE__ */ xn(h, {
1056
- value: o,
1057
- className: w((r = h.props) === null || r === void 0 ? void 0 : r.className, !ae && (d == null ? void 0 : d.variant)) || null
1058
- }), N = le(null);
1059
- if (f.useImperativeHandle(n, function() {
1060
- return {
1061
- nativeElement: N.current || M.current
1062
- };
1063
- }), ae) {
1064
- var X = null;
1065
- if (y) {
1066
- var _ = !R && !A && o, H = "".concat(l, "-clear-icon"), B = _e(y) === "object" && y !== null && y !== void 0 && y.clearIcon ? y.clearIcon : "✖";
1067
- X = /* @__PURE__ */ f.createElement("button", {
1068
- type: "button",
1069
- onClick: function(Y) {
1070
- Q == null || Q(Y), F == null || F();
1071
- },
1072
- onMouseDown: function(Y) {
1073
- return Y.preventDefault();
1074
- },
1075
- className: w(H, ie(ie({}, "".concat(H, "-hidden"), !_), "".concat(H, "-has-suffix"), !!g))
1076
- }, B);
1077
- }
1078
- var q = "".concat(l, "-affix-wrapper"), se = w(q, ie(ie(ie(ie(ie({}, "".concat(l, "-disabled"), R), "".concat(q, "-disabled"), R), "".concat(q, "-focused"), re), "".concat(q, "-readonly"), A), "".concat(q, "-input-with-clear-btn"), g && y && o), b == null ? void 0 : b.affixWrapper, d == null ? void 0 : d.affixWrapper, d == null ? void 0 : d.variant), j = (g || y) && /* @__PURE__ */ f.createElement("span", {
1079
- className: w("".concat(l, "-suffix"), d == null ? void 0 : d.suffix),
1080
- style: c == null ? void 0 : c.suffix
1081
- }, X, g);
1082
- z = /* @__PURE__ */ f.createElement(D, Ce({
1083
- className: se,
1084
- style: c == null ? void 0 : c.affixWrapper,
1085
- onClick: J
1086
- }, u == null ? void 0 : u.affixWrapper, {
1087
- ref: M
1088
- }), S && /* @__PURE__ */ f.createElement("span", {
1089
- className: w("".concat(l, "-prefix"), d == null ? void 0 : d.prefix),
1090
- style: c == null ? void 0 : c.prefix
1091
- }, S), z, j);
1092
- }
1093
- if (Xn(e)) {
1094
- var k = "".concat(l, "-group"), U = "".concat(k, "-addon"), ue = "".concat(k, "-wrapper"), ce = w("".concat(l, "-wrapper"), k, b == null ? void 0 : b.wrapper, d == null ? void 0 : d.wrapper), fe = w(ue, ie({}, "".concat(ue, "-disabled"), R), b == null ? void 0 : b.group, d == null ? void 0 : d.groupWrapper);
1095
- z = /* @__PURE__ */ f.createElement(te, {
1096
- className: fe,
1097
- ref: N
1098
- }, /* @__PURE__ */ f.createElement(W, {
1099
- className: ce
1100
- }, p && /* @__PURE__ */ f.createElement(v, {
1101
- className: U
1102
- }, p), z, C && /* @__PURE__ */ f.createElement(v, {
1103
- className: U
1104
- }, C)));
1105
- }
1106
- return /* @__PURE__ */ f.cloneElement(z, {
1107
- className: w((t = z.props) === null || t === void 0 ? void 0 : t.className, E) || null,
1108
- style: ne(ne({}, (a = z.props) === null || a === void 0 ? void 0 : a.style), G),
1109
- hidden: $
1110
- });
1111
- }), Un = ["show"];
1112
- function mn(e, n) {
1113
- return K.useMemo(function() {
1114
- var r = {};
1115
- n && (r.show = _e(n) === "object" && n.formatter ? n.formatter : !!n), r = ne(ne({}, r), e);
1116
- var t = r, a = t.show, s = Re(t, Un);
1117
- return ne(ne({}, s), {}, {
1118
- show: !!a,
1119
- showFormatter: typeof a == "function" ? a : void 0,
1120
- strategy: s.strategy || function(i) {
1121
- return i.length;
1122
- }
1123
- });
1124
- }, [e, n]);
1125
- }
1126
- var Yn = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnter", "onKeyDown", "onKeyUp", "prefixCls", "disabled", "htmlSize", "className", "maxLength", "suffix", "showCount", "count", "type", "classes", "classNames", "styles", "onCompositionStart", "onCompositionEnd"], Zn = /* @__PURE__ */ We(function(e, n) {
1127
- var r = e.autoComplete, t = e.onChange, a = e.onFocus, s = e.onBlur, i = e.onPressEnter, l = e.onKeyDown, S = e.onKeyUp, g = e.prefixCls, p = g === void 0 ? "rc-input" : g, C = e.disabled, E = e.htmlSize, G = e.className, R = e.maxLength, A = e.suffix, re = e.showCount, ee = e.count, y = e.type, o = y === void 0 ? "text" : y, Q = e.classes, $ = e.classNames, b = e.styles, d = e.onCompositionStart, u = e.onCompositionEnd, c = Re(e, Yn), I = Me(!1), F = de(I, 2), h = F[0], D = F[1], te = le(!1), W = le(!1), v = le(null), M = le(null), J = function(m) {
1128
- v.current && gn(v.current, m);
1129
- }, ae = Pe(e.defaultValue, {
1130
- value: e.value
1131
- }), z = de(ae, 2), N = z[0], X = z[1], _ = N == null ? "" : String(N), H = Me(null), B = de(H, 2), q = B[0], se = B[1], j = mn(ee, re), k = j.max || R, U = j.strategy(_), ue = !!k && U > k;
1132
- Ze(n, function() {
1133
- var O;
1134
- return {
1135
- focus: J,
1136
- blur: function() {
1137
- var L;
1138
- (L = v.current) === null || L === void 0 || L.blur();
1139
- },
1140
- setSelectionRange: function(L, he, pe) {
1141
- var ge;
1142
- (ge = v.current) === null || ge === void 0 || ge.setSelectionRange(L, he, pe);
1143
- },
1144
- select: function() {
1145
- var L;
1146
- (L = v.current) === null || L === void 0 || L.select();
1147
- },
1148
- input: v.current,
1149
- nativeElement: ((O = M.current) === null || O === void 0 ? void 0 : O.nativeElement) || v.current
1150
- };
1151
- }), $e(function() {
1152
- W.current && (W.current = !1), D(function(O) {
1153
- return O && C ? !1 : O;
1154
- });
1155
- }, [C]);
1156
- var ce = function(m, L, he) {
1157
- var pe = L;
1158
- if (!te.current && j.exceedFormatter && j.max && j.strategy(L) > j.max) {
1159
- if (pe = j.exceedFormatter(L, {
1160
- max: j.max
1161
- }), L !== pe) {
1162
- var ge, ve;
1163
- se([((ge = v.current) === null || ge === void 0 ? void 0 : ge.selectionStart) || 0, ((ve = v.current) === null || ve === void 0 ? void 0 : ve.selectionEnd) || 0]);
1164
- }
1165
- } else if (he.source === "compositionEnd")
1166
- return;
1167
- X(pe), v.current && Ee(v.current, m, t, pe);
1168
- };
1169
- $e(function() {
1170
- if (q) {
1171
- var O;
1172
- (O = v.current) === null || O === void 0 || O.setSelectionRange.apply(O, Je(q));
1173
- }
1174
- }, [q]);
1175
- var fe = function(m) {
1176
- ce(m, m.target.value, {
1177
- source: "change"
1178
- });
1179
- }, P = function(m) {
1180
- te.current = !1, ce(m, m.currentTarget.value, {
1181
- source: "compositionEnd"
1182
- }), u == null || u(m);
1183
- }, Y = function(m) {
1184
- i && m.key === "Enter" && !W.current && (W.current = !0, i(m)), l == null || l(m);
1185
- }, Z = function(m) {
1186
- m.key === "Enter" && (W.current = !1), S == null || S(m);
1187
- }, be = function(m) {
1188
- D(!0), a == null || a(m);
1189
- }, Ie = function(m) {
1190
- W.current && (W.current = !1), D(!1), s == null || s(m);
1191
- }, xe = function(m) {
1192
- X(""), J(), v.current && Ee(v.current, m, t);
1193
- }, ze = ue && "".concat(p, "-out-of-range"), ye = function() {
1194
- var m = Rn(e, [
1195
- "prefixCls",
1196
- "onPressEnter",
1197
- "addonBefore",
1198
- "addonAfter",
1199
- "prefix",
1200
- "suffix",
1201
- "allowClear",
1202
- // Input elements must be either controlled or uncontrolled,
1203
- // specify either the value prop, or the defaultValue prop, but not both.
1204
- "defaultValue",
1205
- "showCount",
1206
- "count",
1207
- "classes",
1208
- "htmlSize",
1209
- "styles",
1210
- "classNames",
1211
- "onClear"
1212
- ]);
1213
- return /* @__PURE__ */ f.createElement("input", Ce({
1214
- autoComplete: r
1215
- }, m, {
1216
- onChange: fe,
1217
- onFocus: be,
1218
- onBlur: Ie,
1219
- onKeyDown: Y,
1220
- onKeyUp: Z,
1221
- className: w(p, ie({}, "".concat(p, "-disabled"), C), $ == null ? void 0 : $.input),
1222
- style: b == null ? void 0 : b.input,
1223
- ref: v,
1224
- size: E,
1225
- type: o,
1226
- onCompositionStart: function(he) {
1227
- te.current = !0, d == null || d(he);
1228
- },
1229
- onCompositionEnd: P
1230
- }));
1231
- }, Oe = function() {
1232
- var m = Number(k) > 0;
1233
- if (A || j.show) {
1234
- var L = j.showFormatter ? j.showFormatter({
1235
- value: _,
1236
- count: U,
1237
- maxLength: k
1238
- }) : "".concat(U).concat(m ? " / ".concat(k) : "");
1239
- return /* @__PURE__ */ f.createElement(f.Fragment, null, j.show && /* @__PURE__ */ f.createElement("span", {
1240
- className: w("".concat(p, "-show-count-suffix"), ie({}, "".concat(p, "-show-count-has-suffix"), !!A), $ == null ? void 0 : $.count),
1241
- style: ne({}, b == null ? void 0 : b.count)
1242
- }, L), A);
1243
- }
1244
- return null;
1245
- };
1246
- return /* @__PURE__ */ f.createElement(pn, Ce({}, c, {
1247
- prefixCls: p,
1248
- className: w(G, ze),
1249
- handleReset: xe,
1250
- value: _,
1251
- focused: h,
1252
- triggerFocus: J,
1253
- suffix: Oe(),
1254
- disabled: C,
1255
- classes: Q,
1256
- classNames: $,
1257
- styles: b
1258
- }), ye());
1259
- });
1260
- const bn = (e) => {
1261
- let n;
1262
- return typeof e == "object" && (e != null && e.clearIcon) ? n = e : e && (n = {
1263
- clearIcon: /* @__PURE__ */ f.createElement(En, null)
1264
- }), n;
1265
- };
1266
- function Qn(e, n) {
1267
- const r = le([]), t = () => {
1268
- r.current.push(setTimeout(() => {
1269
- var a, s, i, l;
1270
- !((a = e.current) === null || a === void 0) && a.input && ((s = e.current) === null || s === void 0 ? void 0 : s.input.getAttribute("type")) === "password" && (!((i = e.current) === null || i === void 0) && i.input.hasAttribute("value")) && ((l = e.current) === null || l === void 0 || l.input.removeAttribute("value"));
1271
- }));
1272
- };
1273
- return $e(() => (n && t(), () => r.current.forEach((a) => {
1274
- a && clearTimeout(a);
1275
- })), []), t;
1276
- }
1277
- function Jn(e) {
1278
- return !!(e.prefix || e.suffix || e.allowClear || e.showCount);
1279
- }
1280
- var kn = function(e, n) {
1281
- var r = {};
1282
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (r[t] = e[t]);
1283
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, t = Object.getOwnPropertySymbols(e); a < t.length; a++)
1284
- n.indexOf(t[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[a]) && (r[t[a]] = e[t[a]]);
1285
- return r;
1286
- };
1287
- const er = /* @__PURE__ */ We((e, n) => {
1288
- var r;
1289
- const {
1290
- prefixCls: t,
1291
- bordered: a = !0,
1292
- status: s,
1293
- size: i,
1294
- disabled: l,
1295
- onBlur: S,
1296
- onFocus: g,
1297
- suffix: p,
1298
- allowClear: C,
1299
- addonAfter: E,
1300
- addonBefore: G,
1301
- className: R,
1302
- style: A,
1303
- styles: re,
1304
- rootClassName: ee,
1305
- onChange: y,
1306
- classNames: o,
1307
- variant: Q
1308
- } = e, $ = kn(e, ["prefixCls", "bordered", "status", "size", "disabled", "onBlur", "onFocus", "suffix", "allowClear", "addonAfter", "addonBefore", "className", "style", "styles", "rootClassName", "onChange", "classNames", "variant"]);
1309
- if (process.env.NODE_ENV !== "production") {
1310
- const {
1311
- deprecated: P
1312
- } = Te("Input");
1313
- P(!("bordered" in e), "bordered", "variant");
1314
- }
1315
- const {
1316
- getPrefixCls: b,
1317
- direction: d,
1318
- input: u
1319
- } = f.useContext(ke), c = b("input", t), I = le(null), F = tn(c), [h, D, te] = fn(c, F), {
1320
- compactSize: W,
1321
- compactItemClassnames: v
1322
- } = In(c, d), M = an((P) => {
1323
- var Y;
1324
- return (Y = i ?? W) !== null && Y !== void 0 ? Y : P;
1325
- }), J = f.useContext(en), ae = l ?? J, {
1326
- status: z,
1327
- hasFeedback: N,
1328
- feedbackIcon: X
1329
- } = Sn(on), _ = rn(z, s), H = Jn(e) || !!N, B = le(H);
1330
- if (process.env.NODE_ENV !== "production") {
1331
- const P = Te("Input");
1332
- $e(() => {
1333
- var Y;
1334
- H && !B.current && process.env.NODE_ENV !== "production" && P(document.activeElement === ((Y = I.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"), B.current = H;
1335
- }, [H]);
1336
- }
1337
- const q = Qn(I, !0), se = (P) => {
1338
- q(), S == null || S(P);
1339
- }, j = (P) => {
1340
- q(), g == null || g(P);
1341
- }, k = (P) => {
1342
- q(), y == null || y(P);
1343
- }, U = (N || p) && /* @__PURE__ */ f.createElement(f.Fragment, null, p, N && X), ue = bn(C ?? (u == null ? void 0 : u.allowClear)), [ce, fe] = nn("input", Q, a);
1344
- return h(/* @__PURE__ */ f.createElement(Zn, Object.assign({
1345
- ref: yn(n, I),
1346
- prefixCls: c,
1347
- autoComplete: u == null ? void 0 : u.autoComplete
1348
- }, $, {
1349
- disabled: ae,
1350
- onBlur: se,
1351
- onFocus: j,
1352
- style: Object.assign(Object.assign({}, u == null ? void 0 : u.style), A),
1353
- styles: Object.assign(Object.assign({}, u == null ? void 0 : u.styles), re),
1354
- suffix: U,
1355
- allowClear: ue,
1356
- className: w(R, ee, te, F, v, u == null ? void 0 : u.className),
1357
- onChange: k,
1358
- addonBefore: G && /* @__PURE__ */ f.createElement(Ge, {
1359
- form: !0,
1360
- space: !0
1361
- }, G),
1362
- addonAfter: E && /* @__PURE__ */ f.createElement(Ge, {
1363
- form: !0,
1364
- space: !0
1365
- }, E),
1366
- classNames: Object.assign(Object.assign(Object.assign({}, o), u == null ? void 0 : u.classNames), {
1367
- input: w({
1368
- [`${c}-sm`]: M === "small",
1369
- [`${c}-lg`]: M === "large",
1370
- [`${c}-rtl`]: d === "rtl"
1371
- }, o == null ? void 0 : o.input, (r = u == null ? void 0 : u.classNames) === null || r === void 0 ? void 0 : r.input, D),
1372
- variant: w({
1373
- [`${c}-${ce}`]: fe
1374
- }, Fe(c, _)),
1375
- affixWrapper: w({
1376
- [`${c}-affix-wrapper-sm`]: M === "small",
1377
- [`${c}-affix-wrapper-lg`]: M === "large",
1378
- [`${c}-affix-wrapper-rtl`]: d === "rtl"
1379
- }, D),
1380
- wrapper: w({
1381
- [`${c}-group-rtl`]: d === "rtl"
1382
- }, D),
1383
- groupWrapper: w({
1384
- [`${c}-group-wrapper-sm`]: M === "small",
1385
- [`${c}-group-wrapper-lg`]: M === "large",
1386
- [`${c}-group-wrapper-rtl`]: d === "rtl",
1387
- [`${c}-group-wrapper-${ce}`]: fe
1388
- }, Fe(`${c}-group-wrapper`, _, N), D)
1389
- })
1390
- })));
1391
- });
1392
- process.env.NODE_ENV !== "production" && (er.displayName = "Input");
1393
- var nr = `
1394
- min-height:0 !important;
1395
- max-height:none !important;
1396
- height:0 !important;
1397
- visibility:hidden !important;
1398
- overflow:hidden !important;
1399
- position:absolute !important;
1400
- z-index:-1000 !important;
1401
- top:0 !important;
1402
- right:0 !important;
1403
- pointer-events: none !important;
1404
- `, rr = ["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"], Be = {}, oe;
1405
- function tr(e) {
1406
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, r = e.getAttribute("id") || e.getAttribute("data-reactid") || e.getAttribute("name");
1407
- if (n && Be[r])
1408
- return Be[r];
1409
- var t = window.getComputedStyle(e), a = t.getPropertyValue("box-sizing") || t.getPropertyValue("-moz-box-sizing") || t.getPropertyValue("-webkit-box-sizing"), s = parseFloat(t.getPropertyValue("padding-bottom")) + parseFloat(t.getPropertyValue("padding-top")), i = parseFloat(t.getPropertyValue("border-bottom-width")) + parseFloat(t.getPropertyValue("border-top-width")), l = rr.map(function(g) {
1410
- return "".concat(g, ":").concat(t.getPropertyValue(g));
1411
- }).join(";"), S = {
1412
- sizingStyle: l,
1413
- paddingSize: s,
1414
- borderSize: i,
1415
- boxSizing: a
1416
- };
1417
- return n && r && (Be[r] = S), S;
1418
- }
1419
- function ar(e) {
1420
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, t = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
1421
- oe || (oe = document.createElement("textarea"), oe.setAttribute("tab-index", "-1"), oe.setAttribute("aria-hidden", "true"), oe.setAttribute("name", "hiddenTextarea"), document.body.appendChild(oe)), e.getAttribute("wrap") ? oe.setAttribute("wrap", e.getAttribute("wrap")) : oe.removeAttribute("wrap");
1422
- var a = tr(e, n), s = a.paddingSize, i = a.borderSize, l = a.boxSizing, S = a.sizingStyle;
1423
- oe.setAttribute("style", "".concat(S, ";").concat(nr)), oe.value = e.value || e.placeholder || "";
1424
- var g = void 0, p = void 0, C, E = oe.scrollHeight;
1425
- if (l === "border-box" ? E += i : l === "content-box" && (E -= s), r !== null || t !== null) {
1426
- oe.value = " ";
1427
- var G = oe.scrollHeight - s;
1428
- r !== null && (g = G * r, l === "border-box" && (g = g + s + i), E = Math.max(g, E)), t !== null && (p = G * t, l === "border-box" && (p = p + s + i), C = E > p ? "" : "hidden", E = Math.min(p, E));
1429
- }
1430
- var R = {
1431
- height: E,
1432
- overflowY: C,
1433
- resize: "none"
1434
- };
1435
- return g && (R.minHeight = g), p && (R.maxHeight = p), R;
1436
- }
1437
- var or = ["prefixCls", "defaultValue", "value", "autoSize", "onResize", "className", "style", "disabled", "onChange", "onInternalAutoSize"], Ae = 0, Ne = 1, je = 2, ir = /* @__PURE__ */ K.forwardRef(function(e, n) {
1438
- var r = e, t = r.prefixCls, a = r.defaultValue, s = r.value, i = r.autoSize, l = r.onResize, S = r.className, g = r.style, p = r.disabled, C = r.onChange, E = r.onInternalAutoSize, G = Re(r, or), R = Pe(a, {
1439
- value: s,
1440
- postState: function(B) {
1441
- return B ?? "";
1442
- }
1443
- }), A = de(R, 2), re = A[0], ee = A[1], y = function(B) {
1444
- ee(B.target.value), C == null || C(B);
1445
- }, o = K.useRef();
1446
- K.useImperativeHandle(n, function() {
1447
- return {
1448
- textArea: o.current
1449
- };
1450
- });
1451
- var Q = K.useMemo(function() {
1452
- return i && _e(i) === "object" ? [i.minRows, i.maxRows] : [];
1453
- }, [i]), $ = de(Q, 2), b = $[0], d = $[1], u = !!i, c = function() {
1454
- try {
1455
- if (document.activeElement === o.current) {
1456
- var B = o.current, q = B.selectionStart, se = B.selectionEnd, j = B.scrollTop;
1457
- o.current.setSelectionRange(q, se), o.current.scrollTop = j;
1458
- }
1459
- } catch {
1460
- }
1461
- }, I = K.useState(je), F = de(I, 2), h = F[0], D = F[1], te = K.useState(), W = de(te, 2), v = W[0], M = W[1], J = function() {
1462
- D(Ae), process.env.NODE_ENV === "test" && (E == null || E());
1463
- };
1464
- Le(function() {
1465
- u && J();
1466
- }, [s, b, d, u]), Le(function() {
1467
- if (h === Ae)
1468
- D(Ne);
1469
- else if (h === Ne) {
1470
- var H = ar(o.current, !1, b, d);
1471
- D(je), M(H);
1472
- } else
1473
- c();
1474
- }, [h]);
1475
- var ae = K.useRef(), z = function() {
1476
- Ve.cancel(ae.current);
1477
- }, N = function(B) {
1478
- h === je && (l == null || l(B), i && (z(), ae.current = Ve(function() {
1479
- J();
1480
- })));
1481
- };
1482
- K.useEffect(function() {
1483
- return z;
1484
- }, []);
1485
- var X = u ? v : null, _ = ne(ne({}, g), X);
1486
- return (h === Ae || h === Ne) && (_.overflowY = "hidden", _.overflowX = "hidden"), /* @__PURE__ */ K.createElement(wn, {
1487
- onResize: N,
1488
- disabled: !(i || l)
1489
- }, /* @__PURE__ */ K.createElement("textarea", Ce({}, G, {
1490
- ref: o,
1491
- style: _,
1492
- className: w(t, S, ie({}, "".concat(t, "-disabled"), p)),
1493
- disabled: p,
1494
- value: re,
1495
- onChange: y
1496
- })));
1497
- }), lr = ["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"], dr = /* @__PURE__ */ f.forwardRef(function(e, n) {
1498
- var r, t = e.defaultValue, a = e.value, s = e.onFocus, i = e.onBlur, l = e.onChange, S = e.allowClear, g = e.maxLength, p = e.onCompositionStart, C = e.onCompositionEnd, E = e.suffix, G = e.prefixCls, R = G === void 0 ? "rc-textarea" : G, A = e.showCount, re = e.count, ee = e.className, y = e.style, o = e.disabled, Q = e.hidden, $ = e.classNames, b = e.styles, d = e.onResize, u = e.onClear, c = e.onPressEnter, I = e.readOnly, F = e.autoSize, h = e.onKeyDown, D = Re(e, lr), te = Pe(t, {
1499
- value: a,
1500
- defaultValue: t
1501
- }), W = de(te, 2), v = W[0], M = W[1], J = v == null ? "" : String(v), ae = f.useState(!1), z = de(ae, 2), N = z[0], X = z[1], _ = f.useRef(!1), H = f.useState(null), B = de(H, 2), q = B[0], se = B[1], j = le(null), k = le(null), U = function() {
1502
- var x;
1503
- return (x = k.current) === null || x === void 0 ? void 0 : x.textArea;
1504
- }, ue = function() {
1505
- U().focus();
1506
- };
1507
- Ze(n, function() {
1508
- var V;
1509
- return {
1510
- resizableTextArea: k.current,
1511
- focus: ue,
1512
- blur: function() {
1513
- U().blur();
1514
- },
1515
- nativeElement: ((V = j.current) === null || V === void 0 ? void 0 : V.nativeElement) || U()
1516
- };
1517
- }), $e(function() {
1518
- X(function(V) {
1519
- return !o && V;
1520
- });
1521
- }, [o]);
1522
- var ce = f.useState(null), fe = de(ce, 2), P = fe[0], Y = fe[1];
1523
- f.useEffect(function() {
1524
- if (P) {
1525
- var V;
1526
- (V = U()).setSelectionRange.apply(V, Je(P));
1527
- }
1528
- }, [P]);
1529
- var Z = mn(re, A), be = (r = Z.max) !== null && r !== void 0 ? r : g, Ie = Number(be) > 0, xe = Z.strategy(J), ze = !!be && xe > be, ye = function(x, me) {
1530
- var we = me;
1531
- !_.current && Z.exceedFormatter && Z.max && Z.strategy(me) > Z.max && (we = Z.exceedFormatter(me, {
1532
- max: Z.max
1533
- }), me !== we && Y([U().selectionStart || 0, U().selectionEnd || 0])), M(we), Ee(x.currentTarget, x, l, we);
1534
- }, Oe = function(x) {
1535
- _.current = !0, p == null || p(x);
1536
- }, O = function(x) {
1537
- _.current = !1, ye(x, x.currentTarget.value), C == null || C(x);
1538
- }, m = function(x) {
1539
- ye(x, x.target.value);
1540
- }, L = function(x) {
1541
- x.key === "Enter" && c && c(x), h == null || h(x);
1542
- }, he = function(x) {
1543
- X(!0), s == null || s(x);
1544
- }, pe = function(x) {
1545
- X(!1), i == null || i(x);
1546
- }, ge = function(x) {
1547
- M(""), ue(), Ee(U(), x, l);
1548
- }, ve = E, Se;
1549
- Z.show && (Z.showFormatter ? Se = Z.showFormatter({
1550
- value: J,
1551
- count: xe,
1552
- maxLength: be
1553
- }) : Se = "".concat(xe).concat(Ie ? " / ".concat(be) : ""), ve = /* @__PURE__ */ f.createElement(f.Fragment, null, ve, /* @__PURE__ */ f.createElement("span", {
1554
- className: w("".concat(R, "-data-count"), $ == null ? void 0 : $.count),
1555
- style: b == null ? void 0 : b.count
1556
- }, Se)));
1557
- var hn = function(x) {
1558
- var me;
1559
- d == null || d(x), (me = U()) !== null && me !== void 0 && me.style.height && se(!0);
1560
- }, vn = !F && !A && !S;
1561
- return /* @__PURE__ */ f.createElement(pn, {
1562
- ref: j,
1563
- value: J,
1564
- allowClear: S,
1565
- handleReset: ge,
1566
- suffix: ve,
1567
- prefixCls: R,
1568
- classNames: ne(ne({}, $), {}, {
1569
- affixWrapper: w($ == null ? void 0 : $.affixWrapper, ie(ie({}, "".concat(R, "-show-count"), A), "".concat(R, "-textarea-allow-clear"), S))
1570
- }),
1571
- disabled: o,
1572
- focused: N,
1573
- className: w(ee, ze && "".concat(R, "-out-of-range")),
1574
- style: ne(ne({}, y), q && !vn ? {
1575
- height: "auto"
1576
- } : {}),
1577
- dataAttrs: {
1578
- affixWrapper: {
1579
- "data-count": typeof Se == "string" ? Se : void 0
1580
- }
1581
- },
1582
- hidden: Q,
1583
- readOnly: I,
1584
- onClear: u
1585
- }, /* @__PURE__ */ f.createElement(ir, Ce({}, D, {
1586
- autoSize: F,
1587
- maxLength: g,
1588
- onKeyDown: L,
1589
- onChange: m,
1590
- onFocus: he,
1591
- onBlur: pe,
1592
- onCompositionStart: Oe,
1593
- onCompositionEnd: O,
1594
- className: w($ == null ? void 0 : $.textarea),
1595
- style: ne(ne({}, b == null ? void 0 : b.textarea), {}, {
1596
- resize: y == null ? void 0 : y.resize
1597
- }),
1598
- disabled: o,
1599
- prefixCls: R,
1600
- onResize: hn,
1601
- ref: k,
1602
- readOnly: I
1603
- })));
1604
- }), sr = function(e, n) {
1605
- var r = {};
1606
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (r[t] = e[t]);
1607
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, t = Object.getOwnPropertySymbols(e); a < t.length; a++)
1608
- n.indexOf(t[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[a]) && (r[t[a]] = e[t[a]]);
1609
- return r;
1610
- };
1611
- const Er = /* @__PURE__ */ We((e, n) => {
1612
- var r, t;
1613
- const {
1614
- prefixCls: a,
1615
- bordered: s = !0,
1616
- size: i,
1617
- disabled: l,
1618
- status: S,
1619
- allowClear: g,
1620
- classNames: p,
1621
- rootClassName: C,
1622
- className: E,
1623
- style: G,
1624
- styles: R,
1625
- variant: A
1626
- } = e, re = sr(e, ["prefixCls", "bordered", "size", "disabled", "status", "allowClear", "classNames", "rootClassName", "className", "style", "styles", "variant"]);
1627
- if (process.env.NODE_ENV !== "production") {
1628
- const {
1629
- deprecated: z
1630
- } = Te("TextArea");
1631
- z(!("bordered" in e), "bordered", "variant");
1632
- }
1633
- const {
1634
- getPrefixCls: ee,
1635
- direction: y,
1636
- textArea: o
1637
- } = K.useContext(ke), Q = an(i), $ = K.useContext(en), b = l ?? $, {
1638
- status: d,
1639
- hasFeedback: u,
1640
- feedbackIcon: c
1641
- } = K.useContext(on), I = rn(d, S), F = K.useRef(null);
1642
- K.useImperativeHandle(n, () => {
1643
- var z;
1644
- return {
1645
- resizableTextArea: (z = F.current) === null || z === void 0 ? void 0 : z.resizableTextArea,
1646
- focus: (N) => {
1647
- var X, _;
1648
- gn((_ = (X = F.current) === null || X === void 0 ? void 0 : X.resizableTextArea) === null || _ === void 0 ? void 0 : _.textArea, N);
1649
- },
1650
- blur: () => {
1651
- var N;
1652
- return (N = F.current) === null || N === void 0 ? void 0 : N.blur();
1653
- }
1654
- };
1655
- });
1656
- const h = ee("input", a), D = tn(h), [te, W, v] = fn(h, D), [M, J] = nn("textArea", A, s), ae = bn(g ?? (o == null ? void 0 : o.allowClear));
1657
- return te(/* @__PURE__ */ K.createElement(dr, Object.assign({
1658
- autoComplete: o == null ? void 0 : o.autoComplete
1659
- }, re, {
1660
- style: Object.assign(Object.assign({}, o == null ? void 0 : o.style), G),
1661
- styles: Object.assign(Object.assign({}, o == null ? void 0 : o.styles), R),
1662
- disabled: b,
1663
- allowClear: ae,
1664
- className: w(v, D, E, C, o == null ? void 0 : o.className),
1665
- classNames: Object.assign(Object.assign(Object.assign({}, p), o == null ? void 0 : o.classNames), {
1666
- textarea: w({
1667
- [`${h}-sm`]: Q === "small",
1668
- [`${h}-lg`]: Q === "large"
1669
- }, W, p == null ? void 0 : p.textarea, (r = o == null ? void 0 : o.classNames) === null || r === void 0 ? void 0 : r.textarea),
1670
- variant: w({
1671
- [`${h}-${M}`]: J
1672
- }, Fe(h, I)),
1673
- affixWrapper: w(`${h}-textarea-affix-wrapper`, {
1674
- [`${h}-affix-wrapper-rtl`]: y === "rtl",
1675
- [`${h}-affix-wrapper-sm`]: Q === "small",
1676
- [`${h}-affix-wrapper-lg`]: Q === "large",
1677
- [`${h}-textarea-show-count`]: e.showCount || ((t = e.count) === null || t === void 0 ? void 0 : t.show)
1678
- }, W)
1679
- }),
1680
- prefixCls: h,
1681
- suffix: u && /* @__PURE__ */ K.createElement("span", {
1682
- className: `${h}-textarea-suffix`
1683
- }, c),
1684
- ref: F
1685
- })));
1686
- });
1687
- export {
1688
- er as I,
1689
- Er as T,
1690
- Bn as a,
1691
- Qn as b,
1692
- cn as c,
1693
- ln as d,
1694
- De as e,
1695
- un as g,
1696
- On as i,
1697
- fn as u
1698
- };