|
- {"ast":null,"code":"import _classCallCheck from \"/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/inherits\";\n\nvar _jsxFileName = \"/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/src/shared/components/form/CheckBox.tsx\",\n _this = this;\n\n/* eslint-disable jsx-a11y/label-has-for */\nimport classNames from 'classnames';\nimport CheckIcon from 'mdi-react/CheckIcon';\nimport CloseIcon from 'mdi-react/CloseIcon';\nimport React, { PureComponent } from 'react';\n;\n\nvar CheckBoxField = /*#__PURE__*/function (_PureComponent) {\n _inherits(CheckBoxField, _PureComponent);\n\n function CheckBoxField() {\n _classCallCheck(this, CheckBoxField);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(CheckBoxField).apply(this, arguments));\n }\n\n _createClass(CheckBoxField, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props = this.props,\n onChange = _this$props.onChange,\n defaultChecked = _this$props.defaultChecked;\n onChange(defaultChecked);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n disabled = _this$props2.disabled,\n className = _this$props2.className,\n name = _this$props2.name,\n value = _this$props2.value,\n onChange = _this$props2.onChange,\n label = _this$props2.label,\n color = _this$props2.color;\n var CheckboxClass = classNames({\n 'checkbox-btn': true,\n disabled: disabled\n });\n return /*#__PURE__*/React.createElement(\"label\", {\n className: \"\".concat(CheckboxClass, \" \").concat(className ? \" checkbox-btn--\".concat(className) : ''),\n htmlFor: name,\n __self: this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 7\n }\n }, /*#__PURE__*/React.createElement(\"input\", {\n className: \"checkbox-btn__checkbox\",\n type: \"checkbox\",\n id: name,\n name: name,\n onChange: onChange,\n checked: value,\n disabled: disabled,\n __self: this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 9\n }\n }), /*#__PURE__*/React.createElement(\"span\", {\n className: \"checkbox-btn__checkbox-custom\",\n style: color ? {\n background: color,\n borderColor: color\n } : {},\n __self: this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 9\n }\n }, /*#__PURE__*/React.createElement(CheckIcon, {\n __self: this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 11\n }\n })), className === 'button' ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"checkbox-btn__label-svg\",\n __self: this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 13\n }\n }, /*#__PURE__*/React.createElement(CheckIcon, {\n className: \"checkbox-btn__label-check\",\n __self: this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 15\n }\n }), /*#__PURE__*/React.createElement(CloseIcon, {\n className: \"checkbox-btn__label-uncheck\",\n __self: this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 69,\n columnNumber: 15\n }\n })) : '', /*#__PURE__*/React.createElement(\"span\", {\n className: \"checkbox-btn__label\",\n __self: this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 9\n }\n }, label));\n }\n }]);\n\n return CheckBoxField;\n}(PureComponent);\n\nCheckBoxField.defaultProps = {\n name: '',\n label: '',\n defaultChecked: false,\n disabled: false,\n value: false,\n className: '',\n color: ''\n};\n;\n\nvar renderCheckBoxField = function renderCheckBoxField(props) {\n var input = props.input,\n _props$label = props.label,\n label = _props$label === void 0 ? '' : _props$label,\n _props$defaultChecked = props.defaultChecked,\n defaultChecked = _props$defaultChecked === void 0 ? false : _props$defaultChecked,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n _props$className = props.className,\n className = _props$className === void 0 ? '' : _props$className,\n _props$color = props.color,\n color = _props$color === void 0 ? '' : _props$color;\n return /*#__PURE__*/React.createElement(CheckBoxField, Object.assign({}, input, {\n label: label,\n defaultChecked: defaultChecked,\n disabled: disabled,\n className: className,\n color: color,\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 5\n }\n }));\n}; // export default renderCheckBoxField;\n\n\nexport default CheckBoxField;","map":{"version":3,"sources":["/Users/michielcarman/Server Code/Repository/clients-rpm-kit-manager/code/RPM.KitManager/RPM.KitManager.Web/ClientApp/src/shared/components/form/CheckBox.tsx"],"names":["classNames","CheckIcon","CloseIcon","React","PureComponent","CheckBoxField","props","onChange","defaultChecked","disabled","className","name","value","label","color","CheckboxClass","background","borderColor","defaultProps","renderCheckBoxField","input"],"mappings":";;;;;;;;;AAAA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,OAAOC,SAAP,MAAsB,qBAAtB;AACA,OAAOC,SAAP,MAAsB,qBAAtB;AACA,OAAOC,KAAP,IAAgBC,aAAhB,QAAqC,OAArC;AAYC;;IAEKC,a;;;;;;;;;;;wCAYgB;AAAA,wBACmB,KAAKC,KADxB;AAAA,UACVC,QADU,eACVA,QADU;AAAA,UACA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T;AAGE,IAAA,cAAc,EAAEL,cAHlB;AAIE,IAAA,QAAQ,EAAEC,QAJZ;AAKE,IAAA,SAAS,EAAEC,SALb;AAME,IAAA,KAAK,EAAEI,KANT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KADF;AAUD,CAdD,C,CAgBA;;;AACA,eAAeT,aAAf","sourcesContent":["/* eslint-disable jsx-a11y/label-has-for */\nimport classNames from 'classnames';\nimport CheckIcon from 'mdi-react/CheckIcon';\nimport CloseIcon from 'mdi-react/CloseIcon';\nimport React, { PureComponent } from 'react';\nimport { FunctionComponent } from 'react';\n\ninterface CheckBoxFieldProps {\n onChange: any, // Function\n name?: string,\n label?: string,\n defaultChecked?: boolean,\n disabled?: boolean,\n value?: boolean,\n className?: string,\n color?: string,\n};\n\nclass CheckBoxField extends PureComponent<CheckBoxFieldProps> {\n\n static defaultProps = {\n name: '',\n label: '',\n defaultChecked: false,\n disabled: false,\n value: false,\n className: '',\n color: '',\n };\n\n componentDidMount() {\n const { onChange, defaultChecked } = this.props;\n onChange(defaultChecked);\n }\n\n render() {\n const {\n disabled, className, name, value, onChange, label, color,\n } = this.props;\n const CheckboxClass = classNames({\n 'checkbox-btn': true,\n disabled,\n });\n\n return (\n <label\n className={`${CheckboxClass} ${className ? ` checkbox-btn--${className}` : ''}`}\n htmlFor={name}\n >\n <input\n className=\"checkbox-btn__checkbox\"\n type=\"checkbox\"\n id={name}\n name={name}\n onChange={onChange}\n checked={value}\n disabled={disabled}\n />\n <span\n className=\"checkbox-btn__checkbox-custom\"\n style={color ? { background: color, borderColor: color } : {}}\n >\n <CheckIcon />\n </span>\n {className === 'button'\n ? (\n <span className=\"checkbox-btn__label-svg\">\n <CheckIcon className=\"checkbox-btn__label-check\" />\n <CloseIcon className=\"checkbox-btn__label-uncheck\" />\n </span>\n ) : ''}\n <span className=\"checkbox-btn__label\">\n {label}\n </span>\n </label>\n );\n }\n}\n\n\ninterface renderCheckBoxFieldProps {\n input: {\n onChange: any, // function\n name: string,\n value: boolean\n },\n label?: string,\n defaultChecked?: boolean,\n disabled?: boolean,\n className?: string,\n color?: string,\n};\n\nconst renderCheckBoxField: FunctionComponent<renderCheckBoxFieldProps> = (props) => {\n const {\n input, label = '', defaultChecked = false, disabled = false, className = '', color = '',\n } = props;\n return (\n <CheckBoxField\n {...input}\n label={label}\n defaultChecked={defaultChecked}\n disabled={disabled}\n className={className}\n color={color}\n />\n );\n};\n\n// export default renderCheckBoxField;\nexport default CheckBoxField;\n"]},"metadata":{},"sourceType":"module"}
|