Files
Speedtest-Tracker/conf/site/node_modules/react-bootstrap/esm/FormCheckLabel.js
Henry Whitaker 2219b0213c npm install
2021-03-07 09:24:01 +00:00

30 lines
1.2 KiB
JavaScript
Vendored

import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import classNames from 'classnames';
import React, { useContext } from 'react';
import FormContext from './FormContext';
import { useBootstrapPrefix } from './ThemeProvider';
var FormCheckLabel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
var bsPrefix = _ref.bsPrefix,
bsCustomPrefix = _ref.bsCustomPrefix,
className = _ref.className,
htmlFor = _ref.htmlFor,
props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "bsCustomPrefix", "className", "htmlFor"]);
var _useContext = useContext(FormContext),
controlId = _useContext.controlId,
custom = _useContext.custom;
var _ref2 = custom ? [bsCustomPrefix, 'custom-control-label'] : [bsPrefix, 'form-check-label'],
prefix = _ref2[0],
defaultPrefix = _ref2[1];
bsPrefix = useBootstrapPrefix(prefix, defaultPrefix);
return /*#__PURE__*/React.createElement("label", _extends({}, props, {
ref: ref,
htmlFor: htmlFor || controlId,
className: classNames(className, bsPrefix)
}));
});
FormCheckLabel.displayName = 'FormCheckLabel';
export default FormCheckLabel;