@atlaskit/datetime-picker
Version:
A date time picker allows the user to select an associated date and time.
53 lines (52 loc) • 1.2 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
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 const makeSingleValue =
// TODO: Make ID required
({
id,
lang
}) => ({
children,
className,
clearValue,
cx,
data,
getStyles,
getValue,
hasValue,
isDisabled,
isMulti,
isRtl,
options,
selectOption,
selectProps,
setValue,
...rest
}) => {
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,
lang: lang.replace('_', '-')
},
isDisabled: isDisabled,
isMulti: isMulti,
isRtl: isRtl,
options: options,
selectOption: selectOption,
selectProps: selectProps,
setValue: setValue
}), children);
};