Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FormCheckLabel.js 1.1KB

1234567891011121314151617181920212223242526
  1. import _extends from "@babel/runtime/helpers/esm/extends";
  2. import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
  3. import classNames from 'classnames';
  4. import React, { useContext } from 'react';
  5. import FormContext from './FormContext';
  6. import { useBootstrapPrefix } from './ThemeProvider';
  7. var FormCheckLabel = React.forwardRef(function (_ref, ref) {
  8. var bsPrefix = _ref.bsPrefix,
  9. bsCustomPrefix = _ref.bsCustomPrefix,
  10. className = _ref.className,
  11. htmlFor = _ref.htmlFor,
  12. props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "bsCustomPrefix", "className", "htmlFor"]);
  13. var _useContext = useContext(FormContext),
  14. controlId = _useContext.controlId,
  15. custom = _useContext.custom;
  16. bsPrefix = custom ? useBootstrapPrefix(bsCustomPrefix, 'custom-control-label') : useBootstrapPrefix(bsPrefix, 'form-check-label');
  17. return React.createElement("label", _extends({}, props, {
  18. ref: ref,
  19. htmlFor: htmlFor || controlId,
  20. className: classNames(className, bsPrefix)
  21. }));
  22. });
  23. FormCheckLabel.displayName = 'FormCheckLabel';
  24. export default FormCheckLabel;