armtek-uikit-react 1.0.26 → 1.0.28

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.
@@ -109,7 +109,9 @@ $box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.1);
109
109
  --box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.1);
110
110
  }
111
111
 
112
-
112
+ .react-datepicker-popper{
113
+ z-index: 6;
114
+ }
113
115
 
114
116
 
115
117
  @mixin transition($time: 0.5s, $target: all, $animation: ease) {
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"armtek-uikit-react","version":"1.0.26","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
1
+ {"name":"armtek-uikit-react","version":"1.0.28","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
@@ -4,23 +4,16 @@ export type DateFieldProps = {
4
4
  format?: string;
5
5
  onInput?: (e: ChangeEvent<HTMLInputElement>) => void;
6
6
  onChange?: (value: Date | null) => void;
7
+ value?: Date | null;
7
8
  showTime?: boolean;
8
9
  showTimeOnly?: boolean;
9
- } & TextFieldProps;
10
+ } & Omit<TextFieldProps, 'onChange' | 'value'>;
10
11
  declare const DateField: import("react").ForwardRefExoticComponent<{
11
12
  format?: string | undefined;
12
13
  onInput?: ((e: ChangeEvent<HTMLInputElement>) => void) | undefined;
13
14
  onChange?: ((value: Date | null) => void) | undefined;
15
+ value?: Date | null | undefined;
14
16
  showTime?: boolean | undefined;
15
17
  showTimeOnly?: boolean | undefined;
16
- } & {
17
- label?: string | undefined;
18
- size?: "large" | "small" | undefined;
19
- variant?: import("../../../types/theme").VariantType | undefined;
20
- error?: boolean | undefined;
21
- success?: boolean | undefined;
22
- helperText?: string | undefined;
23
- endAdornment?: import("react").ReactNode;
24
- multiline?: boolean | undefined;
25
- } & Omit<import("react").InputHTMLAttributes<any>, "size"> & import("react").RefAttributes<unknown>>;
18
+ } & Omit<TextFieldProps, "value" | "onChange"> & import("react").RefAttributes<unknown>>;
26
19
  export default DateField;
@@ -2,6 +2,7 @@
2
2
 
3
3
  import TextField from "../TextField/TextField";
4
4
  import { forwardRef, useState } from 'react';
5
+ import Card from "../../Card/Card";
5
6
  import DatePicker from "../DatePicker/DatePicker";
6
7
  import ButtonIcon from "../../ButtonIcon";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -33,6 +34,8 @@ const DateField = /*#__PURE__*/forwardRef((props, ref) => {
33
34
  onInput,
34
35
  showTime,
35
36
  showTimeOnly,
37
+ disabled,
38
+ value,
36
39
  ...restProps
37
40
  } = props;
38
41
  let [date, setDate] = useState(null);
@@ -41,10 +44,11 @@ const DateField = /*#__PURE__*/forwardRef((props, ref) => {
41
44
  setDate(d);
42
45
  if (onChange) onChange(d);
43
46
  };
47
+ let realValue = value !== undefined ? value : date;
44
48
  return /*#__PURE__*/_jsx(_Fragment, {
45
49
  children: /*#__PURE__*/_jsx(DatePicker, {
46
50
  onChange: handleChange,
47
- selected: date,
51
+ selected: realValue,
48
52
  showTimeSelect: !!showTime,
49
53
  timeIntervals: 15,
50
54
  showTimeSelectOnly: !!showTimeOnly && !!showTime,
@@ -54,12 +58,18 @@ const DateField = /*#__PURE__*/forwardRef((props, ref) => {
54
58
  ref: ref,
55
59
  ...restProps
56
60
  }),
57
- inline: false
58
- // calendarContainer={Card}
59
- ,
61
+ inline: false,
62
+ disabled: disabled,
63
+ calendarContainer: PickerCard,
60
64
  popperPlacement: "top-end",
61
65
  dateFormat: format
62
66
  })
63
67
  });
64
68
  });
69
+ const PickerCard = props => {
70
+ return /*#__PURE__*/_jsx(Card, {
71
+ className: props.className,
72
+ children: props.children
73
+ });
74
+ };
65
75
  export default DateField;