diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..04b00bf --- /dev/null +++ b/.eslintrc @@ -0,0 +1,48 @@ +{ + "root": true, + "extends": ["standard"], + "env": { + "node": true, + "jest": true, + "browser": true + }, + "globals": { + "__DEV__": true + }, + "parser": "babel-eslint", + "plugins": ["prettier", "react"], + "rules": { + "react/jsx-uses-react": "error", + "react/jsx-uses-vars": "error", + "no-underscore-dangle": "off", + "quotes": [ + 2, + "double", + { + "avoidEscape": true + } + ], + "indent": [2, "tab"], + "no-tabs": 0, + "arrow-parens": 0, + "no-var": 2, + "prefer-const": 1, + "camelcase": [ + "error", + { + "properties": "always" + } + ], + "key-spacing": [ + "error", + { + "beforeColon": false, + "afterColon": true, + "align": "colon" + } + ], + "object-curly-spacing": ["error", "always"], + "curly": ["error", "all"], + "brace-style": ["error", "1tbs"] + } +} diff --git a/Calendar.js b/Calendar.js index ed32f6e..b6f82fb 100644 --- a/Calendar.js +++ b/Calendar.js @@ -2,322 +2,449 @@ * Created by TinySymphony on 2017-05-08. */ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; +import React, { Component } from "react" +import PropTypes from "prop-types" -import { - View, - Text, - Modal, - Image, - StyleSheet, - ScrollView, - Dimensions, - TouchableHighlight -} from 'react-native'; -import Moment from 'moment'; -import styles from './CalendarStyle'; -import MonthList from './MonthList'; +import { View, Text, Modal, Image, TouchableHighlight } from "react-native" +import Moment from "moment" +import styles from "./CalendarStyle" +import MonthList from "./MonthList" const ICON = { - close: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAADGklEQVR4Xu3b3XXTMBTAcV1Leu8I3YAyAWECygSlE9BOQJmAdAK6QWGCphNQNmAE+mzZl6Mc5xzXtiLJ1r0STfLqJM3/Z9muPwTiwF9w4P3iCHAcAQ4BRDxt2/aDEOKkqqqfAPD0P2EZYy6EEJ/sbwaATVVVtwDwd9gwuQkYY+wHv9n43QcQca21vi4dARFPmqa5F0Ks+r8VEZ+UUu+HCCMAu+abpvnVj+990Z1S6rJUBBtvjHkAgLOp34iIX7XWN/1lI4Cmaa4Q0a5916tIBF+8jUHER631i5ExAqjr+gYAvnjWclEIIfHBAIh41m0CvpFeBEJofBdzqZS627sJ2IV1Xa8B4LNPQAiRFSEmfmr4b48QrkhjjJWyhxLfKwtCZPxvpdQq+DC4Ky4VIVX83hFQKkLK+CAA+6ZSRkLq+GCAEhAo4qMAciJQxUcD5ECgjJ8FwIlAHT8bgAOBI34RACUCV/xiAAoEzvgkACkRuOOTAaRAyBGfFGAJQq745ABzEHLGkwDEItgLMK5reP3zcER0ntL6ztf3LSe7MRJxAuX9/VTxZCNgxqm0E4EynhwgcnMYIVDHswDMReCIZwOIReCKZwOIOdR12wHbhVayo8Bug54Rv/soCwIpwIJ4NgQygATxLAgkAAnjyRGSA8TE27199+BFtjtQSQFi43e3qyL+bU6+Y0wGMDd+xr/NSRGSACyNz4mwGCBVfC6ERQCp43MgzAagiudGmAVAHc+JEA3AFc+FEAXAHc+BEAyQK54aIQggdzwlgheglHgqhL0ApcVTIDgBSo1PjTAJUHp8SgTXfIGH4fP2U3cuOK/euu6chJ5KI+Kt1vpq+D0jgG6yxHfnrZpuQQnxsSNBSvl2OPNl6nH5DQC82wdQUnwMAgBcSynX/bZogBLjIxA+KqV++ACcEyZKjg9AeJZSnobMGbLzbuxm8KYvZZ+3V0qdTz1y7ttfcC+fmO/wjIjnWuuNdydo39AdBu0eczu/BgDsdbgXMy24o2L/nn3wom3bFSL+kVLaFTqaMrdti/3i1/b+I8BrW6OxPQc/Av4BDSZYbnPWwJkAAAAASUVORK5CYII=' -}; + close: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAADGklEQVR4Xu3b3XXTMBTAcV1Leu8I3YAyAWECygSlE9BOQJmAdAK6QWGCphNQNmAE+mzZl6Mc5xzXtiLJ1r0STfLqJM3/Z9muPwTiwF9w4P3iCHAcAQ4BRDxt2/aDEOKkqqqfAPD0P2EZYy6EEJ/sbwaATVVVtwDwd9gwuQkYY+wHv9n43QcQca21vi4dARFPmqa5F0Ks+r8VEZ+UUu+HCCMAu+abpvnVj+990Z1S6rJUBBtvjHkAgLOp34iIX7XWN/1lI4Cmaa4Q0a5916tIBF+8jUHER631i5ExAqjr+gYAvnjWclEIIfHBAIh41m0CvpFeBEJofBdzqZS627sJ2IV1Xa8B4LNPQAiRFSEmfmr4b48QrkhjjJWyhxLfKwtCZPxvpdQq+DC4Ky4VIVX83hFQKkLK+CAA+6ZSRkLq+GCAEhAo4qMAciJQxUcD5ECgjJ8FwIlAHT8bgAOBI34RACUCV/xiAAoEzvgkACkRuOOTAaRAyBGfFGAJQq745ABzEHLGkwDEItgLMK5reP3zcER0ntL6ztf3LSe7MRJxAuX9/VTxZCNgxqm0E4EynhwgcnMYIVDHswDMReCIZwOIReCKZwOIOdR12wHbhVayo8Bug54Rv/soCwIpwIJ4NgQygATxLAgkAAnjyRGSA8TE27199+BFtjtQSQFi43e3qyL+bU6+Y0wGMDd+xr/NSRGSACyNz4mwGCBVfC6ERQCp43MgzAagiudGmAVAHc+JEA3AFc+FEAXAHc+BEAyQK54aIQggdzwlgheglHgqhL0ApcVTIDgBSo1PjTAJUHp8SgTXfIGH4fP2U3cuOK/euu6chJ5KI+Kt1vpq+D0jgG6yxHfnrZpuQQnxsSNBSvl2OPNl6nH5DQC82wdQUnwMAgBcSynX/bZogBLjIxA+KqV++ACcEyZKjg9AeJZSnobMGbLzbuxm8KYvZZ+3V0qdTz1y7ttfcC+fmO/wjIjnWuuNdydo39AdBu0eczu/BgDsdbgXMy24o2L/nn3wom3bFSL+kVLaFTqaMrdti/3i1/b+I8BrW6OxPQc/Av4BDSZYbnPWwJkAAAAASUVORK5CYII=" +} export default class Calendar extends Component { - static propTypes = { - i18n: PropTypes.string, - format: PropTypes.string, - customI18n: PropTypes.object, - color: PropTypes.object, - minDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), - maxDate: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]) - } - static defaultProps = { - format: 'YYYY-MM-DD', - i18n: 'en', - customI18n: {}, - color: {} - } - static I18N_MAP = { - 'zh': { - 'w': ['', '一', '二', '三', '四', '五', '六', '日'], - 'weekday': ['', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'], - 'text': { - 'start': '开 始', - 'end': '结 束', - 'date': '日 期', - 'save': '保 存', - 'clear': '清除' - }, - 'date': 'M月D日' - }, - 'en': { - 'w': ['', 'Mon', 'Tues', 'Wed', 'Thur', 'Fri', 'Sat', 'Sun'], - 'weekday': ['', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'], - 'text': { - 'start': 'Start', - 'end': 'End', - 'date': 'Date', - 'save': 'Save', - 'clear': 'Reset' - }, - 'date': 'DD / MM' - }, - 'jp': { - 'w': ['', '月', '火', '水', '木', '金', '土', '日'], - 'weekday': ['', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日', '日曜日'], - 'text': { - 'start': 'スタート', - 'end': 'エンド', - 'date': '時 間', - 'save': '確 認', - 'clear': 'クリア' - }, - 'date': 'M月D日' - } - } - constructor (props) { - super(props); - this.state = { - isModalVisible: false - }; - this._today = Moment(); - this._year = this._today.year(); - this._i18n = this._i18n.bind(this); - this._getDateRange = this._getDateRange.bind(this); - this._onChoose = this._onChoose.bind(this); - this._resetCalendar = this._resetCalendar.bind(this); - this.close = this.close.bind(this); - this.cancel = this.cancel.bind(this); - this.open = this.open.bind(this); - this.clear = this.clear.bind(this); - this.confirm = this.confirm.bind(this); - this._getDateRange(); - } - componentDidMount () { - this._resetCalendar(); - } - _i18n (data, type) { - const { - i18n, - customI18n - } = this.props; - if (~['w', 'weekday', 'text'].indexOf(type)) { - return (customI18n[type] || {})[data] || Calendar.I18N_MAP[i18n][type][data]; - } - if (type === 'date') { - return data.format(customI18n[type] || Calendar.I18N_MAP[i18n][type]); - } - } - _resetCalendar () { - const { - startDate, - endDate, - format - } = this.props; - let start = Moment(startDate, format); - let end = Moment(endDate, format); - let isStartValid = start.isValid() && start >= this._minDate && start <= this._maxDate; - let isEndValid = end.isValid() && end >= this._minDate && end <= this._maxDate; - this.setState({ - startDate: isStartValid ? start : null, - startDateText: isStartValid ? this._i18n(start, 'date') : '', - startWeekdayText: isStartValid ? this._i18n(start.isoWeekday(), 'weekday') : '', - endDate: isEndValid ? end: null, - endDateText: isEndValid ? this._i18n(end, 'date') : '', - endWeekdayText: isEndValid ? this._i18n(end.isoWeekday(), 'weekday') : '' - }); - } - _getDateRange () { - const { - maxDate, - minDate, - format - } = this.props; - let max = Moment(maxDate, format); - let min = Moment(minDate, format); - let maxValid = max.isValid(); - let minValid = min.isValid(); - if (!maxValid && !minValid) { - max = Moment().add(3, 'months'); - min = Moment(); - } - if (!maxValid && minValid) { - max = min.add(3, 'months'); - } - if (maxValid && !minValid) { - min = max.subtract(3, 'months'); - } - if (min.isSameOrAfter(max)) return {}; - this._minDate = min; - this._maxDate = max; - } - _onChoose (day) { - const { - startDate, - endDate - } = this.state; - if ((!startDate && !endDate) || day < startDate || (startDate && endDate)) { - this.setState({ - startDate: day, - endDate: null, - startDateText: this._i18n(day, 'date'), - startWeekdayText: this._i18n(day.isoWeekday(), 'weekday'), - endDateText: '', - endWeekdayText: '', - }); - } else if (startDate && !endDate && day > startDate) { - this.setState({ - endDate: day, - endDateText: this._i18n(day, 'date'), - endWeekdayText: this._i18n(day.isoWeekday(), 'weekday') - }); - } - } - cancel () { - this.close(); - this._resetCalendar(); - } - close () { - this.setState({ - isModalVisible: false - }); - } - open () { - this.setState({ - isModalVisible: true - }); - } - clear () { - this.setState({ - startDate: null, - endDate: null, - startDateText: '', - startWeekdayText: '', - endDateText: '', - endWeekdayText: '' - }); - } - confirm () { - const { - startDate, - endDate - } = this.state; - let startMoment = startDate ? startDate.clone() : null; - let endMoment = endDate ? endDate.clone() : null; - this.props.onConfirm && this.props.onConfirm({ - startDate: startMoment ? startMoment.toDate() : null, - endDate: endMoment ? endMoment.toDate() : null, - startMoment, - endMoment - }); - this.close(); - } - render () { - const { - startDate, - endDate, - startDateText, - startWeekdayText, - endDateText, - endWeekdayText - } = this.state; - const { - mainColor = '#15aaaa', - subColor = '#fff', - borderColor = 'rgba(255, 255, 255, 0.50)' - } = this.props.color; - let color = {mainColor, subColor, borderColor}; - let mainBack = {backgroundColor: mainColor}; - let subBack = {backgroundColor: subColor}; - let mainFontColor = {color: mainColor}; - let subFontColor = {color: subColor}; - let isValid = !startDate || endDate; - let isClearVisible = startDate || endDate; - return ( - - - - - - - {isClearVisible && - {this._i18n('clear', 'text')} - } - - - - - {startDateText || this._i18n('start', 'text')} - - - {startWeekdayText || this._i18n('date', 'text')} - - - - - - {endDateText || this._i18n('end', 'text')} - - - {endWeekdayText || this._i18n('date', 'text')} - - - - - {[7, 1, 2, 3, 4, 5, 6].map(item => - {this._i18n(item, 'w')} - )} - - - - - - {isValid ? - - - - {this._i18n('save', 'text')} - - - : - - - - {this._i18n('save', 'text')} - - - - } - - - - ); - } + static propTypes = { + i18n : PropTypes.string, + format : PropTypes.string, + customI18n: PropTypes.object, + color : PropTypes.shape({ + mainColor : PropTypes.string, + subColor : PropTypes.string, + borderColor: PropTypes.string + }), + minDate : PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + maxDate : PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]), + selectionType: PropTypes.oneOf(["manual", "week", "day"]), + animationType: PropTypes.oneOf(["none", "slide", "fade"]) + } + static defaultProps = { + format : "YYYY-MM-DD", + i18n : "en", + customI18n : {}, + color : {}, + selectionType: "manual", + animationType: "slide" + } + static I18N_MAP = { + zh: { + w : ["", "一", "二", "三", "四", "五", "六", "日"], + weekday: ["", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"], + text : { + start: "开 始", + apply: "开 始", + end : "结 束", + date : "日 期", + save : "保 存", + clear: "清除" + }, + date: "M月D日" + }, + en: { + w : ["", "Mon", "Tues", "Wed", "Thur", "Fri", "Sat", "Sun"], + weekday: [ + "", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday" + ], + text: { + start: "Start", + apply: "Apply", + end : "End", + date : "Date", + save : "Save", + clear: "Reset" + }, + date: "DD / MM" + }, + jp: { + w : ["", "月", "火", "水", "木", "金", "土", "日"], + weekday: ["", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日", "日曜日"], + text : { + start: "スタート", + apply: "スタート", + end : "エンド", + date : "時 間", + save : "確 認", + clear: "クリア" + }, + date: "M月D日" + } + } + + constructor (props) { + super(props) + this.state = { + isModalVisible: false, + selectionType : "manual" + } + this._today = Moment() + this._year = this._today.year() + this._i18n = this._i18n.bind(this) + this._getDateRange = this._getDateRange.bind(this) + this._onChoose = this._onChoose.bind(this) + this._resetCalendar = this._resetCalendar.bind(this) + this.close = this.close.bind(this) + this.selection = this.selection.bind(this) + this.cancel = this.cancel.bind(this) + this.open = this.open.bind(this) + this.clear = this.clear.bind(this) + this.confirm = this.confirm.bind(this) + this._getDateRange() + } + + componentDidMount () { + const { selectionType } = this.props + this._resetCalendar() + + this.setState({ + selectionType + }) + } + + componentDidUpdate (nextProps, nextState) { + const { startDate, endDate, selectionType } = this.state + + if (startDate && !endDate && selectionType === "week") { + this._onChoose(startDate, "week") + } + } + + _i18n (data, type) { + const { i18n, customI18n } = this.props + if (~["w", "weekday", "text"].indexOf(type)) { + return (customI18n[type] || {})[data] || Calendar.I18N_MAP[i18n][type][data] + } + if (type === "date") { + return data.format(customI18n[type] || Calendar.I18N_MAP[i18n][type]) + } + } + + _resetCalendar () { + const { startDate, endDate, format } = this.props + const start = Moment(startDate, format) + const end = Moment(endDate, format) + const isStartValid = start.isValid() && start >= this._minDate && start <= this._maxDate + const isEndValid = end.isValid() && end >= this._minDate && end <= this._maxDate + this.setState({ + startDate : isStartValid ? start : null, + startDateText : isStartValid ? this._i18n(start, "date") : "", + startWeekdayText: isStartValid ? this._i18n(start.isoWeekday(), "weekday") : "", + endDate : isEndValid ? end : null, + endDateText : isEndValid ? this._i18n(end, "date") : "", + endWeekdayText : isEndValid ? this._i18n(end.isoWeekday(), "weekday") : "" + }) + } + + _getDateRange () { + const { maxDate, minDate, format } = this.props + let max = Moment(maxDate, format) + let min = Moment(minDate, format) + const maxValid = max.isValid() + const minValid = min.isValid() + if (!maxValid && !minValid) { + max = Moment().add(3, "months") + min = Moment() + } + if (!maxValid && minValid) { + max = min.add(3, "months") + } + if (maxValid && !minValid) { + min = max.subtract(3, "months") + } + if (min.isSameOrAfter(max)) { + return {} + } + this._minDate = min + this._maxDate = max + } + + _onChoose (day, selectionType) { + const { startDate, endDate } = this.state + + if (selectionType === "day") { + if ((!startDate && !endDate) || day < startDate || (startDate && endDate)) { + this.setState({ + startDate : day, + endDate : day, + startDateText : this._i18n(day, "date"), + startWeekdayText: this._i18n(day.isoWeekday(), "weekday"), + endDateText : this._i18n(day, "date"), + endWeekdayText : this._i18n(day.isoWeekday(), "weekday") + }) + + this.confirm({ startDate: day, endDate: day }) + } + return + } + + if (selectionType === "week") { + if ((!startDate && !endDate) || day < startDate || (startDate && endDate)) { + const startDay = day.clone().startOf("week") + this.setState({ + startDate : startDay, + endDate : null, + startDateText : this._i18n(startDay, "date"), + startWeekdayText: this._i18n(startDay.isoWeekday(), "weekday"), + endDateText : "", + endWeekdayText : "" + }) + } else if (startDate && !endDate) { + const endDay = day.clone().endOf("week") + this.setState({ + endDate : endDay, + endDateText : this._i18n(endDay, "date"), + endWeekdayText: this._i18n(endDay.isoWeekday(), "weekday") + }) + } + return + } + + if ((!startDate && !endDate) || day < startDate || (startDate && endDate)) { + this.setState({ + startDate : day, + endDate : null, + startDateText : this._i18n(day, "date"), + startWeekdayText: this._i18n(day.isoWeekday(), "weekday"), + endDateText : "", + endWeekdayText : "" + }) + } else if (startDate && !endDate && day > startDate) { + this.setState({ + endDate : day, + endDateText : this._i18n(day, "date"), + endWeekdayText: this._i18n(day.isoWeekday(), "weekday") + }) + } + } + + radioBtnsStyle (_selectionType) { + const { color: { borderColor } } = this.props + const { selectionType } = this.state + + const selected = selectionType === _selectionType + const btnColor = borderColor || "rgba(255, 255, 255, 0.5)" + + return { + backgroundColor: selected ? btnColor : "transparent" + } + } + + cancel () { + this.close() + this._resetCalendar() + } + + close () { + this.setState({ + isModalVisible: false + }) + } + + selection (selectionType) { + this.clear() + + this.setState({ + selectionType + }) + } + + open () { + this.setState({ + isModalVisible: true + }) + } + + clear () { + this.setState({ + startDate : null, + endDate : null, + startDateText : "", + startWeekdayText: "", + endDateText : "", + endWeekdayText : "" + }) + } + + confirm (state) { + let { startDate, endDate } = state // State is proxy coming from touchableOpacity + startDate = startDate || this.state.startDate + endDate = endDate || this.state.endDate + + const startMoment = startDate ? startDate.clone() : null + const endMoment = endDate ? endDate.clone() : null + this.props.onConfirm && + this.props.onConfirm({ + startDate: startMoment ? startMoment.toDate() : null, + endDate : endMoment ? endMoment.toDate() : null, + startMoment, + endMoment + }) + this.close() + } + + render () { + const { + startDate, + endDate, + startDateText, + startWeekdayText, + endDateText, + endWeekdayText, + isModalVisible, + selectionType + } = this.state + const { animationType } = this.props + const { + mainColor = "#15aaaa", + subColor = "#fff", + borderColor = "rgba(255, 255, 255, 0.50)" + } = this.props.color + const color = { mainColor, subColor, borderColor } + const mainBack = { backgroundColor: mainColor } + const subBack = { backgroundColor: subColor } + const subFontColor = { color: subColor } + const isValid = !startDate || endDate + const isClearVisible = startDate || endDate + + return ( + + + + + + + {isClearVisible && ( + + + {this._i18n("clear", "text")} + + + )} + + + + + {startDateText || this._i18n("start", "text")} + + + {startWeekdayText || this._i18n("date", "text")} + + + + + + {endDateText || this._i18n("end", "text")} + + + {endWeekdayText || this._i18n("date", "text")} + + + + + {[7, 1, 2, 3, 4, 5, 6].map(item => ( + + {this._i18n(item, "w")} + + ))} + + + this._onChoose(day, selectionType)} + i18n={this.props.i18n} + color={color} + /> + + + + this.selection("day")} + > + Day + + this.selection("week")} + > + Week + + this.selection("manual")} + > + Manual + + + {isValid ? ( + + + + {this._i18n("apply", "text")} + + + + ) : ( + + + + {this._i18n("apply", "text")} + + + + )} + + + + ) + } } diff --git a/CalendarStyle.js b/CalendarStyle.js index acba202..cc3449d 100644 --- a/CalendarStyle.js +++ b/CalendarStyle.js @@ -1,110 +1,126 @@ -import { - StyleSheet, - Dimensions -} from 'react-native'; -const {scale, width} = Dimensions.get('window'); -let iconSize = 22; -let resultFontSize = 24; -let weekTextFontSize = 16; -let slashLength = 80; +import { StyleSheet, Dimensions } from "react-native" +const { scale, width } = Dimensions.get("window") +let iconSize = 22 +let resultFontSize = 24 +let weekTextFontSize = 16 +let slashLength = 80 if (width < 350) { - resultFontSize = 20; - weekTextFontSize = 14; - iconSize = 20; - slashLength = 70; + resultFontSize = 20 + weekTextFontSize = 14 + iconSize = 20 + slashLength = 70 } export default StyleSheet.create({ - container: { - flex: 1 - }, - ctrl: { - flex: 1.5, - justifyContent: 'space-between', - flexDirection: 'row', - alignItems: 'flex-end', - paddingHorizontal: 15 - }, - result: { - flex: 2.5, - paddingHorizontal: 15, - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'space-between' - }, - resultSlash: { - width: slashLength, - height: 1 / scale, - transform: [ - { - rotateZ: '-45deg' - } - ] - }, - resultPart: { - flex: 1 - }, - resultText: { - fontSize: resultFontSize, - marginVertical: 4, - fontWeight: '200' - }, - clearText: { - fontSize: 18, - fontWeight: '400' - }, - startText: { - textAlign: 'left' - }, - endText: { - textAlign: 'right' - }, - week: { - flex: 1, - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center' - }, - weekText: { - flex: 1, - fontSize: weekTextFontSize, - textAlign: 'center' - }, - scroll: { - flex: 9, - borderTopWidth: 1, - borderBottomWidth: 1 - }, - scrollArea: { - flex: 1 - }, - btn: { - flex: 1.5, - justifyContent: 'center', - alignItems: 'center' - }, - confirmContainer: { - overflow: 'hidden', - backgroundColor: 'rgba(255, 255, 255, 0.40)', - borderRadius: 4, - margin: 14, - flex: 1, - alignSelf: 'stretch', - justifyContent: 'center' - }, - confirmContainerDisabled: { - backgroundColor: 'rgba(255, 255, 255, 0.20)' - }, - confirmText: { - fontSize: 16, - fontWeight: 'bold', - textAlign: 'center' - }, - confirmTextDisabled: { - color: 'rgba(255, 255, 255, 0.40)' - }, - closeIcon: { - width: iconSize, - height: iconSize - } -}); + container: { + flex: 1 + }, + ctrl: { + flex : 1.5, + justifyContent : "space-between", + flexDirection : "row", + alignItems : "flex-end", + paddingHorizontal: 15 + }, + result: { + flex : 2.5, + paddingHorizontal: 15, + flexDirection : "row", + alignItems : "center", + justifyContent : "space-between" + }, + resultSlash: { + width : slashLength, + height : 1 / scale, + transform: [ + { + rotateZ: "-45deg" + } + ] + }, + resultPart: { + flex: 1 + }, + resultText: { + fontSize : resultFontSize, + marginVertical: 4, + fontWeight : "200" + }, + clearText: { + fontSize : 18, + textAlign : "center", + fontWeight: "400" + }, + startText: { + textAlign: "left" + }, + endText: { + textAlign: "right" + }, + week: { + flex : 1, + flexDirection : "row", + justifyContent: "space-between", + alignItems : "center" + }, + weekText: { + flex : 1, + fontSize : weekTextFontSize, + textAlign: "center" + }, + scroll: { + flex : 9, + borderTopWidth : 1, + borderBottomWidth: 1 + }, + scrollArea: { + flex: 1 + }, + btn: { + flex : 1.5, + flexDirection : "row", + justifyContent: "center", + alignItems : "center" + }, + radioBtns: { + flex : 4, + flexDirection : "row", + justifyContent: "flex-end", + paddingLeft : 9 + }, + selectionBtn: { + flex : 1, + paddingVertical: 7, + alignSelf : "stretch", + marginRight : 5, + borderRadius : 5, + borderWidth : 1, + borderColor : "rgba(255, 255, 255, 0.5)" + }, + confirmContainer: { + flex : 1, + overflow : "hidden", + backgroundColor: "rgba(255, 255, 255, 0.40)", + margin : 14, + alignSelf : "stretch", + justifyContent : "center", + borderRadius : 5, + borderWidth : 1, + borderColor : "rgba(255, 255, 255, 0.5)" + }, + confirmContainerDisabled: { + backgroundColor: "rgba(255, 255, 255, 0.20)" + }, + confirmText: { + fontSize : 16, + fontWeight: "bold", + textAlign : "center" + }, + confirmTextDisabled: { + color: "rgba(255, 255, 255, 0.40)" + }, + closeIcon: { + width : iconSize, + height: iconSize + } +}) diff --git a/Day/index.js b/Day/index.js index 57e321d..0637678 100644 --- a/Day/index.js +++ b/Day/index.js @@ -2,90 +2,83 @@ * Created by TinySymphony on 2017-05-11. */ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; +import React, { Component } from "react" +import PropTypes from "prop-types" -import { - View, - Text, - StyleSheet, - TouchableHighlight -} from 'react-native'; -import Moment from 'moment'; -import styles from './style'; +import { View, Text, TouchableHighlight } from "react-native" +import styles from "./style" export default class Day extends Component { - static propTypes = { - onChoose: PropTypes.func - } - constructor (props) { - super(props); - this._chooseDay = this._chooseDay.bind(this); - this._statusCheck = this._statusCheck.bind(this); - this._statusCheck(); - } - _chooseDay () { - this.props.onChoose && this.props.onChoose(this.props.date); - } - _statusCheck (props) { - const { - startDate, - endDate, - today, - date = null, - minDate, - maxDate, - empty - } = props || this.props; - this.isToday = today.isSame(date, 'd'); - this.isValid = date && - (date >= minDate || date.isSame(minDate, 'd')) && - (date <= maxDate || date.isSame(maxDate, 'd')); - this.isMid = date > startDate && date < endDate || - (!date && empty >= startDate && empty <= endDate); - this.isStart = date && date.isSame(startDate, 'd'); - this.isStartPart = this.isStart && endDate; - this.isEnd = date && date.isSame(endDate, 'd'); - this.isFocus = this.isMid || this.isStart || this.isEnd; - return this.isFocus; - } - shouldComponentUpdate (nextProps) { - let prevStatus = this.isFocus; - let nextStatus = this._statusCheck(nextProps); - if (prevStatus || nextStatus) return true; - return false; - } - render () { - const { - date, - color - } = this.props; - let text = date ? date.date() : ''; - let mainColor = {color: color.mainColor}; - let subColor = {color: color.subColor}; - let mainBack = {backgroundColor: color.mainColor}; - let subBack = {backgroundColor: color.subColor}; - return ( - - {this.isValid ? - - {text} - : - - {text} - - } - - ); - } + static propTypes = { + onChoose: PropTypes.func + } + constructor (props) { + super(props) + this._chooseDay = this._chooseDay.bind(this) + this._statusCheck = this._statusCheck.bind(this) + this._statusCheck() + } + _chooseDay () { + this.props.onChoose && this.props.onChoose(this.props.date) + } + _statusCheck (props) { + const { startDate, endDate, today, date = null, minDate, maxDate, empty } = + props || this.props + this.isToday = today.isSame(date, "d") + this.isValid = + date && + (date >= minDate || date.isSame(minDate, "d")) && + (date <= maxDate || date.isSame(maxDate, "d")) + this.isMid = + (date > startDate && date < endDate) || + (!date && empty >= startDate && empty <= endDate) + this.isStart = date && date.isSame(startDate, "d") + this.isStartPart = this.isStart && endDate + this.isEnd = date && date.isSame(endDate, "d") + this.isFocus = this.isMid || this.isStart || this.isEnd + return this.isFocus + } + shouldComponentUpdate (nextProps) { + const prevStatus = this.isFocus + const nextStatus = this._statusCheck(nextProps) + if (prevStatus || nextStatus) { + return true + } + return false + } + render () { + const { date, color } = this.props + const text = date ? date.date() : "" + const mainColor = { color: color.mainColor } + const subColor = { color: color.subColor } + const mainBack = { backgroundColor: color.mainColor } + const subBack = { backgroundColor: color.subColor } + return ( + + {this.isValid ? ( + + + {text} + + + ) : ( + + {text} + + )} + + ) + } } diff --git a/Month/index.js b/Month/index.js index 17ebf6a..4eb433e 100644 --- a/Month/index.js +++ b/Month/index.js @@ -2,125 +2,138 @@ * Created by TinySymphony on 2017-05-11. */ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; +import React, { Component } from "react" +import PropTypes from "prop-types" -import { - View, - Text, - StyleSheet, - TouchableHighlight -} from 'react-native'; -import Moment from 'moment'; -import styles from './style'; -import Day from '../Day'; +import { View, Text, StyleSheet, TouchableHighlight } from "react-native" +import Moment from "moment" +import styles from "./style" +import Day from "../Day" export default class Month extends Component { - constructor (props) { - super(props); - this._getDayList = this._getDayList.bind(this); - this._renderDayRow = this._renderDayRow.bind(this); - this._getMonthText = this._getMonthText.bind(this); - } - static I18N_MAP = { - 'zh': [ - '一月', '二月', '三月', '四月', '五月', '六月', - '七月', '八月', '九月', '十月', '十一月', '十二月' - ], - 'jp': [ - '一月', '二月', '三月', '四月', '五月', '六月', - '七月', '八月', '九月', '十月', '十一月', '十二月' - ], - 'en': [ - 'January', 'February', 'March', 'April', 'May', 'June', - 'July', 'August', 'September', 'October', 'November', 'December' - ] - } - _getMonthText () { - const { - month, - today, - i18n - } = this.props; - let y = month.year(); - let m = month.month(); - let year = today.year(); - if (year === y) { - return Month.I18N_MAP[i18n][m]; - } else { - if (i18n === 'en') { - return `${Month.I18N_MAP[i18n][m]}, ${y}`; - } - return month.format('YYYY年M月'); - } - } - _getDayList (date) { - let dayList; - let month = date.month(); - let weekday = date.isoWeekday(); - if (weekday === 7) { - dayList = []; - } else { - dayList = new Array(weekday).fill({ - empty: date.clone().subtract(1, 'h') - }); - } - while (date.month() === month) { - dayList.push({ - date: date.clone() - }); - date.add(1, 'days'); - } - date.subtract(1, 'days'); - weekday = date.isoWeekday(); - if (weekday === 7) { - return dayList.concat(new Array(6).fill({ - empty: date.clone().hour(1) - })); - } - return dayList.concat(new Array(Math.abs(weekday - 6)).fill({ - empty: date.clone().hour(1) - })); - } - _renderDayRow (dayList, index) { - const { - startDate, - endDate, - today - } = this.props; - return ( - - {dayList.map((item, i) => - - )} - - ); - } - render () { - const { - month, - today, - color - } = this.props; - let subColor = {color: color.subColor}; - let titleText = this._getMonthText(); - let dayList = this._getDayList(month.clone()); - let rowArray = new Array(dayList.length / 7).fill(''); - return ( - - - {titleText} - - - {rowArray.map((item, i) => - this._renderDayRow(dayList.slice(i * 7, i * 7 + 7), i) - )} - - - ); - } + constructor(props) { + super(props) + this._getDayList = this._getDayList.bind(this) + this._renderDayRow = this._renderDayRow.bind(this) + this._getMonthText = this._getMonthText.bind(this) + } + static I18N_MAP = { + zh: [ + "一月", + "二月", + "三月", + "四月", + "五月", + "六月", + "七月", + "八月", + "九月", + "十月", + "十一月", + "十二月" + ], + jp: [ + "一月", + "二月", + "三月", + "四月", + "五月", + "六月", + "七月", + "八月", + "九月", + "十月", + "十一月", + "十二月" + ], + en: [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ] + } + _getMonthText() { + const { month, today, i18n } = this.props + let y = month.year() + let m = month.month() + let year = today.year() + if (year === y) { + return Month.I18N_MAP[i18n][m] + } else { + if (i18n === "en") { + return `${Month.I18N_MAP[i18n][m]}, ${y}` + } + return month.format("YYYY年M月") + } + } + _getDayList(date) { + let dayList + let month = date.month() + let weekday = date.isoWeekday() + if (weekday === 7) { + dayList = [] + } else { + dayList = new Array(weekday).fill({ + empty: date.clone().subtract(1, "h") + }) + } + while (date.month() === month) { + dayList.push({ + date: date.clone() + }) + date.add(1, "days") + } + date.subtract(1, "days") + weekday = date.isoWeekday() + if (weekday === 7) { + return dayList.concat( + new Array(6).fill({ + empty: date.clone().hour(1) + }) + ) + } + return dayList.concat( + new Array(Math.abs(weekday - 6)).fill({ + empty: date.clone().hour(1) + }) + ) + } + _renderDayRow(dayList, index) { + const { startDate, endDate, today } = this.props + return ( + + {dayList.map((item, i) => ( + + ))} + + ) + } + render() { + const { month, today, color } = this.props + let subColor = { color: color.subColor } + let titleText = this._getMonthText() + let dayList = this._getDayList(month.clone()) + let rowArray = new Array(dayList.length / 7).fill("") + return ( + + + {titleText} + + + {rowArray.map((item, i) => + this._renderDayRow(dayList.slice(i * 7, i * 7 + 7), i) + )} + + + ) + } } diff --git a/MonthList.js b/MonthList.js index 9c05255..2e79e68 100644 --- a/MonthList.js +++ b/MonthList.js @@ -2,139 +2,154 @@ * Created by TinySymphony on 2017-05-11. */ -import React, {PropTypes, Component} from 'react'; -import { - View, - Text, - ListView, - Dimensions -} from 'react-native'; -import Moment from 'moment'; -import styles from './CalendarStyle'; -import Month from './Month'; -const {width} = Dimensions.get('window'); +import React, { Component } from "react" +import { ListView, Dimensions } from "react-native" +import Moment from "moment" +import styles from "./CalendarStyle" +import Month from "./Month" +const { width } = Dimensions.get("window") export default class MonthList extends Component { - constructor (props) { - super(props); - this.ds = new ListView.DataSource({ - rowHasChanged: (r1, r2) => { - return r2.shouldUpdate; - } - }); - this.monthList = []; - this.state = { - dataSource: this.ds.cloneWithRows(this._getMonthList()) - }; - this._renderMonth = this._renderMonth.bind(this); - this._shouldUpdate = this._shouldUpdate.bind(this); - this._checkRange = this._checkRange.bind(this); - this._getWeekNums = this._getWeekNums.bind(this); - this._scrollToSelecetdMonth = this._scrollToSelecetdMonth.bind(this); - } - componentWillReceiveProps (nextProps) { - let isDateUpdated = ['startDate', 'endDate', 'minDate', 'maxDate'].reduce((prev, next) => { - if (prev || nextProps[next] !== this.props[next]) { - return true; - } - return prev; - }, false); - if (isDateUpdated) { - this.setState({ - dataSource: - this.state.dataSource.cloneWithRows(this._getMonthList(nextProps)) - }); - } - } - _renderMonth (month) { - return ( - - ); - } - _checkRange (date, start, end) { - if (!date || !start) return false; - if (!end) return date.year() === start.year() && date.month() === start.month(); - if (date.year() < start.year() || (date.year() === start.year() && date.month() < start.month())) return false; - if (date.year() > end.year() || (date.year() === end.year() && date.month() > end.month())) return false; - return true; - } - _shouldUpdate (month, props) { - if (!props) return false; - const { - startDate, - endDate - } = props; - const { - date - } = month; - let next = this._checkRange(date, startDate, endDate); - let prev = this._checkRange(date, this.props.startDate, this.props.endDate); - if (prev || next) return true; - return false; - } - _getMonthList (props) { - let minDate = (props || this.props).minDate.clone().date(1); - let maxDate = (props || this.props).maxDate.clone(); - let monthList = []; - if (!maxDate || !minDate) return monthList; - while (maxDate > minDate || ( - maxDate.year() === minDate.year() && - maxDate.month() === minDate.month() - )) { - let month = { - date: minDate.clone() - }; - month.shouldUpdate = this._shouldUpdate(month, props); - monthList.push(month); - minDate.add(1, 'month'); - } - return monthList; - } - _getWeekNums(start, end) { - let clonedMoment = Moment(start), date, day, num, y, m, total = 0; - while (!clonedMoment.isSame(end, 'months')) { - y = clonedMoment.year(); - m = clonedMoment.month(); - date = new Date(y, m, 1); - day = date.getDay(); - num = new Date(y, m + 1, 0).getDate(); - total += Math.ceil((num + day) / 7); - clonedMoment.add(1, 'months'); - } - return total; - } - _scrollToSelecetdMonth () { - const { - startDate, - minDate - } = this.props; - let monthOffset = 12 * (startDate.year() - minDate.year()) + - startDate.month() - minDate.month(); - let weekOffset = this._getWeekNums(minDate, startDate); - setTimeout(() => { - this.list && this.list.scrollTo({ - x: 0, - y: monthOffset * (24 + 25) + (monthOffset ? weekOffset * Math.ceil(width / 7 + 10) : 0), - animated: true - }); - }, 400); - } - componentDidMount () { - this.props.startDate && this._scrollToSelecetdMonth(); - } - render () { - return ( - {this.list = list;}} - style={styles.scrollArea} - dataSource={this.state.dataSource} - renderRow={this._renderMonth} - pageSize={2} - initialListSize={2} - showsVerticalScrollIndicator={false} - /> - ); - } + constructor (props) { + super(props) + this.ds = new ListView.DataSource({ + rowHasChanged: (r1, r2) => { + return r2.shouldUpdate + } + }) + this.monthList = [] + this.state = { + dataSource: this.ds.cloneWithRows(this._getMonthList()) + } + this._renderMonth = this._renderMonth.bind(this) + this._shouldUpdate = this._shouldUpdate.bind(this) + this._checkRange = this._checkRange.bind(this) + this._getWeekNums = this._getWeekNums.bind(this) + this._scrollToSelectedMonth = this._scrollToSelectedMonth.bind(this) + } + componentWillReceiveProps (nextProps) { + const isDateUpdated = ["startDate", "endDate", "minDate", "maxDate"].reduce( + (prev, next) => { + if (prev || nextProps[next] !== this.props[next]) { + return true + } + return prev + }, + false + ) + if (isDateUpdated) { + this.setState({ + dataSource: this.state.dataSource.cloneWithRows(this._getMonthList(nextProps)) + }) + } + } + _renderMonth (month) { + return + } + _checkRange (date, start, end) { + if (!date || !start) { + return false + } + if (!end) { + return date.year() === start.year() && date.month() === start.month() + } + if ( + date.year() < start.year() || + (date.year() === start.year() && date.month() < start.month()) + ) { + return false + } + if ( + date.year() > end.year() || + (date.year() === end.year() && date.month() > end.month()) + ) { + return false + } + return true + } + _shouldUpdate (month, props) { + if (!props) { + return false + } + const { startDate, endDate } = props + const { date } = month + const next = this._checkRange(date, startDate, endDate) + const prev = this._checkRange(date, this.props.startDate, this.props.endDate) + if (prev || next) { + return true + } + return false + } + _getMonthList (props) { + const minDate = (props || this.props).minDate.clone().date(1) + const maxDate = (props || this.props).maxDate.clone() + const monthList = [] + if (!maxDate || !minDate) { + return monthList + } + while ( + maxDate > minDate || // eslint-disable-line no-unmodified-loop-condition + (maxDate.year() === minDate.year() && maxDate.month() === minDate.month()) + ) { + const month = { + date: minDate.clone() + } + month.shouldUpdate = this._shouldUpdate(month, props) + monthList.push(month) + minDate.add(1, "month") + } + return monthList + } + _getWeekNums (start, end) { + const clonedMoment = Moment(start) + let date + let day + let num + let y + let m + let total = 0 + while (!clonedMoment.isSame(end, "months")) { + y = clonedMoment.year() + m = clonedMoment.month() + date = new Date(y, m, 1) + day = date.getDay() + num = new Date(y, m + 1, 0).getDate() + total += Math.ceil((num + day) / 7) + clonedMoment.add(1, "months") + } + return total + } + _scrollToSelectedMonth () { + const { startDate, minDate } = this.props + const monthOffset = + 12 * (startDate.year() - minDate.year()) + startDate.month() - minDate.month() + const weekOffset = this._getWeekNums(minDate, startDate) + setTimeout(() => { + this.list && + this.list.scrollTo({ + x: 0, + y: + monthOffset * (24 + 25) + + (monthOffset ? weekOffset * Math.ceil(width / 7 + 10) : 0), + animated: true + }) + }, 400) + } + componentDidMount () { + this.props.startDate && this._scrollToSelectedMonth() + } + render () { + return ( + { + this.list = list + }} + style={styles.scrollArea} + dataSource={this.state.dataSource} + renderRow={this._renderMonth} + pageSize={2} + initialListSize={2} + showsVerticalScrollIndicator={false} + /> + ) + } } diff --git a/index.android.js b/index.android.js index afbb090..61cc512 100644 --- a/index.android.js +++ b/index.android.js @@ -2,4 +2,4 @@ * Created by TinySymphony on 2017-05-08. */ -export {default} from './index.ios.js'; +export { default } from "./index.ios.js" diff --git a/index.ios.js b/index.ios.js index 353665e..c92da13 100644 --- a/index.ios.js +++ b/index.ios.js @@ -2,127 +2,126 @@ * Created by TinySymphony on 2017-05-08. */ -import React, { Component } from 'react'; -import { - AppRegistry, - StyleSheet, - Text, - View, - TouchableHighlight -} from 'react-native'; -import Calendar from './Calendar'; +import React, { Component } from "react" +import { AppRegistry, StyleSheet, Text, View, TouchableHighlight } from "react-native" +import Calendar from "./Calendar" export default class calendar extends Component { - constructor(props) { - super(props); - this.calendar = null; - this.state = { - startDate: new Date(2017, 7, 12), - endDate: new Date(2017, 8, 23) - }; - this.openCalendar = this.openCalendar.bind(this); - this.confirmDate = this.confirmDate.bind(this); - } - // when confirm button is clicked, an object is conveyed to outer component - // contains following property: - // startDate [Date Object], endDate [Date Object] - // startMoment [Moment Object], endMoment [Moment Object] - confirmDate ({startDate, endDate, startMoment, endMoment}) { - console.log(startDate, endDate, startMoment, endMoment); - this.setState({ - startDate, - endDate - }); - } - openCalendar() { - !!this.calendar && this.calendar.open(); - } - render() { - // It's an optional property, I use this to show the structure of customI18n object. - let customI18n = { - 'w': ['', 'Mon', 'Tues', 'Wed', 'Thur', 'Fri', 'Sat', 'Sun'], - 'weekday': ['', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'], - 'text': { - 'start': 'Check in', - 'end': 'Check out', - 'date': 'Date', - 'save': 'Confirm', - 'clear': 'Reset' - }, - 'date': 'DD / MM' // date format - }; - // optional property, too. - let color = { - mainColor: '#138691' - }; - const { - startDate, - endDate - } = this.state; - let text = startDate && endDate ? startDate.toLocaleDateString() + ' / ' + endDate.toLocaleDateString() : - 'Please select a period'; - return ( - - - Choose Dates - - - {text} - - {this.calendar = calendar;}} - format="YYYYMMDD" - minDate="20170510" - maxDate="20180412" - startDate={this.state.startDate} - endDate={this.state.endDate} - onConfirm={this.confirmDate} - /> - - ); - } + constructor (props) { + super(props) + this.calendar = null + this.state = { + startDate: new Date(2017, 7, 12), + endDate : new Date(2017, 8, 23) + } + this.openCalendar = this.openCalendar.bind(this) + this.confirmDate = this.confirmDate.bind(this) + } + // when confirm button is clicked, an object is conveyed to outer component + // contains following property: + // startDate [Date Object], endDate [Date Object] + // startMoment [Moment Object], endMoment [Moment Object] + confirmDate ({ startDate, endDate, startMoment, endMoment }) { + this.setState({ + startDate, + endDate + }) + } + openCalendar () { + !!this.calendar && this.calendar.open() + } + render () { + // It's an optional property, I use this to show the structure of customI18n object. + // const customI18n = { + // w : ["", "Mon", "Tues", "Wed", "Thur", "Fri", "Sat", "Sun"], + // weekday: [ + // "", + // "Monday", + // "Tuesday", + // "Wednesday", + // "Thursday", + // "Friday", + // "Saturday", + // "Sunday" + // ], + // text: { + // start: "Check in", + // end : "Check out", + // date : "Date", + // save : "Confirm", + // clear: "Reset" + // }, + // date: "DD / MM" // date format + // } + // optional property, too. + const color = { + mainColor: "#138691" + } + const { startDate, endDate } = this.state + const text = + startDate && endDate + ? startDate.toLocaleDateString() + " / " + endDate.toLocaleDateString() + : "Please select a period" + return ( + + + Choose Dates + + + {text} + + { + this.calendar = calendar + }} + format="YYYYMMDD" + minDate="20170510" + maxDate="20180412" + startDate={this.state.startDate} + endDate={this.state.endDate} + onConfirm={this.confirmDate} + /> + + ) + } } const styles = StyleSheet.create({ - container: { - flex: 1, - justifyContent: 'center', - alignItems: 'center', - backgroundColor: '#F5FCFF', - }, - btn: { - paddingHorizontal: 20, - paddingVertical: 10, - overflow: 'hidden', - borderRadius: 6, - marginBottom: 30, - backgroundColor: '#138691' - }, - btnFont: { - color: '#fff', - fontSize: 20 - }, - welcome: { - fontSize: 20, - textAlign: 'center', - margin: 10, - }, - font: { - fontSize: 24, - fontWeight: '400', - color: '#304853' - }, - instructions: { - textAlign: 'center', - color: '#333333', - marginBottom: 5, - }, -}); + container: { + flex : 1, + justifyContent : "center", + alignItems : "center", + backgroundColor: "#F5FCFF" + }, + btn: { + paddingHorizontal: 20, + paddingVertical : 10, + overflow : "hidden", + borderRadius : 6, + marginBottom : 30, + backgroundColor : "#138691" + }, + btnFont: { + color : "#fff", + fontSize: 20 + }, + welcome: { + fontSize : 20, + textAlign: "center", + margin : 10 + }, + font: { + fontSize : 24, + fontWeight: "400", + color : "#304853" + }, + instructions: { + textAlign : "center", + color : "#333333", + marginBottom: 5 + } +}) -AppRegistry.registerComponent('calendar', () => calendar); +AppRegistry.registerComponent("calendar", () => calendar) diff --git a/package.json b/package.json index 07aac9e..31d63c2 100644 --- a/package.json +++ b/package.json @@ -29,12 +29,22 @@ "react-native": "^0.41.2" }, "devDependencies": { - "coveralls": "^2.13.1", - "cz-conventional-changelog": "^2.0.0", + "babel-eslint": "^8.2.1", "babel-jest": "21.2.0", "babel-preset-react-native": "4.0.0", + "coveralls": "^2.13.1", + "cz-conventional-changelog": "^2.0.0", "enzyme": "^3.2.0", "enzyme-adapter-react-16": "^1.1.0", + "eslint": "^4.13.0", + "eslint-config-react": "^1.1.7", + "eslint-config-standard": "^10.2.1", + "eslint-plugin-import": "^2.8.0", + "eslint-plugin-node": "^5.2.1", + "eslint-plugin-prettier": "^2.3.1", + "eslint-plugin-promise": "^3.6.0", + "eslint-plugin-react": "^7.5.1", + "eslint-plugin-standard": "^3.0.1", "istanbul": "^0.4.5", "jest": "21.2.1", "react": "^16.1.0", diff --git a/readme.md b/readme.md index 9fd6907..b8d3fc5 100644 --- a/readme.md +++ b/readme.md @@ -2,44 +2,42 @@ A date picker component like Airbnb. You can select a date period from the calendar modal. - ### Examples -#### iOS Examples +#### Selection Types Example + - +#### iOS Examples - + - + + #### Android Examples + - - - - - + + ### Usage - > This component use `moment.js` to process date. **install from npm** -``` shell +```shell npm install --save react-native-calendar-select ``` **import in project** -``` js -import Calendar from 'react-native-calendar-select'; +```js +import Calendar from "react-native-calendar-select" ``` ```js @@ -82,7 +80,8 @@ render() { }; // optional property, too. let color = { - subColor: '#f0f0f0' + subColor: '#f0f0f0', + mainColor: "#f4995d" }; return ( @@ -106,28 +105,36 @@ render() { ### Properties - -| Property | Type | Default | Description | -| --- | --- | --- | --- | -| i18n | String | 'en' | Language of the component, supports `en` / `zh` / `jp`. | -| customI18n | Object | {} | Customize text of the component, the structure of this object is shown in the example above. | -| color | Object | {} | Customize color. | -| format | string | 'YYYY-MM-DD' | Define date format, you can also pass Date Object or Moment Object as props. | -| minDate | String / Object | - | Min date of calendar | -| maxDate | String / Object | - | Max date of calendar | -| startDate | String / Object | null | Start date of selection | -| endDate | String / Object | null | End date of selection | -| onConfirm | Function | - | Callback function when the period is confirmed, receives an object as only parameter, contains `startDate` / `endDate` / `startMoment` / `endMoment` four property. | +| Property | Type | Default | Description | +| ------------- | ----------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| i18n | String | 'en' | Language of the component, supports `en` / `zh` / `jp`. | +| customI18n | Object | {} | Customize text of the component, the structure of this object is shown in the example above. | +| color | Object | {} | Customize color. | +| format | string | 'YYYY-MM-DD' | Define date format, you can also pass Date Object or Moment Object as props. | +| minDate | String / Object | - | Min date of calendar | +| maxDate | String / Object | - | Max date of calendar | +| startDate | String / Object | null | Start date of selection | +| endDate | String / Object | null | End date of selection | +| onConfirm | Function | - | Callback function when the period is confirmed, receives an object as only parameter, contains `startDate` / `endDate` / `startMoment` / `endMoment` four property. | +| selectionType | enum(`manual`, `week`, `day`) | "manual" | Initial (optional) selection type can be one of `manual`, `week` and `day` | +| animationType | enum(`slide`, `fade`, `none`) | "slide" | Initial (optional) animation type can be one of `slide`, `fade` and `none` | ### Instance methods -| Method | Description | -| --- | --- | -| cancel | Cancel modification of state and close modal | -| close | Close select modal | -| open | Open select modal | -| clear | Reset state of component | -| confirm | Confirm selection and close modal | - +| Method | Description | +| ------- | -------------------------------------------- | +| cancel | Cancel modification of state and close modal | +| close | Close select modal | +| open | Open select modal | +| clear | Reset state of component | +| confirm | Confirm selection and close modal | + +### Color properties + +| Prop | Description | +| ----------- | ----------------------------------------- | +| subColor | Sets the Text Color | +| mainColor | Sets the Background Color of the Calendar | +| borderColor | Sets the Color of the Calendar border | LICENSE MIT diff --git a/GIF/a-en.gif b/screenshots/a-en.gif similarity index 100% rename from GIF/a-en.gif rename to screenshots/a-en.gif diff --git a/GIF/a-jp.gif b/screenshots/a-jp.gif similarity index 100% rename from GIF/a-jp.gif rename to screenshots/a-jp.gif diff --git a/GIF/a-zh.gif b/screenshots/a-zh.gif similarity index 100% rename from GIF/a-zh.gif rename to screenshots/a-zh.gif diff --git a/GIF/ios-en.gif b/screenshots/ios-en.gif similarity index 100% rename from GIF/ios-en.gif rename to screenshots/ios-en.gif diff --git a/GIF/ios-jp.gif b/screenshots/ios-jp.gif similarity index 100% rename from GIF/ios-jp.gif rename to screenshots/ios-jp.gif diff --git a/GIF/ios-zh.gif b/screenshots/ios-zh.gif similarity index 100% rename from GIF/ios-zh.gif rename to screenshots/ios-zh.gif diff --git a/screenshots/selectionTypeBtns.png b/screenshots/selectionTypeBtns.png new file mode 100644 index 0000000..727ee47 Binary files /dev/null and b/screenshots/selectionTypeBtns.png differ diff --git a/yarn.lock b/yarn.lock index ee50ebd..28cd6ae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,58 @@ # yarn lockfile v1 +"@babel/code-frame@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.36.tgz#2349d7ec04b3a06945ae173280ef8579b63728e4" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +"@babel/helper-function-name@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.36.tgz#366e3bc35147721b69009f803907c4d53212e88d" + dependencies: + "@babel/helper-get-function-arity" "7.0.0-beta.36" + "@babel/template" "7.0.0-beta.36" + "@babel/types" "7.0.0-beta.36" + +"@babel/helper-get-function-arity@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.36.tgz#f5383bac9a96b274828b10d98900e84ee43e32b8" + dependencies: + "@babel/types" "7.0.0-beta.36" + +"@babel/template@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.36.tgz#02e903de5d68bd7899bce3c5b5447e59529abb00" + dependencies: + "@babel/code-frame" "7.0.0-beta.36" + "@babel/types" "7.0.0-beta.36" + babylon "7.0.0-beta.36" + lodash "^4.2.0" + +"@babel/traverse@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.36.tgz#1dc6f8750e89b6b979de5fe44aa993b1a2192261" + dependencies: + "@babel/code-frame" "7.0.0-beta.36" + "@babel/helper-function-name" "7.0.0-beta.36" + "@babel/types" "7.0.0-beta.36" + babylon "7.0.0-beta.36" + debug "^3.0.1" + globals "^11.1.0" + invariant "^2.2.0" + lodash "^4.2.0" + +"@babel/types@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.36.tgz#64f2004353de42adb72f9ebb4665fc35b5499d23" + dependencies: + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^2.0.0" + "@types/node@*": version "8.0.57" resolved "http://registry.npm.taobao.org/@types/node/download/@types/node-8.0.57.tgz#e5d8b4dc112763e35cfc51988f4f38da3c486d99" @@ -42,10 +94,28 @@ acorn-globals@^3.1.0: dependencies: acorn "^4.0.4" +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" + +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + acorn@^4.0.4: version "4.0.13" resolved "http://registry.npm.taobao.org/acorn/download/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" +acorn@^5.2.1: + version "5.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.3.0.tgz#7446d39459c54fb49a80e6ee6478149b940ec822" + +ajv-keywords@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" + ajv@^4.9.1: version "4.11.8" resolved "http://registry.npm.taobao.org/ajv/download/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" @@ -62,6 +132,15 @@ ajv@^5.1.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" +ajv@^5.2.3, ajv@^5.3.0: + version "5.5.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "http://registry.npm.taobao.org/align-text/download/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" @@ -152,6 +231,13 @@ array-filter@~0.0.0: version "0.0.1" resolved "http://registry.npm.taobao.org/array-filter/download/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" +array-includes@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.7.0" + array-map@~0.0.0: version "0.0.0" resolved "http://registry.npm.taobao.org/array-map/download/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" @@ -160,15 +246,21 @@ array-reduce@~0.0.0: version "0.0.0" resolved "http://registry.npm.taobao.org/array-reduce/download/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" -array-uniq@^1.0.2: +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1, array-uniq@^1.0.2: version "1.0.3" - resolved "http://registry.npm.taobao.org/array-uniq/download/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" array-unique@^0.2.1: version "0.2.1" resolved "http://registry.npm.taobao.org/array-unique/download/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" -arrify@^1.0.1: +arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "http://registry.npm.taobao.org/arrify/download/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -222,7 +314,7 @@ aws4@^1.2.1, aws4@^1.6.0: version "1.6.0" resolved "http://registry.npm.taobao.org/aws4/download/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" -babel-code-frame@^6.26.0: +babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "http://registry.npm.taobao.org/babel-code-frame/download/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: @@ -254,6 +346,17 @@ babel-core@^6.0.0, babel-core@^6.24.1, babel-core@^6.26.0, babel-core@^6.7.2: slash "^1.0.0" source-map "^0.5.6" +babel-eslint@^8.2.1: + version "8.2.1" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.1.tgz#136888f3c109edc65376c23ebf494f36a3e03951" + dependencies: + "@babel/code-frame" "7.0.0-beta.36" + "@babel/traverse" "7.0.0-beta.36" + "@babel/types" "7.0.0-beta.36" + babylon "7.0.0-beta.36" + eslint-scope "~3.7.1" + eslint-visitor-keys "^1.0.0" + babel-generator@^6.18.0, babel-generator@^6.24.1, babel-generator@^6.26.0: version "6.26.0" resolved "http://registry.npm.taobao.org/babel-generator/download/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5" @@ -787,6 +890,10 @@ babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26 lodash "^4.17.4" to-fast-properties "^1.0.3" +babylon@7.0.0-beta.36: + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.36.tgz#3a3683ba6a9a1e02b0aa507c8e63435e39305b9e" + babylon@^6.18.0: version "6.18.0" resolved "http://registry.npm.taobao.org/babylon/download/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" @@ -919,7 +1026,7 @@ bser@^2.0.0: dependencies: node-int64 "^0.4.0" -builtin-modules@^1.0.0: +builtin-modules@^1.0.0, builtin-modules@^1.1.1: version "1.1.1" resolved "http://registry.npm.taobao.org/builtin-modules/download/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -931,6 +1038,16 @@ bytes@2.4.0: version "2.4.0" resolved "http://registry.npm.taobao.org/bytes/download/bytes-2.4.0.tgz#7d97196f9d5baf7f6935e25985549edd2a6c2339" +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + callsites@^2.0.0: version "2.0.0" resolved "http://registry.npm.taobao.org/callsites/download/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" @@ -968,7 +1085,7 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0: version "2.3.0" resolved "http://registry.npm.taobao.org/chalk/download/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" dependencies: @@ -995,6 +1112,10 @@ ci-info@^1.0.0: version "1.1.2" resolved "http://registry.npm.taobao.org/ci-info/download/ci-info-1.1.2.tgz#03561259db48d0474c8bdc90f5b47b068b6bbfb4" +circular-json@^0.3.1: + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + cli-cursor@^2.1.0: version "2.1.0" resolved "http://registry.npm.taobao.org/cli-cursor/download/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" @@ -1139,6 +1260,10 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "http://registry.npm.taobao.org/console-control-strings/download/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + content-type-parser@^1.0.1: version "1.0.2" resolved "http://registry.npm.taobao.org/content-type-parser/download/content-type-parser-1.0.2.tgz#caabe80623e63638b2502fd4c7f12ff4ce2352e7" @@ -1292,13 +1417,13 @@ dateformat@^2.0.0: version "2.2.0" resolved "http://registry.npm.taobao.org/dateformat/download/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062" -debug@2.6.9, debug@^2.2.0, debug@^2.6.8: +debug@2.6.9, debug@^2.2.0, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "http://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: ms "2.0.0" -debug@^3.1.0: +debug@^3.0.1, debug@^3.1.0: version "3.1.0" resolved "http://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: @@ -1335,6 +1460,18 @@ define-properties@^1.1.2: foreach "^2.0.5" object-keys "^1.0.8" +del@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + delayed-stream@~1.0.0: version "1.0.0" resolved "http://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -1377,6 +1514,19 @@ discontinuous-range@1.0.0: version "1.0.0" resolved "http://registry.npm.taobao.org/discontinuous-range/download/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a" +doctrine@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +doctrine@^2.0.0, doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + dependencies: + esutils "^2.0.2" + dom-serializer@0, dom-serializer@~0.1.0: version "0.1.0" resolved "http://registry.npm.taobao.org/dom-serializer/download/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" @@ -1506,7 +1656,7 @@ errorhandler@~1.4.2: accepts "~1.3.0" escape-html "~1.0.3" -es-abstract@^1.6.1: +es-abstract@^1.6.1, es-abstract@^1.7.0: version "1.10.0" resolved "http://registry.npm.taobao.org/es-abstract/download/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864" dependencies: @@ -1558,6 +1708,136 @@ escodegen@^1.6.1: optionalDependencies: source-map "~0.5.6" +eslint-config-react@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/eslint-config-react/-/eslint-config-react-1.1.7.tgz#a0918d0fc47d0e9bd161a47308021da85d2585b3" + +eslint-config-standard@^10.2.1: + version "10.2.1" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-10.2.1.tgz#c061e4d066f379dc17cd562c64e819b4dd454591" + +eslint-import-resolver-node@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" + dependencies: + debug "^2.6.9" + resolve "^1.5.0" + +eslint-module-utils@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz#abaec824177613b8a95b299639e1b6facf473449" + dependencies: + debug "^2.6.8" + pkg-dir "^1.0.0" + +eslint-plugin-import@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz#fa1b6ef31fcb3c501c09859c1b86f1fc5b986894" + dependencies: + builtin-modules "^1.1.1" + contains-path "^0.1.0" + debug "^2.6.8" + doctrine "1.5.0" + eslint-import-resolver-node "^0.3.1" + eslint-module-utils "^2.1.1" + has "^1.0.1" + lodash.cond "^4.3.0" + minimatch "^3.0.3" + read-pkg-up "^2.0.0" + +eslint-plugin-node@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-5.2.1.tgz#80df3253c4d7901045ec87fa660a284e32bdca29" + dependencies: + ignore "^3.3.6" + minimatch "^3.0.4" + resolve "^1.3.3" + semver "5.3.0" + +eslint-plugin-prettier@^2.3.1: + version "2.5.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.5.0.tgz#39a91dd7528eaf19cd42c0ee3f2c1f684606a05f" + dependencies: + fast-diff "^1.1.1" + jest-docblock "^21.0.0" + +eslint-plugin-promise@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.6.0.tgz#54b7658c8f454813dc2a870aff8152ec4969ba75" + +eslint-plugin-react@^7.5.1: + version "7.5.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.5.1.tgz#52e56e8d80c810de158859ef07b880d2f56ee30b" + dependencies: + doctrine "^2.0.0" + has "^1.0.1" + jsx-ast-utils "^2.0.0" + prop-types "^15.6.0" + +eslint-plugin-standard@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz#34d0c915b45edc6f010393c7eef3823b08565cf2" + +eslint-scope@^3.7.1, eslint-scope@~3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + +eslint@^4.13.0: + version "4.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.16.0.tgz#934ada9e98715e1d7bbfd6f6f0519ed2fab35cc1" + dependencies: + ajv "^5.3.0" + babel-code-frame "^6.22.0" + chalk "^2.1.0" + concat-stream "^1.6.0" + cross-spawn "^5.1.0" + debug "^3.1.0" + doctrine "^2.1.0" + eslint-scope "^3.7.1" + eslint-visitor-keys "^1.0.0" + espree "^3.5.2" + esquery "^1.0.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.0.1" + ignore "^3.3.3" + imurmurhash "^0.1.4" + inquirer "^3.0.6" + is-resolvable "^1.0.0" + js-yaml "^3.9.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.4" + minimatch "^3.0.2" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + require-uncached "^1.0.3" + semver "^5.3.0" + strip-ansi "^4.0.0" + strip-json-comments "~2.0.1" + table "^4.0.1" + text-table "~0.2.0" + +espree@^3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.2.tgz#756ada8b979e9dcfcdb30aad8d1a9304a905e1ca" + dependencies: + acorn "^5.2.1" + acorn-jsx "^3.0.0" + esprima@2.7.x, esprima@^2.6.0, esprima@^2.7.1: version "2.7.3" resolved "http://registry.npm.taobao.org/esprima/download/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" @@ -1570,11 +1850,24 @@ esprima@^4.0.0: version "4.0.0" resolved "http://registry.npm.taobao.org/esprima/download/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" +esquery@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" + dependencies: + estraverse "^4.1.0" + object-assign "^4.0.1" + estraverse@^1.9.1: version "1.9.3" resolved "http://registry.npm.taobao.org/estraverse/download/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" -estraverse@^4.2.0: +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "http://registry.npm.taobao.org/estraverse/download/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -1682,6 +1975,10 @@ fast-deep-equal@^1.0.0: version "1.0.0" resolved "http://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" +fast-diff@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154" + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "http://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -1727,6 +2024,13 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + filename-regex@^2.0.0: version "2.0.1" resolved "http://registry.npm.taobao.org/filename-regex/download/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" @@ -1770,6 +2074,15 @@ find-up@^2.0.0, find-up@^2.1.0: dependencies: locate-path "^2.0.0" +flat-cache@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" + dependencies: + circular-json "^0.3.1" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" + for-in@^1.0.1: version "1.0.2" resolved "http://registry.npm.taobao.org/for-in/download/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -1856,6 +2169,10 @@ function.prototype.name@^1.0.3: function-bind "^1.1.0" is-callable "^1.1.3" +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + gauge@~1.2.5: version "1.2.7" resolved "http://registry.npm.taobao.org/gauge/download/gauge-1.2.7.tgz#e9cec5483d3d4ee0ef44b60a7d99e4935e136d93" @@ -1944,10 +2261,25 @@ global@^4.3.0: min-document "^2.19.0" process "~0.5.1" +globals@^11.0.1, globals@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.1.0.tgz#632644457f5f0e3ae711807183700ebf2e4633e4" + globals@^9.18.0: version "9.18.0" resolved "http://registry.npm.taobao.org/globals/download/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" +globby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + glogg@^1.0.0: version "1.0.0" resolved "http://registry.npm.taobao.org/glogg/download/glogg-1.0.0.tgz#7fe0f199f57ac906cf512feead8f90ee4a284fc5" @@ -2151,6 +2483,10 @@ iconv-lite@0.4.19, iconv-lite@^0.4.17, iconv-lite@^0.4.8, iconv-lite@~0.4.13: version "0.4.19" resolved "http://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" +ignore@^3.3.3, ignore@^3.3.6: + version "3.3.7" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" + image-size@^0.6.0: version "0.6.1" resolved "http://registry.npm.taobao.org/image-size/download/image-size-0.6.1.tgz#98122a562d59dcc097ef1b2c8191866eb8f5d663" @@ -2193,7 +2529,7 @@ inquirer@^3.0.6: strip-ansi "^4.0.0" through "^2.3.6" -invariant@^2.2.2: +invariant@^2.2.0, invariant@^2.2.2: version "2.2.2" resolved "http://registry.npm.taobao.org/invariant/download/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" dependencies: @@ -2292,6 +2628,22 @@ is-number@^3.0.0: dependencies: kind-of "^3.0.2" +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + +is-path-in-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + dependencies: + path-is-inside "^1.0.1" + is-posix-bracket@^0.1.0: version "0.1.1" resolved "http://registry.npm.taobao.org/is-posix-bracket/download/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" @@ -2314,6 +2666,10 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" +is-resolvable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" + is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "http://registry.npm.taobao.org/is-stream/download/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -2338,7 +2694,7 @@ isarray@0.0.1: version "0.0.1" resolved "http://registry.npm.taobao.org/isarray/download/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" -isarray@1.0.0, isarray@~1.0.0: +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "http://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -2510,7 +2866,7 @@ jest-diff@^21.2.1: jest-get-type "^21.2.0" pretty-format "^21.2.1" -jest-docblock@^21, jest-docblock@^21.2.0: +jest-docblock@^21, jest-docblock@^21.0.0, jest-docblock@^21.2.0: version "21.2.0" resolved "http://registry.npm.taobao.org/jest-docblock/download/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" @@ -2681,7 +3037,7 @@ js-yaml@3.6.1: argparse "^1.0.7" esprima "^2.6.0" -js-yaml@3.x, js-yaml@^3.7.0: +js-yaml@3.x, js-yaml@^3.7.0, js-yaml@^3.9.1: version "3.10.0" resolved "http://registry.npm.taobao.org/js-yaml/download/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" dependencies: @@ -2732,6 +3088,10 @@ json-schema@0.2.3: version "0.2.3" resolved "http://registry.npm.taobao.org/json-schema/download/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + json-stable-stringify@^1.0.1: version "1.0.1" resolved "http://registry.npm.taobao.org/json-stable-stringify/download/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" @@ -2773,6 +3133,12 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" +jsx-ast-utils@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz#e801b1b39985e20fffc87b40e3748080e2dcac7f" + dependencies: + array-includes "^3.0.3" + kind-of@^3.0.2: version "3.2.2" resolved "http://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -2813,7 +3179,7 @@ leven@^2.1.0: version "2.1.0" resolved "http://registry.npm.taobao.org/leven/download/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" -levn@~0.3.0: +levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "http://registry.npm.taobao.org/levn/download/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" dependencies: @@ -2882,6 +3248,10 @@ lodash._root@^3.0.0: version "3.0.1" resolved "http://registry.npm.taobao.org/lodash._root/download/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" +lodash.cond@^4.3.0: + version "4.5.2" + resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" + lodash.escape@^3.0.0: version "3.2.0" resolved "http://registry.npm.taobao.org/lodash.escape/download/lodash.escape-3.2.0.tgz#995ee0dc18c1b48cc92effae71a10aab5b487698" @@ -2953,7 +3323,7 @@ lodash@^3.5.0: version "3.10.1" resolved "http://registry.npm.taobao.org/lodash/download/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" -lodash@^4.14.0, lodash@^4.15.0, lodash@^4.16.6, lodash@^4.17.4, lodash@^4.3.0, lodash@^4.6.1: +lodash@^4.14.0, lodash@^4.15.0, lodash@^4.16.6, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.6.1: version "4.17.4" resolved "http://registry.npm.taobao.org/lodash/download/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -3409,7 +3779,7 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" -optionator@^0.8.1: +optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "http://registry.npm.taobao.org/optionator/download/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" dependencies: @@ -3515,6 +3885,10 @@ path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "http://registry.npm.taobao.org/path-is-absolute/download/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" +path-is-inside@^1.0.1, path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + path-key@^2.0.0: version "2.0.1" resolved "http://registry.npm.taobao.org/path-key/download/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" @@ -3571,6 +3945,12 @@ pinkie@^2.0.0: version "2.0.4" resolved "http://registry.npm.taobao.org/pinkie/download/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + dependencies: + find-up "^1.0.0" + plist@2.0.1: version "2.0.1" resolved "http://registry.npm.taobao.org/plist/download/plist-2.0.1.tgz#0a32ca9481b1c364e92e18dc55c876de9d01da8b" @@ -3588,6 +3968,10 @@ plist@^1.2.0: xmlbuilder "4.0.0" xmldom "0.1.x" +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" + prelude-ls@~1.1.2: version "1.1.2" resolved "http://registry.npm.taobao.org/prelude-ls/download/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -3619,6 +4003,10 @@ process@~0.5.1: version "0.5.2" resolved "http://registry.npm.taobao.org/process/download/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" +progress@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" + promise@^7.1.1: version "7.3.1" resolved "http://registry.npm.taobao.org/promise/download/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" @@ -4041,10 +4429,27 @@ require-main-filename@^1.0.1: version "1.0.1" resolved "http://registry.npm.taobao.org/require-main-filename/download/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" +require-uncached@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + resolve@1.1.7, resolve@1.1.x: version "1.1.7" resolved "http://registry.npm.taobao.org/resolve/download/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" +resolve@^1.3.3, resolve@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" + dependencies: + path-parse "^1.0.5" + response-time@~2.3.1: version "2.3.2" resolved "http://registry.npm.taobao.org/response-time/download/response-time-2.3.2.tgz#ffa71bab952d62f7c1d49b7434355fbc68dffc5a" @@ -4073,7 +4478,7 @@ right-pad@^1.0.1: version "1.0.1" resolved "http://registry.npm.taobao.org/right-pad/download/right-pad-1.0.1.tgz#8ca08c2cbb5b55e74dafa96bf7fd1a27d568c8d0" -rimraf@2, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: +rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: version "2.6.2" resolved "http://registry.npm.taobao.org/rimraf/download/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -4144,6 +4549,10 @@ sax@~1.1.1: version "5.4.1" resolved "http://registry.npm.taobao.org/semver/download/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" +semver@5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + send@0.13.2: version "0.13.2" resolved "http://registry.npm.taobao.org/send/download/send-0.13.2.tgz#765e7607c8055452bba6f0b052595350986036de" @@ -4237,6 +4646,12 @@ slash@^1.0.0: version "1.0.0" resolved "http://registry.npm.taobao.org/slash/download/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" +slice-ansi@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" + dependencies: + is-fullwidth-code-point "^2.0.0" + slide@^1.1.5: version "1.1.6" resolved "http://registry.npm.taobao.org/slide/download/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" @@ -4352,7 +4767,7 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string-width@^2.0.0, string-width@^2.1.0: +string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "http://registry.npm.taobao.org/string-width/download/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" dependencies: @@ -4427,6 +4842,17 @@ sync-exec@~0.6.x: version "0.6.2" resolved "http://registry.npm.taobao.org/sync-exec/download/sync-exec-0.6.2.tgz#717d22cc53f0ce1def5594362f3a89a2ebb91105" +table@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" + dependencies: + ajv "^5.2.3" + ajv-keywords "^2.1.0" + chalk "^2.1.0" + lodash "^4.17.4" + slice-ansi "1.0.0" + string-width "^2.1.1" + tar-pack@^3.4.0: version "3.4.1" resolved "http://registry.npm.taobao.org/tar-pack/download/tar-pack-3.4.1.tgz#e1dbc03a9b9d3ba07e896ad027317eb679a10a1f" @@ -4465,6 +4891,10 @@ test-exclude@^4.1.1: read-pkg-up "^1.0.1" require-main-filename "^1.0.1" +text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + throat@^4.0.0, throat@^4.1.0: version "4.1.0" resolved "http://registry.npm.taobao.org/throat/download/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" @@ -4498,6 +4928,10 @@ to-fast-properties@^1.0.3: version "1.0.3" resolved "http://registry.npm.taobao.org/to-fast-properties/download/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + tough-cookie@^2.3.2, tough-cookie@~2.3.0, tough-cookie@~2.3.3: version "2.3.3" resolved "http://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" @@ -4772,6 +5206,12 @@ write-file-atomic@^2.1.0: imurmurhash "^0.1.4" signal-exit "^3.0.2" +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + ws@^1.1.0: version "1.1.5" resolved "http://registry.npm.taobao.org/ws/download/ws-1.1.5.tgz#cbd9e6e75e09fc5d2c90015f21f0c40875e0dd51"