d4244f5f5fc3b78c1736c14f447a7c70.json 7.08 KB
{"ast":null,"code":"import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport { generate, getSecondaryColor, isIconDefinition, warning, useInsertStyles } from '../utils';\nvar twoToneColorPalette = {\n  primaryColor: '#333',\n  secondaryColor: '#E6E6E6',\n  calculated: false\n};\n\nfunction setTwoToneColors(_ref) {\n  var primaryColor = _ref.primaryColor,\n      secondaryColor = _ref.secondaryColor;\n  twoToneColorPalette.primaryColor = primaryColor;\n  twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);\n  twoToneColorPalette.calculated = !!secondaryColor;\n}\n\nfunction getTwoToneColors() {\n  return _objectSpread({}, twoToneColorPalette);\n}\n\nvar IconBase = function IconBase(props) {\n  var icon = props.icon,\n      className = props.className,\n      onClick = props.onClick,\n      style = props.style,\n      primaryColor = props.primaryColor,\n      secondaryColor = props.secondaryColor,\n      restProps = _objectWithoutProperties(props, [\"icon\", \"className\", \"onClick\", \"style\", \"primaryColor\", \"secondaryColor\"]);\n\n  var colors = twoToneColorPalette;\n\n  if (primaryColor) {\n    colors = {\n      primaryColor: primaryColor,\n      secondaryColor: secondaryColor || getSecondaryColor(primaryColor)\n    };\n  }\n\n  useInsertStyles();\n  warning(isIconDefinition(icon), \"icon should be icon definiton, but got \".concat(icon));\n\n  if (!isIconDefinition(icon)) {\n    return null;\n  }\n\n  var target = icon;\n\n  if (target && typeof target.icon === 'function') {\n    target = _objectSpread(_objectSpread({}, target), {}, {\n      icon: target.icon(colors.primaryColor, colors.secondaryColor)\n    });\n  }\n\n  return generate(target.icon, \"svg-\".concat(target.name), _objectSpread({\n    className: className,\n    onClick: onClick,\n    style: style,\n    'data-icon': target.name,\n    width: '1em',\n    height: '1em',\n    fill: 'currentColor',\n    'aria-hidden': 'true'\n  }, restProps));\n};\n\nIconBase.displayName = 'IconReact';\nIconBase.getTwoToneColors = getTwoToneColors;\nIconBase.setTwoToneColors = setTwoToneColors;\nexport default IconBase;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/@ant-design/icons/es/components/IconBase.js"],"names":["_objectWithoutProperties","_objectSpread","generate","getSecondaryColor","isIconDefinition","warning","useInsertStyles","twoToneColorPalette","primaryColor","secondaryColor","calculated","setTwoToneColors","_ref","getTwoToneColors","IconBase","props","icon","className","onClick","style","restProps","colors","concat","target","name","width","height","fill","displayName"],"mappings":"AAAA,OAAOA,wBAAP,MAAqC,oDAArC;AACA,OAAOC,aAAP,MAA0B,0CAA1B;AACA,SAASC,QAAT,EAAmBC,iBAAnB,EAAsCC,gBAAtC,EAAwDC,OAAxD,EAAiEC,eAAjE,QAAwF,UAAxF;AACA,IAAIC,mBAAmB,GAAG;AACxBC,EAAAA,YAAY,EAAE,MADU;AAExBC,EAAAA,cAAc,EAAE,SAFQ;AAGxBC,EAAAA,UAAU,EAAE;AAHY,CAA1B;;AAMA,SAASC,gBAAT,CAA0BC,IAA1B,EAAgC;AAC9B,MAAIJ,YAAY,GAAGI,IAAI,CAACJ,YAAxB;AAAA,MACIC,cAAc,GAAGG,IAAI,CAACH,cAD1B;AAEAF,EAAAA,mBAAmB,CAACC,YAApB,GAAmCA,YAAnC;AACAD,EAAAA,mBAAmB,CAACE,cAApB,GAAqCA,cAAc,IAAIN,iBAAiB,CAACK,YAAD,CAAxE;AACAD,EAAAA,mBAAmB,CAACG,UAApB,GAAiC,CAAC,CAACD,cAAnC;AACD;;AAED,SAASI,gBAAT,GAA4B;AAC1B,SAAOZ,aAAa,CAAC,EAAD,EAAKM,mBAAL,CAApB;AACD;;AAED,IAAIO,QAAQ,GAAG,SAASA,QAAT,CAAkBC,KAAlB,EAAyB;AACtC,MAAIC,IAAI,GAAGD,KAAK,CAACC,IAAjB;AAAA,MACIC,SAAS,GAAGF,KAAK,CAACE,SADtB;AAAA,MAEIC,OAAO,GAAGH,KAAK,CAACG,O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C,IAAAA,KAAK,EAAEA,KAH8D;AAIrE,iBAAaI,MAAM,CAACC,IAJiD;AAKrEC,IAAAA,KAAK,EAAE,KAL8D;AAMrEC,IAAAA,MAAM,EAAE,KAN6D;AAOrEC,IAAAA,IAAI,EAAE,cAP+D;AAQrE,mBAAe;AARsD,GAAD,EASnEP,SATmE,CAAvD,CAAf;AAUD,CA3CD;;AA6CAN,QAAQ,CAACc,WAAT,GAAuB,WAAvB;AACAd,QAAQ,CAACD,gBAAT,GAA4BA,gBAA5B;AACAC,QAAQ,CAACH,gBAAT,GAA4BA,gBAA5B;AACA,eAAeG,QAAf","sourcesContent":["import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport { generate, getSecondaryColor, isIconDefinition, warning, useInsertStyles } from '../utils';\nvar twoToneColorPalette = {\n  primaryColor: '#333',\n  secondaryColor: '#E6E6E6',\n  calculated: false\n};\n\nfunction setTwoToneColors(_ref) {\n  var primaryColor = _ref.primaryColor,\n      secondaryColor = _ref.secondaryColor;\n  twoToneColorPalette.primaryColor = primaryColor;\n  twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);\n  twoToneColorPalette.calculated = !!secondaryColor;\n}\n\nfunction getTwoToneColors() {\n  return _objectSpread({}, twoToneColorPalette);\n}\n\nvar IconBase = function IconBase(props) {\n  var icon = props.icon,\n      className = props.className,\n      onClick = props.onClick,\n      style = props.style,\n      primaryColor = props.primaryColor,\n      secondaryColor = props.secondaryColor,\n      restProps = _objectWithoutProperties(props, [\"icon\", \"className\", \"onClick\", \"style\", \"primaryColor\", \"secondaryColor\"]);\n\n  var colors = twoToneColorPalette;\n\n  if (primaryColor) {\n    colors = {\n      primaryColor: primaryColor,\n      secondaryColor: secondaryColor || getSecondaryColor(primaryColor)\n    };\n  }\n\n  useInsertStyles();\n  warning(isIconDefinition(icon), \"icon should be icon definiton, but got \".concat(icon));\n\n  if (!isIconDefinition(icon)) {\n    return null;\n  }\n\n  var target = icon;\n\n  if (target && typeof target.icon === 'function') {\n    target = _objectSpread(_objectSpread({}, target), {}, {\n      icon: target.icon(colors.primaryColor, colors.secondaryColor)\n    });\n  }\n\n  return generate(target.icon, \"svg-\".concat(target.name), _objectSpread({\n    className: className,\n    onClick: onClick,\n    style: style,\n    'data-icon': target.name,\n    width: '1em',\n    height: '1em',\n    fill: 'currentColor',\n    'aria-hidden': 'true'\n  }, restProps));\n};\n\nIconBase.displayName = 'IconReact';\nIconBase.getTwoToneColors = getTwoToneColors;\nIconBase.setTwoToneColors = setTwoToneColors;\nexport default IconBase;"]},"metadata":{},"sourceType":"module"}