UNPKG

@fluentui/react-northstar

Version:
46 lines (43 loc) 2.78 kB
"use strict"; exports.__esModule = true; exports.attachmentActionClassName = exports.AttachmentAction = void 0; var _accessibility = require("@fluentui/accessibility"); var customPropTypes = _interopRequireWildcard(require("@fluentui/react-proptypes")); var PropTypes = _interopRequireWildcard(require("prop-types")); var _reactBindings = require("@fluentui/react-bindings"); var _utils = require("../../utils"); var _Button = require("../Button/Button"); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var attachmentActionClassName = 'ui-attachment__action'; /** * An AttachmentAction provides a slot for actions in the Attachment. */ exports.attachmentActionClassName = attachmentActionClassName; var AttachmentAction = (0, _reactBindings.compose)(_Button.Button, { className: attachmentActionClassName, displayName: 'AttachmentAction', overrideStyles: true, shorthandConfig: { mappedProp: 'content' } }); exports.AttachmentAction = AttachmentAction; AttachmentAction.defaultProps = { accessibility: _accessibility.buttonBehavior, as: 'button' }; AttachmentAction.propTypes = Object.assign({}, _utils.commonPropTypes.createCommon({ content: 'shorthand' }), { disabled: PropTypes.bool, icon: customPropTypes.shorthandAllowingChildren, iconPosition: PropTypes.oneOf(['before', 'after']), loader: customPropTypes.itemShorthandWithoutJSX, loading: PropTypes.bool, onClick: PropTypes.func, onFocus: PropTypes.func, primary: customPropTypes.every([customPropTypes.disallow(['secondary']), PropTypes.bool]), secondary: customPropTypes.every([customPropTypes.disallow(['primary']), PropTypes.bool]) }); //# sourceMappingURL=AttachmentAction.js.map