UNPKG

@fluentui/react-northstar

Version:
50 lines (48 loc) 3.07 kB
"use strict"; exports.__esModule = true; exports.commonPropTypes = void 0; var customPropTypes = _interopRequireWildcard(require("@fluentui/react-proptypes")); var PropTypes = _interopRequireWildcard(require("prop-types")); 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 commonPropTypes = { createCommon: function createCommon(config) { if (config === void 0) { config = {}; } var _config = config, _config$accessibility = _config.accessibility, accessibility = _config$accessibility === void 0 ? true : _config$accessibility, _config$as = _config.as, as = _config$as === void 0 ? true : _config$as, _config$children = _config.children, children = _config$children === void 0 ? 'node' : _config$children, _config$className = _config.className, className = _config$className === void 0 ? true : _config$className, _config$color = _config.color, color = _config$color === void 0 ? false : _config$color, _config$content = _config.content, content = _config$content === void 0 ? 'node' : _config$content, _config$styled = _config.styled, styled = _config$styled === void 0 ? true : _config$styled; return Object.assign({}, accessibility && { accessibility: customPropTypes.accessibility }, as && { as: PropTypes.elementType }, children && { children: children === 'element' ? PropTypes.element : PropTypes.node }, className && { className: PropTypes.string }, color && { color: PropTypes.string }, content && { content: content === 'shorthand' ? customPropTypes.itemShorthand : customPropTypes.nodeContent }, styled && { styles: PropTypes.oneOfType([PropTypes.object, PropTypes.func]), variables: PropTypes.oneOfType([PropTypes.object, PropTypes.func]), design: customPropTypes.design }); } }; exports.commonPropTypes = commonPropTypes; //# sourceMappingURL=commonPropTypes.js.map