76a020d7499e9a20ce6ca193363f9893.json
8.15 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport DeleteOutlined from '@ant-design/icons/DeleteOutlined';\nimport defaultLocale from '../locale/default';\nimport Checkbox from '../checkbox';\nimport TransButton from '../_util/transButton';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\n\nvar ListItem = function ListItem(props) {\n var _classNames;\n\n var renderedText = props.renderedText,\n renderedEl = props.renderedEl,\n item = props.item,\n checked = props.checked,\n disabled = props.disabled,\n prefixCls = props.prefixCls,\n onClick = props.onClick,\n onRemove = props.onRemove,\n showRemove = props.showRemove;\n var className = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-content-item\"), true), _defineProperty(_classNames, \"\".concat(prefixCls, \"-content-item-disabled\"), disabled || item.disabled), _defineProperty(_classNames, \"\".concat(prefixCls, \"-content-item-checked\"), checked), _classNames));\n var title;\n\n if (typeof renderedText === 'string' || typeof renderedText === 'number') {\n title = String(renderedText);\n }\n\n return /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: \"Transfer\",\n defaultLocale: defaultLocale.Transfer\n }, function (transferLocale) {\n var liProps = {\n className: className,\n title: title\n };\n var labelNode = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-content-item-text\")\n }, renderedEl); // Show remove\n\n if (showRemove) {\n return /*#__PURE__*/React.createElement(\"li\", liProps, labelNode, /*#__PURE__*/React.createElement(TransButton, {\n disabled: disabled || item.disabled,\n className: \"\".concat(prefixCls, \"-content-item-remove\"),\n \"aria-label\": transferLocale.remove,\n onClick: function onClick() {\n onRemove === null || onRemove === void 0 ? void 0 : onRemove(item);\n }\n }, /*#__PURE__*/React.createElement(DeleteOutlined, null)));\n } // Default click to select\n\n\n liProps.onClick = disabled || item.disabled ? undefined : function () {\n return onClick(item);\n };\n return /*#__PURE__*/React.createElement(\"li\", liProps, /*#__PURE__*/React.createElement(Checkbox, {\n checked: checked,\n disabled: disabled || item.disabled\n }), labelNode);\n });\n};\n\nexport default /*#__PURE__*/React.memo(ListItem);","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/transfer/ListItem.js"],"names":["_defineProperty","React","classNames","DeleteOutlined","defaultLocale","Checkbox","TransButton","LocaleReceiver","ListItem","props","_classNames","renderedText","renderedEl","item","checked","disabled","prefixCls","onClick","onRemove","showRemove","className","concat","title","String","createElement","componentName","Transfer","transferLocale","liProps","labelNode","remove","undefined","memo"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,uCAA5B;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,cAAP,MAA2B,kCAA3B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,WAAP,MAAwB,sBAAxB;AACA,OAAOC,cAAP,MAA2B,mCAA3B;;AAEA,IAAIC,QAAQ,GAAG,SAASA,QAAT,CAAkBC,KAAlB,EAAyB;AACtC,MAAIC,WAAJ;;AAEA,MAAIC,YAAY,GAAGF,KAAK,CAACE,YAAzB;AAAA,MACIC,UAAU,GAAGH,KAAK,CAACG,UADvB;AAAA,MAEIC,IAAI,GAAGJ,KAAK,CAACI,IAFjB;AAAA,MAGIC,OAAO,GAAGL,KAAK,CAACK,OAHpB;AAAA,MAIIC,QAAQ,GAAGN,KAAK,CAACM,QAJrB;AAAA,MAKIC,SAAS,GAAGP,KAAK,CAACO,SALtB;AAAA,MAMIC,OAAO,GAAGR,KAAK,CAACQ,OANpB;AAAA,MAOIC,QAAQ,GAAGT,KAAK,CAACS,QAPrB;AAAA,MAQIC,UAAU,GAAGV,KAAK,CAACU,UARvB;AASA,MAAIC,SAAS,GAAGlB,UAAU,EAAEQ,WAAW,GAAG,EAAd,EAAkBV,eAAe,CAACU,WAAD,EAAc,GAAG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,EAAqB,sBAArB,CAFmG;AAG9G,sBAAcW,cAAc,CAACG,MAHiF;AAI9Gb,QAAAA,OAAO,EAAE,SAASA,OAAT,GAAmB;AAC1BC,UAAAA,QAAQ,KAAK,IAAb,IAAqBA,QAAQ,KAAK,KAAK,CAAvC,GAA2C,KAAK,CAAhD,GAAoDA,QAAQ,CAACL,IAAD,CAA5D;AACD;AAN6G,OAAjC,EAO5E,aAAaZ,KAAK,CAACuB,aAAN,CAAoBrB,cAApB,EAAoC,IAApC,CAP+D,CAA3D,CAApB;AAQD,KAlB0B,CAkBzB;;;AAGFyB,IAAAA,OAAO,CAACX,OAAR,GAAkBF,QAAQ,IAAIF,IAAI,CAACE,QAAjB,GAA4BgB,SAA5B,GAAwC,YAAY;AACpE,aAAOd,OAAO,CAACJ,IAAD,CAAd;AACD,KAFD;AAGA,WAAO,aAAaZ,KAAK,CAACuB,aAAN,CAAoB,IAApB,EAA0BI,OAA1B,EAAmC,aAAa3B,KAAK,CAACuB,aAAN,CAAoBnB,QAApB,EAA8B;AAChGS,MAAAA,OAAO,EAAEA,OADuF;AAEhGC,MAAAA,QAAQ,EAAEA,QAAQ,IAAIF,IAAI,CAACE;AAFqE,KAA9B,CAAhD,EAGhBc,SAHgB,CAApB;AAID,GA/BmB,CAApB;AAgCD,CAnDD;;AAqDA,eAAe,aAAa5B,KAAK,CAAC+B,IAAN,CAAWxB,QAAX,CAA5B","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport DeleteOutlined from '@ant-design/icons/DeleteOutlined';\nimport defaultLocale from '../locale/default';\nimport Checkbox from '../checkbox';\nimport TransButton from '../_util/transButton';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\n\nvar ListItem = function ListItem(props) {\n var _classNames;\n\n var renderedText = props.renderedText,\n renderedEl = props.renderedEl,\n item = props.item,\n checked = props.checked,\n disabled = props.disabled,\n prefixCls = props.prefixCls,\n onClick = props.onClick,\n onRemove = props.onRemove,\n showRemove = props.showRemove;\n var className = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-content-item\"), true), _defineProperty(_classNames, \"\".concat(prefixCls, \"-content-item-disabled\"), disabled || item.disabled), _defineProperty(_classNames, \"\".concat(prefixCls, \"-content-item-checked\"), checked), _classNames));\n var title;\n\n if (typeof renderedText === 'string' || typeof renderedText === 'number') {\n title = String(renderedText);\n }\n\n return /*#__PURE__*/React.createElement(LocaleReceiver, {\n componentName: \"Transfer\",\n defaultLocale: defaultLocale.Transfer\n }, function (transferLocale) {\n var liProps = {\n className: className,\n title: title\n };\n var labelNode = /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-content-item-text\")\n }, renderedEl); // Show remove\n\n if (showRemove) {\n return /*#__PURE__*/React.createElement(\"li\", liProps, labelNode, /*#__PURE__*/React.createElement(TransButton, {\n disabled: disabled || item.disabled,\n className: \"\".concat(prefixCls, \"-content-item-remove\"),\n \"aria-label\": transferLocale.remove,\n onClick: function onClick() {\n onRemove === null || onRemove === void 0 ? void 0 : onRemove(item);\n }\n }, /*#__PURE__*/React.createElement(DeleteOutlined, null)));\n } // Default click to select\n\n\n liProps.onClick = disabled || item.disabled ? undefined : function () {\n return onClick(item);\n };\n return /*#__PURE__*/React.createElement(\"li\", liProps, /*#__PURE__*/React.createElement(Checkbox, {\n checked: checked,\n disabled: disabled || item.disabled\n }), labelNode);\n });\n};\n\nexport default /*#__PURE__*/React.memo(ListItem);"]},"metadata":{},"sourceType":"module"}