@availity/mui-datepicker 0.4.3 → 0.4.4
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.
- package/CHANGELOG.md +7 -0
- package/dist/index.js +8 -6
- package/dist/index.mjs +8 -6
- package/package.json +1 -1
- package/src/lib/Datepicker.tsx +10 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.4.4](https://github.com/Availity/element/compare/@availity/mui-datepicker@0.4.3...@availity/mui-datepicker@0.4.4) (2024-04-22)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **mui-datepicker:** pass FieldProps to TextField correctly ([aba22ea](https://github.com/Availity/element/commit/aba22eae0e4d94a563cf42b9a233631ca8954905))
|
|
11
|
+
|
|
5
12
|
## [0.4.3](https://github.com/Availity/element/compare/@availity/mui-datepicker@0.4.2...@availity/mui-datepicker@0.4.3) (2024-04-19)
|
|
6
13
|
|
|
7
14
|
### Dependency Updates
|
package/dist/index.js
CHANGED
|
@@ -58,6 +58,12 @@ var import_mui_textfield = require("@availity/mui-textfield");
|
|
|
58
58
|
var import_DatePicker = require("@mui/x-date-pickers/DatePicker");
|
|
59
59
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
60
60
|
var paperProps = { elevation: 8, variant: "elevation", sx: { marginTop: "4px" } };
|
|
61
|
+
var PickerTextField = (params) => {
|
|
62
|
+
if (params.inputProps) {
|
|
63
|
+
params.inputProps.placeholder = "MM/DD/YYYY";
|
|
64
|
+
}
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_textfield.TextField, __spreadValues({}, params));
|
|
66
|
+
};
|
|
61
67
|
var Datepicker = (_a) => {
|
|
62
68
|
var _b = _a, { FieldProps, placement = "bottom-start" } = _b, props = __objRest(_b, ["FieldProps", "placement"]);
|
|
63
69
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -66,17 +72,13 @@ var Datepicker = (_a) => {
|
|
|
66
72
|
slotProps: {
|
|
67
73
|
desktopPaper: paperProps,
|
|
68
74
|
mobilePaper: paperProps,
|
|
75
|
+
textField: FieldProps,
|
|
69
76
|
popper: {
|
|
70
77
|
placement
|
|
71
78
|
}
|
|
72
79
|
},
|
|
73
80
|
slots: {
|
|
74
|
-
textField:
|
|
75
|
-
if (params.inputProps) {
|
|
76
|
-
params.inputProps.placeholder = "MM/DD/YYYY";
|
|
77
|
-
}
|
|
78
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_textfield.TextField, __spreadValues(__spreadValues({}, params), FieldProps));
|
|
79
|
-
}
|
|
81
|
+
textField: PickerTextField
|
|
80
82
|
}
|
|
81
83
|
})
|
|
82
84
|
);
|
package/dist/index.mjs
CHANGED
|
@@ -35,6 +35,12 @@ import { TextField } from "@availity/mui-textfield";
|
|
|
35
35
|
import { DatePicker as MuiDatePicker } from "@mui/x-date-pickers/DatePicker";
|
|
36
36
|
import { jsx } from "react/jsx-runtime";
|
|
37
37
|
var paperProps = { elevation: 8, variant: "elevation", sx: { marginTop: "4px" } };
|
|
38
|
+
var PickerTextField = (params) => {
|
|
39
|
+
if (params.inputProps) {
|
|
40
|
+
params.inputProps.placeholder = "MM/DD/YYYY";
|
|
41
|
+
}
|
|
42
|
+
return /* @__PURE__ */ jsx(TextField, __spreadValues({}, params));
|
|
43
|
+
};
|
|
38
44
|
var Datepicker = (_a) => {
|
|
39
45
|
var _b = _a, { FieldProps, placement = "bottom-start" } = _b, props = __objRest(_b, ["FieldProps", "placement"]);
|
|
40
46
|
return /* @__PURE__ */ jsx(
|
|
@@ -43,17 +49,13 @@ var Datepicker = (_a) => {
|
|
|
43
49
|
slotProps: {
|
|
44
50
|
desktopPaper: paperProps,
|
|
45
51
|
mobilePaper: paperProps,
|
|
52
|
+
textField: FieldProps,
|
|
46
53
|
popper: {
|
|
47
54
|
placement
|
|
48
55
|
}
|
|
49
56
|
},
|
|
50
57
|
slots: {
|
|
51
|
-
textField:
|
|
52
|
-
if (params.inputProps) {
|
|
53
|
-
params.inputProps.placeholder = "MM/DD/YYYY";
|
|
54
|
-
}
|
|
55
|
-
return /* @__PURE__ */ jsx(TextField, __spreadValues(__spreadValues({}, params), FieldProps));
|
|
56
|
-
}
|
|
58
|
+
textField: PickerTextField
|
|
57
59
|
}
|
|
58
60
|
})
|
|
59
61
|
);
|
package/package.json
CHANGED
package/src/lib/Datepicker.tsx
CHANGED
|
@@ -36,6 +36,14 @@ export type DatepickerProps = {
|
|
|
36
36
|
|
|
37
37
|
const paperProps = { elevation: 8, variant: 'elevation', sx: { marginTop: '4px' } } as const;
|
|
38
38
|
|
|
39
|
+
const PickerTextField = (params: TextFieldProps) => {
|
|
40
|
+
if (params.inputProps) {
|
|
41
|
+
params.inputProps.placeholder = 'MM/DD/YYYY';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return <TextField {...params} />;
|
|
45
|
+
};
|
|
46
|
+
|
|
39
47
|
export const Datepicker = ({ FieldProps, placement = 'bottom-start', ...props }: DatepickerProps): JSX.Element => {
|
|
40
48
|
return (
|
|
41
49
|
<MuiDatePicker
|
|
@@ -43,18 +51,13 @@ export const Datepicker = ({ FieldProps, placement = 'bottom-start', ...props }:
|
|
|
43
51
|
slotProps={{
|
|
44
52
|
desktopPaper: paperProps,
|
|
45
53
|
mobilePaper: paperProps,
|
|
54
|
+
textField: FieldProps,
|
|
46
55
|
popper: {
|
|
47
56
|
placement,
|
|
48
57
|
},
|
|
49
58
|
}}
|
|
50
59
|
slots={{
|
|
51
|
-
textField:
|
|
52
|
-
if (params.inputProps) {
|
|
53
|
-
params.inputProps.placeholder = 'MM/DD/YYYY';
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return <TextField {...params} {...FieldProps} />;
|
|
57
|
-
},
|
|
60
|
+
textField: PickerTextField,
|
|
58
61
|
}}
|
|
59
62
|
/>
|
|
60
63
|
);
|