mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-22 16:35:14 +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,MAA0C,yDAA1C;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAASC,eAAT,EAA0BC,WAA1B,EAAuCC,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,EAA4EP,IAAI,GAAG,oBAAoBA,IAAvB,GAA8B,KAA9G,EAAqH8B,UAArH,EAAiIA,UAAU,CAACS,MAAX,GAAoB,gBAApB,GAAuC,KAAxK,CAAX,EAA2L5B,SAA3L,CAA7B;AACA,SAAO,aAAazB,KAAK,CAACsD,aAAN,CAAoBb,GAApB,EAAyB3C,QAAQ,CAAC;AACpD4C,IAAAA,OAAO,EAAEA;AAD2C,GAAD,EAElDC,UAFkD,EAEtC;AACbnB,IAAAA,SAAS,EAAE4B;AADE,GAFsC,CAAjC,CAApB;AAKD,CAxCD;;AA0CAb,KAAK,CAACtB,SAAN,GAAkBA,SAAlB;AACAsB,KAAK,CAACL,YAAN,GAAqBA,YAArB;AACA,eAAeK,KAAf","sourcesContent":["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;"]},"metadata":{},"sourceType":"module"} |