revdev-components 0.274.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
- value?: string | null;
7
- onChange?: (value: string | null) => void;
6
+ value?: string;
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);
@@ -5453,7 +5453,7 @@ var Control = function (_a) {
5453
5453
  onChange === null || onChange === void 0 ? void 0 : onChange(date.format(format));
5454
5454
  }
5455
5455
  else {
5456
- onChange === null || onChange === void 0 ? void 0 : onChange(null);
5456
+ onChange === null || onChange === void 0 ? void 0 : onChange(undefined);
5457
5457
  }
5458
5458
  }, [onChange, format]);
5459
5459
  var currentValue = React.useMemo(function () {
@@ -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];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdev-components",
3
- "version": "0.274.0",
3
+ "version": "0.276.0",
4
4
  "main": "build/index.js",
5
5
  "module": "build/index.esm.js",
6
6
  "scripts": {