@invoicebox/ui 0.1.0-alpha.190 → 0.1.0-alpha.191
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),
|
|
@@ -120,10 +121,10 @@ var DateInput = exports.DateInput = function DateInput(_ref) {
|
|
|
120
121
|
}, _constants.SIZE_PARAMS_MAP[size])), /*#__PURE__*/_react["default"].createElement(S.Icon, {
|
|
121
122
|
onClick: handleTrigger,
|
|
122
123
|
$palette: palette
|
|
123
|
-
}, /*#__PURE__*/_react["default"].createElement(_Icon.Icon, null)))), /*#__PURE__*/_react["default"].createElement(_Dropdown.Dropdown, {
|
|
124
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon.Icon, null)))), /*#__PURE__*/_react["default"].createElement(_Dropdown.Dropdown, _extends({
|
|
124
125
|
isOpen: isOpen,
|
|
125
126
|
isAutoPosition: true
|
|
126
|
-
}, /*#__PURE__*/_react["default"].createElement(S.CalendarWrapper, null, /*#__PURE__*/_react["default"].createElement(_Calendar.Calendar, {
|
|
127
|
+
}, dropdownProps), /*#__PURE__*/_react["default"].createElement(S.CalendarWrapper, null, /*#__PURE__*/_react["default"].createElement(_Calendar.Calendar, {
|
|
127
128
|
value: value,
|
|
128
129
|
onChange: handleCalendarChange,
|
|
129
130
|
minDate: minDate,
|