a35637556ccf48a19651b9ad80ea73ad.json
8.45 KB
{"ast":null,"code":"\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _objectWithoutProperties2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutProperties\"));\n\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\n\nvar _utils = require(\"../utils\");\n\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 || (0, _utils.getSecondaryColor)(primaryColor);\n twoToneColorPalette.calculated = !!secondaryColor;\n}\n\nfunction getTwoToneColors() {\n return (0, _objectSpread2.default)({}, 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 = (0, _objectWithoutProperties2.default)(props, [\"icon\", \"className\", \"onClick\", \"style\", \"primaryColor\", \"secondaryColor\"]);\n var colors = twoToneColorPalette;\n\n if (primaryColor) {\n colors = {\n primaryColor: primaryColor,\n secondaryColor: secondaryColor || (0, _utils.getSecondaryColor)(primaryColor)\n };\n }\n\n (0, _utils.useInsertStyles)();\n (0, _utils.warning)((0, _utils.isIconDefinition)(icon), \"icon should be icon definiton, but got \".concat(icon));\n\n if (!(0, _utils.isIconDefinition)(icon)) {\n return null;\n }\n\n var target = icon;\n\n if (target && typeof target.icon === 'function') {\n target = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, target), {}, {\n icon: target.icon(colors.primaryColor, colors.secondaryColor)\n });\n }\n\n return (0, _utils.generate)(target.icon, \"svg-\".concat(target.name), (0, _objectSpread2.default)({\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;\nvar _default = IconBase;\nexports.default = _default;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/@ant-design/icons/lib/components/IconBase.js"],"names":["_interopRequireDefault","require","Object","defineProperty","exports","value","default","_objectWithoutProperties2","_objectSpread2","_utils","twoToneColorPalette","primaryColor","secondaryColor","calculated","setTwoToneColors","_ref","getSecondaryColor","getTwoToneColors","IconBase","props","icon","className","onClick","style","restProps","colors","useInsertStyles","warning","isIconDefinition","concat","target","generate","name","width","height","fill","displayName","_default"],"mappings":"AAAA;;AAEA,IAAIA,sBAAsB,GAAGC,OAAO,CAAC,8CAAD,CAApC;;AAEAC,MAAM,CAACC,cAAP,CAAsBC,OAAtB,EAA+B,YAA/B,EAA6C;AAC3CC,EAAAA,KAAK,EAAE;AADoC,CAA7C;AAGAD,OAAO,CAACE,OAAR,GAAkB,KAAK,CAAvB;;AAEA,IAAIC,yBAAyB,GAAGP,sBAAsB,CAACC,OAAO,CAAC,gDAAD,CAAR,CAAtD;;AAEA,IAAIO,cAAc,GAAGR,sBAAsB,CAACC,OAAO,CAAC,sCAAD,CAAR,CAA3C;;AAEA,IAAIQ,MAAM,GAAGR,OAAO,CAAC,UAAD,CAApB;;AAEA,IAAIS,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,IAA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GAAkB+B,QAAlB","sourcesContent":["\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _objectWithoutProperties2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutProperties\"));\n\nvar _objectSpread2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectSpread2\"));\n\nvar _utils = require(\"../utils\");\n\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 || (0, _utils.getSecondaryColor)(primaryColor);\n twoToneColorPalette.calculated = !!secondaryColor;\n}\n\nfunction getTwoToneColors() {\n return (0, _objectSpread2.default)({}, 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 = (0, _objectWithoutProperties2.default)(props, [\"icon\", \"className\", \"onClick\", \"style\", \"primaryColor\", \"secondaryColor\"]);\n var colors = twoToneColorPalette;\n\n if (primaryColor) {\n colors = {\n primaryColor: primaryColor,\n secondaryColor: secondaryColor || (0, _utils.getSecondaryColor)(primaryColor)\n };\n }\n\n (0, _utils.useInsertStyles)();\n (0, _utils.warning)((0, _utils.isIconDefinition)(icon), \"icon should be icon definiton, but got \".concat(icon));\n\n if (!(0, _utils.isIconDefinition)(icon)) {\n return null;\n }\n\n var target = icon;\n\n if (target && typeof target.icon === 'function') {\n target = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, target), {}, {\n icon: target.icon(colors.primaryColor, colors.secondaryColor)\n });\n }\n\n return (0, _utils.generate)(target.icon, \"svg-\".concat(target.name), (0, _objectSpread2.default)({\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;\nvar _default = IconBase;\nexports.default = _default;"]},"metadata":{},"sourceType":"script"}