@lobehub/ui 1.155.0 → 1.155.2
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/es/Form/components/FormDivider.js +2 -0
- package/es/Form/components/FormFooter.js +2 -0
- package/es/Form/components/FormGroup.js +2 -0
- package/es/Form/components/FormItem.js +2 -0
- package/es/Form/components/FormTitle.js +2 -0
- package/es/Form/index.d.ts +1 -0
- package/es/Form/index.js +2 -2
- package/es/FormModal/index.d.ts +4 -3
- package/es/FormModal/index.js +7 -4
- package/es/components.d.ts +1 -1
- package/package.json +1 -1
- package/es/Form/components/FormInput.d.ts +0 -0
- package/es/Form/components/FormInput.js +0 -0
package/es/Form/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface FormProps extends Omit<AntFormProps, 'variant'> {
|
|
|
19
19
|
itemsType?: ItemsType;
|
|
20
20
|
variant?: FormVariant;
|
|
21
21
|
}
|
|
22
|
+
export type { FormInstance } from 'antd';
|
|
22
23
|
export interface IForm {
|
|
23
24
|
(props: FormProps & RefAttributes<FormInstance>): ReactNode;
|
|
24
25
|
Group: typeof FormGroup;
|
package/es/Form/index.js
CHANGED
|
@@ -61,7 +61,7 @@ var FormParent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
61
61
|
gap: gap
|
|
62
62
|
}, style)
|
|
63
63
|
}, rest), {}, {
|
|
64
|
-
children: [(items === null || items === void 0 ? void 0 : items.length) > 0 ? itemsType === 'group' ? items === null || items === void 0 ? void 0 : items.map(function (item, i) {
|
|
64
|
+
children: [items && (items === null || items === void 0 ? void 0 : items.length) > 0 ? itemsType === 'group' ? items === null || items === void 0 ? void 0 : items.map(function (item, i) {
|
|
65
65
|
return mapTree(item, i);
|
|
66
66
|
}) : /*#__PURE__*/_jsx(FormGroup, {
|
|
67
67
|
itemsType: 'flat',
|
|
@@ -71,7 +71,7 @@ var FormParent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
71
71
|
}).map(function (item, i) {
|
|
72
72
|
return mapFlat(item, i);
|
|
73
73
|
})
|
|
74
|
-
}) :
|
|
74
|
+
}) : undefined, children, footer && /*#__PURE__*/_jsx(FormFooter, {
|
|
75
75
|
children: footer
|
|
76
76
|
})]
|
|
77
77
|
}));
|
package/es/FormModal/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { FormInstance } from
|
|
3
|
-
import { type FormProps } from "../Form";
|
|
2
|
+
import { type FormInstance, type FormProps } from "../Form";
|
|
4
3
|
import { type ModalProps } from "../Modal";
|
|
5
|
-
|
|
4
|
+
type PickModalProps = Pick<ModalProps, 'style' | 'className' | 'allowFullscreen' | 'title' | 'wrapClassName' | 'width' | 'onCancel' | 'open' | 'centered' | 'destroyOnClose' | 'paddings' | 'maxHeight' | 'enableResponsive' | 'afterClose' | 'afterOpenChange' | 'zIndex' | 'mask' | 'getContainer' | 'keyboard' | 'forceRender' | 'focusTriggerAfterClose' | 'closable' | 'loading' | 'closeIcon'>;
|
|
5
|
+
type PickFormProps = Omit<FormProps, 'className' | 'style' | 'title'>;
|
|
6
|
+
export interface FormModalProps extends PickModalProps, PickFormProps {
|
|
6
7
|
classNames?: {
|
|
7
8
|
form?: FormProps['className'];
|
|
8
9
|
} & ModalProps['classNames'];
|
package/es/FormModal/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["classNames", "className", "style", "closable", "styles", "children", "allowFullscreen", "title", "wrapClassName", "afterOpenChange", "width", "onCancel", "centered", "open", "afterClose", "destroyOnClose", "closeIcon", "paddings", "maxHeight", "enableResponsive", "zIndex", "mask", "getContainer", "keyboard", "focusTriggerAfterClose", "forceRender", "loading", "footer", "finishButtonProps", "finishLoading", "onFinish", "finishText", "variant", "gap"],
|
|
4
|
-
_excluded2 = ["form"],
|
|
5
|
-
_excluded3 = ["form"];
|
|
4
|
+
_excluded2 = ["form", "footer"],
|
|
5
|
+
_excluded3 = ["form", "footer"];
|
|
6
6
|
import { Button } from 'antd';
|
|
7
7
|
import { useResponsive } from 'antd-style';
|
|
8
8
|
import { forwardRef } from 'react';
|
|
@@ -57,8 +57,10 @@ var FormModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
57
57
|
cx = _useStyles.cx,
|
|
58
58
|
s = _useStyles.styles;
|
|
59
59
|
var formClassName = classNames.form,
|
|
60
|
+
footerClassName = classNames.footer,
|
|
60
61
|
modalClassNames = _objectWithoutProperties(classNames, _excluded2);
|
|
61
62
|
var formStyle = styles.form,
|
|
63
|
+
footerStyle = styles.footer,
|
|
62
64
|
modalStyles = _objectWithoutProperties(styles, _excluded3);
|
|
63
65
|
return /*#__PURE__*/_jsx(Modal, {
|
|
64
66
|
afterClose: afterClose,
|
|
@@ -94,7 +96,7 @@ var FormModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
94
96
|
wrapClassName: wrapClassName,
|
|
95
97
|
zIndex: zIndex,
|
|
96
98
|
children: /*#__PURE__*/_jsxs(Form, _objectSpread(_objectSpread({
|
|
97
|
-
className: cx(
|
|
99
|
+
className: cx(s.form, formClassName),
|
|
98
100
|
clearOnDestroy: destroyOnClose,
|
|
99
101
|
gap: gap || (variant === 'pure' ? 24 : gap),
|
|
100
102
|
onFinish: onFinish,
|
|
@@ -103,9 +105,10 @@ var FormModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
103
105
|
variant: variant
|
|
104
106
|
}, rest), {}, {
|
|
105
107
|
children: [children, /*#__PURE__*/_jsx(Flexbox, {
|
|
106
|
-
className: s.footer,
|
|
108
|
+
className: cx(s.footer, footerClassName),
|
|
107
109
|
gap: 8,
|
|
108
110
|
horizontal: true,
|
|
111
|
+
style: footerStyle,
|
|
109
112
|
width: '100%',
|
|
110
113
|
children: footer || /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
111
114
|
block: true,
|
package/es/components.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export { default as FileTypeIcon, type FileTypeIconProps } from './FileTypeIcon'
|
|
|
21
21
|
export { default as FluentEmoji, type FluentEmojiProps } from './FluentEmoji';
|
|
22
22
|
export { default as FontLoader, type FontLoaderProps } from './FontLoader';
|
|
23
23
|
export { default as Footer, type FooterProps } from './Footer';
|
|
24
|
-
export { default as Form, type FormProps, type ItemGroup } from './Form';
|
|
24
|
+
export { default as Form, type FormInstance, type FormProps, type ItemGroup } from './Form';
|
|
25
25
|
export { default as FormDivider, type FormDividerProps } from './Form/components/FormDivider';
|
|
26
26
|
export { default as FormFooter, type FormFooterProps } from './Form/components/FormFooter';
|
|
27
27
|
export { default as FormGroup, type FormGroupProps } from './Form/components/FormGroup';
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|