@invoicebox/ui 0.1.0-alpha.190 → 0.1.0-alpha.193
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.
|
@@ -3,10 +3,12 @@ import { TProps as TInputLabelProps } from '../InputLabel';
|
|
|
3
3
|
import { TProps as TPureInputProps } from '../PureInput';
|
|
4
4
|
import { TProps as TCalendarProps } from '../../common/Calendar';
|
|
5
5
|
import { TSizes } from '../constants';
|
|
6
|
+
import { TDropdownProps } from '../../../index';
|
|
6
7
|
export type TProps = {
|
|
7
8
|
value: Date | null;
|
|
8
9
|
onChange: (value: Date) => void;
|
|
9
10
|
withTime?: boolean;
|
|
11
|
+
dropdownProps?: Pick<TDropdownProps, 'isAutoPosition' | 'positionLeft' | 'positionRight' | 'positionVertical'>;
|
|
10
12
|
} & Pick<TPureInputProps, 'hasError' | 'name' | 'onBlur' | 'onFocus'> & Pick<TInputLabelProps, 'label'> & Pick<TCalendarProps, 'maxDate' | 'minDate'> & {
|
|
11
13
|
size?: TSizes;
|
|
12
14
|
};
|
|
@@ -40,7 +40,8 @@ var DateInput = exports.DateInput = function DateInput(_ref) {
|
|
|
40
40
|
_ref$withTime = _ref.withTime,
|
|
41
41
|
withTime = _ref$withTime === void 0 ? false : _ref$withTime,
|
|
42
42
|
_ref$size = _ref.size,
|
|
43
|
-
size = _ref$size === void 0 ? 'M' : _ref$size
|
|
43
|
+
size = _ref$size === void 0 ? 'M' : _ref$size,
|
|
44
|
+
dropdownProps = _ref.dropdownProps;
|
|
44
45
|
var palette = (0, _palette.useComponentPalette)('dateInput');
|
|
45
46
|
var inputRef = (0, _react.useRef)(null);
|
|
46
47
|
var _useState = (0, _react.useState)(false),
|
|
@@ -107,6 +108,7 @@ var DateInput = exports.DateInput = function DateInput(_ref) {
|
|
|
107
108
|
inFocus: inFocus,
|
|
108
109
|
label: label
|
|
109
110
|
}, /*#__PURE__*/_react["default"].createElement(S.InputWrapper, null, /*#__PURE__*/_react["default"].createElement(_PureInput.PureInput, _extends({
|
|
111
|
+
onClick: handleTrigger,
|
|
110
112
|
ref: inputRef,
|
|
111
113
|
hasError: hasError,
|
|
112
114
|
inFocus: inFocus,
|
|
@@ -120,10 +122,10 @@ var DateInput = exports.DateInput = function DateInput(_ref) {
|
|
|
120
122
|
}, _constants.SIZE_PARAMS_MAP[size])), /*#__PURE__*/_react["default"].createElement(S.Icon, {
|
|
121
123
|
onClick: handleTrigger,
|
|
122
124
|
$palette: palette
|
|
123
|
-
}, /*#__PURE__*/_react["default"].createElement(_Icon.Icon, null)))), /*#__PURE__*/_react["default"].createElement(_Dropdown.Dropdown, {
|
|
125
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon.Icon, null)))), /*#__PURE__*/_react["default"].createElement(_Dropdown.Dropdown, _extends({
|
|
124
126
|
isOpen: isOpen,
|
|
125
127
|
isAutoPosition: true
|
|
126
|
-
}, /*#__PURE__*/_react["default"].createElement(S.CalendarWrapper, null, /*#__PURE__*/_react["default"].createElement(_Calendar.Calendar, {
|
|
128
|
+
}, dropdownProps), /*#__PURE__*/_react["default"].createElement(S.CalendarWrapper, null, /*#__PURE__*/_react["default"].createElement(_Calendar.Calendar, {
|
|
127
129
|
value: value,
|
|
128
130
|
onChange: handleCalendarChange,
|
|
129
131
|
minDate: minDate,
|