mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
1 line
26 KiB
JSON
1 line
26 KiB
JSON
{"ast":null,"code":"import MuiTextField from '@material-ui/core/TextField';\nimport MuiSwitch from '@material-ui/core/Switch';\nimport invariant from 'tiny-warning';\nimport MuiCheckbox from '@material-ui/core/Checkbox';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport MuiSelect from '@material-ui/core/Select';\nimport { getIn } from 'formik';\nimport FormControl from '@material-ui/core/FormControl';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport Input from '@material-ui/core/Input';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport MuiRadioGroup from '@material-ui/core/RadioGroup';\nimport { createElement } from 'react';\nimport MuiInputBase from '@material-ui/core/InputBase';\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\n\nvar __assign = function () {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nfunction __rest(s, e) {\n var t = {};\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];\n return t;\n}\n\nfunction fieldToTextField(_a) {\n var disabled = _a.disabled,\n _b = _a.field,\n fieldOnBlur = _b.onBlur,\n field = __rest(_b, [\"onBlur\"]),\n _c = _a.form,\n isSubmitting = _c.isSubmitting,\n touched = _c.touched,\n errors = _c.errors,\n onBlur = _a.onBlur,\n helperText = _a.helperText,\n props = __rest(_a, [\"disabled\", \"field\", \"form\", \"onBlur\", \"helperText\"]);\n\n var fieldError = getIn(errors, field.name);\n var showError = getIn(touched, field.name) && !!fieldError;\n return __assign(__assign({\n variant: props.variant,\n error: showError,\n helperText: showError ? fieldError : helperText,\n disabled: disabled !== null && disabled !== void 0 ? disabled : isSubmitting,\n onBlur: onBlur !== null && onBlur !== void 0 ? onBlur : function (e) {\n fieldOnBlur(e !== null && e !== void 0 ? e : field.name);\n }\n }, field), props);\n}\n\nfunction TextField(_a) {\n var children = _a.children,\n props = __rest(_a, [\"children\"]);\n\n return createElement(MuiTextField, __assign({}, fieldToTextField(props)), children);\n}\n\nTextField.displayName = 'FormikMaterialUITextField';\n\nfunction fieldToSwitch(_a) {\n var disabled = _a.disabled,\n _b = _a.field,\n fieldOnBlur = _b.onBlur,\n field = __rest(_b, [\"onBlur\"]),\n isSubmitting = _a.form.isSubmitting,\n type = _a.type,\n onBlur = _a.onBlur,\n props = __rest(_a, [\"disabled\", \"field\", \"form\", \"type\", \"onBlur\"]);\n\n if (process.env.NODE_ENV !== 'production') {\n invariant(type === 'checkbox', \"property type=checkbox is missing from field \" + field.name + \", this can caused unexpected behaviour\");\n }\n\n return __assign(__assign({\n disabled: disabled !== null && disabled !== void 0 ? disabled : isSubmitting,\n onBlur: onBlur !== null && onBlur !== void 0 ? onBlur : function (e) {\n fieldOnBlur(e !== null && e !== void 0 ? e : field.name);\n }\n }, field), props);\n}\n\nfunction Switch(props) {\n return createElement(MuiSwitch, __assign({}, fieldToSwitch(props)));\n}\n\nSwitch.displayName = 'FormikMaterialUISwitch';\n\nfunction fieldToCheckbox(_a) {\n var disabled = _a.disabled,\n _b = _a.field,\n fieldOnBlur = _b.onBlur,\n field = __rest(_b, [\"onBlur\"]),\n isSubmitting = _a.form.isSubmitting,\n type = _a.type,\n onBlur = _a.onBlur,\n props = __rest(_a, [\"disabled\", \"field\", \"form\", \"type\", \"onBlur\"]);\n\n var indeterminate = !Array.isArray(field.value) && field.value == null;\n\n if (process.env.NODE_ENV !== 'production') {\n invariant(type === 'checkbox', \"property type=checkbox is missing from field \" + field.name + \", this can caused unexpected behaviour\");\n }\n\n return __assign(__assign({\n disabled: disabled !== null && disabled !== void 0 ? disabled : isSubmitting,\n indeterminate: indeterminate,\n onBlur: onBlur !== null && onBlur !== void 0 ? onBlur : function (e) {\n fieldOnBlur(e !== null && e !== void 0 ? e : field.name);\n }\n }, field), props);\n}\n\nfunction Checkbox(props) {\n return createElement(MuiCheckbox, __assign({}, fieldToCheckbox(props)));\n}\n\nCheckbox.displayName = 'FormikMaterialUICheckbox';\n\nfunction CheckboxWithLabel(_a) {\n var Label = _a.Label,\n props = __rest(_a, [\"Label\"]);\n\n return createElement(FormControlLabel, __assign({\n control: createElement(MuiCheckbox, __assign({}, fieldToCheckbox(props)))\n }, Label));\n}\n\nCheckboxWithLabel.displayName = 'FormikMaterialUICheckboxWithLabel';\n\nfunction fieldToSelect(_a) {\n var disabled = _a.disabled,\n _b = _a.field,\n fieldOnBlur = _b.onBlur,\n field = __rest(_b, [\"onBlur\"]),\n isSubmitting = _a.form.isSubmitting,\n onBlur = _a.onBlur,\n props = __rest(_a, [\"disabled\", \"field\", \"form\", \"onBlur\"]);\n\n return __assign(__assign({\n disabled: disabled !== null && disabled !== void 0 ? disabled : isSubmitting,\n onBlur: onBlur !== null && onBlur !== void 0 ? onBlur : function (e) {\n fieldOnBlur(e !== null && e !== void 0 ? e : field.name);\n }\n }, field), props);\n}\n\nfunction Select(props) {\n return createElement(MuiSelect, __assign({}, fieldToSelect(props)));\n}\n\nSelect.displayName = 'FormikMaterialUISelect';\n\nvar SimpleFileUpload = function (_a) {\n var field = _a.field,\n _b = _a.form,\n isSubmitting = _b.isSubmitting,\n touched = _b.touched,\n errors = _b.errors,\n setFieldValue = _b.setFieldValue,\n label = _a.label,\n _c = _a.disabled,\n disabled = _c === void 0 ? false : _c,\n inputProps = _a.InputProps,\n inputLabelProps = _a.InputLabelProps,\n formControlProps = _a.FormControlProps;\n var error = getIn(touched, field.name) && getIn(errors, field.name);\n return createElement(FormControl, __assign({}, formControlProps), label && createElement(InputLabel, __assign({\n shrink: true,\n error: !!error\n }, inputLabelProps), label), createElement(Input, __assign({\n error: !!error,\n inputProps: {\n type: 'file',\n disabled: disabled || isSubmitting,\n name: field.name,\n onChange: function (event) {\n if (inputProps === null || inputProps === void 0 ? void 0 : inputProps.onChange) {\n inputProps.onChange(event);\n } else {\n var file = event.currentTarget.files[0];\n setFieldValue(field.name, file);\n }\n }\n }\n }, inputProps)), error && createElement(FormHelperText, {\n error: true\n }, error));\n};\n\nfunction fieldToRadioGroup(_a) {\n var _b = _a.field,\n fieldOnBlur = _b.onBlur,\n field = __rest(_b, [\"onBlur\"]),\n form = _a.form,\n onBlur = _a.onBlur,\n props = __rest(_a, [\"field\", \"form\", \"onBlur\"]);\n\n return __assign(__assign({\n onBlur: onBlur !== null && onBlur !== void 0 ? onBlur : function (e) {\n fieldOnBlur(e !== null && e !== void 0 ? e : field.name);\n }\n }, field), props);\n}\n\nfunction RadioGroup(props) {\n return createElement(MuiRadioGroup, __assign({}, fieldToRadioGroup(props)));\n}\n\nRadioGroup.displayName = 'FormikMaterialUIRadioGroup';\n\nfunction fieldToInputBase(_a) {\n var disabled = _a.disabled,\n _b = _a.field,\n fieldOnBlur = _b.onBlur,\n field = __rest(_b, [\"onBlur\"]),\n isSubmitting = _a.form.isSubmitting,\n onBlur = _a.onBlur,\n props = __rest(_a, [\"disabled\", \"field\", \"form\", \"onBlur\"]);\n\n return __assign(__assign({\n disabled: disabled !== null && disabled !== void 0 ? disabled : isSubmitting,\n onBlur: onBlur !== null && onBlur !== void 0 ? onBlur : function (e) {\n fieldOnBlur(e !== null && e !== void 0 ? e : field.name);\n }\n }, field), props);\n}\n\nfunction InputBase(props) {\n return createElement(MuiInputBase, __assign({}, fieldToInputBase(props)));\n}\n\nInputBase.displayName = 'FormikMaterialUIInputBase';\nexport { fieldToTextField, TextField, fieldToSwitch, Switch, fieldToCheckbox, Checkbox, CheckboxWithLabel, fieldToSelect, Select, SimpleFileUpload, fieldToRadioGroup, RadioGroup, fieldToInputBase, InputBase };","map":{"version":3,"sources":["../src/TextField.tsx","../src/Switch.tsx","../src/Checkbox.tsx","../src/CheckboxWithLabel.tsx","../src/Select.tsx","../src/SimpleFileUpload.tsx","../src/RadioGroup.tsx","../src/InputBase.tsx"],"names":["React.createElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAUgB,gB,CAAiB,E,EAOhB;AANf,MAAA,QAAQ,GAAA,EAAA,CAAA,QAAR;AAAA,MACA,EAAA,GAAA,EAAA,CAAA,KADA;AAAA,MACiB,WAAW,GAAA,EAAA,CAAA,MAD5B;AAAA,MACiC,KAAK,GAAA,MAAA,CAAA,EAAA,EAA/B,CAAA,QAAA,CAA+B,CADtC;AAAA,MAEA,EAAA,GAAA,EAAA,CAAA,IAFA;AAAA,MAEQ,YAAY,GAAA,EAAA,CAAA,YAFpB;AAAA,MAEsB,OAAO,GAAA,EAAA,CAAA,OAF7B;AAAA,MAE+B,MAAM,GAAA,EAAA,CAAA,MAFrC;AAAA,MAGA,MAAM,GAAA,EAAA,CAAA,MAHN;AAAA,MAIA,UAAU,GAAA,EAAA,CAAA,UAJV;AAAA,MAKG,KAAK,GAAA,MAAA,CAAA,EAAA,EANuB,CAAA,UAAA,EAAA,OAAA,EAAA,MAAA,EAAA,Q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as React from 'react';\nimport MuiTextField, {\n TextFieldProps as MuiTextFieldProps,\n} from '@material-ui/core/TextField';\nimport { FieldProps, getIn } from 'formik';\n\nexport interface TextFieldProps\n extends FieldProps,\n Omit<MuiTextFieldProps, 'name' | 'value' | 'error'> {}\n\nexport function fieldToTextField({\n disabled,\n field: { onBlur: fieldOnBlur, ...field },\n form: { isSubmitting, touched, errors },\n onBlur,\n helperText,\n ...props\n}: TextFieldProps): MuiTextFieldProps {\n const fieldError = getIn(errors, field.name);\n const showError = getIn(touched, field.name) && !!fieldError;\n\n return {\n variant: props.variant,\n error: showError,\n helperText: showError ? fieldError : helperText,\n disabled: disabled ?? isSubmitting,\n onBlur:\n onBlur ??\n function (e) {\n fieldOnBlur(e ?? field.name);\n },\n ...field,\n ...props,\n };\n}\n\nexport function TextField({ children, ...props }: TextFieldProps) {\n return <MuiTextField {...fieldToTextField(props)}>{children}</MuiTextField>;\n}\n\nTextField.displayName = 'FormikMaterialUITextField';\n","import * as React from 'react';\nimport MuiSwitch, {\n SwitchProps as MuiSwitchProps,\n} from '@material-ui/core/Switch';\nimport { FieldProps } from 'formik';\nimport invariant from 'tiny-warning';\n\nexport interface SwitchProps\n extends FieldProps,\n Omit<\n MuiSwitchProps,\n | 'checked'\n | 'name'\n | 'value'\n | 'defaultChecked'\n | 'form'\n // Excluded for conflict with Field type\n | 'type'\n > {\n type?: string;\n}\n\nexport function fieldToSwitch({\n disabled,\n field: { onBlur: fieldOnBlur, ...field },\n form: { isSubmitting },\n type,\n onBlur,\n ...props\n}: SwitchProps): MuiSwitchProps {\n if (process.env.NODE_ENV !== 'production') {\n invariant(\n type === 'checkbox',\n `property type=checkbox is missing from field ${field.name}, this can caused unexpected behaviour`\n );\n }\n\n return {\n disabled: disabled ?? isSubmitting,\n onBlur:\n onBlur ??\n function (e) {\n fieldOnBlur(e ?? field.name);\n },\n ...field,\n ...props,\n };\n}\n\nexport function Switch(props: SwitchProps) {\n return <MuiSwitch {...fieldToSwitch(props)} />;\n}\n\nSwitch.displayName = 'FormikMaterialUISwitch';\n","import * as React from 'react';\nimport MuiCheckbox, {\n CheckboxProps as MuiCheckboxProps,\n} from '@material-ui/core/Checkbox';\nimport { FieldProps } from 'formik';\nimport invariant from 'tiny-warning';\n\nexport interface CheckboxProps\n extends FieldProps,\n Omit<\n MuiCheckboxProps,\n | 'name'\n | 'value'\n | 'error'\n | 'form'\n | 'checked'\n | 'defaultChecked'\n // Excluded for conflict with Field type\n | 'type'\n > {\n type?: string;\n}\n\nexport function fieldToCheckbox({\n disabled,\n field: { onBlur: fieldOnBlur, ...field },\n form: { isSubmitting },\n type,\n onBlur,\n ...props\n}: CheckboxProps): MuiCheckboxProps {\n const indeterminate = !Array.isArray(field.value) && field.value == null;\n\n if (process.env.NODE_ENV !== 'production') {\n invariant(\n type === 'checkbox',\n `property type=checkbox is missing from field ${field.name}, this can caused unexpected behaviour`\n );\n }\n\n return {\n disabled: disabled ?? isSubmitting,\n indeterminate,\n onBlur:\n onBlur ??\n function (e) {\n fieldOnBlur(e ?? field.name);\n },\n ...field,\n ...props,\n };\n}\n\nexport function Checkbox(props: CheckboxProps) {\n return <MuiCheckbox {...fieldToCheckbox(props)} />;\n}\n\nCheckbox.displayName = 'FormikMaterialUICheckbox';\n","import * as React from 'react';\nimport MuiCheckbox from '@material-ui/core/Checkbox';\nimport FormControlLabel, {\n FormControlLabelProps as MuiFormControlLabelProps,\n} from '@material-ui/core/FormControlLabel';\nimport { FieldProps } from 'formik';\n\nimport { CheckboxProps, fieldToCheckbox } from './Checkbox';\n\n/**\n * Exclude props that are passed directly to the control\n * https://github.com/mui-org/material-ui/blob/v3.1.1/packages/material-ui/src/FormControlLabel/FormControlLabel.js#L71\n */\nexport interface CheckboxWithLabelProps extends FieldProps, CheckboxProps {\n Label: Omit<\n MuiFormControlLabelProps,\n 'checked' | 'name' | 'value' | 'control'\n >;\n}\n\nexport function CheckboxWithLabel<Val = unknown>({\n Label,\n ...props\n}: CheckboxWithLabelProps) {\n return (\n <FormControlLabel\n control={<MuiCheckbox {...fieldToCheckbox(props)} />}\n {...Label}\n />\n );\n}\n\nCheckboxWithLabel.displayName = 'FormikMaterialUICheckboxWithLabel';\n","import * as React from 'react';\nimport MuiSelect, {\n SelectProps as MuiSelectProps,\n} from '@material-ui/core/Select';\nimport { FieldProps } from 'formik';\n\nexport interface SelectProps\n extends FieldProps,\n Omit<MuiSelectProps, 'name' | 'value'> {}\n\nexport function fieldToSelect({\n disabled,\n field: { onBlur: fieldOnBlur, ...field },\n form: { isSubmitting },\n onBlur,\n ...props\n}: SelectProps): MuiSelectProps {\n return {\n disabled: disabled ?? isSubmitting,\n onBlur:\n onBlur ??\n function (e) {\n fieldOnBlur(e ?? field.name);\n },\n ...field,\n ...props,\n };\n}\n\nexport function Select(props: SelectProps) {\n return <MuiSelect {...fieldToSelect(props)} />;\n}\n\nSelect.displayName = 'FormikMaterialUISelect';\n","import * as React from 'react';\nimport { FieldProps, getIn } from 'formik';\nimport FormControl, { FormControlProps } from '@material-ui/core/FormControl';\nimport InputLabel, { InputLabelProps } from '@material-ui/core/InputLabel';\nimport Input, { InputProps } from '@material-ui/core/Input';\nimport FormHelperText from '@material-ui/core/FormHelperText';\n\nexport interface SimpleFileUploadProps extends FieldProps {\n label: string;\n disabled?: boolean;\n InputProps?: Omit<InputProps, 'name' | 'type' | 'label'>;\n InputLabelProps?: InputLabelProps;\n FormControlProps?: FormControlProps;\n}\n\nexport const SimpleFileUpload = ({\n field,\n form: { isSubmitting, touched, errors, setFieldValue },\n label,\n disabled = false,\n InputProps: inputProps,\n InputLabelProps: inputLabelProps,\n FormControlProps: formControlProps,\n}: SimpleFileUploadProps) => {\n const error = getIn(touched, field.name) && getIn(errors, field.name);\n\n return (\n <FormControl {...formControlProps}>\n {label && (\n <InputLabel shrink error={!!error} {...inputLabelProps}>\n {label}\n </InputLabel>\n )}\n <Input\n error={!!error}\n inputProps={{\n type: 'file',\n disabled: disabled || isSubmitting,\n name: field.name,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: (event: React.ChangeEvent<any>) => {\n if (inputProps?.onChange) {\n inputProps.onChange(event);\n } else {\n const file = event.currentTarget.files[0];\n setFieldValue(field.name, file);\n }\n },\n }}\n {...inputProps}\n />\n {error && <FormHelperText error>{error}</FormHelperText>}\n </FormControl>\n );\n};\n","import * as React from 'react';\nimport MuiRadioGroup, {\n RadioGroupProps as MuiRadioGroupProps,\n} from '@material-ui/core/RadioGroup';\nimport { FieldProps } from 'formik';\n\nexport interface RadioGroupProps\n extends FieldProps,\n Omit<MuiRadioGroupProps, 'name' | 'value'> {}\n\nexport function fieldToRadioGroup({\n field: { onBlur: fieldOnBlur, ...field },\n form,\n onBlur,\n ...props\n}: RadioGroupProps): MuiRadioGroupProps {\n return {\n onBlur:\n onBlur ??\n function (e) {\n fieldOnBlur(e ?? field.name);\n },\n ...field,\n ...props,\n };\n}\n\nexport function RadioGroup(props: RadioGroupProps) {\n return <MuiRadioGroup {...fieldToRadioGroup(props)} />;\n}\n\nRadioGroup.displayName = 'FormikMaterialUIRadioGroup';\n","import * as React from 'react';\nimport MuiInputBase, {\n InputBaseProps as MuiInputBaseProps,\n} from '@material-ui/core/InputBase';\nimport { FieldProps } from 'formik';\n\nexport interface InputBaseProps\n extends FieldProps,\n Omit<MuiInputBaseProps, 'name' | 'value' | 'error'> {}\n\nexport function fieldToInputBase({\n disabled,\n field: { onBlur: fieldOnBlur, ...field },\n form: { isSubmitting },\n onBlur,\n ...props\n}: InputBaseProps): MuiInputBaseProps {\n return {\n disabled: disabled ?? isSubmitting,\n onBlur:\n onBlur ??\n function (e) {\n fieldOnBlur(e ?? field.name);\n },\n ...field,\n ...props,\n };\n}\n\nexport function InputBase(props: InputBaseProps) {\n return <MuiInputBase {...fieldToInputBase(props)} />;\n}\n\nInputBase.displayName = 'FormikMaterialUIInputBase';\n"]},"metadata":{},"sourceType":"module"} |