@lobehub/ui 1.155.3 → 1.155.5

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.
@@ -2,20 +2,18 @@
2
2
 
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["className", "children"];
5
+ var _excluded = ["children"];
6
6
  import { memo } from 'react';
7
7
  import { Flexbox } from 'react-layout-kit';
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  var FormFooter = /*#__PURE__*/memo(function (_ref) {
10
- var className = _ref.className,
11
- children = _ref.children,
10
+ var children = _ref.children,
12
11
  rest = _objectWithoutProperties(_ref, _excluded);
13
12
  return /*#__PURE__*/_jsx(Flexbox, _objectSpread(_objectSpread({
14
- className: className,
15
13
  gap: 8,
14
+ horizontal: true,
16
15
  justify: 'flex-end'
17
16
  }, rest), {}, {
18
- horizontal: true,
19
17
  children: children
20
18
  }));
21
19
  });
@@ -1,5 +1,5 @@
1
1
  import { Form as AntForm, FormProps as AntFormProps, type FormInstance } from 'antd';
2
- import { type ReactNode, RefAttributes } from 'react';
2
+ import { CSSProperties, type ReactNode, RefAttributes } from 'react';
3
3
  import FormGroup, { type FormGroupProps, FormVariant, ItemsType } from './components/FormGroup';
4
4
  import FormItem, { type FormItemProps } from './components/FormItem';
5
5
  export interface ItemGroup {
@@ -11,12 +11,18 @@ export interface ItemGroup {
11
11
  }
12
12
  export interface FormProps extends Omit<AntFormProps, 'variant'> {
13
13
  children?: ReactNode;
14
+ classNames?: {
15
+ footer?: string;
16
+ };
14
17
  collapsible?: boolean;
15
18
  footer?: ReactNode;
16
19
  gap?: number | string;
17
20
  itemMinWidth?: FormItemProps['minWidth'];
18
21
  items?: ItemGroup[] | FormItemProps[];
19
22
  itemsType?: ItemsType;
23
+ styles?: {
24
+ footer?: CSSProperties;
25
+ };
20
26
  variant?: FormVariant;
21
27
  }
22
28
  export type { FormInstance } from 'antd';
package/es/Form/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["className", "itemMinWidth", "footer", "form", "items", "children", "itemsType", "variant", "gap", "style", "collapsible"];
5
+ var _excluded = ["className", "itemMinWidth", "footer", "form", "items", "children", "itemsType", "variant", "gap", "style", "collapsible", "classNames", "styles"];
6
6
  import { Form as AntForm } from 'antd';
7
7
  import { forwardRef } from 'react';
8
8
  import FormFooter from "./components/FormFooter";
@@ -26,10 +26,14 @@ var FormParent = /*#__PURE__*/forwardRef(function (_ref, ref) {
26
26
  gap = _ref.gap,
27
27
  style = _ref.style,
28
28
  collapsible = _ref.collapsible,
29
+ _ref$classNames = _ref.classNames,
30
+ classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
31
+ _ref$styles = _ref.styles,
32
+ styles = _ref$styles === void 0 ? {} : _ref$styles,
29
33
  rest = _objectWithoutProperties(_ref, _excluded);
30
34
  var _useStyles = useStyles(),
31
35
  cx = _useStyles.cx,
32
- styles = _useStyles.styles;
36
+ s = _useStyles.styles;
33
37
  var mapFlat = function mapFlat(item, itemIndex) {
34
38
  return /*#__PURE__*/_jsx(FormItem, _objectSpread({
35
39
  divider: itemIndex !== 0,
@@ -52,7 +56,7 @@ var FormParent = /*#__PURE__*/forwardRef(function (_ref, ref) {
52
56
  }, groupIndex);
53
57
  };
54
58
  return /*#__PURE__*/_jsxs(AntForm, _objectSpread(_objectSpread({
55
- className: cx(styles.form, variant === 'pure' && styles.pure, styles.mobile, className),
59
+ className: cx(s.form, variant === 'pure' && s.pure, s.mobile, className),
56
60
  colon: false,
57
61
  form: form,
58
62
  layout: 'horizontal',
@@ -72,6 +76,8 @@ var FormParent = /*#__PURE__*/forwardRef(function (_ref, ref) {
72
76
  return mapFlat(item, i);
73
77
  })
74
78
  }) : undefined, children, footer && /*#__PURE__*/_jsx(FormFooter, {
79
+ className: classNames === null || classNames === void 0 ? void 0 : classNames.footer,
80
+ style: styles === null || styles === void 0 ? void 0 : styles.footer,
75
81
  children: footer
76
82
  })]
77
83
  }));
@@ -1,17 +1,15 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
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", "submitButtonProps", "submitLoading", "onFinish", "submitText", "variant", "gap", "onSubmit"],
3
+ var _excluded = ["classNames", "className", "style", "closable", "styles", "allowFullscreen", "title", "wrapClassName", "afterOpenChange", "width", "onCancel", "centered", "open", "afterClose", "destroyOnClose", "closeIcon", "paddings", "maxHeight", "enableResponsive", "zIndex", "mask", "getContainer", "keyboard", "focusTriggerAfterClose", "forceRender", "loading", "footer", "submitButtonProps", "submitLoading", "onFinish", "submitText", "variant", "gap", "onSubmit", "children"],
4
4
  _excluded2 = ["form", "footer"],
5
5
  _excluded3 = ["form", "footer"];
6
6
  import { Button } from 'antd';
7
7
  import { useResponsive } from 'antd-style';
8
8
  import { forwardRef } from 'react';
9
- import { Flexbox } from 'react-layout-kit';
10
9
  import Form from "../Form";
11
10
  import Modal from "../Modal";
12
11
  import { useStyles } from "./style";
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
14
- import { jsxs as _jsxs } from "react/jsx-runtime";
15
13
  var FormModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
16
14
  var _ref$classNames = _ref.classNames,
17
15
  classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
@@ -20,7 +18,6 @@ var FormModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
20
18
  closable = _ref.closable,
21
19
  _ref$styles = _ref.styles,
22
20
  styles = _ref$styles === void 0 ? {} : _ref$styles,
23
- children = _ref.children,
24
21
  allowFullscreen = _ref.allowFullscreen,
25
22
  title = _ref.title,
26
23
  wrapClassName = _ref.wrapClassName,
@@ -51,6 +48,7 @@ var FormModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
51
48
  variant = _ref$variant === void 0 ? 'pure' : _ref$variant,
52
49
  gap = _ref.gap,
53
50
  onSubmit = _ref.onSubmit,
51
+ children = _ref.children,
54
52
  rest = _objectWithoutProperties(_ref, _excluded);
55
53
  var _useResponsive = useResponsive(),
56
54
  mobile = _useResponsive.mobile;
@@ -89,6 +87,7 @@ var FormModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
89
87
  style: style,
90
88
  styles: _objectSpread(_objectSpread({}, modalStyles), {}, {
91
89
  body: _objectSpread({
90
+ paddingBottom: mobile ? 68 : undefined,
92
91
  paddingTop: mobile ? 0 : undefined
93
92
  }, modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.body)
94
93
  }),
@@ -96,34 +95,34 @@ var FormModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
96
95
  width: width,
97
96
  wrapClassName: wrapClassName,
98
97
  zIndex: zIndex,
99
- children: /*#__PURE__*/_jsxs(Form, _objectSpread(_objectSpread({
98
+ children: /*#__PURE__*/_jsx(Form, _objectSpread(_objectSpread({
100
99
  className: cx(s.form, formClassName),
100
+ classNames: {
101
+ footer: cx(s.footer, footerClassName)
102
+ },
101
103
  clearOnDestroy: destroyOnClose,
104
+ footer: footer || /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
105
+ block: true,
106
+ htmlType: "submit",
107
+ loading: submitLoading,
108
+ onClick: onSubmit,
109
+ type: 'primary'
110
+ }, submitButtonProps), {}, {
111
+ style: _objectSpread({
112
+ flex: 1
113
+ }, submitButtonProps === null || submitButtonProps === void 0 ? void 0 : submitButtonProps.style),
114
+ children: submitText || 'Submit'
115
+ })),
102
116
  gap: gap || (variant === 'pure' ? 24 : gap),
103
117
  onFinish: onFinish,
104
118
  ref: ref,
105
119
  style: formStyle,
120
+ styles: {
121
+ footer: footerStyle
122
+ },
106
123
  variant: variant
107
124
  }, rest), {}, {
108
- children: [children, /*#__PURE__*/_jsx(Flexbox, {
109
- className: cx(s.footer, footerClassName),
110
- gap: 8,
111
- horizontal: true,
112
- style: footerStyle,
113
- width: '100%',
114
- children: footer || /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
115
- block: true,
116
- htmlType: "submit",
117
- loading: submitLoading,
118
- onClick: onSubmit,
119
- type: 'primary'
120
- }, submitButtonProps), {}, {
121
- style: _objectSpread({
122
- flex: 1
123
- }, submitButtonProps === null || submitButtonProps === void 0 ? void 0 : submitButtonProps.style),
124
- children: submitText || 'Submit'
125
- }))
126
- })]
125
+ children: children
127
126
  }))
128
127
  });
129
128
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.155.3",
3
+ "version": "1.155.5",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",