revdev-components 0.227.0 → 0.229.0

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.
@@ -1,7 +1,9 @@
1
1
  import React from "react";
2
2
  import { SwitchProps } from "antd";
3
- interface Props extends Omit<SwitchProps, "name"> {
3
+ export interface SwitchFieldControlProps extends Omit<SwitchProps, "name"> {
4
4
  children?: React.ReactNode;
5
+ description?: string;
6
+ titleClassName?: string;
7
+ descriptionClassName?: string;
5
8
  }
6
- export declare const SwitchFieldControl: React.FC<Props>;
7
- export {};
9
+ export declare const SwitchFieldControl: React.FC<SwitchFieldControlProps>;
@@ -1,8 +1,7 @@
1
1
  import React from "react";
2
- import { SwitchProps } from "antd";
3
2
  import { FormLineProps } from "../line";
4
- interface Props extends FormLineProps, Omit<SwitchProps, "name"> {
5
- children?: React.ReactNode;
3
+ import { SwitchFieldControlProps } from "./control";
4
+ interface Props extends FormLineProps, SwitchFieldControlProps {
6
5
  }
7
6
  export declare const SwitchField: React.FC<Props>;
8
7
  export {};
@@ -1,9 +1,11 @@
1
1
  import React from "react";
2
+ import { ButtonType } from "antd/es/button";
2
3
  interface Props {
3
4
  className?: string;
4
5
  children?: React.ReactNode;
5
6
  loading?: boolean;
6
7
  disabled?: boolean;
8
+ type?: ButtonType;
7
9
  }
8
10
  export declare const FormButton: React.FC<Props>;
9
11
  export {};
package/build/index.js CHANGED
@@ -5409,13 +5409,16 @@ var CheckboxField = function (props) {
5409
5409
  React.createElement(antd.Checkbox, __assign({}, controlProps))));
5410
5410
  };
5411
5411
 
5412
- var s$s = {"root":"index-module_root__GGl-p"};
5412
+ var s$s = {"root":"index-module_root__GGl-p","control":"index-module_control__-bnWX","title":"index-module_title__2P0gT"};
5413
5413
 
5414
5414
  var SwitchFieldControl = function (_a) {
5415
- var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
5415
+ var className = _a.className, title = _a.title, titleClassName = _a.titleClassName, children = _a.children, description = _a.description, descriptionClassName = _a.descriptionClassName, props = __rest(_a, ["className", "title", "titleClassName", "children", "description", "descriptionClassName"]);
5416
+ var leftContent = title || children;
5416
5417
  return (React.createElement("div", { className: classNames(s$s.root, className) },
5417
- React.createElement(antd.Switch, __assign({}, props)),
5418
- children && React.createElement("div", { className: s$s.content }, children)));
5418
+ React.createElement("div", { className: s$s.control },
5419
+ React.createElement(antd.Switch, __assign({}, props)),
5420
+ leftContent && React.createElement("div", { className: classNames(titleClassName) }, leftContent)),
5421
+ description && React.createElement("div", { className: classNames(s$s.description, descriptionClassName) }, description)));
5419
5422
  };
5420
5423
 
5421
5424
  var SwitchField = function (props) {
@@ -5452,9 +5455,9 @@ var SwitchButtonField = function (props) {
5452
5455
  var s$r = {"root":"index-module_root__9GQDU"};
5453
5456
 
5454
5457
  var FormButton = function (_a) {
5455
- var className = _a.className, _b = _a.children, children = _b === void 0 ? "Save" : _b, loading = _a.loading, disabled = _a.disabled;
5458
+ var className = _a.className, _b = _a.children, children = _b === void 0 ? "Save" : _b, loading = _a.loading, disabled = _a.disabled, _c = _a.type, type = _c === void 0 ? "primary" : _c;
5456
5459
  return (React.createElement("div", { className: classNames(s$r.root, className) },
5457
- React.createElement(antd.Button, { htmlType: "submit", type: "primary", loading: loading, disabled: disabled }, children)));
5460
+ React.createElement(antd.Button, { htmlType: "submit", type: type, loading: loading, disabled: disabled }, children)));
5458
5461
  };
5459
5462
 
5460
5463
  var s$q = {"root":"index-module_root__C05Ty"};
package/build/styles.css CHANGED
@@ -179,11 +179,21 @@ body {
179
179
  width: 100%;
180
180
  }
181
181
  .index-module_root__GGl-p {
182
+ display: flex;
183
+ flex-direction: column;
184
+ gap: 0.5em;
185
+ }
186
+
187
+ .index-module_control__-bnWX {
182
188
  display: flex;
183
189
  flex-direction: row;
184
190
  align-items: center;
185
191
  gap: 0.7em;
186
192
  }
193
+
194
+ .index-module_title__2P0gT {
195
+ font-weight: bold;
196
+ }
187
197
  .index-module_root__9GQDU {
188
198
  padding-top: 16px;
189
199
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdev-components",
3
- "version": "0.227.0",
3
+ "version": "0.229.0",
4
4
  "main": "build/index.js",
5
5
  "module": "build/index.esm.js",
6
6
  "scripts": {