e77a180ada04710c87c65a2fc84e17e6.json 25 KB
{"ast":null,"code":"var _interopRequireWildcard=require(\"@babel/runtime/helpers/interopRequireWildcard\");var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _applyNativeMethods=_interopRequireDefault(require(\"../../modules/applyNativeMethods\"));var _ColorPropType=_interopRequireDefault(require(\"../ColorPropType\"));var _createElement=_interopRequireDefault(require(\"../createElement\"));var _multiplyStyleLengthValue=_interopRequireDefault(require(\"../../modules/multiplyStyleLengthValue\"));var _StyleSheet=_interopRequireDefault(require(\"../StyleSheet\"));var _UIManager=_interopRequireDefault(require(\"../UIManager\"));var _View=_interopRequireDefault(require(\"../View\"));var _ViewPropTypes=_interopRequireDefault(require(\"../ViewPropTypes\"));var _react=_interopRequireWildcard(require(\"react\"));var _propTypes=require(\"prop-types\");function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==='function'){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable;}));}ownKeys.forEach(function(key){_defineProperty(target,key,source[key]);});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype);subClass.prototype.constructor=subClass;subClass.__proto__=superClass;}var emptyObject={};var thumbDefaultBoxShadow='0px 1px 3px rgba(0,0,0,0.5)';var thumbFocusedBoxShadow=thumbDefaultBoxShadow+\", 0 0 0 10px rgba(0,0,0,0.1)\";var Switch=function(_Component){_inheritsLoose(Switch,_Component);function Switch(){var _this;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_Component.call.apply(_Component,[this].concat(args))||this;_this._handleChange=function(event){var onValueChange=_this.props.onValueChange;onValueChange&&onValueChange(event.nativeEvent.target.checked);};_this._handleFocusState=function(event){var isFocused=event.nativeEvent.type==='focus';var boxShadow=isFocused?thumbFocusedBoxShadow:thumbDefaultBoxShadow;if(_this._thumbElement){_this._thumbElement.setNativeProps({style:{boxShadow:boxShadow}});}};_this._setCheckboxRef=function(element){_this._checkboxElement=element;};_this._setThumbRef=function(element){_this._thumbElement=element;};return _this;}var _proto=Switch.prototype;_proto.blur=function blur(){_UIManager.default.blur(this._checkboxElement);};_proto.focus=function focus(){_UIManager.default.focus(this._checkboxElement);};_proto.render=function render(){var _this$props=this.props,accessibilityLabel=_this$props.accessibilityLabel,activeThumbColor=_this$props.activeThumbColor,activeTrackColor=_this$props.activeTrackColor,disabled=_this$props.disabled,onValueChange=_this$props.onValueChange,style=_this$props.style,thumbColor=_this$props.thumbColor,trackColor=_this$props.trackColor,value=_this$props.value,onTintColor=_this$props.onTintColor,thumbTintColor=_this$props.thumbTintColor,tintColor=_this$props.tintColor,other=_objectWithoutPropertiesLoose(_this$props,[\"accessibilityLabel\",\"activeThumbColor\",\"activeTrackColor\",\"disabled\",\"onValueChange\",\"style\",\"thumbColor\",\"trackColor\",\"value\",\"onTintColor\",\"thumbTintColor\",\"tintColor\"]);var _StyleSheet$flatten=_StyleSheet.default.flatten(style),styleHeight=_StyleSheet$flatten.height,styleWidth=_StyleSheet$flatten.width;var height=styleHeight||20;var minWidth=(0,_multiplyStyleLengthValue.default)(height,2);var width=styleWidth>minWidth?styleWidth:minWidth;var trackBorderRadius=(0,_multiplyStyleLengthValue.default)(height,0.5);var trackCurrentColor=value?onTintColor||activeTrackColor:tintColor||trackColor;var thumbCurrentColor=value?activeThumbColor:thumbTintColor||thumbColor;var thumbHeight=height;var thumbWidth=thumbHeight;var rootStyle=[styles.root,style,{height:height,width:width},disabled&&styles.cursorDefault];var trackStyle=[styles.track,{backgroundColor:trackCurrentColor,borderRadius:trackBorderRadius},disabled&&styles.disabledTrack];var thumbStyle=[styles.thumb,{backgroundColor:thumbCurrentColor,height:thumbHeight,width:thumbWidth},disabled&&styles.disabledThumb];var nativeControl=(0,_createElement.default)('input',{accessibilityLabel:accessibilityLabel,checked:value,disabled:disabled,onBlur:this._handleFocusState,onChange:this._handleChange,onFocus:this._handleFocusState,ref:this._setCheckboxRef,style:[styles.nativeControl,styles.cursorInherit],type:'checkbox'});return _react.default.createElement(_View.default,_extends({},other,{style:rootStyle}),_react.default.createElement(_View.default,{style:trackStyle}),_react.default.createElement(_View.default,{ref:this._setThumbRef,style:[thumbStyle,value&&styles.thumbOn,{marginStart:value?(0,_multiplyStyleLengthValue.default)(thumbWidth,-1):0}]}),nativeControl);};return Switch;}(_react.Component);Switch.displayName='Switch';Switch.defaultProps={activeThumbColor:'#009688',activeTrackColor:'#A3D3CF',disabled:false,style:emptyObject,thumbColor:'#FAFAFA',trackColor:'#939393',value:false};Switch.propTypes=process.env.NODE_ENV!==\"production\"?_objectSpread({},_ViewPropTypes.default,{activeThumbColor:_ColorPropType.default,activeTrackColor:_ColorPropType.default,disabled:_propTypes.bool,onValueChange:_propTypes.func,thumbColor:_ColorPropType.default,trackColor:_ColorPropType.default,value:_propTypes.bool,onTintColor:_ColorPropType.default,thumbTintColor:_ColorPropType.default,tintColor:_ColorPropType.default}):{};var styles=_StyleSheet.default.create({root:{cursor:'pointer',userSelect:'none'},cursorDefault:{cursor:'default'},cursorInherit:{cursor:'inherit'},track:_objectSpread({},_StyleSheet.default.absoluteFillObject,{height:'70%',margin:'auto',transitionDuration:'0.1s',width:'100%'}),disabledTrack:{backgroundColor:'#D5D5D5'},thumb:{alignSelf:'flex-start',borderRadius:'100%',boxShadow:thumbDefaultBoxShadow,start:'0%',transform:[{translateZ:0}],transitionDuration:'0.1s'},thumbOn:{start:'100%'},disabledThumb:{backgroundColor:'#BDBDBD'},nativeControl:_objectSpread({},_StyleSheet.default.absoluteFillObject,{height:'100%',margin:0,opacity:0,padding:0,width:'100%'})});var _default=(0,_applyNativeMethods.default)(Switch);exports.default=_default;","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-web/dist/exports/Switch/index.js"],"names":["_objectSpread","target","i","arguments","length","source","ownKeys","Object","keys","getOwnPropertySymbols","concat","filter","sym","getOwnPropertyDescriptor","enumerable","forEach","key","_defineProperty","obj","value","defineProperty","configurable","writable","_extends","assign","prototype","hasOwnProperty","call","apply","_objectWithoutPropertiesLoose","excluded","sourceKeys","indexOf","_inheritsLoose","subClass","superClass","create","constructor","__proto__","emptyObject","thumbDefaultBoxShadow","thumbFocusedBoxShadow","Switch","_Component","_this","_len","args","Array","_key","_handleChange","event","onValueChange","props","nativeEvent","checked","_handleFocusState","isFocused","type","boxShadow","_thumbElement","setNativeProps","style","_setCheckboxRef","element","_checkboxElement","_setThumbRef","_proto","blur","UIManager","focus","render","_this$props","accessibilityLabel","activeThumbColor","activeTrackColor","disabled","thumbColor","trackColor","onTintColor","thumbTintColor","tintColor","other","_StyleSheet$flatten","StyleSheet","flatten","styleHeight","height","styleWidth","width","minWidth","trackBorderRadius","trackCurrentColor","thumbCurrentColor","thumbHeight","thumbWidth","rootStyle","styles","root","cursorDefault","trackStyle","track","backgroundColor","borderRadius","disabledTrack","thumbStyle","thumb","disabledThumb","nativeControl","onBlur","onChange","onFocus","ref","cursorInherit","React","createElement","View","thumbOn","marginStart","Component","displayName","defaultProps","propTypes","process","env","NODE_ENV","ViewPropTypes","ColorPropType","bool","func","cursor","userSelect","absoluteFillObject","margin","transit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,EAhBL,CAiBA,GAAI9B,CAAAA,MAAM,CAAGb,oBAAW/C,MAAX,CAAkB,CAC7B6D,IAAI,CAAE,CACJgC,MAAM,CAAE,SADJ,CAEJC,UAAU,CAAE,MAFR,CADuB,CAK7BhC,aAAa,CAAE,CACb+B,MAAM,CAAE,SADK,CALc,CAQ7BjB,aAAa,CAAE,CACbiB,MAAM,CAAE,SADK,CARc,CAW7B7B,KAAK,CAAEpG,aAAa,CAAC,EAAD,CAAKmF,oBAAWgD,kBAAhB,CAAoC,CACtD7C,MAAM,CAAE,KAD8C,CAEtD8C,MAAM,CAAE,MAF8C,CAGtDC,kBAAkB,CAAE,MAHkC,CAItD7C,KAAK,CAAE,MAJ+C,CAApC,CAXS,CAiB7Be,aAAa,CAAE,CACbF,eAAe,CAAE,SADJ,CAjBc,CAoB7BI,KAAK,CAAE,CACL6B,SAAS,CAAE,YADN,CAELhC,YAAY,CAAE,MAFT,CAGL5C,SAAS,CAAElB,qBAHN,CAIL+F,KAAK,CAAE,IAJF,CAKLC,SAAS,CAAE,CAAC,CACVC,UAAU,CAAE,CADF,CAAD,CALN,CAQLJ,kBAAkB,CAAE,MARf,CApBsB,CA8B7BjB,OAAO,CAAE,CACPmB,KAAK,CAAE,MADA,CA9BoB,CAiC7B7B,aAAa,CAAE,CACbL,eAAe,CAAE,SADJ,CAjCc,CAoC7BM,aAAa,CAAE3G,aAAa,CAAC,EAAD,CAAKmF,oBAAWgD,kBAAhB,CAAoC,CAC9D7C,MAAM,CAAE,MADsD,CAE9D8C,MAAM,CAAE,CAFsD,CAG9DM,OAAO,CAAE,CAHqD,CAI9DC,OAAO,CAAE,CAJqD,CAK9DnD,KAAK,CAAE,MALuD,CAApC,CApCC,CAAlB,CAAb,C,aA4Ce,gCAAmB9C,MAAnB,C","sourcesContent":["function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\n/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport applyNativeMethods from '../../modules/applyNativeMethods';\nimport ColorPropType from '../ColorPropType';\nimport createElement from '../createElement';\nimport multiplyStyleLengthValue from '../../modules/multiplyStyleLengthValue';\nimport StyleSheet from '../StyleSheet';\nimport UIManager from '../UIManager';\nimport View from '../View';\nimport ViewPropTypes from '../ViewPropTypes';\nimport React, { Component } from 'react';\nimport { bool, func } from 'prop-types';\nvar emptyObject = {};\nvar thumbDefaultBoxShadow = '0px 1px 3px rgba(0,0,0,0.5)';\nvar thumbFocusedBoxShadow = thumbDefaultBoxShadow + \", 0 0 0 10px rgba(0,0,0,0.1)\";\n\nvar Switch =\n/*#__PURE__*/\nfunction (_Component) {\n  _inheritsLoose(Switch, _Component);\n\n  function Switch() {\n    var _this;\n\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n\n    _this = _Component.call.apply(_Component, [this].concat(args)) || this;\n\n    _this._handleChange = function (event) {\n      var onValueChange = _this.props.onValueChange;\n      onValueChange && onValueChange(event.nativeEvent.target.checked);\n    };\n\n    _this._handleFocusState = function (event) {\n      var isFocused = event.nativeEvent.type === 'focus';\n      var boxShadow = isFocused ? thumbFocusedBoxShadow : thumbDefaultBoxShadow;\n\n      if (_this._thumbElement) {\n        _this._thumbElement.setNativeProps({\n          style: {\n            boxShadow: boxShadow\n          }\n        });\n      }\n    };\n\n    _this._setCheckboxRef = function (element) {\n      _this._checkboxElement = element;\n    };\n\n    _this._setThumbRef = function (element) {\n      _this._thumbElement = element;\n    };\n\n    return _this;\n  }\n\n  var _proto = Switch.prototype;\n\n  _proto.blur = function blur() {\n    UIManager.blur(this._checkboxElement);\n  };\n\n  _proto.focus = function focus() {\n    UIManager.focus(this._checkboxElement);\n  };\n\n  _proto.render = function render() {\n    var _this$props = this.props,\n        accessibilityLabel = _this$props.accessibilityLabel,\n        activeThumbColor = _this$props.activeThumbColor,\n        activeTrackColor = _this$props.activeTrackColor,\n        disabled = _this$props.disabled,\n        onValueChange = _this$props.onValueChange,\n        style = _this$props.style,\n        thumbColor = _this$props.thumbColor,\n        trackColor = _this$props.trackColor,\n        value = _this$props.value,\n        onTintColor = _this$props.onTintColor,\n        thumbTintColor = _this$props.thumbTintColor,\n        tintColor = _this$props.tintColor,\n        other = _objectWithoutPropertiesLoose(_this$props, [\"accessibilityLabel\", \"activeThumbColor\", \"activeTrackColor\", \"disabled\", \"onValueChange\", \"style\", \"thumbColor\", \"trackColor\", \"value\", \"onTintColor\", \"thumbTintColor\", \"tintColor\"]);\n\n    var _StyleSheet$flatten = StyleSheet.flatten(style),\n        styleHeight = _StyleSheet$flatten.height,\n        styleWidth = _StyleSheet$flatten.width;\n\n    var height = styleHeight || 20;\n    var minWidth = multiplyStyleLengthValue(height, 2);\n    var width = styleWidth > minWidth ? styleWidth : minWidth;\n    var trackBorderRadius = multiplyStyleLengthValue(height, 0.5);\n    var trackCurrentColor = value ? onTintColor || activeTrackColor : tintColor || trackColor;\n    var thumbCurrentColor = value ? activeThumbColor : thumbTintColor || thumbColor;\n    var thumbHeight = height;\n    var thumbWidth = thumbHeight;\n    var rootStyle = [styles.root, style, {\n      height: height,\n      width: width\n    }, disabled && styles.cursorDefault];\n    var trackStyle = [styles.track, {\n      backgroundColor: trackCurrentColor,\n      borderRadius: trackBorderRadius\n    }, disabled && styles.disabledTrack];\n    var thumbStyle = [styles.thumb, {\n      backgroundColor: thumbCurrentColor,\n      height: thumbHeight,\n      width: thumbWidth\n    }, disabled && styles.disabledThumb];\n    var nativeControl = createElement('input', {\n      accessibilityLabel: accessibilityLabel,\n      checked: value,\n      disabled: disabled,\n      onBlur: this._handleFocusState,\n      onChange: this._handleChange,\n      onFocus: this._handleFocusState,\n      ref: this._setCheckboxRef,\n      style: [styles.nativeControl, styles.cursorInherit],\n      type: 'checkbox'\n    });\n    return React.createElement(View, _extends({}, other, {\n      style: rootStyle\n    }), React.createElement(View, {\n      style: trackStyle\n    }), React.createElement(View, {\n      ref: this._setThumbRef,\n      style: [thumbStyle, value && styles.thumbOn, {\n        marginStart: value ? multiplyStyleLengthValue(thumbWidth, -1) : 0\n      }]\n    }), nativeControl);\n  };\n\n  return Switch;\n}(Component);\n\nSwitch.displayName = 'Switch';\nSwitch.defaultProps = {\n  activeThumbColor: '#009688',\n  activeTrackColor: '#A3D3CF',\n  disabled: false,\n  style: emptyObject,\n  thumbColor: '#FAFAFA',\n  trackColor: '#939393',\n  value: false\n};\nSwitch.propTypes = process.env.NODE_ENV !== \"production\" ? _objectSpread({}, ViewPropTypes, {\n  activeThumbColor: ColorPropType,\n  activeTrackColor: ColorPropType,\n  disabled: bool,\n  onValueChange: func,\n  thumbColor: ColorPropType,\n  trackColor: ColorPropType,\n  value: bool,\n\n  /* eslint-disable react/sort-prop-types */\n  // Equivalent of 'activeTrackColor'\n  onTintColor: ColorPropType,\n  // Equivalent of 'thumbColor'\n  thumbTintColor: ColorPropType,\n  // Equivalent of 'trackColor'\n  tintColor: ColorPropType\n}) : {};\nvar styles = StyleSheet.create({\n  root: {\n    cursor: 'pointer',\n    userSelect: 'none'\n  },\n  cursorDefault: {\n    cursor: 'default'\n  },\n  cursorInherit: {\n    cursor: 'inherit'\n  },\n  track: _objectSpread({}, StyleSheet.absoluteFillObject, {\n    height: '70%',\n    margin: 'auto',\n    transitionDuration: '0.1s',\n    width: '100%'\n  }),\n  disabledTrack: {\n    backgroundColor: '#D5D5D5'\n  },\n  thumb: {\n    alignSelf: 'flex-start',\n    borderRadius: '100%',\n    boxShadow: thumbDefaultBoxShadow,\n    start: '0%',\n    transform: [{\n      translateZ: 0\n    }],\n    transitionDuration: '0.1s'\n  },\n  thumbOn: {\n    start: '100%'\n  },\n  disabledThumb: {\n    backgroundColor: '#BDBDBD'\n  },\n  nativeControl: _objectSpread({}, StyleSheet.absoluteFillObject, {\n    height: '100%',\n    margin: 0,\n    opacity: 0,\n    padding: 0,\n    width: '100%'\n  })\n});\nexport default applyNativeMethods(Switch);"]},"metadata":{},"sourceType":"script"}