mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
1 line
10 KiB
JSON
1 line
10 KiB
JSON
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport FormGroup from '../FormGroup';\nimport useForkRef from '../utils/useForkRef';\nimport useControlled from '../utils/useControlled';\nimport RadioGroupContext from './RadioGroupContext';\nimport useId from '../utils/unstable_useId';\nvar RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {\n var actions = props.actions,\n children = props.children,\n nameProp = props.name,\n valueProp = props.value,\n onChange = props.onChange,\n other = _objectWithoutProperties(props, [\"actions\", \"children\", \"name\", \"value\", \"onChange\"]);\n\n var rootRef = React.useRef(null);\n\n var _useControlled = useControlled({\n controlled: valueProp,\n default: props.defaultValue,\n name: 'RadioGroup'\n }),\n _useControlled2 = _slicedToArray(_useControlled, 2),\n value = _useControlled2[0],\n setValue = _useControlled2[1];\n\n React.useImperativeHandle(actions, function () {\n return {\n focus: function focus() {\n var input = rootRef.current.querySelector('input:not(:disabled):checked');\n\n if (!input) {\n input = rootRef.current.querySelector('input:not(:disabled)');\n }\n\n if (input) {\n input.focus();\n }\n }\n };\n }, []);\n var handleRef = useForkRef(ref, rootRef);\n\n var handleChange = function handleChange(event) {\n setValue(event.target.value);\n\n if (onChange) {\n onChange(event, event.target.value);\n }\n };\n\n var name = useId(nameProp);\n return /*#__PURE__*/React.createElement(RadioGroupContext.Provider, {\n value: {\n name: name,\n onChange: handleChange,\n value: value\n }\n }, /*#__PURE__*/React.createElement(FormGroup, _extends({\n role: \"radiogroup\",\n ref: handleRef\n }, other), children));\n});\nprocess.env.NODE_ENV !== \"production\" ? RadioGroup.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n\n /**\n * The default `input` element value. Use when the component is not controlled.\n */\n defaultValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.number, PropTypes.string]),\n\n /**\n * The name used to reference the value of the control.\n * If you don't provide this prop, it falls back to a randomly generated name.\n */\n name: PropTypes.string,\n\n /**\n * Callback fired when a radio button is selected.\n *\n * @param {object} event The event source of the callback.\n * You can pull out the new value by accessing `event.target.value` (string).\n */\n onChange: PropTypes.func,\n\n /**\n * Value of the selected radio button. The DOM API casts this to a string.\n */\n value: PropTypes.any\n} : void 0;\nexport default RadioGroup;","map":{"version":3,"sources":["/app/node_modules/@material-ui/core/esm/RadioGroup/RadioGroup.js"],"names":["_extends","_slicedToArray","_objectWithoutProperties","React","PropTypes","FormGroup","useForkRef","useControlled","RadioGroupContext","useId","RadioGroup","forwardRef","props","ref","actions","children","nameProp","name","valueProp","value","onChange","other","rootRef","useRef","_useControlled","controlled","default","defaultValue","_useControlled2","setValue","useImperativeHandle","focus","input","current","querySelector","handleRef","handleChange","event","target","createElement","Provider","role","process","env","NODE_ENV","propTypes","node","oneOfType","arrayOf","string","number","func","any"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,oCAArB;AACA,OAAOC,cAAP,MAA2B,0CAA3B;AACA,OAAOC,wBAAP,MAAqC,oDAArC;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,SAAP,MAAsB,cAAtB;AACA,OAAOC,UAAP,MAAuB,qBAAvB;AACA,OAAOC,aAAP,MAA0B,wBAA1B;AACA,OAAOC,iBAAP,MAA8B,qBAA9B;AACA,OAAOC,KAAP,MAAkB,yBAAlB;AACA,IAAIC,UAAU,GAAG,aAAaP,KAAK,CAACQ,UAAN,CAAiB,SAASD,UAAT,CAAoBE,KAApB,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AAAA,IAAI,EAAEb,SAAS,CAAC6C,MApB6C;;AAsB7D;AACF;AACA;AACA;AACA;AACA;AACE7B,EAAAA,QAAQ,EAAEhB,SAAS,CAAC+C,IA5ByC;;AA8B7D;AACF;AACA;AACEhC,EAAAA,KAAK,EAAEf,SAAS,CAACgD;AAjC4C,CAA/D,GAkCI,KAAK,CAlCT;AAmCA,eAAe1C,UAAf","sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport FormGroup from '../FormGroup';\nimport useForkRef from '../utils/useForkRef';\nimport useControlled from '../utils/useControlled';\nimport RadioGroupContext from './RadioGroupContext';\nimport useId from '../utils/unstable_useId';\nvar RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {\n var actions = props.actions,\n children = props.children,\n nameProp = props.name,\n valueProp = props.value,\n onChange = props.onChange,\n other = _objectWithoutProperties(props, [\"actions\", \"children\", \"name\", \"value\", \"onChange\"]);\n\n var rootRef = React.useRef(null);\n\n var _useControlled = useControlled({\n controlled: valueProp,\n default: props.defaultValue,\n name: 'RadioGroup'\n }),\n _useControlled2 = _slicedToArray(_useControlled, 2),\n value = _useControlled2[0],\n setValue = _useControlled2[1];\n\n React.useImperativeHandle(actions, function () {\n return {\n focus: function focus() {\n var input = rootRef.current.querySelector('input:not(:disabled):checked');\n\n if (!input) {\n input = rootRef.current.querySelector('input:not(:disabled)');\n }\n\n if (input) {\n input.focus();\n }\n }\n };\n }, []);\n var handleRef = useForkRef(ref, rootRef);\n\n var handleChange = function handleChange(event) {\n setValue(event.target.value);\n\n if (onChange) {\n onChange(event, event.target.value);\n }\n };\n\n var name = useId(nameProp);\n return /*#__PURE__*/React.createElement(RadioGroupContext.Provider, {\n value: {\n name: name,\n onChange: handleChange,\n value: value\n }\n }, /*#__PURE__*/React.createElement(FormGroup, _extends({\n role: \"radiogroup\",\n ref: handleRef\n }, other), children));\n});\nprocess.env.NODE_ENV !== \"production\" ? RadioGroup.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n\n /**\n * The default `input` element value. Use when the component is not controlled.\n */\n defaultValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.number, PropTypes.string]),\n\n /**\n * The name used to reference the value of the control.\n * If you don't provide this prop, it falls back to a randomly generated name.\n */\n name: PropTypes.string,\n\n /**\n * Callback fired when a radio button is selected.\n *\n * @param {object} event The event source of the callback.\n * You can pull out the new value by accessing `event.target.value` (string).\n */\n onChange: PropTypes.func,\n\n /**\n * Value of the selected radio button. The DOM API casts this to a string.\n */\n value: PropTypes.any\n} : void 0;\nexport default RadioGroup;"]},"metadata":{},"sourceType":"module"} |