mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
1 line
11 KiB
JSON
1 line
11 KiB
JSON
|
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType, isObject } from './utils';\nvar colWidths = ['xs', 'sm', 'md', 'lg', 'xl'];\nvar stringOrNumberProp = PropTypes.oneOfType([PropTypes.number, PropTypes.string]);\nvar columnProps = PropTypes.oneOfType([PropTypes.bool, PropTypes.string, PropTypes.number, PropTypes.shape({\n size: stringOrNumberProp,\n order: stringOrNumberProp,\n offset: stringOrNumberProp\n})]);\nvar propTypes = {\n children: PropTypes.node,\n hidden: PropTypes.bool,\n check: PropTypes.bool,\n size: PropTypes.string,\n for: PropTypes.string,\n tag: tagPropType,\n className: PropTypes.string,\n cssModule: PropTypes.object,\n xs: columnProps,\n sm: columnProps,\n md: columnProps,\n lg: columnProps,\n xl: columnProps,\n widths: PropTypes.array\n};\nvar defaultProps = {\n tag: 'label',\n widths: colWidths\n};\n\nvar getColumnSizeClass = function getColumnSizeClass(isXs, colWidth, colSize) {\n if (colSize === true || colSize === '') {\n return isXs ? 'col' : \"col-\" + colWidth;\n } else if (colSize === 'auto') {\n return isXs ? 'col-auto' : \"col-\" + colWidth + \"-auto\";\n }\n\n return isXs ? \"col-\" + colSize : \"col-\" + colWidth + \"-\" + colSize;\n};\n\nvar Label = function Label(props) {\n var className = props.className,\n cssModule = props.cssModule,\n hidden = props.hidden,\n widths = props.widths,\n Tag = props.tag,\n check = props.check,\n size = props.size,\n htmlFor = props.for,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"hidden\", \"widths\", \"tag\", \"check\", \"size\", \"for\"]);\n\n var colClasses = [];\n widths.forEach(function (colWidth, i) {\n var columnProp = props[colWidth];\n delete attributes[colWidth];\n\n if (!columnProp && columnProp !== '') {\n return;\n }\n\n var isXs = !i;\n var colClass;\n\n if (isObject(columnProp)) {\n var _classNames;\n\n var colSizeInterfix = isXs ? '-' : \"-\" + colWidth + \"-\";\n colClass = getColumnSizeClass(isXs, colWidth, columnProp.size);\n colClasses.push(mapToCssModules(classNames((_classNames = {}, _classNames[colClass] = columnProp.size || columnProp.size === '', _classNames[\"order\" + colSizeInterfix + columnProp.order] = columnProp.order || columnProp.order === 0, _classNames[\"offset\" + colSizeInterfix + columnProp.offset] = columnProp.offset || columnProp.offset === 0, _classNames))), cssModule);\n } else {\n colClass = getColumnSizeClass(isXs, colWidth, columnProp);\n colClasses.push(colClass);\n }\n });\n var classes = mapToCssModules(classNames(className, hidden ? 'sr-only' : false, check ? 'form-check-label' : false, size ? \"col-form-label-\" + size : false, colClasses, colClasses.length ? 'col-form-label' : false), cssModule);\n return /*#__PURE__*/React.createElement(Tag, _extends({\n htmlFor: htmlFor\n }, attributes, {\n className: classes\n }));\n};\n\nLabel.propTypes = propTypes;\nLabel.defaultProps = defaultProps;\nexport default Label;","map":{"version":3,"sources":["/app/node_modules/reactstrap/es/Label.js"],"names":["_extends","_objectWithoutPropertiesLoose","React","PropTypes","classNames","mapToCssModules","tagPropType","isObject","colWidths","stringOrNumberProp","oneOfType","number","string","columnProps","bool","shape","size","order","offset","propTypes","children","node","hidden","check","for","tag","className","cssModule","object","xs","sm","md","lg","xl","widths","array","defaultProps","getColumnSizeClass","isXs","colWidth","colSize","Label","props","Tag","htmlFor","attributes","colClasses","forEach","i","columnProp","colClass","_classNames","colSizeInterfix","push","classes","length","createElement"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,oCAArB;AACA,OAAOC,6BAAP,MAA0
|