@fluentui/react-northstar
Version:
A themable React component library.
90 lines (89 loc) • 3.22 kB
JavaScript
import { datepickerCalendarCellBehavior } from '@fluentui/accessibility';
import { getElementType, useAccessibility, useStyles, useFluentContext, useTelemetry, useUnhandledProps, compose } from '@fluentui/react-bindings';
import * as PropTypes from 'prop-types';
import * as React from 'react';
import { commonPropTypes } from '../../utils';
export var datepickerCalendarCellClassName = 'ui-datepicker__calendarcell';
/**
* A Datepicker cell is used to display calendar grid cells.
*/
export var DatepickerCalendarCell = /*#__PURE__*/function () {
var DatepickerCalendarCell = compose(function (props, ref, composeOptions) {
var context = useFluentContext();
var _useTelemetry = useTelemetry(composeOptions.displayName, context.telemetry),
setStart = _useTelemetry.setStart,
setEnd = _useTelemetry.setEnd;
setStart();
var className = props.className,
design = props.design,
styles = props.styles,
variables = props.variables,
disabled = props.disabled,
selected = props.selected,
quiet = props.quiet,
today = props.today,
content = props.content;
var unhandledProps = useUnhandledProps(composeOptions.handledProps, props);
var ElementType = getElementType(props);
var getA11yProps = useAccessibility(props.accessibility, {
debugName: composeOptions.displayName,
actionHandlers: {},
mapPropsToBehavior: function mapPropsToBehavior() {
return {
selected: selected,
disabled: disabled,
quiet: quiet,
today: today
};
},
rtl: context.rtl
});
var _useStyles = useStyles(DatepickerCalendarCell.displayName, {
className: composeOptions.className,
mapPropsToStyles: function mapPropsToStyles() {
return {
disabled: disabled,
selected: selected,
quiet: quiet,
today: today
};
},
mapPropsToInlineStyles: function mapPropsToInlineStyles() {
return {
className: className,
design: design,
styles: styles,
variables: variables
};
},
rtl: context.rtl,
composeOptions: composeOptions,
unstable_props: props
}),
classes = _useStyles.classes;
var element = /*#__PURE__*/React.createElement(ElementType, getA11yProps('root', Object.assign({
className: classes.root,
ref: ref
}, unhandledProps)), content);
setEnd();
return element;
}, {
className: datepickerCalendarCellClassName,
displayName: 'DatepickerCalendarCell',
handledProps: ['accessibility', 'as', 'className', 'content', 'design', 'disabled', 'selected', 'styles', 'variables', 'quiet', 'today']
});
DatepickerCalendarCell.propTypes = Object.assign({}, commonPropTypes.createCommon({
children: false
}), {
disabled: PropTypes.bool,
selected: PropTypes.bool,
quiet: PropTypes.bool,
today: PropTypes.bool
});
DatepickerCalendarCell.defaultProps = {
accessibility: datepickerCalendarCellBehavior,
as: 'td'
};
return DatepickerCalendarCell;
}();
//# sourceMappingURL=DatepickerCalendarCell.js.map