UNPKG

@atlaskit/datetime-picker

Version:

A date time picker allows the user to select an associated date and time.

55 lines (54 loc) 1.96 kB
import _extends from "@babel/runtime/helpers/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; var _excluded = ["children", "className", "clearValue", "cx", "data", "getStyles", "getValue", "hasValue", "isDisabled", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue"]; import React from 'react'; import { components } from '@atlaskit/react-select/components'; /** * This creates a functional component that `react-select` will use to make the * SingleValue part of the different pickers. */ export var makeSingleValue = // TODO: Make ID required function makeSingleValue(_ref) { var id = _ref.id, lang = _ref.lang; return function (_ref2) { var children = _ref2.children, className = _ref2.className, clearValue = _ref2.clearValue, cx = _ref2.cx, data = _ref2.data, getStyles = _ref2.getStyles, getValue = _ref2.getValue, hasValue = _ref2.hasValue, isDisabled = _ref2.isDisabled, isMulti = _ref2.isMulti, isRtl = _ref2.isRtl, options = _ref2.options, selectOption = _ref2.selectOption, selectProps = _ref2.selectProps, setValue = _ref2.setValue, rest = _objectWithoutProperties(_ref2, _excluded); return /*#__PURE__*/React.createElement(components.SingleValue, _extends({}, rest, { // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides, @atlaskit/ui-styling-standard/no-classname-prop className: className, clearValue: clearValue, cx: cx, data: data, getStyles: getStyles, getValue: getValue, hasValue: hasValue, innerProps: { id: id, lang: lang.replace('_', '-') }, isDisabled: isDisabled, isMulti: isMulti, isRtl: isRtl, options: options, selectOption: selectOption, selectProps: selectProps, setValue: setValue }), children); }; };