poi-plugin-milk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ship-row.es"],"names":["ROOT","i18n","window","__","bind","ShipRow","state","canNotify","misc","ShipRowClass","render","timeElapsed","lastRefresh","canRepair","ship","props","api_nowhp","api_maxhp","availableSRF","estimate","timePerHP","api_id","api_lv","inRepair","api_name","completeTime","resources","constructor","basicNotifyConfig","args","type","title","message","names","join","icon","preemptTime","groupKey","propTypes","bool","isRequired","number","object"],"mappings":";;;;;;;;;AAGA;;;AAHA;;;;AACA;;;;AACA;;AAEA;;;;AACA;;AACA;;AACA;;;;AAEA;;AACA;;AAEA;;;;AAMA;AACA;AACA;AACA;;AAEA,MAAM,EAAEA,IAAF,EAAQC,IAAR,KAAiBC,MAAvB;AACA,MAAMC,KAAKF,KAAK,6BAAL,EAAoCE,EAApC,CAAuCC,IAAvC,CAA4CH,KAAK,6BAAL,CAA5C,CAAX;;AAEA,MAAMI,UAAU,yBACbC,KAAD,IAAW;AACT,QAAMC,YAAYD,MAAME,IAAN,CAAWD,SAA7B;AACA,SAAO;AACLA;AADK,GAAP;AAGD,CANa,oBAOd,MAAME,YAAN,0BAAqC;;AAkBrCC,WAAS;AACP,UAAM,EAAEC,WAAF,EAAeC,WAAf,EAA4BC,SAA5B,EAAuCC,IAAvC,EAA6CP,SAA7C,KAA2D,KAAKQ,KAAtE;AACA,UAAM,EAAEC,SAAF,EAAaC,SAAb,EAAwBC,YAAxB,EAAsCC,QAAtC,EAAgDC,SAAhD;AACJC,YADI,EACIC,MADJ,EACYC,QADZ,EACsBC,QADtB,KACmCV,IADzC;AAEA,UAAMW,eAAeb,cAAcO,QAAnC;;AAEA,WACE;AAAA;AAAA;AACE;AAAA;AAAA;AACGlB,aAAKyB,SAAL,CAAevB,EAAf,CAAkBqB,QAAlB,CADH;AAEE;AAAA;AAAA,YAAM,WAAU,UAAh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MzBC,YAAU;AANe,CARb,SAiBPC,SAjBO,GAiBK;AACjB/B,aAAW,oBAAUgC,IAAV,CAAeC,UADT;AAEjB7B,eAAa,oBAAU8B,MAAV,CAAiBD,UAFb;AAGjB5B,eAAa,oBAAU6B,MAAV,CAAiBD,UAHb;AAIjB1B,QAAM,oBAAU4B,MAAV,CAAiBF,UAJN;AAKjB3B,aAAW,oBAAU0B,IAAV,CAAeC;AALT,CAjBL,SAAhB;;kBAyEenC,O","file":"ship-row.es","sourcesContent":["import React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport { connect } from 'react-redux'\n// import { createSelector } from 'reselect'\nimport _ from 'lodash'\nimport { join } from 'path'\nimport { Label } from 'react-bootstrap'\nimport FontAwesome from 'react-fontawesome'\n\nimport { resolveTime } from 'views/utils/tools'\nimport { CountdownNotifierLabel } from 'views/components/main/parts/countdown-timer'\n\nimport {\n repairEstimate,\n getHPLabelStyle,\n getCountdownLabelStyle,\n} from './functions'\n\n// const constShipsSelector = createSelector(\n// constSelector,\n// (_const) => _.keyBy(_const.$ships, 'api_id')\n// )\n\nconst { ROOT, i18n } = window\nconst __ = i18n['poi-plugin-anchorage-repair'].__.bind(i18n['poi-plugin-anchorage-repair'])\n\nconst ShipRow = connect(\n (state) => {\n const canNotify = state.misc.canNotify\n return {\n canNotify,\n }\n }\n)(class ShipRowClass extends Component {\n static basicNotifyConfig = {\n type: 'repair',\n title: __('Anchorage repair'),\n message: names => `${_.join(names, ', ')} ${__('anchorage repair completed')}`,\n icon: join(ROOT, 'assets', 'img', 'operation', 'repair.png'),\n preemptTime: 0,\n groupKey: 'plugin-anchorage-repair',\n }\n\n static propTypes = {\n canNotify: PropTypes.bool.isRequired,\n timeElapsed: PropTypes.number.isRequired,\n lastRefresh: PropTypes.number.isRequired,\n ship: PropTypes.object.isRequired,\n canRepair: PropTypes.bool.isRequired,\n }\n\n render() {\n const { timeElapsed, lastRefresh, canRepair, ship, canNotify } = this.props\n const { api_nowhp, api_maxhp, availableSRF, estimate, timePerHP,\n api_id, api_lv, inRepair, api_name } = ship\n const completeTime = lastRefresh + estimate\n\n return (\n <tr>\n <td>\n {i18n.resources.__(api_name)}\n <span className=\"lv-label\">Lv.{api_lv}</span>\n </td>\n <td>\n <Label bsStyle={getHPLabelStyle(api_nowhp, api_maxhp, availableSRF, inRepair)}>\n {`${api_nowhp} / ${api_maxhp}`}\n </Label>\n </td>\n <td>\n { (estimate > 0 && canRepair && availableSRF) && (!inRepair ?\n <CountdownNotifierLabel\n timerKey={`anchorage-ship-${api_id}`}\n completeTime={completeTime}\n getLabelStyle={getCountdownLabelStyle}\n getNotifyOptions={() => canNotify && (lastRefresh > 0) && {\n ...this.constructor.basicNotifyConfig,\n completeTime,\n args: i18n.resources.__(api_name),\n }}\n />\n : (inRepair ? <Label bsStyle=\"success\"><FontAwesome name=\"wrench\" /> {__('Docking')}</Label> : '')\n )\n }\n </td>\n <td>{timePerHP ? resolveTime(timePerHP / 1000) : '' }\n </td>\n <td>\n {\n canRepair &&\n api_nowhp !== api_maxhp &&\n !inRepair &&\n repairEstimate(ship, timeElapsed, availableSRF)\n }\n </td>\n </tr>\n )\n }\n})\n\nexport default ShipRow\n"]}