@tachybase/components 0.23.8
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/.turbo/turbo-build.log +9 -0
- package/LICENSE +201 -0
- package/lib/__builtins__/dayjs.d.ts +4 -0
- package/lib/__builtins__/dayjs.js +95 -0
- package/lib/__builtins__/hooks/index.d.ts +4 -0
- package/lib/__builtins__/hooks/index.js +27 -0
- package/lib/__builtins__/hooks/useClickAway.d.ts +5 -0
- package/lib/__builtins__/hooks/useClickAway.js +64 -0
- package/lib/__builtins__/hooks/useConfig.d.ts +1 -0
- package/lib/__builtins__/hooks/useConfig.js +31 -0
- package/lib/__builtins__/hooks/usePrefixCls.d.ts +3 -0
- package/lib/__builtins__/hooks/usePrefixCls.js +38 -0
- package/lib/__builtins__/hooks/useToken.d.ts +6 -0
- package/lib/__builtins__/hooks/useToken.js +28 -0
- package/lib/__builtins__/index.d.ts +7 -0
- package/lib/__builtins__/index.js +33 -0
- package/lib/__builtins__/loading.d.ts +1 -0
- package/lib/__builtins__/loading.js +40 -0
- package/lib/__builtins__/pickDataProps.d.ts +1 -0
- package/lib/__builtins__/pickDataProps.js +36 -0
- package/lib/__builtins__/portal.d.ts +10 -0
- package/lib/__builtins__/portal.js +89 -0
- package/lib/__builtins__/render.d.ts +9 -0
- package/lib/__builtins__/render.js +99 -0
- package/lib/__builtins__/sort.d.ts +73 -0
- package/lib/__builtins__/sort.js +126 -0
- package/lib/__builtins__/style.d.ts +23 -0
- package/lib/__builtins__/style.js +88 -0
- package/lib/array-base/index.d.ts +64 -0
- package/lib/array-base/index.js +345 -0
- package/lib/array-base/style.d.ts +2 -0
- package/lib/array-base/style.js +68 -0
- package/lib/array-cards/index.d.ts +5 -0
- package/lib/array-cards/index.js +166 -0
- package/lib/array-cards/style.d.ts +2 -0
- package/lib/array-cards/style.js +37 -0
- package/lib/array-collapse/index.d.ts +10 -0
- package/lib/array-collapse/index.js +199 -0
- package/lib/array-collapse/style.d.ts +2 -0
- package/lib/array-collapse/style.js +33 -0
- package/lib/array-items/index.d.ts +8 -0
- package/lib/array-items/index.js +122 -0
- package/lib/array-items/style.d.ts +2 -0
- package/lib/array-items/style.js +82 -0
- package/lib/array-table/index.d.ts +9 -0
- package/lib/array-table/index.js +376 -0
- package/lib/array-table/style.d.ts +2 -0
- package/lib/array-table/style.js +71 -0
- package/lib/array-tabs/index.d.ts +4 -0
- package/lib/array-tabs/index.js +102 -0
- package/lib/cascader/index.d.ts +12 -0
- package/lib/cascader/index.js +58 -0
- package/lib/checkbox/index.d.ts +5 -0
- package/lib/checkbox/index.js +51 -0
- package/lib/code-mirror/index.d.ts +3 -0
- package/lib/code-mirror/index.js +91 -0
- package/lib/date-picker/index.d.ts +2 -0
- package/lib/date-picker/index.js +70 -0
- package/lib/date-picker/style.d.ts +1 -0
- package/lib/date-picker/style.js +1 -0
- package/lib/editable/index.d.ts +8 -0
- package/lib/editable/index.js +181 -0
- package/lib/editable/style.d.ts +2 -0
- package/lib/editable/style.js +69 -0
- package/lib/form/index.d.ts +12 -0
- package/lib/form/index.js +71 -0
- package/lib/form-button-group/index.d.ts +27 -0
- package/lib/form-button-group/index.js +148 -0
- package/lib/form-button-group/style.d.ts +2 -0
- package/lib/form-button-group/style.js +41 -0
- package/lib/form-collapse/index.d.ts +28 -0
- package/lib/form-collapse/index.js +150 -0
- package/lib/form-dialog/index.d.ts +26 -0
- package/lib/form-dialog/index.js +194 -0
- package/lib/form-drawer/index.d.ts +25 -0
- package/lib/form-drawer/index.js +187 -0
- package/lib/form-grid/index.d.ts +34 -0
- package/lib/form-grid/index.js +108 -0
- package/lib/form-grid/style.d.ts +2 -0
- package/lib/form-grid/style.js +31 -0
- package/lib/form-item/hooks/index.d.ts +2 -0
- package/lib/form-item/hooks/index.js +23 -0
- package/lib/form-item/hooks/useFormItemLayout.d.ts +37 -0
- package/lib/form-item/hooks/useFormItemLayout.js +66 -0
- package/lib/form-item/hooks/useOverflow.d.ts +5 -0
- package/lib/form-item/hooks/useOverflow.js +55 -0
- package/lib/form-item/index.d.ts +11 -0
- package/lib/form-item/index.js +303 -0
- package/lib/form-item/style/animation.d.ts +2 -0
- package/lib/form-item/style/animation.js +57 -0
- package/lib/form-item/style/grid.d.ts +2 -0
- package/lib/form-item/style/grid.js +50 -0
- package/lib/form-item/style/index.d.ts +2 -0
- package/lib/form-item/style/index.js +387 -0
- package/lib/form-item/style/other.d.ts +2 -0
- package/lib/form-item/style/other.js +490 -0
- package/lib/form-item/types.d.ts +35 -0
- package/lib/form-item/types.js +15 -0
- package/lib/form-layout/index.d.ts +74 -0
- package/lib/form-layout/index.js +96 -0
- package/lib/form-layout/useResponsiveFormLayout.d.ts +17 -0
- package/lib/form-layout/useResponsiveFormLayout.js +89 -0
- package/lib/form-step/index.d.ts +27 -0
- package/lib/form-step/index.js +154 -0
- package/lib/form-tab/index.d.ts +19 -0
- package/lib/form-tab/index.js +150 -0
- package/lib/index.d.ts +38 -0
- package/lib/index.js +95 -0
- package/lib/input/index.d.ts +7 -0
- package/lib/input/index.js +57 -0
- package/lib/lightbox/constant.d.ts +21 -0
- package/lib/lightbox/constant.js +79 -0
- package/lib/lightbox/index.d.ts +2 -0
- package/lib/lightbox/index.js +37 -0
- package/lib/lightbox/interface.d.ts +43 -0
- package/lib/lightbox/interface.js +15 -0
- package/lib/lightbox/react-image-lightbox.d.ts +197 -0
- package/lib/lightbox/react-image-lightbox.js +1431 -0
- package/lib/lightbox/style.css +305 -0
- package/lib/lightbox/util.d.ts +7 -0
- package/lib/lightbox/util.js +71 -0
- package/lib/number-picker/index.d.ts +4 -0
- package/lib/number-picker/index.js +32 -0
- package/lib/password/PasswordStrength.d.ts +9 -0
- package/lib/password/PasswordStrength.js +188 -0
- package/lib/password/index.d.ts +7 -0
- package/lib/password/index.js +85 -0
- package/lib/preview-text/index.d.ts +12 -0
- package/lib/preview-text/index.js +263 -0
- package/lib/preview-text/style.d.ts +2 -0
- package/lib/preview-text/style.js +37 -0
- package/lib/radio/index.d.ts +8 -0
- package/lib/radio/index.js +51 -0
- package/lib/reset/index.d.ts +10 -0
- package/lib/reset/index.js +67 -0
- package/lib/select/index.d.ts +4 -0
- package/lib/select/index.js +59 -0
- package/lib/select-table/hooks/index.d.ts +5 -0
- package/lib/select-table/hooks/index.js +29 -0
- package/lib/select-table/hooks/useCheckSlackly.d.ts +16 -0
- package/lib/select-table/hooks/useCheckSlackly.js +57 -0
- package/lib/select-table/hooks/useFilterOptions.d.ts +3 -0
- package/lib/select-table/hooks/useFilterOptions.js +97 -0
- package/lib/select-table/hooks/useFlatOptions.d.ts +3 -0
- package/lib/select-table/hooks/useFlatOptions.js +46 -0
- package/lib/select-table/hooks/useSize.d.ts +9 -0
- package/lib/select-table/hooks/useSize.js +48 -0
- package/lib/select-table/hooks/useTitleAddon.d.ts +7 -0
- package/lib/select-table/hooks/useTitleAddon.js +90 -0
- package/lib/select-table/index.d.ts +27 -0
- package/lib/select-table/index.js +339 -0
- package/lib/select-table/style.d.ts +2 -0
- package/lib/select-table/style.js +33 -0
- package/lib/select-table/utils.d.ts +78 -0
- package/lib/select-table/utils.js +166 -0
- package/lib/space/index.d.ts +4 -0
- package/lib/space/index.js +49 -0
- package/lib/submit/index.d.ts +11 -0
- package/lib/submit/index.js +67 -0
- package/lib/switch/index.d.ts +2 -0
- package/lib/switch/index.js +44 -0
- package/lib/time-picker/index.d.ts +2 -0
- package/lib/time-picker/index.js +60 -0
- package/lib/time-picker/style.d.ts +1 -0
- package/lib/time-picker/style.js +1 -0
- package/lib/transfer/index.d.ts +2 -0
- package/lib/transfer/index.js +56 -0
- package/lib/tree-select/index.d.ts +2 -0
- package/lib/tree-select/index.js +58 -0
- package/lib/upload/index.d.ts +18 -0
- package/lib/upload/index.js +159 -0
- package/lib/upload/placeholder.d.ts +4 -0
- package/lib/upload/placeholder.js +88 -0
- package/package.json +31 -0
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var other_exports = {};
|
|
20
|
+
__export(other_exports, {
|
|
21
|
+
genOtherStyle: () => genOtherStyle
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(other_exports);
|
|
24
|
+
const genOtherStyle = /* @__PURE__ */ __name((token) => {
|
|
25
|
+
const {
|
|
26
|
+
componentCls,
|
|
27
|
+
colorError,
|
|
28
|
+
colorWarningBg,
|
|
29
|
+
colorWarning,
|
|
30
|
+
colorBorder,
|
|
31
|
+
colorSuccess,
|
|
32
|
+
lineWidth,
|
|
33
|
+
colorPrimaryBorderHover,
|
|
34
|
+
colorPrimary,
|
|
35
|
+
antCls,
|
|
36
|
+
fontSize,
|
|
37
|
+
marginSM,
|
|
38
|
+
marginLG,
|
|
39
|
+
controlHeight,
|
|
40
|
+
controlHeightSM,
|
|
41
|
+
lineHeight,
|
|
42
|
+
controlOutlineWidth,
|
|
43
|
+
controlOutline,
|
|
44
|
+
colorErrorOutline,
|
|
45
|
+
colorWarningOutline,
|
|
46
|
+
colorTextSecondary,
|
|
47
|
+
paddingXS
|
|
48
|
+
} = token;
|
|
49
|
+
const hover = /* @__PURE__ */ __name((color = colorPrimaryBorderHover) => ({
|
|
50
|
+
borderColor: color,
|
|
51
|
+
borderInlineEndWidth: lineWidth
|
|
52
|
+
}), "hover");
|
|
53
|
+
const active = /* @__PURE__ */ __name((color = colorPrimary, outlineColor = controlOutline) => ({
|
|
54
|
+
borderColor: color,
|
|
55
|
+
borderInlineEndWidth: lineWidth,
|
|
56
|
+
outline: 0,
|
|
57
|
+
boxShadow: `0 0 0 ${controlOutlineWidth}px ${outlineColor}`
|
|
58
|
+
}), "active");
|
|
59
|
+
const extraLabelHeight = controlHeightSM - 2;
|
|
60
|
+
return {
|
|
61
|
+
[componentCls]: {
|
|
62
|
+
"&-layout-vertical": {
|
|
63
|
+
display: "block",
|
|
64
|
+
// Vertical Label: https://github.com/ant-design/ant-design/blob/master/components/form/style/index.ts#L391C1-L404C4
|
|
65
|
+
[`${componentCls}-label`]: {
|
|
66
|
+
minHeight: lineHeight * fontSize + paddingXS,
|
|
67
|
+
lineHeight,
|
|
68
|
+
padding: `0 0 ${paddingXS}px`,
|
|
69
|
+
"&-content": {
|
|
70
|
+
whiteSpace: "initial",
|
|
71
|
+
textAlign: "start"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
[`${antCls}-label`]: {
|
|
75
|
+
minHeight: controlHeight - 10,
|
|
76
|
+
lineHeight
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"&-success": {
|
|
80
|
+
[`${antCls}-select-selector,
|
|
81
|
+
${antCls}-cascader-picker,
|
|
82
|
+
${antCls}-picker,
|
|
83
|
+
${antCls}-input,
|
|
84
|
+
${antCls}-input-number,
|
|
85
|
+
${antCls}-input-affix-wrapper,
|
|
86
|
+
${antCls}-input-affix-wrapper,
|
|
87
|
+
${antCls}-input`]: {
|
|
88
|
+
borderColor: `${colorSuccess} !important`
|
|
89
|
+
},
|
|
90
|
+
[`${antCls}-select-selector,
|
|
91
|
+
${antCls}-cascader-picker,
|
|
92
|
+
${antCls}-picker,
|
|
93
|
+
${antCls}-input,
|
|
94
|
+
${antCls}-input-number,
|
|
95
|
+
${antCls}-input-affix-wrapper,
|
|
96
|
+
${antCls}-input-affix-wrapper:hover,
|
|
97
|
+
${antCls}-input:hover`]: {
|
|
98
|
+
borderColor: `${colorSuccess} !important`
|
|
99
|
+
},
|
|
100
|
+
[`${antCls}-input-affix-wrapper-focused,
|
|
101
|
+
${antCls}-input-affix-wrapper:focus,
|
|
102
|
+
${antCls}-input-focused,
|
|
103
|
+
${antCls}-input:focus`]: {
|
|
104
|
+
borderColor: `${colorSuccess} !important`,
|
|
105
|
+
borderInlineEndWidth: "1px !important",
|
|
106
|
+
outline: 0
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"&-warning": {
|
|
110
|
+
[`${antCls}-select-selector,
|
|
111
|
+
${antCls}-cascader-picker,
|
|
112
|
+
${antCls}-picker,
|
|
113
|
+
${antCls}-input,
|
|
114
|
+
${antCls}-input-number,
|
|
115
|
+
${antCls}-input-affix-wrapper,
|
|
116
|
+
${antCls}-input-affix-wrapper,
|
|
117
|
+
${antCls}-input`]: {
|
|
118
|
+
borderColor: colorWarning
|
|
119
|
+
},
|
|
120
|
+
[`${antCls}-select-selector,
|
|
121
|
+
${antCls}-cascader-picker,
|
|
122
|
+
${antCls}-picker,
|
|
123
|
+
${antCls}-input,
|
|
124
|
+
${antCls}-input-number,
|
|
125
|
+
${antCls}-input-affix-wrapper,
|
|
126
|
+
${antCls}-input-affix-wrapper:hover,
|
|
127
|
+
${antCls}-input:hover`]: {
|
|
128
|
+
borderColor: colorWarning
|
|
129
|
+
},
|
|
130
|
+
[`${antCls}-select:not(${antCls}-select-disabled):not(${antCls}-select-customize-input)`]: {
|
|
131
|
+
[`${antCls}-select-selector`]: {
|
|
132
|
+
backgroundColor: colorWarningBg,
|
|
133
|
+
borderColor: colorWarning
|
|
134
|
+
},
|
|
135
|
+
[`&${antCls}-select-open ${antCls}-select-selector,
|
|
136
|
+
&${antCls}-select-focused ${antCls}-select-selector`]: {
|
|
137
|
+
...active(colorWarning, colorWarningOutline)
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
[`${antCls}-input-number,
|
|
141
|
+
${antCls}-picker`]: {
|
|
142
|
+
backgroundColor: colorWarningBg,
|
|
143
|
+
borderColor: colorWarning,
|
|
144
|
+
[`&-focused,
|
|
145
|
+
&:focus`]: {
|
|
146
|
+
...active(colorWarning, colorWarningOutline)
|
|
147
|
+
},
|
|
148
|
+
"&:not([disabled]):hover": {
|
|
149
|
+
backgroundColor: colorWarningBg,
|
|
150
|
+
borderColor: colorWarning
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
[`${antCls}-cascader-picker:focus ${antCls}-cascader-input`]: {
|
|
154
|
+
backgroundColor: colorWarningBg,
|
|
155
|
+
...active(colorWarning, colorWarningOutline)
|
|
156
|
+
},
|
|
157
|
+
[`${antCls}-input-affix-wrapper-focused,
|
|
158
|
+
${antCls}-input-affix-wrapper:focus,
|
|
159
|
+
${antCls}-input-focused,
|
|
160
|
+
${antCls}-input:focus`]: {
|
|
161
|
+
...active(colorWarning, colorWarningOutline)
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"&-error": {
|
|
165
|
+
[`${antCls}-select-selector,
|
|
166
|
+
${antCls}-cascader-picker,
|
|
167
|
+
${antCls}-picker,
|
|
168
|
+
${antCls}-input,
|
|
169
|
+
${antCls}-input-number,
|
|
170
|
+
${antCls}-input-affix-wrapper,
|
|
171
|
+
${antCls}-input`]: {
|
|
172
|
+
borderColor: `${colorError} !important`
|
|
173
|
+
},
|
|
174
|
+
[`${antCls}-select-selector,
|
|
175
|
+
${antCls}-cascader-picker,
|
|
176
|
+
${antCls}-picker,
|
|
177
|
+
${antCls}-input,
|
|
178
|
+
${antCls}-input-number,
|
|
179
|
+
${antCls}-input-affix-wrapper,
|
|
180
|
+
${antCls}-input-affix-wrapper:hover,
|
|
181
|
+
${antCls}-input:hover`]: {
|
|
182
|
+
borderColor: `${colorError} !important`
|
|
183
|
+
},
|
|
184
|
+
[`${antCls}-select:not(${antCls}-select-disabled):not(${antCls}-select-customize-input)`]: {
|
|
185
|
+
[`${antCls}-select-selector`]: {
|
|
186
|
+
borderColor: `${colorError} !important`
|
|
187
|
+
},
|
|
188
|
+
[`&${antCls}-select-open ${antCls}-select-selector,
|
|
189
|
+
&${antCls}-select-focused ${antCls}-select-selector`]: {
|
|
190
|
+
...active(colorError, colorErrorOutline)
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
[`${antCls}-input-number,
|
|
194
|
+
${antCls}-picker`]: {
|
|
195
|
+
borderColor: colorError,
|
|
196
|
+
[`&-focused,
|
|
197
|
+
&:focus`]: {
|
|
198
|
+
...active(colorError, colorErrorOutline)
|
|
199
|
+
},
|
|
200
|
+
[`&:not([disabled]):hover`]: {
|
|
201
|
+
borderColor: colorError
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
[`${antCls}-cascader-picker:focus ${antCls}-cascader-input`]: {
|
|
205
|
+
...active(colorError, colorErrorOutline)
|
|
206
|
+
},
|
|
207
|
+
[`${antCls}-input-affix-wrapper-focused,
|
|
208
|
+
${antCls}-input-affix-wrapper:focus,
|
|
209
|
+
${antCls}-input-focused,
|
|
210
|
+
${antCls}-input:focus`]: {
|
|
211
|
+
...active(colorError, colorErrorOutline)
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"&-feedback-layout": {
|
|
215
|
+
"&-terse": {
|
|
216
|
+
marginBottom: marginSM,
|
|
217
|
+
[`&${componentCls}-feedback-has-text:not(${componentCls}-inset)`]: {
|
|
218
|
+
marginBottom: 0
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"&-loose": {
|
|
222
|
+
marginBottom: marginLG,
|
|
223
|
+
[`&${componentCls}-feedback-has-text:not(${componentCls}-inset)`]: {
|
|
224
|
+
marginBottom: Math.max(marginLG - extraLabelHeight, 0)
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"&-none": {
|
|
228
|
+
marginBottom: 0,
|
|
229
|
+
[`&${componentCls}-feedback-has-text:not(${componentCls}-inset)`]: {
|
|
230
|
+
marginBottom: 0
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"&-control-wrap": {
|
|
235
|
+
[`${componentCls}-control`]: {
|
|
236
|
+
whiteSpace: "pre-line",
|
|
237
|
+
wordBreak: "break-all"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"&-control-align": {
|
|
241
|
+
"&-left": {
|
|
242
|
+
[`${componentCls}-control-content`]: {
|
|
243
|
+
justifyContent: "flex-start"
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"&-right": {
|
|
247
|
+
[`${componentCls}-control-content`]: {
|
|
248
|
+
justifyContent: "flex-end"
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"input[type='radio'], input[type='checkbox']": {
|
|
253
|
+
width: fontSize,
|
|
254
|
+
height: fontSize
|
|
255
|
+
},
|
|
256
|
+
"&-feedback-layout-popover": {
|
|
257
|
+
marginBottom: 8
|
|
258
|
+
},
|
|
259
|
+
"&-fullness": {
|
|
260
|
+
[`> ${componentCls}-control`]: {
|
|
261
|
+
[`> ${componentCls}-control-content`]: {
|
|
262
|
+
[`> ${componentCls}-control-content-component`]: {
|
|
263
|
+
"> *:first-child": {
|
|
264
|
+
width: "100%"
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"&-inset": {
|
|
271
|
+
borderRadius: 2,
|
|
272
|
+
border: `1px solid ${colorBorder}`,
|
|
273
|
+
paddingInlineStart: 12,
|
|
274
|
+
transition: "0.3s all",
|
|
275
|
+
[`${antCls}-input-number,
|
|
276
|
+
${antCls}-picker,
|
|
277
|
+
${antCls}-cascader-picker:focus ${antCls}-cascader-input,
|
|
278
|
+
${antCls}-select:not(${antCls}-select-customize-input)
|
|
279
|
+
${antCls}-select-selector,
|
|
280
|
+
${antCls}-input-affix-wrapper,
|
|
281
|
+
${antCls}-input`]: {
|
|
282
|
+
border: "none !important",
|
|
283
|
+
boxShadow: "none !important"
|
|
284
|
+
},
|
|
285
|
+
[`${antCls}-input-number-handler-wrap`]: {
|
|
286
|
+
border: "none !important",
|
|
287
|
+
[`${antCls}-input-number-handler`]: {
|
|
288
|
+
border: "none !important"
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
"&:hover": {
|
|
292
|
+
...hover()
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
"&-active": {
|
|
296
|
+
[`${componentCls}-control-content-component-has-feedback-icon`]: {
|
|
297
|
+
...active()
|
|
298
|
+
},
|
|
299
|
+
[`${antCls}-input-number,
|
|
300
|
+
${antCls}-picker,
|
|
301
|
+
${antCls}-cascader-picker:focus ${antCls}-cascader-input,
|
|
302
|
+
${antCls}-select:not(${antCls}-select-customize-input)
|
|
303
|
+
${antCls}-select-selector,
|
|
304
|
+
${antCls}-input`]: {
|
|
305
|
+
...active()
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"&-inset-active": {
|
|
309
|
+
...active()
|
|
310
|
+
},
|
|
311
|
+
"&-bordered-none": {
|
|
312
|
+
[`${antCls}-input-number,
|
|
313
|
+
${antCls}-input-affix-wrapper,
|
|
314
|
+
${antCls}-picker,
|
|
315
|
+
${antCls}-cascader-picker:focus ${antCls}-cascader-input,
|
|
316
|
+
${antCls}-select:not(${antCls}-select-customize-input)
|
|
317
|
+
${antCls}-select-selector,
|
|
318
|
+
${antCls}-input`]: {
|
|
319
|
+
border: "none !important",
|
|
320
|
+
boxShadow: "none !important"
|
|
321
|
+
},
|
|
322
|
+
[`${antCls}-input-number-handler-wrap`]: {
|
|
323
|
+
border: "none !important",
|
|
324
|
+
[`${antCls}-input-number-handler`]: {
|
|
325
|
+
border: "none !important"
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
"&:hover": {
|
|
330
|
+
[`${componentCls}-control-content-component-has-feedback-icon`]: {
|
|
331
|
+
...hover()
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
[`textarea${antCls}-input`]: {
|
|
335
|
+
height: "auto"
|
|
336
|
+
},
|
|
337
|
+
[`${componentCls}-label-tooltip-icon`]: {
|
|
338
|
+
marginInlineStart: 4,
|
|
339
|
+
color: token.colorTextSecondary,
|
|
340
|
+
display: "flex",
|
|
341
|
+
alignItems: "center",
|
|
342
|
+
maxHeight: controlHeight,
|
|
343
|
+
span: {
|
|
344
|
+
display: "inline-block"
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
[`${componentCls}-asterisk`]: {
|
|
348
|
+
color: colorError,
|
|
349
|
+
marginInlineEnd: "4px",
|
|
350
|
+
display: "inline-block",
|
|
351
|
+
fontFamily: "SimSun, sans-serif"
|
|
352
|
+
},
|
|
353
|
+
[`${componentCls}-colon`]: {
|
|
354
|
+
marginInlineStart: 2,
|
|
355
|
+
marginInlineEnd: 8
|
|
356
|
+
},
|
|
357
|
+
[`${componentCls}-control`]: {
|
|
358
|
+
flex: 1,
|
|
359
|
+
maxWidth: "100%",
|
|
360
|
+
[`${componentCls}-control-content`]: {
|
|
361
|
+
display: "flex",
|
|
362
|
+
[`${componentCls}-control-content-component`]: {
|
|
363
|
+
width: "100%",
|
|
364
|
+
minHeight: controlHeight - 2,
|
|
365
|
+
lineHeight: `${controlHeight - 2}px`,
|
|
366
|
+
[`&-has-feedback-icon`]: {
|
|
367
|
+
flex: 1,
|
|
368
|
+
position: "relative",
|
|
369
|
+
display: "flex",
|
|
370
|
+
alignItems: "center"
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
[`${componentCls}-addon-before `]: {
|
|
374
|
+
marginInlineEnd: 8,
|
|
375
|
+
display: "inline-flex",
|
|
376
|
+
alignItems: "center",
|
|
377
|
+
minHeight: controlHeight,
|
|
378
|
+
flexShrink: 0
|
|
379
|
+
},
|
|
380
|
+
[`${componentCls}-addon-after`]: {
|
|
381
|
+
marginInlineStart: 8,
|
|
382
|
+
display: "inline-flex",
|
|
383
|
+
alignItems: "center",
|
|
384
|
+
minHeight: controlHeight,
|
|
385
|
+
flexShrink: 0
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
[`${componentCls}-help,
|
|
389
|
+
${componentCls}-extra `]: {
|
|
390
|
+
minHeight: extraLabelHeight,
|
|
391
|
+
lineHeight: `${extraLabelHeight}px`,
|
|
392
|
+
color: colorTextSecondary
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
[`${componentCls}-help,
|
|
396
|
+
${componentCls}-extra`]: {
|
|
397
|
+
clear: "both",
|
|
398
|
+
minHeight: extraLabelHeight,
|
|
399
|
+
color: "rgba(0, 0, 0, 0.45)",
|
|
400
|
+
transition: "color 0.3s cubic-bezier(0.215, 0.61, 0.355, 1)",
|
|
401
|
+
paddingTop: 0
|
|
402
|
+
},
|
|
403
|
+
[`${componentCls}-control-content-component-has-feedback-icon`]: {
|
|
404
|
+
borderRadius: 2,
|
|
405
|
+
border: `1px solid ${colorBorder}`,
|
|
406
|
+
paddingInlineEnd: 8,
|
|
407
|
+
transition: "all 0.3s",
|
|
408
|
+
touchAction: "manipulation",
|
|
409
|
+
outline: "none",
|
|
410
|
+
[`${antCls}-input-number,
|
|
411
|
+
${antCls}-picker,
|
|
412
|
+
${antCls}-cascader-picker:focus ${antCls}-cascader-input,
|
|
413
|
+
${antCls}-select:not(${antCls}-select-customize-input)
|
|
414
|
+
${antCls}-select-selector,
|
|
415
|
+
${antCls}-input-affix-wrapper,
|
|
416
|
+
${antCls}-input`]: {
|
|
417
|
+
border: "none !important",
|
|
418
|
+
boxShadow: "none !important"
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
[`${componentCls}-error-help`]: {
|
|
422
|
+
color: `${colorError} !important`
|
|
423
|
+
},
|
|
424
|
+
[`${componentCls}-warning-help`]: {
|
|
425
|
+
color: colorWarning
|
|
426
|
+
},
|
|
427
|
+
[`${componentCls}-success-help`]: {
|
|
428
|
+
color: `${colorSuccess} !important`
|
|
429
|
+
},
|
|
430
|
+
[`${antCls}-upload`]: {
|
|
431
|
+
background: "transparent"
|
|
432
|
+
},
|
|
433
|
+
[`${antCls}-upload${antCls}-upload-drag`]: {
|
|
434
|
+
background: token.colorBgBase
|
|
435
|
+
},
|
|
436
|
+
[`${antCls}-radio-inline, ${antCls}-checkbox-inline`]: {
|
|
437
|
+
display: "inline-block",
|
|
438
|
+
marginInlineStart: marginSM,
|
|
439
|
+
fontWeight: "normal",
|
|
440
|
+
verticalAlign: "middle",
|
|
441
|
+
cursor: "pointer",
|
|
442
|
+
"&:first-child": {
|
|
443
|
+
marginInlineStart: 0
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
[`${antCls}-radio-vertical,
|
|
447
|
+
${antCls}-checkbox-vertical`]: {
|
|
448
|
+
display: "block"
|
|
449
|
+
},
|
|
450
|
+
[`${antCls}-checkbox-vertical + ${antCls}-checkbox-vertical,
|
|
451
|
+
${antCls}-radio-vertical + ${antCls}-radio-vertical`]: {
|
|
452
|
+
marginInlineStart: 0
|
|
453
|
+
},
|
|
454
|
+
[`${antCls}-input-number`]: {
|
|
455
|
+
width: "100%",
|
|
456
|
+
verticalAlign: "top",
|
|
457
|
+
[`+ ${antCls}-form-text`]: {
|
|
458
|
+
marginInlineStart: marginSM
|
|
459
|
+
},
|
|
460
|
+
"&-handler-wrap": {
|
|
461
|
+
zIndex: 2
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
[`${antCls}-select,
|
|
465
|
+
${antCls}-cascader-picker,
|
|
466
|
+
${antCls}-picker`]: {
|
|
467
|
+
width: "100%"
|
|
468
|
+
},
|
|
469
|
+
[`${antCls}-input-group ${antCls}-select,
|
|
470
|
+
${antCls}-input-group ${antCls}-cascader-picker`]: {
|
|
471
|
+
width: "auto"
|
|
472
|
+
},
|
|
473
|
+
"&-popover": {
|
|
474
|
+
[`${componentCls}-error-help`]: {
|
|
475
|
+
color: `${colorError} !important`
|
|
476
|
+
},
|
|
477
|
+
[`${componentCls}-warning-help`]: {
|
|
478
|
+
color: colorWarning
|
|
479
|
+
},
|
|
480
|
+
[`${componentCls}-success-help`]: {
|
|
481
|
+
color: `${colorSuccess} !important`
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
}, "genOtherStyle");
|
|
487
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
488
|
+
0 && (module.exports = {
|
|
489
|
+
genOtherStyle
|
|
490
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface IFormItemProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
style?: React.CSSProperties;
|
|
4
|
+
prefixCls?: string;
|
|
5
|
+
label?: React.ReactNode;
|
|
6
|
+
colon?: boolean;
|
|
7
|
+
tooltip?: React.ReactNode;
|
|
8
|
+
tooltipIcon?: React.ReactNode;
|
|
9
|
+
layout?: 'vertical' | 'horizontal' | 'inline';
|
|
10
|
+
tooltipLayout?: 'icon' | 'text';
|
|
11
|
+
labelStyle?: React.CSSProperties;
|
|
12
|
+
labelAlign?: 'left' | 'right';
|
|
13
|
+
labelWrap?: boolean;
|
|
14
|
+
labelWidth?: number | string;
|
|
15
|
+
wrapperWidth?: number | string;
|
|
16
|
+
labelCol?: number;
|
|
17
|
+
wrapperCol?: number;
|
|
18
|
+
wrapperAlign?: 'left' | 'right';
|
|
19
|
+
wrapperWrap?: boolean;
|
|
20
|
+
wrapperStyle?: React.CSSProperties;
|
|
21
|
+
fullness?: boolean;
|
|
22
|
+
addonBefore?: React.ReactNode;
|
|
23
|
+
addonAfter?: React.ReactNode;
|
|
24
|
+
size?: 'small' | 'default' | 'large';
|
|
25
|
+
inset?: boolean;
|
|
26
|
+
extra?: React.ReactNode;
|
|
27
|
+
feedbackText?: React.ReactNode;
|
|
28
|
+
feedbackLayout?: 'loose' | 'terse' | 'popover' | 'none' | (string & {});
|
|
29
|
+
feedbackStatus?: 'error' | 'warning' | 'success' | 'pending' | (string & {});
|
|
30
|
+
feedbackIcon?: React.ReactNode;
|
|
31
|
+
getPopupContainer?: (node: HTMLElement) => HTMLElement;
|
|
32
|
+
asterisk?: boolean;
|
|
33
|
+
gridSpan?: number;
|
|
34
|
+
bordered?: boolean;
|
|
35
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var types_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IFormLayoutProps {
|
|
3
|
+
prefixCls?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
colon?: boolean;
|
|
7
|
+
labelAlign?: 'right' | 'left' | ('right' | 'left')[];
|
|
8
|
+
wrapperAlign?: 'right' | 'left' | ('right' | 'left')[];
|
|
9
|
+
labelWrap?: boolean;
|
|
10
|
+
labelWidth?: number;
|
|
11
|
+
wrapperWidth?: number;
|
|
12
|
+
wrapperWrap?: boolean;
|
|
13
|
+
labelCol?: number | number[];
|
|
14
|
+
wrapperCol?: number | number[];
|
|
15
|
+
fullness?: boolean;
|
|
16
|
+
size?: 'small' | 'default' | 'large';
|
|
17
|
+
layout?: 'vertical' | 'horizontal' | 'inline' | ('vertical' | 'horizontal' | 'inline')[];
|
|
18
|
+
direction?: 'rtl' | 'ltr';
|
|
19
|
+
inset?: boolean;
|
|
20
|
+
shallow?: boolean;
|
|
21
|
+
tooltipLayout?: 'icon' | 'text';
|
|
22
|
+
tooltipIcon?: React.ReactNode;
|
|
23
|
+
feedbackLayout?: 'loose' | 'terse' | 'popover' | 'none';
|
|
24
|
+
bordered?: boolean;
|
|
25
|
+
breakpoints?: number[];
|
|
26
|
+
spaceGap?: number;
|
|
27
|
+
gridColumnGap?: number;
|
|
28
|
+
gridRowGap?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface IFormLayoutContext extends Omit<IFormLayoutProps, 'labelAlign' | 'wrapperAlign' | 'layout' | 'labelCol' | 'wrapperCol'> {
|
|
31
|
+
labelAlign?: 'right' | 'left';
|
|
32
|
+
wrapperAlign?: 'right' | 'left';
|
|
33
|
+
layout?: 'vertical' | 'horizontal' | 'inline';
|
|
34
|
+
labelCol?: number;
|
|
35
|
+
wrapperCol?: number;
|
|
36
|
+
}
|
|
37
|
+
export declare const FormLayoutDeepContext: React.Context<IFormLayoutContext>;
|
|
38
|
+
export declare const FormLayoutShallowContext: React.Context<IFormLayoutContext>;
|
|
39
|
+
export declare const useFormDeepLayout: () => IFormLayoutContext;
|
|
40
|
+
export declare const useFormShallowLayout: () => IFormLayoutContext;
|
|
41
|
+
export declare const useFormLayout: () => {
|
|
42
|
+
labelAlign?: "right" | "left";
|
|
43
|
+
wrapperAlign?: "right" | "left";
|
|
44
|
+
layout?: "vertical" | "horizontal" | "inline";
|
|
45
|
+
labelCol?: number;
|
|
46
|
+
wrapperCol?: number;
|
|
47
|
+
style?: React.CSSProperties;
|
|
48
|
+
className?: string;
|
|
49
|
+
inset?: boolean;
|
|
50
|
+
size?: "small" | "default" | "large";
|
|
51
|
+
direction?: "rtl" | "ltr";
|
|
52
|
+
gridColumnGap?: number;
|
|
53
|
+
gridRowGap?: number;
|
|
54
|
+
prefixCls?: string;
|
|
55
|
+
bordered?: boolean;
|
|
56
|
+
breakpoints?: number[];
|
|
57
|
+
colon?: boolean;
|
|
58
|
+
labelWrap?: boolean;
|
|
59
|
+
labelWidth?: number;
|
|
60
|
+
wrapperWidth?: number;
|
|
61
|
+
wrapperWrap?: boolean;
|
|
62
|
+
fullness?: boolean;
|
|
63
|
+
shallow?: boolean;
|
|
64
|
+
tooltipLayout?: "icon" | "text";
|
|
65
|
+
tooltipIcon?: React.ReactNode;
|
|
66
|
+
feedbackLayout?: "loose" | "terse" | "popover" | "none";
|
|
67
|
+
spaceGap?: number;
|
|
68
|
+
};
|
|
69
|
+
export declare const FormLayout: React.FC<React.PropsWithChildren<IFormLayoutProps>> & {
|
|
70
|
+
useFormLayout: () => IFormLayoutContext;
|
|
71
|
+
useFormDeepLayout: () => IFormLayoutContext;
|
|
72
|
+
useFormShallowLayout: () => IFormLayoutContext;
|
|
73
|
+
};
|
|
74
|
+
export default FormLayout;
|