revdev-components 0.227.0 → 0.228.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
|
|
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<
|
|
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
|
-
|
|
5
|
-
|
|
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 {};
|
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(
|
|
5418
|
-
|
|
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) {
|
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;
|