sag_components 1.0.144 → 1.0.146

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.
@@ -15,13 +15,49 @@ var _demo = require("@mui/x-date-pickers/internals/demo");
15
15
  * SAG Datepicker
16
16
  */
17
17
  var Datepicker = function Datepicker(_ref) {
18
- var _ref$width = _ref.width,
18
+ var onChange = _ref.onChange,
19
+ shape = _ref.shape,
20
+ _ref$width = _ref.width,
19
21
  width = _ref$width === void 0 ? "100%" : _ref$width,
20
22
  text = _ref.text;
21
23
  /**
22
24
  * SAG Datepicker
23
25
  */
24
-
26
+ var onChangeHandler = function onChangeHandler(event, newValue) {
27
+ onChange({
28
+ syntheticBaseEvent: event,
29
+ newValue: newValue
30
+ });
31
+ };
32
+ var getTextFieldStyle = function getTextFieldStyle() {
33
+ if (shape === "round") {
34
+ // round
35
+ return {
36
+ "& .MuiOutlinedInput-root": {
37
+ borderRadius: "12px",
38
+ legend: {
39
+ marginLeft: "6px"
40
+ }
41
+ },
42
+ "& .MuiAutocomplete-inputRoot": {
43
+ paddingLeft: "10px !important",
44
+ borderRadius: "12px"
45
+ },
46
+ "& .MuiInputLabel-outlined": {
47
+ paddingLeft: "10px"
48
+ },
49
+ "& .MuiInputLabel-shrink": {
50
+ marginLeft: "1px",
51
+ paddingLeft: "4px",
52
+ paddingRight: 0,
53
+ background: "white"
54
+ }
55
+ };
56
+ } else {
57
+ //square
58
+ return null;
59
+ }
60
+ };
25
61
  return /*#__PURE__*/_react.default.createElement(_DatepickerStyle.DatepickerContainer, {
26
62
  width: width
27
63
  }, /*#__PURE__*/_react.default.createElement(_LocalizationProvider.LocalizationProvider, {
@@ -29,6 +65,10 @@ var Datepicker = function Datepicker(_ref) {
29
65
  }, /*#__PURE__*/_react.default.createElement(_demo.DemoContainer, {
30
66
  components: ['DatePicker']
31
67
  }, /*#__PURE__*/_react.default.createElement(_DatePicker.DatePicker, {
68
+ onChange: function onChange(event, newValue) {
69
+ onChangeHandler(event, newValue);
70
+ },
71
+ sx: getTextFieldStyle(),
32
72
  label: text
33
73
  }))));
34
74
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sag_components",
3
- "version": "1.0.144",
3
+ "version": "1.0.146",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {