revdev-components 0.275.0 → 0.276.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,10 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DatePickerProps } from "antd";
|
|
3
3
|
import { FormLineProps } from "../line";
|
|
4
|
-
interface ControlProps extends Omit<DatePickerProps, "value" | "onChange" | "format"> {
|
|
4
|
+
interface ControlProps extends Omit<DatePickerProps, "value" | "onChange" | "format" | "minDate" | "maxDate"> {
|
|
5
5
|
format: string;
|
|
6
6
|
value?: string;
|
|
7
7
|
onChange?: (value?: string) => void;
|
|
8
|
+
minDate?: Date;
|
|
9
|
+
maxDate?: Date;
|
|
8
10
|
}
|
|
9
11
|
interface Props extends FormLineProps, Omit<ControlProps, "name" | "value" | "onChange"> {
|
|
10
12
|
}
|
package/build/index.js
CHANGED
|
@@ -5444,7 +5444,7 @@ var FormLine = function (_a) {
|
|
|
5444
5444
|
};
|
|
5445
5445
|
|
|
5446
5446
|
var Control = function (_a) {
|
|
5447
|
-
var value = _a.value, format = _a.format, onChange = _a.onChange, props = __rest(_a, ["value", "format", "onChange"]);
|
|
5447
|
+
var value = _a.value, format = _a.format, onChange = _a.onChange, minDate = _a.minDate, maxDate = _a.maxDate, props = __rest(_a, ["value", "format", "onChange", "minDate", "maxDate"]);
|
|
5448
5448
|
var handleChange = React.useCallback(function (date) {
|
|
5449
5449
|
if (typeof date === "string") {
|
|
5450
5450
|
onChange === null || onChange === void 0 ? void 0 : onChange(date);
|
|
@@ -5463,7 +5463,7 @@ var Control = function (_a) {
|
|
|
5463
5463
|
}
|
|
5464
5464
|
return null;
|
|
5465
5465
|
}, [value, format]);
|
|
5466
|
-
return React.createElement(antd.DatePicker, __assign({ value: currentValue, onChange: handleChange, format: format }, props));
|
|
5466
|
+
return (React.createElement(antd.DatePicker, __assign({ value: currentValue, onChange: handleChange, format: format }, props, { minDate: minDate ? dayjs(minDate) : undefined, maxDate: maxDate ? dayjs(maxDate) : undefined })));
|
|
5467
5467
|
};
|
|
5468
5468
|
var DatePickerField = function (props) {
|
|
5469
5469
|
var _a = useLineProps(props), lineProps = _a[0], controlProps = _a[1];
|