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