rsuite 6.0.0-canary-2025031915 → 6.0.0-canary-2025032014
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/AutoComplete/styles/index.css +1 -1
- package/Cascader/styles/index.css +1 -1
- package/CheckPicker/styles/index.css +1 -1
- package/CheckTree/styles/index.css +1 -1
- package/CheckTreePicker/styles/index.css +1 -1
- package/DatePicker/styles/index.css +1 -1
- package/DateRangePicker/styles/index.css +1 -1
- package/Form/styles/index.css +0 -14
- package/Form/styles/index.less +0 -18
- package/FormControl/styles/index.css +10 -15
- package/FormControl/styles/index.less +11 -13
- package/FormControlLabel/styles/index.css +1 -1
- package/FormControlLabel/styles/index.less +1 -1
- package/FormGroup/styles/index.css +14 -21
- package/FormGroup/styles/index.less +15 -4
- package/FormStack/package.json +7 -0
- package/FormStack/styles/index.css +27 -0
- package/FormStack/styles/index.less +15 -0
- package/InputPicker/styles/index.css +1 -1
- package/MultiCascadeTree/styles/index.css +1 -1
- package/MultiCascader/styles/index.css +1 -1
- package/Pagination/styles/index.css +1 -1
- package/SelectPicker/styles/index.css +1 -1
- package/TagInput/styles/index.css +1 -1
- package/TagPicker/styles/index.css +1 -1
- package/TimePicker/styles/index.css +1 -1
- package/TimeRangePicker/styles/index.css +1 -1
- package/Tree/styles/index.css +1 -1
- package/TreePicker/styles/index.css +1 -1
- package/cjs/CustomProvider/types.d.ts +2 -0
- package/cjs/Form/Form.d.ts +10 -1
- package/cjs/Form/Form.js +32 -21
- package/cjs/FormControl/FormControl.d.ts +3 -2
- package/cjs/FormControl/FormControl.js +4 -2
- package/cjs/FormControlLabel/FormControlLabel.d.ts +2 -2
- package/cjs/FormControlLabel/FormControlLabel.js +4 -2
- package/cjs/FormErrorMessage/FormErrorMessage.d.ts +3 -2
- package/cjs/FormErrorMessage/FormErrorMessage.js +4 -2
- package/cjs/FormGroup/FormGroup.d.ts +2 -2
- package/cjs/FormGroup/FormGroup.js +5 -2
- package/cjs/FormHelpText/FormHelpText.d.ts +2 -2
- package/cjs/FormHelpText/FormHelpText.js +6 -3
- package/cjs/FormStack/FormStack.d.ts +27 -0
- package/cjs/FormStack/FormStack.js +50 -0
- package/cjs/FormStack/index.d.ts +4 -0
- package/cjs/FormStack/index.js +11 -0
- package/cjs/Schema/Schema.js +0 -0
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +6 -0
- package/dist/rsuite-no-reset-rtl.css +77 -78
- package/dist/rsuite-no-reset-rtl.min.css +1 -1
- package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
- package/dist/rsuite-no-reset.css +77 -78
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +77 -78
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +77 -78
- package/dist/rsuite.js +29 -18
- package/dist/rsuite.js.map +1 -1
- package/dist/rsuite.min.css +1 -1
- package/dist/rsuite.min.css.map +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/CustomProvider/types.d.ts +2 -0
- package/esm/Form/Form.d.ts +10 -1
- package/esm/Form/Form.js +30 -21
- package/esm/FormControl/FormControl.d.ts +3 -2
- package/esm/FormControl/FormControl.js +4 -2
- package/esm/FormControlLabel/FormControlLabel.d.ts +2 -2
- package/esm/FormControlLabel/FormControlLabel.js +4 -2
- package/esm/FormErrorMessage/FormErrorMessage.d.ts +3 -2
- package/esm/FormErrorMessage/FormErrorMessage.js +4 -2
- package/esm/FormGroup/FormGroup.d.ts +2 -2
- package/esm/FormGroup/FormGroup.js +5 -2
- package/esm/FormHelpText/FormHelpText.d.ts +2 -2
- package/esm/FormHelpText/FormHelpText.js +6 -3
- package/esm/FormStack/FormStack.d.ts +27 -0
- package/esm/FormStack/FormStack.js +45 -0
- package/esm/FormStack/index.d.ts +4 -0
- package/esm/FormStack/index.js +8 -0
- package/esm/Schema/Schema.js +0 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/internals/Picker/styles/index.less +3 -1
- package/package.json +1 -1
- package/styles/index.less +4 -3
package/cjs/Form/Form.js
CHANGED
|
@@ -5,28 +5,40 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _FormControl = _interopRequireDefault(require("../FormControl"));
|
|
10
10
|
var _FormControlLabel = _interopRequireDefault(require("../FormControlLabel"));
|
|
11
11
|
var _FormErrorMessage = _interopRequireDefault(require("../FormErrorMessage"));
|
|
12
12
|
var _FormGroup = _interopRequireDefault(require("../FormGroup"));
|
|
13
13
|
var _FormHelpText = _interopRequireDefault(require("../FormHelpText"));
|
|
14
|
+
var _FormStack = _interopRequireDefault(require("../FormStack"));
|
|
15
|
+
var _Box = _interopRequireDefault(require("../internals/Box"));
|
|
14
16
|
var _useSchemaModel = _interopRequireDefault(require("./hooks/useSchemaModel"));
|
|
15
17
|
var _useFormValidate = _interopRequireDefault(require("./hooks/useFormValidate"));
|
|
16
18
|
var _useFormValue = _interopRequireDefault(require("./hooks/useFormValue"));
|
|
17
|
-
var _useFormClassNames = _interopRequireDefault(require("./hooks/useFormClassNames"));
|
|
18
19
|
var _useFormRef = _interopRequireDefault(require("./hooks/useFormRef"));
|
|
19
20
|
var _utils = require("../internals/utils");
|
|
20
21
|
var _schemaTyped = require("schema-typed");
|
|
21
22
|
var _hooks = require("../internals/hooks");
|
|
22
23
|
var _FormContext = require("./FormContext");
|
|
23
24
|
var _CustomProvider = require("../CustomProvider");
|
|
25
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
26
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
27
|
const defaultSchema = (0, _schemaTyped.SchemaModel)({});
|
|
25
28
|
const Subcomponents = {
|
|
29
|
+
Stack: _FormStack.default,
|
|
26
30
|
Control: _FormControl.default,
|
|
27
|
-
|
|
31
|
+
Label: _FormControlLabel.default,
|
|
28
32
|
ErrorMessage: _FormErrorMessage.default,
|
|
29
33
|
Group: _FormGroup.default,
|
|
34
|
+
Text: _FormHelpText.default,
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated Use `Form.Label` instead
|
|
37
|
+
*/
|
|
38
|
+
ControlLabel: _FormControlLabel.default,
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated Use `Form.Text` instead
|
|
41
|
+
*/
|
|
30
42
|
HelpText: _FormHelpText.default
|
|
31
43
|
};
|
|
32
44
|
|
|
@@ -40,18 +52,16 @@ const Form = (0, _utils.forwardRef)((props, ref) => {
|
|
|
40
52
|
} = (0, _CustomProvider.useCustom)('Form', props);
|
|
41
53
|
const {
|
|
42
54
|
checkTrigger = 'change',
|
|
43
|
-
classPrefix = 'form',
|
|
44
55
|
errorFromContext = true,
|
|
45
56
|
formDefaultValue = {},
|
|
46
57
|
formValue: controlledFormValue,
|
|
47
58
|
formError: controlledFormError,
|
|
48
|
-
fluid,
|
|
49
59
|
nestedField = false,
|
|
50
|
-
|
|
60
|
+
fluid,
|
|
61
|
+
layout,
|
|
51
62
|
model: formModel = defaultSchema,
|
|
52
63
|
readOnly,
|
|
53
64
|
plaintext,
|
|
54
|
-
className,
|
|
55
65
|
children,
|
|
56
66
|
disabled,
|
|
57
67
|
onSubmit,
|
|
@@ -95,15 +105,6 @@ const Form = (0, _utils.forwardRef)((props, ref) => {
|
|
|
95
105
|
resetErrors,
|
|
96
106
|
cleanErrorForField
|
|
97
107
|
} = (0, _useFormValidate.default)(controlledFormError, formValidateProps);
|
|
98
|
-
const classes = (0, _useFormClassNames.default)({
|
|
99
|
-
classPrefix,
|
|
100
|
-
className,
|
|
101
|
-
fluid,
|
|
102
|
-
layout,
|
|
103
|
-
readOnly,
|
|
104
|
-
plaintext,
|
|
105
|
-
disabled
|
|
106
|
-
});
|
|
107
108
|
const submit = (0, _hooks.useEventCallback)(event => {
|
|
108
109
|
// Check the form before submitting
|
|
109
110
|
if (check()) {
|
|
@@ -177,16 +178,26 @@ const Form = (0, _utils.forwardRef)((props, ref) => {
|
|
|
177
178
|
checkFieldForNextValue,
|
|
178
179
|
checkFieldAsyncForNextValue
|
|
179
180
|
};
|
|
180
|
-
|
|
181
|
+
const formChild = (0, _react.useMemo)(() => {
|
|
182
|
+
return fluid || layout ? /*#__PURE__*/_react.default.createElement(_FormStack.default, {
|
|
183
|
+
fluid: fluid,
|
|
184
|
+
layout: layout
|
|
185
|
+
}, children) : children;
|
|
186
|
+
}, [fluid, children, layout]);
|
|
187
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
188
|
+
as: "form",
|
|
189
|
+
"data-rs": "form",
|
|
190
|
+
"data-disabled": disabled,
|
|
191
|
+
"data-readonly": readOnly,
|
|
192
|
+
"data-plaintext": plaintext,
|
|
181
193
|
ref: formRef,
|
|
182
194
|
onSubmit: handleSubmit,
|
|
183
|
-
onReset: handleReset
|
|
184
|
-
|
|
185
|
-
}), /*#__PURE__*/_react.default.createElement(_FormContext.FormProvider, {
|
|
195
|
+
onReset: handleReset
|
|
196
|
+
}, rest), /*#__PURE__*/_react.default.createElement(_FormContext.FormProvider, {
|
|
186
197
|
value: formContextValue
|
|
187
198
|
}, /*#__PURE__*/_react.default.createElement(_FormContext.FormValueProvider, {
|
|
188
199
|
value: formValue
|
|
189
|
-
},
|
|
200
|
+
}, formChild)));
|
|
190
201
|
}, Subcomponents);
|
|
191
202
|
Form.displayName = 'Form';
|
|
192
203
|
var _default = exports.default = Form;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Input from '../Input';
|
|
3
|
+
import { BoxProps } from '../internals/Box';
|
|
3
4
|
import type { CheckType } from 'schema-typed';
|
|
4
|
-
import type { PlacementCorners, FormControlBaseProps,
|
|
5
|
+
import type { PlacementCorners, FormControlBaseProps, CheckTriggerType } from '../internals/types';
|
|
5
6
|
/**
|
|
6
7
|
* Props that FormControl passes to its accepter
|
|
7
8
|
*/
|
|
8
9
|
export type FormControlAccepterProps<ValueType = any> = FormControlBaseProps<ValueType>;
|
|
9
|
-
export interface FormControlProps<ValueType = any> extends
|
|
10
|
+
export interface FormControlProps<ValueType = any> extends BoxProps, Omit<React.HTMLAttributes<HTMLFormElement>, 'value' | 'onChange'> {
|
|
10
11
|
/** Proxied components */
|
|
11
12
|
accepter?: React.ElementType;
|
|
12
13
|
/**
|
|
@@ -12,6 +12,7 @@ var _FormContext = _interopRequireWildcard(require("../Form/FormContext"));
|
|
|
12
12
|
var _useRegisterModel = _interopRequireDefault(require("./hooks/useRegisterModel"));
|
|
13
13
|
var _useField = _interopRequireDefault(require("./hooks/useField"));
|
|
14
14
|
var _Toggle = _interopRequireDefault(require("../Toggle"));
|
|
15
|
+
var _Box = _interopRequireDefault(require("../internals/Box"));
|
|
15
16
|
var _utils = require("../internals/utils");
|
|
16
17
|
var _hooks = require("../internals/hooks");
|
|
17
18
|
var _FormGroup = require("../FormGroup");
|
|
@@ -45,7 +46,7 @@ const FormControl = (0, _utils.forwardRef)((props, ref) => {
|
|
|
45
46
|
checkFieldAsyncForNextValue
|
|
46
47
|
} = (0, _react.useContext)(_FormContext.default);
|
|
47
48
|
const {
|
|
48
|
-
as
|
|
49
|
+
as,
|
|
49
50
|
accepter: AccepterComponent = _Input.default,
|
|
50
51
|
classPrefix = 'form-control',
|
|
51
52
|
checkAsync,
|
|
@@ -133,7 +134,8 @@ const FormControl = (0, _utils.forwardRef)((props, ref) => {
|
|
|
133
134
|
// need to distinguish between undefined and null
|
|
134
135
|
[valueKey]: fieldValue === undefined ? defaultValue : fieldValue
|
|
135
136
|
};
|
|
136
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
137
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
138
|
+
as: as,
|
|
137
139
|
className: classes,
|
|
138
140
|
ref: ref,
|
|
139
141
|
"data-testid": "form-control-wrapper"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
export interface FormControlLabelProps extends
|
|
2
|
+
import { BoxProps } from '../internals/Box';
|
|
3
|
+
export interface FormControlLabelProps extends BoxProps, React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
4
4
|
/** Attribute of the html label tag, defaults to the controlId of the FormGroup */
|
|
5
5
|
htmlFor?: string;
|
|
6
6
|
}
|
|
@@ -6,6 +6,7 @@ exports.__esModule = true;
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Box = _interopRequireDefault(require("../internals/Box"));
|
|
9
10
|
var _hooks = require("../internals/hooks");
|
|
10
11
|
var _utils = require("../internals/utils");
|
|
11
12
|
var _CustomProvider = require("../CustomProvider");
|
|
@@ -23,7 +24,7 @@ const FormControlLabel = (0, _utils.forwardRef)((props, ref) => {
|
|
|
23
24
|
controlId
|
|
24
25
|
} = (0, _FormGroup.useFormGroup)();
|
|
25
26
|
const {
|
|
26
|
-
as
|
|
27
|
+
as = 'label',
|
|
27
28
|
classPrefix = 'form-control-label',
|
|
28
29
|
htmlFor = controlId,
|
|
29
30
|
className,
|
|
@@ -35,7 +36,8 @@ const FormControlLabel = (0, _utils.forwardRef)((props, ref) => {
|
|
|
35
36
|
merge
|
|
36
37
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
37
38
|
const classes = merge(className, withPrefix());
|
|
38
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
40
|
+
as: as,
|
|
39
41
|
id: id,
|
|
40
42
|
htmlFor: htmlFor
|
|
41
43
|
}, rest, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { BoxProps } from '../internals/Box';
|
|
2
|
+
import type { PlacementCorners } from '../internals/types';
|
|
3
|
+
export interface FormErrorMessageProps extends BoxProps {
|
|
3
4
|
/** Show error messages */
|
|
4
5
|
show?: boolean;
|
|
5
6
|
/** The placement of error messages */
|
|
@@ -6,6 +6,7 @@ exports.__esModule = true;
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Box = _interopRequireDefault(require("../internals/Box"));
|
|
9
10
|
var _hooks = require("../internals/hooks");
|
|
10
11
|
var _utils = require("../internals/utils");
|
|
11
12
|
var _CustomProvider = require("../CustomProvider");
|
|
@@ -18,7 +19,7 @@ const FormErrorMessage = (0, _utils.forwardRef)((props, ref) => {
|
|
|
18
19
|
propsWithDefaults
|
|
19
20
|
} = (0, _CustomProvider.useCustom)('FormErrorMessage', props);
|
|
20
21
|
const {
|
|
21
|
-
as
|
|
22
|
+
as,
|
|
22
23
|
classPrefix = 'form-error-message',
|
|
23
24
|
className,
|
|
24
25
|
show,
|
|
@@ -33,7 +34,8 @@ const FormErrorMessage = (0, _utils.forwardRef)((props, ref) => {
|
|
|
33
34
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
34
35
|
const classes = withPrefix('show');
|
|
35
36
|
const wrapperClasses = merge(className, prefix('wrapper'));
|
|
36
|
-
return show ? /*#__PURE__*/_react.default.createElement(
|
|
37
|
+
return show ? /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
38
|
+
as: as,
|
|
37
39
|
ref: ref,
|
|
38
40
|
"data-placement": (0, _utils.kebabPlace)(placement),
|
|
39
41
|
className: wrapperClasses
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export interface FormGroupProps extends
|
|
1
|
+
import { BoxProps } from '../internals/Box';
|
|
2
|
+
export interface FormGroupProps extends BoxProps {
|
|
3
3
|
/**
|
|
4
4
|
* Sets id on `<Form.Control>` and `htmlFor` on `<Form.ControlLabel>`.
|
|
5
5
|
* And generate ʻaria-labelledby` and ʻaria-describedby` for `<Form.Control>`.
|
|
@@ -6,6 +6,7 @@ exports.__esModule = true;
|
|
|
6
6
|
exports.useFormGroup = exports.default = void 0;
|
|
7
7
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _Box = _interopRequireDefault(require("../internals/Box"));
|
|
9
10
|
var _utils = require("../internals/utils");
|
|
10
11
|
var _hooks = require("../internals/hooks");
|
|
11
12
|
var _CustomProvider = require("../CustomProvider");
|
|
@@ -49,7 +50,7 @@ const FormGroup = (0, _utils.forwardRef)((props, ref) => {
|
|
|
49
50
|
propsWithDefaults
|
|
50
51
|
} = (0, _CustomProvider.useCustom)('FormGroup', props);
|
|
51
52
|
const {
|
|
52
|
-
as
|
|
53
|
+
as,
|
|
53
54
|
classPrefix = 'form-group',
|
|
54
55
|
controlId: controlIdProp,
|
|
55
56
|
className,
|
|
@@ -66,7 +67,9 @@ const FormGroup = (0, _utils.forwardRef)((props, ref) => {
|
|
|
66
67
|
}), [controlId]);
|
|
67
68
|
return /*#__PURE__*/_react.default.createElement(FormGroupContext.Provider, {
|
|
68
69
|
value: contextValue
|
|
69
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
70
|
+
}, /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
71
|
+
as: as
|
|
72
|
+
}, rest, {
|
|
70
73
|
ref: ref,
|
|
71
74
|
className: classes,
|
|
72
75
|
role: "group"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
export interface FormHelpTextProps extends
|
|
2
|
+
import { BoxProps } from '../internals/Box';
|
|
3
|
+
export interface FormHelpTextProps extends BoxProps, React.HTMLAttributes<HTMLSpanElement> {
|
|
4
4
|
/** Whether to show through the Tooltip component */
|
|
5
5
|
tooltip?: boolean;
|
|
6
6
|
}
|
|
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _HelpOutline = _interopRequireDefault(require("@rsuite/icons/HelpOutline"));
|
|
10
10
|
var _Tooltip = _interopRequireDefault(require("../Tooltip"));
|
|
11
11
|
var _Whisper = _interopRequireDefault(require("../Whisper"));
|
|
12
|
+
var _Box = _interopRequireDefault(require("../internals/Box"));
|
|
12
13
|
var _utils = require("../internals/utils");
|
|
13
14
|
var _hooks = require("../internals/hooks");
|
|
14
15
|
var _FormGroup = require("../FormGroup");
|
|
@@ -25,7 +26,7 @@ const FormHelpText = (0, _utils.forwardRef)((props, ref) => {
|
|
|
25
26
|
propsWithDefaults
|
|
26
27
|
} = (0, _CustomProvider.useCustom)('FormHelpText', props);
|
|
27
28
|
const {
|
|
28
|
-
as
|
|
29
|
+
as = 'span',
|
|
29
30
|
classPrefix = 'form-help-text',
|
|
30
31
|
className,
|
|
31
32
|
tooltip,
|
|
@@ -47,7 +48,8 @@ const FormHelpText = (0, _utils.forwardRef)((props, ref) => {
|
|
|
47
48
|
speaker: /*#__PURE__*/_react.default.createElement(_Tooltip.default, (0, _extends2.default)({
|
|
48
49
|
id: id
|
|
49
50
|
}, rest), children)
|
|
50
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
52
|
+
as: as,
|
|
51
53
|
role: "img",
|
|
52
54
|
"aria-label": "help",
|
|
53
55
|
className: classes
|
|
@@ -55,7 +57,8 @@ const FormHelpText = (0, _utils.forwardRef)((props, ref) => {
|
|
|
55
57
|
"aria-hidden": true
|
|
56
58
|
})));
|
|
57
59
|
}
|
|
58
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
61
|
+
as: as,
|
|
59
62
|
id: id
|
|
60
63
|
}, rest, {
|
|
61
64
|
ref: ref,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BoxProps } from '../internals/Box';
|
|
2
|
+
export interface FormStackProps extends BoxProps {
|
|
3
|
+
/**
|
|
4
|
+
* Set the layout of the elements within the form.
|
|
5
|
+
* 'horizontal': Left and right columns layout.
|
|
6
|
+
* 'vertical': Top and bottom layout.
|
|
7
|
+
* 'inline': Elements are placed inline.
|
|
8
|
+
*/
|
|
9
|
+
layout?: 'horizontal' | 'vertical' | 'inline';
|
|
10
|
+
/**
|
|
11
|
+
* The fluid property allows the form elements to fill 100% of the container width.
|
|
12
|
+
* Only valid in vertical layouts.
|
|
13
|
+
*/
|
|
14
|
+
fluid?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Define the spacing between immediate children.
|
|
17
|
+
* Can be a number, string, or an array of numbers/strings for responsive spacing.
|
|
18
|
+
*/
|
|
19
|
+
spacing?: number | string | (number | string)[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The `<Form.Stack>` component is a quick layout component through Flexbox,
|
|
23
|
+
* supporting vertical and horizontal stacking, custom spacing and line wrapping.
|
|
24
|
+
* @see https://rsuitejs.com/components/form/
|
|
25
|
+
*/
|
|
26
|
+
declare const FormStack: import("../internals/types").InternalRefForwardingComponent<"span", FormStackProps, never> & Record<string, never>;
|
|
27
|
+
export default FormStack;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Box = _interopRequireDefault(require("../internals/Box"));
|
|
10
|
+
var _utils = require("../internals/utils");
|
|
11
|
+
var _hooks = require("../internals/hooks");
|
|
12
|
+
var _CustomProvider = require("../CustomProvider");
|
|
13
|
+
/**
|
|
14
|
+
* The `<Form.Stack>` component is a quick layout component through Flexbox,
|
|
15
|
+
* supporting vertical and horizontal stacking, custom spacing and line wrapping.
|
|
16
|
+
* @see https://rsuitejs.com/components/form/
|
|
17
|
+
*/
|
|
18
|
+
const FormStack = (0, _utils.forwardRef)((props, ref) => {
|
|
19
|
+
const {
|
|
20
|
+
propsWithDefaults
|
|
21
|
+
} = (0, _CustomProvider.useCustom)('FormStack', props);
|
|
22
|
+
const {
|
|
23
|
+
as,
|
|
24
|
+
classPrefix = 'form-stack',
|
|
25
|
+
className,
|
|
26
|
+
children,
|
|
27
|
+
layout = 'vertical',
|
|
28
|
+
fluid,
|
|
29
|
+
spacing,
|
|
30
|
+
style,
|
|
31
|
+
...rest
|
|
32
|
+
} = propsWithDefaults;
|
|
33
|
+
const {
|
|
34
|
+
withPrefix,
|
|
35
|
+
merge,
|
|
36
|
+
cssVar
|
|
37
|
+
} = (0, _hooks.useStyles)(classPrefix);
|
|
38
|
+
const classes = merge(className, withPrefix(layout, {
|
|
39
|
+
fluid
|
|
40
|
+
}));
|
|
41
|
+
const styles = (0, _utils.mergeStyles)(style, cssVar('spacing', spacing, _utils.getCssValue));
|
|
42
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
43
|
+
as: as,
|
|
44
|
+
ref: ref,
|
|
45
|
+
style: styles,
|
|
46
|
+
className: classes
|
|
47
|
+
}, rest), children);
|
|
48
|
+
});
|
|
49
|
+
FormStack.displayName = 'FormStack';
|
|
50
|
+
var _default = exports.default = FormStack;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _FormStack = _interopRequireDefault(require("./FormStack"));
|
|
8
|
+
exports.FormStack = _FormStack.default;
|
|
9
|
+
// export types
|
|
10
|
+
// export components
|
|
11
|
+
var _default = exports.default = _FormStack.default;
|
package/cjs/Schema/Schema.js
CHANGED
|
File without changes
|
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -212,6 +212,12 @@ Object.keys(_Form).forEach(function (key) {
|
|
|
212
212
|
if (key in exports && exports[key] === _Form[key]) return;
|
|
213
213
|
exports[key] = _Form[key];
|
|
214
214
|
});
|
|
215
|
+
var _FormStack = require("./FormStack");
|
|
216
|
+
Object.keys(_FormStack).forEach(function (key) {
|
|
217
|
+
if (key === "default" || key === "__esModule") return;
|
|
218
|
+
if (key in exports && exports[key] === _FormStack[key]) return;
|
|
219
|
+
exports[key] = _FormStack[key];
|
|
220
|
+
});
|
|
215
221
|
var _FormGroup = require("./FormGroup");
|
|
216
222
|
Object.keys(_FormGroup).forEach(function (key) {
|
|
217
223
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -3858,9 +3858,6 @@ label:hover .rs-checkbox-control .rs-checkbox-inner::before {
|
|
|
3858
3858
|
.rs-content {
|
|
3859
3859
|
flex: 1 1 auto;
|
|
3860
3860
|
}
|
|
3861
|
-
.rs-form-plaintext .rs-form-control-label {
|
|
3862
|
-
color: var(--rs-text-secondary);
|
|
3863
|
-
}
|
|
3864
3861
|
.rs-picker-toolbar {
|
|
3865
3862
|
padding: 10px;
|
|
3866
3863
|
border-top: 1px solid var(--rs-divider-border);
|
|
@@ -4954,31 +4951,72 @@ label:hover .rs-checkbox-control .rs-checkbox-inner::before {
|
|
|
4954
4951
|
.rs-footer {
|
|
4955
4952
|
flex: 0 0 auto;
|
|
4956
4953
|
}
|
|
4957
|
-
.rs-form {
|
|
4958
|
-
--rs-form-
|
|
4959
|
-
--rs-form-spacing: calc(var(--rs-spacing) * 4);
|
|
4960
|
-
--rs-form-group-spacing: var(--rs-spacing);
|
|
4961
|
-
--rs-form-group-direction: column;
|
|
4954
|
+
.rs-form-stack {
|
|
4955
|
+
--rs-form-stack-dir: column;
|
|
4956
|
+
--rs-form-stack-spacing: calc(var(--rs-spacing) * 4);
|
|
4962
4957
|
display: flex;
|
|
4963
|
-
flex-direction: var(--rs-form-
|
|
4964
|
-
gap: var(--rs-form-spacing);
|
|
4958
|
+
flex-direction: var(--rs-form-stack-dir);
|
|
4959
|
+
gap: var(--rs-form-stack-spacing);
|
|
4965
4960
|
align-items: flex-start;
|
|
4966
4961
|
}
|
|
4967
|
-
.rs-form-inline {
|
|
4968
|
-
--rs-form-
|
|
4962
|
+
.rs-form-stack-inline {
|
|
4963
|
+
--rs-form-stack-dir: row;
|
|
4964
|
+
}
|
|
4965
|
+
.rs-form-group {
|
|
4966
|
+
position: relative;
|
|
4967
|
+
display: flex;
|
|
4968
|
+
flex-direction: var(--rs-form-group-direction);
|
|
4969
|
+
gap: var(--rs-form-group-spacing);
|
|
4970
|
+
}
|
|
4971
|
+
.rs-form-group .rs-input {
|
|
4972
|
+
display: inline-block;
|
|
4973
|
+
}
|
|
4974
|
+
.rs-form-group textarea.rs-input {
|
|
4975
|
+
vertical-align: bottom;
|
|
4976
|
+
}
|
|
4977
|
+
.rs-form-stack-vertical .rs-form-group .rs-form-control-label {
|
|
4978
|
+
display: block;
|
|
4979
|
+
}
|
|
4980
|
+
.rs-form-stack {
|
|
4981
|
+
--rs-form-group-spacing: var(--rs-spacing);
|
|
4982
|
+
--rs-form-group-direction: column;
|
|
4983
|
+
}
|
|
4984
|
+
.rs-form-stack-horizontal {
|
|
4985
|
+
--rs-form-control-label-width: 170px;
|
|
4986
|
+
--rs-form-group-spacing: calc(var(--rs-spacing) * 3);
|
|
4987
|
+
--rs-form-group-direction: row;
|
|
4969
4988
|
}
|
|
4970
|
-
.rs-form-
|
|
4989
|
+
.rs-form-stack-horizontal .rs-form-group {
|
|
4990
|
+
align-items: baseline;
|
|
4991
|
+
}
|
|
4992
|
+
.rs-form-stack-horizontal .rs-form-group .rs-form-control-label {
|
|
4993
|
+
display: inline-block;
|
|
4994
|
+
font-size: var(--rs-font-size-sm);
|
|
4995
|
+
width: var(--rs-form-control-label-width);
|
|
4996
|
+
text-align: end;
|
|
4997
|
+
}
|
|
4998
|
+
.rs-form-stack-horizontal .rs-form-group .rs-btn-toolbar {
|
|
4999
|
+
padding-inline-start: calc(var(--rs-form-control-label-width) + var(--rs-form-group-spacing));
|
|
5000
|
+
}
|
|
5001
|
+
.rs-form-stack-inline {
|
|
5002
|
+
--rs-form-group-direction: row;
|
|
5003
|
+
--rs-form-group-spacing: calc(var(--rs-spacing) * 3);
|
|
5004
|
+
}
|
|
5005
|
+
.rs-form-stack-inline .rs-form-group {
|
|
5006
|
+
align-items: center;
|
|
5007
|
+
}
|
|
5008
|
+
.rs-form-stack-fluid .rs-form-group {
|
|
4971
5009
|
width: 100%;
|
|
4972
5010
|
}
|
|
4973
|
-
.rs-form-fluid .rs-form-control-wrapper
|
|
4974
|
-
.rs-form-fluid .rs-form-control-wrapper > .rs-input {
|
|
5011
|
+
.rs-form-stack-fluid .rs-form-control-wrapper {
|
|
4975
5012
|
width: 100%;
|
|
4976
5013
|
}
|
|
4977
|
-
.rs-form-fluid.rs-form-
|
|
5014
|
+
.rs-form-stack-fluid .rs-form-control-wrapper > .rs-input-number,
|
|
5015
|
+
.rs-form-stack-fluid .rs-form-control-wrapper > .rs-input {
|
|
4978
5016
|
width: 100%;
|
|
4979
5017
|
}
|
|
4980
|
-
.rs-form-fluid.rs-form-vertical .rs-form-group .rs-
|
|
4981
|
-
|
|
5018
|
+
.rs-form-stack-fluid.rs-form-stack-vertical .rs-form-group .rs-input-group {
|
|
5019
|
+
width: 100%;
|
|
4982
5020
|
}
|
|
4983
5021
|
.rs-form-control-wrapper {
|
|
4984
5022
|
position: relative;
|
|
@@ -4991,24 +5029,22 @@ label:hover .rs-checkbox-control .rs-checkbox-inner::before {
|
|
|
4991
5029
|
pointer-events: none;
|
|
4992
5030
|
touch-action: none;
|
|
4993
5031
|
}
|
|
4994
|
-
.rs-form-vertical .rs-form-group .rs-input-group {
|
|
5032
|
+
.rs-form-stack-vertical .rs-form-group .rs-input-group {
|
|
4995
5033
|
width: 300px;
|
|
4996
5034
|
}
|
|
4997
|
-
.rs-form-vertical .rs-form-group .rs-form-control-wrapper {
|
|
5035
|
+
.rs-form-stack-vertical .rs-form-group .rs-form-control-wrapper {
|
|
4998
5036
|
display: inline-block;
|
|
4999
|
-
max-width: -moz-max-content;
|
|
5000
|
-
max-width: max-content;
|
|
5001
5037
|
}
|
|
5002
|
-
.rs-form-horizontal .rs-form-group .rs-form-control-wrapper {
|
|
5038
|
+
.rs-form-stack-horizontal .rs-form-group .rs-form-control-wrapper {
|
|
5003
5039
|
float: inline-start;
|
|
5004
5040
|
}
|
|
5005
|
-
.rs-form-horizontal .rs-form-group .rs-form-control-wrapper + .rs-form-help-text {
|
|
5041
|
+
.rs-form-stack-horizontal .rs-form-group .rs-form-control-wrapper + .rs-form-help-text {
|
|
5006
5042
|
clear: both;
|
|
5007
5043
|
}
|
|
5008
|
-
.rs-form-inline .rs-form-group .rs-form-control-wrapper {
|
|
5044
|
+
.rs-form-stack-inline .rs-form-group .rs-form-control-wrapper {
|
|
5009
5045
|
display: inline-block;
|
|
5010
5046
|
}
|
|
5011
|
-
.rs-form-inline .rs-form-group .rs-sr-only + .rs-form-control-wrapper {
|
|
5047
|
+
.rs-form-stack-inline .rs-form-group .rs-sr-only + .rs-form-control-wrapper {
|
|
5012
5048
|
margin-inline-start: 0;
|
|
5013
5049
|
}
|
|
5014
5050
|
.rs-input-group > .rs-form-control > .rs-input {
|
|
@@ -5016,45 +5052,8 @@ label:hover .rs-checkbox-control .rs-checkbox-inner::before {
|
|
|
5016
5052
|
border: none;
|
|
5017
5053
|
outline: none;
|
|
5018
5054
|
}
|
|
5019
|
-
.rs-form-
|
|
5020
|
-
|
|
5021
|
-
display: flex;
|
|
5022
|
-
flex-direction: var(--rs-form-group-direction);
|
|
5023
|
-
gap: var(--rs-form-group-spacing);
|
|
5024
|
-
}
|
|
5025
|
-
.rs-form-group .rs-input {
|
|
5026
|
-
display: inline-block;
|
|
5027
|
-
}
|
|
5028
|
-
.rs-form-group textarea.rs-input {
|
|
5029
|
-
vertical-align: bottom;
|
|
5030
|
-
}
|
|
5031
|
-
.rs-form-vertical .rs-form-group .rs-form-control-label {
|
|
5032
|
-
display: block;
|
|
5033
|
-
}
|
|
5034
|
-
.rs-form-horizontal {
|
|
5035
|
-
--rs-form-control-label-width: 170px;
|
|
5036
|
-
--rs-form-group-spacing: calc(var(--rs-spacing) * 3);
|
|
5037
|
-
--rs-form-group-direction: row;
|
|
5038
|
-
}
|
|
5039
|
-
.rs-form-horizontal .rs-form-group {
|
|
5040
|
-
align-items: baseline;
|
|
5041
|
-
}
|
|
5042
|
-
.rs-form-horizontal .rs-form-group .rs-form-control-label {
|
|
5043
|
-
display: inline-block;
|
|
5044
|
-
font-size: var(--rs-font-size-sm);
|
|
5045
|
-
width: var(--rs-form-control-label-width);
|
|
5046
|
-
text-align: end;
|
|
5047
|
-
}
|
|
5048
|
-
.rs-form-horizontal .rs-form-group .rs-btn-toolbar {
|
|
5049
|
-
padding-inline-start: calc(var(--rs-form-control-label-width) + var(--rs-form-group-spacing));
|
|
5050
|
-
}
|
|
5051
|
-
.rs-form-inline {
|
|
5052
|
-
--rs-form-spacing: calc(var(--rs-spacing) * 4);
|
|
5053
|
-
--rs-form-group-direction: row;
|
|
5054
|
-
--rs-form-group-spacing: calc(var(--rs-spacing) * 3);
|
|
5055
|
-
}
|
|
5056
|
-
.rs-form-inline .rs-form-group {
|
|
5057
|
-
align-items: center;
|
|
5055
|
+
[data-rs='form'][data-plaintext='true'] .rs-form-control-label {
|
|
5056
|
+
color: var(--rs-text-secondary);
|
|
5058
5057
|
}
|
|
5059
5058
|
@keyframes errorMessageSlideUpIn {
|
|
5060
5059
|
0% {
|
|
@@ -5239,6 +5238,18 @@ label:hover .rs-checkbox-control .rs-checkbox-inner::before {
|
|
|
5239
5238
|
.rs-form-error-message-wrapper:where([data-placement='left-end'], [data-placement='right-end']) .rs-form-error-message-arrow::after {
|
|
5240
5239
|
bottom: 4px;
|
|
5241
5240
|
}
|
|
5241
|
+
.rs-form-help-text {
|
|
5242
|
+
display: block;
|
|
5243
|
+
color: var(--rs-text-secondary);
|
|
5244
|
+
min-height: 20px;
|
|
5245
|
+
line-height: 1.66666667;
|
|
5246
|
+
font-size: var(--rs-font-size-xs);
|
|
5247
|
+
}
|
|
5248
|
+
.rs-form-help-text-tooltip {
|
|
5249
|
+
display: inline-flex;
|
|
5250
|
+
align-items: center;
|
|
5251
|
+
font-size: var(--rs-font-size-md);
|
|
5252
|
+
}
|
|
5242
5253
|
:root {
|
|
5243
5254
|
--rs-grid-gutter: calc(var(--rs-spacing) * 3);
|
|
5244
5255
|
--rs-row-gutter: calc(var(--rs-grid-gutter) / -2);
|
|
@@ -7818,18 +7829,6 @@ label:hover .rs-checkbox-control .rs-checkbox-inner::before {
|
|
|
7818
7829
|
.rs-header {
|
|
7819
7830
|
flex: 0 0 auto;
|
|
7820
7831
|
}
|
|
7821
|
-
.rs-form-help-text {
|
|
7822
|
-
display: block;
|
|
7823
|
-
color: var(--rs-text-secondary);
|
|
7824
|
-
min-height: 20px;
|
|
7825
|
-
line-height: 1.66666667;
|
|
7826
|
-
font-size: var(--rs-font-size-xs);
|
|
7827
|
-
}
|
|
7828
|
-
.rs-form-help-text-tooltip {
|
|
7829
|
-
display: inline-flex;
|
|
7830
|
-
align-items: center;
|
|
7831
|
-
font-size: var(--rs-font-size-md);
|
|
7832
|
-
}
|
|
7833
7832
|
.rs-btn-icon {
|
|
7834
7833
|
padding: calc((var(--rs-btn-size) - var(--rs-btn-icon-size)) / 2);
|
|
7835
7834
|
line-height: var(--rs-btn-icon-size);
|
|
@@ -14545,7 +14544,7 @@ kbd.rs-text {
|
|
|
14545
14544
|
}
|
|
14546
14545
|
.rs-picker-label.rs-input-group-addon {
|
|
14547
14546
|
color: var(--rs-text-primary);
|
|
14548
|
-
padding-inline
|
|
14547
|
+
padding-inline: calc(var(--rs-input-group-inside-btn-padding) * 2 - var(--rs-picker-toggle-border-width));
|
|
14549
14548
|
}
|
|
14550
14549
|
.rs-picker-loader {
|
|
14551
14550
|
width: var(--rs-picker-loader-size);
|