/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var _beeLayout = __webpack_require__(1);
var _beePanel = __webpack_require__(8);
var _beeButton = __webpack_require__(103);
var _beeButton2 = _interopRequireDefault(_beeButton);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var CARET = _react2['default'].createElement('i', { className: 'uf uf-arrow-down' });
var CARETUP = _react2['default'].createElement('i', { className: 'uf uf-arrow-up' });
var Demo1 = __webpack_require__(105);var Demo10 = __webpack_require__(123);var Demo11 = __webpack_require__(124);var Demo12 = __webpack_require__(127);var Demo13 = __webpack_require__(130);var Demo14 = __webpack_require__(134);var Demo15 = __webpack_require__(464);var Demo16 = __webpack_require__(465);var Demo2 = __webpack_require__(466);var Demo3 = __webpack_require__(472);var Demo4 = __webpack_require__(473);var Demo5 = __webpack_require__(474);var Demo6 = __webpack_require__(475);var Demo7 = __webpack_require__(476);var Demo8 = __webpack_require__(477);var Demo9 = __webpack_require__(481);var DemoArray = [{ "example": _react2['default'].createElement(Demo1, null), "title": " 简单表格", "code": "/**\n*\n* @title 简单表格\n* @description\n*\n*/\n\nimport React, { Component } from \"react\";\nimport Table from \"../../src\";\n\nconst columns = [\n { title: \"用户名\", dataIndex: \"a\", key: \"a\", width: 100 },\n { id: \"123\", title: \"性别\", dataIndex: \"b\", key: \"b\", width: 100 },\n { title: \"年龄\", dataIndex: \"c\", key: \"c\", width: 200 },\n {\n title: \"操作\",\n dataIndex: \"d\",\n key: \"d\",\n render(text, record, index) {\n return (\n {\n alert('这是第'+index+'列,内容为:'+text);\n }}\n >\n 一些操作\n \n );\n }\n }\n];\n\nconst data = [\n { a: \"令狐冲\", b: \"男\", c: 41, d: \"操作\", key: \"1\" },\n { a: \"杨过\", b: \"男\", c: 67, d: \"操作\", key: \"2\" },\n { a: \"郭靖\", b: \"男\", c: 25, d: \"操作\", key: \"3\" }\n];\n\nclass Demo1 extends Component {\n render() {\n return (\n
标题: 这是一个标题
}\n footer={currentData => 表尾: 我是小尾巴
}\n />\n );\n }\n}\n\n\n", "desc": "" }, { "example": _react2['default'].createElement(Demo10, null), "title": " 无数据时显示", "code": "/**\n*\n* @title 无数据时显示\n* @description 无数据时显示效果展示(可自定义)\n *\n* import {Table} from 'tinper-bee';\n*/\n\n\nimport React, { Component } from 'react';\nimport Table from 'bee-table';\n\n\nconst columns10 = [\n {\n title: \"Name\",\n dataIndex: \"name\",\n key: \"name\",\n width: \"40%\"\n },\n {\n title: \"Age\",\n dataIndex: \"age\",\n key: \"age\",\n width: \"30%\"\n },\n {\n title: \"Address\",\n dataIndex: \"address\",\n key: \"address\"\n }\n ];\n \n const data10 = [\n \n ];\n\n const emptyFunc = () => 这里没有数据! \n \n class Demo10 extends Component {\n render() {\n return ;\n }\n }\n\n", "desc": " 无数据时显示效果展示(可自定义)" }, { "example": _react2['default'].createElement(Demo11, null), "title": " 列排序", "code": "/**\n*\n* @title 列排序\n* @description 点击列的上下按钮即可排序\n*\n*/\n\n\nimport React, { Component } from 'react';\nimport Table from 'bee-table';\nimport Icon from \"bee-icon\";\n\nconst columns11 = [\n {\n title: \"名字\",\n dataIndex: \"a\",\n key: \"a\",\n width: 100\n },\n {\n title: \"性别\",\n dataIndex: \"b\",\n key: \"b\",\n width: 100\n },\n {\n title: \"年龄\",\n dataIndex: \"c\",\n key: \"c\",\n width: 200,\n sorter: (a, b) => a.c - b.c\n },\n {\n title: \"武功级别\",\n dataIndex: \"d\",\n key: \"d\"\n }\n];\n\nconst data11 = [\n { a: \"杨过\", b: \"男\", c: 30,d:'内行', key: \"2\" },\n { a: \"令狐冲\", b: \"男\", c: 41,d:'大侠', key: \"1\" },\n { a: \"郭靖\", b: \"男\", c: 25,d:'大侠', key: \"3\" }\n];\n\nconst defaultProps11 = {\n prefixCls: \"bee-table\"\n};\nclass Demo11 extends Component {\n constructor(props) {\n super(props);\n this.state = {\n sortOrder: \"\",\n data: data11\n };\n }\n toggleSortOrder=(order, column)=> {\n let { sortOrder, data, oldData } = this.state;\n let ascend_sort = function(key) {\n return function(a, b) {\n return a.key - b.key;\n };\n };\n let descend_sort = function(key) {\n return function(a, b) {\n return b.key - a.key;\n };\n };\n if (sortOrder === order) {\n // 切换为未排序状态\n order = \"\";\n }\n if (!oldData) {\n oldData = data.concat();\n }\n if (order === \"ascend\") {\n data = data.sort(function(a, b) {\n return column.sorter(a, b);\n });\n } else if (order === \"descend\") {\n data = data.sort(function(a, b) {\n return column.sorter(b, a);\n });\n } else {\n data = oldData.concat();\n }\n this.setState({\n sortOrder: order,\n data: data,\n oldData: oldData\n });\n }\n renderColumnsDropdown(columns) {\n const { sortOrder } = this.state;\n const { prefixCls } = this.props;\n\n return columns.map(originColumn => {\n let column = Object.assign({}, originColumn);\n let sortButton;\n if (column.sorter) {\n const isAscend = sortOrder === \"ascend\";\n const isDescend = sortOrder === \"descend\";\n sortButton = (\n \n this.toggleSortOrder(\"ascend\", column)}\n >\n \n \n this.toggleSortOrder(\"descend\", column)}\n >\n \n \n
\n );\n }\n column.title = (\n \n {column.title}\n {sortButton}\n \n );\n return column;\n });\n }\n render() {\n let columns = this.renderColumnsDropdown(columns11);\n return ;\n }\n}\nDemo11.defaultProps = defaultProps11;\n\n\n", "desc": " 点击列的上下按钮即可排序" }, { "example": _react2['default'].createElement(Demo12, null), "title": " 全选功能", "code": "/**\n*\n* @title 全选功能\n* @description 点击表格左列按钮即可选中,并且在选中的回调函数中能获取到选中的数据(未使用封装好的全选功能)\n*\n*/\n\n\nimport React, { Component } from 'react';\nimport Table from 'bee-table';\nimport Checkbox from \"bee-checkbox\";\n\nconst columns12 = [\n {\n title: \"名字\",\n dataIndex: \"a\",\n key: \"a\",\n width: 100\n },\n {\n title: \"性别\",\n dataIndex: \"b\",\n key: \"b\",\n width: 100\n },\n {\n title: \"年龄\",\n dataIndex: \"c\",\n key: \"c\",\n width: 200,\n sorter: (a, b) => a.c - b.c\n },\n {\n title: \"武功级别\",\n dataIndex: \"d\",\n key: \"d\"\n }\n];\n\nconst data12 = [\n { a: \"杨过\", b: \"男\", c: 30,d:'内行', key: \"2\" },\n { a: \"令狐冲\", b: \"男\", c: 41,d:'大侠', key: \"1\" },\n { a: \"郭靖\", b: \"男\", c: 25,d:'大侠', key: \"3\" }\n];\n\nconst defaultProps12 = {\n prefixCls: \"bee-table\",\n multiSelect: {\n type: \"checkbox\",\n param: \"key\"\n }\n};\nclass Demo12 extends Component {\n constructor(props) {\n super(props);\n this.state = {\n checkedAll:false,\n checkedArray: [\n false,\n false,\n false,\n ],\n data: data12\n };\n }\n onAllCheckChange = () => {\n let self = this;\n let checkedArray = [];\n let listData = self.state.data.concat();\n let selIds = [];\n // let id = self.props.multiSelect.param;\n for (var i = 0; i < self.state.checkedArray.length; i++) {\n checkedArray[i] = !self.state.checkedAll;\n }\n // if (self.state.checkedAll) {\n // selIds = [];\n // } else {\n // for (var i = 0; i < listData.length; i++) {\n // selIds[i] = listData[i][id];\n // }\n // }\n self.setState({\n checkedAll: !self.state.checkedAll,\n checkedArray: checkedArray,\n // selIds: selIds\n });\n // self.props.onSelIds(selIds);\n };\n onCheckboxChange = (text, record, index) => {\n let self = this;\n let allFlag = false;\n // let selIds = self.state.selIds;\n // let id = self.props.postId;\n let checkedArray = self.state.checkedArray.concat();\n // if (self.state.checkedArray[index]) {\n // selIds.remove(record[id]);\n // } else {\n // selIds.push(record[id]);\n // }\n checkedArray[index] = !self.state.checkedArray[index];\n for (var i = 0; i < self.state.checkedArray.length; i++) {\n if (!checkedArray[i]) {\n allFlag = false;\n break;\n } else {\n allFlag = true;\n }\n }\n self.setState({\n checkedAll: allFlag,\n checkedArray: checkedArray,\n // selIds: selIds\n });\n // self.props.onSelIds(selIds);\n };\n renderColumnsMultiSelect(columns) {\n const { data,checkedArray } = this.state;\n const { multiSelect } = this.props;\n let select_column = {};\n let indeterminate_bool = false;\n // let indeterminate_bool1 = true;\n if (multiSelect && multiSelect.type === \"checkbox\") {\n let i = checkedArray.length;\n while(i--){\n if(checkedArray[i]){\n indeterminate_bool = true;\n break;\n }\n }\n let defaultColumns = [\n {\n title: (\n \n ),\n key: \"checkbox\",\n dataIndex: \"checkbox\",\n width: \"5%\",\n render: (text, record, index) => {\n return (\n \n );\n }\n }\n ];\n columns = defaultColumns.concat(columns);\n }\n return columns;\n }\n render() {\n let columns = this.renderColumnsMultiSelect(columns12);\n return ;\n }\n}\nDemo12.defaultProps = defaultProps12;\n\n", "desc": " 点击表格左列按钮即可选中,并且在选中的回调函数中能获取到选中的数据(未使用封装好的全选功能)" }, { "example": _react2['default'].createElement(Demo13, null), "title": " 列排序、全选功能、合计", "code": "/**\n *\n * @title 列排序、全选功能、合计\n * @description 列排序、全选功能、合计(通过使用的封装好的功能方法实现复杂功能,简单易用!)\n *\n */\n\nimport React, { Component } from \"react\";\nimport Table from \"../../src\";\nimport Checkbox from \"bee-checkbox\";\nimport Button from \"bee-button\";\nimport multiSelect from \"../../src/lib/multiSelect.js\";\nimport sort from \"../../src/lib/sort.js\";\nimport sum from \"../../src/lib/sum.js\";\n\nconst columns13 = [\n {\n title: \"名字\",\n dataIndex: \"a\",\n key: \"a\",\n width: 200\n },\n {\n title: \"性别\",\n dataIndex: \"b\",\n key: \"b\",\n width: 200\n },\n {\n title: \"年龄\",\n dataIndex: \"c\",\n key: \"c\",\n width: 200,\n sumCol: true,\n sorter: (a, b) => a.c - b.c\n },\n {\n title: \"武功级别\",\n dataIndex: \"d\",\n key: \"d\",\n width: 200\n }\n];\n\nconst data13 = [\n { a: \"杨过\", b: \"男\", c: 30, d: \"内行\", key: \"2\" },\n { a: \"令狐冲\", b: \"男\", c: 41, d: \"大侠\", key: \"1\" },\n { a: \"郭靖\", b: \"男\", c: 25, d: \"大侠\", key: \"3\" }\n];\nconst data13_1 = [\n { a: \"杨过\", b: \"男\", c: 30, d: \"内行\", key: \"2\" },\n { a: \"杨过\", b: \"男\", c: 30, d: \"内行\", key: \"22\" },\n { a: \"杨过\", b: \"男\", c: 30, d: \"内行\", key: \"222\" },\n { a: \"令狐冲\", b: \"男\", c: 41, d: \"大侠\", key: \"1\" },\n { a: \"郭靖\", b: \"男\", c: 25, d: \"大侠\", key: \"3\" }\n];\n//拼接成复杂功能的table组件不能在render中定义,需要像此例子声明在组件的外侧,不然操作state会导致功能出现异常\nlet ComplexTable = multiSelect(sum(sort(Table)));\n\nclass Demo13 extends Component {\n constructor(props) {\n super(props);\n this.state = {\n data13: data13,\n selectedRow: this.selectedRow,\n selectDisabled: this.selectDisabled\n };\n }\n getSelectedDataFunc = data => {\n console.log(data);\n };\n selectDisabled = (record, index) => {\n console.log(record);\n if (index === 1) {\n return true;\n }\n return false;\n };\n selectedRow = (record, index) => {\n console.log(record);\n if (index === 0) {\n return true;\n }\n return false;\n };\n onClick = () => {\n this.setState({\n selectedRow: function() {}\n });\n };\n onClick1 = () => {\n this.setState({\n selectDisabled: (record, index) => {\n console.log(record);\n if (index === 2) {\n return true;\n }\n return false;\n }\n });\n };\n render() {\n let multiObj = {\n type: \"checkbox\"\n };\n return (\n \n \n change selectedRow\n \n \n change selectDisabled\n \n \n
\n );\n }\n}\n\n", "desc": " 列排序、全选功能、合计(通过使用的封装好的功能方法实现复杂功能,简单易用!)" }, { "example": _react2['default'].createElement(Demo14, null), "title": " 编辑态表格", "code": "/**\n*\n* @title 编辑态表格\n* @description 这是带有多种不同格式的编辑态表格(编辑态是通过使用不同的render来达到不同编辑格式)\n*\n*/\n\nimport Button from \"bee-button\";\nimport React, { Component } from \"react\";\nimport Table from \"../../src\";\nimport Animate from \"bee-animate\";\nimport Tooltip from \"bee-tooltip\";\nimport Icon from \"bee-icon\";\nimport Input from \"bee-form-control\";\nimport Checkbox from \"bee-checkbox\";\nimport Select from \"bee-select\";\nimport InputRender from \"../../build/render/InputRender.js\";\nimport DateRender from \"../../build/render/DateRender.js\";\nimport SelectRender from \"../../build/render/SelectRender.js\";\n\n//日期控件引入\nimport DatePicker from \"bee-datepicker\";\nimport MonthPicker, { WeekPicker, RangePicker } from \"bee-datepicker\";\n\nconst format = \"YYYY-MM-DD\";\nconst format2 = \"YYYY-MM\";\nconst format3 = \"YYYY-MM-DD HH:mm:ss\";\n\nconst dateInputPlaceholder = \"选择日期\";\nconst dateInputPlaceholder2 = \"选择年月\";\nconst dataSource = [\n {\n key: \"boyuzhou\",\n value: \"jack\"\n },\n {\n key: \"renhualiu\",\n value: \"lucy\"\n },\n {\n key: \"yuzhao\",\n value: \"yiminghe\"\n }\n];\nclass Demo14 extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n dataSource: [\n {\n key: \"0\",\n name: \"沉鱼\",\n number: \"10\",\n age: \"y\",\n address: \"jack\",\n datepicker: \"2017-06-12\",\n MonthPicker: \"2017-02\"\n },\n {\n key: \"1\",\n name: \"落雁\",\n number: \"100\",\n age: \"y\",\n address: \"lucy\",\n datepicker: \"2017-06-12\",\n MonthPicker: \"2017-02\"\n },\n {\n key: \"2\",\n name: \"闭月\",\n number: \"1000\",\n age: \"n\",\n address: \"lucy\",\n datepicker: \"2017-06-12\",\n MonthPicker: \"2017-02\"\n },\n {\n key: \"3\",\n name: \"羞花\",\n number: \"9999\",\n age: \"y\",\n address: \"lucy\",\n datepicker: \"2017-06-12\",\n MonthPicker: \"2017-02\"\n }\n ],\n count: 4\n };\n this.columns = [\n {\n title: \"普通输入\",\n dataIndex: \"name\",\n key: \"name\",\n width: \"150px\",\n render: (text, record, index) => (\n \n \n \n }\n reg={/^[0-9]+$/}\n />\n )\n },\n {\n title: \"货币输入\",\n dataIndex: \"number\",\n key: \"number\",\n width: \"150px\",\n render: (text, record, index) => (\n \n \n \n }\n />\n )\n },\n {\n title: \"复选\",\n dataIndex: \"age\",\n key: \"age\",\n width: \"100px\",\n render: (text, record, index) => (\n \n )\n },\n {\n title: \"下拉框\",\n dataIndex: \"address\",\n key: \"address\",\n width: \"200px\",\n render: (text, record, index) => {\n return (\n \n boyuzhou \n renhualiu \n \n Disabled\n \n yuzhao \n \n );\n }\n },\n {\n title: \"年月日\",\n dataIndex: \"datepicker\",\n key: \"datepicker\",\n width: \"200px\",\n render: (text, record, index) => {\n return (\n \n );\n }\n },\n {\n title: \"年月\",\n dataIndex: \"MonthPicker\",\n key: \"MonthPicker\",\n width: \"200px\",\n render: (text, record, index) => {\n return (\n \n );\n }\n }\n ];\n }\n check = (flag, obj) => {\n console.log(flag);\n console.log(obj);\n };\n\n onInputChange = (index, key) => {\n return value => {\n const dataSource = [...this.state.dataSource];\n dataSource[index][key] = value;\n this.setState({ dataSource });\n };\n };\n onCheckChange = (index, key) => {\n return value => {\n const dataSource = [...this.state.dataSource];\n dataSource[index][key] = value;\n this.setState({ dataSource });\n };\n };\n onSelectChange = (index, key) => {\n return value => {\n console.log(`selected ${value}`);\n const dataSource = [...this.state.dataSource];\n dataSource[index][key] = value;\n this.setState({ dataSource });\n };\n };\n onDateChange = d => {\n console.log(d);\n };\n onDateSelect = d => {\n console.log(d);\n };\n onDelete = index => {\n return () => {\n const dataSource = [...this.state.dataSource];\n dataSource.splice(index, 1);\n this.setState({ dataSource });\n };\n };\n handleAdd = () => {\n const { count, dataSource } = this.state;\n const newData = {\n key: count,\n name: `凤姐 ${count}`,\n age: 32,\n address: \"jack\",\n datepicker: \"2017-06-12\",\n MonthPicker: \"2017-02\"\n };\n this.setState({\n dataSource: [...dataSource, newData],\n count: count + 1\n });\n };\n\n getBodyWrapper = body => {\n return (\n \n {body.props.children}\n \n );\n };\n getData = () => {\n console.log(this.state.dataSource);\n };\n render() {\n const { dataSource } = this.state;\n const columns = this.columns;\n return (\n \n
\n 添加一行\n \n
\n 获取数据\n \n
\n
\n );\n }\n}\n\n\n", "desc": " 这是带有多种不同格式的编辑态表格(编辑态是通过使用不同的render来达到不同编辑格式)" }, { "example": _react2['default'].createElement(Demo15, null), "title": " 表格行/列合并", "code": "/**\n*\n* @title 表格行/列合并\n* @description 表头只支持列合并,使用 column 里的 colSpan 进行设置。表格支持行/列合并,使用 render 里的单元格属性 colSpan 或者 rowSpan 设值为 0 时,设置的表格不会渲染。\n*\n*/\n\nimport React, { Component } from \"react\";\nimport Table from \"../../src\";\n\nconst renderContent = (value, row, index) => {\n const obj = {\n children: value,\n props: {},\n };\n if (index === 4) {\n obj.props.colSpan = 0;\n }\n return obj;\n};\n\nconst columns = [{\n title: 'Name',\n key: \"name\",\n dataIndex: 'name',\n render: (text, row, index) => {\n if (index < 4) {\n return {text} ;\n }\n return {\n children: {text} ,\n props: {\n colSpan: 5,\n },\n };\n },\n}, {\n title: 'Age',\n key: \"Age\",\n dataIndex: 'age',\n render: renderContent,\n}, {\n title: 'Home phone',\n colSpan: 2,\n key: \"tel\",\n dataIndex: 'tel',\n render: (value, row, index) => {\n const obj = {\n children: value,\n props: {},\n };\n if (index === 2) {\n obj.props.rowSpan = 2;\n }\n if (index === 3) {\n obj.props.rowSpan = 0;\n }\n if (index === 4) {\n obj.props.colSpan = 0;\n }\n return obj;\n },\n}, {\n title: 'Phone',\n colSpan: 0,\n key: \"phone\",\n dataIndex: 'phone',\n render: renderContent,\n}, {\n title: 'Address',\n key: \"address\",\n dataIndex: 'address',\n render: renderContent,\n}];\n\nconst data = [{\n key: '1',\n name: 'John Brown',\n age: 32,\n tel: '0571-22098909',\n phone: 18889898989,\n address: 'New York No. 1 Lake Park',\n}, {\n key: '2',\n name: 'Jim Green',\n tel: '0571-22098333',\n phone: 18889898888,\n age: 42,\n address: 'London No. 1 Lake Park',\n}, {\n key: '3',\n name: 'Joe Black',\n age: 32,\n tel: '0575-22098909',\n phone: 18900010002,\n address: 'Sidney No. 1 Lake Park',\n}, {\n key: '4',\n name: 'Jim Red',\n age: 18,\n tel: '0575-22098909',\n phone: 18900010002,\n address: 'London No. 2 Lake Park',\n}, {\n key: '5',\n name: 'Jake White',\n age: 18,\n tel: '0575-22098909',\n phone: 18900010002,\n address: 'Dublin No. 2 Lake Park',\n}];\n\nclass Demo15 extends Component {\n render() {\n return (\n \n );\n }\n}\n\n\n\n", "desc": " 表头只支持列合并,使用 column 里的 colSpan 进行设置。表格支持行/列合并,使用 render 里的单元格属性 colSpan 或者 rowSpan 设值为 0 时,设置的表格不会渲染。" }, { "example": _react2['default'].createElement(Demo16, null), "title": " 嵌套子表格", "code": "/**\n*\n* @title 嵌套子表格\n* @description 通过expandedRowRender参数来实现子表格\n*\n*/\n\nimport React, { Component } from \"react\";\nimport Table from \"../../src\";\n\nconst columns16 = [\n { title: \"用户名\", dataIndex: \"a\", key: \"a\", width: 100 },\n { id: \"123\", title: \"性别\", dataIndex: \"b\", key: \"b\", width: 100 },\n { title: \"年龄\", dataIndex: \"c\", key: \"c\", width: 200 },\n {\n title: \"操作\",\n dataIndex: \"d\",\n key: \"d\",\n render(text, record, index) {\n return (\n {\n alert(\"这是第\" + index + \"列,内容为:\" + text);\n }}\n >\n 一些操作\n \n );\n }\n }\n];\n\nconst data16 = [\n { a: \"令狐冲\", b: \"男\", c: 41, d: \"操作\", key: \"1\" },\n { a: \"杨过\", b: \"男\", c: 67, d: \"操作\", key: \"2\" },\n { a: \"郭靖\", b: \"男\", c: 25, d: \"操作\", key: \"3\" }\n];\n\nclass Demo16 extends Component {\n constructor(props){\n super(props);\n this.state={\n data:data16\n }\n }\n expandedRowRender = () => {\n return (\n 标题: 这是一个标题
}\n footer={currentData => 表尾: 我是小尾巴
}\n />\n );\n };\n getData=(expanded, record)=>{\n //当点击展开的时候才去请求数据\n if(expanded){\n if(record.key==='1'){\n this.setState({\n data:[\n { a: \"令狐冲\", b: \"男\", c: 41, d: \"操作\", key: \"1\" },\n { a: \"杨过\", b: \"男\", c: 67, d: \"操作\", key: \"2\" }\n ]\n })\n }else{\n this.setState({\n data:[\n { a: \"令狐冲\", b: \"男\", c: 41, d: \"操作\", key: \"1\" },\n ]\n })\n }\n }\n \n \n }\n render() {\n return (\n 标题: 这是一个标题
}\n footer={currentData => 表尾: 我是小尾巴
}\n />\n );\n }\n}\n\n\n", "desc": " 通过expandedRowRender参数来实现子表格" }, { "example": _react2['default'].createElement(Demo2, null), "title": " 增删改表格", "code": "/**\n*\n* @title 增删改表格\n* @description 这是带有增删改功能的表格(此编辑功能未使用render组件)\n*\n*/\n\nimport Button from \"bee-button\";\nimport React, { Component } from \"react\";\nimport Table from \"../../src\";\nimport Animate from \"bee-animate\";\nimport Icon from \"bee-icon\";\nimport Input from \"bee-form-control\";\nimport Popconfirm from \"bee-popconfirm\";\n\nclass EditableCell extends React.Component {\n state = {\n value: this.props.value,\n editable: false\n };\n handleChange = e => {\n const value = e.target.value;\n this.setState({ value });\n };\n check = () => {\n this.setState({ editable: false });\n if (this.props.onChange) {\n this.props.onChange(this.state.value);\n }\n };\n edit = () => {\n this.setState({ editable: true });\n };\n handleKeydown = event => {\n if (event.keyCode == 13) {\n this.check();\n }\n };\n render() {\n const { value, editable } = this.state;\n return (\n \n {editable ? (\n
\n \n \n
\n ) : (\n
\n {value || \" \"}\n \n
\n )}\n
\n );\n }\n}\n\nclass Demo2 extends React.Component {\n constructor(props) {\n super(props);\n this.columns = [\n {\n title: \"姓名\",\n dataIndex: \"name\",\n key: \"name\",\n width: \"30%\",\n render: (text, record, index) => (\n \n )\n },\n {\n title: \"年龄\",\n dataIndex: \"age\",\n key: \"age\"\n },\n {\n title: \"你懂的\",\n dataIndex: \"address\",\n key: \"address\"\n },\n {\n title: \"操作\",\n dataIndex: \"operation\",\n key: \"operation\",\n render: (text, record, index) => {\n return this.state.dataSource.length > 1 ? (\n \n \n \n ) : null;\n }\n }\n ];\n\n this.state = {\n dataSource: [\n {\n key: \"0\",\n name: \"沉鱼\",\n age: \"18\",\n address: \"96, 77, 89\"\n },\n {\n key: \"1\",\n name: \"落雁\",\n age: \"16\",\n address: \"90, 70, 80\"\n },\n {\n key: \"2\",\n name: \"闭月\",\n age: \"17\",\n address: \"80, 60, 80\"\n },\n {\n key: \"3\",\n name: \"羞花\",\n age: \"20\",\n address: \"120, 60, 90\"\n }\n ],\n count: 4\n };\n }\n onCellChange = (index, key) => {\n return value => {\n const dataSource = [...this.state.dataSource];\n dataSource[index][key] = value;\n this.setState({ dataSource });\n };\n };\n onDelete = index => {\n return () => {\n const dataSource = [...this.state.dataSource];\n dataSource.splice(index, 1);\n this.setState({ dataSource });\n };\n };\n handleAdd = () => {\n const { count, dataSource } = this.state;\n const newData = {\n key: count,\n name: `凤姐 ${count}`,\n age: 32,\n address: `100 100 100`\n };\n this.setState({\n dataSource: [...dataSource, newData],\n count: count + 1\n });\n };\n\n getBodyWrapper = body => {\n return (\n \n {body.props.children}\n \n );\n };\n render() {\n const { dataSource } = this.state;\n const columns = this.columns;\n return (\n \n );\n }\n}\n\n\n", "desc": " 这是带有增删改功能的表格(此编辑功能未使用render组件)" }, { "example": _react2['default'].createElement(Demo3, null), "title": " 表头分组", "code": "/**\n *\n * @title 表头分组\n * @description columns[n] 可以内嵌 children,以渲染分组表头。\n *\n */\n\nimport Button from \"bee-button\";\nimport React, { Component } from \"react\";\nimport Table from \"../../src\";\n\nconst { ColumnGroup, Column } = Table;\n\nconst columns = [\n {\n title: \"Name\",\n dataIndex: \"name\",\n key: \"name\",\n width: 100,\n fixed: \"left\"\n },\n {\n title: \"Other\",\n children: [\n {\n title: \"Age\",\n dataIndex: \"age\",\n key: \"age\",\n width: 200\n },\n {\n title: \"Address\",\n children: [\n {\n title: \"Street\",\n dataIndex: \"street\",\n key: \"street\",\n width: 200\n },\n {\n title: \"Block\",\n children: [\n {\n title: \"Building\",\n dataIndex: \"building\",\n key: \"building\",\n width: 100\n },\n {\n title: \"Door No.\",\n dataIndex: \"number\",\n key: \"number\",\n width: 100\n }\n ]\n }\n ]\n }\n ]\n },\n {\n title: \"Company\",\n children: [\n {\n title: \"Company Address\",\n dataIndex: \"companyAddress\",\n key: \"companyAddress\"\n },\n {\n title: \"Company Name\",\n dataIndex: \"companyName\",\n key: \"companyName\"\n }\n ]\n },\n {\n title: \"Gender\",\n dataIndex: \"gender\",\n key: \"gender\",\n width: 60,\n fixed: \"right\"\n }\n];\n\nconst data = [];\nfor (let i = 0; i < 20; i++) {\n data.push({\n key: i,\n name: \"John Brown\",\n age: i + 1,\n street: \"Lake Park\",\n building: \"C\",\n number: 2035,\n companyAddress: \"Lake Street 42\",\n companyName: \"SoftLake Co\",\n gender: \"M\"\n });\n}\n\nclass Demo3 extends Component {\n render() {\n return (\n \n );\n }\n}\n\n\n", "desc": " columns[n] 可以内嵌 children,以渲染分组表头。" }, { "example": _react2['default'].createElement(Demo4, null), "title": " 树形数据展示", "code": "/**\n*\n* @title 树形数据展示\n* @description 通过在data中配置children数据,来自动生成树形数据\n*\n*/\n\n\nimport React, { Component } from 'react';\nimport Table from 'bee-table';\n\n\nconst columns4 = [\n {\n title: \"Name\",\n dataIndex: \"name\",\n key: \"name\",\n width: \"40%\"\n },\n {\n title: \"Age\",\n dataIndex: \"age\",\n key: \"age\",\n width: \"30%\"\n },\n {\n title: \"Address\",\n dataIndex: \"address\",\n key: \"address\"\n }\n];\n\nconst data4 = [\n {\n key: 1,\n name: \"John Brown sr.\",\n age: 60,\n address: \"New York No. 1 Lake Park\",\n children: [\n {\n key: 11,\n name: \"John Brown\",\n age: 42,\n address: \"New York No. 2 Lake Park\"\n },\n {\n key: 12,\n name: \"John Brown jr.\",\n age: 30,\n address: \"New York No. 3 Lake Park\",\n children: [\n {\n key: 121,\n name: \"Jimmy Brown\",\n age: 16,\n address: \"New York No. 3 Lake Park\"\n }\n ]\n },\n {\n key: 13,\n name: \"Jim Green sr.\",\n age: 72,\n address: \"London No. 1 Lake Park\",\n children: [\n {\n key: 131,\n name: \"Jim Green\",\n age: 42,\n address: \"London No. 2 Lake Park\",\n children: [\n {\n key: 1311,\n name: \"Jim Green jr.\",\n age: 25,\n address: \"London No. 3 Lake Park\"\n },\n {\n key: 1312,\n name: \"Jimmy Green sr.\",\n age: 18,\n address: \"London No. 4 Lake Park\"\n }\n ]\n }\n ]\n }\n ]\n },\n {\n key: 2,\n name: \"Joe Black\",\n age: 32,\n address: \"Sidney No. 1 Lake Park\"\n }\n];\nclass Demo4 extends Component {\n render() {\n return ;\n }\n}\n\n\n", "desc": " 通过在data中配置children数据,来自动生成树形数据" }, { "example": _react2['default'].createElement(Demo5, null), "title": " 固定列", "code": "/**\n*\n* @title 固定列\n* @description 固定列到表格的某侧\n*\n*/\n\n\n\nimport React, { Component } from 'react';\nimport Table from 'bee-table';\n\n\n\nconst columns5 = [\n {\n title: \"Full Name\",\n width: 100,\n dataIndex: \"name\",\n key: \"name\",\n fixed: \"left\"\n },\n { title: \"Age\", width: 100, dataIndex: \"age\", key: \"age\", fixed: \"left\" },\n { title: \"Column 1\", dataIndex: \"address\", key: \"1\" },\n { title: \"Column 2\", dataIndex: \"address\", key: \"2\" },\n { title: \"Column 3\", dataIndex: \"address\", key: \"3\" },\n { title: \"Column 4\", dataIndex: \"address\", key: \"4\" },\n { title: \"Column 5\", dataIndex: \"address\", key: \"5\" },\n { title: \"Column 6\", dataIndex: \"address\", key: \"6\" },\n { title: \"Column 7\", dataIndex: \"address\", key: \"7\" },\n { title: \"Column 8\", dataIndex: \"address\", key: \"8\" }\n];\n\nconst data5 = [\n {\n key: \"1\",\n name: \"John Brown\",\n age: 32,\n address: \"New York Park\"\n },\n {\n key: \"2\",\n name: \"Jim Green\",\n age: 40,\n address: \"London Park\"\n },\n {\n key: \"3\",\n name: \"Jim Green\",\n age: 40,\n address: \"London Park\"\n },\n {\n key: \"4\",\n name: \"Jim Green\",\n age: 40,\n address: \"London Park\"\n }\n];\n\nclass Demo5 extends Component {\n render() {\n return ;\n }\n}\n\n", "desc": " 固定列到表格的某侧" }, { "example": _react2['default'].createElement(Demo6, null), "title": " 固定表头", "code": "/**\n*\n* @title 固定表头\n* @description 方便一页内展示大量数据。需要指定 column 的 width 属性,否则列头和内容可能不对齐。(还可以设置scroll来支持横向或纵向滚动)\n*\n*/\n\n\nimport React, { Component } from 'react';\nimport Table from 'bee-table';\n\n\nconst columns6 = [\n {\n title: \"Full Name\",\n width: 100,\n dataIndex: \"name\",\n key: \"name\"\n },\n { title: \"Age\", width: 100, dataIndex: \"age\", key: \"age\"},\n { title: \"Address\", dataIndex: \"address\", key: \"1\" }\n];\n\nconst data6 = [\n {\n key: \"1\",\n name: \"John Brown\",\n age: 32,\n address: \"New York Park\"\n },\n {\n key: \"2\",\n name: \"Jim Green\",\n age: 40,\n address: \"London Park\"\n },\n {\n key: \"3\",\n name: \"Jim Green\",\n age: 40,\n address: \"London Park\"\n },\n {\n key: \"4\",\n name: \"Jim Green\",\n age: 40,\n address: \"London Park\"\n },{\n key: \"11\",\n name: \"John Brown\",\n age: 32,\n address: \"New York Park\"\n },\n {\n key: \"12\",\n name: \"Jim Green\",\n age: 40,\n address: \"London Park\"\n },\n {\n key: \"13\",\n name: \"Jim Green\",\n age: 40,\n address: \"London Park\"\n },\n {\n key: \"14\",\n name: \"Jim Green\",\n age: 40,\n address: \"London Park\"\n }\n];\n\nclass Demo6 extends Component {\n render() {\n return ;\n }\n}\n\n", "desc": " 方便一页内展示大量数据。需要指定 column 的 width 属性,否则列头和内容可能不对齐。(还可以设置scroll来支持横向或纵向滚动)" }, { "example": _react2['default'].createElement(Demo7, null), "title": " 主子表", "code": "/**\n *\n * @title 主子表\n * @description 主表点击子表联动\n *\n */\n\nimport React, { Component } from \"react\";\nimport Table from \"../../src\";\n\nconst columns7 = [\n { title: \"班级\", dataIndex: \"a\", key: \"a\" },\n { title: \"人数\", dataIndex: \"b\", key: \"b\" },\n { title: \"班主任\", dataIndex: \"c\", key: \"c\" },\n {\n title: \"武功级别\",\n dataIndex: \"d\",\n key: \"d\"\n }\n];\n\nconst data7 = [\n { a: \"02级一班\", b: \"2\", c: \"欧阳锋\", d: \"大侠\", key: \"1\" },\n { a: \"03级二班\", b: \"3\", c: \"归海一刀\", d: \"大侠\", key: \"2\" },\n { a: \"05级三班\", b: \"1\", c: \"一拳超人\", d: \"愣头青\", key: \"3\" }\n];\n\nconst columns7_1 = [\n { title: \"姓名\", dataIndex: \"a\", key: \"a\" },\n { title: \"班级\", dataIndex: \"b\", key: \"b\" },\n { title: \"系别\", dataIndex: \"c\", key: \"c\" }\n];\n\nclass Demo7 extends Component {\n constructor(props) {\n super(props);\n this.state = {\n children_data: []\n };\n }\n\n rowclick = (record, index) => {\n if (record.a === \"02级一班\") {\n this.setState({\n children_data: [\n { a: \"郭靖\", b: \"02级一班\", c: \"文学系\", key: \"1\" },\n { a: \"黄蓉\", b: \"02级一班\", c: \"文学系\", key: \"2\" }\n ]\n });\n } else if (record.a === \"03级二班\") {\n this.setState({\n children_data: [\n { a: \"杨过\", b: \"03级二班\", c: \"外语系\", key: \"1\" },\n { a: \"小龙女\", b: \"03级二班\", c: \"外语系\", key: \"2\" },\n { a: \"傻姑\", b: \"03级二班\", c: \"外语系\", key: \"3\" }\n ]\n });\n } else if (record.a === \"05级三班\") {\n this.setState({\n children_data: [{ a: \"金圣叹\", b: \"05级三班\", c: \"美术系\", key: \"1\" }]\n });\n }\n };\n\n render() {\n return (\n \n
标题: 我是主表
}\n />\n 标题: 我是子表
}\n />\n \n );\n }\n}\n\n\n", "desc": " 主表点击子表联动" }, { "example": _react2['default'].createElement(Demo8, null), "title": " 表格+分页", "code": "/**\n *\n * @title 表格+分页\n * @description 点击分页联动表格\n *\n *import {Table} from 'tinper-bee';\n */\n\nimport React, { Component } from \"react\";\n\nimport Table from \"../../src\";\nimport Pagination from \"bee-pagination\";\n\nconst columns8 = [\n { title: \"姓名\", dataIndex: \"a\", key: \"a\", width: 100 },\n { id: \"123\", title: \"性别\", dataIndex: \"b\", key: \"b\", width: 100 },\n { title: \"年龄\", dataIndex: \"c\", key: \"c\", width: 200 },\n {\n title: \"武功级别\",\n dataIndex: \"d\",\n key: \"d\"\n }\n];\n\nconst pageData = {\n 1: [\n { a: \"杨过\", b: \"男\", c: 30, d: \"内行\", key: \"2\" },\n { a: \"令狐冲\", b: \"男\", c: 41, d: \"大侠\", key: \"1\" },\n { a: \"郭靖\", b: \"男\", c: 25, d: \"大侠\", key: \"3\" }\n ],\n 2: [\n { a: \"芙蓉姐姐\", b: \"女\", c: 23, d: \"大侠\", key: \"1\" },\n { a: \"芙蓉妹妹\", b: \"女\", c: 23, d: \"内行\", key: \"2\" }\n ]\n};\n\nclass Demo8 extends Component {\n constructor(props) {\n super(props);\n this.state = {\n data: pageData[1],\n activePage: 1\n };\n }\n\n handleSelect(eventKey) {\n this.setState({\n data: pageData[eventKey],\n activePage: eventKey\n });\n }\n\n render() {\n return (\n \n );\n }\n}\n\n", "desc": " 点击分页联动表格" }, { "example": _react2['default'].createElement(Demo9, null), "title": " 表格+搜索", "code": "/**\n *\n * @title 表格+搜索\n * @description 搜索刷新表格数据\n *\n *\n * import {Table} from 'tinper-bee';\n */\n\nimport React, { Component } from \"react\";\n\nimport Table from \"../../src\";\nimport Icon from \"bee-icon\";\nimport InputGroup from \"bee-input-group\";\nimport FormControl from \"bee-form-control\";\n\nclass Search extends Component {\n state = {\n searchValue: \"\",\n empty: false\n };\n\n /**\n * 搜索\n */\n handleSearch = () => {\n let { onSearch } = this.props;\n this.setState({\n empty: true\n });\n onSearch && onSearch(this.state.searchValue);\n };\n\n /**\n * 捕获回车\n * @param e\n */\n handleKeyDown = e => {\n if (e.keyCode === 13) {\n this.handleSearch();\n }\n };\n\n /**\n * 输入框改变\n * @param e\n */\n handleChange = e => {\n this.setState({\n searchValue: e.target.value\n });\n };\n\n /**\n * 清空输入框\n */\n emptySearch = () => {\n let { onEmpty } = this.props;\n this.setState({\n searchValue: \"\",\n empty: false\n });\n onEmpty && onEmpty();\n };\n\n render() {\n return (\n \n \n {this.state.empty ? (\n \n ) : null}\n\n \n \n \n \n );\n }\n}\n\nconst columns9 = [\n {\n title: \"姓名\",\n dataIndex: \"a\",\n key: \"a\",\n width: 100\n },\n {\n title: \"性别\",\n dataIndex: \"b\",\n key: \"b\",\n width: 100\n },\n {\n title: \"年龄\",\n dataIndex: \"c\",\n key: \"c\",\n width: 200\n },\n {\n title: \"武功级别\",\n dataIndex: \"d\",\n key: \"d\"\n }\n];\n\nconst userData = [\n { a: \"杨过\", b: \"男\", c: 30, d: \"内行\", key: \"2\" },\n { a: \"令狐冲\", b: \"男\", c: 41, d: \"大侠\", key: \"1\" },\n { a: \"郭靖\", b: \"男\", c: 25, d: \"大侠\", key: \"3\" }\n];\n\nclass Demo9 extends Component {\n constructor(props) {\n super(props);\n this.state = {\n data: userData\n };\n }\n\n handleSearch = value => {\n if (value === \"\") {\n return this.setState({\n data: userData\n });\n }\n let regExp = new RegExp(value, \"ig\");\n let data = userData.filter(item => regExp.test(item.a));\n this.setState({\n data\n });\n };\n\n handleEmpty = () => {\n this.setState({\n data: userData\n });\n };\n\n render() {\n return (\n \n );\n }\n}\n\n\n", "desc": " 搜索刷新表格数据" }];
var Demo = function (_Component) {
_inherits(Demo, _Component);
function Demo(props) {
_classCallCheck(this, Demo);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.state = {
open: false
};
_this.handleClick = _this.handleClick.bind(_this);
return _this;
}
Demo.prototype.handleClick = function handleClick() {
this.setState({ open: !this.state.open });
};
Demo.prototype.render = function render() {
var _props = this.props,
title = _props.title,
example = _props.example,
code = _props.code,
desc = _props.desc;
var caret = this.state.open ? CARETUP : CARET;
var text = this.state.open ? "隐藏代码" : "查看代码";
var footer = _react2['default'].createElement(
_beeButton2['default'],
{ shape: 'block', onClick: this.handleClick },
caret,
text
);
var header = _react2['default'].createElement(
_beeLayout.Row,
null,
_react2['default'].createElement(
_beeLayout.Col,
{ md: 12 },
example
)
);
return _react2['default'].createElement(
_beeLayout.Col,
{ md: 12 },
_react2['default'].createElement(
'h3',
null,
title
),
_react2['default'].createElement(
'p',
null,
desc
),
_react2['default'].createElement(
_beePanel.Panel,
{ collapsible: true, headerContent: true, expanded: this.state.open, colors: 'bordered', header: header, footer: footer, footerStyle: { padding: 0 } },
_react2['default'].createElement(
'pre',
null,
_react2['default'].createElement(
'code',
{ className: 'hljs javascript' },
code
)
)
)
);
};
return Demo;
}(_react.Component);
var DemoGroup = function (_Component2) {
_inherits(DemoGroup, _Component2);
function DemoGroup(props) {
_classCallCheck(this, DemoGroup);
return _possibleConstructorReturn(this, _Component2.call(this, props));
}
DemoGroup.prototype.render = function render() {
return _react2['default'].createElement(
_beeLayout.Row,
null,
DemoArray.map(function (child, index) {
return _react2['default'].createElement(Demo, { example: child.example, title: child.title, code: child.code, desc: child.desc, key: index });
})
);
};
return DemoGroup;
}(_react.Component);
_reactDom2['default'].render(_react2['default'].createElement(DemoGroup, null), document.getElementById('tinperBeeDemo'));
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Con = exports.Row = exports.Col = undefined;
var _Col2 = __webpack_require__(2);
var _Col3 = _interopRequireDefault(_Col2);
var _Row2 = __webpack_require__(6);
var _Row3 = _interopRequireDefault(_Row2);
var _Layout = __webpack_require__(7);
var _Layout2 = _interopRequireDefault(_Layout);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports.Col = _Col3["default"];
exports.Row = _Row3["default"];
exports.Con = _Layout2["default"];
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
componentClass: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string]),
/**
* xs显示列数
*/
xs: _propTypes2["default"].number,
/**
* sm显示列数
*/
sm: _propTypes2["default"].number,
/**
* md显示列数
*/
md: _propTypes2["default"].number,
/**
* lg显示列数
*/
lg: _propTypes2["default"].number,
/**
* xs偏移列数
*/
xsOffset: _propTypes2["default"].number,
/**
* sm偏移列数
*/
smOffset: _propTypes2["default"].number,
/**
* md偏移列数
*/
mdOffset: _propTypes2["default"].number,
/**
* lg偏移列数
*/
lgOffset: _propTypes2["default"].number,
/**
* xs右偏移列数
*/
xsPush: _propTypes2["default"].number,
/**
* sm右偏移列数
*/
smPush: _propTypes2["default"].number,
/**
* md右偏移列数
*/
mdPush: _propTypes2["default"].number,
/**
* lg右偏移列数
*/
lgPush: _propTypes2["default"].number,
/**
* xs左偏移列数
*/
xsPull: _propTypes2["default"].number,
/**
* sm左偏移列数
*/
smPull: _propTypes2["default"].number,
/**
* md左偏移列数
*/
mdPull: _propTypes2["default"].number,
/**
* lg左偏移列数
*/
lgPull: _propTypes2["default"].number
};
var defaultProps = {
componentClass: 'div',
clsPrefix: 'u-col'
};
var DEVICE_SIZES = ['lg', 'md', 'sm', 'xs'];
var Col = function (_Component) {
_inherits(Col, _Component);
function Col() {
_classCallCheck(this, Col);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
Col.prototype.render = function render() {
var _props = this.props,
Component = _props.componentClass,
className = _props.className,
clsPrefix = _props.clsPrefix,
others = _objectWithoutProperties(_props, ['componentClass', 'className', 'clsPrefix']);
var tbClass = [];
/**
* 对传入props做样式转化
* @type {[type]}
*/
DEVICE_SIZES.forEach(function (size) {
function popProp(propSuffix, modifier) {
var propName = '' + size + propSuffix;
var propValue = others[propName];
if (propValue != undefined && propValue != null) {
tbClass.push(clsPrefix + '-' + size + modifier + '-' + propValue);
}
delete others[propName];
}
popProp('', '');
popProp('Offset', '-offset');
popProp('Push', '-push');
popProp('Pull', '-pull');
});
return _react2["default"].createElement(
Component,
_extends({
className: (0, _classnames2["default"])(tbClass, className)
}, others),
this.props.children
);
};
return Col;
}(_react.Component);
Col.defaultProps = defaultProps;
Col.propTypes = propTypes;
exports["default"] = Col;
module.exports = exports['default'];
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
(function () {
'use strict';
var hasOwn = {}.hasOwnProperty;
function classNames () {
var classes = [];
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (!arg) continue;
var argType = typeof arg;
if (argType === 'string' || argType === 'number') {
classes.push(arg);
} else if (Array.isArray(arg)) {
classes.push(classNames.apply(null, arg));
} else if (argType === 'object') {
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(key);
}
}
}
}
return classes.join(' ');
}
if (typeof module !== 'undefined' && module.exports) {
module.exports = classNames;
} else if (true) {
// register as 'classnames', consistent with npm package name
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
return classNames;
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {
window.classNames = classNames;
}
}());
/***/ }),
/* 4 */
/***/ (function(module, exports) {
module.exports = React;
/***/ }),
/* 5 */
/***/ (function(module, exports) {
module.exports = PropTypes;
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
componentClass: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string])
};
var defaultProps = {
componentClass: 'div',
clsPrefix: 'u-row'
};
var Row = function (_Component) {
_inherits(Row, _Component);
function Row() {
_classCallCheck(this, Row);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
Row.prototype.render = function render() {
var _props = this.props,
Component = _props.componentClass,
clsPrefix = _props.clsPrefix,
className = _props.className,
others = _objectWithoutProperties(_props, ['componentClass', 'clsPrefix', 'className']);
var bsclass = '' + clsPrefix;
return _react2["default"].createElement(
Component,
_extends({}, others, {
className: (0, _classnames2["default"])(bsclass, className)
}),
this.props.children
);
};
return Row;
}(_react.Component);
Row.propTypes = propTypes;
Row.defaultProps = defaultProps;
exports["default"] = Row;
module.exports = exports['default'];
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
/**
* Adds `container-fluid` class.
*/
fluid: _propTypes2["default"].bool,
/**
* You can use a custom element for this component
*/
componentClass: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string])
};
var defaultProps = {
componentClass: 'div',
fluid: false,
clsPrefix: 'u-container'
};
var Con = function (_React$Component) {
_inherits(Con, _React$Component);
function Con() {
_classCallCheck(this, Con);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Con.prototype.render = function render() {
var _tbclass;
var _props = this.props,
fluid = _props.fluid,
Component = _props.componentClass,
clsPrefix = _props.clsPrefix,
className = _props.className,
others = _objectWithoutProperties(_props, ['fluid', 'componentClass', 'clsPrefix', 'className']);
var tbclass = (_tbclass = {}, _defineProperty(_tbclass, '' + clsPrefix, !fluid), _defineProperty(_tbclass, clsPrefix + '-fluid', fluid), _tbclass);
return _react2["default"].createElement(
Component,
_extends({}, others, {
className: (0, _classnames2["default"])(tbclass, className)
}),
this.props.children
);
};
return Con;
}(_react2["default"].Component);
Con.propTypes = propTypes;
Con.defaultProps = defaultProps;
exports["default"] = Con;
module.exports = exports['default'];
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PanelGroup = exports.Panel = undefined;
var _Panel2 = __webpack_require__(9);
var _Panel3 = _interopRequireDefault(_Panel2);
var _PanelGroup2 = __webpack_require__(102);
var _PanelGroup3 = _interopRequireDefault(_PanelGroup2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports.Panel = _Panel3["default"];
exports.PanelGroup = _PanelGroup3["default"];
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _beeTransition = __webpack_require__(10);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
//是否添加折叠
collapsible: _propTypes2["default"].bool,
onSelect: _propTypes2["default"].func,
//头部组件
header: _propTypes2["default"].node,
headerStyle: _propTypes2["default"].object,
id: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].number]),
headerContent: _propTypes2["default"].bool,
//footer组件
footer: _propTypes2["default"].node,
footerStyle: _propTypes2["default"].object,
//默认是否打开
defaultExpanded: _propTypes2["default"].bool,
//是否打开
expanded: _propTypes2["default"].bool,
//每个panel的标记
eventKey: _propTypes2["default"].any,
headerRole: _propTypes2["default"].string,
panelRole: _propTypes2["default"].string,
//颜色
colors: _propTypes2["default"].oneOf(['primary', 'accent', 'success', 'info', 'warning', 'danger', 'default', 'bordered']),
// From Collapse.的扩展动画
onEnter: _propTypes2["default"].func,
onEntering: _propTypes2["default"].func,
onEntered: _propTypes2["default"].func,
onExit: _propTypes2["default"].func,
onExiting: _propTypes2["default"].func,
onExited: _propTypes2["default"].func
};
var defaultProps = {
defaultExpanded: false,
clsPrefix: "u-panel",
colors: "default"
};
var Panel = function (_React$Component) {
_inherits(Panel, _React$Component);
function Panel(props, context) {
_classCallCheck(this, Panel);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
_this.handleClickTitle = _this.handleClickTitle.bind(_this);
_this.state = {
expanded: _this.props.defaultExpanded
};
return _this;
}
//头部点击事件
Panel.prototype.handleClickTitle = function handleClickTitle(e) {
// 不让事件进入事件池
e.persist();
e.selected = true;
if (this.props.onSelect) {
this.props.onSelect(this.props.eventKey, e);
} else {
e.preventDefault();
}
if (e.selected) {
this.setState({ expanded: !this.state.expanded });
}
};
//渲染panelheader
Panel.prototype.renderHeader = function renderHeader(collapsible, header, id, role, expanded, clsPrefix) {
var titleClassName = clsPrefix + '-title';
if (!collapsible) {
if (!_react2["default"].isValidElement(header)) {
return header;
}
return (0, _react.cloneElement)(header, {
className: (0, _classnames2["default"])(header.props.className, titleClassName)
});
}
if (!_react2["default"].isValidElement(header)) {
return _react2["default"].createElement(
'h4',
{ role: 'presentation', className: titleClassName },
this.renderAnchor(header, id, role, expanded)
);
}
if (this.props.headerContent) {
return (0, _react.cloneElement)(header, {
className: (0, _classnames2["default"])(header.props.className, titleClassName)
});
}
return (0, _react.cloneElement)(header, {
className: (0, _classnames2["default"])(header.props.className, titleClassName),
children: this.renderAnchor(header.props.children, id, role, expanded)
});
};
//如果使用链接,渲染为a标签
Panel.prototype.renderAnchor = function renderAnchor(header, id, role, expanded) {
return _react2["default"].createElement(
'a',
{
role: role,
href: id && '#' + id,
'aria-controls': id,
'aria-expanded': expanded,
'aria-selected': expanded,
className: expanded ? null : 'collapsed'
},
header
);
};
//如果有折叠动画,渲染折叠动画
Panel.prototype.renderCollapsibleBody = function renderCollapsibleBody(id, expanded, role, children, clsPrefix, animationHooks) {
return _react2["default"].createElement(
_beeTransition.Collapse,
_extends({ 'in': expanded }, animationHooks),
_react2["default"].createElement(
'div',
{
id: id,
role: role,
className: clsPrefix + '-collapse',
'aria-hidden': !expanded
},
this.renderBody(children, clsPrefix)
)
);
};
//渲染panelbody
Panel.prototype.renderBody = function renderBody(rawChildren, clsPrefix) {
var children = [];
var bodyChildren = [];
var bodyClassName = clsPrefix + '-body';
//添加到body的children中
function maybeAddBody() {
if (!bodyChildren.length) {
return;
}
// 给子组件添加key,为了之后触发事件时使用
children.push(_react2["default"].createElement(
'div',
{ key: children.length, className: bodyClassName },
bodyChildren
));
bodyChildren = [];
}
//转换为数组,方便复用
_react2["default"].Children.toArray(rawChildren).forEach(function (child) {
if (_react2["default"].isValidElement(child) && child.props.fill) {
maybeAddBody();
//将标示fill设置为undefined
children.push((0, _react.cloneElement)(child, { fill: undefined }));
return;
}
bodyChildren.push(child);
});
maybeAddBody();
return children;
};
Panel.prototype.render = function render() {
var _props = this.props,
collapsible = _props.collapsible,
header = _props.header,
id = _props.id,
footer = _props.footer,
propsExpanded = _props.expanded,
footerStyle = _props.footerStyle,
headerStyle = _props.headerStyle,
headerRole = _props.headerRole,
panelRole = _props.panelRole,
className = _props.className,
colors = _props.colors,
children = _props.children,
onEnter = _props.onEnter,
onEntering = _props.onEntering,
onEntered = _props.onEntered,
clsPrefix = _props.clsPrefix,
onExit = _props.onExit,
headerContent = _props.headerContent,
onExiting = _props.onExiting,
onExited = _props.onExited,
defaultExpanded = _props.defaultExpanded,
eventKey = _props.eventKey,
onSelect = _props.onSelect,
props = _objectWithoutProperties(_props, ['collapsible', 'header', 'id', 'footer', 'expanded', 'footerStyle', 'headerStyle', 'headerRole', 'panelRole', 'className', 'colors', 'children', 'onEnter', 'onEntering', 'onEntered', 'clsPrefix', 'onExit', 'headerContent', 'onExiting', 'onExited', 'defaultExpanded', 'eventKey', 'onSelect']);
var expanded = propsExpanded != null ? propsExpanded : this.state.expanded;
var classes = {};
classes['' + clsPrefix] = true;
classes[clsPrefix + '-' + colors] = true;
var headerClass = _defineProperty({}, clsPrefix + '-heading', true);
return _react2["default"].createElement(
'div',
_extends({}, props, {
className: (0, _classnames2["default"])(className, classes),
id: collapsible ? null : id
}),
header && _react2["default"].createElement(
'div',
{ className: (0, _classnames2["default"])(headerClass), style: headerStyle, onClick: this.handleClickTitle },
this.renderHeader(collapsible, header, id, headerRole, expanded, clsPrefix)
),
collapsible ? this.renderCollapsibleBody(id, expanded, panelRole, children, clsPrefix, { onEnter: onEnter, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited }) : this.renderBody(children, clsPrefix),
footer && _react2["default"].createElement(
'div',
{ className: clsPrefix + '-footer', style: footerStyle },
footer
)
);
};
return Panel;
}(_react2["default"].Component);
Panel.propTypes = propTypes;
Panel.defaultProps = defaultProps;
exports["default"] = Panel;
module.exports = exports['default'];
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Fade = exports.Collapse = exports.Transition = undefined;
var _Transition2 = __webpack_require__(11);
var _Transition3 = _interopRequireDefault(_Transition2);
var _Collapse2 = __webpack_require__(16);
var _Collapse3 = _interopRequireDefault(_Collapse2);
var _Fade2 = __webpack_require__(101);
var _Fade3 = _interopRequireDefault(_Fade2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports.Transition = _Transition3["default"];
exports.Collapse = _Collapse3["default"];
exports.Fade = _Fade3["default"];
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = undefined;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _properties = __webpack_require__(13);
var _properties2 = _interopRequireDefault(_properties);
var _on = __webpack_require__(15);
var _on2 = _interopRequireDefault(_on);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var transitionEndEvent = _properties2["default"].end;
//设置状态码
var UNMOUNTED = exports.UNMOUNTED = 0;
var EXITED = exports.EXITED = 1;
var ENTERING = exports.ENTERING = 2;
var ENTERED = exports.ENTERED = 3;
var EXITING = exports.EXITING = 4;
var propTypes = {
/**
* 是否触发动画
*/
"in": _propTypes2["default"].bool,
/**
* 不显示的时候是否移除组件
*/
unmountOnExit: _propTypes2["default"].bool,
/**
* 如果设置为默认显示,挂载时显示动画
*/
transitionAppear: _propTypes2["default"].bool,
/**
* 设置超时时间,防止出现问题,可设置为>=动画时间
*/
timeout: _propTypes2["default"].number,
/**
* 退出组件时添加的class
*/
exitedClassName: _propTypes2["default"].string,
/**
* 退出组件中添加的class
*/
exitingClassName: _propTypes2["default"].string,
/**
* 进入动画后添加的class
*/
enteredClassName: _propTypes2["default"].string,
/**
* 进入动画时添加的class
*/
enteringClassName: _propTypes2["default"].string,
/**
* 进入动画开始时的钩子函数
*/
onEnter: _propTypes2["default"].func,
/**
* 进入动画中的钩子函数
*/
onEntering: _propTypes2["default"].func,
/**
* 进入动画后的钩子函数
*/
onEntered: _propTypes2["default"].func,
/**
* 退出动画开始时的钩子函数
*/
onExit: _propTypes2["default"].func,
/**
* 退出动画中的钩子函数
*/
onExiting: _propTypes2["default"].func,
/**
* 退出动画后的钩子函数
*/
onExited: _propTypes2["default"].func
};
function noop() {}
var defaultProps = {
"in": false,
unmountOnExit: false,
transitionAppear: false,
timeout: 5000,
onEnter: noop,
onEntering: noop,
onEntered: noop,
onExit: noop,
onExiting: noop,
onExited: noop
};
/**
* 动画组件
*/
var Transition = function (_Component) {
_inherits(Transition, _Component);
function Transition(props, context) {
_classCallCheck(this, Transition);
var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
var initialStatus = void 0;
if (props["in"]) {
// 在componentdidmount时开始执行动画
initialStatus = props.transitionAppear ? EXITED : ENTERED;
} else {
initialStatus = props.unmountOnExit ? UNMOUNTED : EXITED;
}
_this.state = { status: initialStatus };
_this.nextCallback = null;
return _this;
}
Transition.prototype.componentDidMount = function componentDidMount() {
if (this.props.transitionAppear && this.props["in"]) {
this.performEnter(this.props);
}
};
Transition.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (nextProps["in"] && this.props.unmountOnExit) {
if (this.state.status === UNMOUNTED) {
// 在componentDidUpdate执行动画.
this.setState({ status: EXITED });
}
} else {
this._needsUpdate = true;
}
};
Transition.prototype.componentDidUpdate = function componentDidUpdate() {
var status = this.state.status;
if (this.props.unmountOnExit && status === EXITED) {
// 当使用unmountOnExit时,exited为exiting和unmont的过渡状态
if (this.props["in"]) {
this.performEnter(this.props);
} else {
this.setState({ status: UNMOUNTED });
}
return;
}
// 确保只响应prop变化
if (this._needsUpdate) {
this._needsUpdate = false;
if (this.props["in"]) {
if (status === EXITING) {
this.performEnter(this.props);
} else if (status === EXITED) {
this.performEnter(this.props);
}
// 其他,当我们已经输入或输出
} else {
if (status === ENTERING || status === ENTERED) {
this.performExit(this.props);
}
// 我们已经输入或输出完成
}
}
};
Transition.prototype.componentWillUnmount = function componentWillUnmount() {
this.cancelNextCallback();
};
Transition.prototype.performEnter = function performEnter(props) {
var _this2 = this;
this.cancelNextCallback();
var node = _reactDom2["default"].findDOMNode(this);
// 这里接收新props
props.onEnter(node);
this.safeSetState({ status: ENTERING }, function () {
_this2.props.onEntering(node);
_this2.onTransitionEnd(node, function () {
_this2.safeSetState({ status: ENTERED }, function () {
_this2.props.onEntered(node);
});
});
});
};
Transition.prototype.performExit = function performExit(props) {
var _this3 = this;
this.cancelNextCallback();
var node = _reactDom2["default"].findDOMNode(this);
props.onExit(node);
this.safeSetState({ status: EXITING }, function () {
_this3.props.onExiting(node);
_this3.onTransitionEnd(node, function () {
_this3.safeSetState({ status: EXITED }, function () {
_this3.props.onExited(node);
});
});
});
};
Transition.prototype.cancelNextCallback = function cancelNextCallback() {
if (this.nextCallback !== null) {
this.nextCallback.cancel();
this.nextCallback = null;
}
};
Transition.prototype.safeSetState = function safeSetState(nextState, callback) {
// 确保在组件销毁后挂起的setState被消除
this.setState(nextState, this.setNextCallback(callback));
};
Transition.prototype.setNextCallback = function setNextCallback(callback) {
var _this4 = this;
var active = true;
this.nextCallback = function (event) {
if (active) {
active = false;
_this4.nextCallback = null;
callback(event);
}
};
this.nextCallback.cancel = function () {
active = false;
};
return this.nextCallback;
};
Transition.prototype.onTransitionEnd = function onTransitionEnd(node, handler) {
this.setNextCallback(handler);
if (node) {
if (transitionEndEvent == undefined) {
this.nextCallback();
} else {
(0, _on2["default"])(node, transitionEndEvent, this.nextCallback);
}
setTimeout(this.nextCallback, this.props.timeout);
} else {
setTimeout(this.nextCallback, 0);
}
};
Transition.prototype.render = function render() {
var status = this.state.status;
if (status === UNMOUNTED) {
return null;
}
var _props = this.props,
children = _props.children,
className = _props.className,
childProps = _objectWithoutProperties(_props, ['children', 'className']);
Object.keys(Transition.propTypes).forEach(function (key) {
return delete childProps[key];
});
var transitionClassName = void 0;
if (status === EXITED) {
transitionClassName = this.props.exitedClassName;
} else if (status === ENTERING) {
transitionClassName = this.props.enteringClassName;
} else if (status === ENTERED) {
transitionClassName = this.props.enteredClassName;
} else if (status === EXITING) {
transitionClassName = this.props.exitingClassName;
}
var child = _react2["default"].Children.only(children);
return _react2["default"].cloneElement(child, _extends({}, childProps, {
className: (0, _classnames2["default"])(child.props.className, className, transitionClassName)
}));
};
return Transition;
}(_react.Component);
Transition.propTypes = propTypes;
Transition.defaultProps = defaultProps;
exports["default"] = Transition;
/***/ }),
/* 12 */
/***/ (function(module, exports) {
module.exports = ReactDOM;
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.animationEnd = exports.animationDelay = exports.animationTiming = exports.animationDuration = exports.animationName = exports.transitionEnd = exports.transitionDuration = exports.transitionDelay = exports.transitionTiming = exports.transitionProperty = exports.transform = undefined;
var _inDOM = __webpack_require__(14);
var _inDOM2 = _interopRequireDefault(_inDOM);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var transform = 'transform';
var prefix = void 0,
transitionEnd = void 0,
animationEnd = void 0;
var transitionProperty = void 0,
transitionDuration = void 0,
transitionTiming = void 0,
transitionDelay = void 0;
var animationName = void 0,
animationDuration = void 0,
animationTiming = void 0,
animationDelay = void 0;
if (_inDOM2.default) {
var _getTransitionPropert = getTransitionProperties();
prefix = _getTransitionPropert.prefix;
exports.transitionEnd = transitionEnd = _getTransitionPropert.transitionEnd;
exports.animationEnd = animationEnd = _getTransitionPropert.animationEnd;
exports.transform = transform = prefix + '-' + transform;
exports.transitionProperty = transitionProperty = prefix + '-transition-property';
exports.transitionDuration = transitionDuration = prefix + '-transition-duration';
exports.transitionDelay = transitionDelay = prefix + '-transition-delay';
exports.transitionTiming = transitionTiming = prefix + '-transition-timing-function';
exports.animationName = animationName = prefix + '-animation-name';
exports.animationDuration = animationDuration = prefix + '-animation-duration';
exports.animationTiming = animationTiming = prefix + '-animation-delay';
exports.animationDelay = animationDelay = prefix + '-animation-timing-function';
}
exports.transform = transform;
exports.transitionProperty = transitionProperty;
exports.transitionTiming = transitionTiming;
exports.transitionDelay = transitionDelay;
exports.transitionDuration = transitionDuration;
exports.transitionEnd = transitionEnd;
exports.animationName = animationName;
exports.animationDuration = animationDuration;
exports.animationTiming = animationTiming;
exports.animationDelay = animationDelay;
exports.animationEnd = animationEnd;
exports.default = {
transform: transform,
end: transitionEnd,
property: transitionProperty,
timing: transitionTiming,
delay: transitionDelay,
duration: transitionDuration
};
function getTransitionProperties() {
var style = document.createElement('div').style;
var vendorMap = {
O: function O(e) {
return 'o' + e.toLowerCase();
},
Moz: function Moz(e) {
return e.toLowerCase();
},
Webkit: function Webkit(e) {
return 'webkit' + e;
},
ms: function ms(e) {
return 'MS' + e;
}
};
var vendors = Object.keys(vendorMap);
var transitionEnd = void 0,
animationEnd = void 0;
var prefix = '';
for (var i = 0; i < vendors.length; i++) {
var vendor = vendors[i];
if (vendor + 'TransitionProperty' in style) {
prefix = '-' + vendor.toLowerCase();
transitionEnd = vendorMap[vendor]('TransitionEnd');
animationEnd = vendorMap[vendor]('AnimationEnd');
break;
}
}
if (!transitionEnd && 'transitionProperty' in style) transitionEnd = 'transitionend';
if (!animationEnd && 'animationName' in style) animationEnd = 'animationend';
style = null;
return { animationEnd: animationEnd, transitionEnd: transitionEnd, prefix: prefix };
}
/***/ }),
/* 14 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
module.exports = exports['default'];
/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _inDOM = __webpack_require__(14);
var _inDOM2 = _interopRequireDefault(_inDOM);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var on = function on() {};
if (_inDOM2.default) {
on = function () {
if (document.addEventListener) return function (node, eventName, handler, capture) {
return node.addEventListener(eventName, handler, capture || false);
};else if (document.attachEvent) return function (node, eventName, handler) {
return node.attachEvent('on' + eventName, function (e) {
e = e || window.event;
e.target = e.target || e.srcElement;
e.currentTarget = node;
handler.call(node, e);
});
};
}();
}
exports.default = on;
module.exports = exports['default'];
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _style = __webpack_require__(17);
var _style2 = _interopRequireDefault(_style);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Transition = __webpack_require__(11);
var _Transition2 = _interopRequireDefault(_Transition);
var _capitalize = __webpack_require__(25);
var _capitalize2 = _interopRequireDefault(_capitalize);
var _tinperBeeCore = __webpack_require__(26);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var MARGINS = {
height: ['marginTop', 'marginBottom'],
width: ['marginLeft', 'marginRight']
};
// reading a dimension prop will cause the browser to recalculate,
// which will let our animations work
function triggerBrowserReflow(node) {
node.offsetHeight; // eslint-disable-line no-unused-expressions
}
function getDimensionValue(dimension, elem) {
var value = elem['offset' + (0, _capitalize2["default"])(dimension)];
var margins = MARGINS[dimension];
return value + parseInt((0, _style2["default"])(elem, margins[0]), 10) + parseInt((0, _style2["default"])(elem, margins[1]), 10);
}
var propTypes = {
/**
* Show the component; triggers the expand or collapse animation
*/
"in": _propTypes2["default"].bool,
/**
* Unmount the component (remove it from the DOM) when it is collapsed
*/
unmountOnExit: _propTypes2["default"].bool,
/**
* Run the expand animation when the component mounts, if it is initially
* shown
*/
transitionAppear: _propTypes2["default"].bool,
/**
* Duration of the collapse animation in milliseconds, to ensure that
* finishing callbacks are fired even if the original browser transition end
* events are canceled
*/
timeout: _propTypes2["default"].number,
/**
* Callback fired before the component expands
*/
onEnter: _propTypes2["default"].func,
/**
* Callback fired after the component starts to expand
*/
onEntering: _propTypes2["default"].func,
/**
* Callback fired after the component has expanded
*/
onEntered: _propTypes2["default"].func,
/**
* Callback fired before the component collapses
*/
onExit: _propTypes2["default"].func,
/**
* Callback fired after the component starts to collapse
*/
onExiting: _propTypes2["default"].func,
/**
* Callback fired after the component has collapsed
*/
onExited: _propTypes2["default"].func,
/**
* The dimension used when collapsing, or a function that returns the
* dimension
*
* _Note: Bootstrap only partially supports 'width'!
* You will need to supply your own CSS animation for the `.width` CSS class._
*/
dimension: _propTypes2["default"].oneOfType([_propTypes2["default"].oneOf(['height', 'width']), _propTypes2["default"].func]),
/**
* Function that returns the height or width of the animating DOM node
*
* Allows for providing some custom logic for how much the Collapse component
* should animate in its specified dimension. Called with the current
* dimension prop value and the DOM node.
*/
getDimensionValue: _propTypes2["default"].func,
/**
* ARIA role of collapsible element
*/
role: _propTypes2["default"].string
};
var defaultProps = {
"in": false,
timeout: 300,
unmountOnExit: false,
transitionAppear: false,
dimension: 'height',
getDimensionValue: getDimensionValue
};
var Collapse = function (_React$Component) {
_inherits(Collapse, _React$Component);
function Collapse(props, context) {
_classCallCheck(this, Collapse);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
_this.handleEnter = _this.handleEnter.bind(_this);
_this.handleEntering = _this.handleEntering.bind(_this);
_this.handleEntered = _this.handleEntered.bind(_this);
_this.handleExit = _this.handleExit.bind(_this);
_this.handleExiting = _this.handleExiting.bind(_this);
return _this;
}
/* -- Expanding -- */
Collapse.prototype.handleEnter = function handleEnter(elem) {
var dimension = this._dimension();
elem.style[dimension] = '0';
};
Collapse.prototype.handleEntering = function handleEntering(elem) {
var dimension = this._dimension();
elem.style[dimension] = this._getScrollDimensionValue(elem, dimension);
};
Collapse.prototype.handleEntered = function handleEntered(elem) {
var dimension = this._dimension();
elem.style[dimension] = null;
};
/* -- Collapsing -- */
Collapse.prototype.handleExit = function handleExit(elem) {
var dimension = this._dimension();
elem.style[dimension] = this.props.getDimensionValue(dimension, elem) + 'px';
triggerBrowserReflow(elem);
};
Collapse.prototype.handleExiting = function handleExiting(elem) {
var dimension = this._dimension();
elem.style[dimension] = '0';
};
Collapse.prototype._dimension = function _dimension() {
return typeof this.props.dimension === 'function' ? this.props.dimension() : this.props.dimension;
};
// for testing
Collapse.prototype._getScrollDimensionValue = function _getScrollDimensionValue(elem, dimension) {
return elem['scroll' + (0, _capitalize2["default"])(dimension)] + 'px';
};
Collapse.prototype.render = function render() {
var _props = this.props,
onEnter = _props.onEnter,
onEntering = _props.onEntering,
onEntered = _props.onEntered,
onExit = _props.onExit,
onExiting = _props.onExiting,
className = _props.className,
props = _objectWithoutProperties(_props, ['onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'className']);
delete props.dimension;
delete props.getDimensionValue;
var handleEnter = (0, _tinperBeeCore.createChainedFunction)(this.handleEnter, onEnter);
var handleEntering = (0, _tinperBeeCore.createChainedFunction)(this.handleEntering, onEntering);
var handleEntered = (0, _tinperBeeCore.createChainedFunction)(this.handleEntered, onEntered);
var handleExit = (0, _tinperBeeCore.createChainedFunction)(this.handleExit, onExit);
var handleExiting = (0, _tinperBeeCore.createChainedFunction)(this.handleExiting, onExiting);
var classes = {
width: this._dimension() === 'width'
};
return _react2["default"].createElement(_Transition2["default"], _extends({}, props, {
'aria-expanded': props.role ? props["in"] : null,
className: (0, _classnames2["default"])(className, classes),
exitedClassName: 'collapse',
exitingClassName: 'collapsing',
enteredClassName: 'collapse in',
enteringClassName: 'collapsing',
onEnter: handleEnter,
onEntering: handleEntering,
onEntered: handleEntered,
onExit: handleExit,
onExiting: handleExiting
}));
};
return Collapse;
}(_react2["default"].Component);
Collapse.propTypes = propTypes;
Collapse.defaultProps = defaultProps;
exports["default"] = Collapse;
module.exports = exports['default'];
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = style;
var _camelizeStyle = __webpack_require__(18);
var _camelizeStyle2 = _interopRequireDefault(_camelizeStyle);
var _hyphenateStyle = __webpack_require__(20);
var _hyphenateStyle2 = _interopRequireDefault(_hyphenateStyle);
var _getComputedStyle2 = __webpack_require__(22);
var _getComputedStyle3 = _interopRequireDefault(_getComputedStyle2);
var _removeStyle = __webpack_require__(23);
var _removeStyle2 = _interopRequireDefault(_removeStyle);
var _properties = __webpack_require__(13);
var _isTransform = __webpack_require__(24);
var _isTransform2 = _interopRequireDefault(_isTransform);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function style(node, property, value) {
var css = '';
var transforms = '';
var props = property;
if (typeof property === 'string') {
if (value === undefined) {
return node.style[(0, _camelizeStyle2.default)(property)] || (0, _getComputedStyle3.default)(node).getPropertyValue((0, _hyphenateStyle2.default)(property));
} else {
(props = {})[property] = value;
}
}
Object.keys(props).forEach(function (key) {
var value = props[key];
if (!value && value !== 0) {
(0, _removeStyle2.default)(node, (0, _hyphenateStyle2.default)(key));
} else if ((0, _isTransform2.default)(key)) {
transforms += key + '(' + value + ') ';
} else {
css += (0, _hyphenateStyle2.default)(key) + ': ' + value + ';';
}
});
if (transforms) {
css += _properties.transform + ': ' + transforms + ';';
}
node.style.cssText += ';' + css;
}
module.exports = exports['default'];
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = camelizeStyleName;
var _camelize = __webpack_require__(19);
var _camelize2 = _interopRequireDefault(_camelize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var msPattern = /^-ms-/; /**
* Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
* https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/camelizeStyleName.js
*/
function camelizeStyleName(string) {
return (0, _camelize2.default)(string.replace(msPattern, 'ms-'));
}
module.exports = exports['default'];
/***/ }),
/* 19 */
/***/ (function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = camelize;
var rHyphen = /-(.)/g;
function camelize(string) {
return string.replace(rHyphen, function (_, chr) {
return chr.toUpperCase();
});
}
module.exports = exports["default"];
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = hyphenateStyleName;
var _hyphenate = __webpack_require__(21);
var _hyphenate2 = _interopRequireDefault(_hyphenate);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var msPattern = /^ms-/; /**
* Copyright 2013-2014, Facebook, Inc.
* All rights reserved.
* https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/hyphenateStyleName.js
*/
function hyphenateStyleName(string) {
return (0, _hyphenate2.default)(string).replace(msPattern, '-ms-');
}
module.exports = exports['default'];
/***/ }),
/* 21 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = hyphenate;
var rUpper = /([A-Z])/g;
function hyphenate(string) {
return string.replace(rUpper, '-$1').toLowerCase();
}
module.exports = exports['default'];
/***/ }),
/* 22 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _getComputedStyle;
var _camelizeStyle = __webpack_require__(18);
var _camelizeStyle2 = _interopRequireDefault(_camelizeStyle);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var rposition = /^(top|right|bottom|left)$/;
var rnumnonpx = /^([+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/i;
function _getComputedStyle(node) {
if (!node) throw new TypeError('No Element passed to `getComputedStyle()`');
var doc = node.ownerDocument;
return 'defaultView' in doc ? doc.defaultView.opener ? node.ownerDocument.defaultView.getComputedStyle(node, null) : window.getComputedStyle(node, null) : {
//ie 8 "magic" from: https://github.com/jquery/jquery/blob/1.11-stable/src/css/curCSS.js#L72
getPropertyValue: function getPropertyValue(prop) {
var style = node.style;
prop = (0, _camelizeStyle2.default)(prop);
if (prop == 'float') prop = 'styleFloat';
var current = node.currentStyle[prop] || null;
if (current == null && style && style[prop]) current = style[prop];
if (rnumnonpx.test(current) && !rposition.test(prop)) {
// Remember the original values
var left = style.left;
var runStyle = node.runtimeStyle;
var rsLeft = runStyle && runStyle.left;
// Put in the new values to get a computed value out
if (rsLeft) runStyle.left = node.currentStyle.left;
style.left = prop === 'fontSize' ? '1em' : current;
current = style.pixelLeft + 'px';
// Revert the changed values
style.left = left;
if (rsLeft) runStyle.left = rsLeft;
}
return current;
}
};
}
module.exports = exports['default'];
/***/ }),
/* 23 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = removeStyle;
function removeStyle(node, key) {
return 'removeProperty' in node.style ? node.style.removeProperty(key) : node.style.removeAttribute(key);
}
module.exports = exports['default'];
/***/ }),
/* 24 */
/***/ (function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isTransform;
var supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;
function isTransform(property) {
return !!(property && supportedTransforms.test(property));
}
module.exports = exports["default"];
/***/ }),
/* 25 */
/***/ (function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = capitalize;
function capitalize(string) {
return "" + string.charAt(0).toUpperCase() + string.slice(1);
}
module.exports = exports["default"];
/***/ }),
/* 26 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.Align = exports.toArray = exports.cssAnimation = exports.addEventListener = exports.contains = exports.KeyCode = exports.createChainedFunction = exports.splitComponent = exports.isRequiredForA11y = exports.elementType = exports.deprecated = exports.componentOrElement = exports.all = undefined;
var _all2 = __webpack_require__(27);
var _all3 = _interopRequireDefault(_all2);
var _componentOrElement2 = __webpack_require__(29);
var _componentOrElement3 = _interopRequireDefault(_componentOrElement2);
var _deprecated2 = __webpack_require__(30);
var _deprecated3 = _interopRequireDefault(_deprecated2);
var _elementType2 = __webpack_require__(33);
var _elementType3 = _interopRequireDefault(_elementType2);
var _isRequiredForA11y2 = __webpack_require__(34);
var _isRequiredForA11y3 = _interopRequireDefault(_isRequiredForA11y2);
var _splitComponent2 = __webpack_require__(35);
var _splitComponent3 = _interopRequireDefault(_splitComponent2);
var _createChainedFunction2 = __webpack_require__(71);
var _createChainedFunction3 = _interopRequireDefault(_createChainedFunction2);
var _keyCode = __webpack_require__(72);
var _keyCode2 = _interopRequireDefault(_keyCode);
var _contains2 = __webpack_require__(73);
var _contains3 = _interopRequireDefault(_contains2);
var _addEventListener2 = __webpack_require__(74);
var _addEventListener3 = _interopRequireDefault(_addEventListener2);
var _cssAnimation2 = __webpack_require__(79);
var _cssAnimation3 = _interopRequireDefault(_cssAnimation2);
var _toArray2 = __webpack_require__(83);
var _toArray3 = _interopRequireDefault(_toArray2);
var _Align2 = __webpack_require__(84);
var _Align3 = _interopRequireDefault(_Align2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.all = _all3.default;
exports.componentOrElement = _componentOrElement3.default;
exports.deprecated = _deprecated3.default;
exports.elementType = _elementType3.default;
exports.isRequiredForA11y = _isRequiredForA11y3.default;
exports.splitComponent = _splitComponent3.default;
exports.createChainedFunction = _createChainedFunction3.default;
exports.KeyCode = _keyCode2.default;
exports.contains = _contains3.default;
exports.addEventListener = _addEventListener3.default;
exports.cssAnimation = _cssAnimation3.default;
exports.toArray = _toArray3.default;
//export getContainerRenderMixin from './getContainerRenderMixin';
exports.Align = _Align3.default;
/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.default = all;
var _createChainableTypeChecker = __webpack_require__(28);
var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function all() {
for (var _len = arguments.length, validators = Array(_len), _key = 0; _key < _len; _key++) {
validators[_key] = arguments[_key];
}
function allPropTypes() {
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
var error = null;
validators.forEach(function (validator) {
if (error != null) {
return;
}
var result = validator.apply(undefined, args);
if (result != null) {
error = result;
}
});
return error;
}
return (0, _createChainableTypeChecker2.default)(allPropTypes);
}
/***/ }),
/* 28 */
/***/ (function(module, exports) {
'use strict';
exports.__esModule = true;
exports.default = createChainableTypeChecker;
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
// Mostly taken from ReactPropTypes.
function createChainableTypeChecker(validate) {
function checkType(isRequired, props, propName, componentName, location, propFullName) {
var componentNameSafe = componentName || '<>';
var propFullNameSafe = propFullName || propName;
if (props[propName] == null) {
if (isRequired) {
return new Error('Required ' + location + ' `' + propFullNameSafe + '` was not specified ' + ('in `' + componentNameSafe + '`.'));
}
return null;
}
for (var _len = arguments.length, args = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) {
args[_key - 6] = arguments[_key];
}
return validate.apply(undefined, [props, propName, componentNameSafe, location, propFullNameSafe].concat(args));
}
var chainedCheckType = checkType.bind(null, false);
chainedCheckType.isRequired = checkType.bind(null, true);
return chainedCheckType;
}
/***/ }),
/* 29 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _createChainableTypeChecker = __webpack_require__(28);
var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);
if (_react2.default.isValidElement(propValue)) {
return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement. You can usually obtain a ReactComponent or DOMElement ' + 'from a ReactElement by attaching a ref to it.');
}
if ((propType !== 'object' || typeof propValue.render !== 'function') && propValue.nodeType !== 1) {
return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement.');
}
return null;
}
exports.default = (0, _createChainableTypeChecker2.default)(validate);
/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.default = deprecated;
var _warning = __webpack_require__(31);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var warned = {};
function deprecated(validator, reason) {
return function validate(props, propName, componentName, location, propFullName) {
var componentNameSafe = componentName || '<>';
var propFullNameSafe = propFullName || propName;
if (props[propName] != null) {
var messageKey = componentName + '.' + propName;
(0, _warning2.default)(warned[messageKey], 'The ' + location + ' `' + propFullNameSafe + '` of ' + ('`' + componentNameSafe + '` is deprecated. ' + reason + '.'));
warned[messageKey] = true;
}
for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
args[_key - 5] = arguments[_key];
}
return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));
};
}
/* eslint-disable no-underscore-dangle */
function _resetWarned() {
warned = {};
}
deprecated._resetWarned = _resetWarned;
/* eslint-enable no-underscore-dangle */
/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = function() {};
if (process.env.NODE_ENV !== 'production') {
warning = function(condition, format, args) {
var len = arguments.length;
args = new Array(len > 2 ? len - 2 : 0);
for (var key = 2; key < len; key++) {
args[key - 2] = arguments[key];
}
if (format === undefined) {
throw new Error(
'`warning(condition, format, ...args)` requires a warning ' +
'message argument'
);
}
if (format.length < 10 || (/^[s\W]*$/).test(format)) {
throw new Error(
'The warning format should be able to uniquely identify this ' +
'warning. Please, use a more descriptive format than: ' + format
);
}
if (!condition) {
var argIndex = 0;
var message = 'Warning: ' +
format.replace(/%s/g, function() {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch(x) {}
}
};
}
module.exports = warning;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(32)))
/***/ }),
/* 32 */
/***/ (function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return [] }
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
/***/ }),
/* 33 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _createChainableTypeChecker = __webpack_require__(28);
var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function elementType(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);
if (_react2.default.isValidElement(propValue)) {
return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + 'or a ReactClass).');
}
if (propType !== 'function' && propType !== 'string') {
return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + 'or a ReactClass).');
}
return null;
}
exports.default = (0, _createChainableTypeChecker2.default)(elementType);
/***/ }),
/* 34 */
/***/ (function(module, exports) {
'use strict';
exports.__esModule = true;
exports.default = isRequiredForA11y;
function isRequiredForA11y(validator) {
return function validate(props, propName, componentName, location, propFullName) {
var componentNameSafe = componentName || '<>';
var propFullNameSafe = propFullName || propName;
if (props[propName] == null) {
return new Error('The ' + location + ' `' + propFullNameSafe + '` is required to make ' + ('`' + componentNameSafe + '` accessible for users of assistive ') + 'technologies such as screen readers.');
}
for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
args[_key - 5] = arguments[_key];
}
return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));
};
}
/***/ }),
/* 35 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _entries = __webpack_require__(36);
var _entries2 = _interopRequireDefault(_entries);
exports.default = splitComponentProps;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* 分割要传入父元素和子元素的props
* @param {[object]} props 传入的属性
* @param {[reactElement]} Component 组件
* @return {[array]} 返回数组,第一个元素为父元素props对象,第二个子元素props对象
*/
function splitComponentProps(props, Component) {
var componentPropTypes = Component.propTypes;
var parentProps = {};
var childProps = {};
(0, _entries2.default)(props).forEach(function (_ref) {
var propName = _ref[0],
propValue = _ref[1];
if (componentPropTypes[propName]) {
parentProps[propName] = propValue;
} else {
childProps[propName] = propValue;
}
});
return [parentProps, childProps];
}
/***/ }),
/* 36 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(37), __esModule: true };
/***/ }),
/* 37 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(38);
module.exports = __webpack_require__(41).Object.entries;
/***/ }),
/* 38 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/tc39/proposal-object-values-entries
var $export = __webpack_require__(39);
var $entries = __webpack_require__(54)(true);
$export($export.S, 'Object', {
entries: function entries(it) {
return $entries(it);
}
});
/***/ }),
/* 39 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(40);
var core = __webpack_require__(41);
var ctx = __webpack_require__(42);
var hide = __webpack_require__(44);
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var IS_WRAP = type & $export.W;
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
var expProto = exports[PROTOTYPE];
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
var key, own, out;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
if (own && key in exports) continue;
// export native or passed
out = own ? target[key] : source[key];
// prevent global pollution for namespaces
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
// bind timers to global for call from export context
: IS_BIND && own ? ctx(out, global)
// wrap global constructors for prevent change them in library
: IS_WRAP && target[key] == out ? (function (C) {
var F = function (a, b, c) {
if (this instanceof C) {
switch (arguments.length) {
case 0: return new C();
case 1: return new C(a);
case 2: return new C(a, b);
} return new C(a, b, c);
} return C.apply(this, arguments);
};
F[PROTOTYPE] = C[PROTOTYPE];
return F;
// make static versions for prototype methods
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
if (IS_PROTO) {
(exports.virtual || (exports.virtual = {}))[key] = out;
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
}
}
};
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ }),
/* 40 */
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
/***/ }),
/* 41 */
/***/ (function(module, exports) {
var core = module.exports = { version: '2.5.3' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
/***/ }),
/* 42 */
/***/ (function(module, exports, __webpack_require__) {
// optional / simple context binding
var aFunction = __webpack_require__(43);
module.exports = function (fn, that, length) {
aFunction(fn);
if (that === undefined) return fn;
switch (length) {
case 1: return function (a) {
return fn.call(that, a);
};
case 2: return function (a, b) {
return fn.call(that, a, b);
};
case 3: return function (a, b, c) {
return fn.call(that, a, b, c);
};
}
return function (/* ...args */) {
return fn.apply(that, arguments);
};
};
/***/ }),
/* 43 */
/***/ (function(module, exports) {
module.exports = function (it) {
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
return it;
};
/***/ }),
/* 44 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(45);
var createDesc = __webpack_require__(53);
module.exports = __webpack_require__(49) ? function (object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/* 45 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(46);
var IE8_DOM_DEFINE = __webpack_require__(48);
var toPrimitive = __webpack_require__(52);
var dP = Object.defineProperty;
exports.f = __webpack_require__(49) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/* 46 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(47);
module.exports = function (it) {
if (!isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/* 47 */
/***/ (function(module, exports) {
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/* 48 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = !__webpack_require__(49) && !__webpack_require__(50)(function () {
return Object.defineProperty(__webpack_require__(51)('div'), 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 49 */
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(50)(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 50 */
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
/***/ }),
/* 51 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(47);
var document = __webpack_require__(40).document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return is ? document.createElement(it) : {};
};
/***/ }),
/* 52 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__(47);
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
if (!isObject(it)) return it;
var fn, val;
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ }),
/* 53 */
/***/ (function(module, exports) {
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
/***/ }),
/* 54 */
/***/ (function(module, exports, __webpack_require__) {
var getKeys = __webpack_require__(55);
var toIObject = __webpack_require__(58);
var isEnum = __webpack_require__(70).f;
module.exports = function (isEntries) {
return function (it) {
var O = toIObject(it);
var keys = getKeys(O);
var length = keys.length;
var i = 0;
var result = [];
var key;
while (length > i) if (isEnum.call(O, key = keys[i++])) {
result.push(isEntries ? [key, O[key]] : O[key]);
} return result;
};
};
/***/ }),
/* 55 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(56);
var enumBugKeys = __webpack_require__(69);
module.exports = Object.keys || function keys(O) {
return $keys(O, enumBugKeys);
};
/***/ }),
/* 56 */
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__(57);
var toIObject = __webpack_require__(58);
var arrayIndexOf = __webpack_require__(62)(false);
var IE_PROTO = __webpack_require__(66)('IE_PROTO');
module.exports = function (object, names) {
var O = toIObject(object);
var i = 0;
var result = [];
var key;
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (has(O, key = names[i++])) {
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
/***/ }),
/* 57 */
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/* 58 */
/***/ (function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(59);
var defined = __webpack_require__(61);
module.exports = function (it) {
return IObject(defined(it));
};
/***/ }),
/* 59 */
/***/ (function(module, exports, __webpack_require__) {
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__(60);
// eslint-disable-next-line no-prototype-builtins
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
return cof(it) == 'String' ? it.split('') : Object(it);
};
/***/ }),
/* 60 */
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = function (it) {
return toString.call(it).slice(8, -1);
};
/***/ }),
/* 61 */
/***/ (function(module, exports) {
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
/***/ }),
/* 62 */
/***/ (function(module, exports, __webpack_require__) {
// false -> Array#indexOf
// true -> Array#includes
var toIObject = __webpack_require__(58);
var toLength = __webpack_require__(63);
var toAbsoluteIndex = __webpack_require__(65);
module.exports = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIObject($this);
var length = toLength(O.length);
var index = toAbsoluteIndex(fromIndex, length);
var value;
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
if (O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
/***/ }),
/* 63 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.15 ToLength
var toInteger = __webpack_require__(64);
var min = Math.min;
module.exports = function (it) {
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
/***/ }),
/* 64 */
/***/ (function(module, exports) {
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = function (it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
/***/ }),
/* 65 */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(64);
var max = Math.max;
var min = Math.min;
module.exports = function (index, length) {
index = toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
};
/***/ }),
/* 66 */
/***/ (function(module, exports, __webpack_require__) {
var shared = __webpack_require__(67)('keys');
var uid = __webpack_require__(68);
module.exports = function (key) {
return shared[key] || (shared[key] = uid(key));
};
/***/ }),
/* 67 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(40);
var SHARED = '__core-js_shared__';
var store = global[SHARED] || (global[SHARED] = {});
module.exports = function (key) {
return store[key] || (store[key] = {});
};
/***/ }),
/* 68 */
/***/ (function(module, exports) {
var id = 0;
var px = Math.random();
module.exports = function (key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
/***/ }),
/* 69 */
/***/ (function(module, exports) {
// IE 8- don't enum bug keys
module.exports = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
/***/ }),
/* 70 */
/***/ (function(module, exports) {
exports.f = {}.propertyIsEnumerable;
/***/ }),
/* 71 */
/***/ (function(module, exports) {
'use strict';
exports.__esModule = true;
function createChainedFunction() {
for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
funcs[_key] = arguments[_key];
}
return funcs.filter(function (f) {
return f != null;
}).reduce(function (acc, f) {
if (typeof f !== 'function') {
throw new Error('Invalid Argument Type, must only provide functions, undefined, or null.');
}
if (acc === null) {
return f;
}
return function chainedFunction() {
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
acc.apply(this, args);
f.apply(this, args);
};
}, null);
}
exports.default = createChainedFunction;
/***/ }),
/* 72 */
/***/ (function(module, exports) {
'use strict';
/**
* @ignore
* some key-codes definition and utils from closure-library
* @author yiminghe@gmail.com
*/
var KeyCode = {
/**
* MAC_ENTER
*/
MAC_ENTER: 3,
/**
* BACKSPACE
*/
BACKSPACE: 8,
/**
* TAB
*/
TAB: 9,
/**
* NUMLOCK on FF/Safari Mac
*/
NUM_CENTER: 12, // NUMLOCK on FF/Safari Mac
/**
* ENTER
*/
ENTER: 13,
/**
* SHIFT
*/
SHIFT: 16,
/**
* CTRL
*/
CTRL: 17,
/**
* ALT
*/
ALT: 18,
/**
* PAUSE
*/
PAUSE: 19,
/**
* CAPS_LOCK
*/
CAPS_LOCK: 20,
/**
* ESC
*/
ESC: 27,
/**
* SPACE
*/
SPACE: 32,
/**
* PAGE_UP
*/
PAGE_UP: 33, // also NUM_NORTH_EAST
/**
* PAGE_DOWN
*/
PAGE_DOWN: 34, // also NUM_SOUTH_EAST
/**
* END
*/
END: 35, // also NUM_SOUTH_WEST
/**
* HOME
*/
HOME: 36, // also NUM_NORTH_WEST
/**
* LEFT
*/
LEFT: 37, // also NUM_WEST
/**
* UP
*/
UP: 38, // also NUM_NORTH
/**
* RIGHT
*/
RIGHT: 39, // also NUM_EAST
/**
* DOWN
*/
DOWN: 40, // also NUM_SOUTH
/**
* PRINT_SCREEN
*/
PRINT_SCREEN: 44,
/**
* INSERT
*/
INSERT: 45, // also NUM_INSERT
/**
* DELETE
*/
DELETE: 46, // also NUM_DELETE
/**
* ZERO
*/
ZERO: 48,
/**
* ONE
*/
ONE: 49,
/**
* TWO
*/
TWO: 50,
/**
* THREE
*/
THREE: 51,
/**
* FOUR
*/
FOUR: 52,
/**
* FIVE
*/
FIVE: 53,
/**
* SIX
*/
SIX: 54,
/**
* SEVEN
*/
SEVEN: 55,
/**
* EIGHT
*/
EIGHT: 56,
/**
* NINE
*/
NINE: 57,
/**
* QUESTION_MARK
*/
QUESTION_MARK: 63, // needs localization
/**
* A
*/
A: 65,
/**
* B
*/
B: 66,
/**
* C
*/
C: 67,
/**
* D
*/
D: 68,
/**
* E
*/
E: 69,
/**
* F
*/
F: 70,
/**
* G
*/
G: 71,
/**
* H
*/
H: 72,
/**
* I
*/
I: 73,
/**
* J
*/
J: 74,
/**
* K
*/
K: 75,
/**
* L
*/
L: 76,
/**
* M
*/
M: 77,
/**
* N
*/
N: 78,
/**
* O
*/
O: 79,
/**
* P
*/
P: 80,
/**
* Q
*/
Q: 81,
/**
* R
*/
R: 82,
/**
* S
*/
S: 83,
/**
* T
*/
T: 84,
/**
* U
*/
U: 85,
/**
* V
*/
V: 86,
/**
* W
*/
W: 87,
/**
* X
*/
X: 88,
/**
* Y
*/
Y: 89,
/**
* Z
*/
Z: 90,
/**
* META
*/
META: 91, // WIN_KEY_LEFT
/**
* WIN_KEY_RIGHT
*/
WIN_KEY_RIGHT: 92,
/**
* CONTEXT_MENU
*/
CONTEXT_MENU: 93,
/**
* NUM_ZERO
*/
NUM_ZERO: 96,
/**
* NUM_ONE
*/
NUM_ONE: 97,
/**
* NUM_TWO
*/
NUM_TWO: 98,
/**
* NUM_THREE
*/
NUM_THREE: 99,
/**
* NUM_FOUR
*/
NUM_FOUR: 100,
/**
* NUM_FIVE
*/
NUM_FIVE: 101,
/**
* NUM_SIX
*/
NUM_SIX: 102,
/**
* NUM_SEVEN
*/
NUM_SEVEN: 103,
/**
* NUM_EIGHT
*/
NUM_EIGHT: 104,
/**
* NUM_NINE
*/
NUM_NINE: 105,
/**
* NUM_MULTIPLY
*/
NUM_MULTIPLY: 106,
/**
* NUM_PLUS
*/
NUM_PLUS: 107,
/**
* NUM_MINUS
*/
NUM_MINUS: 109,
/**
* NUM_PERIOD
*/
NUM_PERIOD: 110,
/**
* NUM_DIVISION
*/
NUM_DIVISION: 111,
/**
* F1
*/
F1: 112,
/**
* F2
*/
F2: 113,
/**
* F3
*/
F3: 114,
/**
* F4
*/
F4: 115,
/**
* F5
*/
F5: 116,
/**
* F6
*/
F6: 117,
/**
* F7
*/
F7: 118,
/**
* F8
*/
F8: 119,
/**
* F9
*/
F9: 120,
/**
* F10
*/
F10: 121,
/**
* F11
*/
F11: 122,
/**
* F12
*/
F12: 123,
/**
* NUMLOCK
*/
NUMLOCK: 144,
/**
* SEMICOLON
*/
SEMICOLON: 186, // needs localization
/**
* DASH
*/
DASH: 189, // needs localization
/**
* EQUALS
*/
EQUALS: 187, // needs localization
/**
* COMMA
*/
COMMA: 188, // needs localization
/**
* PERIOD
*/
PERIOD: 190, // needs localization
/**
* SLASH
*/
SLASH: 191, // needs localization
/**
* APOSTROPHE
*/
APOSTROPHE: 192, // needs localization
/**
* SINGLE_QUOTE
*/
SINGLE_QUOTE: 222, // needs localization
/**
* OPEN_SQUARE_BRACKET
*/
OPEN_SQUARE_BRACKET: 219, // needs localization
/**
* BACKSLASH
*/
BACKSLASH: 220, // needs localization
/**
* CLOSE_SQUARE_BRACKET
*/
CLOSE_SQUARE_BRACKET: 221, // needs localization
/**
* WIN_KEY
*/
WIN_KEY: 224,
/**
* MAC_FF_META
*/
MAC_FF_META: 224, // Firefox (Gecko) fires this for the meta key instead of 91
/**
* WIN_IME
*/
WIN_IME: 229
};
/*
whether text and modified key is entered at the same time.
*/
KeyCode.isTextModifyingKeyEvent = function isTextModifyingKeyEvent(e) {
var keyCode = e.keyCode;
if (e.altKey && !e.ctrlKey || e.metaKey ||
// Function keys don't generate text
keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
return false;
}
// The following keys are quite harmless, even in combination with
// CTRL, ALT or SHIFT.
switch (keyCode) {
case KeyCode.ALT:
case KeyCode.CAPS_LOCK:
case KeyCode.CONTEXT_MENU:
case KeyCode.CTRL:
case KeyCode.DOWN:
case KeyCode.END:
case KeyCode.ESC:
case KeyCode.HOME:
case KeyCode.INSERT:
case KeyCode.LEFT:
case KeyCode.MAC_FF_META:
case KeyCode.META:
case KeyCode.NUMLOCK:
case KeyCode.NUM_CENTER:
case KeyCode.PAGE_DOWN:
case KeyCode.PAGE_UP:
case KeyCode.PAUSE:
case KeyCode.PRINT_SCREEN:
case KeyCode.RIGHT:
case KeyCode.SHIFT:
case KeyCode.UP:
case KeyCode.WIN_KEY:
case KeyCode.WIN_KEY_RIGHT:
return false;
default:
return true;
}
};
/*
whether character is entered.
*/
KeyCode.isCharacterKey = function isCharacterKey(keyCode) {
if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
return true;
}
if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
return true;
}
if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
return true;
}
// Safari sends zero key code for non-latin characters.
if (window.navigation.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
return true;
}
switch (keyCode) {
case KeyCode.SPACE:
case KeyCode.QUESTION_MARK:
case KeyCode.NUM_PLUS:
case KeyCode.NUM_MINUS:
case KeyCode.NUM_PERIOD:
case KeyCode.NUM_DIVISION:
case KeyCode.SEMICOLON:
case KeyCode.DASH:
case KeyCode.EQUALS:
case KeyCode.COMMA:
case KeyCode.PERIOD:
case KeyCode.SLASH:
case KeyCode.APOSTROPHE:
case KeyCode.SINGLE_QUOTE:
case KeyCode.OPEN_SQUARE_BRACKET:
case KeyCode.BACKSLASH:
case KeyCode.CLOSE_SQUARE_BRACKET:
return true;
default:
return false;
}
};
module.exports = KeyCode;
/***/ }),
/* 73 */
/***/ (function(module, exports) {
"use strict";
exports.__esModule = true;
exports.default = contains;
function contains(root, n) {
var node = n;
while (node) {
if (node === root) {
return true;
}
node = node.parentNode;
}
return false;
}
/***/ }),
/* 74 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.default = addEventListenerWrap;
var _addDomEventListener = __webpack_require__(75);
var _addDomEventListener2 = _interopRequireDefault(_addDomEventListener);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function addEventListenerWrap(target, eventType, cb) {
/* eslint camelcase: 2 */
var callback = _reactDom2.default.unstable_batchedUpdates ? function run(e) {
_reactDom2.default.unstable_batchedUpdates(cb, e);
} : cb;
return (0, _addDomEventListener2.default)(target, eventType, callback);
}
/***/ }),
/* 75 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = addEventListener;
var _EventObject = __webpack_require__(76);
var _EventObject2 = _interopRequireDefault(_EventObject);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function addEventListener(target, eventType, callback) {
function wrapCallback(e) {
var ne = new _EventObject2["default"](e);
callback.call(target, ne);
}
if (target.addEventListener) {
target.addEventListener(eventType, wrapCallback, false);
return {
remove: function remove() {
target.removeEventListener(eventType, wrapCallback, false);
}
};
} else if (target.attachEvent) {
target.attachEvent('on' + eventType, wrapCallback);
return {
remove: function remove() {
target.detachEvent('on' + eventType, wrapCallback);
}
};
}
}
module.exports = exports['default'];
/***/ }),
/* 76 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _EventBaseObject = __webpack_require__(77);
var _EventBaseObject2 = _interopRequireDefault(_EventBaseObject);
var _objectAssign = __webpack_require__(78);
var _objectAssign2 = _interopRequireDefault(_objectAssign);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**
* @ignore
* event object for dom
* @author yiminghe@gmail.com
*/
var TRUE = true;
var FALSE = false;
var commonProps = ['altKey', 'bubbles', 'cancelable', 'ctrlKey', 'currentTarget', 'eventPhase', 'metaKey', 'shiftKey', 'target', 'timeStamp', 'view', 'type'];
function isNullOrUndefined(w) {
return w === null || w === undefined;
}
var eventNormalizers = [{
reg: /^key/,
props: ['char', 'charCode', 'key', 'keyCode', 'which'],
fix: function fix(event, nativeEvent) {
if (isNullOrUndefined(event.which)) {
event.which = !isNullOrUndefined(nativeEvent.charCode) ? nativeEvent.charCode : nativeEvent.keyCode;
}
// add metaKey to non-Mac browsers (use ctrl for PC 's and Meta for Macs)
if (event.metaKey === undefined) {
event.metaKey = event.ctrlKey;
}
}
}, {
reg: /^touch/,
props: ['touches', 'changedTouches', 'targetTouches']
}, {
reg: /^hashchange$/,
props: ['newURL', 'oldURL']
}, {
reg: /^gesturechange$/i,
props: ['rotation', 'scale']
}, {
reg: /^(mousewheel|DOMMouseScroll)$/,
props: [],
fix: function fix(event, nativeEvent) {
var deltaX = void 0;
var deltaY = void 0;
var delta = void 0;
var wheelDelta = nativeEvent.wheelDelta;
var axis = nativeEvent.axis;
var wheelDeltaY = nativeEvent.wheelDeltaY;
var wheelDeltaX = nativeEvent.wheelDeltaX;
var detail = nativeEvent.detail;
// ie/webkit
if (wheelDelta) {
delta = wheelDelta / 120;
}
// gecko
if (detail) {
// press control e.detail == 1 else e.detail == 3
delta = 0 - (detail % 3 === 0 ? detail / 3 : detail);
}
// Gecko
if (axis !== undefined) {
if (axis === event.HORIZONTAL_AXIS) {
deltaY = 0;
deltaX = 0 - delta;
} else if (axis === event.VERTICAL_AXIS) {
deltaX = 0;
deltaY = delta;
}
}
// Webkit
if (wheelDeltaY !== undefined) {
deltaY = wheelDeltaY / 120;
}
if (wheelDeltaX !== undefined) {
deltaX = -1 * wheelDeltaX / 120;
}
// 默认 deltaY (ie)
if (!deltaX && !deltaY) {
deltaY = delta;
}
if (deltaX !== undefined) {
/**
* deltaX of mousewheel event
* @property deltaX
* @member Event.DomEvent.Object
*/
event.deltaX = deltaX;
}
if (deltaY !== undefined) {
/**
* deltaY of mousewheel event
* @property deltaY
* @member Event.DomEvent.Object
*/
event.deltaY = deltaY;
}
if (delta !== undefined) {
/**
* delta of mousewheel event
* @property delta
* @member Event.DomEvent.Object
*/
event.delta = delta;
}
}
}, {
reg: /^mouse|contextmenu|click|mspointer|(^DOMMouseScroll$)/i,
props: ['buttons', 'clientX', 'clientY', 'button', 'offsetX', 'relatedTarget', 'which', 'fromElement', 'toElement', 'offsetY', 'pageX', 'pageY', 'screenX', 'screenY'],
fix: function fix(event, nativeEvent) {
var eventDoc = void 0;
var doc = void 0;
var body = void 0;
var target = event.target;
var button = nativeEvent.button;
// Calculate pageX/Y if missing and clientX/Y available
if (target && isNullOrUndefined(event.pageX) && !isNullOrUndefined(nativeEvent.clientX)) {
eventDoc = target.ownerDocument || document;
doc = eventDoc.documentElement;
body = eventDoc.body;
event.pageX = nativeEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
event.pageY = nativeEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
}
// which for click: 1 === left; 2 === middle; 3 === right
// do not use button
if (!event.which && button !== undefined) {
if (button & 1) {
event.which = 1;
} else if (button & 2) {
event.which = 3;
} else if (button & 4) {
event.which = 2;
} else {
event.which = 0;
}
}
// add relatedTarget, if necessary
if (!event.relatedTarget && event.fromElement) {
event.relatedTarget = event.fromElement === target ? event.toElement : event.fromElement;
}
return event;
}
}];
function retTrue() {
return TRUE;
}
function retFalse() {
return FALSE;
}
function DomEventObject(nativeEvent) {
var type = nativeEvent.type;
var isNative = typeof nativeEvent.stopPropagation === 'function' || typeof nativeEvent.cancelBubble === 'boolean';
_EventBaseObject2["default"].call(this);
this.nativeEvent = nativeEvent;
// in case dom event has been mark as default prevented by lower dom node
var isDefaultPrevented = retFalse;
if ('defaultPrevented' in nativeEvent) {
isDefaultPrevented = nativeEvent.defaultPrevented ? retTrue : retFalse;
} else if ('getPreventDefault' in nativeEvent) {
// https://bugzilla.mozilla.org/show_bug.cgi?id=691151
isDefaultPrevented = nativeEvent.getPreventDefault() ? retTrue : retFalse;
} else if ('returnValue' in nativeEvent) {
isDefaultPrevented = nativeEvent.returnValue === FALSE ? retTrue : retFalse;
}
this.isDefaultPrevented = isDefaultPrevented;
var fixFns = [];
var fixFn = void 0;
var l = void 0;
var prop = void 0;
var props = commonProps.concat();
eventNormalizers.forEach(function (normalizer) {
if (type.match(normalizer.reg)) {
props = props.concat(normalizer.props);
if (normalizer.fix) {
fixFns.push(normalizer.fix);
}
}
});
l = props.length;
// clone properties of the original event object
while (l) {
prop = props[--l];
this[prop] = nativeEvent[prop];
}
// fix target property, if necessary
if (!this.target && isNative) {
this.target = nativeEvent.srcElement || document; // srcElement might not be defined either
}
// check if target is a text node (safari)
if (this.target && this.target.nodeType === 3) {
this.target = this.target.parentNode;
}
l = fixFns.length;
while (l) {
fixFn = fixFns[--l];
fixFn(this, nativeEvent);
}
this.timeStamp = nativeEvent.timeStamp || Date.now();
}
var EventBaseObjectProto = _EventBaseObject2["default"].prototype;
(0, _objectAssign2["default"])(DomEventObject.prototype, EventBaseObjectProto, {
constructor: DomEventObject,
preventDefault: function preventDefault() {
var e = this.nativeEvent;
// if preventDefault exists run it on the original event
if (e.preventDefault) {
e.preventDefault();
} else {
// otherwise set the returnValue property of the original event to FALSE (IE)
e.returnValue = FALSE;
}
EventBaseObjectProto.preventDefault.call(this);
},
stopPropagation: function stopPropagation() {
var e = this.nativeEvent;
// if stopPropagation exists run it on the original event
if (e.stopPropagation) {
e.stopPropagation();
} else {
// otherwise set the cancelBubble property of the original event to TRUE (IE)
e.cancelBubble = TRUE;
}
EventBaseObjectProto.stopPropagation.call(this);
}
});
exports["default"] = DomEventObject;
module.exports = exports['default'];
/***/ }),
/* 77 */
/***/ (function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* @ignore
* base event object for custom and dom event.
* @author yiminghe@gmail.com
*/
function returnFalse() {
return false;
}
function returnTrue() {
return true;
}
function EventBaseObject() {
this.timeStamp = Date.now();
this.target = undefined;
this.currentTarget = undefined;
}
EventBaseObject.prototype = {
isEventObject: 1,
constructor: EventBaseObject,
isDefaultPrevented: returnFalse,
isPropagationStopped: returnFalse,
isImmediatePropagationStopped: returnFalse,
preventDefault: function preventDefault() {
this.isDefaultPrevented = returnTrue;
},
stopPropagation: function stopPropagation() {
this.isPropagationStopped = returnTrue;
},
stopImmediatePropagation: function stopImmediatePropagation() {
this.isImmediatePropagationStopped = returnTrue;
// fixed 1.2
// call stopPropagation implicitly
this.stopPropagation();
},
halt: function halt(immediate) {
if (immediate) {
this.stopImmediatePropagation();
} else {
this.stopPropagation();
}
this.preventDefault();
}
};
exports["default"] = EventBaseObject;
module.exports = exports['default'];
/***/ }),
/* 78 */
/***/ (function(module, exports) {
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
'use strict';
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
/***/ }),
/* 79 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _Event = __webpack_require__(80);
var _Event2 = _interopRequireDefault(_Event);
var _componentClasses = __webpack_require__(81);
var _componentClasses2 = _interopRequireDefault(_componentClasses);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var isCssAnimationSupported = _Event2.default.endEvents.length !== 0;
var capitalPrefixes = ['Webkit', 'Moz', 'O',
// ms is special .... !
'ms'];
var prefixes = ['-webkit-', '-moz-', '-o-', 'ms-', ''];
function getStyleProperty(node, name) {
var style = window.getComputedStyle(node);
var ret = '';
for (var i = 0; i < prefixes.length; i++) {
ret = style.getPropertyValue(prefixes[i] + name);
if (ret) {
break;
}
}
return ret;
}
function fixBrowserByTimeout(node) {
if (isCssAnimationSupported) {
var transitionDelay = parseFloat(getStyleProperty(node, 'transition-delay')) || 0;
var transitionDuration = parseFloat(getStyleProperty(node, 'transition-duration')) || 0;
var animationDelay = parseFloat(getStyleProperty(node, 'animation-delay')) || 0;
var animationDuration = parseFloat(getStyleProperty(node, 'animation-duration')) || 0;
var time = Math.max(transitionDuration + transitionDelay, animationDuration + animationDelay);
// sometimes, browser bug
node.rcEndAnimTimeout = setTimeout(function () {
node.rcEndAnimTimeout = null;
if (node.rcEndListener) {
node.rcEndListener();
}
}, time * 1000 + 200);
}
}
function clearBrowserBugTimeout(node) {
if (node.rcEndAnimTimeout) {
clearTimeout(node.rcEndAnimTimeout);
node.rcEndAnimTimeout = null;
}
}
var cssAnimation = function cssAnimation(node, transitionName, endCallback) {
var nameIsObj = (typeof transitionName === 'undefined' ? 'undefined' : _typeof(transitionName)) === 'object';
var className = nameIsObj ? transitionName.name : transitionName;
var activeClassName = nameIsObj ? transitionName.active : transitionName + '-active';
var end = endCallback;
var start = void 0;
var active = void 0;
var nodeClasses = (0, _componentClasses2.default)(node);
if (endCallback && Object.prototype.toString.call(endCallback) === '[object Object]') {
end = endCallback.end;
start = endCallback.start;
active = endCallback.active;
}
if (node.rcEndListener) {
node.rcEndListener();
}
node.rcEndListener = function (e) {
if (e && e.target !== node) {
return;
}
if (node.rcAnimTimeout) {
clearTimeout(node.rcAnimTimeout);
node.rcAnimTimeout = null;
}
clearBrowserBugTimeout(node);
nodeClasses.remove(className);
nodeClasses.remove(activeClassName);
_Event2.default.removeEndEventListener(node, node.rcEndListener);
node.rcEndListener = null;
// Usually this optional end is used for informing an owner of
// a leave animation and telling it to remove the child.
if (end) {
end();
}
};
_Event2.default.addEndEventListener(node, node.rcEndListener);
if (start) {
start();
}
nodeClasses.add(className);
node.rcAnimTimeout = setTimeout(function () {
node.rcAnimTimeout = null;
nodeClasses.add(activeClassName);
if (active) {
setTimeout(active, 0);
}
fixBrowserByTimeout(node);
// 30ms for firefox
}, 30);
return {
stop: function stop() {
if (node.rcEndListener) {
node.rcEndListener();
}
}
};
};
cssAnimation.style = function (node, style, callback) {
if (node.rcEndListener) {
node.rcEndListener();
}
node.rcEndListener = function (e) {
if (e && e.target !== node) {
return;
}
if (node.rcAnimTimeout) {
clearTimeout(node.rcAnimTimeout);
node.rcAnimTimeout = null;
}
clearBrowserBugTimeout(node);
_Event2.default.removeEndEventListener(node, node.rcEndListener);
node.rcEndListener = null;
// Usually this optional callback is used for informing an owner of
// a leave animation and telling it to remove the child.
if (callback) {
callback();
}
};
_Event2.default.addEndEventListener(node, node.rcEndListener);
node.rcAnimTimeout = setTimeout(function () {
for (var s in style) {
if (style.hasOwnProperty(s)) {
node.style[s] = style[s];
}
}
node.rcAnimTimeout = null;
fixBrowserByTimeout(node);
}, 0);
};
cssAnimation.setTransition = function (node, p, value) {
var property = p;
var v = value;
if (value === undefined) {
v = property;
property = '';
}
property = property || '';
capitalPrefixes.forEach(function (prefix) {
node.style[prefix + 'Transition' + property] = v;
});
};
cssAnimation.isCssAnimationSupported = isCssAnimationSupported;
exports.default = cssAnimation;
/***/ }),
/* 80 */
/***/ (function(module, exports) {
'use strict';
exports.__esModule = true;
var EVENT_NAME_MAP = {
transitionend: {
transition: 'transitionend',
WebkitTransition: 'webkitTransitionEnd',
MozTransition: 'mozTransitionEnd',
OTransition: 'oTransitionEnd',
msTransition: 'MSTransitionEnd'
},
animationend: {
animation: 'animationend',
WebkitAnimation: 'webkitAnimationEnd',
MozAnimation: 'mozAnimationEnd',
OAnimation: 'oAnimationEnd',
msAnimation: 'MSAnimationEnd'
}
};
var endEvents = [];
function detectEvents() {
var testEl = document.createElement('div');
var style = testEl.style;
if (!('AnimationEvent' in window)) {
delete EVENT_NAME_MAP.animationend.animation;
}
if (!('TransitionEvent' in window)) {
delete EVENT_NAME_MAP.transitionend.transition;
}
for (var baseEventName in EVENT_NAME_MAP) {
if (EVENT_NAME_MAP.hasOwnProperty(baseEventName)) {
var baseEvents = EVENT_NAME_MAP[baseEventName];
for (var styleName in baseEvents) {
if (styleName in style) {
endEvents.push(baseEvents[styleName]);
break;
}
}
}
}
}
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
detectEvents();
}
function addEventListener(node, eventName, eventListener) {
node.addEventListener(eventName, eventListener, false);
}
function removeEventListener(node, eventName, eventListener) {
node.removeEventListener(eventName, eventListener, false);
}
var TransitionEvents = {
addEndEventListener: function addEndEventListener(node, eventListener) {
if (endEvents.length === 0) {
window.setTimeout(eventListener, 0);
return;
}
endEvents.forEach(function (endEvent) {
addEventListener(node, endEvent, eventListener);
});
},
endEvents: endEvents,
removeEndEventListener: function removeEndEventListener(node, eventListener) {
if (endEvents.length === 0) {
return;
}
endEvents.forEach(function (endEvent) {
removeEventListener(node, endEvent, eventListener);
});
}
};
exports.default = TransitionEvents;
/***/ }),
/* 81 */
/***/ (function(module, exports, __webpack_require__) {
/**
* Module dependencies.
*/
try {
var index = __webpack_require__(82);
} catch (err) {
var index = __webpack_require__(82);
}
/**
* Whitespace regexp.
*/
var re = /\s+/;
/**
* toString reference.
*/
var toString = Object.prototype.toString;
/**
* Wrap `el` in a `ClassList`.
*
* @param {Element} el
* @return {ClassList}
* @api public
*/
module.exports = function(el){
return new ClassList(el);
};
/**
* Initialize a new ClassList for `el`.
*
* @param {Element} el
* @api private
*/
function ClassList(el) {
if (!el || !el.nodeType) {
throw new Error('A DOM element reference is required');
}
this.el = el;
this.list = el.classList;
}
/**
* Add class `name` if not already present.
*
* @param {String} name
* @return {ClassList}
* @api public
*/
ClassList.prototype.add = function(name){
// classList
if (this.list) {
this.list.add(name);
return this;
}
// fallback
var arr = this.array();
var i = index(arr, name);
if (!~i) arr.push(name);
this.el.className = arr.join(' ');
return this;
};
/**
* Remove class `name` when present, or
* pass a regular expression to remove
* any which match.
*
* @param {String|RegExp} name
* @return {ClassList}
* @api public
*/
ClassList.prototype.remove = function(name){
if ('[object RegExp]' == toString.call(name)) {
return this.removeMatching(name);
}
// classList
if (this.list) {
this.list.remove(name);
return this;
}
// fallback
var arr = this.array();
var i = index(arr, name);
if (~i) arr.splice(i, 1);
this.el.className = arr.join(' ');
return this;
};
/**
* Remove all classes matching `re`.
*
* @param {RegExp} re
* @return {ClassList}
* @api private
*/
ClassList.prototype.removeMatching = function(re){
var arr = this.array();
for (var i = 0; i < arr.length; i++) {
if (re.test(arr[i])) {
this.remove(arr[i]);
}
}
return this;
};
/**
* Toggle class `name`, can force state via `force`.
*
* For browsers that support classList, but do not support `force` yet,
* the mistake will be detected and corrected.
*
* @param {String} name
* @param {Boolean} force
* @return {ClassList}
* @api public
*/
ClassList.prototype.toggle = function(name, force){
// classList
if (this.list) {
if ("undefined" !== typeof force) {
if (force !== this.list.toggle(name, force)) {
this.list.toggle(name); // toggle again to correct
}
} else {
this.list.toggle(name);
}
return this;
}
// fallback
if ("undefined" !== typeof force) {
if (!force) {
this.remove(name);
} else {
this.add(name);
}
} else {
if (this.has(name)) {
this.remove(name);
} else {
this.add(name);
}
}
return this;
};
/**
* Return an array of classes.
*
* @return {Array}
* @api public
*/
ClassList.prototype.array = function(){
var className = this.el.getAttribute('class') || '';
var str = className.replace(/^\s+|\s+$/g, '');
var arr = str.split(re);
if ('' === arr[0]) arr.shift();
return arr;
};
/**
* Check if class `name` is present.
*
* @param {String} name
* @return {ClassList}
* @api public
*/
ClassList.prototype.has =
ClassList.prototype.contains = function(name){
return this.list
? this.list.contains(name)
: !! ~index(this.array(), name);
};
/***/ }),
/* 82 */
/***/ (function(module, exports) {
module.exports = function(arr, obj){
if (arr.indexOf) return arr.indexOf(obj);
for (var i = 0; i < arr.length; ++i) {
if (arr[i] === obj) return i;
}
return -1;
};
/***/ }),
/* 83 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
exports.default = toArray;
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function toArray(children) {
var ret = [];
_react2.default.Children.forEach(children, function (c) {
ret.push(c);
});
return ret;
}
/***/ }),
/* 84 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _createReactClass = __webpack_require__(85);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _domAlign = __webpack_require__(91);
var _domAlign2 = _interopRequireDefault(_domAlign);
var _addEventListener = __webpack_require__(74);
var _addEventListener2 = _interopRequireDefault(_addEventListener);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
//import isWindow from './isWindow';
function isWindow(obj) {
/* eslint no-eq-null: 0 */
/* eslint eqeqeq: 0 */
return obj != null && obj == obj.window;
}
function buffer(fn, ms) {
var timer = void 0;
function clear() {
if (timer) {
clearTimeout(timer);
timer = null;
}
}
function bufferFn() {
clear();
timer = setTimeout(fn, ms);
}
bufferFn.clear = clear;
return bufferFn;
}
var propTypes = {
childrenProps: _propTypes2.default.object,
align: _propTypes2.default.object.isRequired,
target: _propTypes2.default.func,
onAlign: _propTypes2.default.func,
monitorBufferTime: _propTypes2.default.number,
monitorWindowResize: _propTypes2.default.bool,
disabled: _propTypes2.default.bool,
children: _propTypes2.default.any
};
var defaultProps = {
target: function target() {
return window;
},
onAlign: function onAlign() {},
monitorBufferTime: 50,
monitorWindowResize: false,
disabled: false
};
var Align = function (_React$Component) {
_inherits(Align, _React$Component);
function Align(props) {
_classCallCheck(this, Align);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
_initialiseProps.call(_this);
return _this;
}
Align.prototype.componentDidMount = function componentDidMount() {
var props = this.props;
// if parent ref not attached .... use document.getElementById
this.forceAlign();
if (!props.disabled && props.monitorWindowResize) {
this.startMonitorWindowResize();
}
};
Align.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
var reAlign = false;
var props = this.props;
if (!props.disabled) {
if (prevProps.disabled || prevProps.align !== props.align) {
reAlign = true;
} else {
var lastTarget = prevProps.target();
var currentTarget = props.target();
if (isWindow(lastTarget) && isWindow(currentTarget)) {
reAlign = false;
} else if (lastTarget !== currentTarget) {
reAlign = true;
}
}
}
if (reAlign) {
this.forceAlign();
}
if (props.monitorWindowResize && !props.disabled) {
this.startMonitorWindowResize();
} else {
this.stopMonitorWindowResize();
}
};
Align.prototype.componentWillUnmount = function componentWillUnmount() {
this.stopMonitorWindowResize();
};
Align.prototype.startMonitorWindowResize = function startMonitorWindowResize() {
if (!this.resizeHandler) {
this.bufferMonitor = buffer(this.forceAlign, this.props.monitorBufferTime);
this.resizeHandler = (0, _addEventListener2.default)(window, 'resize', this.bufferMonitor);
}
};
Align.prototype.render = function render() {
var _props = this.props,
childrenProps = _props.childrenProps,
children = _props.children;
var child = _react2.default.Children.only(children);
if (childrenProps) {
var newProps = {};
for (var prop in childrenProps) {
if (childrenProps.hasOwnProperty(prop)) {
newProps[prop] = this.props[childrenProps[prop]];
}
}
return _react2.default.cloneElement(child, newProps);
}
return child;
};
return Align;
}(_react2.default.Component);
var _initialiseProps = function _initialiseProps() {
var _this2 = this;
this.stopMonitorWindowResize = function () {
if (_this2.resizeHandler) {
_this2.bufferMonitor.clear();
_this2.resizeHandler.remove();
_this2.resizeHandler = null;
}
};
this.forceAlign = function () {
var props = _this2.props;
if (!props.disabled) {
var source = _reactDom2.default.findDOMNode(_this2);
props.onAlign(source, (0, _domAlign2.default)(source, props.target(), props.align));
}
};
};
;
Align.defaultProps = defaultProps;
Align.propTypes = propTypes;
exports.default = Align;
/***/ }),
/* 85 */
/***/ (function(module, exports, __webpack_require__) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
'use strict';
var React = __webpack_require__(4);
var factory = __webpack_require__(86);
if (typeof React === 'undefined') {
throw Error(
'create-react-class could not find the React object. If you are using script tags, ' +
'make sure that React is being loaded before create-react-class.'
);
}
// Hack to grab NoopUpdateQueue from isomorphic React
var ReactNoopUpdateQueue = new React.Component().updater;
module.exports = factory(
React.Component,
React.isValidElement,
ReactNoopUpdateQueue
);
/***/ }),
/* 86 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
'use strict';
var _assign = __webpack_require__(78);
var emptyObject = __webpack_require__(87);
var _invariant = __webpack_require__(88);
if (process.env.NODE_ENV !== 'production') {
var warning = __webpack_require__(89);
}
var MIXINS_KEY = 'mixins';
// Helper function to allow the creation of anonymous functions which do not
// have .name set to the name of the variable being assigned to.
function identity(fn) {
return fn;
}
var ReactPropTypeLocationNames;
if (process.env.NODE_ENV !== 'production') {
ReactPropTypeLocationNames = {
prop: 'prop',
context: 'context',
childContext: 'child context'
};
} else {
ReactPropTypeLocationNames = {};
}
function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
/**
* Policies that describe methods in `ReactClassInterface`.
*/
var injectedMixins = [];
/**
* Composite components are higher-level components that compose other composite
* or host components.
*
* To create a new type of `ReactClass`, pass a specification of
* your new class to `React.createClass`. The only requirement of your class
* specification is that you implement a `render` method.
*
* var MyComponent = React.createClass({
* render: function() {
* return Hello World
;
* }
* });
*
* The class specification supports a specific protocol of methods that have
* special meaning (e.g. `render`). See `ReactClassInterface` for
* more the comprehensive protocol. Any other properties and methods in the
* class specification will be available on the prototype.
*
* @interface ReactClassInterface
* @internal
*/
var ReactClassInterface = {
/**
* An array of Mixin objects to include when defining your component.
*
* @type {array}
* @optional
*/
mixins: 'DEFINE_MANY',
/**
* An object containing properties and methods that should be defined on
* the component's constructor instead of its prototype (static methods).
*
* @type {object}
* @optional
*/
statics: 'DEFINE_MANY',
/**
* Definition of prop types for this component.
*
* @type {object}
* @optional
*/
propTypes: 'DEFINE_MANY',
/**
* Definition of context types for this component.
*
* @type {object}
* @optional
*/
contextTypes: 'DEFINE_MANY',
/**
* Definition of context types this component sets for its children.
*
* @type {object}
* @optional
*/
childContextTypes: 'DEFINE_MANY',
// ==== Definition methods ====
/**
* Invoked when the component is mounted. Values in the mapping will be set on
* `this.props` if that prop is not specified (i.e. using an `in` check).
*
* This method is invoked before `getInitialState` and therefore cannot rely
* on `this.state` or use `this.setState`.
*
* @return {object}
* @optional
*/
getDefaultProps: 'DEFINE_MANY_MERGED',
/**
* Invoked once before the component is mounted. The return value will be used
* as the initial value of `this.state`.
*
* getInitialState: function() {
* return {
* isOn: false,
* fooBaz: new BazFoo()
* }
* }
*
* @return {object}
* @optional
*/
getInitialState: 'DEFINE_MANY_MERGED',
/**
* @return {object}
* @optional
*/
getChildContext: 'DEFINE_MANY_MERGED',
/**
* Uses props from `this.props` and state from `this.state` to render the
* structure of the component.
*
* No guarantees are made about when or how often this method is invoked, so
* it must not have side effects.
*
* render: function() {
* var name = this.props.name;
* return Hello, {name}!
;
* }
*
* @return {ReactComponent}
* @required
*/
render: 'DEFINE_ONCE',
// ==== Delegate methods ====
/**
* Invoked when the component is initially created and about to be mounted.
* This may have side effects, but any external subscriptions or data created
* by this method must be cleaned up in `componentWillUnmount`.
*
* @optional
*/
componentWillMount: 'DEFINE_MANY',
/**
* Invoked when the component has been mounted and has a DOM representation.
* However, there is no guarantee that the DOM node is in the document.
*
* Use this as an opportunity to operate on the DOM when the component has
* been mounted (initialized and rendered) for the first time.
*
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidMount: 'DEFINE_MANY',
/**
* Invoked before the component receives new props.
*
* Use this as an opportunity to react to a prop transition by updating the
* state using `this.setState`. Current props are accessed via `this.props`.
*
* componentWillReceiveProps: function(nextProps, nextContext) {
* this.setState({
* likesIncreasing: nextProps.likeCount > this.props.likeCount
* });
* }
*
* NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
* transition may cause a state change, but the opposite is not true. If you
* need it, you are probably looking for `componentWillUpdate`.
*
* @param {object} nextProps
* @optional
*/
componentWillReceiveProps: 'DEFINE_MANY',
/**
* Invoked while deciding if the component should be updated as a result of
* receiving new props, state and/or context.
*
* Use this as an opportunity to `return false` when you're certain that the
* transition to the new props/state/context will not require a component
* update.
*
* shouldComponentUpdate: function(nextProps, nextState, nextContext) {
* return !equal(nextProps, this.props) ||
* !equal(nextState, this.state) ||
* !equal(nextContext, this.context);
* }
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @return {boolean} True if the component should update.
* @optional
*/
shouldComponentUpdate: 'DEFINE_ONCE',
/**
* Invoked when the component is about to update due to a transition from
* `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
* and `nextContext`.
*
* Use this as an opportunity to perform preparation before an update occurs.
*
* NOTE: You **cannot** use `this.setState()` in this method.
*
* @param {object} nextProps
* @param {?object} nextState
* @param {?object} nextContext
* @param {ReactReconcileTransaction} transaction
* @optional
*/
componentWillUpdate: 'DEFINE_MANY',
/**
* Invoked when the component's DOM representation has been updated.
*
* Use this as an opportunity to operate on the DOM when the component has
* been updated.
*
* @param {object} prevProps
* @param {?object} prevState
* @param {?object} prevContext
* @param {DOMElement} rootNode DOM element representing the component.
* @optional
*/
componentDidUpdate: 'DEFINE_MANY',
/**
* Invoked when the component is about to be removed from its parent and have
* its DOM representation destroyed.
*
* Use this as an opportunity to deallocate any external resources.
*
* NOTE: There is no `componentDidUnmount` since your component will have been
* destroyed by that point.
*
* @optional
*/
componentWillUnmount: 'DEFINE_MANY',
// ==== Advanced methods ====
/**
* Updates the component's currently mounted DOM representation.
*
* By default, this implements React's rendering and reconciliation algorithm.
* Sophisticated clients may wish to override this.
*
* @param {ReactReconcileTransaction} transaction
* @internal
* @overridable
*/
updateComponent: 'OVERRIDE_BASE'
};
/**
* Mapping from class specification keys to special processing functions.
*
* Although these are declared like instance properties in the specification
* when defining classes using `React.createClass`, they are actually static
* and are accessible on the constructor instead of the prototype. Despite
* being static, they must be defined outside of the "statics" key under
* which all other static methods are defined.
*/
var RESERVED_SPEC_KEYS = {
displayName: function(Constructor, displayName) {
Constructor.displayName = displayName;
},
mixins: function(Constructor, mixins) {
if (mixins) {
for (var i = 0; i < mixins.length; i++) {
mixSpecIntoComponent(Constructor, mixins[i]);
}
}
},
childContextTypes: function(Constructor, childContextTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, childContextTypes, 'childContext');
}
Constructor.childContextTypes = _assign(
{},
Constructor.childContextTypes,
childContextTypes
);
},
contextTypes: function(Constructor, contextTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, contextTypes, 'context');
}
Constructor.contextTypes = _assign(
{},
Constructor.contextTypes,
contextTypes
);
},
/**
* Special case getDefaultProps which should move into statics but requires
* automatic merging.
*/
getDefaultProps: function(Constructor, getDefaultProps) {
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps = createMergedResultFunction(
Constructor.getDefaultProps,
getDefaultProps
);
} else {
Constructor.getDefaultProps = getDefaultProps;
}
},
propTypes: function(Constructor, propTypes) {
if (process.env.NODE_ENV !== 'production') {
validateTypeDef(Constructor, propTypes, 'prop');
}
Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
},
statics: function(Constructor, statics) {
mixStaticSpecIntoComponent(Constructor, statics);
},
autobind: function() {}
};
function validateTypeDef(Constructor, typeDef, location) {
for (var propName in typeDef) {
if (typeDef.hasOwnProperty(propName)) {
// use a warning instead of an _invariant so components
// don't show up in prod but only in __DEV__
if (process.env.NODE_ENV !== 'production') {
warning(
typeof typeDef[propName] === 'function',
'%s: %s type `%s` is invalid; it must be a function, usually from ' +
'React.PropTypes.',
Constructor.displayName || 'ReactClass',
ReactPropTypeLocationNames[location],
propName
);
}
}
}
}
function validateMethodOverride(isAlreadyDefined, name) {
var specPolicy = ReactClassInterface.hasOwnProperty(name)
? ReactClassInterface[name]
: null;
// Disallow overriding of base class methods unless explicitly allowed.
if (ReactClassMixin.hasOwnProperty(name)) {
_invariant(
specPolicy === 'OVERRIDE_BASE',
'ReactClassInterface: You are attempting to override ' +
'`%s` from your class specification. Ensure that your method names ' +
'do not overlap with React methods.',
name
);
}
// Disallow defining methods more than once unless explicitly allowed.
if (isAlreadyDefined) {
_invariant(
specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED',
'ReactClassInterface: You are attempting to define ' +
'`%s` on your component more than once. This conflict may be due ' +
'to a mixin.',
name
);
}
}
/**
* Mixin helper which handles policy validation and reserved
* specification keys when building React classes.
*/
function mixSpecIntoComponent(Constructor, spec) {
if (!spec) {
if (process.env.NODE_ENV !== 'production') {
var typeofSpec = typeof spec;
var isMixinValid = typeofSpec === 'object' && spec !== null;
if (process.env.NODE_ENV !== 'production') {
warning(
isMixinValid,
"%s: You're attempting to include a mixin that is either null " +
'or not an object. Check the mixins included by the component, ' +
'as well as any mixins they include themselves. ' +
'Expected object but got %s.',
Constructor.displayName || 'ReactClass',
spec === null ? null : typeofSpec
);
}
}
return;
}
_invariant(
typeof spec !== 'function',
"ReactClass: You're attempting to " +
'use a component class or function as a mixin. Instead, just use a ' +
'regular object.'
);
_invariant(
!isValidElement(spec),
"ReactClass: You're attempting to " +
'use a component as a mixin. Instead, just use a regular object.'
);
var proto = Constructor.prototype;
var autoBindPairs = proto.__reactAutoBindPairs;
// By handling mixins before any other properties, we ensure the same
// chaining order is applied to methods with DEFINE_MANY policy, whether
// mixins are listed before or after these methods in the spec.
if (spec.hasOwnProperty(MIXINS_KEY)) {
RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
}
for (var name in spec) {
if (!spec.hasOwnProperty(name)) {
continue;
}
if (name === MIXINS_KEY) {
// We have already handled mixins in a special case above.
continue;
}
var property = spec[name];
var isAlreadyDefined = proto.hasOwnProperty(name);
validateMethodOverride(isAlreadyDefined, name);
if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
RESERVED_SPEC_KEYS[name](Constructor, property);
} else {
// Setup methods on prototype:
// The following member methods should not be automatically bound:
// 1. Expected ReactClass methods (in the "interface").
// 2. Overridden methods (that were mixed in).
var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
var isFunction = typeof property === 'function';
var shouldAutoBind =
isFunction &&
!isReactClassMethod &&
!isAlreadyDefined &&
spec.autobind !== false;
if (shouldAutoBind) {
autoBindPairs.push(name, property);
proto[name] = property;
} else {
if (isAlreadyDefined) {
var specPolicy = ReactClassInterface[name];
// These cases should already be caught by validateMethodOverride.
_invariant(
isReactClassMethod &&
(specPolicy === 'DEFINE_MANY_MERGED' ||
specPolicy === 'DEFINE_MANY'),
'ReactClass: Unexpected spec policy %s for key %s ' +
'when mixing in component specs.',
specPolicy,
name
);
// For methods which are defined more than once, call the existing
// methods before calling the new property, merging if appropriate.
if (specPolicy === 'DEFINE_MANY_MERGED') {
proto[name] = createMergedResultFunction(proto[name], property);
} else if (specPolicy === 'DEFINE_MANY') {
proto[name] = createChainedFunction(proto[name], property);
}
} else {
proto[name] = property;
if (process.env.NODE_ENV !== 'production') {
// Add verbose displayName to the function, which helps when looking
// at profiling tools.
if (typeof property === 'function' && spec.displayName) {
proto[name].displayName = spec.displayName + '_' + name;
}
}
}
}
}
}
}
function mixStaticSpecIntoComponent(Constructor, statics) {
if (!statics) {
return;
}
for (var name in statics) {
var property = statics[name];
if (!statics.hasOwnProperty(name)) {
continue;
}
var isReserved = name in RESERVED_SPEC_KEYS;
_invariant(
!isReserved,
'ReactClass: You are attempting to define a reserved ' +
'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' +
'as an instance property instead; it will still be accessible on the ' +
'constructor.',
name
);
var isInherited = name in Constructor;
_invariant(
!isInherited,
'ReactClass: You are attempting to define ' +
'`%s` on your component more than once. This conflict may be ' +
'due to a mixin.',
name
);
Constructor[name] = property;
}
}
/**
* Merge two objects, but throw if both contain the same key.
*
* @param {object} one The first object, which is mutated.
* @param {object} two The second object
* @return {object} one after it has been mutated to contain everything in two.
*/
function mergeIntoWithNoDuplicateKeys(one, two) {
_invariant(
one && two && typeof one === 'object' && typeof two === 'object',
'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'
);
for (var key in two) {
if (two.hasOwnProperty(key)) {
_invariant(
one[key] === undefined,
'mergeIntoWithNoDuplicateKeys(): ' +
'Tried to merge two objects with the same key: `%s`. This conflict ' +
'may be due to a mixin; in particular, this may be caused by two ' +
'getInitialState() or getDefaultProps() methods returning objects ' +
'with clashing keys.',
key
);
one[key] = two[key];
}
}
return one;
}
/**
* Creates a function that invokes two functions and merges their return values.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createMergedResultFunction(one, two) {
return function mergedResult() {
var a = one.apply(this, arguments);
var b = two.apply(this, arguments);
if (a == null) {
return b;
} else if (b == null) {
return a;
}
var c = {};
mergeIntoWithNoDuplicateKeys(c, a);
mergeIntoWithNoDuplicateKeys(c, b);
return c;
};
}
/**
* Creates a function that invokes two functions and ignores their return vales.
*
* @param {function} one Function to invoke first.
* @param {function} two Function to invoke second.
* @return {function} Function that invokes the two argument functions.
* @private
*/
function createChainedFunction(one, two) {
return function chainedFunction() {
one.apply(this, arguments);
two.apply(this, arguments);
};
}
/**
* Binds a method to the component.
*
* @param {object} component Component whose method is going to be bound.
* @param {function} method Method to be bound.
* @return {function} The bound method.
*/
function bindAutoBindMethod(component, method) {
var boundMethod = method.bind(component);
if (process.env.NODE_ENV !== 'production') {
boundMethod.__reactBoundContext = component;
boundMethod.__reactBoundMethod = method;
boundMethod.__reactBoundArguments = null;
var componentName = component.constructor.displayName;
var _bind = boundMethod.bind;
boundMethod.bind = function(newThis) {
for (
var _len = arguments.length,
args = Array(_len > 1 ? _len - 1 : 0),
_key = 1;
_key < _len;
_key++
) {
args[_key - 1] = arguments[_key];
}
// User is trying to bind() an autobound method; we effectively will
// ignore the value of "this" that the user is trying to use, so
// let's warn.
if (newThis !== component && newThis !== null) {
if (process.env.NODE_ENV !== 'production') {
warning(
false,
'bind(): React component methods may only be bound to the ' +
'component instance. See %s',
componentName
);
}
} else if (!args.length) {
if (process.env.NODE_ENV !== 'production') {
warning(
false,
'bind(): You are binding a component method to the component. ' +
'React does this for you automatically in a high-performance ' +
'way, so you can safely remove this call. See %s',
componentName
);
}
return boundMethod;
}
var reboundMethod = _bind.apply(boundMethod, arguments);
reboundMethod.__reactBoundContext = component;
reboundMethod.__reactBoundMethod = method;
reboundMethod.__reactBoundArguments = args;
return reboundMethod;
};
}
return boundMethod;
}
/**
* Binds all auto-bound methods in a component.
*
* @param {object} component Component whose method is going to be bound.
*/
function bindAutoBindMethods(component) {
var pairs = component.__reactAutoBindPairs;
for (var i = 0; i < pairs.length; i += 2) {
var autoBindKey = pairs[i];
var method = pairs[i + 1];
component[autoBindKey] = bindAutoBindMethod(component, method);
}
}
var IsMountedPreMixin = {
componentDidMount: function() {
this.__isMounted = true;
}
};
var IsMountedPostMixin = {
componentWillUnmount: function() {
this.__isMounted = false;
}
};
/**
* Add more to the ReactClass base class. These are all legacy features and
* therefore not already part of the modern ReactComponent.
*/
var ReactClassMixin = {
/**
* TODO: This will be deprecated because state should always keep a consistent
* type signature and the only use case for this, is to avoid that.
*/
replaceState: function(newState, callback) {
this.updater.enqueueReplaceState(this, newState, callback);
},
/**
* Checks whether or not this composite component is mounted.
* @return {boolean} True if mounted, false otherwise.
* @protected
* @final
*/
isMounted: function() {
if (process.env.NODE_ENV !== 'production') {
warning(
this.__didWarnIsMounted,
'%s: isMounted is deprecated. Instead, make sure to clean up ' +
'subscriptions and pending requests in componentWillUnmount to ' +
'prevent memory leaks.',
(this.constructor && this.constructor.displayName) ||
this.name ||
'Component'
);
this.__didWarnIsMounted = true;
}
return !!this.__isMounted;
}
};
var ReactClassComponent = function() {};
_assign(
ReactClassComponent.prototype,
ReactComponent.prototype,
ReactClassMixin
);
/**
* Creates a composite component class given a class specification.
* See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
*
* @param {object} spec Class specification (which must define `render`).
* @return {function} Component constructor function.
* @public
*/
function createClass(spec) {
// To keep our warnings more understandable, we'll use a little hack here to
// ensure that Constructor.name !== 'Constructor'. This makes sure we don't
// unnecessarily identify a class without displayName as 'Constructor'.
var Constructor = identity(function(props, context, updater) {
// This constructor gets overridden by mocks. The argument is used
// by mocks to assert on what gets mounted.
if (process.env.NODE_ENV !== 'production') {
warning(
this instanceof Constructor,
'Something is calling a React component directly. Use a factory or ' +
'JSX instead. See: https://fb.me/react-legacyfactory'
);
}
// Wire up auto-binding
if (this.__reactAutoBindPairs.length) {
bindAutoBindMethods(this);
}
this.props = props;
this.context = context;
this.refs = emptyObject;
this.updater = updater || ReactNoopUpdateQueue;
this.state = null;
// ReactClasses doesn't have constructors. Instead, they use the
// getInitialState and componentWillMount methods for initialization.
var initialState = this.getInitialState ? this.getInitialState() : null;
if (process.env.NODE_ENV !== 'production') {
// We allow auto-mocks to proceed as if they're returning null.
if (
initialState === undefined &&
this.getInitialState._isMockFunction
) {
// This is probably bad practice. Consider warning here and
// deprecating this convenience.
initialState = null;
}
}
_invariant(
typeof initialState === 'object' && !Array.isArray(initialState),
'%s.getInitialState(): must return an object or null',
Constructor.displayName || 'ReactCompositeComponent'
);
this.state = initialState;
});
Constructor.prototype = new ReactClassComponent();
Constructor.prototype.constructor = Constructor;
Constructor.prototype.__reactAutoBindPairs = [];
injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
mixSpecIntoComponent(Constructor, IsMountedPreMixin);
mixSpecIntoComponent(Constructor, spec);
mixSpecIntoComponent(Constructor, IsMountedPostMixin);
// Initialize the defaultProps property after all mixins have been merged.
if (Constructor.getDefaultProps) {
Constructor.defaultProps = Constructor.getDefaultProps();
}
if (process.env.NODE_ENV !== 'production') {
// This is a tag to indicate that the use of these method names is ok,
// since it's used with createClass. If it's not, then it's likely a
// mistake so we'll warn you to use the static property, property
// initializer or constructor respectively.
if (Constructor.getDefaultProps) {
Constructor.getDefaultProps.isReactClassApproved = {};
}
if (Constructor.prototype.getInitialState) {
Constructor.prototype.getInitialState.isReactClassApproved = {};
}
}
_invariant(
Constructor.prototype.render,
'createClass(...): Class specification must implement a `render` method.'
);
if (process.env.NODE_ENV !== 'production') {
warning(
!Constructor.prototype.componentShouldUpdate,
'%s has a method called ' +
'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +
'The name is phrased as a question because the function is ' +
'expected to return a value.',
spec.displayName || 'A component'
);
warning(
!Constructor.prototype.componentWillRecieveProps,
'%s has a method called ' +
'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',
spec.displayName || 'A component'
);
}
// Reduce time spent doing lookups by setting these on the prototype.
for (var methodName in ReactClassInterface) {
if (!Constructor.prototype[methodName]) {
Constructor.prototype[methodName] = null;
}
}
return Constructor;
}
return createClass;
}
module.exports = factory;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(32)))
/***/ }),
/* 87 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
'use strict';
var emptyObject = {};
if (process.env.NODE_ENV !== 'production') {
Object.freeze(emptyObject);
}
module.exports = emptyObject;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(32)))
/***/ }),
/* 88 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
'use strict';
/**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
* to provide information about what broke and what you were
* expecting.
*
* The invariant message will be stripped in production, but the invariant
* will remain to ensure logic does not differ in production.
*/
var validateFormat = function validateFormat(format) {};
if (process.env.NODE_ENV !== 'production') {
validateFormat = function validateFormat(format) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
};
}
function invariant(condition, format, a, b, c, d, e, f) {
validateFormat(format);
if (!condition) {
var error;
if (format === undefined) {
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
} else {
var args = [a, b, c, d, e, f];
var argIndex = 0;
error = new Error(format.replace(/%s/g, function () {
return args[argIndex++];
}));
error.name = 'Invariant Violation';
}
error.framesToPop = 1; // we don't care about invariant's own frame
throw error;
}
}
module.exports = invariant;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(32)))
/***/ }),
/* 89 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
'use strict';
var emptyFunction = __webpack_require__(90);
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
var warning = emptyFunction;
if (process.env.NODE_ENV !== 'production') {
var printWarning = function printWarning(format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var argIndex = 0;
var message = 'Warning: ' + format.replace(/%s/g, function () {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
// --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
} catch (x) {}
};
warning = function warning(condition, format) {
if (format === undefined) {
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
}
if (format.indexOf('Failed Composite propType: ') === 0) {
return; // Ignore CompositeComponent proptype check.
}
if (!condition) {
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
args[_key2 - 2] = arguments[_key2];
}
printWarning.apply(undefined, [format].concat(args));
}
};
}
module.exports = warning;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(32)))
/***/ }),
/* 90 */
/***/ (function(module, exports) {
"use strict";
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
function makeEmptyFunction(arg) {
return function () {
return arg;
};
}
/**
* This function accepts and discards inputs; it has no side effects. This is
* primarily useful idiomatically for overridable function endpoints which
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
*/
var emptyFunction = function emptyFunction() {};
emptyFunction.thatReturns = makeEmptyFunction;
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
emptyFunction.thatReturnsThis = function () {
return this;
};
emptyFunction.thatReturnsArgument = function (arg) {
return arg;
};
module.exports = emptyFunction;
/***/ }),
/* 91 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _utils = __webpack_require__(92);
var _utils2 = _interopRequireDefault(_utils);
var _getOffsetParent = __webpack_require__(94);
var _getOffsetParent2 = _interopRequireDefault(_getOffsetParent);
var _getVisibleRectForElement = __webpack_require__(95);
var _getVisibleRectForElement2 = _interopRequireDefault(_getVisibleRectForElement);
var _adjustForViewport = __webpack_require__(97);
var _adjustForViewport2 = _interopRequireDefault(_adjustForViewport);
var _getRegion = __webpack_require__(98);
var _getRegion2 = _interopRequireDefault(_getRegion);
var _getElFuturePos = __webpack_require__(99);
var _getElFuturePos2 = _interopRequireDefault(_getElFuturePos);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
// http://yiminghe.iteye.com/blog/1124720
/**
* align dom node flexibly
* @author yiminghe@gmail.com
*/
function isFailX(elFuturePos, elRegion, visibleRect) {
return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;
}
function isFailY(elFuturePos, elRegion, visibleRect) {
return elFuturePos.top < visibleRect.top || elFuturePos.top + elRegion.height > visibleRect.bottom;
}
function isCompleteFailX(elFuturePos, elRegion, visibleRect) {
return elFuturePos.left > visibleRect.right || elFuturePos.left + elRegion.width < visibleRect.left;
}
function isCompleteFailY(elFuturePos, elRegion, visibleRect) {
return elFuturePos.top > visibleRect.bottom || elFuturePos.top + elRegion.height < visibleRect.top;
}
function isOutOfVisibleRect(target) {
var visibleRect = (0, _getVisibleRectForElement2['default'])(target);
var targetRegion = (0, _getRegion2['default'])(target);
return !visibleRect || targetRegion.left + targetRegion.width <= visibleRect.left || targetRegion.top + targetRegion.height <= visibleRect.top || targetRegion.left >= visibleRect.right || targetRegion.top >= visibleRect.bottom;
}
function flip(points, reg, map) {
var ret = [];
_utils2['default'].each(points, function (p) {
ret.push(p.replace(reg, function (m) {
return map[m];
}));
});
return ret;
}
function flipOffset(offset, index) {
offset[index] = -offset[index];
return offset;
}
function convertOffset(str, offsetLen) {
var n = void 0;
if (/%$/.test(str)) {
n = parseInt(str.substring(0, str.length - 1), 10) / 100 * offsetLen;
} else {
n = parseInt(str, 10);
}
return n || 0;
}
function normalizeOffset(offset, el) {
offset[0] = convertOffset(offset[0], el.width);
offset[1] = convertOffset(offset[1], el.height);
}
function domAlign(el, refNode, align) {
var points = align.points;
var offset = align.offset || [0, 0];
var targetOffset = align.targetOffset || [0, 0];
var overflow = align.overflow;
var target = align.target || refNode;
var source = align.source || el;
offset = [].concat(offset);
targetOffset = [].concat(targetOffset);
overflow = overflow || {};
var newOverflowCfg = {};
var fail = 0;
// 当前节点可以被放置的显示区域
var visibleRect = (0, _getVisibleRectForElement2['default'])(source);
// 当前节点所占的区域, left/top/width/height
var elRegion = (0, _getRegion2['default'])(source);
// 参照节点所占的区域, left/top/width/height
var refNodeRegion = (0, _getRegion2['default'])(target);
// 将 offset 转换成数值,支持百分比
normalizeOffset(offset, elRegion);
normalizeOffset(targetOffset, refNodeRegion);
// 当前节点将要被放置的位置
var elFuturePos = (0, _getElFuturePos2['default'])(elRegion, refNodeRegion, points, offset, targetOffset);
// 当前节点将要所处的区域
var newElRegion = _utils2['default'].merge(elRegion, elFuturePos);
var isTargetNotOutOfVisible = !isOutOfVisibleRect(target);
// 如果可视区域不能完全放置当前节点时允许调整
if (visibleRect && (overflow.adjustX || overflow.adjustY) && isTargetNotOutOfVisible) {
if (overflow.adjustX) {
// 如果横向不能放下
if (isFailX(elFuturePos, elRegion, visibleRect)) {
// 对齐位置反下
var newPoints = flip(points, /[lr]/ig, {
l: 'r',
r: 'l'
});
// 偏移量也反下
var newOffset = flipOffset(offset, 0);
var newTargetOffset = flipOffset(targetOffset, 0);
var newElFuturePos = (0, _getElFuturePos2['default'])(elRegion, refNodeRegion, newPoints, newOffset, newTargetOffset);
if (!isCompleteFailX(newElFuturePos, elRegion, visibleRect)) {
fail = 1;
points = newPoints;
offset = newOffset;
targetOffset = newTargetOffset;
}
}
}
if (overflow.adjustY) {
// 如果纵向不能放下
if (isFailY(elFuturePos, elRegion, visibleRect)) {
// 对齐位置反下
var _newPoints = flip(points, /[tb]/ig, {
t: 'b',
b: 't'
});
// 偏移量也反下
var _newOffset = flipOffset(offset, 1);
var _newTargetOffset = flipOffset(targetOffset, 1);
var _newElFuturePos = (0, _getElFuturePos2['default'])(elRegion, refNodeRegion, _newPoints, _newOffset, _newTargetOffset);
if (!isCompleteFailY(_newElFuturePos, elRegion, visibleRect)) {
fail = 1;
points = _newPoints;
offset = _newOffset;
targetOffset = _newTargetOffset;
}
}
}
// 如果失败,重新计算当前节点将要被放置的位置
if (fail) {
elFuturePos = (0, _getElFuturePos2['default'])(elRegion, refNodeRegion, points, offset, targetOffset);
_utils2['default'].mix(newElRegion, elFuturePos);
}
// 检查反下后的位置是否可以放下了
// 如果仍然放不下只有指定了可以调整当前方向才调整
newOverflowCfg.adjustX = overflow.adjustX && isFailX(elFuturePos, elRegion, visibleRect);
newOverflowCfg.adjustY = overflow.adjustY && isFailY(elFuturePos, elRegion, visibleRect);
// 确实要调整,甚至可能会调整高度宽度
if (newOverflowCfg.adjustX || newOverflowCfg.adjustY) {
newElRegion = (0, _adjustForViewport2['default'])(elFuturePos, elRegion, visibleRect, newOverflowCfg);
}
}
// need judge to in case set fixed with in css on height auto element
if (newElRegion.width !== elRegion.width) {
_utils2['default'].css(source, 'width', _utils2['default'].width(source) + newElRegion.width - elRegion.width);
}
if (newElRegion.height !== elRegion.height) {
_utils2['default'].css(source, 'height', _utils2['default'].height(source) + newElRegion.height - elRegion.height);
}
// https://github.com/kissyteam/kissy/issues/190
// 相对于屏幕位置没变,而 left/top 变了
// 例如
_utils2['default'].offset(source, {
left: newElRegion.left,
top: newElRegion.top
}, {
useCssRight: align.useCssRight,
useCssBottom: align.useCssBottom,
useCssTransform: align.useCssTransform
});
return {
points: points,
offset: offset,
targetOffset: targetOffset,
overflow: newOverflowCfg
};
}
domAlign.__getOffsetParent = _getOffsetParent2['default'];
domAlign.__getVisibleRectForElement = _getVisibleRectForElement2['default'];
exports['default'] = domAlign;
/**
* 2012-04-26 yiminghe@gmail.com
* - 优化智能对齐算法
* - 慎用 resizeXX
*
* 2011-07-13 yiminghe@gmail.com note:
* - 增加智能对齐,以及大小调整选项
**/
module.exports = exports['default'];
/***/ }),
/* 92 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _propertyUtils = __webpack_require__(93);
var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
var getComputedStyleX = void 0;
// https://stackoverflow.com/a/3485654/3040605
function forceRelayout(elem) {
var originalStyle = elem.style.display;
elem.style.display = 'none';
elem.offsetHeight; // eslint-disable-line
elem.style.display = originalStyle;
}
function css(el, name, v) {
var value = v;
if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
for (var i in name) {
if (name.hasOwnProperty(i)) {
css(el, i, name[i]);
}
}
return undefined;
}
if (typeof value !== 'undefined') {
if (typeof value === 'number') {
value = value + 'px';
}
el.style[name] = value;
return undefined;
}
return getComputedStyleX(el, name);
}
function getClientPosition(elem) {
var box = void 0;
var x = void 0;
var y = void 0;
var doc = elem.ownerDocument;
var body = doc.body;
var docElem = doc && doc.documentElement;
// 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式
box = elem.getBoundingClientRect();
// 注:jQuery 还考虑减去 docElem.clientLeft/clientTop
// 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确
// 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin
x = box.left;
y = box.top;
// In IE, most of the time, 2 extra pixels are added to the top and left
// due to the implicit 2-pixel inset border. In IE6/7 quirks mode and
// IE6 standards mode, this border can be overridden by setting the
// document element's border to zero -- thus, we cannot rely on the
// offset always being 2 pixels.
// In quirks mode, the offset can be determined by querying the body's
// clientLeft/clientTop, but in standards mode, it is found by querying
// the document element's clientLeft/clientTop. Since we already called
// getClientBoundingRect we have already forced a reflow, so it is not
// too expensive just to query them all.
// ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的
// 窗口边框标准是设 documentElement ,quirks 时设置 body
// 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去
// 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置
// 标准 ie 下 docElem.clientTop 就是 border-top
// ie7 html 即窗口边框改变不了。永远为 2
// 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0
x -= docElem.clientLeft || body.clientLeft || 0;
y -= docElem.clientTop || body.clientTop || 0;
return {
left: x,
top: y
};
}
function getScroll(w, top) {
var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];
var method = 'scroll' + (top ? 'Top' : 'Left');
if (typeof ret !== 'number') {
var d = w.document;
// ie6,7,8 standard mode
ret = d.documentElement[method];
if (typeof ret !== 'number') {
// quirks mode
ret = d.body[method];
}
}
return ret;
}
function getScrollLeft(w) {
return getScroll(w);
}
function getScrollTop(w) {
return getScroll(w, true);
}
function getOffset(el) {
var pos = getClientPosition(el);
var doc = el.ownerDocument;
var w = doc.defaultView || doc.parentWindow;
pos.left += getScrollLeft(w);
pos.top += getScrollTop(w);
return pos;
}
/**
* A crude way of determining if an object is a window
* @member util
*/
function isWindow(obj) {
// must use == for ie8
/* eslint eqeqeq:0 */
return obj !== null && obj !== undefined && obj == obj.window;
}
function getDocument(node) {
if (isWindow(node)) {
return node.document;
}
if (node.nodeType === 9) {
return node;
}
return node.ownerDocument;
}
function _getComputedStyle(elem, name, cs) {
var computedStyle = cs;
var val = '';
var d = getDocument(elem);
computedStyle = computedStyle || d.defaultView.getComputedStyle(elem, null);
// https://github.com/kissyteam/kissy/issues/61
if (computedStyle) {
val = computedStyle.getPropertyValue(name) || computedStyle[name];
}
return val;
}
var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');
var RE_POS = /^(top|right|bottom|left)$/;
var CURRENT_STYLE = 'currentStyle';
var RUNTIME_STYLE = 'runtimeStyle';
var LEFT = 'left';
var PX = 'px';
function _getComputedStyleIE(elem, name) {
// currentStyle maybe null
// http://msdn.microsoft.com/en-us/library/ms535231.aspx
var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];
// 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值
// 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19
// 在 ie 下不对,需要直接用 offset 方式
// borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
// exclude left right for relativity
if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
// Remember the original values
var style = elem.style;
var left = style[LEFT];
var rsLeft = elem[RUNTIME_STYLE][LEFT];
// prevent flashing of content
elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];
// Put in the new values to get a computed value out
style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;
ret = style.pixelLeft + PX;
// Revert the changed values
style[LEFT] = left;
elem[RUNTIME_STYLE][LEFT] = rsLeft;
}
return ret === '' ? 'auto' : ret;
}
if (typeof window !== 'undefined') {
getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
}
function getOffsetDirection(dir, option) {
if (dir === 'left') {
return option.useCssRight ? 'right' : dir;
}
return option.useCssBottom ? 'bottom' : dir;
}
function oppositeOffsetDirection(dir) {
if (dir === 'left') {
return 'right';
} else if (dir === 'right') {
return 'left';
} else if (dir === 'top') {
return 'bottom';
} else if (dir === 'bottom') {
return 'top';
}
}
// 设置 elem 相对 elem.ownerDocument 的坐标
function setLeftTop(elem, offset, option) {
// set position first, in-case top/left are set even on static elem
if (css(elem, 'position') === 'static') {
elem.style.position = 'relative';
}
var presetH = -999;
var presetV = -999;
var horizontalProperty = getOffsetDirection('left', option);
var verticalProperty = getOffsetDirection('top', option);
var oppositeHorizontalProperty = oppositeOffsetDirection(horizontalProperty);
var oppositeVerticalProperty = oppositeOffsetDirection(verticalProperty);
if (horizontalProperty !== 'left') {
presetH = 999;
}
if (verticalProperty !== 'top') {
presetV = 999;
}
var originalTransition = '';
var originalOffset = getOffset(elem);
if ('left' in offset || 'top' in offset) {
originalTransition = (0, _propertyUtils.getTransitionProperty)(elem) || '';
(0, _propertyUtils.setTransitionProperty)(elem, 'none');
}
if ('left' in offset) {
elem.style[oppositeHorizontalProperty] = '';
elem.style[horizontalProperty] = presetH + 'px';
}
if ('top' in offset) {
elem.style[oppositeVerticalProperty] = '';
elem.style[verticalProperty] = presetV + 'px';
}
// force relayout
forceRelayout(elem);
var old = getOffset(elem);
var originalStyle = {};
for (var key in offset) {
if (offset.hasOwnProperty(key)) {
var dir = getOffsetDirection(key, option);
var preset = key === 'left' ? presetH : presetV;
var off = originalOffset[key] - old[key];
if (dir === key) {
originalStyle[dir] = preset + off;
} else {
originalStyle[dir] = preset - off;
}
}
}
css(elem, originalStyle);
// force relayout
forceRelayout(elem);
if ('left' in offset || 'top' in offset) {
(0, _propertyUtils.setTransitionProperty)(elem, originalTransition);
}
var ret = {};
for (var _key in offset) {
if (offset.hasOwnProperty(_key)) {
var _dir = getOffsetDirection(_key, option);
var _off = offset[_key] - originalOffset[_key];
if (_key === _dir) {
ret[_dir] = originalStyle[_dir] + _off;
} else {
ret[_dir] = originalStyle[_dir] - _off;
}
}
}
css(elem, ret);
}
function setTransform(elem, offset) {
var originalOffset = getOffset(elem);
var originalXY = (0, _propertyUtils.getTransformXY)(elem);
var resultXY = { x: originalXY.x, y: originalXY.y };
if ('left' in offset) {
resultXY.x = originalXY.x + offset.left - originalOffset.left;
}
if ('top' in offset) {
resultXY.y = originalXY.y + offset.top - originalOffset.top;
}
(0, _propertyUtils.setTransformXY)(elem, resultXY);
}
function setOffset(elem, offset, option) {
if (option.useCssRight || option.useCssBottom) {
setLeftTop(elem, offset, option);
} else if (option.useCssTransform && (0, _propertyUtils.getTransformName)() in document.body.style) {
setTransform(elem, offset, option);
} else {
setLeftTop(elem, offset, option);
}
}
function each(arr, fn) {
for (var i = 0; i < arr.length; i++) {
fn(arr[i]);
}
}
function isBorderBoxFn(elem) {
return getComputedStyleX(elem, 'boxSizing') === 'border-box';
}
var BOX_MODELS = ['margin', 'border', 'padding'];
var CONTENT_INDEX = -1;
var PADDING_INDEX = 2;
var BORDER_INDEX = 1;
var MARGIN_INDEX = 0;
function swap(elem, options, callback) {
var old = {};
var style = elem.style;
var name = void 0;
// Remember the old values, and insert the new ones
for (name in options) {
if (options.hasOwnProperty(name)) {
old[name] = style[name];
style[name] = options[name];
}
}
callback.call(elem);
// Revert the old values
for (name in options) {
if (options.hasOwnProperty(name)) {
style[name] = old[name];
}
}
}
function getPBMWidth(elem, props, which) {
var value = 0;
var prop = void 0;
var j = void 0;
var i = void 0;
for (j = 0; j < props.length; j++) {
prop = props[j];
if (prop) {
for (i = 0; i < which.length; i++) {
var cssProp = void 0;
if (prop === 'border') {
cssProp = '' + prop + which[i] + 'Width';
} else {
cssProp = prop + which[i];
}
value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
}
}
}
return value;
}
var domUtils = {};
each(['Width', 'Height'], function (name) {
domUtils['doc' + name] = function (refWin) {
var d = refWin.document;
return Math.max(
// firefox chrome documentElement.scrollHeight< body.scrollHeight
// ie standard mode : documentElement.scrollHeight> body.scrollHeight
d.documentElement['scroll' + name],
// quirks : documentElement.scrollHeight 最大等于可视窗口多一点?
d.body['scroll' + name], domUtils['viewport' + name](d));
};
domUtils['viewport' + name] = function (win) {
// pc browser includes scrollbar in window.innerWidth
var prop = 'client' + name;
var doc = win.document;
var body = doc.body;
var documentElement = doc.documentElement;
var documentElementProp = documentElement[prop];
// 标准模式取 documentElement
// backcompat 取 body
return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;
};
});
/*
得到元素的大小信息
@param elem
@param name
@param {String} [extra] 'padding' : (css width) + padding
'border' : (css width) + padding + border
'margin' : (css width) + padding + border + margin
*/
function getWH(elem, name, ex) {
var extra = ex;
if (isWindow(elem)) {
return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);
} else if (elem.nodeType === 9) {
return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);
}
var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
var borderBoxValue = name === 'width' ? elem.getBoundingClientRect().width : elem.getBoundingClientRect().height;
var computedStyle = getComputedStyleX(elem);
var isBorderBox = isBorderBoxFn(elem, computedStyle);
var cssBoxValue = 0;
if (borderBoxValue === null || borderBoxValue === undefined || borderBoxValue <= 0) {
borderBoxValue = undefined;
// Fall back to computed then un computed css if necessary
cssBoxValue = getComputedStyleX(elem, name);
if (cssBoxValue === null || cssBoxValue === undefined || Number(cssBoxValue) < 0) {
cssBoxValue = elem.style[name] || 0;
}
// Normalize '', auto, and prepare for extra
cssBoxValue = parseFloat(cssBoxValue) || 0;
}
if (extra === undefined) {
extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
}
var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;
var val = borderBoxValue || cssBoxValue;
if (extra === CONTENT_INDEX) {
if (borderBoxValueOrIsBorderBox) {
return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);
}
return cssBoxValue;
} else if (borderBoxValueOrIsBorderBox) {
if (extra === BORDER_INDEX) {
return val;
}
return val + (extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle));
}
return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);
}
var cssShow = {
position: 'absolute',
visibility: 'hidden',
display: 'block'
};
// fix #119 : https://github.com/kissyteam/kissy/issues/119
function getWHIgnoreDisplay() {
for (var _len = arguments.length, args = Array(_len), _key2 = 0; _key2 < _len; _key2++) {
args[_key2] = arguments[_key2];
}
var val = void 0;
var elem = args[0];
// in case elem is window
// elem.offsetWidth === undefined
if (elem.offsetWidth !== 0) {
val = getWH.apply(undefined, args);
} else {
swap(elem, cssShow, function () {
val = getWH.apply(undefined, args);
});
}
return val;
}
each(['width', 'height'], function (name) {
var first = name.charAt(0).toUpperCase() + name.slice(1);
domUtils['outer' + first] = function (el, includeMargin) {
return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);
};
var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
domUtils[name] = function (elem, v) {
var val = v;
if (val !== undefined) {
if (elem) {
var computedStyle = getComputedStyleX(elem);
var isBorderBox = isBorderBoxFn(elem);
if (isBorderBox) {
val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);
}
return css(elem, name, val);
}
return undefined;
}
return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);
};
});
function mix(to, from) {
for (var i in from) {
if (from.hasOwnProperty(i)) {
to[i] = from[i];
}
}
return to;
}
var utils = {
getWindow: function getWindow(node) {
if (node && node.document && node.setTimeout) {
return node;
}
var doc = node.ownerDocument || node;
return doc.defaultView || doc.parentWindow;
},
getDocument: getDocument,
offset: function offset(el, value, option) {
if (typeof value !== 'undefined') {
setOffset(el, value, option || {});
} else {
return getOffset(el);
}
},
isWindow: isWindow,
each: each,
css: css,
clone: function clone(obj) {
var i = void 0;
var ret = {};
for (i in obj) {
if (obj.hasOwnProperty(i)) {
ret[i] = obj[i];
}
}
var overflow = obj.overflow;
if (overflow) {
for (i in obj) {
if (obj.hasOwnProperty(i)) {
ret.overflow[i] = obj.overflow[i];
}
}
}
return ret;
},
mix: mix,
getWindowScrollLeft: function getWindowScrollLeft(w) {
return getScrollLeft(w);
},
getWindowScrollTop: function getWindowScrollTop(w) {
return getScrollTop(w);
},
merge: function merge() {
var ret = {};
for (var _len2 = arguments.length, args = Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
args[_key3] = arguments[_key3];
}
for (var i = 0; i < args.length; i++) {
utils.mix(ret, args[i]);
}
return ret;
},
viewportWidth: 0,
viewportHeight: 0
};
mix(utils, domUtils);
exports['default'] = utils;
module.exports = exports['default'];
/***/ }),
/* 93 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getTransformName = getTransformName;
exports.setTransitionProperty = setTransitionProperty;
exports.getTransitionProperty = getTransitionProperty;
exports.getTransformXY = getTransformXY;
exports.setTransformXY = setTransformXY;
var vendorPrefix = void 0;
var jsCssMap = {
Webkit: '-webkit-',
Moz: '-moz-',
// IE did it wrong again ...
ms: '-ms-',
O: '-o-'
};
function getVendorPrefix() {
if (vendorPrefix !== undefined) {
return vendorPrefix;
}
vendorPrefix = '';
var style = document.createElement('p').style;
var testProp = 'Transform';
for (var key in jsCssMap) {
if (key + testProp in style) {
vendorPrefix = key;
}
}
return vendorPrefix;
}
function getTransitionName() {
return getVendorPrefix() ? getVendorPrefix() + 'TransitionProperty' : 'transitionProperty';
}
function getTransformName() {
return getVendorPrefix() ? getVendorPrefix() + 'Transform' : 'transform';
}
function setTransitionProperty(node, value) {
var name = getTransitionName();
if (name) {
node.style[name] = value;
if (name !== 'transitionProperty') {
node.style.transitionProperty = value;
}
}
}
function setTransform(node, value) {
var name = getTransformName();
if (name) {
node.style[name] = value;
if (name !== 'transform') {
node.style.transform = value;
}
}
}
function getTransitionProperty(node) {
return node.style.transitionProperty || node.style[getTransitionName()];
}
function getTransformXY(node) {
var style = window.getComputedStyle(node, null);
var transform = style.getPropertyValue('transform') || style.getPropertyValue(getTransformName());
if (transform && transform !== 'none') {
var matrix = transform.replace(/[^0-9\-.,]/g, '').split(',');
return { x: parseFloat(matrix[12] || matrix[4], 0), y: parseFloat(matrix[13] || matrix[5], 0) };
}
return {
x: 0,
y: 0
};
}
var matrix2d = /matrix\((.*)\)/;
var matrix3d = /matrix3d\((.*)\)/;
function setTransformXY(node, xy) {
var style = window.getComputedStyle(node, null);
var transform = style.getPropertyValue('transform') || style.getPropertyValue(getTransformName());
if (transform && transform !== 'none') {
var arr = void 0;
var match2d = transform.match(matrix2d);
if (match2d) {
match2d = match2d[1];
arr = match2d.split(',').map(function (item) {
return parseFloat(item, 10);
});
arr[4] = xy.x;
arr[5] = xy.y;
setTransform(node, 'matrix(' + arr.join(',') + ')');
} else {
var match3d = transform.match(matrix3d)[1];
arr = match3d.split(',').map(function (item) {
return parseFloat(item, 10);
});
arr[12] = xy.x;
arr[13] = xy.y;
setTransform(node, 'matrix3d(' + arr.join(',') + ')');
}
} else {
setTransform(node, 'translateX(' + xy.x + 'px) translateY(' + xy.y + 'px) translateZ(0)');
}
}
/***/ }),
/* 94 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _utils = __webpack_require__(92);
var _utils2 = _interopRequireDefault(_utils);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* 得到会导致元素显示不全的祖先元素
*/
function getOffsetParent(element) {
if (_utils2['default'].isWindow(element) || element.nodeType === 9) {
return null;
}
// ie 这个也不是完全可行
/*
*/
// element.offsetParent does the right thing in ie7 and below. Return parent with layout!
// In other browsers it only includes elements with position absolute, relative or
// fixed, not elements with overflow set to auto or scroll.
// if (UA.ie && ieMode < 8) {
// return element.offsetParent;
// }
// 统一的 offsetParent 方法
var doc = _utils2['default'].getDocument(element);
var body = doc.body;
var parent = void 0;
var positionStyle = _utils2['default'].css(element, 'position');
var skipStatic = positionStyle === 'fixed' || positionStyle === 'absolute';
if (!skipStatic) {
return element.nodeName.toLowerCase() === 'html' ? null : element.parentNode;
}
for (parent = element.parentNode; parent && parent !== body; parent = parent.parentNode) {
positionStyle = _utils2['default'].css(parent, 'position');
if (positionStyle !== 'static') {
return parent;
}
}
return null;
}
exports['default'] = getOffsetParent;
module.exports = exports['default'];
/***/ }),
/* 95 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _utils = __webpack_require__(92);
var _utils2 = _interopRequireDefault(_utils);
var _getOffsetParent = __webpack_require__(94);
var _getOffsetParent2 = _interopRequireDefault(_getOffsetParent);
var _isAncestorFixed = __webpack_require__(96);
var _isAncestorFixed2 = _interopRequireDefault(_isAncestorFixed);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/**
* 获得元素的显示部分的区域
*/
function getVisibleRectForElement(element) {
var visibleRect = {
left: 0,
right: Infinity,
top: 0,
bottom: Infinity
};
var el = (0, _getOffsetParent2['default'])(element);
var doc = _utils2['default'].getDocument(element);
var win = doc.defaultView || doc.parentWindow;
var body = doc.body;
var documentElement = doc.documentElement;
// Determine the size of the visible rect by climbing the dom accounting for
// all scrollable containers.
while (el) {
// clientWidth is zero for inline block elements in ie.
if ((navigator.userAgent.indexOf('MSIE') === -1 || el.clientWidth !== 0) &&
// body may have overflow set on it, yet we still get the entire
// viewport. In some browsers, el.offsetParent may be
// document.documentElement, so check for that too.
el !== body && el !== documentElement && _utils2['default'].css(el, 'overflow') !== 'visible') {
var pos = _utils2['default'].offset(el);
// add border
pos.left += el.clientLeft;
pos.top += el.clientTop;
visibleRect.top = Math.max(visibleRect.top, pos.top);
visibleRect.right = Math.min(visibleRect.right,
// consider area without scrollBar
pos.left + el.clientWidth);
visibleRect.bottom = Math.min(visibleRect.bottom, pos.top + el.clientHeight);
visibleRect.left = Math.max(visibleRect.left, pos.left);
} else if (el === body || el === documentElement) {
break;
}
el = (0, _getOffsetParent2['default'])(el);
}
// Set element position to fixed
// make sure absolute element itself don't affect it's visible area
// https://github.com/ant-design/ant-design/issues/7601
var originalPosition = null;
if (!_utils2['default'].isWindow(element) && element.nodeType !== 9) {
originalPosition = element.style.position;
var position = _utils2['default'].css(element, 'position');
if (position === 'absolute') {
element.style.position = 'fixed';
}
}
var scrollX = _utils2['default'].getWindowScrollLeft(win);
var scrollY = _utils2['default'].getWindowScrollTop(win);
var viewportWidth = _utils2['default'].viewportWidth(win);
var viewportHeight = _utils2['default'].viewportHeight(win);
var documentWidth = documentElement.scrollWidth;
var documentHeight = documentElement.scrollHeight;
// Reset element position after calculate the visible area
if (element.style) {
element.style.position = originalPosition;
}
if ((0, _isAncestorFixed2['default'])(element)) {
// Clip by viewport's size.
visibleRect.left = Math.max(visibleRect.left, scrollX);
visibleRect.top = Math.max(visibleRect.top, scrollY);
visibleRect.right = Math.min(visibleRect.right, scrollX + viewportWidth);
visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + viewportHeight);
} else {
// Clip by document's size.
var maxVisibleWidth = Math.max(documentWidth, scrollX + viewportWidth);
visibleRect.right = Math.min(visibleRect.right, maxVisibleWidth);
var maxVisibleHeight = Math.max(documentHeight, scrollY + viewportHeight);
visibleRect.bottom = Math.min(visibleRect.bottom, maxVisibleHeight);
}
return visibleRect.top >= 0 && visibleRect.left >= 0 && visibleRect.bottom > visibleRect.top && visibleRect.right > visibleRect.left ? visibleRect : null;
}
exports['default'] = getVisibleRectForElement;
module.exports = exports['default'];
/***/ }),
/* 96 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = isAncestorFixed;
var _utils = __webpack_require__(92);
var _utils2 = _interopRequireDefault(_utils);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function isAncestorFixed(element) {
if (_utils2['default'].isWindow(element) || element.nodeType === 9) {
return false;
}
var doc = _utils2['default'].getDocument(element);
var body = doc.body;
var parent = null;
for (parent = element.parentNode; parent && parent !== body; parent = parent.parentNode) {
var positionStyle = _utils2['default'].css(parent, 'position');
if (positionStyle === 'fixed') {
return true;
}
}
return false;
}
module.exports = exports['default'];
/***/ }),
/* 97 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _utils = __webpack_require__(92);
var _utils2 = _interopRequireDefault(_utils);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function adjustForViewport(elFuturePos, elRegion, visibleRect, overflow) {
var pos = _utils2['default'].clone(elFuturePos);
var size = {
width: elRegion.width,
height: elRegion.height
};
if (overflow.adjustX && pos.left < visibleRect.left) {
pos.left = visibleRect.left;
}
// Left edge inside and right edge outside viewport, try to resize it.
if (overflow.resizeWidth && pos.left >= visibleRect.left && pos.left + size.width > visibleRect.right) {
size.width -= pos.left + size.width - visibleRect.right;
}
// Right edge outside viewport, try to move it.
if (overflow.adjustX && pos.left + size.width > visibleRect.right) {
// 保证左边界和可视区域左边界对齐
pos.left = Math.max(visibleRect.right - size.width, visibleRect.left);
}
// Top edge outside viewport, try to move it.
if (overflow.adjustY && pos.top < visibleRect.top) {
pos.top = visibleRect.top;
}
// Top edge inside and bottom edge outside viewport, try to resize it.
if (overflow.resizeHeight && pos.top >= visibleRect.top && pos.top + size.height > visibleRect.bottom) {
size.height -= pos.top + size.height - visibleRect.bottom;
}
// Bottom edge outside viewport, try to move it.
if (overflow.adjustY && pos.top + size.height > visibleRect.bottom) {
// 保证上边界和可视区域上边界对齐
pos.top = Math.max(visibleRect.bottom - size.height, visibleRect.top);
}
return _utils2['default'].mix(pos, size);
}
exports['default'] = adjustForViewport;
module.exports = exports['default'];
/***/ }),
/* 98 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _utils = __webpack_require__(92);
var _utils2 = _interopRequireDefault(_utils);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function getRegion(node) {
var offset = void 0;
var w = void 0;
var h = void 0;
if (!_utils2['default'].isWindow(node) && node.nodeType !== 9) {
offset = _utils2['default'].offset(node);
w = _utils2['default'].outerWidth(node);
h = _utils2['default'].outerHeight(node);
} else {
var win = _utils2['default'].getWindow(node);
offset = {
left: _utils2['default'].getWindowScrollLeft(win),
top: _utils2['default'].getWindowScrollTop(win)
};
w = _utils2['default'].viewportWidth(win);
h = _utils2['default'].viewportHeight(win);
}
offset.width = w;
offset.height = h;
return offset;
}
exports['default'] = getRegion;
module.exports = exports['default'];
/***/ }),
/* 99 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _getAlignOffset = __webpack_require__(100);
var _getAlignOffset2 = _interopRequireDefault(_getAlignOffset);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function getElFuturePos(elRegion, refNodeRegion, points, offset, targetOffset) {
var p1 = (0, _getAlignOffset2['default'])(refNodeRegion, points[1]);
var p2 = (0, _getAlignOffset2['default'])(elRegion, points[0]);
var diff = [p2.left - p1.left, p2.top - p1.top];
return {
left: elRegion.left - diff[0] + offset[0] - targetOffset[0],
top: elRegion.top - diff[1] + offset[1] - targetOffset[1]
};
}
exports['default'] = getElFuturePos;
module.exports = exports['default'];
/***/ }),
/* 100 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* 获取 node 上的 align 对齐点 相对于页面的坐标
*/
function getAlignOffset(region, align) {
var V = align.charAt(0);
var H = align.charAt(1);
var w = region.width;
var h = region.height;
var x = region.left;
var y = region.top;
if (V === 'c') {
y += h / 2;
} else if (V === 'b') {
y += h;
}
if (H === 'c') {
x += w / 2;
} else if (H === 'r') {
x += w;
}
return {
left: x,
top: y
};
}
exports['default'] = getAlignOffset;
module.exports = exports['default'];
/***/ }),
/* 101 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Transition = __webpack_require__(11);
var _Transition2 = _interopRequireDefault(_Transition);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
/**
* Show the component; triggers the fade in or fade out animation
*/
"in": _propTypes2["default"].bool,
/**
* Unmount the component (remove it from the DOM) when it is faded out
*/
unmountOnExit: _propTypes2["default"].bool,
/**
* Run the fade in animation when the component mounts, if it is initially
* shown
*/
transitionAppear: _propTypes2["default"].bool,
/**
* Duration of the fade animation in milliseconds, to ensure that finishing
* callbacks are fired even if the original browser transition end events are
* canceled
*/
timeout: _propTypes2["default"].number,
/**
* Callback fired before the component fades in
*/
onEnter: _propTypes2["default"].func,
/**
* Callback fired after the component starts to fade in
*/
onEntering: _propTypes2["default"].func,
/**
* Callback fired after the has component faded in
*/
onEntered: _propTypes2["default"].func,
/**
* Callback fired before the component fades out
*/
onExit: _propTypes2["default"].func,
/**
* Callback fired after the component starts to fade out
*/
onExiting: _propTypes2["default"].func,
/**
* Callback fired after the component has faded out
*/
onExited: _propTypes2["default"].func
};
var defaultProps = {
"in": false,
timeout: 300,
unmountOnExit: false,
transitionAppear: false
};
var Fade = function (_React$Component) {
_inherits(Fade, _React$Component);
function Fade() {
_classCallCheck(this, Fade);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Fade.prototype.render = function render() {
return _react2["default"].createElement(_Transition2["default"], _extends({}, this.props, {
className: (0, _classnames2["default"])(this.props.className, 'fade'),
enteredClassName: 'in',
enteringClassName: 'in'
}));
};
return Fade;
}(_react2["default"].Component);
Fade.propTypes = propTypes;
Fade.defaultProps = defaultProps;
exports["default"] = Fade;
module.exports = exports['default'];
/***/ }),
/* 102 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _tinperBeeCore = __webpack_require__(26);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
//是否是手风琴效果
accordion: _propTypes2["default"].bool,
//激活的项
activeKey: _propTypes2["default"].any,
//默认的激活的项
defaultActiveKey: _propTypes2["default"].any,
//选中函数
onSelect: _propTypes2["default"].func,
role: _propTypes2["default"].string
};
var defaultProps = {
accordion: false,
clsPrefix: 'u-panel-group'
};
// TODO: Use uncontrollable.
var PanelGroup = function (_React$Component) {
_inherits(PanelGroup, _React$Component);
function PanelGroup(props, context) {
_classCallCheck(this, PanelGroup);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
_this.handleSelect = _this.handleSelect.bind(_this);
_this.state = {
activeKey: props.defaultActiveKey
};
return _this;
}
PanelGroup.prototype.handleSelect = function handleSelect(key, e) {
e.preventDefault();
if (this.props.onSelect) {
this.props.onSelect(key, e);
}
if (this.state.activeKey === key) {
key = null;
}
this.setState({ activeKey: key });
};
PanelGroup.prototype.render = function render() {
var _this2 = this;
var _props = this.props,
accordion = _props.accordion,
propsActiveKey = _props.activeKey,
className = _props.className,
children = _props.children,
defaultActiveKey = _props.defaultActiveKey,
onSelect = _props.onSelect,
style = _props.style,
clsPrefix = _props.clsPrefix,
others = _objectWithoutProperties(_props, ['accordion', 'activeKey', 'className', 'children', 'defaultActiveKey', 'onSelect', 'style', 'clsPrefix']);
var activeKey = void 0;
if (accordion) {
activeKey = propsActiveKey != null ? propsActiveKey : this.state.activeKey;
others.role = others.role || 'tablist';
}
var classes = {};
classes['' + clsPrefix] = true;
return _react2["default"].createElement(
'div',
_extends({}, others, {
className: (0, _classnames2["default"])(className, classes)
}),
_react2["default"].Children.map(children, function (child) {
if (!_react2["default"].isValidElement(child)) {
return child;
}
var childProps = {
style: child.props.style
};
if (accordion) {
_extends(childProps, {
headerRole: 'tab',
panelRole: 'tabpanel',
collapsible: true,
expanded: child.props.eventKey === activeKey,
onSelect: (0, _tinperBeeCore.createChainedFunction)(_this2.handleSelect, child.props.onSelect)
});
}
return (0, _react.cloneElement)(child, childProps);
})
);
};
return PanelGroup;
}(_react2["default"].Component);
PanelGroup.propTypes = propTypes;
PanelGroup.defaultProps = defaultProps;
exports["default"] = PanelGroup;
module.exports = exports['default'];
/***/ }),
/* 103 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Button = __webpack_require__(104);
var _Button2 = _interopRequireDefault(_Button);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports["default"] = _Button2["default"];
module.exports = exports['default'];
/***/ }),
/* 104 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
/**
* @title 尺寸
*/
size: _propTypes2["default"].oneOf(['sm', 'xg', 'lg']),
/**
* @title 样式
*/
style: _propTypes2["default"].object,
/**
* @title 形状
*/
shape: _propTypes2["default"].oneOf(['block', 'round', 'border', 'squared', 'floating', 'pillRight', 'pillLeft', 'icon']),
bordered: _propTypes2["default"].bool,
/**
* @title 类型
*/
colors: _propTypes2["default"].oneOf(['primary', 'accent', 'success', 'info', 'warning', 'danger', 'default']),
/**
* @title 是否禁用
* @veIgnore
*/
disabled: _propTypes2["default"].bool,
/**
* @title 类名
* @veIgnore
*/
className: _propTypes2["default"].string,
/**
* @title 的 type
* @veIgnore
*/
htmlType: _propTypes2["default"].oneOf(['submit', 'button', 'reset']),
isSubmit: _propTypes2["default"].bool //是否作为form的提交按钮
};
var defaultProps = {
disabled: false,
htmlType: 'button',
clsPrefix: 'u-button',
bordered: false,
isSubmit: false
};
var sizeMap = {
sm: 'sm',
xg: 'xg',
lg: 'lg'
},
colorsMap = {
primary: 'primary',
accent: 'accent',
success: 'success',
info: 'info',
warning: 'warning',
danger: 'danger'
},
shapeMap = {
block: 'block',
round: 'round',
border: 'border',
squared: 'squared',
floating: 'floating',
pillRight: 'pill-right',
pillLeft: 'pill-left',
icon: 'icon'
};
var Button = function (_Component) {
_inherits(Button, _Component);
function Button(props) {
_classCallCheck(this, Button);
return _possibleConstructorReturn(this, _Component.call(this, props));
}
Button.prototype.render = function render() {
var _props = this.props,
colors = _props.colors,
shape = _props.shape,
disabled = _props.disabled,
className = _props.className,
size = _props.size,
bordered = _props.bordered,
children = _props.children,
htmlType = _props.htmlType,
clsPrefix = _props.clsPrefix,
isSubmit = _props.isSubmit,
others = _objectWithoutProperties(_props, ['colors', 'shape', 'disabled', 'className', 'size', 'bordered', 'children', 'htmlType', 'clsPrefix', 'isSubmit']);
var clsObj = {};
if (className) {
clsObj[className] = true;
}
if (sizeMap[size]) {
clsObj[clsPrefix + '-' + sizeMap[size]] = true;
}
if (shapeMap[shape]) {
clsObj[clsPrefix + '-' + shapeMap[shape]] = true;
}
if (colorsMap[colors]) {
clsObj[clsPrefix + '-' + colorsMap[colors]] = true;
}
//clsObj[`${clsPrefix}-border`] = bordered;
var classes = (0, _classnames2["default"])(clsPrefix, clsObj);
return _react2["default"].createElement(
'button',
_extends({
type: htmlType,
className: classes,
disabled: disabled
}, others),
this.props.children
);
};
return Button;
}(_react.Component);
Button.propTypes = propTypes;
Button.defaultProps = defaultProps;
exports["default"] = Button;
module.exports = exports['default'];
/***/ }),
/* 105 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 简单表格
* @description
*
*/
var columns = [{ title: "用户名", dataIndex: "a", key: "a", width: 100 }, { id: "123", title: "性别", dataIndex: "b", key: "b", width: 100 }, { title: "年龄", dataIndex: "c", key: "c", width: 200 }, {
title: "操作",
dataIndex: "d",
key: "d",
render: function render(text, record, index) {
return _react2["default"].createElement(
"a",
{
href: "#",
onClick: function onClick() {
alert('这是第' + index + '列,内容为:' + text);
}
},
"\u4E00\u4E9B\u64CD\u4F5C"
);
}
}];
var data = [{ a: "令狐冲", b: "男", c: 41, d: "操作", key: "1" }, { a: "杨过", b: "男", c: 67, d: "操作", key: "2" }, { a: "郭靖", b: "男", c: 25, d: "操作", key: "3" }];
var Demo1 = function (_Component) {
_inherits(Demo1, _Component);
function Demo1() {
_classCallCheck(this, Demo1);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
Demo1.prototype.render = function render() {
return _react2["default"].createElement(_src2["default"], {
columns: columns,
data: data,
title: function title(currentData) {
return _react2["default"].createElement(
"div",
null,
"\u6807\u9898: \u8FD9\u662F\u4E00\u4E2A\u6807\u9898"
);
},
footer: function footer(currentData) {
return _react2["default"].createElement(
"div",
null,
"\u8868\u5C3E: \u6211\u662F\u5C0F\u5C3E\u5DF4"
);
}
});
};
return Demo1;
}(_react.Component);
exports["default"] = Demo1;
module.exports = exports["default"];
/***/ }),
/* 106 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var Table = __webpack_require__(107);
var Column = __webpack_require__(120);
var ColumnGroup = __webpack_require__(121);
Table.Column = Column;
Table.ColumnGroup = ColumnGroup;
module.exports = Table;
/***/ }),
/* 107 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _TableRow = __webpack_require__(108);
var _TableRow2 = _interopRequireDefault(_TableRow);
var _TableHeader = __webpack_require__(117);
var _TableHeader2 = _interopRequireDefault(_TableHeader);
var _utils = __webpack_require__(118);
var _shallowequal = __webpack_require__(112);
var _shallowequal2 = _interopRequireDefault(_shallowequal);
var _addEventListener = __webpack_require__(74);
var _addEventListener2 = _interopRequireDefault(_addEventListener);
var _ColumnManager = __webpack_require__(119);
var _ColumnManager2 = _interopRequireDefault(_ColumnManager);
var _createStore = __webpack_require__(122);
var _createStore2 = _interopRequireDefault(_createStore);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
data: _propTypes2['default'].array,
expandIconAsCell: _propTypes2['default'].bool,
defaultExpandAllRows: _propTypes2['default'].bool,
expandedRowKeys: _propTypes2['default'].array,
defaultExpandedRowKeys: _propTypes2['default'].array,
useFixedHeader: _propTypes2['default'].bool,
columns: _propTypes2['default'].array,
clsPrefix: _propTypes2['default'].string,
bodyStyle: _propTypes2['default'].object,
style: _propTypes2['default'].object,
//特殊的渲染规则的key值
rowKey: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].func]),
rowClassName: _propTypes2['default'].func,
expandedRowClassName: _propTypes2['default'].func,
childrenColumnName: _propTypes2['default'].string,
onExpand: _propTypes2['default'].func,
onExpandedRowsChange: _propTypes2['default'].func,
indentSize: _propTypes2['default'].number,
onRowClick: _propTypes2['default'].func,
onRowDoubleClick: _propTypes2['default'].func,
expandIconColumnIndex: _propTypes2['default'].number,
//是否显示表头
showHeader: _propTypes2['default'].bool,
title: _propTypes2['default'].func,
footer: _propTypes2['default'].func,
emptyText: _propTypes2['default'].func,
scroll: _propTypes2['default'].object,
rowRef: _propTypes2['default'].func,
getBodyWrapper: _propTypes2['default'].func,
children: _propTypes2['default'].node
};
var defaultProps = {
data: [],
useFixedHeader: false,
expandIconAsCell: false,
defaultExpandAllRows: false,
defaultExpandedRowKeys: [],
rowKey: 'key',
rowClassName: function rowClassName() {
return '';
},
expandedRowClassName: function expandedRowClassName() {
return '';
},
onExpand: function onExpand() {},
onExpandedRowsChange: function onExpandedRowsChange() {},
onRowClick: function onRowClick() {},
onRowDoubleClick: function onRowDoubleClick() {},
clsPrefix: 'u-table',
bodyStyle: {},
style: {},
childrenColumnName: 'children',
indentSize: 15,
expandIconColumnIndex: 0,
showHeader: true,
scroll: {},
rowRef: function rowRef() {
return null;
},
getBodyWrapper: function getBodyWrapper(body) {
return body;
},
emptyText: function emptyText() {
return 'No Data';
}
};
var Table = function (_Component) {
_inherits(Table, _Component);
function Table(props) {
_classCallCheck(this, Table);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
var expandedRowKeys = [];
var rows = [].concat(_toConsumableArray(props.data));
_this.columnManager = new _ColumnManager2['default'](props.columns, props.children);
_this.store = (0, _createStore2['default'])({ currentHoverKey: null });
if (props.defaultExpandAllRows) {
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
expandedRowKeys.push(_this.getRowKey(row, i));
rows = rows.concat(row[props.childrenColumnName] || []);
}
} else {
expandedRowKeys = props.expandedRowKeys || props.defaultExpandedRowKeys;
}
_this.state = {
expandedRowKeys: expandedRowKeys,
data: props.data,
currentHoverKey: null,
scrollPosition: 'left',
fixedColumnsHeadRowsHeight: [],
fixedColumnsBodyRowsHeight: []
};
_this.onExpandedRowsChange = _this.onExpandedRowsChange.bind(_this);
_this.onExpanded = _this.onExpanded.bind(_this);
_this.onRowDestroy = _this.onRowDestroy.bind(_this);
_this.getRowKey = _this.getRowKey.bind(_this);
_this.getExpandedRows = _this.getExpandedRows.bind(_this);
_this.getHeader = _this.getHeader.bind(_this);
_this.getHeaderRows = _this.getHeaderRows.bind(_this);
_this.getExpandedRow = _this.getExpandedRow.bind(_this);
_this.getRowsByData = _this.getRowsByData.bind(_this);
_this.getRows = _this.getRows.bind(_this);
_this.getColGroup = _this.getColGroup.bind(_this);
_this.getLeftFixedTable = _this.getLeftFixedTable.bind(_this);
_this.getRightFixedTable = _this.getRightFixedTable.bind(_this);
_this.getTable = _this.getTable.bind(_this);
_this.getTitle = _this.getTitle.bind(_this);
_this.getFooter = _this.getFooter.bind(_this);
_this.getEmptyText = _this.getEmptyText.bind(_this);
_this.getHeaderRowStyle = _this.getHeaderRowStyle.bind(_this);
_this.syncFixedTableRowHeight = _this.syncFixedTableRowHeight.bind(_this);
_this.resetScrollY = _this.resetScrollY.bind(_this);
_this.findExpandedRow = _this.findExpandedRow.bind(_this);
_this.isRowExpanded = _this.isRowExpanded.bind(_this);
_this.detectScrollTarget = _this.detectScrollTarget.bind(_this);
_this.handleBodyScroll = _this.handleBodyScroll.bind(_this);
_this.handleRowHover = _this.handleRowHover.bind(_this);
return _this;
}
Table.prototype.componentDidMount = function componentDidMount() {
this.resetScrollY();
if (this.columnManager.isAnyColumnsFixed()) {
this.syncFixedTableRowHeight();
this.resizeEvent = (0, _addEventListener2['default'])(window, 'resize', (0, _utils.debounce)(this.syncFixedTableRowHeight, 150));
}
};
Table.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if ('data' in nextProps) {
this.setState({
data: nextProps.data
});
if (!nextProps.data || nextProps.data.length === 0) {
this.resetScrollY();
}
}
if ('expandedRowKeys' in nextProps) {
this.setState({
expandedRowKeys: nextProps.expandedRowKeys
});
}
if (nextProps.columns && nextProps.columns !== this.props.columns) {
this.columnManager.reset(nextProps.columns);
} else if (nextProps.children !== this.props.children) {
this.columnManager.reset(null, nextProps.children);
}
};
Table.prototype.componentDidUpdate = function componentDidUpdate() {
this.syncFixedTableRowHeight();
};
Table.prototype.componentWillUnmount = function componentWillUnmount() {
if (this.resizeEvent) {
this.resizeEvent.remove();
}
};
Table.prototype.onExpandedRowsChange = function onExpandedRowsChange(expandedRowKeys) {
if (!this.props.expandedRowKeys) {
this.setState({ expandedRowKeys: expandedRowKeys });
}
this.props.onExpandedRowsChange(expandedRowKeys);
};
Table.prototype.onExpanded = function onExpanded(expanded, record, index, e) {
if (e) {
e.preventDefault();
e.stopPropagation();
}
var info = this.findExpandedRow(record);
if (typeof info !== 'undefined' && !expanded) {
this.onRowDestroy(record, index);
} else if (!info && expanded) {
var expandedRows = this.getExpandedRows().concat();
expandedRows.push(this.getRowKey(record, index));
this.onExpandedRowsChange(expandedRows);
}
this.props.onExpand(expanded, record);
};
Table.prototype.onRowDestroy = function onRowDestroy(record, rowIndex) {
var expandedRows = this.getExpandedRows().concat();
var rowKey = this.getRowKey(record, rowIndex);
var index = -1;
expandedRows.forEach(function (r, i) {
if (r === rowKey) {
index = i;
}
});
if (index !== -1) {
expandedRows.splice(index, 1);
}
this.onExpandedRowsChange(expandedRows);
};
Table.prototype.getRowKey = function getRowKey(record, index) {
var rowKey = this.props.rowKey;
var key = typeof rowKey === 'function' ? rowKey(record, index) : record[rowKey];
(0, _utils.warningOnce)(key !== undefined, 'Each record in table should have a unique `key` prop,' + 'or set `rowKey` to an unique primary key.');
return key;
};
Table.prototype.getExpandedRows = function getExpandedRows() {
return this.props.expandedRowKeys || this.state.expandedRowKeys;
};
Table.prototype.getHeader = function getHeader(columns, fixed) {
var _props = this.props,
showHeader = _props.showHeader,
expandIconAsCell = _props.expandIconAsCell,
clsPrefix = _props.clsPrefix;
var rows = this.getHeaderRows(columns);
if (expandIconAsCell && fixed !== 'right') {
rows[0].unshift({
key: 'u-table-expandIconAsCell',
className: clsPrefix + '-expand-icon-th',
title: '',
rowSpan: rows.length
});
}
var trStyle = fixed ? this.getHeaderRowStyle(columns, rows) : null;
return showHeader ? _react2['default'].createElement(_TableHeader2['default'], {
clsPrefix: clsPrefix,
rows: rows,
rowStyle: trStyle
}) : null;
};
Table.prototype.getHeaderRows = function getHeaderRows(columns) {
var _this2 = this;
var currentRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
var rows = arguments[2];
rows = rows || [];
rows[currentRow] = rows[currentRow] || [];
columns.forEach(function (column) {
if (column.rowSpan && rows.length < column.rowSpan) {
while (rows.length < column.rowSpan) {
rows.push([]);
}
}
var cell = {
key: column.key,
className: column.className || '',
children: column.title
};
if (column.children) {
_this2.getHeaderRows(column.children, currentRow + 1, rows);
}
if ('colSpan' in column) {
cell.colSpan = column.colSpan;
}
if ('rowSpan' in column) {
cell.rowSpan = column.rowSpan;
}
if (cell.colSpan !== 0) {
rows[currentRow].push(cell);
}
});
return rows.filter(function (row) {
return row.length > 0;
});
};
Table.prototype.getExpandedRow = function getExpandedRow(key, content, visible, className, fixed) {
var _props2 = this.props,
clsPrefix = _props2.clsPrefix,
expandIconAsCell = _props2.expandIconAsCell;
var colCount = void 0;
if (fixed === 'left') {
colCount = this.columnManager.leftLeafColumns().length;
} else if (fixed === 'right') {
colCount = this.columnManager.rightLeafColumns().length;
} else {
colCount = this.columnManager.leafColumns().length;
}
var columns = [{
key: 'extra-row',
render: function render() {
return {
props: {
colSpan: colCount
},
children: fixed !== 'right' ? content : ' '
};
}
}];
if (expandIconAsCell && fixed !== 'right') {
columns.unshift({
key: 'expand-icon-placeholder',
render: function render() {
return null;
}
});
}
return _react2['default'].createElement(_TableRow2['default'], {
columns: columns,
visible: visible,
className: className,
key: key + '-extra-row',
clsPrefix: clsPrefix + '-expanded-row',
indent: 1,
expandable: false,
store: this.store
});
};
Table.prototype.getRowsByData = function getRowsByData(data, visible, indent, columns, fixed) {
var props = this.props;
var childrenColumnName = props.childrenColumnName;
var expandedRowRender = props.expandedRowRender;
var expandRowByClick = props.expandRowByClick;
var fixedColumnsBodyRowsHeight = this.state.fixedColumnsBodyRowsHeight;
var rst = [];
var rowClassName = props.rowClassName;
var rowRef = props.rowRef;
var expandedRowClassName = props.expandedRowClassName;
var needIndentSpaced = props.data.some(function (record) {
return record[childrenColumnName];
});
var onRowClick = props.onRowClick;
var onRowDoubleClick = props.onRowDoubleClick;
var expandIconAsCell = fixed !== 'right' ? props.expandIconAsCell : false;
var expandIconColumnIndex = fixed !== 'right' ? props.expandIconColumnIndex : -1;
for (var i = 0; i < data.length; i++) {
var record = data[i];
var key = this.getRowKey(record, i);
var childrenColumn = record[childrenColumnName];
var isRowExpanded = this.isRowExpanded(record, i);
var expandedRowContent = void 0;
if (expandedRowRender && isRowExpanded) {
expandedRowContent = expandedRowRender(record, i, indent);
}
var className = rowClassName(record, i, indent);
var onHoverProps = {};
if (this.columnManager.isAnyColumnsFixed()) {
onHoverProps.onHover = this.handleRowHover;
}
var height = fixed && fixedColumnsBodyRowsHeight[i] ? fixedColumnsBodyRowsHeight[i] : null;
var leafColumns = void 0;
if (fixed === 'left') {
leafColumns = this.columnManager.leftLeafColumns();
} else if (fixed === 'right') {
leafColumns = this.columnManager.rightLeafColumns();
} else {
leafColumns = this.columnManager.leafColumns();
}
rst.push(_react2['default'].createElement(_TableRow2['default'], _extends({
indent: indent,
indentSize: props.indentSize,
needIndentSpaced: needIndentSpaced,
className: className,
record: record,
expandIconAsCell: expandIconAsCell,
onDestroy: this.onRowDestroy,
index: i,
visible: visible,
expandRowByClick: expandRowByClick,
onExpand: this.onExpanded,
expandable: childrenColumn || expandedRowRender,
expanded: isRowExpanded,
clsPrefix: props.clsPrefix + '-row',
childrenColumnName: childrenColumnName,
columns: leafColumns,
expandIconColumnIndex: expandIconColumnIndex,
onRowClick: onRowClick,
onRowDoubleClick: onRowDoubleClick,
height: height
}, onHoverProps, {
key: key,
hoverKey: key,
ref: rowRef,
store: this.store
})));
var subVisible = visible && isRowExpanded;
if (expandedRowContent && isRowExpanded) {
rst.push(this.getExpandedRow(key, expandedRowContent, subVisible, expandedRowClassName(record, i, indent), fixed));
}
if (childrenColumn) {
rst = rst.concat(this.getRowsByData(childrenColumn, subVisible, indent + 1, columns, fixed));
}
}
return rst;
};
Table.prototype.getRows = function getRows(columns, fixed) {
return this.getRowsByData(this.state.data, true, 0, columns, fixed);
};
Table.prototype.getColGroup = function getColGroup(columns, fixed) {
var cols = [];
if (this.props.expandIconAsCell && fixed !== 'right') {
cols.push(_react2['default'].createElement('col', {
className: this.props.clsPrefix + '-expand-icon-col',
key: 'u-table-expand-icon-col'
}));
}
var leafColumns = void 0;
if (fixed === 'left') {
leafColumns = this.columnManager.leftLeafColumns();
} else if (fixed === 'right') {
leafColumns = this.columnManager.rightLeafColumns();
} else {
leafColumns = this.columnManager.leafColumns();
}
cols = cols.concat(leafColumns.map(function (c) {
return _react2['default'].createElement('col', { key: c.key, style: { width: c.width, minWidth: c.width } });
}));
return _react2['default'].createElement(
'colgroup',
null,
cols
);
};
Table.prototype.getLeftFixedTable = function getLeftFixedTable() {
return this.getTable({
columns: this.columnManager.leftColumns(),
fixed: 'left'
});
};
Table.prototype.getRightFixedTable = function getRightFixedTable() {
return this.getTable({
columns: this.columnManager.rightColumns(),
fixed: 'right'
});
};
Table.prototype.getTable = function getTable() {
var _this3 = this;
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var columns = options.columns,
fixed = options.fixed;
var _props3 = this.props,
clsPrefix = _props3.clsPrefix,
_props3$scroll = _props3.scroll,
scroll = _props3$scroll === undefined ? {} : _props3$scroll,
getBodyWrapper = _props3.getBodyWrapper,
footerScroll = _props3.footerScroll;
var useFixedHeader = this.props.useFixedHeader;
var bodyStyle = _extends({}, this.props.bodyStyle);
var headStyle = {};
var tableClassName = '';
if (scroll.x || fixed) {
tableClassName = clsPrefix + '-fixed';
if (!footerScroll) {
bodyStyle.overflowX = bodyStyle.overflowX || 'auto';
}
}
if (scroll.y) {
// maxHeight will make fixed-Table scrolling not working
// so we only set maxHeight to body-Table here
if (fixed) {
bodyStyle.height = bodyStyle.height || scroll.y;
} else {
bodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
}
bodyStyle.overflowY = bodyStyle.overflowY || 'auto';
useFixedHeader = true;
// Add negative margin bottom for scroll bar overflow bug
var scrollbarWidth = (0, _utils.measureScrollbar)();
if (scrollbarWidth >= 0) {
(fixed ? bodyStyle : headStyle).marginBottom = '-' + scrollbarWidth + 'px';
(fixed ? bodyStyle : headStyle).paddingBottom = '0px';
}
}
var renderTable = function renderTable() {
var hasHead = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
var hasBody = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var tableStyle = {};
if (!fixed && scroll.x) {
// not set width, then use content fixed width
if (scroll.x === true) {
tableStyle.tableLayout = 'fixed';
} else {
tableStyle.width = scroll.x;
}
}
var tableBody = hasBody ? getBodyWrapper(_react2['default'].createElement(
'tbody',
{ className: clsPrefix + '-tbody' },
_this3.getRows(columns, fixed)
)) : null;
return _react2['default'].createElement(
'table',
{ className: tableClassName, style: tableStyle },
_this3.getColGroup(columns, fixed),
hasHead ? _this3.getHeader(columns, fixed) : null,
tableBody
);
};
var headTable = void 0;
if (useFixedHeader) {
headTable = _react2['default'].createElement(
'div',
{
className: clsPrefix + '-header',
ref: fixed ? null : 'headTable',
style: headStyle,
onMouseOver: this.detectScrollTarget,
onTouchStart: this.detectScrollTarget,
onScroll: this.handleBodyScroll
},
renderTable(true, false)
);
}
var BodyTable = _react2['default'].createElement(
'div',
{
className: clsPrefix + '-body',
style: bodyStyle,
ref: 'bodyTable',
onMouseOver: this.detectScrollTarget,
onTouchStart: this.detectScrollTarget,
onScroll: this.handleBodyScroll
},
renderTable(!useFixedHeader)
);
if (fixed && columns.length) {
var refName = void 0;
if (columns[0].fixed === 'left' || columns[0].fixed === true) {
refName = 'fixedColumnsBodyLeft';
} else if (columns[0].fixed === 'right') {
refName = 'fixedColumnsBodyRight';
}
delete bodyStyle.overflowX;
delete bodyStyle.overflowY;
BodyTable = _react2['default'].createElement(
'div',
{
className: clsPrefix + '-body-outer',
style: _extends({}, bodyStyle)
},
_react2['default'].createElement(
'div',
{
className: clsPrefix + '-body-inner',
ref: refName,
onMouseOver: this.detectScrollTarget,
onTouchStart: this.detectScrollTarget,
onScroll: this.handleBodyScroll
},
renderTable(!useFixedHeader)
)
);
}
return _react2['default'].createElement(
'span',
null,
headTable,
BodyTable
);
};
Table.prototype.getTitle = function getTitle() {
var _props4 = this.props,
title = _props4.title,
clsPrefix = _props4.clsPrefix;
return title ? _react2['default'].createElement(
'div',
{ className: clsPrefix + '-title' },
title(this.state.data)
) : null;
};
Table.prototype.getFooter = function getFooter() {
var _props5 = this.props,
footer = _props5.footer,
clsPrefix = _props5.clsPrefix;
return footer ? _react2['default'].createElement(
'div',
{ className: clsPrefix + '-footer' },
footer(this.state.data)
) : null;
};
Table.prototype.getEmptyText = function getEmptyText() {
var _props6 = this.props,
emptyText = _props6.emptyText,
clsPrefix = _props6.clsPrefix,
data = _props6.data;
return !data.length ? _react2['default'].createElement(
'div',
{ className: clsPrefix + '-placeholder' },
emptyText()
) : null;
};
Table.prototype.getHeaderRowStyle = function getHeaderRowStyle(columns, rows) {
var fixedColumnsHeadRowsHeight = this.state.fixedColumnsHeadRowsHeight;
var headerHeight = fixedColumnsHeadRowsHeight[0];
if (headerHeight && columns) {
if (headerHeight === 'auto') {
return { height: 'auto' };
}
return { height: headerHeight / rows.length };
}
return null;
};
Table.prototype.syncFixedTableRowHeight = function syncFixedTableRowHeight() {
var clsPrefix = this.props.clsPrefix;
var headRows = this.refs.headTable ? this.refs.headTable.querySelectorAll('thead') : this.refs.bodyTable.querySelectorAll('thead');
var bodyRows = this.refs.bodyTable.querySelectorAll('.' + clsPrefix + '-row') || [];
var fixedColumnsHeadRowsHeight = [].map.call(headRows, function (row) {
return row.getBoundingClientRect().height || 'auto';
});
var fixedColumnsBodyRowsHeight = [].map.call(bodyRows, function (row) {
return row.getBoundingClientRect().height || 'auto';
});
if ((0, _shallowequal2['default'])(this.state.fixedColumnsHeadRowsHeight, fixedColumnsHeadRowsHeight) && (0, _shallowequal2['default'])(this.state.fixedColumnsBodyRowsHeight, fixedColumnsBodyRowsHeight)) {
return;
}
this.setState({
fixedColumnsHeadRowsHeight: fixedColumnsHeadRowsHeight,
fixedColumnsBodyRowsHeight: fixedColumnsBodyRowsHeight
});
};
Table.prototype.resetScrollY = function resetScrollY() {
if (this.refs.headTable) {
this.refs.headTable.scrollLeft = 0;
}
if (this.refs.bodyTable) {
this.refs.bodyTable.scrollLeft = 0;
}
};
Table.prototype.findExpandedRow = function findExpandedRow(record, index) {
var _this4 = this;
var rows = this.getExpandedRows().filter(function (i) {
return i === _this4.getRowKey(record, index);
});
return rows[0];
};
Table.prototype.isRowExpanded = function isRowExpanded(record, index) {
return typeof this.findExpandedRow(record, index) !== 'undefined';
};
Table.prototype.detectScrollTarget = function detectScrollTarget(e) {
if (this.scrollTarget !== e.currentTarget) {
this.scrollTarget = e.currentTarget;
}
};
Table.prototype.handleBodyScroll = function handleBodyScroll(e) {
// Prevent scrollTop setter trigger onScroll event
// http://stackoverflow.com/q/1386696
if (e.target !== this.scrollTarget) {
return;
}
var _props$scroll = this.props.scroll,
scroll = _props$scroll === undefined ? {} : _props$scroll;
var _refs = this.refs,
headTable = _refs.headTable,
bodyTable = _refs.bodyTable,
fixedColumnsBodyLeft = _refs.fixedColumnsBodyLeft,
fixedColumnsBodyRight = _refs.fixedColumnsBodyRight;
if (scroll.x && e.target.scrollLeft !== this.lastScrollLeft) {
if (e.target === bodyTable && headTable) {
headTable.scrollLeft = e.target.scrollLeft;
} else if (e.target === headTable && bodyTable) {
bodyTable.scrollLeft = e.target.scrollLeft;
}
if (e.target.scrollLeft === 0) {
this.setState({ scrollPosition: 'left' });
} else if (e.target.scrollLeft + 1 >= e.target.children[0].getBoundingClientRect().width - e.target.getBoundingClientRect().width) {
this.setState({ scrollPosition: 'right' });
} else if (this.state.scrollPosition !== 'middle') {
this.setState({ scrollPosition: 'middle' });
}
}
if (scroll.y) {
if (fixedColumnsBodyLeft && e.target !== fixedColumnsBodyLeft) {
fixedColumnsBodyLeft.scrollTop = e.target.scrollTop;
}
if (fixedColumnsBodyRight && e.target !== fixedColumnsBodyRight) {
fixedColumnsBodyRight.scrollTop = e.target.scrollTop;
}
if (bodyTable && e.target !== bodyTable) {
bodyTable.scrollTop = e.target.scrollTop;
}
}
// Remember last scrollLeft for scroll direction detecting.
this.lastScrollLeft = e.target.scrollLeft;
};
Table.prototype.handleRowHover = function handleRowHover(isHover, key) {
this.store.setState({
currentHoverKey: isHover ? key : null
});
};
Table.prototype.render = function render() {
var props = this.props;
var clsPrefix = props.clsPrefix;
var className = props.clsPrefix;
if (props.className) {
className += ' ' + props.className;
}
if (props.useFixedHeader || props.scroll && props.scroll.y) {
className += ' ' + clsPrefix + '-fixed-header';
}
if (props.bordered) {
className += ' ' + clsPrefix + '-bordered';
}
className += ' ' + clsPrefix + '-scroll-position-' + this.state.scrollPosition;
var isTableScroll = this.columnManager.isAnyColumnsFixed() || props.scroll.x || props.scroll.y;
return _react2['default'].createElement(
'div',
{ className: className, style: props.style },
this.getTitle(),
_react2['default'].createElement(
'div',
{ className: clsPrefix + '-content' },
this.columnManager.isAnyColumnsLeftFixed() && _react2['default'].createElement(
'div',
{ className: clsPrefix + '-fixed-left' },
this.getLeftFixedTable()
),
_react2['default'].createElement(
'div',
{ className: isTableScroll ? clsPrefix + '-scroll' : '' },
this.getTable({ columns: this.columnManager.groupedColumns() }),
this.getEmptyText(),
this.getFooter()
),
this.columnManager.isAnyColumnsRightFixed() && _react2['default'].createElement(
'div',
{ className: clsPrefix + '-fixed-right' },
this.getRightFixedTable()
)
)
);
};
return Table;
}(_react.Component);
;
Table.propTypes = propTypes;
Table.defaultProps = defaultProps;
exports['default'] = Table;
module.exports = exports['default'];
/***/ }),
/* 108 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _TableCell = __webpack_require__(109);
var _TableCell2 = _interopRequireDefault(_TableCell);
var _ExpandIcon = __webpack_require__(111);
var _ExpandIcon2 = _interopRequireDefault(_ExpandIcon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
onDestroy: _propTypes2['default'].func,
onRowClick: _propTypes2['default'].func,
onRowDoubleClick: _propTypes2['default'].func,
record: _propTypes2['default'].object,
clsPrefix: _propTypes2['default'].string,
expandIconColumnIndex: _propTypes2['default'].number,
onHover: _propTypes2['default'].func,
columns: _propTypes2['default'].array,
height: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].number]),
visible: _propTypes2['default'].bool,
index: _propTypes2['default'].number,
hoverKey: _propTypes2['default'].any,
expanded: _propTypes2['default'].bool,
expandable: _propTypes2['default'].any,
onExpand: _propTypes2['default'].func,
needIndentSpaced: _propTypes2['default'].bool,
className: _propTypes2['default'].string,
indent: _propTypes2['default'].number,
indentSize: _propTypes2['default'].number,
expandIconAsCell: _propTypes2['default'].bool,
expandRowByClick: _propTypes2['default'].bool,
store: _propTypes2['default'].object.isRequired
};
var defaultProps = {
onRowClick: function onRowClick() {},
onRowDoubleClick: function onRowDoubleClick() {},
onDestroy: function onDestroy() {},
expandIconColumnIndex: 0,
expandRowByClick: false,
onHover: function onHover() {}
};
var TableRow = function (_Component) {
_inherits(TableRow, _Component);
function TableRow(props) {
_classCallCheck(this, TableRow);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.state = {
hovered: false
};
_this.onRowClick = _this.onRowClick.bind(_this);
_this.onRowDoubleClick = _this.onRowDoubleClick.bind(_this);
_this.onMouseEnter = _this.onMouseEnter.bind(_this);
_this.onMouseLeave = _this.onMouseLeave.bind(_this);
return _this;
}
TableRow.prototype.componentDidMount = function componentDidMount() {
var _this2 = this;
var _props = this.props,
store = _props.store,
hoverKey = _props.hoverKey;
this.unsubscribe = store.subscribe(function () {
if (store.getState().currentHoverKey === hoverKey) {
_this2.setState({ hovered: true });
} else if (_this2.state.hovered === true) {
_this2.setState({ hovered: false });
}
});
};
TableRow.prototype.componentWillUnmount = function componentWillUnmount() {
var _props2 = this.props,
record = _props2.record,
onDestroy = _props2.onDestroy,
index = _props2.index;
onDestroy(record, index);
if (this.unsubscribe) {
this.unsubscribe();
}
};
TableRow.prototype.onRowClick = function onRowClick(event) {
var _props3 = this.props,
record = _props3.record,
index = _props3.index,
onRowClick = _props3.onRowClick,
expandable = _props3.expandable,
expandRowByClick = _props3.expandRowByClick,
expanded = _props3.expanded,
onExpand = _props3.onExpand;
if (expandable && expandRowByClick) {
onExpand(!expanded, record, index, event);
}
onRowClick(record, index, event);
};
TableRow.prototype.onRowDoubleClick = function onRowDoubleClick(event) {
var _props4 = this.props,
record = _props4.record,
index = _props4.index,
onRowDoubleClick = _props4.onRowDoubleClick;
onRowDoubleClick(record, index, event);
};
TableRow.prototype.onMouseEnter = function onMouseEnter() {
var _props5 = this.props,
onHover = _props5.onHover,
hoverKey = _props5.hoverKey;
onHover(true, hoverKey);
};
TableRow.prototype.onMouseLeave = function onMouseLeave() {
var _props6 = this.props,
onHover = _props6.onHover,
hoverKey = _props6.hoverKey;
onHover(false, hoverKey);
};
TableRow.prototype.render = function render() {
var _props7 = this.props,
clsPrefix = _props7.clsPrefix,
columns = _props7.columns,
record = _props7.record,
height = _props7.height,
visible = _props7.visible,
index = _props7.index,
expandIconColumnIndex = _props7.expandIconColumnIndex,
expandIconAsCell = _props7.expandIconAsCell,
expanded = _props7.expanded,
expandRowByClick = _props7.expandRowByClick,
expandable = _props7.expandable,
onExpand = _props7.onExpand,
needIndentSpaced = _props7.needIndentSpaced,
indent = _props7.indent,
indentSize = _props7.indentSize;
var className = this.props.className;
if (this.state.hovered) {
className += ' ' + clsPrefix + '-hover';
}
var cells = [];
var expandIcon = _react2['default'].createElement(_ExpandIcon2['default'], {
expandable: expandable,
clsPrefix: clsPrefix,
onExpand: onExpand,
needIndentSpaced: needIndentSpaced,
expanded: expanded,
record: record
});
for (var i = 0; i < columns.length; i++) {
if (expandIconAsCell && i === 0) {
cells.push(_react2['default'].createElement(
'td',
{
className: clsPrefix + '-expand-icon-cell',
key: 'rc-table-expand-icon-cell'
},
expandIcon
));
}
var isColumnHaveExpandIcon = expandIconAsCell || expandRowByClick ? false : i === expandIconColumnIndex;
cells.push(_react2['default'].createElement(_TableCell2['default'], {
clsPrefix: clsPrefix,
record: record,
indentSize: indentSize,
indent: indent,
index: index,
column: columns[i],
key: columns[i].key,
expandIcon: isColumnHaveExpandIcon ? expandIcon : null
}));
}
var style = { height: height };
if (!visible) {
style.display = 'none';
}
return _react2['default'].createElement(
'tr',
{
onClick: this.onRowClick,
onDoubleClick: this.onRowDoubleClick,
onMouseEnter: this.onMouseEnter,
onMouseLeave: this.onMouseLeave,
className: clsPrefix + ' ' + className + ' ' + clsPrefix + '-level-' + indent,
style: style
},
cells
);
};
return TableRow;
}(_react.Component);
;
TableRow.propTypes = propTypes;
TableRow.defaultProps = defaultProps;
exports['default'] = TableRow;
module.exports = exports['default'];
/***/ }),
/* 109 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _objectPath = __webpack_require__(110);
var _objectPath2 = _interopRequireDefault(_objectPath);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
record: _propTypes2['default'].object,
clsPrefix: _propTypes2['default'].string,
index: _propTypes2['default'].number,
indent: _propTypes2['default'].number,
indentSize: _propTypes2['default'].number,
column: _propTypes2['default'].object,
expandIcon: _propTypes2['default'].node
};
var TableCell = function (_Component) {
_inherits(TableCell, _Component);
function TableCell(props) {
_classCallCheck(this, TableCell);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.isInvalidRenderCellText = _this.isInvalidRenderCellText.bind(_this);
_this.handleClick = _this.handleClick.bind(_this);
return _this;
}
TableCell.prototype.isInvalidRenderCellText = function isInvalidRenderCellText(text) {
return text && !_react2['default'].isValidElement(text) && Object.prototype.toString.call(text) === '[object Object]';
};
TableCell.prototype.handleClick = function handleClick(e) {
var _props = this.props,
record = _props.record,
onCellClick = _props.column.onCellClick;
if (onCellClick) {
onCellClick(record, e);
}
};
TableCell.prototype.render = function render() {
var _props2 = this.props,
record = _props2.record,
indentSize = _props2.indentSize,
clsPrefix = _props2.clsPrefix,
indent = _props2.indent,
index = _props2.index,
expandIcon = _props2.expandIcon,
column = _props2.column;
var dataIndex = column.dataIndex,
render = column.render,
_column$className = column.className,
className = _column$className === undefined ? '' : _column$className;
var text = _objectPath2['default'].get(record, dataIndex);
var tdProps = void 0;
var colSpan = void 0;
var rowSpan = void 0;
if (render) {
text = render(text, record, index);
if (this.isInvalidRenderCellText(text)) {
tdProps = text.props || {};
rowSpan = tdProps.rowSpan;
colSpan = tdProps.colSpan;
text = text.children;
}
}
if (this.isInvalidRenderCellText(text)) {
text = null;
}
var indentText = expandIcon ? _react2['default'].createElement('span', {
style: { paddingLeft: indentSize * indent + 'px' },
className: clsPrefix + '-indent indent-level-' + indent
}) : null;
if (rowSpan === 0 || colSpan === 0) {
return null;
}
return _react2['default'].createElement(
'td',
{
colSpan: colSpan,
rowSpan: rowSpan,
className: className,
onClick: this.handleClick
},
indentText,
expandIcon,
text
);
};
return TableCell;
}(_react.Component);
;
TableCell.propTypes = propTypes;
exports['default'] = TableCell;
module.exports = exports['default'];
/***/ }),
/* 110 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory){
'use strict';
/*istanbul ignore next:cant test*/
if (typeof module === 'object' && typeof module.exports === 'object') {
module.exports = factory();
} else if (true) {
// AMD. Register as an anonymous module.
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {
// Browser globals
root.objectPath = factory();
}
})(this, function(){
'use strict';
var toStr = Object.prototype.toString;
function hasOwnProperty(obj, prop) {
if(obj == null) {
return false
}
//to handle objects with null prototypes (too edge case?)
return Object.prototype.hasOwnProperty.call(obj, prop)
}
function isEmpty(value){
if (!value) {
return true;
}
if (isArray(value) && value.length === 0) {
return true;
} else if (typeof value !== 'string') {
for (var i in value) {
if (hasOwnProperty(value, i)) {
return false;
}
}
return true;
}
return false;
}
function toString(type){
return toStr.call(type);
}
function isObject(obj){
return typeof obj === 'object' && toString(obj) === "[object Object]";
}
var isArray = Array.isArray || function(obj){
/*istanbul ignore next:cant test*/
return toStr.call(obj) === '[object Array]';
}
function isBoolean(obj){
return typeof obj === 'boolean' || toString(obj) === '[object Boolean]';
}
function getKey(key){
var intKey = parseInt(key);
if (intKey.toString() === key) {
return intKey;
}
return key;
}
function factory(options) {
options = options || {}
var objectPath = function(obj) {
return Object.keys(objectPath).reduce(function(proxy, prop) {
if(prop === 'create') {
return proxy;
}
/*istanbul ignore else*/
if (typeof objectPath[prop] === 'function') {
proxy[prop] = objectPath[prop].bind(objectPath, obj);
}
return proxy;
}, {});
};
function hasShallowProperty(obj, prop) {
return (options.includeInheritedProps || (typeof prop === 'number' && Array.isArray(obj)) || hasOwnProperty(obj, prop))
}
function getShallowProperty(obj, prop) {
if (hasShallowProperty(obj, prop)) {
return obj[prop];
}
}
function set(obj, path, value, doNotReplace){
if (typeof path === 'number') {
path = [path];
}
if (!path || path.length === 0) {
return obj;
}
if (typeof path === 'string') {
return set(obj, path.split('.').map(getKey), value, doNotReplace);
}
var currentPath = path[0];
var currentValue = getShallowProperty(obj, currentPath);
if (path.length === 1) {
if (currentValue === void 0 || !doNotReplace) {
obj[currentPath] = value;
}
return currentValue;
}
if (currentValue === void 0) {
//check if we assume an array
if(typeof path[1] === 'number') {
obj[currentPath] = [];
} else {
obj[currentPath] = {};
}
}
return set(obj[currentPath], path.slice(1), value, doNotReplace);
}
objectPath.has = function (obj, path) {
if (typeof path === 'number') {
path = [path];
} else if (typeof path === 'string') {
path = path.split('.');
}
if (!path || path.length === 0) {
return !!obj;
}
for (var i = 0; i < path.length; i++) {
var j = getKey(path[i]);
if((typeof j === 'number' && isArray(obj) && j < obj.length) ||
(options.includeInheritedProps ? (j in Object(obj)) : hasOwnProperty(obj, j))) {
obj = obj[j];
} else {
return false;
}
}
return true;
};
objectPath.ensureExists = function (obj, path, value){
return set(obj, path, value, true);
};
objectPath.set = function (obj, path, value, doNotReplace){
return set(obj, path, value, doNotReplace);
};
objectPath.insert = function (obj, path, value, at){
var arr = objectPath.get(obj, path);
at = ~~at;
if (!isArray(arr)) {
arr = [];
objectPath.set(obj, path, arr);
}
arr.splice(at, 0, value);
};
objectPath.empty = function(obj, path) {
if (isEmpty(path)) {
return void 0;
}
if (obj == null) {
return void 0;
}
var value, i;
if (!(value = objectPath.get(obj, path))) {
return void 0;
}
if (typeof value === 'string') {
return objectPath.set(obj, path, '');
} else if (isBoolean(value)) {
return objectPath.set(obj, path, false);
} else if (typeof value === 'number') {
return objectPath.set(obj, path, 0);
} else if (isArray(value)) {
value.length = 0;
} else if (isObject(value)) {
for (i in value) {
if (hasShallowProperty(value, i)) {
delete value[i];
}
}
} else {
return objectPath.set(obj, path, null);
}
};
objectPath.push = function (obj, path /*, values */){
var arr = objectPath.get(obj, path);
if (!isArray(arr)) {
arr = [];
objectPath.set(obj, path, arr);
}
arr.push.apply(arr, Array.prototype.slice.call(arguments, 2));
};
objectPath.coalesce = function (obj, paths, defaultValue) {
var value;
for (var i = 0, len = paths.length; i < len; i++) {
if ((value = objectPath.get(obj, paths[i])) !== void 0) {
return value;
}
}
return defaultValue;
};
objectPath.get = function (obj, path, defaultValue){
if (typeof path === 'number') {
path = [path];
}
if (!path || path.length === 0) {
return obj;
}
if (obj == null) {
return defaultValue;
}
if (typeof path === 'string') {
return objectPath.get(obj, path.split('.'), defaultValue);
}
var currentPath = getKey(path[0]);
var nextObj = getShallowProperty(obj, currentPath)
if (nextObj === void 0) {
return defaultValue;
}
if (path.length === 1) {
return nextObj;
}
return objectPath.get(obj[currentPath], path.slice(1), defaultValue);
};
objectPath.del = function del(obj, path) {
if (typeof path === 'number') {
path = [path];
}
if (obj == null) {
return obj;
}
if (isEmpty(path)) {
return obj;
}
if(typeof path === 'string') {
return objectPath.del(obj, path.split('.'));
}
var currentPath = getKey(path[0]);
if (!hasShallowProperty(obj, currentPath)) {
return obj;
}
if(path.length === 1) {
if (isArray(obj)) {
obj.splice(currentPath, 1);
} else {
delete obj[currentPath];
}
} else {
return objectPath.del(obj[currentPath], path.slice(1));
}
return obj;
}
return objectPath;
}
var mod = factory();
mod.create = factory;
mod.withInheritedProps = factory({includeInheritedProps: true})
return mod;
});
/***/ }),
/* 111 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _shallowequal = __webpack_require__(112);
var _shallowequal2 = _interopRequireDefault(_shallowequal);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
record: _propTypes2['default'].object,
clsPrefix: _propTypes2['default'].string,
expandable: _propTypes2['default'].any,
expanded: _propTypes2['default'].bool,
needIndentSpaced: _propTypes2['default'].bool,
onExpand: _propTypes2['default'].func
};
var ExpandIcon = function (_Component) {
_inherits(ExpandIcon, _Component);
function ExpandIcon(props) {
_classCallCheck(this, ExpandIcon);
return _possibleConstructorReturn(this, _Component.call(this, props));
}
ExpandIcon.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
return !(0, _shallowequal2['default'])(nextProps, this.props);
};
ExpandIcon.prototype.render = function render() {
var _props = this.props,
expandable = _props.expandable,
clsPrefix = _props.clsPrefix,
onExpand = _props.onExpand,
needIndentSpaced = _props.needIndentSpaced,
expanded = _props.expanded,
record = _props.record;
if (expandable) {
var expandClassName = expanded ? 'expanded' : 'collapsed';
return _react2['default'].createElement('span', {
className: clsPrefix + '-expand-icon ' + clsPrefix + '-' + expandClassName,
onClick: function onClick(e) {
return onExpand(!expanded, record, e);
}
});
} else if (needIndentSpaced) {
return _react2['default'].createElement('span', { className: clsPrefix + '-expand-icon ' + clsPrefix + '-spaced' });
}
return null;
};
return ExpandIcon;
}(_react.Component);
;
ExpandIcon.propTypes = propTypes;
exports['default'] = ExpandIcon;
module.exports = exports['default'];
/***/ }),
/* 112 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var fetchKeys = __webpack_require__(113);
module.exports = function shallowEqual(objA, objB, compare, compareContext) {
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
if (ret !== void 0) {
return !!ret;
}
if (objA === objB) {
return true;
}
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;
}
var keysA = fetchKeys(objA);
var keysB = fetchKeys(objB);
var len = keysA.length;
if (len !== keysB.length) {
return false;
}
compareContext = compareContext || null;
// Test for A's keys different from B.
var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
for (var i = 0; i < len; i++) {
var key = keysA[i];
if (!bHasOwnProperty(key)) {
return false;
}
var valueA = objA[key];
var valueB = objB[key];
var _ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
if (_ret === false || _ret === void 0 && valueA !== valueB) {
return false;
}
}
return true;
};
/***/ }),
/* 113 */
/***/ (function(module, exports, __webpack_require__) {
/**
* lodash 3.1.2 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.8.3
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
var getNative = __webpack_require__(114),
isArguments = __webpack_require__(115),
isArray = __webpack_require__(116);
/** Used to detect unsigned integer values. */
var reIsUint = /^\d+$/;
/** Used for native method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/* Native method references for those with the same name as other `lodash` methods. */
var nativeKeys = getNative(Object, 'keys');
/**
* Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
* of an array-like value.
*/
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
* that affects Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
/**
* Checks if `value` is array-like.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
*/
function isArrayLike(value) {
return value != null && isLength(getLength(value));
}
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
length = length == null ? MAX_SAFE_INTEGER : length;
return value > -1 && value % 1 == 0 && value < length;
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
*/
function isLength(value) {
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* A fallback implementation of `Object.keys` which creates an array of the
* own enumerable property names of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function shimKeys(object) {
var props = keysIn(object),
propsLength = props.length,
length = propsLength && object.length;
var allowIndexes = !!length && isLength(length) &&
(isArray(object) || isArguments(object));
var index = -1,
result = [];
while (++index < propsLength) {
var key = props[index];
if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
result.push(key);
}
}
return result;
}
/**
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(1);
* // => false
*/
function isObject(value) {
// Avoid a V8 JIT bug in Chrome 19-20.
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
* for more details.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
var keys = !nativeKeys ? shimKeys : function(object) {
var Ctor = object == null ? undefined : object.constructor;
if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
(typeof object != 'function' && isArrayLike(object))) {
return shimKeys(object);
}
return isObject(object) ? nativeKeys(object) : [];
};
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keysIn(new Foo);
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/
function keysIn(object) {
if (object == null) {
return [];
}
if (!isObject(object)) {
object = Object(object);
}
var length = object.length;
length = (length && isLength(length) &&
(isArray(object) || isArguments(object)) && length) || 0;
var Ctor = object.constructor,
index = -1,
isProto = typeof Ctor == 'function' && Ctor.prototype === object,
result = Array(length),
skipIndexes = length > 0;
while (++index < length) {
result[index] = (index + '');
}
for (var key in object) {
if (!(skipIndexes && isIndex(key, length)) &&
!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
module.exports = keys;
/***/ }),
/* 114 */
/***/ (function(module, exports) {
/**
* lodash 3.9.1 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.8.3
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
/** `Object#toString` result references. */
var funcTag = '[object Function]';
/** Used to detect host constructors (Safari > 5). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/**
* Checks if `value` is object-like.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/** Used for native method references. */
var objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var fnToString = Function.prototype.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = object == null ? undefined : object[key];
return isNative(value) ? value : undefined;
}
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in older versions of Chrome and Safari which return 'function' for regexes
// and Safari 8 equivalents which return 'object' for typed array constructors.
return isObject(value) && objToString.call(value) == funcTag;
}
/**
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(1);
* // => false
*/
function isObject(value) {
// Avoid a V8 JIT bug in Chrome 19-20.
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is a native function.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function, else `false`.
* @example
*
* _.isNative(Array.prototype.push);
* // => true
*
* _.isNative(_);
* // => false
*/
function isNative(value) {
if (value == null) {
return false;
}
if (isFunction(value)) {
return reIsNative.test(fnToString.call(value));
}
return isObjectLike(value) && reIsHostCtor.test(value);
}
module.exports = getNative;
/***/ }),
/* 115 */
/***/ (function(module, exports) {
/**
* lodash (Custom Build)
* Build: `lodash modularize exports="npm" -o ./`
* Copyright jQuery Foundation and other contributors
* Released under MIT license
* Based on Underscore.js 1.8.3
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var objectToString = objectProto.toString;
/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
function isArguments(value) {
// Safari 8.1 makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
}
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
/**
* This method is like `_.isArrayLike` except that it also checks if `value`
* is an object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array-like object,
* else `false`.
* @example
*
* _.isArrayLikeObject([1, 2, 3]);
* // => true
*
* _.isArrayLikeObject(document.body.children);
* // => true
*
* _.isArrayLikeObject('abc');
* // => false
*
* _.isArrayLikeObject(_.noop);
* // => false
*/
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8-9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag;
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
module.exports = isArguments;
/***/ }),
/* 116 */
/***/ (function(module, exports) {
/**
* lodash 3.0.4 (Custom Build)
* Build: `lodash modern modularize exports="npm" -o ./`
* Copyright 2012-2015 The Dojo Foundation
* Based on Underscore.js 1.8.3
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license
*/
/** `Object#toString` result references. */
var arrayTag = '[object Array]',
funcTag = '[object Function]';
/** Used to detect host constructors (Safari > 5). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/**
* Checks if `value` is object-like.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
/** Used for native method references. */
var objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var fnToString = Function.prototype.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/* Native method references for those with the same name as other `lodash` methods. */
var nativeIsArray = getNative(Array, 'isArray');
/**
* Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
* of an array-like value.
*/
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = object == null ? undefined : object[key];
return isNative(value) ? value : undefined;
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
*/
function isLength(value) {
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(function() { return arguments; }());
* // => false
*/
var isArray = nativeIsArray || function(value) {
return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
};
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in older versions of Chrome and Safari which return 'function' for regexes
// and Safari 8 equivalents which return 'object' for typed array constructors.
return isObject(value) && objToString.call(value) == funcTag;
}
/**
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(1);
* // => false
*/
function isObject(value) {
// Avoid a V8 JIT bug in Chrome 19-20.
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is a native function.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function, else `false`.
* @example
*
* _.isNative(Array.prototype.push);
* // => true
*
* _.isNative(_);
* // => false
*/
function isNative(value) {
if (value == null) {
return false;
}
if (isFunction(value)) {
return reIsNative.test(fnToString.call(value));
}
return isObjectLike(value) && reIsHostCtor.test(value);
}
module.exports = isArray;
/***/ }),
/* 117 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _shallowequal = __webpack_require__(112);
var _shallowequal2 = _interopRequireDefault(_shallowequal);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
clsPrefix: _propTypes2['default'].string,
rowStyle: _propTypes2['default'].object,
rows: _propTypes2['default'].array
};
var TableHeader = function (_Component) {
_inherits(TableHeader, _Component);
function TableHeader(props) {
_classCallCheck(this, TableHeader);
return _possibleConstructorReturn(this, _Component.call(this, props));
}
TableHeader.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
return !(0, _shallowequal2['default'])(nextProps, this.props);
};
TableHeader.prototype.render = function render() {
var _props = this.props,
clsPrefix = _props.clsPrefix,
rowStyle = _props.rowStyle,
rows = _props.rows;
return _react2['default'].createElement(
'thead',
{ className: clsPrefix + '-thead' },
rows.map(function (row, index) {
return _react2['default'].createElement(
'tr',
{ key: index, style: rowStyle },
row.map(function (cellProps, i) {
return _react2['default'].createElement('th', _extends({}, cellProps, { key: i }));
})
);
})
);
};
return TableHeader;
}(_react.Component);
;
TableHeader.propTypes = propTypes;
exports['default'] = TableHeader;
module.exports = exports['default'];
/***/ }),
/* 118 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.measureScrollbar = measureScrollbar;
exports.debounce = debounce;
exports.warningOnce = warningOnce;
var _warning = __webpack_require__(31);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var scrollbarWidth = void 0;
// Measure scrollbar width for padding body during modal show/hide
var scrollbarMeasure = {
position: 'absolute',
top: '-9999px',
width: '50px',
height: '50px',
overflow: 'scroll'
};
function measureScrollbar() {
if (typeof document === 'undefined' || typeof window === 'undefined') {
return 0;
}
if (scrollbarWidth) {
return scrollbarWidth;
}
var scrollDiv = document.createElement('div');
for (var scrollProp in scrollbarMeasure) {
if (scrollbarMeasure.hasOwnProperty(scrollProp)) {
scrollDiv.style[scrollProp] = scrollbarMeasure[scrollProp];
}
}
document.body.appendChild(scrollDiv);
var width = scrollDiv.offsetWidth - scrollDiv.clientWidth;
document.body.removeChild(scrollDiv);
scrollbarWidth = width;
return scrollbarWidth;
}
function debounce(func, wait, immediate) {
var timeout = void 0;
return function debounceFunc() {
var context = this;
var args = arguments;
// https://fb.me/react-event-pooling
if (args[0] && args[0].persist) {
args[0].persist();
}
var later = function later() {
timeout = null;
if (!immediate) {
func.apply(context, args);
}
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) {
func.apply(context, args);
}
};
}
var warned = {};
function warningOnce(condition, format, args) {
if (!warned[format]) {
(0, _warning2['default'])(condition, format, args);
warned[format] = true;
}
}
/***/ }),
/* 119 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _Column = __webpack_require__(120);
var _Column2 = _interopRequireDefault(_Column);
var _ColumnGroup = __webpack_require__(121);
var _ColumnGroup2 = _interopRequireDefault(_ColumnGroup);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
//行控制管理
var ColumnManager = function () {
function ColumnManager(columns, elements) {
_classCallCheck(this, ColumnManager);
this._cached = {};
this.columns = columns || this.normalize(elements);
}
ColumnManager.prototype.isAnyColumnsFixed = function isAnyColumnsFixed() {
var _this = this;
return this._cache('isAnyColumnsFixed', function () {
return _this.columns.some(function (column) {
return !!column.fixed;
});
});
};
ColumnManager.prototype.isAnyColumnsLeftFixed = function isAnyColumnsLeftFixed() {
var _this2 = this;
return this._cache('isAnyColumnsLeftFixed', function () {
return _this2.columns.some(function (column) {
return column.fixed === 'left' || column.fixed === true;
});
});
};
ColumnManager.prototype.isAnyColumnsRightFixed = function isAnyColumnsRightFixed() {
var _this3 = this;
return this._cache('isAnyColumnsRightFixed', function () {
return _this3.columns.some(function (column) {
return column.fixed === 'right';
});
});
};
ColumnManager.prototype.leftColumns = function leftColumns() {
var _this4 = this;
return this._cache('leftColumns', function () {
return _this4.groupedColumns().filter(function (column) {
return column.fixed === 'left' || column.fixed === true;
});
});
};
ColumnManager.prototype.rightColumns = function rightColumns() {
var _this5 = this;
return this._cache('rightColumns', function () {
return _this5.groupedColumns().filter(function (column) {
return column.fixed === 'right';
});
});
};
ColumnManager.prototype.leafColumns = function leafColumns() {
var _this6 = this;
return this._cache('leafColumns', function () {
return _this6._leafColumns(_this6.columns);
});
};
ColumnManager.prototype.leftLeafColumns = function leftLeafColumns() {
var _this7 = this;
return this._cache('leftLeafColumns', function () {
return _this7._leafColumns(_this7.leftColumns());
});
};
ColumnManager.prototype.rightLeafColumns = function rightLeafColumns() {
var _this8 = this;
return this._cache('rightLeafColumns', function () {
return _this8._leafColumns(_this8.rightColumns());
});
};
// add appropriate rowspan and colspan to column
ColumnManager.prototype.groupedColumns = function groupedColumns() {
var _this9 = this;
return this._cache('groupedColumns', function () {
var _groupColumns = function _groupColumns(columns) {
var currentRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
var parentColumn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var rows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
// track how many rows we got
rows[currentRow] = rows[currentRow] || [];
var grouped = [];
var setRowSpan = function setRowSpan(column) {
var rowSpan = rows.length - currentRow;
if (column && !column.children && // parent columns are supposed to be one row
rowSpan > 1 && (!column.rowSpan || column.rowSpan < rowSpan)) {
column.rowSpan = rowSpan;
}
};
columns.forEach(function (column, index) {
var newColumn = _extends({}, column);
rows[currentRow].push(newColumn);
parentColumn.colSpan = parentColumn.colSpan || 0;
if (newColumn.children && newColumn.children.length > 0) {
newColumn.children = _groupColumns(newColumn.children, currentRow + 1, newColumn, rows);
parentColumn.colSpan = parentColumn.colSpan + newColumn.colSpan;
} else {
parentColumn.colSpan++;
}
// update rowspan to all same row columns
for (var i = 0; i < rows[currentRow].length - 1; ++i) {
setRowSpan(rows[currentRow][i]);
}
// last column, update rowspan immediately
if (index + 1 === columns.length) {
setRowSpan(newColumn);
}
grouped.push(newColumn);
});
return grouped;
};
return _groupColumns(_this9.columns);
});
};
ColumnManager.prototype.normalize = function normalize(elements) {
var _this10 = this;
var columns = [];
_react2['default'].Children.forEach(elements, function (element) {
if (!_this10.isColumnElement(element)) return;
var column = _extends({}, element.props);
if (element.key) {
column.key = element.key;
}
if (element.type === _ColumnGroup2['default']) {
column.children = _this10.normalize(column.children);
}
columns.push(column);
});
return columns;
};
ColumnManager.prototype.isColumnElement = function isColumnElement(element) {
return element && (element.type === _Column2['default'] || element.type === _ColumnGroup2['default']);
};
ColumnManager.prototype.reset = function reset(columns, elements) {
this.columns = columns || this.normalize(elements);
this._cached = {};
};
ColumnManager.prototype._cache = function _cache(name, fn) {
if (name in this._cached) {
return this._cached[name];
}
this._cached[name] = fn();
return this._cached[name];
};
ColumnManager.prototype._leafColumns = function _leafColumns(columns) {
var _this11 = this;
var leafColumns = [];
columns.forEach(function (column) {
if (!column.children) {
leafColumns.push(column);
} else {
leafColumns.push.apply(leafColumns, _toConsumableArray(_this11._leafColumns(column.children)));
}
});
return leafColumns;
};
return ColumnManager;
}();
exports['default'] = ColumnManager;
module.exports = exports['default'];
/***/ }),
/* 120 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
className: _propTypes2['default'].string,
colSpan: _propTypes2['default'].number,
title: _propTypes2['default'].node,
dataIndex: _propTypes2['default'].string,
width: _propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].string]),
fixed: _propTypes2['default'].oneOf([true, 'left', 'right']),
render: _propTypes2['default'].func,
onCellClick: _propTypes2['default'].func
};
var Column = function (_Component) {
_inherits(Column, _Component);
function Column() {
_classCallCheck(this, Column);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
return Column;
}(_react.Component);
Column.propTypes = propTypes;
exports['default'] = Column;
module.exports = exports['default'];
/***/ }),
/* 121 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var ColumnGroup = function (_Component) {
_inherits(ColumnGroup, _Component);
function ColumnGroup() {
_classCallCheck(this, ColumnGroup);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
return ColumnGroup;
}(_react.Component);
ColumnGroup.propTypes = {
title: _propTypes2['default'].node
};
exports['default'] = ColumnGroup;
module.exports = exports['default'];
/***/ }),
/* 122 */
/***/ (function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports["default"] = createStore;
function createStore(initialState) {
var state = initialState;
var listeners = [];
function setState(partial) {
state = _extends({}, state, partial);
for (var i = 0; i < listeners.length; i++) {
listeners[i]();
}
}
function getState() {
return state;
}
function subscribe(listener) {
listeners.push(listener);
return function unsubscribe() {
var index = listeners.indexOf(listener);
listeners.splice(index, 1);
};
}
return {
setState: setState,
getState: getState,
subscribe: subscribe
};
}
module.exports = exports["default"];
/***/ }),
/* 123 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 无数据时显示
* @description 无数据时显示效果展示(可自定义)
*
* import {Table} from 'tinper-bee';
*/
var columns10 = [{
title: "Name",
dataIndex: "name",
key: "name",
width: "40%"
}, {
title: "Age",
dataIndex: "age",
key: "age",
width: "30%"
}, {
title: "Address",
dataIndex: "address",
key: "address"
}];
var data10 = [];
var emptyFunc = function emptyFunc() {
return _react2['default'].createElement(
'span',
null,
'\u8FD9\u91CC\u6CA1\u6709\u6570\u636E\uFF01'
);
};
var Demo10 = function (_Component) {
_inherits(Demo10, _Component);
function Demo10() {
_classCallCheck(this, Demo10);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
Demo10.prototype.render = function render() {
return _react2['default'].createElement(_src2['default'], { columns: columns10, data: data10, emptyText: emptyFunc });
};
return Demo10;
}(_react.Component);
exports['default'] = Demo10;
module.exports = exports['default'];
/***/ }),
/* 124 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
var _beeIcon = __webpack_require__(125);
var _beeIcon2 = _interopRequireDefault(_beeIcon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 列排序
* @description 点击列的上下按钮即可排序
*
*/
var columns11 = [{
title: "名字",
dataIndex: "a",
key: "a",
width: 100
}, {
title: "性别",
dataIndex: "b",
key: "b",
width: 100
}, {
title: "年龄",
dataIndex: "c",
key: "c",
width: 200,
sorter: function sorter(a, b) {
return a.c - b.c;
}
}, {
title: "武功级别",
dataIndex: "d",
key: "d"
}];
var data11 = [{ a: "杨过", b: "男", c: 30, d: '内行', key: "2" }, { a: "令狐冲", b: "男", c: 41, d: '大侠', key: "1" }, { a: "郭靖", b: "男", c: 25, d: '大侠', key: "3" }];
var defaultProps11 = {
prefixCls: "bee-table"
};
var Demo11 = function (_Component) {
_inherits(Demo11, _Component);
function Demo11(props) {
_classCallCheck(this, Demo11);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.toggleSortOrder = function (order, column) {
var _this$state = _this.state,
sortOrder = _this$state.sortOrder,
data = _this$state.data,
oldData = _this$state.oldData;
var ascend_sort = function ascend_sort(key) {
return function (a, b) {
return a.key - b.key;
};
};
var descend_sort = function descend_sort(key) {
return function (a, b) {
return b.key - a.key;
};
};
if (sortOrder === order) {
// 切换为未排序状态
order = "";
}
if (!oldData) {
oldData = data.concat();
}
if (order === "ascend") {
data = data.sort(function (a, b) {
return column.sorter(a, b);
});
} else if (order === "descend") {
data = data.sort(function (a, b) {
return column.sorter(b, a);
});
} else {
data = oldData.concat();
}
_this.setState({
sortOrder: order,
data: data,
oldData: oldData
});
};
_this.state = {
sortOrder: "",
data: data11
};
return _this;
}
Demo11.prototype.renderColumnsDropdown = function renderColumnsDropdown(columns) {
var _this2 = this;
var sortOrder = this.state.sortOrder;
var prefixCls = this.props.prefixCls;
return columns.map(function (originColumn) {
var column = _extends({}, originColumn);
var sortButton = void 0;
if (column.sorter) {
var isAscend = sortOrder === "ascend";
var isDescend = sortOrder === "descend";
sortButton = _react2['default'].createElement(
'div',
{ className: prefixCls + '-column-sorter' },
_react2['default'].createElement(
'span',
{
className: prefixCls + '-column-sorter-up ' + (isAscend ? "on" : "off"),
title: '\u2191',
onClick: function onClick() {
return _this2.toggleSortOrder("ascend", column);
}
},
_react2['default'].createElement(_beeIcon2['default'], { type: 'uf-triangle-up' })
),
_react2['default'].createElement(
'span',
{
className: prefixCls + '-column-sorter-down ' + (isDescend ? "on" : "off"),
title: '\u2193',
onClick: function onClick() {
return _this2.toggleSortOrder("descend", column);
}
},
_react2['default'].createElement(_beeIcon2['default'], { type: 'uf-triangle-down' })
)
);
}
column.title = _react2['default'].createElement(
'span',
null,
column.title,
sortButton
);
return column;
});
};
Demo11.prototype.render = function render() {
var columns = this.renderColumnsDropdown(columns11);
return _react2['default'].createElement(_src2['default'], { columns: columns, data: this.state.data });
};
return Demo11;
}(_react.Component);
Demo11.defaultProps = defaultProps11;
exports['default'] = Demo11;
module.exports = exports['default'];
/***/ }),
/* 125 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Icon = __webpack_require__(126);
var _Icon2 = _interopRequireDefault(_Icon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports["default"] = _Icon2["default"];
module.exports = exports['default'];
/***/ }),
/* 126 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
type: _propTypes2["default"].string
};
/**
* badge 默认显示内容1
*/
var defaultProps = {
clsPrefix: 'uf'
};
var Icon = function (_Component) {
_inherits(Icon, _Component);
function Icon(props) {
_classCallCheck(this, Icon);
return _possibleConstructorReturn(this, _Component.call(this, props));
}
Icon.prototype.render = function render() {
var _props = this.props,
type = _props.type,
className = _props.className,
clsPrefix = _props.clsPrefix,
others = _objectWithoutProperties(_props, ['type', 'className', 'clsPrefix']);
var clsObj = {};
var classNames = (0, _classnames2["default"])(clsPrefix, type);
return _react2["default"].createElement('i', _extends({}, others, { className: (0, _classnames2["default"])(classNames, className) }));
};
return Icon;
}(_react.Component);
Icon.defaultProps = defaultProps;
Icon.propTypes = propTypes;
exports["default"] = Icon;
module.exports = exports['default'];
/***/ }),
/* 127 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
var _beeCheckbox = __webpack_require__(128);
var _beeCheckbox2 = _interopRequireDefault(_beeCheckbox);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 全选功能
* @description 点击表格左列按钮即可选中,并且在选中的回调函数中能获取到选中的数据(未使用封装好的全选功能)
*
*/
var columns12 = [{
title: "名字",
dataIndex: "a",
key: "a",
width: 100
}, {
title: "性别",
dataIndex: "b",
key: "b",
width: 100
}, {
title: "年龄",
dataIndex: "c",
key: "c",
width: 200,
sorter: function sorter(a, b) {
return a.c - b.c;
}
}, {
title: "武功级别",
dataIndex: "d",
key: "d"
}];
var data12 = [{ a: "杨过", b: "男", c: 30, d: '内行', key: "2" }, { a: "令狐冲", b: "男", c: 41, d: '大侠', key: "1" }, { a: "郭靖", b: "男", c: 25, d: '大侠', key: "3" }];
var defaultProps12 = {
prefixCls: "bee-table",
multiSelect: {
type: "checkbox",
param: "key"
}
};
var Demo12 = function (_Component) {
_inherits(Demo12, _Component);
function Demo12(props) {
_classCallCheck(this, Demo12);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.onAllCheckChange = function () {
var self = _this;
var checkedArray = [];
var listData = self.state.data.concat();
var selIds = [];
// let id = self.props.multiSelect.param;
for (var i = 0; i < self.state.checkedArray.length; i++) {
checkedArray[i] = !self.state.checkedAll;
}
// if (self.state.checkedAll) {
// selIds = [];
// } else {
// for (var i = 0; i < listData.length; i++) {
// selIds[i] = listData[i][id];
// }
// }
self.setState({
checkedAll: !self.state.checkedAll,
checkedArray: checkedArray
// selIds: selIds
});
// self.props.onSelIds(selIds);
};
_this.onCheckboxChange = function (text, record, index) {
var self = _this;
var allFlag = false;
// let selIds = self.state.selIds;
// let id = self.props.postId;
var checkedArray = self.state.checkedArray.concat();
// if (self.state.checkedArray[index]) {
// selIds.remove(record[id]);
// } else {
// selIds.push(record[id]);
// }
checkedArray[index] = !self.state.checkedArray[index];
for (var i = 0; i < self.state.checkedArray.length; i++) {
if (!checkedArray[i]) {
allFlag = false;
break;
} else {
allFlag = true;
}
}
self.setState({
checkedAll: allFlag,
checkedArray: checkedArray
// selIds: selIds
});
// self.props.onSelIds(selIds);
};
_this.state = {
checkedAll: false,
checkedArray: [false, false, false],
data: data12
};
return _this;
}
Demo12.prototype.renderColumnsMultiSelect = function renderColumnsMultiSelect(columns) {
var _this2 = this;
var _state = this.state,
data = _state.data,
checkedArray = _state.checkedArray;
var multiSelect = this.props.multiSelect;
var select_column = {};
var indeterminate_bool = false;
// let indeterminate_bool1 = true;
if (multiSelect && multiSelect.type === "checkbox") {
var i = checkedArray.length;
while (i--) {
if (checkedArray[i]) {
indeterminate_bool = true;
break;
}
}
var defaultColumns = [{
title: _react2['default'].createElement(_beeCheckbox2['default'], {
className: 'table-checkbox',
checked: this.state.checkedAll,
indeterminate: indeterminate_bool && !this.state.checkedAll,
onChange: this.onAllCheckChange
}),
key: "checkbox",
dataIndex: "checkbox",
width: "5%",
render: function render(text, record, index) {
return _react2['default'].createElement(_beeCheckbox2['default'], {
className: 'table-checkbox',
checked: _this2.state.checkedArray[index],
onChange: _this2.onCheckboxChange.bind(_this2, text, record, index)
});
}
}];
columns = defaultColumns.concat(columns);
}
return columns;
};
Demo12.prototype.render = function render() {
var columns = this.renderColumnsMultiSelect(columns12);
return _react2['default'].createElement(_src2['default'], { columns: columns, data: data12 });
};
return Demo12;
}(_react.Component);
Demo12.defaultProps = defaultProps12;
exports['default'] = Demo12;
module.exports = exports['default'];
/***/ }),
/* 128 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Checkbox = __webpack_require__(129);
var _Checkbox2 = _interopRequireDefault(_Checkbox);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports["default"] = _Checkbox2["default"];
module.exports = exports['default'];
/***/ }),
/* 129 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _tinperBeeCore = __webpack_require__(26);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
//import warning from 'warning';
var propTypes = {
colors: _propTypes2["default"].oneOf(['', 'dark', 'success', 'info', 'warning', 'danger', 'primary']),
disabled: _propTypes2["default"].bool
};
var defaultProps = {
disabled: false,
colors: 'primary',
clsPrefix: 'u-checkbox',
defaultChecked: false
};
var clsPrefix = 'u-checkbox';
var Checkbox = function (_React$Component) {
_inherits(Checkbox, _React$Component);
function Checkbox(props) {
_classCallCheck(this, Checkbox);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
_this.state = {
checked: 'checked' in props ? props.checked : props.defaultChecked
};
_this.changeState = _this.changeState.bind(_this);
return _this;
}
Checkbox.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProp) {
if (nextProp.hasOwnProperty('checked')) {
this.setState({
checked: nextProp.checked
});
}
};
Checkbox.prototype.changeState = function changeState() {
var _props = this.props,
onChange = _props.onChange,
disabled = _props.disabled;
var checked = this.state.checked;
if (disabled == false) {
this.setState({
checked: !checked
});
}
if (onChange instanceof Function) {
onChange(!this.state.checked);
}
};
Checkbox.prototype.render = function render() {
var _props2 = this.props,
disabled = _props2.disabled,
colors = _props2.colors,
size = _props2.size,
className = _props2.className,
indeterminate = _props2.indeterminate,
children = _props2.children,
checked = _props2.checked,
clsPrefix = _props2.clsPrefix,
onChange = _props2.onChange,
others = _objectWithoutProperties(_props2, ['disabled', 'colors', 'size', 'className', 'indeterminate', 'children', 'checked', 'clsPrefix', 'onChange']);
var input = _react2["default"].createElement('input', _extends({}, others, {
onClick: this.changeState,
type: 'checkbox',
disabled: this.props.disabled
}));
var classes = {
'is-checked': this.state.checked,
disabled: disabled
};
if (colors) {
classes[clsPrefix + '-' + colors] = true;
}
if (size) {
classes[clsPrefix + '-' + size] = true;
}
if (!checked && indeterminate) {
classes[clsPrefix + '-indeterminate'] = true;
}
var classNames = (0, _classnames2["default"])(clsPrefix, classes);
return _react2["default"].createElement(
'label',
{ className: (0, _classnames2["default"])(classNames, className) },
input,
_react2["default"].createElement('label', { className: 'u-checkbox-label' }),
_react2["default"].createElement(
'span',
null,
children
)
);
};
return Checkbox;
}(_react2["default"].Component);
Checkbox.propTypes = propTypes;
Checkbox.defaultProps = defaultProps;
exports["default"] = Checkbox;
module.exports = exports['default'];
/***/ }),
/* 130 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
var _beeCheckbox = __webpack_require__(128);
var _beeCheckbox2 = _interopRequireDefault(_beeCheckbox);
var _beeButton = __webpack_require__(103);
var _beeButton2 = _interopRequireDefault(_beeButton);
var _multiSelect = __webpack_require__(131);
var _multiSelect2 = _interopRequireDefault(_multiSelect);
var _sort = __webpack_require__(132);
var _sort2 = _interopRequireDefault(_sort);
var _sum = __webpack_require__(133);
var _sum2 = _interopRequireDefault(_sum);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 列排序、全选功能、合计
* @description 列排序、全选功能、合计(通过使用的封装好的功能方法实现复杂功能,简单易用!)
*
*/
var columns13 = [{
title: "名字",
dataIndex: "a",
key: "a",
width: 200
}, {
title: "性别",
dataIndex: "b",
key: "b",
width: 200
}, {
title: "年龄",
dataIndex: "c",
key: "c",
width: 200,
sumCol: true,
sorter: function sorter(a, b) {
return a.c - b.c;
}
}, {
title: "武功级别",
dataIndex: "d",
key: "d",
width: 200
}];
var data13 = [{ a: "杨过", b: "男", c: 30, d: "内行", key: "2" }, { a: "令狐冲", b: "男", c: 41, d: "大侠", key: "1" }, { a: "郭靖", b: "男", c: 25, d: "大侠", key: "3" }];
var data13_1 = [{ a: "杨过", b: "男", c: 30, d: "内行", key: "2" }, { a: "杨过", b: "男", c: 30, d: "内行", key: "22" }, { a: "杨过", b: "男", c: 30, d: "内行", key: "222" }, { a: "令狐冲", b: "男", c: 41, d: "大侠", key: "1" }, { a: "郭靖", b: "男", c: 25, d: "大侠", key: "3" }];
//拼接成复杂功能的table组件不能在render中定义,需要像此例子声明在组件的外侧,不然操作state会导致功能出现异常
var ComplexTable = (0, _multiSelect2["default"])((0, _sum2["default"])((0, _sort2["default"])(_src2["default"])));
var Demo13 = function (_Component) {
_inherits(Demo13, _Component);
function Demo13(props) {
_classCallCheck(this, Demo13);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.getSelectedDataFunc = function (data) {
console.log(data);
};
_this.selectDisabled = function (record, index) {
console.log(record);
if (index === 1) {
return true;
}
return false;
};
_this.selectedRow = function (record, index) {
console.log(record);
if (index === 0) {
return true;
}
return false;
};
_this.onClick = function () {
_this.setState({
selectedRow: function selectedRow() {}
});
};
_this.onClick1 = function () {
_this.setState({
selectDisabled: function selectDisabled(record, index) {
console.log(record);
if (index === 2) {
return true;
}
return false;
}
});
};
_this.state = {
data13: data13,
selectedRow: _this.selectedRow,
selectDisabled: _this.selectDisabled
};
return _this;
}
Demo13.prototype.render = function render() {
var multiObj = {
type: "checkbox"
};
return _react2["default"].createElement(
"div",
null,
_react2["default"].createElement(
_beeButton2["default"],
{ className: "editable-add-btn", onClick: this.onClick },
"change selectedRow"
),
_react2["default"].createElement(
_beeButton2["default"],
{
className: "editable-add-btn",
style: { marginLeft: "5px" },
onClick: this.onClick1
},
"change selectDisabled"
),
_react2["default"].createElement(ComplexTable, {
selectDisabled: this.state.selectDisabled,
selectedRow: this.state.selectedRow,
columns: columns13,
data: this.state.data13,
multiSelect: multiObj,
getSelectedDataFunc: this.getSelectedDataFunc
})
);
};
return Demo13;
}(_react.Component);
exports["default"] = Demo13;
module.exports = exports["default"];
/***/ }),
/* 131 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports["default"] = multiSelect;
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _beeCheckbox = __webpack_require__(128);
var _beeCheckbox2 = _interopRequireDefault(_beeCheckbox);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
/**
* multiSelect={
* type--默认值为checkbox
* param--可以设置返回的选中的数据属性;默认值:null;
* }
* getSelectedDataFunc--function,能获取到选中的数据
* 使用全选时得注意,data中的key值一定要是唯一值
*/
function multiSelect(Table) {
var _class, _temp, _initialiseProps;
Array.prototype.indexOf = function (val) {
for (var i = 0; i < this.length; i++) {
if (this[i] == val) return i;
}
return -1;
};
Array.prototype.remove = function (val) {
var index = this.indexOf(val);
if (index > -1) {
this.splice(index, 1);
}
};
return _temp = _class = function (_Component) {
_inherits(multiSelect, _Component);
function multiSelect(props) {
_classCallCheck(this, multiSelect);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_initialiseProps.call(_this);
var data = props.data,
checkedObj = _this.initCheckedObj(props);
_this.state = {
checkedAll: false,
checkedObj: checkedObj,
selIds: [],
data: _this.props.data
};
return _this;
}
multiSelect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var props = this.props,
selectDisabled = props.selectDisabled,
selectedRow = props.selectedRow,
data = props.data,
checkedObj = {};
if (nextProps.data !== data || nextProps.selectDisabled !== selectDisabled || nextProps.selectedRow !== selectedRow) {
checkedObj = this.initCheckedObj(nextProps);
this.setState({
checkedAll: false,
checkedObj: checkedObj,
selIds: [],
data: nextProps.data
});
}
};
multiSelect.prototype.renderColumnsMultiSelect = function renderColumnsMultiSelect(columns) {
var _this2 = this;
var data = this.state.data;
var checkedObj = _extends({}, this.state.checkedObj);
var checkedArray = Object.keys(checkedObj);
var multiSelect = this.props.multiSelect;
var select_column = {};
var indeterminate_bool = false;
if (!multiSelect || !multiSelect.type) {
multiSelect = _extends({}, multiSelect, { type: "checkbox" });
}
if (multiSelect && multiSelect.type === "checkbox") {
var i = checkedArray.length;
while (i--) {
if (checkedObj[checkedArray[i]]) {
indeterminate_bool = true;
break;
}
}
var defaultColumns = [{
title: _react2["default"].createElement(_beeCheckbox2["default"], {
className: "table-checkbox",
checked: this.state.checkedAll,
indeterminate: indeterminate_bool && !this.state.checkedAll,
onChange: this.onAllCheckChange
}),
key: "checkbox",
dataIndex: "checkbox",
width: "100px",
render: function render(text, record, index) {
var bool = checkedObj.hasOwnProperty(record["key"]);
return _react2["default"].createElement(_beeCheckbox2["default"], {
className: "table-checkbox",
checked: checkedObj[record.key],
disabled: !bool,
onChange: _this2.onCheckboxChange.bind(_this2, text, record, index)
});
}
}];
columns = defaultColumns.concat(columns);
}
return columns;
};
multiSelect.prototype.render = function render() {
var columns = this.renderColumnsMultiSelect(this.props.columns).concat();
return _react2["default"].createElement(Table, _extends({}, this.props, { columns: columns }));
};
return multiSelect;
}(_react.Component), _initialiseProps = function _initialiseProps() {
var _this3 = this;
this.initCheckedObj = function (props) {
var checkedObj = {},
selectDisabled = props.selectDisabled,
selectedRow = props.selectedRow,
data = props.data;
for (var i = 0; i < data.length; i++) {
var bool = selectDisabled && selectDisabled(data[i], i) || false;
if (!bool) {
checkedObj[data[i]["key"]] = selectedRow && selectedRow(data[i], i) || false;
}
}
return checkedObj;
};
this.onAllCheckChange = function () {
var self = _this3;
var listData = self.state.data.concat();
var checkedObj = _extends({}, self.state.checkedObj);
var data = self.props.data;
var selIds = [];
var id = self.props.multiSelect.param;
if (self.state.checkedAll) {
selIds = [];
} else {
for (var i = 0; i < listData.length; i++) {
if (id) {
selIds[i] = listData[i][id];
} else {
selIds[i] = listData[i];
}
}
}
for (var i = 0; i < data.length; i++) {
var bool = checkedObj.hasOwnProperty(data[i]["key"]);
if (!bool) {
selIds.splice(i, 1);
} else {
checkedObj[data[i]["key"]] = !self.state.checkedAll;
}
}
self.setState({
checkedAll: !self.state.checkedAll,
checkedObj: checkedObj,
selIds: selIds
});
self.props.getSelectedDataFunc(selIds);
};
this.onCheckboxChange = function (text, record, index) {
var self = _this3;
var allFlag = false;
var selIds = self.state.selIds;
var id = self.props.multiSelect ? self.props.multiSelect.param ? record[self.props.multiSelect.param] : record : record;
var checkedObj = _extends({}, self.state.checkedObj);
var checkedArray = Object.keys(checkedObj);
var getSelectedDataFunc = self.props.getSelectedDataFunc;
if (checkedObj[record["key"]]) {
selIds.remove(id);
} else {
selIds.push(id);
}
checkedObj[record["key"]] = !checkedObj[record["key"]];
for (var i = 0; i < checkedArray.length; i++) {
if (!checkedObj[checkedArray[i]]) {
allFlag = false;
break;
} else {
allFlag = true;
}
}
self.setState({
checkedAll: allFlag,
checkedObj: checkedObj,
selIds: selIds
});
if (typeof getSelectedDataFunc === "function") {
getSelectedDataFunc(selIds);
}
};
}, _temp;
}
module.exports = exports["default"];
/***/ }),
/* 132 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports["default"] = sort;
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _beeIcon = __webpack_require__(125);
var _beeIcon2 = _interopRequireDefault(_beeIcon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
/**
* 参数:prefixCls,默认bee-table,用于设置图标的样式
* @param {*} Table
*/
function sort(Table) {
return function (_Component) {
_inherits(Demo11, _Component);
function Demo11(props) {
_classCallCheck(this, Demo11);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.toggleSortOrder = function (order, column) {
var _this$state = _this.state,
sortOrder = _this$state.sortOrder,
data = _this$state.data,
oldData = _this$state.oldData;
var ascend_sort = function ascend_sort(key) {
return function (a, b) {
return a.key - b.key;
};
};
var descend_sort = function descend_sort(key) {
return function (a, b) {
return b.key - a.key;
};
};
if (sortOrder === order) {
// 切换为未排序状态
order = "";
}
if (!oldData) {
oldData = data.concat();
}
if (order === "ascend") {
data = data.sort(function (a, b) {
return column.sorter(a, b);
});
} else if (order === "descend") {
data = data.sort(function (a, b) {
return column.sorter(b, a);
});
} else {
data = oldData.concat();
}
_this.setState({
sortOrder: order,
data: data,
oldData: oldData
});
};
_this.state = {
sortOrder: "",
data: _this.props.data
};
return _this;
}
Demo11.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (nextProps.data !== this.props.data) {
this.setState({
sortOrder: "",
data: nextProps.data,
oldData: nextProps.data.concat()
});
}
};
Demo11.prototype.renderColumnsDropdown = function renderColumnsDropdown(columns) {
var _this2 = this;
var sortOrder = this.state.sortOrder;
var prefixCls = this.props.prefixCls || "bee-table";
return columns.map(function (originColumn) {
var column = _extends({}, originColumn);
var sortButton = void 0;
if (column.sorter) {
var isAscend = sortOrder === "ascend";
var isDescend = sortOrder === "descend";
sortButton = _react2["default"].createElement(
"div",
{ className: prefixCls + "-column-sorter" },
_react2["default"].createElement(
"span",
{
className: prefixCls + "-column-sorter-up " + (isAscend ? "on" : "off"),
title: "\u2191",
onClick: function onClick() {
return _this2.toggleSortOrder("ascend", column);
}
},
_react2["default"].createElement(_beeIcon2["default"], { type: "uf-triangle-up" })
),
_react2["default"].createElement(
"span",
{
className: prefixCls + "-column-sorter-down " + (isDescend ? "on" : "off"),
title: "\u2193",
onClick: function onClick() {
return _this2.toggleSortOrder("descend", column);
}
},
_react2["default"].createElement(_beeIcon2["default"], { type: "uf-triangle-down" })
)
);
}
column.title = _react2["default"].createElement(
"span",
null,
column.title,
sortButton
);
return column;
});
};
Demo11.prototype.render = function render() {
var columns = this.renderColumnsDropdown(this.props.columns.concat());
return _react2["default"].createElement(Table, _extends({}, this.props, { columns: columns, data: this.state.data }));
};
return Demo11;
}(_react.Component);
}
module.exports = exports["default"];
/***/ }),
/* 133 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports["default"] = sum;
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
//创建新列存放 “合计” 字段
var columns2 = {
title: "合计",
key: "showSum",
dataIndex: "showSum"
};
function sum(Table) {
return function (_React$Component) {
_inherits(SumTable, _React$Component);
//无状态
function SumTable(props) {
_classCallCheck(this, SumTable);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
_this.currentFooter = function () {
var data_2 = _this.props.data;
var columns_sum = _this.props.columns.concat();
var sumCol_index = void 0;
//用一个对象存储合计数据,这里合计对象的属性对应每列字段
for (var i = 0; i < columns_sum.length; i++) {
if (columns_sum[i].sumCol) {
sumCol_index = columns_sum[i].dataIndex;
break;
}
}
var obj = {};
obj[sumCol_index] = 0;
if (Array.isArray(data_2)) {
for (var _i = 0; _i < data_2.length; _i++) {
if (typeof data_2[_i][sumCol_index] == "number" || !isNaN(data_2[_i][sumCol_index])) {
obj[sumCol_index] -= -data_2[_i][sumCol_index];
} else {
obj[sumCol_index] = "";
}
}
}
obj.key = "sumData";
obj.showSum = "合计";
obj = [obj];
//将设置的和用户传入的合并属性
columns_sum[0] = _extends({}, columns_sum[0], columns2);
//除去列为特殊渲染的,避免像a标签这种html代码写入到合计中
columns_sum.map(function (item, index) {
if (typeof item.render == "function" && !item.sumCol) {
item.render = "";
}
return item;
});
return _react2["default"].createElement(Table, _extends({}, _this.props, { footerScroll: true, showHeader: false, columns: columns_sum, data: obj }));
};
return _this;
}
//合计数字列,并将计算所得数据存储到一个obj对象中
SumTable.prototype.render = function render() {
return _react2["default"].createElement(Table, _extends({}, this.props, {
footerScroll: true,
columns: this.props.columns,
data: this.props.data,
footer: this.currentFooter
}));
};
return SumTable;
}(_react2["default"].Component);
}
module.exports = exports["default"];
/***/ }),
/* 134 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _beeButton = __webpack_require__(103);
var _beeButton2 = _interopRequireDefault(_beeButton);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
var _beeAnimate = __webpack_require__(135);
var _beeAnimate2 = _interopRequireDefault(_beeAnimate);
var _beeTooltip = __webpack_require__(140);
var _beeTooltip2 = _interopRequireDefault(_beeTooltip);
var _beeIcon = __webpack_require__(125);
var _beeIcon2 = _interopRequireDefault(_beeIcon);
var _beeFormControl = __webpack_require__(164);
var _beeFormControl2 = _interopRequireDefault(_beeFormControl);
var _beeCheckbox = __webpack_require__(128);
var _beeCheckbox2 = _interopRequireDefault(_beeCheckbox);
var _beeSelect = __webpack_require__(166);
var _beeSelect2 = _interopRequireDefault(_beeSelect);
var _InputRender = __webpack_require__(198);
var _InputRender2 = _interopRequireDefault(_InputRender);
var _DateRender = __webpack_require__(211);
var _DateRender2 = _interopRequireDefault(_DateRender);
var _SelectRender = __webpack_require__(463);
var _SelectRender2 = _interopRequireDefault(_SelectRender);
var _beeDatepicker = __webpack_require__(212);
var _beeDatepicker2 = _interopRequireDefault(_beeDatepicker);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 编辑态表格
* @description 这是带有多种不同格式的编辑态表格(编辑态是通过使用不同的render来达到不同编辑格式)
*
*/
//日期控件引入
var format = "YYYY-MM-DD";
var format2 = "YYYY-MM";
var format3 = "YYYY-MM-DD HH:mm:ss";
var dateInputPlaceholder = "选择日期";
var dateInputPlaceholder2 = "选择年月";
var dataSource = [{
key: "boyuzhou",
value: "jack"
}, {
key: "renhualiu",
value: "lucy"
}, {
key: "yuzhao",
value: "yiminghe"
}];
var Demo14 = function (_React$Component) {
_inherits(Demo14, _React$Component);
function Demo14(props) {
_classCallCheck(this, Demo14);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
_this.check = function (flag, obj) {
console.log(flag);
console.log(obj);
};
_this.onInputChange = function (index, key) {
return function (value) {
var dataSource = [].concat(_toConsumableArray(_this.state.dataSource));
dataSource[index][key] = value;
_this.setState({ dataSource: dataSource });
};
};
_this.onCheckChange = function (index, key) {
return function (value) {
var dataSource = [].concat(_toConsumableArray(_this.state.dataSource));
dataSource[index][key] = value;
_this.setState({ dataSource: dataSource });
};
};
_this.onSelectChange = function (index, key) {
return function (value) {
console.log("selected " + value);
var dataSource = [].concat(_toConsumableArray(_this.state.dataSource));
dataSource[index][key] = value;
_this.setState({ dataSource: dataSource });
};
};
_this.onDateChange = function (d) {
console.log(d);
};
_this.onDateSelect = function (d) {
console.log(d);
};
_this.onDelete = function (index) {
return function () {
var dataSource = [].concat(_toConsumableArray(_this.state.dataSource));
dataSource.splice(index, 1);
_this.setState({ dataSource: dataSource });
};
};
_this.handleAdd = function () {
var _this$state = _this.state,
count = _this$state.count,
dataSource = _this$state.dataSource;
var newData = {
key: count,
name: "\u51E4\u59D0 " + count,
age: 32,
address: "jack",
datepicker: "2017-06-12",
MonthPicker: "2017-02"
};
_this.setState({
dataSource: [].concat(_toConsumableArray(dataSource), [newData]),
count: count + 1
});
};
_this.getBodyWrapper = function (body) {
return _react2["default"].createElement(
_beeAnimate2["default"],
{
transitionName: "move",
component: "tbody",
className: body.props.className
},
body.props.children
);
};
_this.getData = function () {
console.log(_this.state.dataSource);
};
_this.state = {
dataSource: [{
key: "0",
name: "沉鱼",
number: "10",
age: "y",
address: "jack",
datepicker: "2017-06-12",
MonthPicker: "2017-02"
}, {
key: "1",
name: "落雁",
number: "100",
age: "y",
address: "lucy",
datepicker: "2017-06-12",
MonthPicker: "2017-02"
}, {
key: "2",
name: "闭月",
number: "1000",
age: "n",
address: "lucy",
datepicker: "2017-06-12",
MonthPicker: "2017-02"
}, {
key: "3",
name: "羞花",
number: "9999",
age: "y",
address: "lucy",
datepicker: "2017-06-12",
MonthPicker: "2017-02"
}],
count: 4
};
_this.columns = [{
title: "普通输入",
dataIndex: "name",
key: "name",
width: "150px",
render: function render(text, record, index) {
return _react2["default"].createElement(_InputRender2["default"], {
name: "name",
placeholder: "\u8BF7\u8F93\u5165\u59D3\u540D",
value: text,
isclickTrigger: true,
check: _this.check,
onChange: _this.onInputChange(index, "name"),
isRequire: true,
method: "blur",
errorMessage: _react2["default"].createElement(
_beeTooltip2["default"],
{ overlay: "错误提示" },
_react2["default"].createElement(_beeIcon2["default"], { type: "uf-exc-c", className: "" })
),
reg: /^[0-9]+$/
});
}
}, {
title: "货币输入",
dataIndex: "number",
key: "number",
width: "150px",
render: function render(text, record, index) {
return _react2["default"].createElement(_InputRender2["default"], {
format: "Currency",
name: "name",
placeholder: "\u8BF7\u8F93\u5165\u59D3\u540D",
value: text,
isclickTrigger: true,
check: _this.check,
onChange: _this.onInputChange(index, "name"),
isRequire: true,
method: "blur",
errorMessage: _react2["default"].createElement(
_beeTooltip2["default"],
{ overlay: "错误提示" },
_react2["default"].createElement(_beeIcon2["default"], { type: "uf-exc-c", className: "" })
)
});
}
}, {
title: "复选",
dataIndex: "age",
key: "age",
width: "100px",
render: function render(text, record, index) {
return _react2["default"].createElement(_beeCheckbox2["default"], {
checked: record.age,
onChange: _this.onCheckChange(index, "age")
});
}
}, {
title: "下拉框",
dataIndex: "address",
key: "address",
width: "200px",
render: function render(text, record, index) {
return _react2["default"].createElement(
_SelectRender2["default"],
{
dataSource: dataSource,
isclickTrigger: true,
value: text,
onChange: _this.onSelectChange(index, "address")
},
_react2["default"].createElement(
Option,
{ value: "jack" },
"boyuzhou"
),
_react2["default"].createElement(
Option,
{ value: "lucy" },
"renhualiu"
),
_react2["default"].createElement(
Option,
{ value: "disabled", disabled: true },
"Disabled"
),
_react2["default"].createElement(
Option,
{ value: "yiminghe" },
"yuzhao"
)
);
}
}, {
title: "年月日",
dataIndex: "datepicker",
key: "datepicker",
width: "200px",
render: function render(text, record, index) {
return _react2["default"].createElement(_DateRender2["default"], {
value: text,
isclickTrigger: true,
format: format,
onSelect: _this.onDateSelect,
onChange: _this.onDateChange,
placeholder: dateInputPlaceholder
});
}
}, {
title: "年月",
dataIndex: "MonthPicker",
key: "MonthPicker",
width: "200px",
render: function render(text, record, index) {
return _react2["default"].createElement(_DateRender2["default"], {
value: text,
isclickTrigger: true,
format: format2,
onSelect: _this.onSelect,
onChange: _this.onChange,
placeholder: dateInputPlaceholder2
});
}
}];
return _this;
}
Demo14.prototype.render = function render() {
var dataSource = this.state.dataSource;
var columns = this.columns;
return _react2["default"].createElement(
"div",
null,
_react2["default"].createElement(
_beeButton2["default"],
{
className: "editable-add-btn",
type: "ghost",
onClick: this.handleAdd
},
"\u6DFB\u52A0\u4E00\u884C"
),
_react2["default"].createElement(
_beeButton2["default"],
{
style: { marginLeft: "5px" },
className: "editable-add-btn",
type: "ghost",
onClick: this.getData
},
"\u83B7\u53D6\u6570\u636E"
),
_react2["default"].createElement(_src2["default"], {
data: dataSource,
columns: columns,
getBodyWrapper: this.getBodyWrapper
})
);
};
return Demo14;
}(_react2["default"].Component);
exports["default"] = Demo14;
module.exports = exports["default"];
/***/ }),
/* 135 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Animate = __webpack_require__(136);
var _Animate2 = _interopRequireDefault(_Animate);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports["default"] = _Animate2["default"];
module.exports = exports['default'];
/***/ }),
/* 136 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _ChildrenUtils = __webpack_require__(137);
var _AnimateChild = __webpack_require__(138);
var _AnimateChild2 = _interopRequireDefault(_AnimateChild);
var _util = __webpack_require__(139);
var _util2 = _interopRequireDefault(_util);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var defaultKey = 'u_animate_' + Date.now();
function getChildrenFromProps(props) {
var children = props.children;
if (_react2["default"].isValidElement(children)) {
if (!children.key) {
return _react2["default"].cloneElement(children, {
key: defaultKey
});
}
}
return children;
}
function noop() {}
var propTypes = {
component: _propTypes2["default"].any,
animation: _propTypes2["default"].object,
transitionName: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].object]),
transitionEnter: _propTypes2["default"].bool,
transitionAppear: _propTypes2["default"].bool,
exclusive: _propTypes2["default"].bool,
transitionLeave: _propTypes2["default"].bool,
onEnd: _propTypes2["default"].func,
onEnter: _propTypes2["default"].func,
onLeave: _propTypes2["default"].func,
onAppear: _propTypes2["default"].func,
showProp: _propTypes2["default"].string
};
var defaultProps = {
animation: {},
component: 'span',
transitionEnter: true,
transitionLeave: true,
transitionAppear: false,
onEnd: noop,
onEnter: noop,
onLeave: noop,
onAppear: noop
};
var Animate = function (_Component) {
_inherits(Animate, _Component);
function Animate(props) {
_classCallCheck(this, Animate);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.currentlyAnimatingKeys = {};
_this.keysToEnter = [];
_this.keysToLeave = [];
_this.state = {
children: (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(_this.props))
};
_this.performEnter = _this.performEnter.bind(_this);
_this.performAppear = _this.performAppear.bind(_this);
_this.handleDoneAdding = _this.handleDoneAdding.bind(_this);
_this.performLeave = _this.performLeave.bind(_this);
_this.performLeave = _this.performLeave.bind(_this);
_this.handleDoneLeaving = _this.handleDoneLeaving.bind(_this);
_this.isValidChildByKey = _this.isValidChildByKey.bind(_this);
_this.stop = _this.stop.bind(_this);
return _this;
}
Animate.prototype.componentDidMount = function componentDidMount() {
var _this2 = this;
this.mounted = true;
var showProp = this.props.showProp;
var children = this.state.children;
if (showProp) {
children = children.filter(function (child) {
return !!child.props[showProp];
});
}
children.forEach(function (child) {
if (child) {
_this2.performAppear(child.key);
}
});
};
Animate.prototype.componentWillUnmount = function componentWillUnmount() {
this.mounted = false;
};
Animate.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var _this3 = this;
this.nextProps = nextProps;
var nextChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(nextProps));
var props = this.props;
// exclusive needs immediate response
if (props.exclusive) {
Object.keys(this.currentlyAnimatingKeys).forEach(function (key) {
_this3.stop(key);
});
}
var showProp = props.showProp;
var currentlyAnimatingKeys = this.currentlyAnimatingKeys;
// last props children if exclusive
var currentChildren = props.exclusive ? (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props)) : this.state.children;
// in case destroy in showProp mode
var newChildren = [];
if (showProp) {
currentChildren.forEach(function (currentChild) {
var nextChild = currentChild && (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, currentChild.key);
var newChild = void 0;
if ((!nextChild || !nextChild.props[showProp]) && currentChild.props[showProp]) {
newChild = _react2["default"].cloneElement(nextChild || currentChild, _defineProperty({}, showProp, true));
} else {
newChild = nextChild;
}
if (newChild) {
newChildren.push(newChild);
}
});
nextChildren.forEach(function (nextChild) {
if (!nextChild || !(0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, nextChild.key)) {
newChildren.push(nextChild);
}
});
} else {
newChildren = (0, _ChildrenUtils.mergeChildren)(currentChildren, nextChildren);
}
// need render to avoid update
this.setState({
children: newChildren
});
nextChildren.forEach(function (child) {
var key = child && child.key;
if (child && currentlyAnimatingKeys[key]) {
return;
}
var hasPrev = child && (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key);
if (showProp) {
var showInNext = child.props[showProp];
if (hasPrev) {
var showInNow = (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp);
if (!showInNow && showInNext) {
_this3.keysToEnter.push(key);
}
} else if (showInNext) {
_this3.keysToEnter.push(key);
}
} else if (!hasPrev) {
_this3.keysToEnter.push(key);
}
});
currentChildren.forEach(function (child) {
var key = child && child.key;
if (child && currentlyAnimatingKeys[key]) {
return;
}
var hasNext = child && (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, key);
if (showProp) {
var showInNow = child.props[showProp];
if (hasNext) {
var showInNext = (0, _ChildrenUtils.findShownChildInChildrenByKey)(nextChildren, key, showProp);
if (!showInNext && showInNow) {
_this3.keysToLeave.push(key);
}
} else if (showInNow) {
_this3.keysToLeave.push(key);
}
} else if (!hasNext) {
_this3.keysToLeave.push(key);
}
});
};
Animate.prototype.componentDidUpdate = function componentDidUpdate() {
var keysToEnter = this.keysToEnter;
this.keysToEnter = [];
keysToEnter.forEach(this.performEnter);
var keysToLeave = this.keysToLeave;
this.keysToLeave = [];
keysToLeave.forEach(this.performLeave);
};
Animate.prototype.performEnter = function performEnter(key) {
// may already remove by exclusive
if (this.refs[key]) {
this.currentlyAnimatingKeys[key] = true;
this.refs[key].componentWillEnter(this.handleDoneAdding.bind(this, key, 'enter'));
}
};
Animate.prototype.performAppear = function performAppear(key) {
if (this.refs[key]) {
this.currentlyAnimatingKeys[key] = true;
this.refs[key].componentWillAppear(this.handleDoneAdding.bind(this, key, 'appear'));
}
};
Animate.prototype.handleDoneAdding = function handleDoneAdding(key, type) {
var props = this.props;
delete this.currentlyAnimatingKeys[key];
// if update on exclusive mode, skip check
if (props.exclusive && props !== this.nextProps) {
return;
}
var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props));
if (!this.isValidChildByKey(currentChildren, key)) {
// exclusive will not need this
this.performLeave(key);
} else {
if (type === 'appear') {
if (_util2["default"].allowAppearCallback(props)) {
props.onAppear(key);
props.onEnd(key, true);
}
} else {
if (_util2["default"].allowEnterCallback(props)) {
props.onEnter(key);
props.onEnd(key, true);
}
}
}
};
Animate.prototype.performLeave = function performLeave(key) {
// may already remove by exclusive
if (this.refs[key]) {
this.currentlyAnimatingKeys[key] = true;
this.refs[key].componentWillLeave(this.handleDoneLeaving.bind(this, key));
}
};
Animate.prototype.handleDoneLeaving = function handleDoneLeaving(key) {
var props = this.props;
delete this.currentlyAnimatingKeys[key];
// if update on exclusive mode, skip check
if (props.exclusive && props !== this.nextProps) {
return;
}
var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props));
// in case state change is too fast
if (this.isValidChildByKey(currentChildren, key)) {
this.performEnter(key);
} else {
var end = function end() {
if (_util2["default"].allowLeaveCallback(props)) {
props.onLeave(key);
props.onEnd(key, false);
}
};
/* eslint react/no-is-mounted:0 */
if (this.mounted && !(0, _ChildrenUtils.isSameChildren)(this.state.children, currentChildren, props.showProp)) {
this.setState({
children: currentChildren
}, end);
} else {
end();
}
}
};
Animate.prototype.isValidChildByKey = function isValidChildByKey(currentChildren, key) {
var showProp = this.props.showProp;
if (showProp) {
return (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp);
}
return (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key);
};
Animate.prototype.stop = function stop(key) {
delete this.currentlyAnimatingKeys[key];
var component = this.refs[key];
if (component) {
component.stop();
}
};
Animate.prototype.render = function render() {
var props = this.props;
this.nextProps = props;
var stateChildren = this.state.children;
var children = null;
if (stateChildren) {
children = stateChildren.map(function (child) {
if (child === null || child === undefined) {
return child;
}
if (!child.key) {
throw new Error('must set key for children');
}
return _react2["default"].createElement(
_AnimateChild2["default"],
{
key: child.key,
ref: child.key,
animation: props.animation,
transitionName: props.transitionName,
transitionEnter: props.transitionEnter,
transitionAppear: props.transitionAppear,
transitionLeave: props.transitionLeave
},
child
);
});
}
var Component = props.component;
if (Component) {
var passedProps = props;
if (typeof Component === 'string') {
passedProps = {
className: props.className,
style: props.style
};
}
return _react2["default"].createElement(
Component,
passedProps,
children
);
}
return children[0] || null;
};
return Animate;
}(_react.Component);
;
Animate.defaultProps = defaultProps;
Animate.propTypes = Animate.propTypes;
exports["default"] = Animate;
module.exports = exports['default'];
/***/ }),
/* 137 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.toArrayChildren = toArrayChildren;
exports.findChildInChildrenByKey = findChildInChildrenByKey;
exports.findShownChildInChildrenByKey = findShownChildInChildrenByKey;
exports.findHiddenChildInChildrenByKey = findHiddenChildInChildrenByKey;
exports.isSameChildren = isSameChildren;
exports.mergeChildren = mergeChildren;
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function toArrayChildren(children) {
var ret = [];
_react2["default"].Children.forEach(children, function (child) {
ret.push(child);
});
return ret;
}
function findChildInChildrenByKey(children, key) {
var ret = null;
if (children) {
children.forEach(function (child) {
if (ret) {
return;
}
if (child && child.key === key) {
ret = child;
}
});
}
return ret;
}
function findShownChildInChildrenByKey(children, key, showProp) {
var ret = null;
if (children) {
children.forEach(function (child) {
if (child && child.key === key && child.props[showProp]) {
if (ret) {
throw new Error('two child with same key for children');
}
ret = child;
}
});
}
return ret;
}
function findHiddenChildInChildrenByKey(children, key, showProp) {
var found = 0;
if (children) {
children.forEach(function (child) {
if (found) {
return;
}
found = child && child.key === key && !child.props[showProp];
});
}
return found;
}
function isSameChildren(c1, c2, showProp) {
var same = c1.length === c2.length;
if (same) {
c1.forEach(function (child, index) {
var child2 = c2[index];
if (child && child2) {
if (child && !child2 || !child && child2) {
same = false;
} else if (child.key !== child2.key) {
same = false;
} else if (showProp && child.props[showProp] !== child2.props[showProp]) {
same = false;
}
}
});
}
return same;
}
function mergeChildren(prev, next) {
var ret = [];
// For each key of `next`, the list of keys to insert before that key in
// the combined list
var nextChildrenPending = {};
var pendingChildren = [];
prev.forEach(function (child) {
if (child && findChildInChildrenByKey(next, child.key)) {
if (pendingChildren.length) {
nextChildrenPending[child.key] = pendingChildren;
pendingChildren = [];
}
} else {
pendingChildren.push(child);
}
});
next.forEach(function (child) {
if (child && nextChildrenPending.hasOwnProperty(child.key)) {
ret = ret.concat(nextChildrenPending[child.key]);
}
ret.push(child);
});
ret = ret.concat(pendingChildren);
return ret;
}
/***/ }),
/* 138 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _tinperBeeCore = __webpack_require__(26);
var _util = __webpack_require__(139);
var _util2 = _interopRequireDefault(_util);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var transitionMap = {
enter: 'transitionEnter',
appear: 'transitionAppear',
leave: 'transitionLeave'
};
var propTypes = {
children: _propTypes2["default"].any
};
var AnimateChild = function (_Component) {
_inherits(AnimateChild, _Component);
function AnimateChild(props) {
_classCallCheck(this, AnimateChild);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.transition = _this.transition.bind(_this);
_this.stop = _this.stop.bind(_this);
return _this;
}
AnimateChild.prototype.componentWillUnmount = function componentWillUnmount() {
this.stop();
};
AnimateChild.prototype.componentWillEnter = function componentWillEnter(done) {
if (_util2["default"].isEnterSupported(this.props)) {
this.transition('enter', done);
} else {
done();
}
};
AnimateChild.prototype.componentWillAppear = function componentWillAppear(done) {
if (_util2["default"].isAppearSupported(this.props)) {
this.transition('appear', done);
} else {
done();
}
};
AnimateChild.prototype.componentWillLeave = function componentWillLeave(done) {
if (_util2["default"].isLeaveSupported(this.props)) {
this.transition('leave', done);
} else {
// always sync, do not interupt with react component life cycle
// update hidden -> animate hidden ->
// didUpdate -> animate leave -> unmount (if animate is none)
done();
}
};
AnimateChild.prototype.transition = function transition(animationType, finishCallback) {
var _this2 = this;
var node = _reactDom2["default"].findDOMNode(this);
var props = this.props;
var transitionName = props.transitionName;
var nameIsObj = (typeof transitionName === 'undefined' ? 'undefined' : _typeof(transitionName)) === 'object';
this.stop();
var end = function end() {
_this2.stopper = null;
finishCallback();
};
if ((_tinperBeeCore.cssAnimation.isCssAnimationSupported || !props.animation[animationType]) && transitionName && props[transitionMap[animationType]]) {
var name = nameIsObj ? transitionName[animationType] : transitionName + '-' + animationType;
var activeName = name + '-active';
if (nameIsObj && transitionName[animationType + 'Active']) {
activeName = transitionName[animationType + 'Active'];
}
this.stopper = (0, _tinperBeeCore.cssAnimation)(node, {
name: name,
active: activeName
}, end);
} else {
this.stopper = props.animation[animationType](node, end);
}
};
AnimateChild.prototype.stop = function stop() {
var stopper = this.stopper;
if (stopper) {
this.stopper = null;
stopper.stop();
}
};
AnimateChild.prototype.render = function render() {
return this.props.children;
};
return AnimateChild;
}(_react.Component);
;
AnimateChild.propTypes = propTypes;
exports["default"] = AnimateChild;
module.exports = exports['default'];
/***/ }),
/* 139 */
/***/ (function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var util = {
isAppearSupported: function isAppearSupported(props) {
return props.transitionName && props.transitionAppear || props.animation.appear;
},
isEnterSupported: function isEnterSupported(props) {
return props.transitionName && props.transitionEnter || props.animation.enter;
},
isLeaveSupported: function isLeaveSupported(props) {
return props.transitionName && props.transitionLeave || props.animation.leave;
},
allowAppearCallback: function allowAppearCallback(props) {
return props.transitionAppear || props.animation.appear;
},
allowEnterCallback: function allowEnterCallback(props) {
return props.transitionEnter || props.animation.enter;
},
allowLeaveCallback: function allowLeaveCallback(props) {
return props.transitionLeave || props.animation.leave;
}
};
exports["default"] = util;
module.exports = exports["default"];
/***/ }),
/* 140 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Tooltip = __webpack_require__(141);
var _Tooltip2 = _interopRequireDefault(_Tooltip);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports["default"] = _Tooltip2["default"];
module.exports = exports['default'];
/***/ }),
/* 141 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _OverlayTrigger = __webpack_require__(142);
var _OverlayTrigger2 = _interopRequireDefault(_OverlayTrigger);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
/**
* @required
*/
id: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].number]),
inverse: _propTypes2["default"].bool,
/**
* 相对目标元素显示上下左右的位置
*/
placement: _propTypes2["default"].oneOf(['top', 'right', 'bottom', 'left']),
/**
* 绝对定位上边距.
*/
positionTop: _propTypes2["default"].oneOfType([_propTypes2["default"].number, _propTypes2["default"].string]),
/**
* 绝对定位左边距
*/
positionLeft: _propTypes2["default"].oneOfType([_propTypes2["default"].number, _propTypes2["default"].string]),
/**
* 与目标Top的距离
*/
arrowOffsetTop: _propTypes2["default"].oneOfType([_propTypes2["default"].number, _propTypes2["default"].string]),
/**
* 与目标Left的距离
*/
arrowOffsetLeft: _propTypes2["default"].oneOfType([_propTypes2["default"].number, _propTypes2["default"].string])
};
var defaultProps = {
placement: 'right',
clsPrefix: 'u-tooltip'
};
var Tooltip = function (_React$Component) {
_inherits(Tooltip, _React$Component);
function Tooltip() {
_classCallCheck(this, Tooltip);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Tooltip.prototype.render = function render() {
var _classes;
var _props = this.props,
placement = _props.placement,
positionTop = _props.positionTop,
positionLeft = _props.positionLeft,
arrowOffsetTop = _props.arrowOffsetTop,
arrowOffsetLeft = _props.arrowOffsetLeft,
className = _props.className,
style = _props.style,
children = _props.children,
clsPrefix = _props.clsPrefix,
overlay = _props.overlay,
inverse = _props.inverse,
others = _objectWithoutProperties(_props, ['placement', 'positionTop', 'positionLeft', 'arrowOffsetTop', 'arrowOffsetLeft', 'className', 'style', 'children', 'clsPrefix', 'overlay', 'inverse']);
var classes = (_classes = {}, _defineProperty(_classes, placement, true), _defineProperty(_classes, 'inverse', inverse), _classes);
var outerStyle = _extends({
top: positionTop,
left: positionLeft
}, style);
var arrowStyle = {
top: arrowOffsetTop,
left: arrowOffsetLeft
};
var classNames = (0, _classnames2["default"])(clsPrefix, classes);
var overlayNode = _react2["default"].createElement(
'div',
{
className: (0, _classnames2["default"])(className, classNames),
style: outerStyle
},
_react2["default"].createElement('div', { className: 'tooltip-arrow', style: arrowStyle }),
_react2["default"].createElement(
'div',
{ className: 'tooltip-inner' },
overlay
)
);
return _react2["default"].createElement(
_OverlayTrigger2["default"],
_extends({ placement: placement }, others, { overlay: overlayNode }),
children
);
};
return Tooltip;
}(_react2["default"].Component);
Tooltip.propTypes = propTypes;
Tooltip.defaultProps = defaultProps;
exports["default"] = Tooltip;
module.exports = exports['default'];
/***/ }),
/* 142 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _contains = __webpack_require__(143);
var _contains2 = _interopRequireDefault(_contains);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _warning = __webpack_require__(31);
var _warning2 = _interopRequireDefault(_warning);
var _Portal = __webpack_require__(144);
var _Portal2 = _interopRequireDefault(_Portal);
var _Overlay = __webpack_require__(148);
var _Overlay2 = _interopRequireDefault(_Overlay);
var _createChainedFunction = __webpack_require__(163);
var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var isReact16 = _reactDom2["default"].createPortal !== undefined;
var createPortal = isReact16 ? _reactDom2["default"].createPortal : _reactDom2["default"].unstable_renderSubtreeIntoContainer;
/**
* 检查值是属于这个值,还是等于这个值
*
* @param {string} one
* @param {string|array} of
* @returns {boolean}
*/
function isOneOf(one, of) {
if (Array.isArray(of)) {
return of.indexOf(one) >= 0;
}
return one === of;
}
var triggerType = _propTypes2["default"].oneOf(['click', 'hover', 'focus']);
var propTypes = _extends({}, _Portal2["default"].propTypes, _Overlay2["default"].propTypes, {
/**
* 指定哪些操作或操作触发叠加层可见性
*/
trigger: _propTypes2["default"].oneOfType([triggerType, _propTypes2["default"].arrayOf(triggerType)]),
/**
* 显示和隐藏覆盖一旦触发的毫秒延迟量
*/
delay: _propTypes2["default"].number,
/**
* 触发后显示叠加层之前的延迟毫秒
*/
delayShow: _propTypes2["default"].number,
/**
* 触发后隐藏叠加层的延迟毫秒
*/
delayHide: _propTypes2["default"].number,
// FIXME: This should be `defaultShow`.
/**
* 覆盖的初始可见性状态。对于更细微的可见性控制,请考虑直接使用覆盖组件。
*/
defaultOverlayShown: _propTypes2["default"].bool,
/**
* 要覆盖在目标旁边的元素或文本。
*/
overlay: _propTypes2["default"].node.isRequired,
/**
* @private
*/
onBlur: _propTypes2["default"].func,
/**
* @private
*/
onClick: _propTypes2["default"].func,
/**
* @private
*/
onFocus: _propTypes2["default"].func,
/**
* @private
*/
onMouseOut: _propTypes2["default"].func,
/**
* @private
*/
onMouseOver: _propTypes2["default"].func,
// Overridden props from ``.
/**
* @private
*/
target: _propTypes2["default"].oneOf([null]),
/**
* @private
*/
onHide: _propTypes2["default"].oneOf([null]),
/**
* @private
*/
show: _propTypes2["default"].oneOf([null])
});
var defaultProps = {
defaultOverlayShown: false,
trigger: ['hover', 'focus']
};
var OverlayTrigger = function (_Component) {
_inherits(OverlayTrigger, _Component);
function OverlayTrigger(props, context) {
_classCallCheck(this, OverlayTrigger);
var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
_this.handleToggle = _this.handleToggle.bind(_this);
_this.handleDelayedShow = _this.handleDelayedShow.bind(_this);
_this.handleDelayedHide = _this.handleDelayedHide.bind(_this);
_this.handleHide = _this.handleHide.bind(_this);
_this.makeOverlay = _this.makeOverlay.bind(_this);
_this.handleMouseOver = function (e) {
return _this.handleMouseOverOut(_this.handleDelayedShow, e);
};
_this.handleMouseOut = function (e) {
return _this.handleMouseOverOut(_this.handleDelayedHide, e);
};
_this._mountNode = null;
_this.state = {
show: props.defaultOverlayShown
};
return _this;
}
OverlayTrigger.prototype.componentDidMount = function componentDidMount() {
this._mountNode = document.createElement('div');
!isReact16 && this.renderOverlay();
};
OverlayTrigger.prototype.componentDidUpdate = function componentDidUpdate() {
!isReact16 && this.renderOverlay();
};
OverlayTrigger.prototype.componentWillUnmount = function componentWillUnmount() {
!isReact16 && _reactDom2["default"].unmountComponentAtNode(this._mountNode);
this._mountNode = null;
clearTimeout(this._hoverShowDelay);
clearTimeout(this._hoverHideDelay);
};
OverlayTrigger.prototype.handleToggle = function handleToggle() {
if (this.state.show) {
this.hide();
} else {
this.show();
}
};
OverlayTrigger.prototype.handleDelayedShow = function handleDelayedShow() {
var _this2 = this;
if (this._hoverHideDelay != null) {
clearTimeout(this._hoverHideDelay);
this._hoverHideDelay = null;
return;
}
if (this.state.show || this._hoverShowDelay != null) {
return;
}
var delay = this.props.delayShow != null ? this.props.delayShow : this.props.delay;
if (!delay) {
this.show();
return;
}
this._hoverShowDelay = setTimeout(function () {
_this2._hoverShowDelay = null;
_this2.show();
}, delay);
};
OverlayTrigger.prototype.handleDelayedHide = function handleDelayedHide() {
var _this3 = this;
if (this._hoverShowDelay != null) {
clearTimeout(this._hoverShowDelay);
this._hoverShowDelay = null;
return;
}
if (!this.state.show || this._hoverHideDelay != null) {
return;
}
var delay = this.props.delayHide != null ? this.props.delayHide : this.props.delay;
if (!delay) {
this.hide();
return;
}
this._hoverHideDelay = setTimeout(function () {
_this3._hoverHideDelay = null;
_this3.hide();
}, delay);
};
// 简单实现mouseEnter和mouseLeave。
// React的内置版本是有问题的:https://github.com/facebook/react/issues/4251
//在触发器被禁用的情况下,mouseOut / Over可能导致闪烁
//从一个子元素移动到另一个子元素。
OverlayTrigger.prototype.handleMouseOverOut = function handleMouseOverOut(handler, e) {
var target = e.currentTarget;
var related = e.relatedTarget || e.nativeEvent.toElement;
if (!related || related !== target && !(0, _contains2["default"])(target, related)) {
handler(e);
}
};
OverlayTrigger.prototype.handleHide = function handleHide() {
this.hide();
};
OverlayTrigger.prototype.show = function show() {
this.setState({ show: true });
};
OverlayTrigger.prototype.hide = function hide() {
this.setState({ show: false });
};
OverlayTrigger.prototype.makeOverlay = function makeOverlay(overlay, props) {
return _react2["default"].createElement(
_Overlay2["default"],
_extends({}, props, {
show: this.state.show,
onHide: this.handleHide,
target: this
}),
overlay
);
};
OverlayTrigger.prototype.renderOverlay = function renderOverlay() {
_reactDom2["default"].unstable_renderSubtreeIntoContainer(this, this._overlay, this._mountNode);
};
OverlayTrigger.prototype.render = function render() {
var _props = this.props,
trigger = _props.trigger,
overlay = _props.overlay,
children = _props.children,
onBlur = _props.onBlur,
onClick = _props.onClick,
onFocus = _props.onFocus,
onMouseOut = _props.onMouseOut,
onMouseOver = _props.onMouseOver,
props = _objectWithoutProperties(_props, ['trigger', 'overlay', 'children', 'onBlur', 'onClick', 'onFocus', 'onMouseOut', 'onMouseOver']);
delete props.delay;
delete props.delayShow;
delete props.delayHide;
delete props.defaultOverlayShown;
var child = _react2["default"].Children.only(children);
var childProps = child.props;
var triggerProps = {
'aria-describedby': overlay.props.id
};
// FIXME: 这里用于传递这个组件上的处理程序的逻辑是不一致的。我们不应该通过任何这些道具。
triggerProps.onClick = (0, _createChainedFunction2["default"])(childProps.onClick, onClick);
if (isOneOf('click', trigger)) {
triggerProps.onClick = (0, _createChainedFunction2["default"])(triggerProps.onClick, this.handleToggle);
}
if (isOneOf('hover', trigger)) {
(0, _warning2["default"])(!(trigger === 'hover'), '[react-bootstrap] Specifying only the `"hover"` trigger limits the ' + 'visibility of the overlay to just mouse users. Consider also ' + 'including the `"focus"` trigger so that touch and keyboard only ' + 'users can see the overlay as well.');
triggerProps.onMouseOver = (0, _createChainedFunction2["default"])(childProps.onMouseOver, onMouseOver, this.handleMouseOver);
triggerProps.onMouseOut = (0, _createChainedFunction2["default"])(childProps.onMouseOut, onMouseOut, this.handleMouseOut);
}
if (isOneOf('focus', trigger)) {
triggerProps.onFocus = (0, _createChainedFunction2["default"])(childProps.onFocus, onFocus, this.handleDelayedShow);
triggerProps.onBlur = (0, _createChainedFunction2["default"])(childProps.onBlur, onBlur, this.handleDelayedHide);
}
this._overlay = this.makeOverlay(overlay, props);
if (!isReact16) {
return (0, _react.cloneElement)(child, triggerProps);
}
triggerProps.key = 'overlay';
var portal = _react2["default"].createElement(
_Portal2["default"],
{
key: 'portal',
container: props.container },
this._overlay
);
return [(0, _react.cloneElement)(child, triggerProps), portal];
};
return OverlayTrigger;
}(_react.Component);
OverlayTrigger.propTypes = propTypes;
OverlayTrigger.defaultProps = defaultProps;
exports["default"] = OverlayTrigger;
module.exports = exports['default'];
/***/ }),
/* 143 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _inDOM = __webpack_require__(14);
var _inDOM2 = _interopRequireDefault(_inDOM);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function () {
// HTML DOM and SVG DOM may have different support levels,
// so we need to check on context instead of a document root element.
return _inDOM2.default ? function (context, node) {
if (context.contains) {
return context.contains(node);
} else if (context.compareDocumentPosition) {
return context === node || !!(context.compareDocumentPosition(node) & 16);
} else {
return fallback(context, node);
}
} : fallback;
}();
function fallback(context, node) {
if (node) do {
if (node === context) return true;
} while (node = node.parentNode);
return false;
}
module.exports = exports['default'];
/***/ }),
/* 144 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _ownerDocument = __webpack_require__(145);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
var _getContainer = __webpack_require__(147);
var _getContainer2 = _interopRequireDefault(_getContainer);
var _tinperBeeCore = __webpack_require__(26);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var isReact16 = _reactDom2["default"].createPortal !== undefined;
var createPortal = isReact16 ? _reactDom2["default"].createPortal : _reactDom2["default"].unstable_renderSubtreeIntoContainer;
var propTypes = {
/**
* 存放子组件的容器
*/
container: _propTypes2["default"].oneOfType([_tinperBeeCore.componentOrElement, _propTypes2["default"].func])
};
var defaultProps = {};
/**
* Portal组件是将子组件渲染
*/
var Portal = function (_Component) {
_inherits(Portal, _Component);
function Portal(props) {
_classCallCheck(this, Portal);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.getMountNode = _this.getMountNode.bind(_this);
_this.getOverlayDOMNode = _this.getOverlayDOMNode.bind(_this);
_this.mountOverlayTarget = _this.mountOverlayTarget.bind(_this);
_this.unmountOverlayTarget = _this.unmountOverlayTarget.bind(_this);
_this.renderOverlay = _this.renderOverlay.bind(_this);
_this.unrenderOverlay = _this.unrenderOverlay.bind(_this);
_this.overlayTarget = isReact16 ? document.createElement('div') : null;
return _this;
}
Portal.prototype.componentDidMount = function componentDidMount() {
if (isReact16) {
this.portalContainerNode = (0, _getContainer2["default"])(this.props.container, (0, _ownerDocument2["default"])(this).body);
this.portalContainerNode.appendChild(this.overlayTarget);
} else {
this.renderOverlay();
}
this.mounted = true;
};
Portal.prototype.componentDidUpdate = function componentDidUpdate() {
if (isReact16) {
var overlay = !this.props.children ? null : _react2["default"].Children.only(this.props.children);
if (overlay === null) {
this.unrenderOverlay();
this.unmountOverlayTarget();
} else {}
} else {
this.renderOverlay();
}
};
//this._overlayTarget为当前的要添加的子组件, this._portalContainerNode要添加组件的容器元素
Portal.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (this.overlayTarget && nextProps.container !== this.props.container) {
this.portalContainerNode.removeChild(this.overlayTarget);
this.portalContainerNode = (0, _getContainer2["default"])(nextProps.container, (0, _ownerDocument2["default"])(this).body);
this.portalContainerNode.appendChild(this.overlayTarget);
}
};
Portal.prototype.componentWillUnmount = function componentWillUnmount() {
this.unrenderOverlay();
this.unmountOverlayTarget();
this.mounted = false;
};
Portal.prototype.getMountNode = function getMountNode() {
return this.overlayTarget;
};
Portal.prototype.getOverlayDOMNode = function getOverlayDOMNode() {
if (!this.mounted) {
throw new Error('getOverlayDOMNode(): A component must be mounted to have a DOM node.');
}
if (this.overlayInstance) {
return _reactDom2["default"].findDOMNode(this.overlayInstance);
}
return null;
};
/**
* 如果要添加的子组件不存在,就将div添加到要添加容器的DOM中;
*/
Portal.prototype.mountOverlayTarget = function mountOverlayTarget() {
if (!this.overlayTarget) {
this.overlayTarget = document.createElement('div');
this.portalContainerNode = (0, _getContainer2["default"])(this.props.container, (0, _ownerDocument2["default"])(this).body);
this.portalContainerNode.appendChild(this.overlayTarget);
}
};
/**
* 将要添加的子元素从容器中移除,并把变量置为null
*/
Portal.prototype.unmountOverlayTarget = function unmountOverlayTarget() {
if (this.overlayTarget) {
this.portalContainerNode.removeChild(this.overlayTarget);
this.overlayTarget = null;
}
this.portalContainerNode = null;
};
/**
* 手动渲染_overlayTarget
*/
Portal.prototype.renderOverlay = function renderOverlay() {
var overlay = !this.props.children ? null : _react2["default"].Children.only(this.props.children);
// Save reference for future access.
if (overlay !== null) {
this.mountOverlayTarget();
this.overlayInstance = _reactDom2["default"].unstable_renderSubtreeIntoContainer(this, overlay, this.overlayTarget);
} else {
// Unrender if the component is null for transitions to null
this.unrenderOverlay();
this.unmountOverlayTarget();
}
};
/**
* 销毁_overlayTarget组件。并把_overlayInstance置为null
*/
Portal.prototype.unrenderOverlay = function unrenderOverlay() {
if (this.overlayTarget) {
!isReact16 && _reactDom2["default"].unmountComponentAtNode(this.overlayTarget);
this.overlayInstance = null;
}
};
Portal.prototype.render = function render() {
if (!isReact16) {
return null;
}
var overlay = !this.props.children ? null : _react2["default"].Children.only(this.props.children);
return _reactDom2["default"].createPortal(overlay, this.overlayTarget);
};
return Portal;
}(_react.Component);
;
Portal.propTypes = propTypes;
Portal.defaultProps = defaultProps;
exports["default"] = Portal;
module.exports = exports['default'];
/***/ }),
/* 145 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = function (componentOrElement) {
return (0, _ownerDocument2["default"])(_reactDom2["default"].findDOMNode(componentOrElement));
};
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _ownerDocument = __webpack_require__(146);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
module.exports = exports['default'];
/***/ }),
/* 146 */
/***/ (function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ownerDocument;
function ownerDocument(node) {
return node && node.ownerDocument || document;
}
module.exports = exports["default"];
/***/ }),
/* 147 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = getContainer;
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**
* 获取容器组件
* @param {[type]} container [description]
* @param {[type]} defaultContainer [description]
* @return {[type]} [description]
*/
function getContainer(container, defaultContainer) {
container = typeof container === 'function' ? container() : container;
return _reactDom2["default"].findDOMNode(container) || defaultContainer;
}
module.exports = exports['default'];
/***/ }),
/* 148 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _BaseOverlay = __webpack_require__(149);
var _BaseOverlay2 = _interopRequireDefault(_BaseOverlay);
var _tinperBeeCore = __webpack_require__(26);
var _Fade = __webpack_require__(161);
var _Fade2 = _interopRequireDefault(_Fade);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = _extends({}, _BaseOverlay2["default"].propTypes, {
/**
* 是否显示
*/
show: _propTypes2["default"].bool,
/**
* 是
*/
rootClose: _propTypes2["default"].bool,
/**
* 当点击rootClose触发close时的回调函数
*/
onHide: _propTypes2["default"].func,
/**
* 使用动画
*/
animation: _propTypes2["default"].oneOfType([_tinperBeeCore.elementType, _propTypes2["default"].func]),
/**
* Callback fired before the Overlay transitions in
*/
onEnter: _propTypes2["default"].func,
/**
* Callback fired as the Overlay begins to transition in
*/
onEntering: _propTypes2["default"].func,
/**
* Callback fired after the Overlay finishes transitioning in
*/
onEntered: _propTypes2["default"].func,
/**
* Callback fired right before the Overlay transitions out
*/
onExit: _propTypes2["default"].func,
/**
* Callback fired as the Overlay begins to transition out
*/
onExiting: _propTypes2["default"].func,
/**
* Callback fired after the Overlay finishes transitioning out
*/
onExited: _propTypes2["default"].func,
/**
* Sets the direction of the Overlay.
*/
placement: _propTypes2["default"].oneOf(['top', 'right', 'bottom', 'left'])
});
var defaultProps = {
animation: _Fade2["default"],
rootClose: false,
show: false,
placement: 'right'
};
var Overlay = function (_Component) {
_inherits(Overlay, _Component);
function Overlay() {
_classCallCheck(this, Overlay);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
Overlay.prototype.render = function render() {
var _props = this.props,
animation = _props.animation,
children = _props.children,
props = _objectWithoutProperties(_props, ['animation', 'children']);
var transition = animation === true ? _Fade2["default"] : animation || null;
var child = void 0;
if (!transition) {
child = (0, _react.cloneElement)(children, {
className: (0, _classnames2["default"])(children.props.className, 'in')
});
} else {
child = children;
}
return _react2["default"].createElement(
_BaseOverlay2["default"],
_extends({}, props, {
transition: transition
}),
child
);
};
return Overlay;
}(_react.Component);
Overlay.propTypes = propTypes;
Overlay.defaultProps = defaultProps;
exports["default"] = Overlay;
module.exports = exports['default'];
/***/ }),
/* 149 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Portal = __webpack_require__(144);
var _Portal2 = _interopRequireDefault(_Portal);
var _Position = __webpack_require__(150);
var _Position2 = _interopRequireDefault(_Position);
var _RootCloseWrapper = __webpack_require__(158);
var _RootCloseWrapper2 = _interopRequireDefault(_RootCloseWrapper);
var _tinperBeeCore = __webpack_require__(26);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var isReact16 = _reactDom2["default"].createPortal !== undefined;
var propTypes = _extends({}, _Position2["default"].propTypes, {
/**
* 是否显示
*/
show: _propTypes2["default"].bool,
/**
* 点击其他地方,是否隐藏overlay
*/
rootClose: _propTypes2["default"].bool,
/**
* 当rootClose为true的时候,触发的隐藏方法
* @type func
*/
onHide: function onHide(props) {
var propType = _propTypes2["default"].func;
if (props.rootClose) {
propType = propType.isRequired;
}
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return propType.apply(undefined, [props].concat(args));
},
/**
* 过渡动画组件
*/
transition: _propTypes2["default"].oneOfType([_tinperBeeCore.elementType, _propTypes2["default"].func]),
/**
* overlay添加动画前的钩子函数
*/
onEnter: _propTypes2["default"].func,
/**
* 开始动画的钩子函数
*/
onEntering: _propTypes2["default"].func,
/**
* 渲染之后的钩子函数
*/
onEntered: _propTypes2["default"].func,
/**
* 关闭开始时的钩子函数
*/
onExit: _propTypes2["default"].func,
/**
* 关闭时的钩子函数
*/
onExiting: _propTypes2["default"].func,
/**
* 关闭后的钩子函数
*/
onExited: _propTypes2["default"].func
});
function noop() {}
var defaultProps = {
show: false,
rootClose: true
};
/**
* 悬浮组件
*/
var BaseOverlay = function (_Component) {
_inherits(BaseOverlay, _Component);
function BaseOverlay(props, context) {
_classCallCheck(this, BaseOverlay);
var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
_this.state = { exited: !props.show };
_this.onHiddenListener = _this.handleHidden.bind(_this);
return _this;
}
BaseOverlay.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (nextProps.show) {
this.setState({ exited: false });
} else if (!nextProps.transition) {
// Otherwise let handleHidden take care of marking exited.
this.setState({ exited: true });
}
};
BaseOverlay.prototype.handleHidden = function handleHidden() {
this.setState({ exited: true });
if (this.props.onExited) {
var _props;
(_props = this.props).onExited.apply(_props, arguments);
}
};
BaseOverlay.prototype.render = function render() {
var _props2 = this.props,
container = _props2.container,
containerPadding = _props2.containerPadding,
target = _props2.target,
placement = _props2.placement,
shouldUpdatePosition = _props2.shouldUpdatePosition,
rootClose = _props2.rootClose,
positionLeft = _props2.positionLeft,
positionTop = _props2.positionTop,
children = _props2.children,
Transition = _props2.transition,
props = _objectWithoutProperties(_props2, ['container', 'containerPadding', 'target', 'placement', 'shouldUpdatePosition', 'rootClose', 'positionLeft', 'positionTop', 'children', 'transition']);
// Don't un-render the overlay while it's transitioning out.
var mountOverlay = props.show || Transition && !this.state.exited;
if (!mountOverlay) {
// Don't bother showing anything if we don't have to.
return null;
}
var child = children;
// Position is be inner-most because it adds inline styles into the child,
// which the other wrappers don't forward correctly.
child = _react2["default"].createElement(
_Position2["default"],
{
container: container,
containerPadding: containerPadding,
target: target,
positionLeft: positionLeft,
positionTop: positionTop,
placement: placement,
shouldUpdatePosition: shouldUpdatePosition },
child
);
if (Transition) {
var onExit = props.onExit,
onExiting = props.onExiting,
onEnter = props.onEnter,
onEntering = props.onEntering,
onEntered = props.onEntered;
// This animates the child node by injecting props, so it must precede
// anything that adds a wrapping div.
child = _react2["default"].createElement(
Transition,
{
'in': props.show,
transitionAppear: true,
onExit: onExit,
onExiting: onExiting,
onExited: this.onHiddenListener,
onEnter: onEnter,
onEntering: onEntering,
onEntered: onEntered
},
child
);
}
// This goes after everything else because it adds a wrapping div.
if (rootClose) {
child = _react2["default"].createElement(
_RootCloseWrapper2["default"],
{ onRootClose: props.onHide },
child
);
}
if (isReact16) {
return child;
} else {
return _react2["default"].createElement(
_Portal2["default"],
{ container: container },
child
);
}
};
return BaseOverlay;
}(_react.Component);
BaseOverlay.propTypes = propTypes;
BaseOverlay.defaultProps = defaultProps;
exports["default"] = BaseOverlay;
module.exports = exports['default'];
/***/ }),
/* 150 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _tinperBeeCore = __webpack_require__(26);
var _calculatePosition = __webpack_require__(151);
var _calculatePosition2 = _interopRequireDefault(_calculatePosition);
var _getContainer = __webpack_require__(147);
var _getContainer2 = _interopRequireDefault(_getContainer);
var _ownerDocument = __webpack_require__(145);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
/**
* 要设置定位的元素
*/
target: _propTypes2["default"].oneOfType([_tinperBeeCore.componentOrElement, _propTypes2["default"].func]),
/**
* 存放的容器元素
*/
container: _propTypes2["default"].oneOfType([_tinperBeeCore.componentOrElement, _propTypes2["default"].func]),
/**
* 容器padding值
*/
containerPadding: _propTypes2["default"].number,
/**
* 位置设置
*/
placement: _propTypes2["default"].oneOf(['top', 'right', 'bottom', 'left']),
/**
* 是否需要更新位置
*/
shouldUpdatePosition: _propTypes2["default"].bool
};
var defaultProps = {
containerPadding: 0,
placement: 'right',
shouldUpdatePosition: false
};
/**
* 计算子组件的位置的组件
*/
var Position = function (_Component) {
_inherits(Position, _Component);
function Position(props, context) {
_classCallCheck(this, Position);
var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
_this.state = {
positionLeft: 0,
positionTop: 0,
arrowOffsetLeft: null,
arrowOffsetTop: null
};
_this.needsFlush = false;
_this.lastTarget = null;
_this.getTarget = _this.getTarget.bind(_this);
_this.maybeUpdatePosition = _this.maybeUpdatePosition.bind(_this);
_this.updatePosition = _this.updatePosition.bind(_this);
return _this;
}
Position.prototype.componentDidMount = function componentDidMount() {
this.updatePosition(this.getTarget());
};
Position.prototype.componentWillReceiveProps = function componentWillReceiveProps() {
this.needsFlush = true;
};
Position.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
if (this.needsFlush) {
this.needsFlush = false;
this.maybeUpdatePosition();
}
};
/**
* 获取要设置位置的子元素
*/
Position.prototype.getTarget = function getTarget() {
var target = this.props.target;
var targetElement = typeof target === 'function' ? target() : target;
return targetElement && _reactDom2["default"].findDOMNode(targetElement) || null;
};
/**
* 验证是否需要更新位置
*/
Position.prototype.maybeUpdatePosition = function maybeUpdatePosition(placementChanged) {
var target = this.getTarget();
if (!this.props.shouldUpdatePosition && target === this.lastTarget && !placementChanged) {
return;
}
this.updatePosition(target);
};
/**
* 更新位置
*/
Position.prototype.updatePosition = function updatePosition(target) {
this.lastTarget = target;
if (!target) {
this.setState({
positionLeft: 0,
positionTop: 0,
arrowOffsetLeft: null,
arrowOffsetTop: null
});
return;
}
var overlay = _reactDom2["default"].findDOMNode(this);
var container = (0, _getContainer2["default"])(this.props.container, (0, _ownerDocument2["default"])(this).body);
this.setState((0, _calculatePosition2["default"])(this.props.placement, overlay, target, container, this.props.containerPadding));
};
Position.prototype.render = function render() {
var _props = this.props,
children = _props.children,
className = _props.className,
props = _objectWithoutProperties(_props, ['children', 'className']);
var _state = this.state,
positionLeft = _state.positionLeft,
positionTop = _state.positionTop,
arrowPosition = _objectWithoutProperties(_state, ['positionLeft', 'positionTop']);
// These should not be forwarded to the child.
delete props.target;
delete props.container;
delete props.containerPadding;
delete props.shouldUpdatePosition;
var child = _react2["default"].Children.only(children);
return (0, _react.cloneElement)(child, {
className: (0, _classnames2["default"])(className, child.props.className),
style: _extends({}, child.props.style, {
left: positionLeft,
top: positionTop
})
});
};
return Position;
}(_react.Component);
Position.propTypes = propTypes;
Position.defaultProps = defaultProps;
exports["default"] = Position;
module.exports = exports['default'];
/***/ }),
/* 151 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = calculatePosition;
var _offset = __webpack_require__(152);
var _offset2 = _interopRequireDefault(_offset);
var _position = __webpack_require__(154);
var _position2 = _interopRequireDefault(_position);
var _scrollTop = __webpack_require__(156);
var _scrollTop2 = _interopRequireDefault(_scrollTop);
var _ownerDocument = __webpack_require__(145);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function getContainerDimensions(containerNode) {
var width = void 0,
height = void 0,
scroll = void 0;
if (containerNode.tagName === 'BODY') {
width = window.innerWidth;
height = window.innerHeight;
scroll = (0, _scrollTop2["default"])((0, _ownerDocument2["default"])(containerNode).documentElement) || (0, _scrollTop2["default"])(containerNode);
} else {
var _getOffset = (0, _offset2["default"])(containerNode);
width = _getOffset.width;
height = _getOffset.height;
scroll = (0, _scrollTop2["default"])(containerNode);
}
return { width: width, height: height, scroll: scroll };
}
function getTopDelta(top, overlayHeight, container, padding) {
var containerDimensions = getContainerDimensions(container);
var containerScroll = containerDimensions.scroll;
var containerHeight = containerDimensions.height;
var topEdgeOffset = top - padding - containerScroll;
var bottomEdgeOffset = top + padding - containerScroll + overlayHeight;
if (topEdgeOffset < 0) {
return -topEdgeOffset;
} else if (bottomEdgeOffset > containerHeight) {
return containerHeight - bottomEdgeOffset;
} else {
return 0;
}
}
function getLeftDelta(left, overlayWidth, container, padding) {
var containerDimensions = getContainerDimensions(container);
var containerWidth = containerDimensions.width;
var leftEdgeOffset = left - padding;
var rightEdgeOffset = left + padding + overlayWidth;
if (leftEdgeOffset < 0) {
return -leftEdgeOffset;
} else if (rightEdgeOffset > containerWidth) {
return containerWidth - rightEdgeOffset;
}
return 0;
}
function calculatePosition(placement, overlayNode, target, container, padding) {
var childOffset = container.tagName === 'BODY' ? (0, _offset2["default"])(target) : (0, _position2["default"])(target, container);
var _getOffset2 = (0, _offset2["default"])(overlayNode),
overlayHeight = _getOffset2.height,
overlayWidth = _getOffset2.width;
var positionLeft = void 0,
positionTop = void 0,
arrowOffsetLeft = void 0,
arrowOffsetTop = void 0;
if (/^left|^right/.test(placement)) {
positionTop = childOffset.top + (childOffset.height - overlayHeight) / 2;
if (/left/.test(placement)) {
positionLeft = childOffset.left - overlayWidth;
} else {
positionLeft = childOffset.left + childOffset.width;
}
if (/Top/.test(placement)) {
positionTop = childOffset.top;
} else if (/Bottom/.test(placement)) {
positionTop = childOffset.top + childOffset.height - overlayHeight;
}
var topDelta = getTopDelta(positionTop, overlayHeight, container, padding);
positionTop += topDelta;
arrowOffsetTop = 50 * (1 - 2 * topDelta / overlayHeight) + '%';
arrowOffsetLeft = void 0;
} else if (/^top|^bottom/.test(placement)) {
positionLeft = childOffset.left + (childOffset.width - overlayWidth) / 2;
if (/top/.test(placement)) {
positionTop = childOffset.top - overlayHeight;
} else {
positionTop = childOffset.top + childOffset.height;
}
if (/Left/.test(placement)) {
positionLeft = childOffset.left;
} else if (/Right/.test(placement)) {
positionLeft = childOffset.left + (childOffset.width - overlayWidth);
}
var leftDelta = getLeftDelta(positionLeft, overlayWidth, container, padding);
positionLeft += leftDelta;
arrowOffsetLeft = 50 * (1 - 2 * leftDelta / overlayWidth) + '%';
arrowOffsetTop = void 0;
} else {
throw new Error('calcOverlayPosition(): No such placement of "' + placement + '" found.');
}
return { positionLeft: positionLeft, positionTop: positionTop, arrowOffsetLeft: arrowOffsetLeft, arrowOffsetTop: arrowOffsetTop };
}
module.exports = exports['default'];
/***/ }),
/* 152 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = offset;
var _contains = __webpack_require__(143);
var _contains2 = _interopRequireDefault(_contains);
var _isWindow = __webpack_require__(153);
var _isWindow2 = _interopRequireDefault(_isWindow);
var _ownerDocument = __webpack_require__(146);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function offset(node) {
var doc = (0, _ownerDocument2.default)(node),
win = (0, _isWindow2.default)(doc),
docElem = doc && doc.documentElement,
box = { top: 0, left: 0, height: 0, width: 0 };
if (!doc) return;
// Make sure it's not a disconnected DOM node
if (!(0, _contains2.default)(docElem, node)) return box;
if (node.getBoundingClientRect !== undefined) box = node.getBoundingClientRect();
// IE8 getBoundingClientRect doesn't support width & height
box = {
top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0),
left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0),
width: (box.width == null ? node.offsetWidth : box.width) || 0,
height: (box.height == null ? node.offsetHeight : box.height) || 0
};
return box;
}
module.exports = exports['default'];
/***/ }),
/* 153 */
/***/ (function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getWindow;
function getWindow(node) {
return node === node.window ? node : node.nodeType === 9 ? node.defaultView || node.parentWindow : false;
}
module.exports = exports["default"];
/***/ }),
/* 154 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports.default = position;
var _offset = __webpack_require__(152);
var _offset2 = _interopRequireDefault(_offset);
var _offsetParent = __webpack_require__(155);
var _offsetParent2 = _interopRequireDefault(_offsetParent);
var _scrollTop = __webpack_require__(156);
var _scrollTop2 = _interopRequireDefault(_scrollTop);
var _scrollLeft = __webpack_require__(157);
var _scrollLeft2 = _interopRequireDefault(_scrollLeft);
var _style = __webpack_require__(17);
var _style2 = _interopRequireDefault(_style);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function nodeName(node) {
return node.nodeName && node.nodeName.toLowerCase();
}
function position(node, offsetParent) {
var parentOffset = { top: 0, left: 0 },
offset;
// Fixed elements are offset from window (parentOffset = {top:0, left: 0},
// because it is its only offset parent
if ((0, _style2.default)(node, 'position') === 'fixed') {
offset = node.getBoundingClientRect();
} else {
offsetParent = offsetParent || (0, _offsetParent2.default)(node);
offset = (0, _offset2.default)(node);
if (nodeName(offsetParent) !== 'html') parentOffset = (0, _offset2.default)(offsetParent);
parentOffset.top += parseInt((0, _style2.default)(offsetParent, 'borderTopWidth'), 10) - (0, _scrollTop2.default)(offsetParent) || 0;
parentOffset.left += parseInt((0, _style2.default)(offsetParent, 'borderLeftWidth'), 10) - (0, _scrollLeft2.default)(offsetParent) || 0;
}
// Subtract parent offsets and node margins
return _extends({}, offset, {
top: offset.top - parentOffset.top - (parseInt((0, _style2.default)(node, 'marginTop'), 10) || 0),
left: offset.left - parentOffset.left - (parseInt((0, _style2.default)(node, 'marginLeft'), 10) || 0)
});
}
module.exports = exports['default'];
/***/ }),
/* 155 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = offsetParent;
var _ownerDocument = __webpack_require__(146);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
var _style = __webpack_require__(17);
var _style2 = _interopRequireDefault(_style);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function nodeName(node) {
return node.nodeName && node.nodeName.toLowerCase();
}
function offsetParent(node) {
var doc = (0, _ownerDocument2.default)(node),
offsetParent = node && node.offsetParent;
while (offsetParent && nodeName(node) !== 'html' && (0, _style2.default)(offsetParent, 'position') === 'static') {
offsetParent = offsetParent.offsetParent;
}
return offsetParent || doc.documentElement;
}
module.exports = exports['default'];
/***/ }),
/* 156 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = scrollTop;
var _isWindow = __webpack_require__(153);
var _isWindow2 = _interopRequireDefault(_isWindow);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function scrollTop(node, val) {
var win = (0, _isWindow2.default)(node);
if (val === undefined) return win ? 'pageYOffset' in win ? win.pageYOffset : win.document.documentElement.scrollTop : node.scrollTop;
if (win) win.scrollTo('pageXOffset' in win ? win.pageXOffset : win.document.documentElement.scrollLeft, val);else node.scrollTop = val;
}
module.exports = exports['default'];
/***/ }),
/* 157 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = scrollTop;
var _isWindow = __webpack_require__(153);
var _isWindow2 = _interopRequireDefault(_isWindow);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function scrollTop(node, val) {
var win = (0, _isWindow2.default)(node);
if (val === undefined) return win ? 'pageXOffset' in win ? win.pageXOffset : win.document.documentElement.scrollLeft : node.scrollLeft;
if (win) win.scrollTo(val, 'pageYOffset' in win ? win.pageYOffset : win.document.documentElement.scrollTop);else node.scrollLeft = val;
}
module.exports = exports['default'];
/***/ }),
/* 158 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _contains = __webpack_require__(143);
var _contains2 = _interopRequireDefault(_contains);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _addEventListener = __webpack_require__(159);
var _addEventListener2 = _interopRequireDefault(_addEventListener);
var _ownerDocument = __webpack_require__(145);
var _ownerDocument2 = _interopRequireDefault(_ownerDocument);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
onRootClose: _propTypes2["default"].func,
children: _propTypes2["default"].element,
/**
* 是否禁用
*/
disabled: _propTypes2["default"].bool,
/**
* 触发事件选择
*/
event: _propTypes2["default"].oneOf(['click', 'mousedown'])
};
var defaultProps = {
event: 'click'
};
function isLeftClickEvent(event) {
return event.button === 0;
}
function isModifiedEvent(event) {
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
}
var RootCloseWrapper = function (_Component) {
_inherits(RootCloseWrapper, _Component);
function RootCloseWrapper(props, context) {
_classCallCheck(this, RootCloseWrapper);
var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
_this.handleMouseCapture = function (e) {
_this.preventMouseRootClose = isModifiedEvent(e) || !isLeftClickEvent(e) || (0, _contains2["default"])(_reactDom2["default"].findDOMNode(_this), e.target);
};
_this.handleMouse = function () {
if (!_this.preventMouseRootClose && _this.props.onRootClose) {
_this.props.onRootClose();
}
};
_this.handleKeyUp = function (e) {
if (e.keyCode === 27 && _this.props.onRootClose) {
_this.props.onRootClose();
}
};
_this.preventMouseRootClose = false;
_this.addEventListeners = _this.addEventListeners.bind(_this);
_this.removeEventListeners = _this.removeEventListeners.bind(_this);
return _this;
}
RootCloseWrapper.prototype.componentDidMount = function componentDidMount() {
if (!this.props.disabled) {
this.addEventListeners();
}
};
RootCloseWrapper.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
if (!this.props.disabled && prevProps.disabled) {
this.addEventListeners();
} else if (this.props.disabled && !prevProps.disabled) {
this.removeEventListeners();
}
};
RootCloseWrapper.prototype.componentWillUnmount = function componentWillUnmount() {
if (!this.props.disabled) {
this.removeEventListeners();
}
};
RootCloseWrapper.prototype.addEventListeners = function addEventListeners() {
var event = this.props.event;
var doc = (0, _ownerDocument2["default"])(this);
// 避免react的监听事件触发引起判断的不准确
this.documentMouseCaptureListener = (0, _addEventListener2["default"])(doc, event, this.handleMouseCapture, true);
this.documentMouseListener = (0, _addEventListener2["default"])(doc, event, this.handleMouse);
this.documentKeyupListener = (0, _addEventListener2["default"])(doc, 'keyup', this.handleKeyUp);
};
RootCloseWrapper.prototype.removeEventListeners = function removeEventListeners() {
if (this.documentMouseCaptureListener) {
this.documentMouseCaptureListener.remove();
}
if (this.documentMouseListener) {
this.documentMouseListener.remove();
}
if (this.documentKeyupListener) {
this.documentKeyupListener.remove();
}
};
RootCloseWrapper.prototype.render = function render() {
return this.props.children;
};
return RootCloseWrapper;
}(_react.Component);
RootCloseWrapper.propTypes = propTypes;
RootCloseWrapper.defaultProps = defaultProps;
exports["default"] = RootCloseWrapper;
module.exports = exports['default'];
/***/ }),
/* 159 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = function (node, event, handler, capture) {
(0, _on2["default"])(node, event, handler, capture);
return {
remove: function remove() {
(0, _off2["default"])(node, event, handler, capture);
}
};
};
var _on = __webpack_require__(15);
var _on2 = _interopRequireDefault(_on);
var _off = __webpack_require__(160);
var _off2 = _interopRequireDefault(_off);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
module.exports = exports['default'];
/***/ }),
/* 160 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _inDOM = __webpack_require__(14);
var _inDOM2 = _interopRequireDefault(_inDOM);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var off = function off() {};
if (_inDOM2.default) {
off = function () {
if (document.addEventListener) return function (node, eventName, handler, capture) {
return node.removeEventListener(eventName, handler, capture || false);
};else if (document.attachEvent) return function (node, eventName, handler) {
return node.detachEvent('on' + eventName, handler);
};
}();
}
exports.default = off;
module.exports = exports['default'];
/***/ }),
/* 161 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _Transition = __webpack_require__(162);
var _Transition2 = _interopRequireDefault(_Transition);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
/**
* Show the component; triggers the fade in or fade out animation
*/
"in": _propTypes2["default"].bool,
/**
* Unmount the component (remove it from the DOM) when it is faded out
*/
unmountOnExit: _propTypes2["default"].bool,
/**
* Run the fade in animation when the component mounts, if it is initially
* shown
*/
transitionAppear: _propTypes2["default"].bool,
/**
* Duration of the fade animation in milliseconds, to ensure that finishing
* callbacks are fired even if the original browser transition end events are
* canceled
*/
timeout: _propTypes2["default"].number,
/**
* Callback fired before the component fades in
*/
onEnter: _propTypes2["default"].func,
/**
* Callback fired after the component starts to fade in
*/
onEntering: _propTypes2["default"].func,
/**
* Callback fired after the has component faded in
*/
onEntered: _propTypes2["default"].func,
/**
* Callback fired before the component fades out
*/
onExit: _propTypes2["default"].func,
/**
* Callback fired after the component starts to fade out
*/
onExiting: _propTypes2["default"].func,
/**
* Callback fired after the component has faded out
*/
onExited: _propTypes2["default"].func
};
var defaultProps = {
"in": false,
timeout: 300,
unmountOnExit: false,
transitionAppear: false
};
var Fade = function (_React$Component) {
_inherits(Fade, _React$Component);
function Fade() {
_classCallCheck(this, Fade);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Fade.prototype.render = function render() {
return _react2["default"].createElement(_Transition2["default"], _extends({}, this.props, {
className: (0, _classnames2["default"])(this.props.className, 'fade'),
enteredClassName: 'in',
enteringClassName: 'in'
}));
};
return Fade;
}(_react2["default"].Component);
Fade.propTypes = propTypes;
Fade.defaultProps = defaultProps;
exports["default"] = Fade;
module.exports = exports['default'];
/***/ }),
/* 162 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = undefined;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _properties = __webpack_require__(13);
var _properties2 = _interopRequireDefault(_properties);
var _on = __webpack_require__(15);
var _on2 = _interopRequireDefault(_on);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var transitionEndEvent = _properties2["default"].end;
//设置状态码
var UNMOUNTED = exports.UNMOUNTED = 0;
var EXITED = exports.EXITED = 1;
var ENTERING = exports.ENTERING = 2;
var ENTERED = exports.ENTERED = 3;
var EXITING = exports.EXITING = 4;
var propTypes = {
/**
* 是否触发动画
*/
"in": _propTypes2["default"].bool,
/**
* 不显示的时候是否移除组件
*/
unmountOnExit: _propTypes2["default"].bool,
/**
* 如果设置为默认显示,挂载时显示动画
*/
transitionAppear: _propTypes2["default"].bool,
/**
* 设置超时时间,防止出现问题,可设置为>=动画时间
*/
timeout: _propTypes2["default"].number,
/**
* 退出组件时添加的class
*/
exitedClassName: _propTypes2["default"].string,
/**
* 退出组件中添加的class
*/
exitingClassName: _propTypes2["default"].string,
/**
* 进入动画后添加的class
*/
enteredClassName: _propTypes2["default"].string,
/**
* 进入动画时添加的class
*/
enteringClassName: _propTypes2["default"].string,
/**
* 进入动画开始时的钩子函数
*/
onEnter: _propTypes2["default"].func,
/**
* 进入动画中的钩子函数
*/
onEntering: _propTypes2["default"].func,
/**
* 进入动画后的钩子函数
*/
onEntered: _propTypes2["default"].func,
/**
* 退出动画开始时的钩子函数
*/
onExit: _propTypes2["default"].func,
/**
* 退出动画中的钩子函数
*/
onExiting: _propTypes2["default"].func,
/**
* 退出动画后的钩子函数
*/
onExited: _propTypes2["default"].func
};
function noop() {}
var defaultProps = {
"in": false,
unmountOnExit: false,
transitionAppear: false,
timeout: 5000,
onEnter: noop,
onEntering: noop,
onEntered: noop,
onExit: noop,
onExiting: noop,
onExited: noop
};
/**
* 动画组件
*/
var Transition = function (_Component) {
_inherits(Transition, _Component);
function Transition(props, context) {
_classCallCheck(this, Transition);
var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
var initialStatus = void 0;
if (props["in"]) {
// 在componentdidmount时开始执行动画
initialStatus = props.transitionAppear ? EXITED : ENTERED;
} else {
initialStatus = props.unmountOnExit ? UNMOUNTED : EXITED;
}
_this.state = { status: initialStatus };
_this.nextCallback = null;
_this.performEnter = _this.performEnter.bind(_this);
_this.performExit = _this.performExit.bind(_this);
_this.cancelNextCallback = _this.cancelNextCallback.bind(_this);
_this.onTransitionEnd = _this.onTransitionEnd.bind(_this);
_this.safeSetState = _this.safeSetState.bind(_this);
_this.setNextCallback = _this.setNextCallback.bind(_this);
return _this;
}
Transition.prototype.componentDidMount = function componentDidMount() {
if (this.props.transitionAppear && this.props["in"]) {
this.performEnter(this.props);
}
};
Transition.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (nextProps["in"] && this.props.unmountOnExit) {
if (this.state.status === UNMOUNTED) {
// 在componentDidUpdate执行动画.
this.setState({ status: EXITED });
}
} else {
this._needsUpdate = true;
}
};
Transition.prototype.componentDidUpdate = function componentDidUpdate() {
var status = this.state.status;
if (this.props.unmountOnExit && status === EXITED) {
// 当使用unmountOnExit时,exited为exiting和unmont的过渡状态
if (this.props["in"]) {
this.performEnter(this.props);
} else {
this.setState({ status: UNMOUNTED });
}
return;
}
// 确保只响应prop变化
if (this._needsUpdate) {
this._needsUpdate = false;
if (this.props["in"]) {
if (status === EXITING) {
this.performEnter(this.props);
} else if (status === EXITED) {
this.performEnter(this.props);
}
// 其他,当我们已经输入或输出
} else {
if (status === ENTERING || status === ENTERED) {
this.performExit(this.props);
}
// 我们已经输入或输出完成
}
}
};
Transition.prototype.componentWillUnmount = function componentWillUnmount() {
this.cancelNextCallback();
};
Transition.prototype.performEnter = function performEnter(props) {
var _this2 = this;
this.cancelNextCallback();
var node = _reactDom2["default"].findDOMNode(this);
// 这里接收新props
props.onEnter(node);
this.safeSetState({ status: ENTERING }, function () {
_this2.props.onEntering(node);
_this2.onTransitionEnd(node, function () {
_this2.safeSetState({ status: ENTERED }, function () {
_this2.props.onEntered(node);
});
});
});
};
Transition.prototype.performExit = function performExit(props) {
var _this3 = this;
this.cancelNextCallback();
var node = _reactDom2["default"].findDOMNode(this);
props.onExit(node);
this.safeSetState({ status: EXITING }, function () {
_this3.props.onExiting(node);
_this3.onTransitionEnd(node, function () {
_this3.safeSetState({ status: EXITED }, function () {
_this3.props.onExited(node);
});
});
});
};
Transition.prototype.cancelNextCallback = function cancelNextCallback() {
if (this.nextCallback !== null) {
this.nextCallback.cancel();
this.nextCallback = null;
}
};
Transition.prototype.safeSetState = function safeSetState(nextState, callback) {
// 确保在组件销毁后挂起的setState被消除
this.setState(nextState, this.setNextCallback(callback));
};
Transition.prototype.setNextCallback = function setNextCallback(callback) {
var _this4 = this;
var active = true;
this.nextCallback = function (event) {
if (active) {
active = false;
_this4.nextCallback = null;
callback(event);
}
};
this.nextCallback.cancel = function () {
active = false;
};
return this.nextCallback;
};
Transition.prototype.onTransitionEnd = function onTransitionEnd(node, handler) {
this.setNextCallback(handler);
if (node) {
(0, _on2["default"])(node, transitionEndEvent, this.nextCallback);
setTimeout(this.nextCallback, this.props.timeout);
} else {
setTimeout(this.nextCallback, 0);
}
};
Transition.prototype.render = function render() {
var status = this.state.status;
if (status === UNMOUNTED) {
return null;
}
var _props = this.props,
children = _props.children,
className = _props.className,
childProps = _objectWithoutProperties(_props, ['children', 'className']);
Object.keys(Transition.propTypes).forEach(function (key) {
return delete childProps[key];
});
var transitionClassName = void 0;
if (status === EXITED) {
transitionClassName = this.props.exitedClassName;
} else if (status === ENTERING) {
transitionClassName = this.props.enteringClassName;
} else if (status === ENTERED) {
transitionClassName = this.props.enteredClassName;
} else if (status === EXITING) {
transitionClassName = this.props.exitingClassName;
}
var child = _react2["default"].Children.only(children);
return _react2["default"].cloneElement(child, _extends({}, childProps, {
className: (0, _classnames2["default"])(child.props.className, className, transitionClassName)
}));
};
return Transition;
}(_react.Component);
Transition.propTypes = propTypes;
Transition.defaultProps = defaultProps;
exports["default"] = Transition;
/***/ }),
/* 163 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* Safe chained function
*
* Will only create a new function if needed,
* otherwise will pass back existing functions or null.
*
* @param {function} functions to chain
* @returns {function|null}
*/
function createChainedFunction() {
for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
funcs[_key] = arguments[_key];
}
return funcs.filter(function (f) {
return f != null;
}).reduce(function (acc, f) {
if (typeof f !== 'function') {
throw new Error('Invalid Argument Type, must only provide functions, undefined, or null.');
}
if (acc === null) {
return f;
}
return function chainedFunction() {
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
acc.apply(this, args);
f.apply(this, args);
};
}, null);
}
exports["default"] = createChainedFunction;
module.exports = exports['default'];
/***/ }),
/* 164 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _FormControl = __webpack_require__(165);
var _FormControl2 = _interopRequireDefault(_FormControl);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports["default"] = _FormControl2["default"];
module.exports = exports['default'];
/***/ }),
/* 165 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _beeIcon = __webpack_require__(125);
var _beeIcon2 = _interopRequireDefault(_beeIcon);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
componentClass: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string]),
type: _propTypes2["default"].string,
size: _propTypes2["default"].oneOf(['sm', 'md', 'lg'])
};
var defaultProps = {
componentClass: 'input',
clsPrefix: 'u-form-control',
type: 'text',
size: 'md'
};
var FormControl = function (_React$Component) {
_inherits(FormControl, _React$Component);
function FormControl(props) {
_classCallCheck(this, FormControl);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
_this.handleChange = function (e) {
var value = e.target.value;
var onChange = _this.props.onChange;
_this.setState({
value: value,
showSearch: value == null || value === ""
});
if (onChange) {
onChange(value);
}
};
_this.clearValue = function () {
_this.setState({ showSearch: true });
};
_this.state = {
showSearch: true,
value: props.value == null ? "" : props.value
};
_this.input = {};
return _this;
}
FormControl.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProp) {
if (nextProp.value !== this.state.value) {
this.setState({ value: nextProp.value });
}
};
FormControl.prototype.render = function render() {
var _this2 = this;
var _props = this.props,
Component = _props.componentClass,
type = _props.type,
className = _props.className,
size = _props.size,
clsPrefix = _props.clsPrefix,
onChange = _props.onChange,
others = _objectWithoutProperties(_props, ['componentClass', 'type', 'className', 'size', 'clsPrefix', 'onChange']);
// input[type="file"] 不应该有类名 .form-control.
var classes = {};
if (size) {
classes['' + size] = true;
}
if (type === "search") {
classes['u-input-search'] = true;
}
var classNames = void 0;
if (type !== 'file') {
classNames = (0, _classnames2["default"])(clsPrefix, classes);
}
if (type === "search") {
return _react2["default"].createElement(
'span',
{ className: 'u-input-search u-input-affix-wrapper' },
_react2["default"].createElement(Component, _extends({}, others, {
type: type,
ref: function ref(el) {
return _this2.input = el;
},
onChange: this.handleChange,
value: this.state.value,
className: (0, _classnames2["default"])(className, classNames)
})),
_react2["default"].createElement(
'span',
{ className: 'u-input-suffix' },
this.state.showSearch && _react2["default"].createElement(_beeIcon2["default"], { type: 'uf-search' }),
!this.state.showSearch && _react2["default"].createElement(_beeIcon2["default"], { onClick: this.clearValue, type: 'uf-close-c' })
)
);
}
return _react2["default"].createElement(Component, _extends({}, others, {
type: type,
ref: function ref(el) {
return _this2.input = el;
},
value: this.state.value,
onChange: this.handleChange,
className: (0, _classnames2["default"])(className, classNames)
}));
};
return FormControl;
}(_react2["default"].Component);
FormControl.propTypes = propTypes;
FormControl.defaultProps = defaultProps;
exports["default"] = FormControl;
module.exports = exports['default'];
/***/ }),
/* 166 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Select = __webpack_require__(167);
var _Select2 = _interopRequireDefault(_Select);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports["default"] = _Select2["default"];
module.exports = exports['default'];
/***/ }),
/* 167 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _RcSelect = __webpack_require__(168);
var _RcSelect2 = _interopRequireDefault(_RcSelect);
var _Option = __webpack_require__(197);
var _Option2 = _interopRequireDefault(_Option);
var _OptGroup = __webpack_require__(184);
var _OptGroup2 = _interopRequireDefault(_OptGroup);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var SelectContext = {
antLocale: {
Select: _propTypes2["default"].any
}
};
var defaultProps = {
clsPrefix: "u-select",
showSearch: false,
transitionName: "slide-up",
choiceTransitionName: "zoom"
};
var propTypes = {
clsPrefix: _propTypes2["default"].string,
className: _propTypes2["default"].string,
value: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].any]),
defaultValue: _propTypes2["default"].oneOfType([_propTypes2["default"].node, _propTypes2["default"].array, _propTypes2["default"].any]),
size: _propTypes2["default"].oneOf(["default", "lg", "sm"]),
combobox: _propTypes2["default"].bool,
notFoundContent: _propTypes2["default"].oneOfType([_propTypes2["default"].node, _propTypes2["default"].array, _propTypes2["default"].any]),
showSearch: _propTypes2["default"].bool,
transitionName: _propTypes2["default"].string,
choiceTransitionName: _propTypes2["default"].string,
multiple: _propTypes2["default"].bool,
allowClear: _propTypes2["default"].bool,
filterOption: _propTypes2["default"].oneOfType([_propTypes2["default"].bool, _propTypes2["default"].func]),
tags: _propTypes2["default"].bool,
onSelect: _propTypes2["default"].func,
onDeselect: _propTypes2["default"].func,
onSearch: _propTypes2["default"].func,
placeholder: _propTypes2["default"].string,
dropdownMatchSelectWidth: _propTypes2["default"].bool,
optionFilterProp: _propTypes2["default"].string,
optionLabelProp: _propTypes2["default"].string,
disabled: _propTypes2["default"].bool,
defaultActiveFirstOption: _propTypes2["default"].bool,
labelInValue: _propTypes2["default"].bool,
getPopupContainer: _propTypes2["default"].func,
style: _propTypes2["default"].object,
dropdownStyle: _propTypes2["default"].object,
dropdownMenuStyle: _propTypes2["default"].object,
onChange: _propTypes2["default"].func,
scrollToEnd: _propTypes2["default"].func
};
var Select = function (_Component) {
_inherits(Select, _Component);
function Select(props) {
_classCallCheck(this, Select);
return _possibleConstructorReturn(this, _Component.call(this, props));
}
Select.prototype.render = function render() {
var _classNames;
var _props = this.props,
clsPrefix = _props.clsPrefix,
_props$className = _props.className,
className = _props$className === undefined ? "" : _props$className,
size = _props.size,
combobox = _props.combobox,
showSearch = _props.showSearch,
data = _props.data;
var _props2 = this.props,
_props2$notFoundConte = _props2.notFoundContent,
notFoundContent = _props2$notFoundConte === undefined ? "Not Found" : _props2$notFoundConte,
optionLabelProp = _props2.optionLabelProp;
var cls = (0, _classnames2["default"])((_classNames = {}, _defineProperty(_classNames, clsPrefix + "-lg", size === "lg"), _defineProperty(_classNames, clsPrefix + "-sm", size === "sm"), _defineProperty(_classNames, clsPrefix + "-show-search", showSearch), _classNames), className);
var antLocale = this.context.antLocale;
if (antLocale && antLocale.Select) {
notFoundContent = "notFoundContent" in this.props ? notFoundContent : antLocale.Select.notFoundContent;
}
if (combobox) {
notFoundContent = null;
// children 带 dom 结构时,无法填入输入框
optionLabelProp = optionLabelProp || "value";
}
if (data) {
data.map(function (item) {
return _react2["default"].createElement(
_Option2["default"],
{ value: item.value },
item.key
);
});
}
return data ? _react2["default"].createElement(
_RcSelect2["default"],
_extends({}, this.props, {
className: cls,
optionLabelProp: optionLabelProp || "children",
notFoundContent: notFoundContent
}),
data.map(function (item) {
return _react2["default"].createElement(
_Option2["default"],
{ key: item.value, value: item.value, disabled: item.disabled ? true : false },
item.key
);
})
) : _react2["default"].createElement(_RcSelect2["default"], _extends({}, this.props, {
className: cls,
optionLabelProp: optionLabelProp || "children",
notFoundContent: notFoundContent
}));
};
return Select;
}(_react.Component);
Select.context = SelectContext;
Select.propTypes = propTypes;
Select.defaultProps = defaultProps;
Select.Option = _Option2["default"];
Select.OptGroup = _OptGroup2["default"];
exports["default"] = Select;
module.exports = exports["default"];
/***/ }),
/* 168 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _beeMenus = __webpack_require__(169);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _tinperBeeCore = __webpack_require__(26);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _OptGroup = __webpack_require__(184);
var _OptGroup2 = _interopRequireDefault(_OptGroup);
var _warning = __webpack_require__(31);
var _warning2 = _interopRequireDefault(_warning);
var _componentClasses = __webpack_require__(81);
var _componentClasses2 = _interopRequireDefault(_componentClasses);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _util = __webpack_require__(185);
var _SelectTrigger = __webpack_require__(186);
var _SelectTrigger2 = _interopRequireDefault(_SelectTrigger);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
//import FilterMixin from './FilterMixin';
function noop() {}
function filterFn(input, child) {
return String((0, _util.getPropValue)(child, this.props.optionFilterProp)).indexOf(input) > -1;
}
function saveRef(name, component) {
this[name] = component;
}
var valueObjectShape = void 0;
if (_propTypes2["default"]) {
valueObjectShape = _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].shape({
key: _propTypes2["default"].string,
label: _propTypes2["default"].node
})]);
}
var propTypes = {
defaultActiveFirstOption: _propTypes2["default"].bool,
multiple: _propTypes2["default"].bool,
filterOption: _propTypes2["default"].any,
children: _propTypes2["default"].any,
showSearch: _propTypes2["default"].bool,
disabled: _propTypes2["default"].bool,
allowClear: _propTypes2["default"].bool,
showArrow: _propTypes2["default"].bool,
tags: _propTypes2["default"].bool,
clsPrefix: _propTypes2["default"].string,
className: _propTypes2["default"].string,
transitionName: _propTypes2["default"].string,
optionLabelProp: _propTypes2["default"].string,
optionFilterProp: _propTypes2["default"].string,
animation: _propTypes2["default"].string,
choiceTransitionName: _propTypes2["default"].string,
onChange: _propTypes2["default"].func,
onBlur: _propTypes2["default"].func,
onFocus: _propTypes2["default"].func,
onSelect: _propTypes2["default"].func,
onSearch: _propTypes2["default"].func,
placeholder: _propTypes2["default"].any,
onDeselect: _propTypes2["default"].func,
labelInValue: _propTypes2["default"].bool,
value: _propTypes2["default"].oneOfType([valueObjectShape, _propTypes2["default"].arrayOf(valueObjectShape)]),
defaultValue: _propTypes2["default"].oneOfType([valueObjectShape, _propTypes2["default"].arrayOf(valueObjectShape)]),
dropdownStyle: _propTypes2["default"].object,
maxTagTextLength: _propTypes2["default"].number,
tokenSeparators: _propTypes2["default"].arrayOf(_propTypes2["default"].string)
};
var defaultProps = {
clsPrefix: 'rc-select',
filterOption: filterFn,
defaultOpen: false,
labelInValue: false,
defaultActiveFirstOption: true,
showSearch: true,
allowClear: false,
placeholder: '',
defaultValue: [],
onChange: noop,
onFocus: noop,
onBlur: noop,
onSelect: noop,
onSearch: noop,
onDeselect: noop,
showArrow: true,
dropdownMatchSelectWidth: true,
dropdownStyle: {},
dropdownMenuStyle: {},
optionFilterProp: 'value',
optionLabelProp: 'value',
notFoundContent: 'Not Found'
};
var RcSelect = function (_Component) {
_inherits(RcSelect, _Component);
//mixins: [FilterMixin],
function RcSelect(props) {
_classCallCheck(this, RcSelect);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
var value = [];
if ('value' in props) {
value = (0, _util.toArray)(props.value);
} else {
value = (0, _util.toArray)(props.defaultValue);
}
value = _this.addLabelToValue(props, value);
value = _this.addTitleToValue(props, value);
var inputValue = '';
if (props.combobox) {
inputValue = value.length ? String(value[0].key) : '';
}
_this.saveInputRef = saveRef.bind(_this, 'inputInstance');
_this.saveInputMirrorRef = saveRef.bind(_this, 'inputMirrorInstance');
var open = props.open;
if (open === undefined) {
open = props.defaultOpen;
}
_this.state = {
value: value,
inputValue: inputValue,
open: open
};
_this.filterOption = _this.filterOption.bind(_this);
_this.renderFilterOptions = _this.renderFilterOptions.bind(_this);
_this.renderFilterOptionsFromChildren = _this.renderFilterOptionsFromChildren.bind(_this);
_this.onInputChange = _this.onInputChange.bind(_this);
_this.onDropdownVisibleChange = _this.onDropdownVisibleChange.bind(_this);
_this.onKeyDown = _this.onKeyDown.bind(_this);
_this.onInputKeyDown = _this.onInputKeyDown.bind(_this);
_this.onMenuSelect = _this.onMenuSelect.bind(_this);
_this.onMenuDeselect = _this.onMenuDeselect.bind(_this);
_this.onArrowClick = _this.onArrowClick.bind(_this);
_this.onPlaceholderClick = _this.onPlaceholderClick.bind(_this);
_this.onOuterFocus = _this.onOuterFocus.bind(_this);
_this.onPopupFocus = _this.onPopupFocus.bind(_this);
_this.onOuterBlur = _this.onOuterBlur.bind(_this);
_this.onClearSelection = _this.onClearSelection.bind(_this);
_this.onChoiceAnimationLeave = _this.onChoiceAnimationLeave.bind(_this);
_this.getLabelBySingleValue = _this.getLabelBySingleValue.bind(_this);
_this.getValueByLabel = _this.getValueByLabel.bind(_this);
_this.getLabelFromOption = _this.getLabelFromOption.bind(_this);
_this.getLabelFromProps = _this.getLabelFromProps.bind(_this);
_this.getVLForOnChange = _this.getVLForOnChange.bind(_this);
_this.getLabelByValue = _this.getLabelByValue.bind(_this);
_this.getDropdownContainer = _this.getDropdownContainer.bind(_this);
_this.getPlaceholderElement = _this.getPlaceholderElement.bind(_this);
_this.getInputElement = _this.getInputElement.bind(_this);
_this.getInputDOMNode = _this.getInputDOMNode.bind(_this);
_this.getInputMirrorDOMNode = _this.getInputMirrorDOMNode.bind(_this);
_this.getPopupDOMNode = _this.getPopupDOMNode.bind(_this);
_this.getPopupMenuComponent = _this.getPopupMenuComponent.bind(_this);
_this.setOpenState = _this.setOpenState.bind(_this);
_this.setInputValue = _this.setInputValue.bind(_this);
_this.clearBlurTime = _this.clearBlurTime.bind(_this);
_this.clearAdjustTimer = _this.clearAdjustTimer.bind(_this);
_this.clearAdjustTimer = _this.clearAdjustTimer.bind(_this);
_this.updateFocusClassName = _this.updateFocusClassName.bind(_this);
_this.maybeFocus = _this.maybeFocus.bind(_this);
_this.addLabelToValue = _this.addLabelToValue.bind(_this);
_this.addTitleToValue = _this.addTitleToValue.bind(_this);
_this.removeSelected = _this.removeSelected.bind(_this);
_this.openIfHasChildren = _this.openIfHasChildren.bind(_this);
_this.fireChange = _this.fireChange.bind(_this);
_this.isChildDisabled = _this.isChildDisabled.bind(_this);
_this.tokenize = _this.tokenize.bind(_this);
_this.adjustOpenState = _this.adjustOpenState.bind(_this);
_this.renderTopControlNode = _this.renderTopControlNode.bind(_this);
return _this;
}
RcSelect.prototype.componentWillMount = function componentWillMount() {
this.adjustOpenState();
};
RcSelect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if ('value' in nextProps) {
var value = (0, _util.toArray)(nextProps.value);
value = this.addLabelToValue(nextProps, value);
value = this.addTitleToValue(nextProps, value);
this.setState({
value: value
});
if (nextProps.combobox) {
this.setState({
inputValue: value.length ? this.getLabelFromProps(nextProps, value[0].key) : ''
});
}
}
};
RcSelect.prototype.componentWillUpdate = function componentWillUpdate(nextProps, nextState) {
this.props = nextProps;
this.state = nextState;
this.adjustOpenState();
};
RcSelect.prototype.componentDidUpdate = function componentDidUpdate() {
var state = this.state,
props = this.props;
if (state.open && (0, _util.isMultipleOrTags)(props)) {
var inputNode = this.getInputDOMNode();
var mirrorNode = this.getInputMirrorDOMNode();
if (inputNode.value) {
inputNode.style.width = '';
inputNode.style.width = mirrorNode.clientWidth + 'px';
} else {
inputNode.style.width = '';
}
}
};
RcSelect.prototype.componentWillUnmount = function componentWillUnmount() {
this.clearBlurTime();
this.clearAdjustTimer();
if (this.dropdownContainer) {
_reactDom2["default"].unmountComponentAtNode(this.dropdownContainer);
document.body.removeChild(this.dropdownContainer);
this.dropdownContainer = null;
}
};
RcSelect.prototype.filterOption = function filterOption(input, child) {
if (!input) {
return true;
}
var filterOption = this.props.filterOption;
if (!filterOption) {
return true;
}
if (child.props.disabled) {
return false;
}
return filterOption.call(this, input, child);
};
RcSelect.prototype.renderFilterOptions = function renderFilterOptions(inputValue) {
return this.renderFilterOptionsFromChildren(this.props.children, true, inputValue);
};
RcSelect.prototype.renderFilterOptionsFromChildren = function renderFilterOptionsFromChildren(children, showNotFound, iv) {
var _this2 = this;
var sel = [];
var props = this.props;
var inputValue = iv === undefined ? this.state.inputValue : iv;
var childrenKeys = [];
var tags = props.tags;
_react2["default"].Children.forEach(children, function (child) {
if (child.type === _OptGroup2["default"]) {
var innerItems = _this2.renderFilterOptionsFromChildren(child.props.children, false);
if (innerItems.length) {
var label = child.props.label;
var key = child.key;
if (!key && typeof label === 'string') {
key = label;
} else if (!label && key) {
label = key;
}
sel.push(_react2["default"].createElement(
_beeMenus.ItemGroup,
{ key: key, title: label },
innerItems
));
}
return;
}
// warning(
// child.type === Option,
// 'the children of `Select` should be `Select.Option` or `Select.OptGroup`, ' +
// `instead of \`${child.type.name || child.type.displayName || child.type}\`.`
// );
var childValue = (0, _util.getValuePropValue)(child);
if (_this2.filterOption(inputValue, child)) {
sel.push(_react2["default"].createElement(_beeMenus.Item, _extends({
style: _util.UNSELECTABLE_STYLE,
attribute: _util.UNSELECTABLE_ATTRIBUTE,
value: childValue,
key: childValue
}, child.props)));
}
if (tags && !child.props.disabled) {
childrenKeys.push(childValue);
}
});
if (tags) {
// tags value must be string
var value = this.state.value || [];
value = value.filter(function (singleValue) {
return childrenKeys.indexOf(singleValue.key) === -1 && (!inputValue || String(singleValue.key).indexOf(String(inputValue)) > -1);
});
sel = sel.concat(value.map(function (singleValue) {
var key = singleValue.key;
return _react2["default"].createElement(
_beeMenus.Item,
{
style: _util.UNSELECTABLE_STYLE,
attribute: _util.UNSELECTABLE_ATTRIBUTE,
value: key,
key: key
},
key
);
}));
if (inputValue) {
var notFindInputItem = sel.every(function (option) {
return (0, _util.getValuePropValue)(option) !== inputValue;
});
if (notFindInputItem) {
sel.unshift(_react2["default"].createElement(
_beeMenus.Item,
{
style: _util.UNSELECTABLE_STYLE,
attribute: _util.UNSELECTABLE_ATTRIBUTE,
value: inputValue,
key: inputValue
},
inputValue
));
}
}
}
if (!sel.length && showNotFound && props.notFoundContent) {
sel = [_react2["default"].createElement(
_beeMenus.Item,
{
style: _util.UNSELECTABLE_STYLE,
attribute: _util.UNSELECTABLE_ATTRIBUTE,
disabled: true,
value: 'NOT_FOUND',
key: 'NOT_FOUND'
},
props.notFoundContent
)];
}
return sel;
};
RcSelect.prototype.onInputChange = function onInputChange(event) {
var tokenSeparators = this.props.tokenSeparators;
var val = event.target.value;
if ((0, _util.isMultipleOrTags)(this.props) && tokenSeparators && (0, _util.includesSeparators)(val, tokenSeparators)) {
var nextValue = this.tokenize(val);
this.fireChange(nextValue);
this.setOpenState(false, true);
this.setInputValue('', false);
return;
}
this.setInputValue(val);
this.setState({
open: true
});
if ((0, _util.isCombobox)(this.props)) {
this.fireChange([{
key: val
}]);
}
};
RcSelect.prototype.onDropdownVisibleChange = function onDropdownVisibleChange(open) {
this.setOpenState(open);
};
// combobox ignore
RcSelect.prototype.onKeyDown = function onKeyDown(event) {
var props = this.props;
if (props.disabled) {
return;
}
var keyCode = event.keyCode;
if (this.state.open && !this.getInputDOMNode()) {
this.onInputKeyDown(event);
} else if (keyCode === _tinperBeeCore.KeyCode.ENTER || keyCode === _tinperBeeCore.KeyCode.DOWN) {
this.setOpenState(true);
event.preventDefault();
}
};
RcSelect.prototype.onInputKeyDown = function onInputKeyDown(event) {
var props = this.props;
if (props.disabled) {
return;
}
var state = this.state;
var keyCode = event.keyCode;
if ((0, _util.isMultipleOrTags)(props) && !event.target.value && keyCode === _tinperBeeCore.KeyCode.BACKSPACE) {
event.preventDefault();
var value = state.value;
if (value.length) {
this.removeSelected(value[value.length - 1].key);
}
return;
}
if (keyCode === _tinperBeeCore.KeyCode.DOWN) {
if (!state.open) {
this.openIfHasChildren();
event.preventDefault();
event.stopPropagation();
return;
}
} else if (keyCode === _tinperBeeCore.KeyCode.ESC) {
if (state.open) {
this.setOpenState(false);
event.preventDefault();
event.stopPropagation();
}
return;
}
if (state.open) {
var menu = this.refs.trigger.getInnerMenu();
if (menu && menu.rcMenu.onKeyDown(event)) {
event.preventDefault();
event.stopPropagation();
}
}
};
RcSelect.prototype.onMenuSelect = function onMenuSelect(_ref) {
var _this3 = this;
var item = _ref.item;
var value = this.state.value;
var props = this.props;
var selectedValue = (0, _util.getValuePropValue)(item);
var selectedLabel = this.getLabelFromOption(item);
var event = selectedValue;
if (props.labelInValue) {
event = {
key: event,
label: selectedLabel
};
}
props.onSelect(event, item);
var selectedTitle = item.props.title;
if ((0, _util.isMultipleOrTags)(props)) {
if ((0, _util.findIndexInValueByKey)(value, selectedValue) !== -1) {
return;
}
value = value.concat([{
key: selectedValue,
label: selectedLabel,
title: selectedTitle
}]);
} else {
if ((0, _util.isCombobox)(props)) {
this.skipAdjustOpen = true;
this.clearAdjustTimer();
this.skipAdjustOpenTimer = setTimeout(function () {
_this3.skipAdjustOpen = false;
}, 0);
}
if (value.length && value[0].key === selectedValue) {
this.setOpenState(false, true);
return;
}
value = [{
key: selectedValue,
label: selectedLabel,
title: selectedTitle
}];
this.setOpenState(false, true);
}
this.fireChange(value);
var inputValue = void 0;
if ((0, _util.isCombobox)(props)) {
inputValue = (0, _util.getPropValue)(item, props.optionLabelProp);
} else {
inputValue = '';
}
this.setInputValue(inputValue, false);
};
RcSelect.prototype.onMenuDeselect = function onMenuDeselect(_ref2) {
var item = _ref2.item,
domEvent = _ref2.domEvent;
if (domEvent.type === 'click') {
this.removeSelected((0, _util.getValuePropValue)(item));
}
this.setInputValue('', false);
};
RcSelect.prototype.onArrowClick = function onArrowClick(e) {
e.stopPropagation();
if (!this.props.disabled) {
this.setOpenState(!this.state.open, true);
}
};
RcSelect.prototype.onPlaceholderClick = function onPlaceholderClick() {
if (this.getInputDOMNode()) {
this.getInputDOMNode().focus();
}
};
RcSelect.prototype.onOuterFocus = function onOuterFocus() {
this.clearBlurTime();
this._focused = true;
this.updateFocusClassName();
this.props.onFocus();
};
RcSelect.prototype.onPopupFocus = function onPopupFocus() {
// fix ie scrollbar, focus element again
this.maybeFocus(true, true);
};
RcSelect.prototype.onOuterBlur = function onOuterBlur() {
var _this4 = this;
this.blurTimer = setTimeout(function () {
_this4._focused = false;
_this4.updateFocusClassName();
var props = _this4.props;
var value = _this4.state.value;
var inputValue = _this4.state.inputValue;
if ((0, _util.isSingleMode)(props) && props.showSearch && inputValue && props.defaultActiveFirstOption) {
var options = _this4._options || [];
if (options.length) {
var firstOption = (0, _util.findFirstMenuItem)(options);
if (firstOption) {
value = [{
key: firstOption.key,
label: _this4.getLabelFromOption(firstOption)
}];
_this4.fireChange(value);
}
}
} else if ((0, _util.isMultipleOrTags)(props) && inputValue) {
// why not use setState?
_this4.state.inputValue = _this4.getInputDOMNode().value = '';
}
props.onBlur(_this4.getVLForOnChange(value));
}, 10);
};
RcSelect.prototype.onClearSelection = function onClearSelection(event) {
var props = this.props;
var state = this.state;
if (props.disabled) {
return;
}
var inputValue = state.inputValue,
value = state.value;
event.stopPropagation();
if (inputValue || value.length) {
if (value.length) {
this.fireChange([]);
}
this.setOpenState(false, true);
if (inputValue) {
this.setInputValue('');
}
}
};
RcSelect.prototype.onChoiceAnimationLeave = function onChoiceAnimationLeave() {
this.refs.trigger.refs.trigger.forcePopupAlign();
};
RcSelect.prototype.getLabelBySingleValue = function getLabelBySingleValue(children, value) {
var _this5 = this;
if (value === undefined) {
return null;
}
var label = null;
_react2["default"].Children.forEach(children, function (child) {
if (child.type === _OptGroup2["default"]) {
var maybe = _this5.getLabelBySingleValue(child.props.children, value);
if (maybe !== null) {
label = maybe;
}
} else if ((0, _util.getValuePropValue)(child) === value) {
label = _this5.getLabelFromOption(child);
}
});
return label;
};
RcSelect.prototype.getValueByLabel = function getValueByLabel(children, label) {
var _this6 = this;
if (label === undefined) {
return null;
}
var value = null;
_react2["default"].Children.forEach(children, function (child) {
if (child.type === _OptGroup2["default"]) {
var maybe = _this6.getValueByLabel(child.props.children, label);
if (maybe !== null) {
value = maybe;
}
} else if ((0, _util.toArray)(_this6.getLabelFromOption(child)).join('') === label) {
value = (0, _util.getValuePropValue)(child);
}
});
return value;
};
RcSelect.prototype.getLabelFromOption = function getLabelFromOption(child) {
return (0, _util.getPropValue)(child, this.props.optionLabelProp);
};
RcSelect.prototype.getLabelFromProps = function getLabelFromProps(props, value) {
return this.getLabelByValue(props.children, value);
};
RcSelect.prototype.getVLForOnChange = function getVLForOnChange(vls_) {
var vls = vls_;
if (vls !== undefined) {
if (!this.props.labelInValue) {
vls = vls.map(function (v) {
return v.key;
});
} else {
vls = vls.map(function (vl) {
return { key: vl.key, label: vl.label };
});
}
return (0, _util.isMultipleOrTags)(this.props) ? vls : vls[0];
}
return vls;
};
RcSelect.prototype.getLabelByValue = function getLabelByValue(children, value) {
var label = this.getLabelBySingleValue(children, value);
if (label === null) {
return value;
}
return label;
};
RcSelect.prototype.getDropdownContainer = function getDropdownContainer() {
if (!this.dropdownContainer) {
this.dropdownContainer = document.createElement('div');
document.body.appendChild(this.dropdownContainer);
}
return this.dropdownContainer;
};
RcSelect.prototype.getPlaceholderElement = function getPlaceholderElement() {
var props = this.props,
state = this.state;
var hidden = false;
if (state.inputValue) {
hidden = true;
}
if (state.value.length) {
hidden = true;
}
if ((0, _util.isCombobox)(props) && state.value.length === 1 && !state.value[0].key) {
hidden = false;
}
var placeholder = props.placeholder;
if (placeholder) {
return _react2["default"].createElement(
'div',
_extends({
onMouseDown: _util.preventDefaultEvent,
style: _extends({
display: hidden ? 'none' : 'block'
}, _util.UNSELECTABLE_STYLE)
}, _util.UNSELECTABLE_ATTRIBUTE, {
onClick: this.onPlaceholderClick,
className: props.clsPrefix + '-selection-placeholder'
}),
placeholder
);
}
return null;
};
RcSelect.prototype.getInputElement = function getInputElement() {
var props = this.props;
return _react2["default"].createElement(
'div',
{ className: props.clsPrefix + '-search-field-wrap' },
_react2["default"].createElement('input', {
ref: this.saveInputRef,
onChange: this.onInputChange,
onKeyDown: this.onInputKeyDown,
value: this.state.inputValue,
disabled: props.disabled,
className: props.clsPrefix + '-search-field'
}),
_react2["default"].createElement(
'span',
{
ref: this.saveInputMirrorRef,
className: props.clsPrefix + '-search-field-mirror'
},
this.state.inputValue
)
);
};
RcSelect.prototype.getInputDOMNode = function getInputDOMNode() {
return this.inputInstance;
};
RcSelect.prototype.getInputMirrorDOMNode = function getInputMirrorDOMNode() {
return this.inputMirrorInstance;
};
RcSelect.prototype.getPopupDOMNode = function getPopupDOMNode() {
return this.refs.trigger.getPopupDOMNode();
};
RcSelect.prototype.getPopupMenuComponent = function getPopupMenuComponent() {
return this.refs.trigger.getInnerMenu();
};
RcSelect.prototype.setOpenState = function setOpenState(open, needFocus) {
var _this7 = this;
var props = this.props,
state = this.state;
if (state.open === open) {
this.maybeFocus(open, needFocus);
return;
}
var nextState = {
open: open
};
// clear search input value when open is false in singleMode.
if (!open && (0, _util.isSingleMode)(props) && props.showSearch) {
this.setInputValue('');
}
if (!open) {
this.maybeFocus(open, needFocus);
}
this.setState(nextState, function () {
if (open) {
_this7.maybeFocus(open, needFocus);
}
});
};
RcSelect.prototype.setInputValue = function setInputValue(inputValue) {
var fireSearch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
this.setState({
inputValue: inputValue
});
if (fireSearch) {
this.props.onSearch(inputValue);
}
};
RcSelect.prototype.clearBlurTime = function clearBlurTime() {
if (this.blurTimer) {
clearTimeout(this.blurTimer);
this.blurTimer = null;
}
};
RcSelect.prototype.clearAdjustTimer = function clearAdjustTimer() {
if (this.skipAdjustOpenTimer) {
clearTimeout(this.skipAdjustOpenTimer);
this.skipAdjustOpenTimer = null;
}
};
RcSelect.prototype.updateFocusClassName = function updateFocusClassName() {
var refs = this.refs,
props = this.props;
if (this._focused) {
(0, _componentClasses2["default"])(refs.root).add(props.clsPrefix + '-focused');
} else {
(0, _componentClasses2["default"])(refs.root).remove(props.clsPrefix + '-focused');
}
};
RcSelect.prototype.maybeFocus = function maybeFocus(open, needFocus) {
if (needFocus || open) {
var input = this.getInputDOMNode();
var _document = document,
activeElement = _document.activeElement;
if (input && (open || (0, _util.isMultipleOrTagsOrCombobox)(this.props))) {
if (activeElement !== input) {
input.focus();
}
} else {
var selection = this.refs.selection;
if (activeElement !== selection) {
selection.focus();
}
}
}
};
RcSelect.prototype.addLabelToValue = function addLabelToValue(props, value_) {
var _this8 = this;
var value = value_;
if (props.labelInValue) {
value.forEach(function (v) {
v.label = v.label || _this8.getLabelFromProps(props, v.key);
});
} else {
value = value.map(function (v) {
return {
key: v,
label: _this8.getLabelFromProps(props, v)
};
});
}
return value;
};
RcSelect.prototype.addTitleToValue = function addTitleToValue(props, values) {
var _this9 = this;
var nextValues = values;
var keys = values.map(function (v) {
return v.key;
});
_react2["default"].Children.forEach(props.children, function (child) {
if (child.type === _OptGroup2["default"]) {
nextValues = _this9.addTitleToValue(child.props, nextValues);
} else {
var value = (0, _util.getValuePropValue)(child);
var valueIndex = keys.indexOf(value);
if (valueIndex > -1) {
nextValues[valueIndex].title = child.props.title;
}
}
});
return nextValues;
};
RcSelect.prototype.removeSelected = function removeSelected(selectedKey) {
var props = this.props;
if (props.disabled || this.isChildDisabled(selectedKey)) {
return;
}
var label = void 0;
var value = this.state.value.filter(function (singleValue) {
if (singleValue.key === selectedKey) {
label = singleValue.label;
}
return singleValue.key !== selectedKey;
});
var canMultiple = (0, _util.isMultipleOrTags)(props);
if (canMultiple) {
var event = selectedKey;
if (props.labelInValue) {
event = {
key: selectedKey,
label: label
};
}
props.onDeselect(event);
}
this.fireChange(value);
};
RcSelect.prototype.openIfHasChildren = function openIfHasChildren() {
var props = this.props;
if (_react2["default"].Children.count(props.children) || (0, _util.isSingleMode)(props)) {
this.setOpenState(true);
}
};
RcSelect.prototype.fireChange = function fireChange(value) {
var props = this.props;
if (!('value' in props)) {
this.setState({
value: value
});
}
props.onChange(this.getVLForOnChange(value));
};
RcSelect.prototype.isChildDisabled = function isChildDisabled(key) {
return (0, _util.toArray)(this.props.children).some(function (child) {
var childValue = (0, _util.getValuePropValue)(child);
return childValue === key && child.props && child.props.disabled;
});
};
RcSelect.prototype.tokenize = function tokenize(string) {
var _this10 = this;
var _props = this.props,
multiple = _props.multiple,
tokenSeparators = _props.tokenSeparators,
children = _props.children;
var nextValue = this.state.value;
(0, _util.splitBySeparators)(string, tokenSeparators).forEach(function (label) {
var selectedValue = { key: label, label: label };
if ((0, _util.findIndexInValueByLabel)(nextValue, label) === -1) {
if (multiple) {
var value = _this10.getValueByLabel(children, label);
if (value) {
selectedValue.key = value;
nextValue = nextValue.concat(selectedValue);
}
} else {
nextValue = nextValue.concat(selectedValue);
}
}
});
return nextValue;
};
RcSelect.prototype.adjustOpenState = function adjustOpenState() {
if (this.skipAdjustOpen) {
return;
}
var open = this.state.open;
if (typeof document !== 'undefined' && this.getInputDOMNode() && document.activeElement === this.getInputDOMNode()) {
open = true;
}
var options = [];
if (open) {
options = this.renderFilterOptions();
}
this._options = options;
if (open && ((0, _util.isMultipleOrTagsOrCombobox)(this.props) || !this.props.showSearch) && !options.length) {
open = false;
}
this.state.open = open;
};
RcSelect.prototype.renderTopControlNode = function renderTopControlNode() {
var _this11 = this;
var _state = this.state,
value = _state.value,
open = _state.open,
inputValue = _state.inputValue;
var props = this.props;
var choiceTransitionName = props.choiceTransitionName,
clsPrefix = props.clsPrefix,
maxTagTextLength = props.maxTagTextLength,
showSearch = props.showSearch;
var className = clsPrefix + '-selection-rendered';
// search input is inside topControlNode in single, multiple & combobox. 2016/04/13
var innerNode = null;
if ((0, _util.isSingleMode)(props)) {
var selectedValue = null;
if (value.length) {
var showSelectedValue = false;
var opacity = 1;
if (!showSearch) {
showSelectedValue = true;
} else {
if (open) {
showSelectedValue = !inputValue;
if (showSelectedValue) {
opacity = 0.4;
}
} else {
showSelectedValue = true;
}
}
var singleValue = value[0];
selectedValue = _react2["default"].createElement(
'div',
{
key: 'value',
className: clsPrefix + '-selection-selected-value',
title: singleValue.title || singleValue.label,
style: {
display: showSelectedValue ? 'block' : 'none',
opacity: opacity
}
},
value[0].label
);
}
if (!showSearch) {
innerNode = [selectedValue];
} else {
innerNode = [selectedValue, _react2["default"].createElement(
'div',
{
className: clsPrefix + '-search ' + clsPrefix + '-search--inline',
key: 'input',
style: {
display: open ? 'block' : 'none'
}
},
this.getInputElement()
)];
}
} else {
var selectedValueNodes = [];
if ((0, _util.isMultipleOrTags)(props)) {
selectedValueNodes = value.map(function (singleValue) {
var content = singleValue.label;
var title = singleValue.title || content;
if (maxTagTextLength && typeof content === 'string' && content.length > maxTagTextLength) {
content = content.slice(0, maxTagTextLength) + '...';
}
var disabled = _this11.isChildDisabled(singleValue.key);
var choiceClassName = disabled ? clsPrefix + '-selection-choice ' + clsPrefix + '-selection-choice-disabled' : clsPrefix + '-selection-choice';
return _react2["default"].createElement(
'li',
_extends({
style: _util.UNSELECTABLE_STYLE
}, _util.UNSELECTABLE_ATTRIBUTE, {
onMouseDown: _util.preventDefaultEvent,
className: choiceClassName,
key: singleValue.key,
title: title
}),
_react2["default"].createElement(
'div',
{ className: clsPrefix + '-selection-choice-content' },
content
),
disabled ? null : _react2["default"].createElement('span', {
className: clsPrefix + '-selection-choice-remove',
onClick: _this11.removeSelected.bind(_this11, singleValue.key)
})
);
});
}
selectedValueNodes.push(_react2["default"].createElement(
'li',
{
className: clsPrefix + '-search ' + clsPrefix + '-search--inline',
key: '__input'
},
this.getInputElement()
));
innerNode = _react2["default"].createElement(
'ul',
null,
selectedValueNodes
);
}
return _react2["default"].createElement(
'div',
{ className: className },
this.getPlaceholderElement(),
innerNode
);
};
RcSelect.prototype.render = function render() {
var _rootCls;
var props = this.props;
var multiple = (0, _util.isMultipleOrTags)(props);
var state = this.state;
var className = props.className,
disabled = props.disabled,
allowClear = props.allowClear,
clsPrefix = props.clsPrefix;
var ctrlNode = this.renderTopControlNode();
var extraSelectionProps = {};
var open = this.state.open;
var options = this._options;
if (!(0, _util.isMultipleOrTagsOrCombobox)(props)) {
extraSelectionProps = {
onKeyDown: this.onKeyDown,
tabIndex: 0
};
}
var rootCls = (_rootCls = {}, _defineProperty(_rootCls, className, !!className), _defineProperty(_rootCls, clsPrefix, 1), _defineProperty(_rootCls, clsPrefix + '-open', open), _defineProperty(_rootCls, clsPrefix + '-focused', open || !!this._focused), _defineProperty(_rootCls, clsPrefix + '-combobox', (0, _util.isCombobox)(props)), _defineProperty(_rootCls, clsPrefix + '-disabled', disabled), _defineProperty(_rootCls, clsPrefix + '-enabled', !disabled), _defineProperty(_rootCls, clsPrefix + '-allow-clear', !!props.allowClear), _rootCls);
var clearStyle = _extends({}, _util.UNSELECTABLE_STYLE, {
display: 'none'
});
if (state.inputValue || state.value.length) {
clearStyle.display = 'block';
}
var clear = _react2["default"].createElement('span', _extends({
key: 'clear',
onMouseDown: _util.preventDefaultEvent,
style: clearStyle
}, _util.UNSELECTABLE_ATTRIBUTE, {
className: clsPrefix + '-selection-clear',
onClick: this.onClearSelection
}));
return _react2["default"].createElement(
_SelectTrigger2["default"],
{
onPopupFocus: this.onPopupFocus,
dropdownAlign: props.dropdownAlign,
dropdownClassName: props.dropdownClassName,
dropdownMatchSelectWidth: props.dropdownMatchSelectWidth,
defaultActiveFirstOption: props.defaultActiveFirstOption,
dropdownMenuStyle: props.dropdownMenuStyle,
transitionName: props.transitionName,
animation: props.animation,
clsPrefix: props.clsPrefix,
dropdownStyle: props.dropdownStyle,
combobox: props.combobox,
showSearch: props.showSearch,
options: options,
multiple: multiple,
disabled: disabled,
visible: open,
inputValue: state.inputValue,
value: state.value,
onDropdownVisibleChange: this.onDropdownVisibleChange,
getPopupContainer: props.getPopupContainer,
onMenuSelect: this.onMenuSelect,
onMenuDeselect: this.onMenuDeselect,
scrollToEnd: props.scrollToEnd,
ref: 'trigger'
},
_react2["default"].createElement(
'div',
{
style: props.style,
ref: 'root',
onBlur: this.onOuterBlur,
onFocus: this.onOuterFocus,
className: (0, _classnames2["default"])(rootCls)
},
_react2["default"].createElement(
'div',
_extends({
ref: 'selection',
key: 'selection',
className: clsPrefix + '-selection\n ' + clsPrefix + '-selection--' + (multiple ? 'multiple' : 'single'),
role: 'combobox',
'aria-autocomplete': 'list',
'aria-haspopup': 'true',
'aria-expanded': open
}, extraSelectionProps),
ctrlNode,
allowClear && !multiple ? clear : null,
multiple || !props.showArrow ? null : _react2["default"].createElement(
'span',
_extends({
key: 'arrow',
className: clsPrefix + '-arrow',
style: _util.UNSELECTABLE_STYLE
}, _util.UNSELECTABLE_ATTRIBUTE, {
onMouseDown: _util.preventDefaultEvent,
onClick: this.onArrowClick
}),
_react2["default"].createElement('b', null)
)
)
)
);
};
return RcSelect;
}(_react.Component);
;
RcSelect.defaultProps = defaultProps;
RcSelect.propTypes = propTypes;
exports["default"] = RcSelect;
module.exports = exports['default'];
/***/ }),
/* 169 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _VerticalMenu = __webpack_require__(170);
var _VerticalMenu2 = _interopRequireDefault(_VerticalMenu);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports["default"] = _VerticalMenu2["default"];
module.exports = exports['default'];
/***/ }),
/* 170 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _ExportMenu = __webpack_require__(171);
var _ExportMenu2 = _interopRequireDefault(_ExportMenu);
var _openAnimation = __webpack_require__(182);
var _openAnimation2 = _interopRequireDefault(_openAnimation);
var _warning = __webpack_require__(183);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var Menu = function (_React$Component) {
_inherits(Menu, _React$Component);
function Menu(props) {
_classCallCheck(this, Menu);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
_this.handleClick = function (e) {
_this.setOpenKeys([]);
var onClick = _this.props.onClick;
if (onClick) {
onClick(e);
}
};
_this.handleOpenChange = function (openKeys) {
_this.setOpenKeys(openKeys);
var onOpenChange = _this.props.onOpenChange;
if (onOpenChange) {
onOpenChange(openKeys);
}
};
(0, _warning2["default"])(!('onOpen' in props || 'onClose' in props), '`onOpen` and `onClose` are removed, please use `onOpenChange` instead.');
_this.state = {
openKeys: []
};
_this.rcMenu = {};
return _this;
}
Menu.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (this.props.mode === 'inline' && nextProps.mode !== 'inline') {
this.switchModeFromInline = true;
}
if ('openKeys' in nextProps) {
this.setOpenKeys(nextProps.openKeys);
}
};
Menu.prototype.setOpenKeys = function setOpenKeys(openKeys) {
if (!('openKeys' in this.props)) {
this.setState({ openKeys: openKeys });
}
};
Menu.prototype.render = function render() {
var _this2 = this;
var openAnimation = this.props.openAnimation || this.props.openTransitionName;
if (!openAnimation) {
switch (this.props.mode) {
case 'horizontal':
openAnimation = 'slide-up';
break;
case 'vertical':
// When mode switch from inline
// submenu should hide without animation
if (this.switchModeFromInline) {
openAnimation = '';
this.switchModeFromInline = false;
} else {
openAnimation = 'zoom-big';
}
break;
case 'inline':
openAnimation = _openAnimation2["default"];
break;
default:
}
}
var props = {};
var className = this.props.className + ' ' + this.props.prefixCls + '-' + this.props.theme;
if (this.props.mode !== 'inline') {
// 这组属性的目的是
// 弹出型的菜单需要点击后立即关闭
// 另外,弹出型的菜单的受控模式没有使用场景
props = {
openKeys: this.state.openKeys,
onClick: this.handleClick,
onOpenChange: this.handleOpenChange,
openTransitionName: openAnimation,
className: className
};
} else {
props = {
openAnimation: openAnimation,
className: className
};
}
return _react2["default"].createElement(_ExportMenu2["default"], _extends({ ref: function ref(el) {
return _this2.rcMenu = el;
} }, this.props, props));
};
return Menu;
}(_react2["default"].Component);
Menu.defaultProps = {
prefixCls: 'u-menu',
className: '',
theme: 'light' // or dark
};
Menu.Divider = _ExportMenu.Divider;
Menu.Item = _ExportMenu.Item;
Menu.SubMenu = _ExportMenu.SubMenu;
Menu.ItemGroup = _ExportMenu.ItemGroup;
Menu.MenuToggle = _ExportMenu.MenuToggle;
Menu.SideContainer = _ExportMenu.SideContainer;
exports["default"] = Menu;
module.exports = exports['default'];
/***/ }),
/* 171 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.MenuToggle = exports.SideContainer = exports.Divider = exports.ItemGroup = exports.MenuItemGroup = exports.MenuItem = exports.Item = exports.SubMenu = undefined;
var _Menu = __webpack_require__(172);
var _Menu2 = _interopRequireDefault(_Menu);
var _SubMenu = __webpack_require__(175);
var _SubMenu2 = _interopRequireDefault(_SubMenu);
var _MenuItem = __webpack_require__(177);
var _MenuItem2 = _interopRequireDefault(_MenuItem);
var _MenuItemGroup = __webpack_require__(178);
var _MenuItemGroup2 = _interopRequireDefault(_MenuItemGroup);
var _Divider = __webpack_require__(179);
var _Divider2 = _interopRequireDefault(_Divider);
var _SideContainer = __webpack_require__(180);
var _SideContainer2 = _interopRequireDefault(_SideContainer);
var _MenuToggle = __webpack_require__(181);
var _MenuToggle2 = _interopRequireDefault(_MenuToggle);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports.SubMenu = _SubMenu2["default"];
exports.Item = _MenuItem2["default"];
exports.MenuItem = _MenuItem2["default"];
exports.MenuItemGroup = _MenuItemGroup2["default"];
exports.ItemGroup = _MenuItemGroup2["default"];
exports.Divider = _Divider2["default"];
exports.SideContainer = _SideContainer2["default"];
exports.MenuToggle = _MenuToggle2["default"];
exports["default"] = _Menu2["default"];
/***/ }),
/* 172 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _util = __webpack_require__(173);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _DOMWrap = __webpack_require__(174);
var _DOMWrap2 = _interopRequireDefault(_DOMWrap);
var _tinperBeeCore = __webpack_require__(26);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
function saveRef(index, subIndex, c) {
if (c) {
if (subIndex !== undefined) {
this.instanceArray[index] = this.instanceArray[index] || [];
this.instanceArray[index][subIndex] = c;
} else {
this.instanceArray[index] = c;
}
}
}
function allDisabled(arr) {
if (!arr.length) {
return true;
}
return arr.every(function (c) {
return !!c.props.disabled;
});
}
function getActiveKey(props, originalActiveKey) {
var activeKey = originalActiveKey;
var children = props.children,
eventKey = props.eventKey;
if (activeKey) {
var found = void 0;
(0, _util.loopMenuItem)(children, function (c, i) {
if (c && !c.props.disabled && activeKey === (0, _util.getKeyFromChildrenIndex)(c, eventKey, i)) {
found = true;
}
});
if (found) {
return activeKey;
}
}
activeKey = null;
if (props.defaultActiveFirst) {
(0, _util.loopMenuItem)(children, function (c, i) {
if (!activeKey && c && !c.props.disabled) {
activeKey = (0, _util.getKeyFromChildrenIndex)(c, eventKey, i);
}
});
return activeKey;
}
return activeKey;
}
var propTypes = {
openSubMenuOnMouseEnter: _propTypes2["default"].bool,
closeSubMenuOnMouseLeave: _propTypes2["default"].bool,
selectedKeys: _propTypes2["default"].oneOfType([_propTypes2["default"].array, _propTypes2["default"].string]),
defaultSelectedKeys: _propTypes2["default"].arrayOf(_propTypes2["default"].string),
defaultOpenKeys: _propTypes2["default"].arrayOf(_propTypes2["default"].string),
openKeys: _propTypes2["default"].arrayOf(_propTypes2["default"].string),
mode: _propTypes2["default"].string,
onClick: _propTypes2["default"].func,
onSelect: _propTypes2["default"].func,
onDeselect: _propTypes2["default"].func,
onDestroy: _propTypes2["default"].func,
openTransitionName: _propTypes2["default"].string,
openAnimation: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].object]),
level: _propTypes2["default"].number,
eventKey: _propTypes2["default"].string,
selectable: _propTypes2["default"].bool,
children: _propTypes2["default"].any,
focusable: _propTypes2["default"].bool,
multiple: _propTypes2["default"].bool,
style: _propTypes2["default"].object,
defaultActiveFirst: _propTypes2["default"].bool,
visible: _propTypes2["default"].bool,
activeKey: _propTypes2["default"].string
};
var defaultProps = {
openSubMenuOnMouseEnter: true,
closeSubMenuOnMouseLeave: true,
selectable: true,
onClick: _util.noop,
onSelect: _util.noop,
onOpenChange: _util.noop,
onDeselect: _util.noop,
defaultSelectedKeys: [],
defaultOpenKeys: [],
clsPrefix: 'u-menu',
className: '',
mode: 'vertical',
level: 1,
inlineIndent: 24,
visible: true,
focusable: true,
style: {}
};
var Menu = function (_Component) {
_inherits(Menu, _Component);
function Menu(props) {
_classCallCheck(this, Menu);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
var selectedKeys = _this.props.defaultSelectedKeys;
var openKeys = _this.props.defaultOpenKeys;
if ('selectedKeys' in _this.props) {
selectedKeys = _this.props.selectedKeys || [];
}
if ('openKeys' in props) {
openKeys = _this.props.openKeys || [];
}
_this.state = {
selectedKeys: selectedKeys,
openKeys: openKeys,
activeKey: getActiveKey(_this.props, _this.props.activeKey)
//activeKey: getActiveKey(this.props, this.props.activeKey),
};
_this.renderMenuItem = _this.renderMenuItem.bind(_this);
_this.onDestroy = _this.onDestroy.bind(_this);
_this.onItemHover = _this.onItemHover.bind(_this);
_this.onSelect = _this.onSelect.bind(_this);
_this.onOpenChange = _this.onOpenChange.bind(_this);
_this.onClick = _this.onClick.bind(_this);
_this.onDeselect = _this.onDeselect.bind(_this);
_this.getOpenTransitionName = _this.getOpenTransitionName.bind(_this);
_this.isInlineMode = _this.isInlineMode.bind(_this);
_this.lastOpenSubMenu = _this.lastOpenSubMenu.bind(_this);
_this.renderMenuItem = _this.renderMenuItem.bind(_this);
_this.renderCommonMenuItem = _this.renderCommonMenuItem.bind(_this);
_this.renderRoot = _this.renderRoot.bind(_this);
_this.getOpenChangesOnItemHover = _this.getOpenChangesOnItemHover.bind(_this);
_this.getFlatInstanceArray = _this.getFlatInstanceArray.bind(_this);
_this.onKeyDown = _this.onKeyDown.bind(_this);
_this.step = _this.step.bind(_this);
return _this;
}
Menu.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var props = {};
if ('selectedKeys' in nextProps) {
props.selectedKeys = nextProps.selectedKeys;
}
if ('openKeys' in nextProps) {
props.openKeys = nextProps.openKeys;
}
if ('activeKey' in nextProps) {
props.activeKey = getActiveKey(nextProps, nextProps.activeKey);
} else {
var originalActiveKey = this.state.activeKey;
var activeKey = getActiveKey(nextProps, originalActiveKey);
// fix: this.setState(), parent.render(),
if (activeKey !== originalActiveKey) {
props.activeKey = activeKey;
}
}
this.setState(props);
};
Menu.prototype.componentWillMount = function componentWillMount() {
this.instanceArray = [];
};
Menu.prototype.onDestroy = function onDestroy(key) {
var state = this.state;
var props = this.props;
var selectedKeys = state.selectedKeys;
var openKeys = state.openKeys;
var index = selectedKeys.indexOf(key);
if (!('selectedKeys' in props) && index !== -1) {
selectedKeys.splice(index, 1);
}
index = openKeys.indexOf(key);
if (!('openKeys' in props) && index !== -1) {
openKeys.splice(index, 1);
}
};
Menu.prototype.onItemHover = function onItemHover(e) {
var item = e.item;
var _props = this.props,
mode = _props.mode,
closeSubMenuOnMouseLeave = _props.closeSubMenuOnMouseLeave;
var _e$openChanges = e.openChanges,
openChanges = _e$openChanges === undefined ? [] : _e$openChanges;
// special for top sub menu
if (mode !== 'inline' && !closeSubMenuOnMouseLeave && item.isSubMenu) {
var activeKey = this.state.activeKey;
var activeItem = this.getFlatInstanceArray().filter(function (c) {
return c && c.props.eventKey === activeKey;
})[0];
if (activeItem && activeItem.props.open) {
openChanges = openChanges.concat({
key: item.props.eventKey,
item: item,
originalEvent: e,
open: true
});
}
}
openChanges = openChanges.concat(this.getOpenChangesOnItemHover(e));
if (openChanges.length) {
this.onOpenChange(openChanges);
}
};
Menu.prototype.onSelect = function onSelect(selectInfo) {
var props = this.props;
if (props.selectable) {
// root menu
var selectedKeys = this.state.selectedKeys;
var selectedKey = selectInfo.key;
if (props.multiple) {
selectedKeys = selectedKeys.concat([selectedKey]);
} else {
selectedKeys = [selectedKey];
}
if (!('selectedKeys' in props)) {
this.setState({
selectedKeys: selectedKeys
});
}
props.onSelect(_extends({}, selectInfo, {
selectedKeys: selectedKeys
}));
}
};
Menu.prototype.onClick = function onClick(e) {
this.props.onClick(e);
};
Menu.prototype.onOpenChange = function onOpenChange(e_) {
var props = this.props;
var openKeys = this.state.openKeys.concat();
var changed = false;
var processSingle = function processSingle(e) {
var oneChanged = false;
if (e.open) {
oneChanged = openKeys.indexOf(e.key) === -1;
if (oneChanged) {
openKeys.push(e.key);
}
} else {
var index = openKeys.indexOf(e.key);
oneChanged = index !== -1;
if (oneChanged) {
openKeys.splice(index, 1);
}
}
changed = changed || oneChanged;
};
if (Array.isArray(e_)) {
// batch change call
e_.forEach(processSingle);
} else {
processSingle(e_);
}
if (changed) {
if (!('openKeys' in this.props)) {
this.setState({ openKeys: openKeys });
}
props.onOpenChange(openKeys);
}
};
Menu.prototype.onDeselect = function onDeselect(selectInfo) {
var props = this.props;
if (props.selectable) {
var selectedKeys = this.state.selectedKeys.concat();
var selectedKey = selectInfo.key;
var index = selectedKeys.indexOf(selectedKey);
if (index !== -1) {
selectedKeys.splice(index, 1);
}
if (!('selectedKeys' in props)) {
this.setState({
selectedKeys: selectedKeys
});
}
props.onDeselect(_extends({}, selectInfo, {
selectedKeys: selectedKeys
}));
}
};
Menu.prototype.getOpenTransitionName = function getOpenTransitionName() {
var props = this.props;
var transitionName = props.openTransitionName;
var animationName = props.openAnimation;
if (!transitionName && typeof animationName === 'string') {
transitionName = props.clsPrefix + '-open-' + animationName;
}
return transitionName;
};
Menu.prototype.isInlineMode = function isInlineMode() {
return this.props.mode === 'inline';
};
Menu.prototype.lastOpenSubMenu = function lastOpenSubMenu() {
var lastOpen = [];
var openKeys = this.state.openKeys;
if (openKeys.length) {
lastOpen = this.getFlatInstanceArray().filter(function (c) {
return c && openKeys.indexOf(c.props.eventKey) !== -1;
});
}
return lastOpen[0];
};
Menu.prototype.renderMenuItem = function renderMenuItem(c, i, subIndex) {
if (!c) {
return null;
}
var state = this.state;
var extraProps = {
openKeys: state.openKeys,
selectedKeys: state.selectedKeys,
openSubMenuOnMouseEnter: this.props.openSubMenuOnMouseEnter
};
return this.renderCommonMenuItem(c, i, subIndex, extraProps);
};
Menu.prototype.renderCommonMenuItem = function renderCommonMenuItem(child, i, subIndex, extraProps) {
var state = this.state;
var props = this.props;
var key = (0, _util.getKeyFromChildrenIndex)(child, props.eventKey, i);
var childProps = child.props;
var isActive = key === state.activeKey;
var newChildProps = _extends({
mode: props.mode,
level: props.level,
inlineIndent: props.inlineIndent,
renderMenuItem: this.renderMenuItem,
rootPrefixCls: props.clsPrefix,
index: i,
parentMenu: this,
ref: childProps.disabled ? undefined : (0, _tinperBeeCore.createChainedFunction)(child.ref, saveRef.bind(this, i, subIndex)),
eventKey: key,
closeSubMenuOnMouseLeave: props.closeSubMenuOnMouseLeave,
onItemHover: this.onItemHover,
active: !childProps.disabled && isActive,
multiple: props.multiple,
onClick: this.onClick,
openTransitionName: this.getOpenTransitionName(),
openAnimation: props.openAnimation,
onOpenChange: this.onOpenChange,
onDeselect: this.onDeselect,
onDestroy: this.onDestroy,
onSelect: this.onSelect
}, extraProps);
if (props.mode === 'inline') {
newChildProps.closeSubMenuOnMouseLeave = newChildProps.openSubMenuOnMouseEnter = false;
}
return _react2["default"].cloneElement(child, newChildProps);
};
Menu.prototype.getOpenChangesOnItemHover = function getOpenChangesOnItemHover(e) {
var mode = this.props.mode;
var key = e.key,
hover = e.hover,
trigger = e.trigger;
var activeKey = this.state.activeKey;
if (!trigger || hover || this.props.closeSubMenuOnMouseLeave || !e.item.isSubMenu || mode === 'inline') {
this.setState({
activeKey: hover ? key : null
});
} else {}
// keep active for sub menu for click active
// empty
// clear last open status
if (hover && mode !== 'inline') {
var activeItem = this.getFlatInstanceArray().filter(function (c) {
return c && c.props.eventKey === activeKey;
})[0];
if (activeItem && activeItem.isSubMenu && activeItem.props.eventKey !== key) {
return {
item: activeItem,
originalEvent: e,
key: activeItem.props.eventKey,
open: false
};
}
}
return [];
};
Menu.prototype.getFlatInstanceArray = function getFlatInstanceArray() {
var instanceArray = this.instanceArray;
var hasInnerArray = instanceArray.some(function (a) {
return Array.isArray(a);
});
if (hasInnerArray) {
instanceArray = [];
this.instanceArray.forEach(function (a) {
if (Array.isArray(a)) {
instanceArray.push.apply(instanceArray, a);
} else {
instanceArray.push(a);
}
});
this.instanceArray = instanceArray;
}
return instanceArray;
};
Menu.prototype.step = function step(direction) {
var children = this.getFlatInstanceArray();
var activeKey = this.state.activeKey;
var len = children.length;
if (!len) {
return null;
}
if (direction < 0) {
children = children.concat().reverse();
}
// find current activeIndex
var activeIndex = -1;
children.every(function (c, ci) {
if (c && c.props.eventKey === activeKey) {
activeIndex = ci;
return false;
}
return true;
});
if (!this.props.defaultActiveFirst && activeIndex !== -1) {
if (allDisabled(children.slice(activeIndex, len - 1))) {
return undefined;
}
}
var start = (activeIndex + 1) % len;
var i = start;
for (;;) {
var child = children[i];
if (!child || child.props.disabled) {
i = (i + 1 + len) % len;
// complete a loop
if (i === start) {
return null;
}
} else {
return child;
}
}
};
Menu.prototype.onKeyDown = function onKeyDown(e) {
var _this2 = this;
var keyCode = e.keyCode;
var handled = void 0;
this.getFlatInstanceArray().forEach(function (obj) {
if (obj && obj.props.active) {
handled = obj.onKeyDown(e);
}
});
if (handled) {
return 1;
}
var activeItem = null;
if (keyCode === _tinperBeeCore.KeyCode.UP || keyCode === _tinperBeeCore.KeyCode.DOWN) {
activeItem = this.step(keyCode === _tinperBeeCore.KeyCode.UP ? -1 : 1);
}
if (activeItem) {
e.preventDefault();
this.setState({
activeKey: activeItem.props.eventKey
}, function () {
scrollIntoView(ReactDOM.findDOMNode(activeItem), ReactDOM.findDOMNode(_this2), {
onlyScrollIfNeeded: true
});
});
return 1;
} else if (activeItem === undefined) {
e.preventDefault();
this.setState({
activeKey: null
});
return 1;
}
};
Menu.prototype.renderRoot = function renderRoot(props) {
var _classes;
this.instanceArray = [];
var classes = (_classes = {}, _defineProperty(_classes, props.clsPrefix, 1), _defineProperty(_classes, props.clsPrefix + '-' + props.mode, 1), _defineProperty(_classes, props.className, !!props.className), _classes);
var domProps = {
className: (0, _classnames2["default"])(classes),
role: 'menu',
'aria-activedescendant': ''
};
if (props.id) {
domProps.id = props.id;
}
if (props.focusable) {
domProps.tabIndex = '0';
domProps.onKeyDown = this.onKeyDown;
}
return (
// ESLint is not smart enough to know that the type of `children` was checked.
/* eslint-disable */
_react2["default"].createElement(
_DOMWrap2["default"],
_extends({
style: props.style,
tag: 'ul',
hiddenClassName: props.clsPrefix + '-hidden',
visible: props.visible
}, domProps),
_react2["default"].Children.map(props.children, this.renderMenuItem.bind(this))
)
/*eslint-enable */
);
};
Menu.prototype.render = function render() {
var props = _extends({}, this.props);
props.className += ' ' + props.clsPrefix + '-root';
return this.renderRoot(props);
};
return Menu;
}(_react.Component);
;
Menu.propTypes = propTypes;
Menu.defaultProps = defaultProps;
exports["default"] = Menu;
module.exports = exports['default'];
/***/ }),
/* 173 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.noop = noop;
exports.getKeyFromChildrenIndex = getKeyFromChildrenIndex;
exports.loopMenuItem = loopMenuItem;
exports.loopMenuItemRecusively = loopMenuItemRecusively;
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function noop() {}
function getKeyFromChildrenIndex(child, menuEventKey, index) {
var prefix = menuEventKey || '';
return child.key || prefix + 'item_' + index;
}
function loopMenuItem(children, cb) {
var index = -1;
_react2["default"].Children.forEach(children, function (c) {
index++;
if (c && c.type && c.type.isMenuItemGroup) {
_react2["default"].Children.forEach(c.props.children, function (c2) {
index++;
cb(c2, index);
});
} else {
cb(c, index);
}
});
}
function loopMenuItemRecusively(children, keys, ret) {
if (!children || ret.find) {
return;
}
_react2["default"].Children.forEach(children, function (c) {
if (ret.find) {
return;
}
if (c) {
var construt = c.type;
if (!construt || !(construt.isSubMenu || construt.isMenuItem || construt.isMenuItemGroup)) {
return;
}
if (keys.indexOf(c.key) !== -1) {
ret.find = true;
} else if (c.props.children) {
loopMenuItemRecusively(c.props.children, keys, ret);
}
}
});
}
/***/ }),
/* 174 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
tag: _propTypes2["default"].string,
hiddenClassName: _propTypes2["default"].string,
visible: _propTypes2["default"].bool
};
var defaultProps = {
tag: 'div'
};
var DOMWrap = function (_Component) {
_inherits(DOMWrap, _Component);
function DOMWrap() {
_classCallCheck(this, DOMWrap);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
DOMWrap.prototype.render = function render() {
var props = _extends({}, this.props);
if (!props.visible) {
props.className = props.className || '';
props.className += ' ' + props.hiddenClassName;
}
var Tag = props.tag;
delete props.tag;
delete props.hiddenClassName;
delete props.visible;
return _react2["default"].createElement(Tag, props);
};
return DOMWrap;
}(_react.Component);
;
DOMWrap.propTypes = propTypes;
DOMWrap.defaultProps = defaultProps;
exports["default"] = DOMWrap;
module.exports = exports['default'];
/***/ }),
/* 175 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _SubPopupMenu = __webpack_require__(176);
var _SubPopupMenu2 = _interopRequireDefault(_SubPopupMenu);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _keyCode = __webpack_require__(72);
var _keyCode2 = _interopRequireDefault(_keyCode);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _util = __webpack_require__(173);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var guid = 0;
var propTypes = {
parentMenu: _propTypes2["default"].object,
title: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].node]),
children: _propTypes2["default"].any,
selectedKeys: _propTypes2["default"].array,
openKeys: _propTypes2["default"].array,
onClick: _propTypes2["default"].func,
onOpenChange: _propTypes2["default"].func,
rootPrefixCls: _propTypes2["default"].string,
eventKey: _propTypes2["default"].string,
multiple: _propTypes2["default"].bool,
active: _propTypes2["default"].bool,
onSelect: _propTypes2["default"].func,
closeSubMenuOnMouseLeave: _propTypes2["default"].bool,
openSubMenuOnMouseEnter: _propTypes2["default"].bool,
onDeselect: _propTypes2["default"].func,
onDestroy: _propTypes2["default"].func,
onItemHover: _propTypes2["default"].func,
onMouseEnter: _propTypes2["default"].func,
onMouseLeave: _propTypes2["default"].func,
onTitleMouseEnter: _propTypes2["default"].func,
onTitleMouseLeave: _propTypes2["default"].func,
onTitleClick: _propTypes2["default"].func
};
var defaultProps = {
onMouseEnter: _util.noop,
onMouseLeave: _util.noop,
onTitleMouseEnter: _util.noop,
onTitleMouseLeave: _util.noop,
onTitleClick: _util.noop,
title: ''
};
var SubMenu = function (_Component) {
_inherits(SubMenu, _Component);
function SubMenu(props) {
_classCallCheck(this, SubMenu);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.isSubMenu = 1;
_this.state = {
defaultActiveFirst: false
};
_this.onDestroy = _this.onDestroy.bind(_this);
_this.onKeyDown = _this.onKeyDown.bind(_this);
_this.onOpenChange = _this.onOpenChange.bind(_this);
_this.onMouseEnter = _this.onMouseEnter.bind(_this);
_this.onTitleMouseEnter = _this.onTitleMouseEnter.bind(_this);
_this.onTitleMouseLeave = _this.onTitleMouseLeave.bind(_this);
_this.onMouseLeave = _this.onMouseLeave.bind(_this);
_this.onTitleClick = _this.onTitleClick.bind(_this);
_this.onSubMenuClick = _this.onSubMenuClick.bind(_this);
_this.onSelect = _this.onSelect.bind(_this);
_this.onDeselect = _this.onDeselect.bind(_this);
_this.getPrefixCls = _this.getPrefixCls.bind(_this);
_this.getActiveClassName = _this.getActiveClassName.bind(_this);
_this.getSelectedClassName = _this.getSelectedClassName.bind(_this);
_this.getDisabledClassName = _this.getDisabledClassName.bind(_this);
_this.getOpenClassName = _this.getOpenClassName.bind(_this);
_this.saveMenuInstance = _this.saveMenuInstance.bind(_this);
_this.addKeyPath = _this.addKeyPath.bind(_this);
_this.triggerOpenChange = _this.triggerOpenChange.bind(_this);
_this.clearSubMenuTimers = _this.clearSubMenuTimers.bind(_this);
_this.clearSubMenuLeaveTimer = _this.clearSubMenuLeaveTimer.bind(_this);
_this.clearSubMenuTitleLeaveTimer = _this.clearSubMenuTitleLeaveTimer.bind(_this);
_this.isChildrenSelected = _this.isChildrenSelected.bind(_this);
_this.isOpen = _this.isOpen.bind(_this);
_this.renderChildren = _this.renderChildren.bind(_this);
return _this;
}
SubMenu.prototype.componentWillUnmount = function componentWillUnmount() {
var _props = this.props,
onDestroy = _props.onDestroy,
eventKey = _props.eventKey,
parentMenu = _props.parentMenu;
this.mounted = true;
if (onDestroy) {
onDestroy(eventKey);
}
if (parentMenu.subMenuInstance === this) {
this.clearSubMenuTimers();
}
};
SubMenu.prototype.componentDidMount = function componentDidMount() {
this.mounted = true;
};
SubMenu.prototype.onDestroy = function onDestroy(key) {
this.props.onDestroy(key);
};
SubMenu.prototype.onKeyDown = function onKeyDown(e) {
var keyCode = e.keyCode;
var menu = this.menuInstance;
var isOpen = this.isOpen();
if (keyCode === _keyCode2["default"].ENTER) {
this.onTitleClick(e);
this.setState({
defaultActiveFirst: true
});
return true;
}
if (keyCode === _keyCode2["default"].RIGHT) {
if (isOpen) {
menu.onKeyDown(e);
} else {
this.triggerOpenChange(true);
this.setState({
defaultActiveFirst: true
});
}
return true;
}
if (keyCode === _keyCode2["default"].LEFT) {
var handled = void 0;
if (isOpen) {
handled = menu.onKeyDown(e);
} else {
return undefined;
}
if (!handled) {
this.triggerOpenChange(false);
handled = true;
}
return handled;
}
if (isOpen && (keyCode === _keyCode2["default"].UP || keyCode === _keyCode2["default"].DOWN)) {
return menu.onKeyDown(e);
}
};
SubMenu.prototype.onOpenChange = function onOpenChange(e) {
this.props.onOpenChange(e);
};
SubMenu.prototype.onMouseEnter = function onMouseEnter(e) {
var props = this.props;
this.clearSubMenuLeaveTimer(props.parentMenu.subMenuInstance !== this);
props.onMouseEnter({
key: props.eventKey,
domEvent: e
});
};
SubMenu.prototype.onTitleMouseEnter = function onTitleMouseEnter(domEvent) {
var props = this.props;
var parentMenu = props.parentMenu,
key = props.eventKey;
var item = this;
this.clearSubMenuTitleLeaveTimer(parentMenu.subMenuInstance !== item);
if (parentMenu.menuItemInstance) {
parentMenu.menuItemInstance.clearMenuItemMouseLeaveTimer(true);
}
var openChanges = [];
if (props.openSubMenuOnMouseEnter) {
openChanges.push({
key: key,
item: item,
trigger: 'mouseenter',
open: true
});
}
props.onItemHover({
key: key,
item: item,
hover: true,
trigger: 'mouseenter',
openChanges: openChanges
});
this.setState({
defaultActiveFirst: false
});
props.onTitleMouseEnter({
key: key,
domEvent: domEvent
});
};
SubMenu.prototype.onTitleMouseLeave = function onTitleMouseLeave(e) {
var _this2 = this;
var props = this.props;
var parentMenu = props.parentMenu,
eventKey = props.eventKey;
parentMenu.subMenuInstance = this;
parentMenu.subMenuTitleLeaveFn = function () {
if (_this2.mounted) {
// leave whole sub tree
// still active
if (props.mode === 'inline' && props.active) {
props.onItemHover({
key: eventKey,
item: _this2,
hover: false,
trigger: 'mouseleave'
});
}
props.onTitleMouseLeave({
key: props.eventKey,
domEvent: e
});
}
};
parentMenu.subMenuTitleLeaveTimer = setTimeout(parentMenu.subMenuTitleLeaveFn, 100);
};
SubMenu.prototype.onMouseLeave = function onMouseLeave(e) {
var _this3 = this;
var props = this.props;
var parentMenu = props.parentMenu,
eventKey = props.eventKey;
parentMenu.subMenuInstance = this;
parentMenu.subMenuLeaveFn = function () {
if (_this3.mounted) {
// leave whole sub tree
// still active
if (props.mode !== 'inline') {
var isOpen = _this3.isOpen();
if (isOpen && props.closeSubMenuOnMouseLeave && props.active) {
props.onItemHover({
key: eventKey,
item: _this3,
hover: false,
trigger: 'mouseleave',
openChanges: [{
key: eventKey,
item: _this3,
trigger: 'mouseleave',
open: false
}]
});
} else {
if (props.active) {
props.onItemHover({
key: eventKey,
item: _this3,
hover: false,
trigger: 'mouseleave'
});
}
if (isOpen && props.closeSubMenuOnMouseLeave) {
_this3.triggerOpenChange(false);
}
}
}
// trigger mouseleave
props.onMouseLeave({
key: eventKey,
domEvent: e
});
}
};
// prevent popup menu and submenu gap
parentMenu.subMenuLeaveTimer = setTimeout(parentMenu.subMenuLeaveFn, 100);
};
SubMenu.prototype.onTitleClick = function onTitleClick(e) {
var props = this.props;
props.onTitleClick({
key: props.eventKey,
domEvent: e
});
if (props.openSubMenuOnMouseEnter) {
return;
}
this.triggerOpenChange(!this.isOpen(), 'click');
this.setState({
defaultActiveFirst: false
});
};
SubMenu.prototype.onSubMenuClick = function onSubMenuClick(info) {
this.props.onClick(this.addKeyPath(info));
};
SubMenu.prototype.onSelect = function onSelect(info) {
this.props.onSelect(info);
};
SubMenu.prototype.onDeselect = function onDeselect(info) {
this.props.onDeselect(info);
};
SubMenu.prototype.getPrefixCls = function getPrefixCls() {
return this.props.rootPrefixCls + '-submenu';
};
SubMenu.prototype.getActiveClassName = function getActiveClassName() {
return this.getPrefixCls() + '-active';
};
SubMenu.prototype.getDisabledClassName = function getDisabledClassName() {
return this.getPrefixCls() + '-disabled';
};
SubMenu.prototype.getSelectedClassName = function getSelectedClassName() {
return this.getPrefixCls() + '-selected';
};
SubMenu.prototype.getOpenClassName = function getOpenClassName() {
return this.props.rootPrefixCls + '-submenu-open';
};
SubMenu.prototype.saveMenuInstance = function saveMenuInstance(c) {
this.menuInstance = c;
};
SubMenu.prototype.addKeyPath = function addKeyPath(info) {
return _extends({}, info, {
keyPath: (info.keyPath || []).concat(this.props.eventKey)
});
};
SubMenu.prototype.triggerOpenChange = function triggerOpenChange(open, type) {
var key = this.props.eventKey;
this.onOpenChange({
key: key,
item: this,
trigger: type,
open: open
});
};
SubMenu.prototype.clearSubMenuTimers = function clearSubMenuTimers() {
var callFn = void 0;
this.clearSubMenuLeaveTimer(callFn);
this.clearSubMenuTitleLeaveTimer(callFn);
};
SubMenu.prototype.clearSubMenuTitleLeaveTimer = function clearSubMenuTitleLeaveTimer() {
var callFn = void 0;
var parentMenu = this.props.parentMenu;
if (parentMenu.subMenuTitleLeaveTimer) {
clearTimeout(parentMenu.subMenuTitleLeaveTimer);
parentMenu.subMenuTitleLeaveTimer = null;
if (callFn && parentMenu.subMenuTitleLeaveFn) {
parentMenu.subMenuTitleLeaveFn();
}
parentMenu.subMenuTitleLeaveFn = null;
}
};
SubMenu.prototype.clearSubMenuLeaveTimer = function clearSubMenuLeaveTimer() {
var callFn = void 0;
var parentMenu = this.props.parentMenu;
if (parentMenu.subMenuLeaveTimer) {
clearTimeout(parentMenu.subMenuLeaveTimer);
parentMenu.subMenuLeaveTimer = null;
if (callFn && parentMenu.subMenuLeaveFn) {
parentMenu.subMenuLeaveFn();
}
parentMenu.subMenuLeaveFn = null;
}
};
SubMenu.prototype.isChildrenSelected = function isChildrenSelected() {
var ret = { find: false };
(0, _util.loopMenuItemRecusively)(this.props.children, this.props.selectedKeys, ret);
return ret.find;
};
SubMenu.prototype.isOpen = function isOpen() {
return this.props.openKeys.indexOf(this.props.eventKey) !== -1;
};
SubMenu.prototype.renderChildren = function renderChildren(children) {
var props = this.props;
var baseProps = {
mode: props.mode === 'horizontal' ? 'vertical' : props.mode,
visible: this.isOpen(),
level: props.level + 1,
inlineIndent: props.inlineIndent,
focusable: false,
onClick: this.onSubMenuClick,
onSelect: this.onSelect,
onDeselect: this.onDeselect,
onDestroy: this.onDestroy,
selectedKeys: props.selectedKeys,
eventKey: props.eventKey + '-menu-',
openKeys: props.openKeys,
openTransitionName: props.openTransitionName,
openAnimation: props.openAnimation,
onOpenChange: this.onOpenChange,
closeSubMenuOnMouseLeave: props.closeSubMenuOnMouseLeave,
defaultActiveFirst: this.state.defaultActiveFirst,
multiple: props.multiple,
prefixCls: props.rootPrefixCls,
id: this._menuId,
ref: this.saveMenuInstance
};
return _react2["default"].createElement(
_SubPopupMenu2["default"],
baseProps,
children
);
};
SubMenu.prototype.render = function render() {
var _classes;
var isOpen = this.isOpen();
this.haveOpen = this.haveOpen || isOpen;
var props = this.props;
var prefixCls = this.getPrefixCls();
var classes = (_classes = {}, _defineProperty(_classes, props.className, !!props.className), _defineProperty(_classes, prefixCls + '-' + props.mode, 1), _classes);
classes[this.getOpenClassName()] = isOpen;
classes[this.getActiveClassName()] = props.active;
classes[this.getDisabledClassName()] = props.disabled;
classes[this.getSelectedClassName()] = this.isChildrenSelected();
if (!this._menuId) {
if (props.eventKey) {
this._menuId = props.eventKey + '$Menu';
} else {
this._menuId = '$__$' + ++guid + '$Menu';
}
}
classes[prefixCls] = true;
classes[prefixCls + '-' + props.mode] = 1;
var titleClickEvents = {};
var mouseEvents = {};
var titleMouseEvents = {};
if (!props.disabled) {
titleClickEvents = {
onClick: this.onTitleClick
};
mouseEvents = {
onMouseLeave: this.onMouseLeave,
onMouseEnter: this.onMouseEnter
};
// only works in title, not outer li
titleMouseEvents = {
onMouseEnter: this.onTitleMouseEnter,
onMouseLeave: this.onTitleMouseLeave
};
}
var style = {};
if (props.mode === 'inline') {
style.paddingLeft = props.inlineIndent * props.level;
}
return _react2["default"].createElement(
'li',
_extends({ className: (0, _classnames2["default"])(classes) }, mouseEvents),
_react2["default"].createElement(
'div',
_extends({
style: style,
className: prefixCls + '-title'
}, titleMouseEvents, titleClickEvents, {
'aria-expanded': isOpen,
'aria-owns': this._menuId,
'aria-haspopup': 'true'
}),
props.title
),
this.renderChildren(props.children)
);
};
return SubMenu;
}(_react.Component);
;
SubMenu.propTypes = propTypes;
SubMenu.defaultProps = defaultProps;
SubMenu.isSubMenu = 1;
exports["default"] = SubMenu;
module.exports = exports['default'];
/***/ }),
/* 176 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _beeAnimate = __webpack_require__(135);
var _beeAnimate2 = _interopRequireDefault(_beeAnimate);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _createChainedFunction = __webpack_require__(71);
var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
var _util = __webpack_require__(173);
var _DOMWrap = __webpack_require__(174);
var _DOMWrap2 = _interopRequireDefault(_DOMWrap);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
function allDisabled(arr) {
if (!arr.length) {
return true;
}
return arr.every(function (c) {
return !!c.props.disabled;
});
}
function getActiveKey(props, originalActiveKey) {
var activeKey = originalActiveKey;
var children = props.children,
eventKey = props.eventKey;
if (activeKey) {
var found = void 0;
(0, _util.loopMenuItem)(children, function (c, i) {
if (c && !c.props.disabled && activeKey === (0, _util.getKeyFromChildrenIndex)(c, eventKey, i)) {
found = true;
}
});
if (found) {
return activeKey;
}
}
activeKey = null;
if (props.defaultActiveFirst) {
(0, _util.loopMenuItem)(children, function (c, i) {
if (!activeKey && c && !c.props.disabled) {
activeKey = (0, _util.getKeyFromChildrenIndex)(c, eventKey, i);
}
});
return activeKey;
}
return activeKey;
}
function saveRef(index, subIndex, c) {
if (c) {
if (subIndex !== undefined) {
this.instanceArray[index] = this.instanceArray[index] || [];
this.instanceArray[index][subIndex] = c;
} else {
this.instanceArray[index] = c;
}
}
}
var propTypes = {
onSelect: _propTypes2["default"].func,
onClick: _propTypes2["default"].func,
onDeselect: _propTypes2["default"].func,
onOpenChange: _propTypes2["default"].func,
onDestroy: _propTypes2["default"].func,
openTransitionName: _propTypes2["default"].string,
openAnimation: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].object]),
openKeys: _propTypes2["default"].array,
closeSubMenuOnMouseLeave: _propTypes2["default"].bool,
visible: _propTypes2["default"].bool,
children: _propTypes2["default"].any
};
var SubPopupMenu = function (_Component) {
_inherits(SubPopupMenu, _Component);
function SubPopupMenu(props) {
_classCallCheck(this, SubPopupMenu);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.state = {
activeKey: getActiveKey(_this.props, _this.props.activeKey)
};
_this.getOpenChangesOnItemHover = _this.getOpenChangesOnItemHover.bind(_this);
_this.onDeselect = _this.onDeselect.bind(_this);
_this.onClick = _this.onClick.bind(_this);
_this.onOpenChange = _this.onOpenChange.bind(_this);
_this.onDestroy = _this.onDestroy.bind(_this);
_this.onSelect = _this.onSelect.bind(_this);
_this.onItemHover = _this.onItemHover.bind(_this);
_this.getOpenTransitionName = _this.getOpenTransitionName.bind(_this);
_this.renderMenuItem = _this.renderMenuItem.bind(_this);
_this.getFlatInstanceArray = _this.getFlatInstanceArray.bind(_this);
_this.renderCommonMenuItem = _this.renderCommonMenuItem.bind(_this);
_this.renderRoot = _this.renderRoot.bind(_this);
return _this;
}
SubPopupMenu.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var props = void 0;
if ('activeKey' in nextProps) {
props = {
activeKey: getActiveKey(nextProps, nextProps.activeKey)
};
} else {
var originalActiveKey = this.state.activeKey;
var activeKey = getActiveKey(nextProps, originalActiveKey);
// fix: this.setState(), parent.render(),
if (activeKey !== originalActiveKey) {
props = {
activeKey: activeKey
};
}
}
if (props) {
this.setState(props);
}
};
SubPopupMenu.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
return this.props.visible || nextProps.visible;
};
SubPopupMenu.prototype.onDeselect = function onDeselect(selectInfo) {
this.props.onDeselect(selectInfo);
};
SubPopupMenu.prototype.onSelect = function onSelect(selectInfo) {
this.props.onSelect(selectInfo);
};
SubPopupMenu.prototype.onClick = function onClick(e) {
this.props.onClick(e);
};
SubPopupMenu.prototype.onOpenChange = function onOpenChange(e) {
this.props.onOpenChange(e);
};
SubPopupMenu.prototype.onDestroy = function onDestroy(key) {
this.props.onDestroy(key);
};
SubPopupMenu.prototype.onItemHover = function onItemHover(e) {
var _e$openChanges = e.openChanges,
openChanges = _e$openChanges === undefined ? [] : _e$openChanges;
openChanges = openChanges.concat(this.getOpenChangesOnItemHover(e));
if (openChanges.length) {
this.onOpenChange(openChanges);
}
};
SubPopupMenu.prototype.getOpenTransitionName = function getOpenTransitionName() {
return this.props.openTransitionName;
};
SubPopupMenu.prototype.renderMenuItem = function renderMenuItem(c, i, subIndex) {
var props = this.props;
var extraProps = {
openKeys: props.openKeys,
selectedKeys: props.selectedKeys,
openSubMenuOnMouseEnter: true
};
return this.renderCommonMenuItem(c, i, subIndex, extraProps);
};
SubPopupMenu.prototype.getOpenChangesOnItemHover = function getOpenChangesOnItemHover(e) {
var mode = this.props.mode;
var key = e.key,
hover = e.hover,
trigger = e.trigger;
var activeKey = this.state.activeKey;
if (!trigger || hover || this.props.closeSubMenuOnMouseLeave || !e.item.isSubMenu || mode === 'inline') {
this.setState({
activeKey: hover ? key : null
});
} else {}
// keep active for sub menu for click active
// empty
// clear last open status
if (hover && mode !== 'inline') {
var activeItem = this.getFlatInstanceArray().filter(function (c) {
return c && c.props.eventKey === activeKey;
})[0];
if (activeItem && activeItem.isSubMenu && activeItem.props.eventKey !== key) {
return {
item: activeItem,
originalEvent: e,
key: activeItem.props.eventKey,
open: false
};
}
}
return [];
};
SubPopupMenu.prototype.renderCommonMenuItem = function renderCommonMenuItem(child, i, subIndex, extraProps) {
var state = this.state;
var props = this.props;
var key = (0, _util.getKeyFromChildrenIndex)(child, props.eventKey, i);
var childProps = child.props;
var isActive = key === state.activeKey;
var newChildProps = _extends({
mode: props.mode,
level: props.level,
inlineIndent: props.inlineIndent,
renderMenuItem: this.renderMenuItem,
rootPrefixCls: props.prefixCls,
index: i,
parentMenu: this,
ref: childProps.disabled ? undefined : (0, _createChainedFunction2["default"])(child.ref, saveRef.bind(this, i, subIndex)),
eventKey: key,
closeSubMenuOnMouseLeave: props.closeSubMenuOnMouseLeave,
onItemHover: this.onItemHover,
active: !childProps.disabled && isActive,
multiple: props.multiple,
onClick: this.onClick,
openTransitionName: this.getOpenTransitionName(),
openAnimation: props.openAnimation,
onOpenChange: this.onOpenChange,
onDeselect: this.onDeselect,
onDestroy: this.onDestroy,
onSelect: this.onSelect
}, extraProps);
if (props.mode === 'inline') {
newChildProps.closeSubMenuOnMouseLeave = newChildProps.openSubMenuOnMouseEnter = false;
}
return _react2["default"].cloneElement(child, newChildProps);
};
SubPopupMenu.prototype.getFlatInstanceArray = function getFlatInstanceArray() {
var instanceArray = this.instanceArray;
var hasInnerArray = instanceArray.some(function (a) {
return Array.isArray(a);
});
if (hasInnerArray) {
instanceArray = [];
this.instanceArray.forEach(function (a) {
if (Array.isArray(a)) {
instanceArray.push.apply(instanceArray, a);
} else {
instanceArray.push(a);
}
});
this.instanceArray = instanceArray;
}
return instanceArray;
};
SubPopupMenu.prototype.renderRoot = function renderRoot(props) {
var _classes;
this.instanceArray = [];
var classes = (_classes = {}, _defineProperty(_classes, props.prefixCls, 1), _defineProperty(_classes, props.prefixCls + '-' + props.mode, 1), _defineProperty(_classes, props.className, !!props.className), _classes);
var domProps = {
className: (0, _classnames2["default"])(classes),
role: 'menu',
'aria-activedescendant': ''
};
if (props.id) {
domProps.id = props.id;
}
if (props.focusable) {
domProps.tabIndex = '0';
domProps.onKeyDown = this.onKeyDown;
}
return (
// ESLint is not smart enough to know that the type of `children` was checked.
/* eslint-disable */
_react2["default"].createElement(
_DOMWrap2["default"],
_extends({
style: props.style,
tag: 'ul',
hiddenClassName: props.prefixCls + '-hidden',
visible: props.visible
}, domProps),
_react2["default"].Children.map(props.children, this.renderMenuItem.bind(this))
)
/*eslint-enable */
);
};
SubPopupMenu.prototype.render = function render() {
var renderFirst = this.renderFirst;
this.renderFirst = 1;
this.haveOpened = this.haveOpened || this.props.visible;
if (!this.haveOpened) {
return null;
}
var transitionAppear = true;
if (!renderFirst && this.props.visible) {
transitionAppear = false;
}
var props = _extends({}, this.props);
props.className += ' ' + props.prefixCls + '-sub';
var animProps = {};
if (props.openTransitionName) {
animProps.transitionName = props.openTransitionName;
} else if (_typeof(props.openAnimation) === 'object') {
animProps.animation = _extends({}, props.openAnimation);
if (!transitionAppear) {
delete animProps.animation.appear;
}
}
return _react2["default"].createElement(
_beeAnimate2["default"],
_extends({}, animProps, {
showProp: 'visible',
component: '',
transitionAppear: transitionAppear
}),
this.renderRoot(props)
);
};
return SubPopupMenu;
}(_react.Component);
;
SubPopupMenu.propTypes = propTypes;
exports["default"] = SubPopupMenu;
module.exports = exports['default'];
/***/ }),
/* 177 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _keyCode = __webpack_require__(72);
var _keyCode2 = _interopRequireDefault(_keyCode);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _util = __webpack_require__(173);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
/* eslint react/no-is-mounted:0 */
var propTypes = {
rootPrefixCls: _propTypes2["default"].string,
eventKey: _propTypes2["default"].string,
active: _propTypes2["default"].bool,
children: _propTypes2["default"].any,
selectedKeys: _propTypes2["default"].array,
disabled: _propTypes2["default"].bool,
title: _propTypes2["default"].string,
onSelect: _propTypes2["default"].func,
onClick: _propTypes2["default"].func,
onDeselect: _propTypes2["default"].func,
parentMenu: _propTypes2["default"].object,
onItemHover: _propTypes2["default"].func,
onDestroy: _propTypes2["default"].func,
onMouseEnter: _propTypes2["default"].func,
onMouseLeave: _propTypes2["default"].func
};
var defaultProps = {
onSelect: _util.noop,
onMouseEnter: _util.noop,
onMouseLeave: _util.noop
};
var MenuItem = function (_Component) {
_inherits(MenuItem, _Component);
function MenuItem(props) {
_classCallCheck(this, MenuItem);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.onMouseLeave = _this.onMouseLeave.bind(_this);
_this.onMouseEnter = _this.onMouseEnter.bind(_this);
_this.onKeyDown = _this.onKeyDown.bind(_this);
_this.onClick = _this.onClick.bind(_this);
_this.getPrefixCls = _this.getPrefixCls.bind(_this);
_this.getActiveClassName = _this.getActiveClassName.bind(_this);
_this.getDisabledClassName = _this.getDisabledClassName.bind(_this);
_this.getSelectedClassName = _this.getSelectedClassName.bind(_this);
_this.clearMenuItemMouseLeaveTimer = _this.clearMenuItemMouseLeaveTimer.bind(_this);
_this.isSelected = _this.isSelected.bind(_this);
return _this;
}
MenuItem.prototype.componentWillUnmount = function componentWillUnmount() {
var props = this.props;
this.mounted = false;
if (props.onDestroy) {
props.onDestroy(props.eventKey);
}
if (props.parentMenu.menuItemInstance === this) {
this.clearMenuItemMouseLeaveTimer();
}
};
MenuItem.prototype.componentDidMount = function componentDidMount() {
this.mounted = true;
};
MenuItem.prototype.onKeyDown = function onKeyDown(e) {
var keyCode = e.keyCode;
if (keyCode === _keyCode2["default"].ENTER) {
this.onClick(e);
return true;
}
};
MenuItem.prototype.onMouseLeave = function onMouseLeave(e) {
var _this2 = this;
var props = this.props;
var eventKey = props.eventKey,
parentMenu = props.parentMenu;
parentMenu.menuItemInstance = this;
parentMenu.menuItemMouseLeaveFn = function () {
if (_this2.mounted && props.active) {
props.onItemHover({
key: eventKey,
item: _this2,
hover: false,
domEvent: e,
trigger: 'mouseleave'
});
}
};
parentMenu.menuItemMouseLeaveTimer = setTimeout(parentMenu.menuItemMouseLeaveFn, 30);
props.onMouseLeave({
key: eventKey,
domEvent: e
});
};
MenuItem.prototype.onMouseEnter = function onMouseEnter(e) {
var props = this.props;
var eventKey = props.eventKey,
parentMenu = props.parentMenu;
this.clearMenuItemMouseLeaveTimer(parentMenu.menuItemInstance !== this);
if (parentMenu.subMenuInstance) {
parentMenu.subMenuInstance.clearSubMenuTimers();
}
props.onItemHover({
key: eventKey,
item: this,
hover: true,
domEvent: e,
trigger: 'mouseenter'
});
props.onMouseEnter({
key: eventKey,
domEvent: e
});
};
MenuItem.prototype.onClick = function onClick(e) {
var props = this.props;
var selected = this.isSelected();
var eventKey = props.eventKey;
var info = {
key: eventKey,
keyPath: [eventKey],
item: this,
domEvent: e
};
props.onClick(info);
if (props.multiple) {
if (selected) {
props.onDeselect(info);
} else {
props.onSelect(info);
}
} else if (!selected) {
props.onSelect(info);
}
};
MenuItem.prototype.getPrefixCls = function getPrefixCls() {
return this.props.rootPrefixCls + '-item';
};
MenuItem.prototype.getActiveClassName = function getActiveClassName() {
return this.getPrefixCls() + '-active';
};
MenuItem.prototype.getSelectedClassName = function getSelectedClassName() {
return this.getPrefixCls() + '-selected';
};
MenuItem.prototype.getDisabledClassName = function getDisabledClassName() {
return this.getPrefixCls() + '-disabled';
};
MenuItem.prototype.clearMenuItemMouseLeaveTimer = function clearMenuItemMouseLeaveTimer() {
var props = this.props;
var callFn = void 0;
var parentMenu = props.parentMenu;
if (parentMenu.menuItemMouseLeaveTimer) {
clearTimeout(parentMenu.menuItemMouseLeaveTimer);
parentMenu.menuItemMouseLeaveTimer = null;
if (callFn && parentMenu.menuItemMouseLeaveFn) {
parentMenu.menuItemMouseLeaveFn();
}
parentMenu.menuItemMouseLeaveFn = null;
}
};
MenuItem.prototype.isSelected = function isSelected() {
return this.props.selectedKeys.indexOf(this.props.eventKey) !== -1;
};
MenuItem.prototype.render = function render() {
var props = this.props;
var selected = this.isSelected();
var classes = {};
classes[this.getActiveClassName()] = !props.disabled && props.active;
classes[this.getSelectedClassName()] = selected;
classes[this.getDisabledClassName()] = props.disabled;
classes[this.getPrefixCls()] = true;
classes[props.className] = !!props.className;
var attrs = _extends({}, props.attribute, {
title: props.title,
className: (0, _classnames2["default"])(classes),
role: 'menuitem',
'aria-selected': selected,
'aria-disabled': props.disabled
});
var mouseEvent = {};
if (!props.disabled) {
mouseEvent = {
onClick: this.onClick,
onMouseLeave: this.onMouseLeave,
onMouseEnter: this.onMouseEnter
};
}
var style = _extends({}, props.style);
if (props.mode === 'inline') {
style.paddingLeft = props.inlineIndent * props.level;
}
return _react2["default"].createElement(
'li',
_extends({
style: style
}, attrs, mouseEvent),
props.children
);
};
return MenuItem;
}(_react.Component);
;
MenuItem.isMenuItem = 1;
MenuItem.defaultProps = defaultProps;
MenuItem.propTypes = propTypes;
exports["default"] = MenuItem;
module.exports = exports['default'];
/***/ }),
/* 178 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
renderMenuItem: _propTypes2["default"].func,
index: _propTypes2["default"].number,
className: _propTypes2["default"].string,
rootPrefixCls: _propTypes2["default"].string,
title: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].node]),
children: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].node])
};
var defaultProps = {
disabled: true
};
var MenuItemGroup = function (_Component) {
_inherits(MenuItemGroup, _Component);
function MenuItemGroup() {
_classCallCheck(this, MenuItemGroup);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
MenuItemGroup.prototype.renderInnerMenuItem = function renderInnerMenuItem(item, subIndex) {
var _props = this.props,
renderMenuItem = _props.renderMenuItem,
index = _props.index;
return renderMenuItem(item, index, subIndex);
};
MenuItemGroup.prototype.render = function render() {
var _props2 = this.props,
_props2$className = _props2.className,
className = _props2$className === undefined ? '' : _props2$className,
title = _props2.title,
children = _props2.children,
rootPrefixCls = _props2.rootPrefixCls;
var titleClassName = rootPrefixCls + '-item-group-title';
var listClassName = rootPrefixCls + '-item-group-list';
return _react2["default"].createElement(
'li',
{ className: className + ' ' + rootPrefixCls + '-item-group' },
_react2["default"].createElement(
'div',
{ className: titleClassName },
title
),
_react2["default"].createElement(
'ul',
{ className: listClassName },
_react2["default"].Children.map(children, this.renderInnerMenuItem.bind(this))
)
);
};
return MenuItemGroup;
}(_react.Component);
;
MenuItemGroup.isMenuItemGroup = true;
MenuItemGroup.propTypes = propTypes;
MenuItemGroup.defaultProps = defaultProps;
exports["default"] = MenuItemGroup;
module.exports = exports['default'];
/***/ }),
/* 179 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
className: _propTypes2["default"].string,
rootPrefixCls: _propTypes2["default"].string
};
var Divider = function (_Component) {
_inherits(Divider, _Component);
function Divider() {
_classCallCheck(this, Divider);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
Divider.prototype.render = function render() {
var _props = this.props,
className = _props.className,
rootPrefixCls = _props.rootPrefixCls;
return _react2["default"].createElement('li', { className: className + ' ' + rootPrefixCls + '-item-divider' });
};
return Divider;
}(_react.Component);
;
Divider.propTypes = propTypes;
exports["default"] = Divider;
module.exports = exports['default'];
/***/ }),
/* 180 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var defaultProps = {
clsPrefix: "u-navbar-side-container",
sideActive: false
};
var NavSideContainer = function (_React$Component) {
_inherits(NavSideContainer, _React$Component);
function NavSideContainer() {
_classCallCheck(this, NavSideContainer);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
NavSideContainer.prototype.render = function render() {
var _props = this.props,
className = _props.className,
children = _props.children,
clsPrefix = _props.clsPrefix,
sideActive = _props.sideActive,
expanded = _props.expanded,
props = _objectWithoutProperties(_props, ['className', 'children', 'clsPrefix', 'sideActive', 'expanded']);
//const navbarProps = this.context.u_navbar;
return _react2["default"].createElement(
'div',
{ className: (0, _classnames2["default"])(className, clsPrefix, expanded && 'expanded') },
children
);
};
return NavSideContainer;
}(_react2["default"].Component);
NavSideContainer.defaultProps = defaultProps;
exports["default"] = NavSideContainer;
module.exports = exports['default'];
/***/ }),
/* 181 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _createChainedFunction = __webpack_require__(71);
var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
onClick: _propTypes2["default"].func,
/**
* The toggle content, if left empty it will render the default toggle (seen above).
*/
show: _propTypes2["default"].bool,
children: _propTypes2["default"].node
};
var contextTypes = {
u_navbar: _propTypes2["default"].shape({
expanded: _propTypes2["default"].bool,
onToggle: _propTypes2["default"].func
})
};
var defaultProps = {
clsPrefix: 'u-navbar-toggle',
show: false
};
var MenuToggle = function (_React$Component) {
_inherits(MenuToggle, _React$Component);
function MenuToggle(props) {
_classCallCheck(this, MenuToggle);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));
_this.state = {
toggleState: false
//this.handleRender = this.handleRender.bind(this);
};return _this;
}
MenuToggle.prototype.handleClick = function handleClick() {
var _context$u_navbar = this.context.u_navbar,
expanded = _context$u_navbar.expanded,
onToggle = _context$u_navbar.onToggle;
this.setState({ toggleState: !this.state.toggleState });
if (onToggle) {
onToggle(!expanded);
}
};
MenuToggle.prototype.render = function render() {
var _props = this.props,
onClick = _props.onClick,
className = _props.className,
children = _props.children,
clsPrefix = _props.clsPrefix,
show = _props.show,
props = _objectWithoutProperties(_props, ['onClick', 'className', 'children', 'clsPrefix', 'show']);
//const navbarProps = this.context.u_navbar || { bsClass: 'navbar' };
//console.log(navbarProps.onToggle, navbarProps.expanded);
var buttonProps = _extends({
type: 'button'
}, props, {
onClick: (0, _createChainedFunction2["default"])(onClick, this.handleClick.bind(this)),
className: (0, _classnames2["default"])(className, clsPrefix, show && 'show')
//!this.context.u_navbar.expanded && 'collapsed',
});
if (children) {
return _react2["default"].createElement(
'button',
buttonProps,
children
);
}
//当show存在时,渲染左侧静态面包按钮
return _react2["default"].createElement(
'div',
null,
show && this.state.toggleState && _react2["default"].createElement(
'button',
buttonProps,
_react2["default"].createElement(
'span',
{ className: 'sr-only' },
'Toggle navigation'
),
_react2["default"].createElement('span', { className: 'icon-bar' }),
_react2["default"].createElement('span', { className: 'icon-bar' }),
_react2["default"].createElement('span', { className: 'icon-bar' })
),
show && !this.state.toggleState && _react2["default"].createElement(
'button',
buttonProps,
_react2["default"].createElement('span', { className: 'uf uf-arrow-left' })
),
!show && !this.state.toggleState && _react2["default"].createElement(
'button',
buttonProps,
_react2["default"].createElement(
'span',
{ className: 'sr-only' },
'Toggle navigation'
),
_react2["default"].createElement('span', { className: 'icon-bar' }),
_react2["default"].createElement('span', { className: 'icon-bar' }),
_react2["default"].createElement('span', { className: 'icon-bar' })
)
);
};
return MenuToggle;
}(_react2["default"].Component);
MenuToggle.propTypes = propTypes;
MenuToggle.defaultProps = defaultProps;
MenuToggle.contextTypes = contextTypes;
exports["default"] = MenuToggle;
module.exports = exports['default'];
/***/ }),
/* 182 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _tinperBeeCore = __webpack_require__(26);
function animate(node, show, done) {
var height = void 0;
return (0, _tinperBeeCore.cssAnimation)(node, 'u-motion-collapse', {
start: function start() {
if (!show) {
node.style.height = node.offsetHeight + 'px';
} else {
height = node.offsetHeight;
node.style.height = 0;
}
},
active: function active() {
node.style.height = (show ? height : 0) + 'px';
},
end: function end() {
node.style.height = '';
done();
}
});
}
var animation = {
enter: function enter(node, done) {
return animate(node, true, done);
},
leave: function leave(node, done) {
return animate(node, false, done);
},
appear: function appear(node, done) {
return animate(node, true, done);
}
};
exports["default"] = animation;
module.exports = exports['default'];
/***/ }),
/* 183 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _warning = __webpack_require__(31);
var _warning2 = _interopRequireDefault(_warning);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var warned = {};
exports["default"] = function (valid, message) {
if (!valid && !warned[message]) {
(0, _warning2["default"])(false, message);
warned[message] = true;
}
};
module.exports = exports['default'];
/***/ }),
/* 184 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
label: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].object])
};
var OptGroup = function (_React$Component) {
_inherits(OptGroup, _React$Component);
function OptGroup() {
_classCallCheck(this, OptGroup);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
return OptGroup;
}(_react2["default"].Component);
OptGroup.propTypes = propTypes;
exports["default"] = OptGroup;
module.exports = exports['default'];
/***/ }),
/* 185 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.UNSELECTABLE_ATTRIBUTE = exports.UNSELECTABLE_STYLE = undefined;
exports.getValuePropValue = getValuePropValue;
exports.getPropValue = getPropValue;
exports.isCombobox = isCombobox;
exports.isMultipleOrTags = isMultipleOrTags;
exports.isMultipleOrTagsOrCombobox = isMultipleOrTagsOrCombobox;
exports.isSingleMode = isSingleMode;
exports.toArray = toArray;
exports.preventDefaultEvent = preventDefaultEvent;
exports.findIndexInValueByKey = findIndexInValueByKey;
exports.findIndexInValueByLabel = findIndexInValueByLabel;
exports.getSelectKeys = getSelectKeys;
exports.findFirstMenuItem = findFirstMenuItem;
exports.includesSeparators = includesSeparators;
exports.splitBySeparators = splitBySeparators;
var _beeMenus = __webpack_require__(169);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function getValuePropValue(child) {
var props = child.props;
if ('value' in props) {
return props.value;
}
if (child.key) {
return child.key;
}
throw new Error('no key or value for ' + child);
}
function getPropValue(child, prop) {
if (prop === 'value') {
return getValuePropValue(child);
}
return child.props[prop];
}
function isCombobox(props) {
return props.combobox;
}
function isMultipleOrTags(props) {
return props.multiple || props.tags;
}
function isMultipleOrTagsOrCombobox(props) {
return isMultipleOrTags(props) || isCombobox(props);
}
function isSingleMode(props) {
return !isMultipleOrTagsOrCombobox(props);
}
function toArray(value) {
var ret = value;
if (value === undefined) {
ret = [];
} else if (!Array.isArray(value)) {
ret = [value];
}
return ret;
}
function preventDefaultEvent(e) {
e.preventDefault();
}
function findIndexInValueByKey(value, key) {
var index = -1;
for (var i = 0; i < value.length; i++) {
if (value[i].key === key) {
index = i;
break;
}
}
return index;
}
function findIndexInValueByLabel(value, label) {
var index = -1;
for (var i = 0; i < value.length; i++) {
if (toArray(value[i].label).join('') === label) {
index = i;
break;
}
}
return index;
}
function getSelectKeys(menuItems, value) {
if (value === null || value === undefined) {
return [];
}
var selectedKeys = [];
_react2["default"].Children.forEach(menuItems, function (item) {
if (item.type === _beeMenus.ItemGroup) {
selectedKeys = selectedKeys.concat(getSelectKeys(item.props.children, value));
} else {
var itemValue = getValuePropValue(item);
var itemKey = item.key;
if (findIndexInValueByKey(value, itemValue) !== -1 && itemKey) {
selectedKeys.push(itemKey);
}
}
});
return selectedKeys;
}
var UNSELECTABLE_STYLE = exports.UNSELECTABLE_STYLE = {
userSelect: 'none',
WebkitUserSelect: 'none'
};
var UNSELECTABLE_ATTRIBUTE = exports.UNSELECTABLE_ATTRIBUTE = {
unselectable: 'unselectable'
};
function findFirstMenuItem(children) {
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (child.type === _beeMenus.ItemGroup) {
var found = findFirstMenuItem(child.props.children);
if (found) {
return found;
}
} else if (!child.props.disabled) {
return child;
}
}
return null;
}
function includesSeparators(string, separators) {
for (var i = 0; i < separators.length; ++i) {
if (string.lastIndexOf(separators[i]) > 0) {
return true;
}
}
return false;
}
function splitBySeparators(string, separators) {
var reg = new RegExp('[' + separators.join() + ']');
var array = string.split(reg);
if (array[0] === '') {
array.shift();
}
if (array[array.length - 1] === '') {
array.pop();
}
return array;
}
/***/ }),
/* 186 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _trigger = __webpack_require__(187);
var _trigger2 = _interopRequireDefault(_trigger);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _DropdownMenu = __webpack_require__(193);
var _DropdownMenu2 = _interopRequireDefault(_DropdownMenu);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _util = __webpack_require__(185);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var BUILT_IN_PLACEMENTS = {
bottomLeft: {
points: ['tl', 'bl'],
offset: [0, 4],
overflow: {
adjustX: 0,
adjustY: 1
}
},
topLeft: {
points: ['bl', 'tl'],
offset: [0, -4],
overflow: {
adjustX: 0,
adjustY: 1
}
}
};
var propTypes = {
onPopupFocus: _propTypes2["default"].func,
dropdownMatchSelectWidth: _propTypes2["default"].bool,
dropdownAlign: _propTypes2["default"].object,
visible: _propTypes2["default"].bool,
disabled: _propTypes2["default"].bool,
showSearch: _propTypes2["default"].bool,
dropdownClassName: _propTypes2["default"].string,
multiple: _propTypes2["default"].bool,
inputValue: _propTypes2["default"].string,
filterOption: _propTypes2["default"].any,
options: _propTypes2["default"].any,
clsPrefix: _propTypes2["default"].string,
popupClassName: _propTypes2["default"].string,
children: _propTypes2["default"].any
};
var SelectTrigger = function (_Component) {
_inherits(SelectTrigger, _Component);
function SelectTrigger(props) {
_classCallCheck(this, SelectTrigger);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.setDropdownWidth = function () {
var width = _reactDom2["default"].findDOMNode(_this).offsetWidth;
if (width !== _this.state.dropdownWidth) {
_this.setState({ dropdownWidth: width });
}
};
_this.getInnerMenu = _this.getInnerMenu.bind(_this);
_this.getPopupDOMNode = _this.getPopupDOMNode.bind(_this);
_this.getDropdownTransitionName = _this.getDropdownTransitionName.bind(_this);
_this.getDropdownElement = _this.getDropdownElement.bind(_this);
_this.getDropdownPrefixCls = _this.getDropdownPrefixCls.bind(_this);
_this.saveMenu = _this.saveMenu.bind(_this);
_this.state = {
dropdownWidth: null
};
return _this;
}
SelectTrigger.prototype.componentDidMount = function componentDidMount() {
this.setDropdownWidth();
};
SelectTrigger.prototype.componentDidUpdate = function componentDidUpdate() {
this.setDropdownWidth();
};
SelectTrigger.prototype.getInnerMenu = function getInnerMenu() {
return this.popupMenu && this.popupMenu.refs.menu;
};
SelectTrigger.prototype.getPopupDOMNode = function getPopupDOMNode() {
return this.refs.trigger.getPopupDomNode();
};
SelectTrigger.prototype.getDropdownElement = function getDropdownElement(newProps) {
var props = this.props;
return _react2["default"].createElement(_DropdownMenu2["default"], _extends({
ref: this.saveMenu
}, newProps, {
clsPrefix: this.getDropdownPrefixCls(),
onMenuSelect: props.onMenuSelect,
scrollToEnd: props.scrollToEnd,
onMenuDeselect: props.onMenuDeselect,
value: props.value,
defaultActiveFirstOption: props.defaultActiveFirstOption,
dropdownMenuStyle: props.dropdownMenuStyle
}));
};
SelectTrigger.prototype.getDropdownTransitionName = function getDropdownTransitionName() {
var props = this.props;
var transitionName = props.transitionName;
if (!transitionName && props.animation) {
transitionName = this.getDropdownPrefixCls() + '-' + props.animation;
}
return transitionName;
};
SelectTrigger.prototype.getDropdownPrefixCls = function getDropdownPrefixCls() {
return this.props.clsPrefix + '-dropdown';
};
SelectTrigger.prototype.saveMenu = function saveMenu(menu) {
this.popupMenu = menu;
};
SelectTrigger.prototype.render = function render() {
var _popupClassName;
var _props = this.props,
onPopupFocus = _props.onPopupFocus,
props = _objectWithoutProperties(_props, ['onPopupFocus']);
var multiple = props.multiple,
visible = props.visible,
inputValue = props.inputValue,
dropdownAlign = props.dropdownAlign,
disabled = props.disabled,
showSearch = props.showSearch,
dropdownClassName = props.dropdownClassName,
dropdownStyle = props.dropdownStyle,
dropdownMatchSelectWidth = props.dropdownMatchSelectWidth;
var dropdownPrefixCls = this.getDropdownPrefixCls();
var popupClassName = (_popupClassName = {}, _defineProperty(_popupClassName, dropdownClassName, !!dropdownClassName), _defineProperty(_popupClassName, dropdownPrefixCls + '--' + (multiple ? 'multiple' : 'single'), 1), _popupClassName);
var popupElement = this.getDropdownElement({
menuItems: props.options,
onPopupFocus: onPopupFocus,
multiple: multiple,
inputValue: inputValue,
visible: visible
});
var hideAction = void 0;
if (disabled) {
hideAction = [];
} else if ((0, _util.isSingleMode)(props) && !showSearch) {
hideAction = ['click'];
} else {
hideAction = ['blur'];
}
var popupStyle = _extends({}, dropdownStyle);
var widthProp = dropdownMatchSelectWidth ? 'width' : 'minWidth';
if (this.state.dropdownWidth) {
popupStyle[widthProp] = this.state.dropdownWidth + 'px';
}
return _react2["default"].createElement(
_trigger2["default"],
_extends({}, props, {
showAction: disabled ? [] : ['click'],
hideAction: hideAction,
ref: 'trigger',
popupPlacement: 'bottomLeft',
builtinPlacements: BUILT_IN_PLACEMENTS,
clsPrefix: dropdownPrefixCls
// popupTransitionName={this.getDropdownTransitionName()}
, onPopupVisibleChange: props.onDropdownVisibleChange,
popup: popupElement,
popupAlign: dropdownAlign,
popupVisible: visible,
getPopupContainer: props.getPopupContainer,
popupClassName: (0, _classnames2["default"])(popupClassName),
popupStyle: popupStyle
}),
props.children
);
};
return SelectTrigger;
}(_react.Component);
;
SelectTrigger.propTypes = propTypes;
exports["default"] = SelectTrigger;
module.exports = exports['default'];
/***/ }),
/* 187 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(188);
/***/ }),
/* 188 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _contains = __webpack_require__(143);
var _contains2 = _interopRequireDefault(_contains);
var _tinperBeeCore = __webpack_require__(26);
var _Popup = __webpack_require__(189);
var _Popup2 = _interopRequireDefault(_Popup);
var _utils = __webpack_require__(192);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
//import getContainerRenderMixin from './getContainerRenderMixin';
function noop() {}
function returnEmptyString() {
return '';
}
var ALL_HANDLERS = ['onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter', 'onMouseLeave', 'onFocus', 'onBlur'];
var propTypes = {
children: _propTypes2["default"].any,
action: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].arrayOf(_propTypes2["default"].string)]),
showAction: _propTypes2["default"].any,
hideAction: _propTypes2["default"].any,
getPopupClassNameFromAlign: _propTypes2["default"].any,
onPopupVisibleChange: _propTypes2["default"].func,
afterPopupVisibleChange: _propTypes2["default"].func,
popup: _propTypes2["default"].oneOfType([_propTypes2["default"].node, _propTypes2["default"].func]).isRequired,
popupStyle: _propTypes2["default"].object,
clsPrefix: _propTypes2["default"].string,
popupClassName: _propTypes2["default"].string,
popupPlacement: _propTypes2["default"].string,
builtinPlacements: _propTypes2["default"].object,
popupTransitionName: _propTypes2["default"].string,
popupAnimation: _propTypes2["default"].any,
mouseEnterDelay: _propTypes2["default"].number,
mouseLeaveDelay: _propTypes2["default"].number,
zIndex: _propTypes2["default"].number,
focusDelay: _propTypes2["default"].number,
blurDelay: _propTypes2["default"].number,
getPopupContainer: _propTypes2["default"].func,
destroyPopupOnHide: _propTypes2["default"].bool,
mask: _propTypes2["default"].bool,
maskClosable: _propTypes2["default"].bool,
onPopupAlign: _propTypes2["default"].func,
popupAlign: _propTypes2["default"].object,
popupVisible: _propTypes2["default"].bool,
maskTransitionName: _propTypes2["default"].string,
maskAnimation: _propTypes2["default"].string
};
var defaultProps = {
clsPrefix: 'rc-trigger-popup',
getPopupClassNameFromAlign: returnEmptyString,
onPopupVisibleChange: noop,
afterPopupVisibleChange: noop,
onPopupAlign: noop,
popupClassName: '',
mouseEnterDelay: 0,
mouseLeaveDelay: 0.1,
focusDelay: 0,
blurDelay: 0.15,
popupStyle: {},
destroyPopupOnHide: false,
popupAlign: {},
defaultPopupVisible: false,
mask: false,
maskClosable: true,
action: [],
showAction: [],
hideAction: []
};
var Trigger = function (_Component) {
_inherits(Trigger, _Component);
function Trigger(props) {
_classCallCheck(this, Trigger);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.state = {
popupVisible: !!_this.props.popupVisible || _this.props.defaultPopupVisible
//this.removeContainer = this.removeContainer.bind(this);
};_this.getContainer = _this.getContainer.bind(_this);
_this.renderComponent = _this.renderComponent.bind(_this);
_this.isVisible = _this.isVisible.bind(_this);
_this.onMouseEnter = _this.onMouseEnter.bind(_this);
_this.onMouseLeave = _this.onMouseLeave.bind(_this);
_this.onPopupMouseEnter = _this.onPopupMouseEnter.bind(_this);
_this.onPopupMouseLeave = _this.onPopupMouseLeave.bind(_this);
_this.onFocus = _this.onFocus.bind(_this);
_this.onMouseDown = _this.onMouseDown.bind(_this);
_this.onTouchStart = _this.onTouchStart.bind(_this);
_this.onBlur = _this.onBlur.bind(_this);
_this.onDocumentClick = _this.onDocumentClick.bind(_this);
_this.getPopupDomNode = _this.getPopupDomNode.bind(_this);
_this.getRootDomNode = _this.getRootDomNode.bind(_this);
_this.getPopupClassNameFromAlign = _this.getPopupClassNameFromAlign.bind(_this);
_this.getPopupAlign = _this.getPopupAlign.bind(_this);
_this.getComponent = _this.getComponent.bind(_this);
_this.setPopupVisible = _this.setPopupVisible.bind(_this);
_this.delaySetPopupVisible = _this.delaySetPopupVisible.bind(_this);
_this.clearDelayTimer = _this.clearDelayTimer.bind(_this);
_this.createTwoChains = _this.createTwoChains.bind(_this);
_this.isClickToShow = _this.isClickToShow.bind(_this);
_this.isClickToHide = _this.isClickToHide.bind(_this);
_this.isMouseEnterToShow = _this.isMouseEnterToShow.bind(_this);
_this.isMouseLeaveToHide = _this.isMouseLeaveToHide.bind(_this);
_this.isFocusToShow = _this.isFocusToShow.bind(_this);
_this.isBlurToHide = _this.isBlurToHide.bind(_this);
_this.forcePopupAlign = _this.forcePopupAlign.bind(_this);
_this.fireEvents = _this.fireEvents.bind(_this);
_this.close = _this.close.bind(_this);
_this.onClick = _this.onClick.bind(_this);
return _this;
}
Trigger.prototype.isVisible = function isVisible(instance) {
return instance.state.popupVisible;
};
Trigger.prototype.getContainer = function getContainer(instance) {
var popupContainer = document.createElement('div');
var mountNode = instance.props.getPopupContainer ? instance.props.getPopupContainer((0, _reactDom.findDOMNode)(instance)) : document.body;
mountNode.appendChild(popupContainer);
return popupContainer;
};
Trigger.prototype.renderComponent = function renderComponent(instance, componentArg, ready) {
if (instance._component || this.isVisible(instance)) {
if (!instance._container) {
instance._container = this.getContainer(instance);
}
var component = instance.getComponent(componentArg);
_reactDom2["default"].unstable_renderSubtreeIntoContainer(instance, component, instance._container, function callback() {
instance._component = this;
if (ready) {
ready.call(this);
}
});
}
};
Trigger.prototype.componentWillMount = function componentWillMount() {
var _this2 = this;
this.mounted = false;
ALL_HANDLERS.forEach(function (h) {
_this2['fire' + h] = function (e) {
_this2.fireEvents(h, e);
};
});
};
Trigger.prototype.componentDidMount = function componentDidMount() {
this.mounted = true;
this.componentDidUpdate({}, {
popupVisible: this.state.popupVisible
});
};
Trigger.prototype.componentWillReceiveProps = function componentWillReceiveProps(_ref) {
var popupVisible = _ref.popupVisible;
if (popupVisible !== undefined) {
this.setState({
popupVisible: popupVisible
});
}
};
Trigger.prototype.componentDidUpdate = function componentDidUpdate(_, prevState) {
var props = this.props;
var state = this.state;
this.renderComponent(this, null, function () {
if (prevState.popupVisible !== state.popupVisible) {
props.afterPopupVisibleChange(state.popupVisible);
}
});
if (this.isClickToHide()) {
if (state.popupVisible) {
if (!this.clickOutsideHandler) {
this.clickOutsideHandler = (0, _tinperBeeCore.addEventListener)(document, 'mousedown', this.onDocumentClick);
this.touchOutsideHandler = (0, _tinperBeeCore.addEventListener)(document, 'touchstart', this.onDocumentClick);
}
return;
}
}
if (this.clickOutsideHandler) {
this.clickOutsideHandler.remove();
this.touchOutsideHandler.remove();
this.clickOutsideHandler = null;
this.touchOutsideHandler = null;
}
};
Trigger.prototype.componentWillUnmount = function componentWillUnmount() {
this.clearDelayTimer();
if (this.clickOutsideHandler) {
this.clickOutsideHandler.remove();
this.touchOutsideHandler.remove();
this.clickOutsideHandler = null;
this.touchOutsideHandler = null;
}
if (this._container) {
_reactDom2["default"].unmountComponentAtNode(this._container);
}
//this.removeContainer();
};
Trigger.prototype.onMouseEnter = function onMouseEnter(e) {
this.fireEvents('onMouseEnter', e);
this.delaySetPopupVisible(true, this.props.mouseEnterDelay);
};
Trigger.prototype.onMouseLeave = function onMouseLeave(e) {
this.fireEvents('onMouseLeave', e);
this.delaySetPopupVisible(false, this.props.mouseLeaveDelay);
};
Trigger.prototype.onPopupMouseEnter = function onPopupMouseEnter() {
this.clearDelayTimer();
};
Trigger.prototype.onPopupMouseLeave = function onPopupMouseLeave(e) {
// https://github.com/react-component/trigger/pull/13
// react bug?
if (e.relatedTarget && !e.relatedTarget.setTimeout && this._component && (0, _contains2["default"])(this._component.getPopupDomNode(), e.relatedTarget)) {
return;
}
this.delaySetPopupVisible(false, this.props.mouseLeaveDelay);
};
Trigger.prototype.onFocus = function onFocus(e) {
this.fireEvents('onFocus', e);
// incase focusin and focusout
this.clearDelayTimer();
if (this.isFocusToShow()) {
this.focusTime = Date.now();
this.delaySetPopupVisible(true, this.props.focusDelay);
}
};
Trigger.prototype.onMouseDown = function onMouseDown(e) {
this.fireEvents('onMouseDown', e);
this.preClickTime = Date.now();
};
Trigger.prototype.onTouchStart = function onTouchStart(e) {
this.fireEvents('onTouchStart', e);
this.preTouchTime = Date.now();
};
Trigger.prototype.onBlur = function onBlur(e) {
this.fireEvents('onBlur', e);
this.clearDelayTimer();
if (this.isBlurToHide()) {
this.delaySetPopupVisible(false, this.props.blurDelay);
}
};
Trigger.prototype.onClick = function onClick(event) {
this.fireEvents('onClick', event);
// focus will trigger click
if (this.focusTime) {
var preTime = void 0;
if (this.preClickTime && this.preTouchTime) {
preTime = Math.min(this.preClickTime, this.preTouchTime);
} else if (this.preClickTime) {
preTime = this.preClickTime;
} else if (this.preTouchTime) {
preTime = this.preTouchTime;
}
if (Math.abs(preTime - this.focusTime) < 20) {
return;
}
this.focusTime = 0;
}
this.preClickTime = 0;
this.preTouchTime = 0;
event.preventDefault();
var nextVisible = !this.state.popupVisible;
if (this.isClickToHide() && !nextVisible || nextVisible && this.isClickToShow()) {
this.setPopupVisible(!this.state.popupVisible);
}
};
Trigger.prototype.onDocumentClick = function onDocumentClick(event) {
if (this.props.mask && !this.props.maskClosable) {
return;
}
var target = event.target;
var root = (0, _reactDom.findDOMNode)(this);
var popupNode = this.getPopupDomNode();
if (!(0, _contains2["default"])(root, target) && !(0, _contains2["default"])(popupNode, target)) {
this.close();
}
};
Trigger.prototype.getPopupDomNode = function getPopupDomNode() {
// for test
if (this._component) {
return this.mounted ? this._component.getPopupDomNode() : null;
}
return null;
};
Trigger.prototype.getRootDomNode = function getRootDomNode() {
return _reactDom2["default"].findDOMNode(this);
};
Trigger.prototype.getPopupClassNameFromAlign = function getPopupClassNameFromAlign(align) {
var className = [];
var props = this.props;
var popupPlacement = props.popupPlacement,
builtinPlacements = props.builtinPlacements,
clsPrefix = props.clsPrefix;
if (popupPlacement && builtinPlacements) {
className.push((0, _utils.getPopupClassNameFromAlign)(builtinPlacements, clsPrefix, align));
}
if (props.getPopupClassNameFromAlign) {
className.push(props.getPopupClassNameFromAlign(align));
}
return className.join(' ');
};
Trigger.prototype.getPopupAlign = function getPopupAlign() {
var props = this.props;
var popupPlacement = props.popupPlacement,
popupAlign = props.popupAlign,
builtinPlacements = props.builtinPlacements;
if (popupPlacement && builtinPlacements) {
return (0, _utils.getAlignFromPlacement)(builtinPlacements, popupPlacement, popupAlign);
}
return popupAlign;
};
Trigger.prototype.getComponent = function getComponent() {
var props = this.props,
state = this.state;
var mouseProps = {};
if (this.isMouseEnterToShow()) {
mouseProps.onMouseEnter = this.onPopupMouseEnter;
}
if (this.isMouseLeaveToHide()) {
mouseProps.onMouseLeave = this.onPopupMouseLeave;
}
return _react2["default"].createElement(
_Popup2["default"],
_extends({
clsPrefix: props.clsPrefix,
destroyPopupOnHide: props.destroyPopupOnHide,
visible: state.popupVisible,
className: props.popupClassName,
action: props.action,
align: this.getPopupAlign(),
onAlign: props.onPopupAlign,
animation: props.popupAnimation,
getClassNameFromAlign: this.getPopupClassNameFromAlign
}, mouseProps, {
getRootDomNode: this.getRootDomNode,
style: props.popupStyle,
mask: props.mask,
zIndex: props.zIndex,
transitionName: props.popupTransitionName,
maskAnimation: props.maskAnimation,
maskTransitionName: props.maskTransitionName
}),
typeof props.popup === 'function' ? props.popup() : props.popup
);
};
Trigger.prototype.setPopupVisible = function setPopupVisible(popupVisible) {
this.clearDelayTimer();
if (this.state.popupVisible !== popupVisible) {
if (!('popupVisible' in this.props)) {
this.setState({
popupVisible: popupVisible
});
}
this.props.onPopupVisibleChange(popupVisible);
}
};
Trigger.prototype.delaySetPopupVisible = function delaySetPopupVisible(visible, delayS) {
var _this3 = this;
var delay = delayS * 1000;
this.clearDelayTimer();
if (delay) {
this.delayTimer = setTimeout(function () {
_this3.setPopupVisible(visible);
_this3.clearDelayTimer();
}, delay);
} else {
this.setPopupVisible(visible);
}
};
Trigger.prototype.clearDelayTimer = function clearDelayTimer() {
if (this.delayTimer) {
clearTimeout(this.delayTimer);
this.delayTimer = null;
}
};
Trigger.prototype.createTwoChains = function createTwoChains(event) {
var childPros = this.props.children.props;
var props = this.props;
if (childPros[event] && props[event]) {
return this['fire' + event];
}
return childPros[event] || props[event];
};
Trigger.prototype.isClickToShow = function isClickToShow() {
var _props = this.props,
action = _props.action,
showAction = _props.showAction;
return action.indexOf('click') !== -1 || showAction.indexOf('click') !== -1;
};
Trigger.prototype.isClickToHide = function isClickToHide() {
var _props2 = this.props,
action = _props2.action,
hideAction = _props2.hideAction;
return action.indexOf('click') !== -1 || hideAction.indexOf('click') !== -1;
};
Trigger.prototype.isMouseEnterToShow = function isMouseEnterToShow() {
var _props3 = this.props,
action = _props3.action,
showAction = _props3.showAction;
return action.indexOf('hover') !== -1 || showAction.indexOf('mouseEnter') !== -1;
};
Trigger.prototype.isMouseLeaveToHide = function isMouseLeaveToHide() {
var _props4 = this.props,
action = _props4.action,
hideAction = _props4.hideAction;
return action.indexOf('hover') !== -1 || hideAction.indexOf('mouseLeave') !== -1;
};
Trigger.prototype.isFocusToShow = function isFocusToShow() {
var _props5 = this.props,
action = _props5.action,
showAction = _props5.showAction;
return action.indexOf('focus') !== -1 || showAction.indexOf('focus') !== -1;
};
Trigger.prototype.isBlurToHide = function isBlurToHide() {
var _props6 = this.props,
action = _props6.action,
hideAction = _props6.hideAction;
return action.indexOf('focus') !== -1 || hideAction.indexOf('blur') !== -1;
};
Trigger.prototype.forcePopupAlign = function forcePopupAlign() {
if (this.state.popupVisible && this.popupInstance && this.popupInstance.alignInstance) {
this.popupInstance.alignInstance.forceAlign();
}
};
Trigger.prototype.fireEvents = function fireEvents(type, e) {
var childCallback = this.props.children.props[type];
if (childCallback) {
childCallback(e);
}
var callback = this.props[type];
if (callback) {
callback(e);
}
};
Trigger.prototype.close = function close() {
this.setPopupVisible(false);
};
Trigger.prototype.render = function render() {
var props = this.props;
var children = props.children;
var child = _react2["default"].Children.only(children);
var newChildProps = {};
if (this.isClickToHide() || this.isClickToShow()) {
newChildProps.onClick = this.onClick;
newChildProps.onMouseDown = this.onMouseDown;
newChildProps.onTouchStart = this.onTouchStart;
} else {
newChildProps.onClick = this.createTwoChains('onClick');
newChildProps.onMouseDown = this.createTwoChains('onMouseDown');
newChildProps.onTouchStart = this.createTwoChains('onTouchStart');
}
if (this.isMouseEnterToShow()) {
newChildProps.onMouseEnter = this.onMouseEnter;
} else {
newChildProps.onMouseEnter = this.createTwoChains('onMouseEnter');
}
if (this.isMouseLeaveToHide()) {
newChildProps.onMouseLeave = this.onMouseLeave;
} else {
newChildProps.onMouseLeave = this.createTwoChains('onMouseLeave');
}
if (this.isFocusToShow() || this.isBlurToHide()) {
newChildProps.onFocus = this.onFocus;
newChildProps.onBlur = this.onBlur;
} else {
newChildProps.onFocus = this.createTwoChains('onFocus');
newChildProps.onBlur = this.createTwoChains('onBlur');
}
return _react2["default"].cloneElement(child, newChildProps);
};
return Trigger;
}(_react.Component);
;
Trigger.propTypes = propTypes;
Trigger.defaultProps = defaultProps;
exports["default"] = Trigger;
module.exports = exports['default'];
/***/ }),
/* 189 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _Align = __webpack_require__(84);
var _Align2 = _interopRequireDefault(_Align);
var _beeAnimate = __webpack_require__(135);
var _beeAnimate2 = _interopRequireDefault(_beeAnimate);
var _PopupInner = __webpack_require__(190);
var _PopupInner2 = _interopRequireDefault(_PopupInner);
var _LazyRenderBox = __webpack_require__(191);
var _LazyRenderBox2 = _interopRequireDefault(_LazyRenderBox);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
visible: _propTypes2["default"].bool,
style: _propTypes2["default"].object,
getClassNameFromAlign: _propTypes2["default"].func,
onAlign: _propTypes2["default"].func,
getRootDomNode: _propTypes2["default"].func,
onMouseEnter: _propTypes2["default"].func,
align: _propTypes2["default"].any,
destroyPopupOnHide: _propTypes2["default"].bool,
className: _propTypes2["default"].string,
clsPrefix: _propTypes2["default"].string,
onMouseLeave: _propTypes2["default"].func
};
var Popup = function (_Component) {
_inherits(Popup, _Component);
function Popup() {
_classCallCheck(this, Popup);
var _this = _possibleConstructorReturn(this, _Component.call(this));
_this.onAlign = _this.onAlign.bind(_this);
_this.getPopupDomNode = _this.getPopupDomNode.bind(_this);
_this.getTarget = _this.getTarget.bind(_this);
_this.getMaskTransitionName = _this.getMaskTransitionName.bind(_this);
_this.getTransitionName = _this.getTransitionName.bind(_this);
_this.getClassName = _this.getClassName.bind(_this);
_this.getPopupElement = _this.getPopupElement.bind(_this);
_this.getZIndexStyle = _this.getZIndexStyle.bind(_this);
_this.getMaskElement = _this.getMaskElement.bind(_this);
_this.saveAlign = _this.saveAlign.bind(_this);
return _this;
}
Popup.prototype.componentDidMount = function componentDidMount() {
this.rootNode = this.getPopupDomNode();
};
Popup.prototype.onAlign = function onAlign(popupDomNode, align) {
var props = this.props;
var alignClassName = props.getClassNameFromAlign(props.align);
var currentAlignClassName = props.getClassNameFromAlign(align);
if (alignClassName !== currentAlignClassName) {
this.currentAlignClassName = currentAlignClassName;
popupDomNode.className = this.getClassName(currentAlignClassName);
}
props.onAlign(popupDomNode, align);
};
Popup.prototype.getPopupDomNode = function getPopupDomNode() {
return _reactDom2["default"].findDOMNode(this.refs.popup);
};
Popup.prototype.getTarget = function getTarget() {
return this.props.getRootDomNode();
};
Popup.prototype.getMaskTransitionName = function getMaskTransitionName() {
var props = this.props;
var transitionName = props.maskTransitionName;
var animation = props.maskAnimation;
if (!transitionName && animation) {
transitionName = props.clsPrefix + '-' + animation;
}
return transitionName;
};
Popup.prototype.getTransitionName = function getTransitionName() {
var props = this.props;
var transitionName = props.transitionName;
if (!transitionName && props.animation) {
transitionName = props.clsPrefix + '-' + props.animation;
}
return transitionName;
};
Popup.prototype.getClassName = function getClassName(currentAlignClassName) {
return this.props.clsPrefix + ' ' + this.props.className + ' ' + currentAlignClassName;
};
Popup.prototype.getPopupElement = function getPopupElement() {
var props = this.props;
var align = props.align,
style = props.style,
visible = props.visible,
clsPrefix = props.clsPrefix,
destroyPopupOnHide = props.destroyPopupOnHide;
var className = this.getClassName(this.currentAlignClassName || props.getClassNameFromAlign(align));
var hiddenClassName = clsPrefix + '-hidden';
if (!visible) {
this.currentAlignClassName = null;
}
var newStyle = _extends({}, style, this.getZIndexStyle());
var popupInnerProps = {
className: className,
clsPrefix: clsPrefix,
ref: 'popup',
onMouseEnter: props.onMouseEnter,
onMouseLeave: props.onMouseLeave,
style: newStyle
};
if (destroyPopupOnHide) {
return _react2["default"].createElement(
_beeAnimate2["default"],
{
component: '',
exclusive: true,
transitionAppear: true,
transitionName: this.getTransitionName()
},
visible ? _react2["default"].createElement(
_Align2["default"],
{
target: this.getTarget,
key: 'popup',
ref: this.saveAlign,
monitorWindowResize: true,
align: align,
onAlign: this.onAlign
},
_react2["default"].createElement(
_PopupInner2["default"],
_extends({
visible: true
}, popupInnerProps),
props.children
)
) : null
);
}
return _react2["default"].createElement(
_beeAnimate2["default"],
{
component: '',
exclusive: true,
transitionAppear: true,
transitionName: this.getTransitionName(),
showProp: 'xVisible'
},
_react2["default"].createElement(
_Align2["default"],
{
target: this.getTarget,
key: 'popup',
ref: this.saveAlign,
monitorWindowResize: true,
xVisible: visible,
childrenProps: { visible: 'xVisible' },
disabled: !visible,
align: align,
onAlign: this.onAlign
},
_react2["default"].createElement(
_PopupInner2["default"],
_extends({
hiddenClassName: hiddenClassName
}, popupInnerProps),
props.children
)
)
);
};
Popup.prototype.getZIndexStyle = function getZIndexStyle() {
var style = {};
var props = this.props;
if (props.zIndex !== undefined) {
style.zIndex = props.zIndex;
}
return style;
};
Popup.prototype.getMaskElement = function getMaskElement() {
var props = this.props;
var maskElement = void 0;
if (props.mask) {
var maskTransition = this.getMaskTransitionName();
maskElement = _react2["default"].createElement(_LazyRenderBox2["default"], {
style: this.getZIndexStyle(),
key: 'mask',
className: props.clsPrefix + '-mask',
hiddenClassName: props.clsPrefix + '-mask-hidden',
visible: props.visible
});
if (maskTransition) {
maskElement = _react2["default"].createElement(
_beeAnimate2["default"],
{
key: 'mask',
showProp: 'visible',
transitionAppear: true,
component: '',
transitionName: maskTransition
},
maskElement
);
}
}
return maskElement;
};
Popup.prototype.saveAlign = function saveAlign(align) {
this.alignInstance = align;
};
Popup.prototype.render = function render() {
return _react2["default"].createElement(
'div',
null,
this.getMaskElement(),
this.getPopupElement()
);
};
return Popup;
}(_react.Component);
;
Popup.propTypes = propTypes;
exports["default"] = Popup;
module.exports = exports['default'];
/***/ }),
/* 190 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _LazyRenderBox = __webpack_require__(191);
var _LazyRenderBox2 = _interopRequireDefault(_LazyRenderBox);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
hiddenClassName: _propTypes2["default"].string,
className: _propTypes2["default"].string,
clsPrefix: _propTypes2["default"].string,
onMouseEnter: _propTypes2["default"].func,
onMouseLeave: _propTypes2["default"].func,
children: _propTypes2["default"].any
};
var PopupInner = function (_Component) {
_inherits(PopupInner, _Component);
function PopupInner() {
_classCallCheck(this, PopupInner);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
PopupInner.prototype.render = function render() {
var props = this.props;
var className = props.className;
if (!props.visible) {
className += ' ' + props.hiddenClassName;
}
return _react2["default"].createElement(
'div',
{
className: className,
onMouseEnter: props.onMouseEnter,
onMouseLeave: props.onMouseLeave,
style: props.style
},
_react2["default"].createElement(
_LazyRenderBox2["default"],
{ className: props.clsPrefix + '-content', visible: props.visible },
props.children
)
);
};
return PopupInner;
}(_react.Component);
;
PopupInner.propTypes = propTypes;
exports["default"] = PopupInner;
module.exports = exports['default'];
/***/ }),
/* 191 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
children: _propTypes2["default"].any,
className: _propTypes2["default"].string,
visible: _propTypes2["default"].bool,
hiddenClassName: _propTypes2["default"].string
};
var LazyRenderBox = function (_Component) {
_inherits(LazyRenderBox, _Component);
function LazyRenderBox() {
_classCallCheck(this, LazyRenderBox);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
LazyRenderBox.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
return nextProps.hiddenClassName || nextProps.visible;
};
LazyRenderBox.prototype.render = function render() {
var _props = this.props,
hiddenClassName = _props.hiddenClassName,
visible = _props.visible,
props = _objectWithoutProperties(_props, ['hiddenClassName', 'visible']);
if (hiddenClassName || _react2["default"].Children.count(props.children) > 1) {
if (!visible && hiddenClassName) {
props.className += ' ' + hiddenClassName;
}
return _react2["default"].createElement('div', props);
}
return _react2["default"].Children.only(props.children);
};
return LazyRenderBox;
}(_react.Component);
;
LazyRenderBox.propTypes = propTypes;
exports["default"] = LazyRenderBox;
module.exports = exports['default'];
/***/ }),
/* 192 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports.getAlignFromPlacement = getAlignFromPlacement;
exports.getPopupClassNameFromAlign = getPopupClassNameFromAlign;
function isPointsEq(a1, a2) {
return a1[0] === a2[0] && a1[1] === a2[1];
}
function getAlignFromPlacement(builtinPlacements, placementStr, align) {
var baseAlign = builtinPlacements[placementStr] || {};
return _extends({}, baseAlign, align);
}
function getPopupClassNameFromAlign(builtinPlacements, clsPrefix, align) {
var points = align.points;
for (var placement in builtinPlacements) {
if (builtinPlacements.hasOwnProperty(placement)) {
if (isPointsEq(builtinPlacements[placement].points, points)) {
return clsPrefix + '-placement-' + placement;
}
}
}
return '';
}
/***/ }),
/* 193 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(12);
var _tinperBeeCore = __webpack_require__(26);
var _beeMenus = __webpack_require__(169);
var _beeMenus2 = _interopRequireDefault(_beeMenus);
var _domScrollIntoView = __webpack_require__(194);
var _domScrollIntoView2 = _interopRequireDefault(_domScrollIntoView);
var _util = __webpack_require__(185);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
defaultActiveFirstOption: _propTypes2["default"].bool,
value: _propTypes2["default"].any,
dropdownMenuStyle: _propTypes2["default"].object,
multiple: _propTypes2["default"].bool,
onPopupFocus: _propTypes2["default"].func,
onMenuDeSelect: _propTypes2["default"].func,
onMenuSelect: _propTypes2["default"].func,
clsPrefix: _propTypes2["default"].string,
menuItems: _propTypes2["default"].any,
inputValue: _propTypes2["default"].string,
visible: _propTypes2["default"].bool
};
var DropdownMenu = function (_Component) {
_inherits(DropdownMenu, _Component);
function DropdownMenu() {
_classCallCheck(this, DropdownMenu);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
DropdownMenu.prototype.componentWillMount = function componentWillMount() {
this.lastInputValue = this.props.inputValue;
};
DropdownMenu.prototype.componentDidMount = function componentDidMount() {
this.scrollActiveItemToView();
this.lastVisible = this.props.visible;
var scrollDom = (0, _reactDom.findDOMNode)(this.refs.menu);
scrollDom.addEventListener('scroll', this.handleScroll.bind(this));
};
DropdownMenu.prototype.componentWillUnmount = function componentWillUnmount() {
var scrollDom = (0, _reactDom.findDOMNode)(this.refs.menu);
scrollDom.removeEventListener('scroll', this.handleScroll.bind(this));
};
DropdownMenu.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
if (!nextProps.visible) {
this.lastVisible = false;
}
// freeze when hide
return nextProps.visible;
};
DropdownMenu.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
var props = this.props;
if (!prevProps.visible && props.visible) {
this.scrollActiveItemToView();
}
this.lastVisible = props.visible;
this.lastInputValue = props.inputValue;
};
DropdownMenu.prototype.handleScroll = function handleScroll(event) {
var scrollToEnd = this.props.scrollToEnd;
var el = event.target;
if (el.scrollHeight < el.clientHeight + el.scrollTop + 1) {
if (scrollToEnd) {
scrollToEnd();
}
}
};
DropdownMenu.prototype.scrollActiveItemToView = function scrollActiveItemToView() {
// scroll into view
var itemComponent = (0, _reactDom.findDOMNode)(this.firstActiveItem);
if (itemComponent) {
(0, _domScrollIntoView2["default"])(itemComponent, (0, _reactDom.findDOMNode)(this.refs.menu), {
onlyScrollIfNeeded: true
});
}
};
DropdownMenu.prototype.renderMenu = function renderMenu() {
var _this2 = this;
var props = this.props;
var menuItems = props.menuItems,
defaultActiveFirstOption = props.defaultActiveFirstOption,
value = props.value,
clsPrefix = props.clsPrefix,
multiple = props.multiple,
onMenuSelect = props.onMenuSelect,
inputValue = props.inputValue;
if (menuItems && menuItems.length) {
var menuProps = {};
if (multiple) {
menuProps.onDeselect = props.onMenuDeselect;
menuProps.onSelect = onMenuSelect;
} else {
menuProps.onClick = onMenuSelect;
}
var selectedKeys = (0, _util.getSelectKeys)(menuItems, value);
var activeKeyProps = {};
var clonedMenuItems = menuItems;
if (selectedKeys.length) {
if (props.visible && !this.lastVisible) {
activeKeyProps.activeKey = selectedKeys[0];
}
var foundFirst = false;
// set firstActiveItem via cloning menus
// for scroll into view
var clone = function clone(item) {
if (!foundFirst && selectedKeys.indexOf(item.key) !== -1) {
foundFirst = true;
return (0, _react.cloneElement)(item, {
ref: function ref(_ref) {
_this2.firstActiveItem = _ref;
}
});
}
return item;
};
clonedMenuItems = menuItems.map(function (item) {
if (item.type === _beeMenus.ItemGroup) {
var children = (0, _tinperBeeCore.toArray)(item.props.children).map(clone);
return (0, _react.cloneElement)(item, {}, children);
}
return clone(item);
});
}
// clear activeKey when inputValue change
if (inputValue !== this.lastInputValue) {
activeKeyProps.activeKey = '';
}
return _react2["default"].createElement(
_beeMenus2["default"],
_extends({
ref: 'menu',
style: this.props.dropdownMenuStyle,
defaultActiveFirst: defaultActiveFirstOption
}, activeKeyProps, {
multiple: multiple,
focusable: false
}, menuProps, {
selectedKeys: selectedKeys,
clsPrefix: clsPrefix + '-menu'
}),
clonedMenuItems
);
}
return null;
};
DropdownMenu.prototype.render = function render() {
var renderMenu = this.renderMenu();
return renderMenu ? _react2["default"].createElement(
'div',
{
style: { overflow: 'auto' },
onFocus: this.props.onPopupFocus,
onMouseDown: _util.preventDefaultEvent
},
renderMenu
) : null;
};
return DropdownMenu;
}(_react.Component);
;
exports["default"] = DropdownMenu;
module.exports = exports['default'];
/***/ }),
/* 194 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(195);
/***/ }),
/* 195 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var util = __webpack_require__(196);
function scrollIntoView(elem, container, config) {
config = config || {};
// document 归一化到 window
if (container.nodeType === 9) {
container = util.getWindow(container);
}
var allowHorizontalScroll = config.allowHorizontalScroll;
var onlyScrollIfNeeded = config.onlyScrollIfNeeded;
var alignWithTop = config.alignWithTop;
var alignWithLeft = config.alignWithLeft;
var offsetTop = config.offsetTop || 0;
var offsetLeft = config.offsetLeft || 0;
var offsetBottom = config.offsetBottom || 0;
var offsetRight = config.offsetRight || 0;
allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;
var isWin = util.isWindow(container);
var elemOffset = util.offset(elem);
var eh = util.outerHeight(elem);
var ew = util.outerWidth(elem);
var containerOffset = undefined;
var ch = undefined;
var cw = undefined;
var containerScroll = undefined;
var diffTop = undefined;
var diffBottom = undefined;
var win = undefined;
var winScroll = undefined;
var ww = undefined;
var wh = undefined;
if (isWin) {
win = container;
wh = util.height(win);
ww = util.width(win);
winScroll = {
left: util.scrollLeft(win),
top: util.scrollTop(win)
};
// elem 相对 container 可视视窗的距离
diffTop = {
left: elemOffset.left - winScroll.left - offsetLeft,
top: elemOffset.top - winScroll.top - offsetTop
};
diffBottom = {
left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight,
top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom
};
containerScroll = winScroll;
} else {
containerOffset = util.offset(container);
ch = container.clientHeight;
cw = container.clientWidth;
containerScroll = {
left: container.scrollLeft,
top: container.scrollTop
};
// elem 相对 container 可视视窗的距离
// 注意边框, offset 是边框到根节点
diffTop = {
left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft,
top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop
};
diffBottom = {
left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight,
top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom
};
}
if (diffTop.top < 0 || diffBottom.top > 0) {
// 强制向上
if (alignWithTop === true) {
util.scrollTop(container, containerScroll.top + diffTop.top);
} else if (alignWithTop === false) {
util.scrollTop(container, containerScroll.top + diffBottom.top);
} else {
// 自动调整
if (diffTop.top < 0) {
util.scrollTop(container, containerScroll.top + diffTop.top);
} else {
util.scrollTop(container, containerScroll.top + diffBottom.top);
}
}
} else {
if (!onlyScrollIfNeeded) {
alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;
if (alignWithTop) {
util.scrollTop(container, containerScroll.top + diffTop.top);
} else {
util.scrollTop(container, containerScroll.top + diffBottom.top);
}
}
}
if (allowHorizontalScroll) {
if (diffTop.left < 0 || diffBottom.left > 0) {
// 强制向上
if (alignWithLeft === true) {
util.scrollLeft(container, containerScroll.left + diffTop.left);
} else if (alignWithLeft === false) {
util.scrollLeft(container, containerScroll.left + diffBottom.left);
} else {
// 自动调整
if (diffTop.left < 0) {
util.scrollLeft(container, containerScroll.left + diffTop.left);
} else {
util.scrollLeft(container, containerScroll.left + diffBottom.left);
}
}
} else {
if (!onlyScrollIfNeeded) {
alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;
if (alignWithLeft) {
util.scrollLeft(container, containerScroll.left + diffTop.left);
} else {
util.scrollLeft(container, containerScroll.left + diffBottom.left);
}
}
}
}
}
module.exports = scrollIntoView;
/***/ }),
/* 196 */
/***/ (function(module, exports) {
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
function getClientPosition(elem) {
var box = undefined;
var x = undefined;
var y = undefined;
var doc = elem.ownerDocument;
var body = doc.body;
var docElem = doc && doc.documentElement;
// 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式
box = elem.getBoundingClientRect();
// 注:jQuery 还考虑减去 docElem.clientLeft/clientTop
// 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确
// 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin
x = box.left;
y = box.top;
// In IE, most of the time, 2 extra pixels are added to the top and left
// due to the implicit 2-pixel inset border. In IE6/7 quirks mode and
// IE6 standards mode, this border can be overridden by setting the
// document element's border to zero -- thus, we cannot rely on the
// offset always being 2 pixels.
// In quirks mode, the offset can be determined by querying the body's
// clientLeft/clientTop, but in standards mode, it is found by querying
// the document element's clientLeft/clientTop. Since we already called
// getClientBoundingRect we have already forced a reflow, so it is not
// too expensive just to query them all.
// ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的
// 窗口边框标准是设 documentElement ,quirks 时设置 body
// 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去
// 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置
// 标准 ie 下 docElem.clientTop 就是 border-top
// ie7 html 即窗口边框改变不了。永远为 2
// 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0
x -= docElem.clientLeft || body.clientLeft || 0;
y -= docElem.clientTop || body.clientTop || 0;
return {
left: x,
top: y
};
}
function getScroll(w, top) {
var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];
var method = 'scroll' + (top ? 'Top' : 'Left');
if (typeof ret !== 'number') {
var d = w.document;
// ie6,7,8 standard mode
ret = d.documentElement[method];
if (typeof ret !== 'number') {
// quirks mode
ret = d.body[method];
}
}
return ret;
}
function getScrollLeft(w) {
return getScroll(w);
}
function getScrollTop(w) {
return getScroll(w, true);
}
function getOffset(el) {
var pos = getClientPosition(el);
var doc = el.ownerDocument;
var w = doc.defaultView || doc.parentWindow;
pos.left += getScrollLeft(w);
pos.top += getScrollTop(w);
return pos;
}
function _getComputedStyle(elem, name, computedStyle_) {
var val = '';
var d = elem.ownerDocument;
var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);
// https://github.com/kissyteam/kissy/issues/61
if (computedStyle) {
val = computedStyle.getPropertyValue(name) || computedStyle[name];
}
return val;
}
var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');
var RE_POS = /^(top|right|bottom|left)$/;
var CURRENT_STYLE = 'currentStyle';
var RUNTIME_STYLE = 'runtimeStyle';
var LEFT = 'left';
var PX = 'px';
function _getComputedStyleIE(elem, name) {
// currentStyle maybe null
// http://msdn.microsoft.com/en-us/library/ms535231.aspx
var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];
// 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值
// 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19
// 在 ie 下不对,需要直接用 offset 方式
// borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
// exclude left right for relativity
if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
// Remember the original values
var style = elem.style;
var left = style[LEFT];
var rsLeft = elem[RUNTIME_STYLE][LEFT];
// prevent flashing of content
elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];
// Put in the new values to get a computed value out
style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;
ret = style.pixelLeft + PX;
// Revert the changed values
style[LEFT] = left;
elem[RUNTIME_STYLE][LEFT] = rsLeft;
}
return ret === '' ? 'auto' : ret;
}
var getComputedStyleX = undefined;
if (typeof window !== 'undefined') {
getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
}
function each(arr, fn) {
for (var i = 0; i < arr.length; i++) {
fn(arr[i]);
}
}
function isBorderBoxFn(elem) {
return getComputedStyleX(elem, 'boxSizing') === 'border-box';
}
var BOX_MODELS = ['margin', 'border', 'padding'];
var CONTENT_INDEX = -1;
var PADDING_INDEX = 2;
var BORDER_INDEX = 1;
var MARGIN_INDEX = 0;
function swap(elem, options, callback) {
var old = {};
var style = elem.style;
var name = undefined;
// Remember the old values, and insert the new ones
for (name in options) {
if (options.hasOwnProperty(name)) {
old[name] = style[name];
style[name] = options[name];
}
}
callback.call(elem);
// Revert the old values
for (name in options) {
if (options.hasOwnProperty(name)) {
style[name] = old[name];
}
}
}
function getPBMWidth(elem, props, which) {
var value = 0;
var prop = undefined;
var j = undefined;
var i = undefined;
for (j = 0; j < props.length; j++) {
prop = props[j];
if (prop) {
for (i = 0; i < which.length; i++) {
var cssProp = undefined;
if (prop === 'border') {
cssProp = prop + which[i] + 'Width';
} else {
cssProp = prop + which[i];
}
value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
}
}
}
return value;
}
/**
* A crude way of determining if an object is a window
* @member util
*/
function isWindow(obj) {
// must use == for ie8
/* eslint eqeqeq:0 */
return obj != null && obj == obj.window;
}
var domUtils = {};
each(['Width', 'Height'], function (name) {
domUtils['doc' + name] = function (refWin) {
var d = refWin.document;
return Math.max(
// firefox chrome documentElement.scrollHeight< body.scrollHeight
// ie standard mode : documentElement.scrollHeight> body.scrollHeight
d.documentElement['scroll' + name],
// quirks : documentElement.scrollHeight 最大等于可视窗口多一点?
d.body['scroll' + name], domUtils['viewport' + name](d));
};
domUtils['viewport' + name] = function (win) {
// pc browser includes scrollbar in window.innerWidth
var prop = 'client' + name;
var doc = win.document;
var body = doc.body;
var documentElement = doc.documentElement;
var documentElementProp = documentElement[prop];
// 标准模式取 documentElement
// backcompat 取 body
return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;
};
});
/*
得到元素的大小信息
@param elem
@param name
@param {String} [extra] 'padding' : (css width) + padding
'border' : (css width) + padding + border
'margin' : (css width) + padding + border + margin
*/
function getWH(elem, name, extra) {
if (isWindow(elem)) {
return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);
} else if (elem.nodeType === 9) {
return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);
}
var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;
var computedStyle = getComputedStyleX(elem);
var isBorderBox = isBorderBoxFn(elem, computedStyle);
var cssBoxValue = 0;
if (borderBoxValue == null || borderBoxValue <= 0) {
borderBoxValue = undefined;
// Fall back to computed then un computed css if necessary
cssBoxValue = getComputedStyleX(elem, name);
if (cssBoxValue == null || Number(cssBoxValue) < 0) {
cssBoxValue = elem.style[name] || 0;
}
// Normalize '', auto, and prepare for extra
cssBoxValue = parseFloat(cssBoxValue) || 0;
}
if (extra === undefined) {
extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
}
var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;
var val = borderBoxValue || cssBoxValue;
if (extra === CONTENT_INDEX) {
if (borderBoxValueOrIsBorderBox) {
return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);
}
return cssBoxValue;
}
if (borderBoxValueOrIsBorderBox) {
var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);
return val + (extra === BORDER_INDEX ? 0 : padding);
}
return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);
}
var cssShow = {
position: 'absolute',
visibility: 'hidden',
display: 'block'
};
// fix #119 : https://github.com/kissyteam/kissy/issues/119
function getWHIgnoreDisplay(elem) {
var val = undefined;
var args = arguments;
// in case elem is window
// elem.offsetWidth === undefined
if (elem.offsetWidth !== 0) {
val = getWH.apply(undefined, args);
} else {
swap(elem, cssShow, function () {
val = getWH.apply(undefined, args);
});
}
return val;
}
function css(el, name, v) {
var value = v;
if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
for (var i in name) {
if (name.hasOwnProperty(i)) {
css(el, i, name[i]);
}
}
return undefined;
}
if (typeof value !== 'undefined') {
if (typeof value === 'number') {
value += 'px';
}
el.style[name] = value;
return undefined;
}
return getComputedStyleX(el, name);
}
each(['width', 'height'], function (name) {
var first = name.charAt(0).toUpperCase() + name.slice(1);
domUtils['outer' + first] = function (el, includeMargin) {
return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);
};
var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
domUtils[name] = function (elem, val) {
if (val !== undefined) {
if (elem) {
var computedStyle = getComputedStyleX(elem);
var isBorderBox = isBorderBoxFn(elem);
if (isBorderBox) {
val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);
}
return css(elem, name, val);
}
return undefined;
}
return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);
};
});
// 设置 elem 相对 elem.ownerDocument 的坐标
function setOffset(elem, offset) {
// set position first, in-case top/left are set even on static elem
if (css(elem, 'position') === 'static') {
elem.style.position = 'relative';
}
var old = getOffset(elem);
var ret = {};
var current = undefined;
var key = undefined;
for (key in offset) {
if (offset.hasOwnProperty(key)) {
current = parseFloat(css(elem, key)) || 0;
ret[key] = current + offset[key] - old[key];
}
}
css(elem, ret);
}
module.exports = _extends({
getWindow: function getWindow(node) {
var doc = node.ownerDocument || node;
return doc.defaultView || doc.parentWindow;
},
offset: function offset(el, value) {
if (typeof value !== 'undefined') {
setOffset(el, value);
} else {
return getOffset(el);
}
},
isWindow: isWindow,
each: each,
css: css,
clone: function clone(obj) {
var ret = {};
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
ret[i] = obj[i];
}
}
var overflow = obj.overflow;
if (overflow) {
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
ret.overflow[i] = obj.overflow[i];
}
}
}
return ret;
},
scrollLeft: function scrollLeft(w, v) {
if (isWindow(w)) {
if (v === undefined) {
return getScrollLeft(w);
}
window.scrollTo(v, getScrollTop(w));
} else {
if (v === undefined) {
return w.scrollLeft;
}
w.scrollLeft = v;
}
},
scrollTop: function scrollTop(w, v) {
if (isWindow(w)) {
if (v === undefined) {
return getScrollTop(w);
}
window.scrollTo(getScrollLeft(w), v);
} else {
if (v === undefined) {
return w.scrollTop;
}
w.scrollTop = v;
}
},
viewportWidth: 0,
viewportHeight: 0
}, domUtils);
/***/ }),
/* 197 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
disabled: _propTypes2["default"].bool,
value: _propTypes2["default"].string
};
var Option = function (_React$Component) {
_inherits(Option, _React$Component);
function Option() {
_classCallCheck(this, Option);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
return Option;
}(_react2["default"].Component);
Option.propTypes = propTypes;
exports["default"] = Option;
module.exports = exports['default'];
/***/ }),
/* 198 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _beeIcon = __webpack_require__(125);
var _beeIcon2 = _interopRequireDefault(_beeIcon);
var _beeFormControl = __webpack_require__(164);
var _beeFormControl2 = _interopRequireDefault(_beeFormControl);
var _beeForm = __webpack_require__(199);
var _beeForm2 = _interopRequireDefault(_beeForm);
var _beeTooltip = __webpack_require__(140);
var _beeTooltip2 = _interopRequireDefault(_beeTooltip);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
check: _propTypes2["default"].func
};
var defaultProps = {
check: function check() {
return "";
}
};
var InputRender = function (_Component) {
_inherits(InputRender, _Component);
function InputRender() {
var _temp, _this, _ret;
_classCallCheck(this, InputRender);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = {
value: _this.props.value,
editable: false
}, _this.handleChange = function (e) {
var value = e;
_this.setState({ value: value });
}, _this.check = function () {
if (typeof _this.flag === "undefined" || _this.flag) {
_this.props.check(_this.flag, _this.obj);
_this.setState({ editable: false });
if (_this.props.onChange) {
_this.props.onChange(_this.state.value);
}
_this.flag = undefined;
}
}, _this.checkValidate = function (flag, obj) {
_this.flag = flag;
_this.obj = obj;
}, _this.edit = function () {
_this.setState({ editable: true });
}, _this.handleKeydown = function (event) {
if (event.keyCode == 13) {
_this.check();
}
}, _this.formatCurrency = function (money) {
if (money && money != null && !!Number(money)) {
money = String(money);
var left = money.split(".")[0],
right = money.split(".")[1];
right = right ? right.length >= 2 ? "." + right.substr(0, 2) : "." + right + "0" : ".00";
var temp = left.split("").reverse().join("").match(/(\d{1,3})/g);
return (Number(money) < 0 ? "-" : "") + temp.join(",").split("").reverse().join("") + right;
} else if (money === 0) {
//注意===在这里的使用,如果传入的money为0,if中会将其判定为boolean类型,故而要另外做===判断
return "0.00";
} else {
return "";
}
}, _temp), _possibleConstructorReturn(_this, _ret);
}
//货币的格式化方法
InputRender.prototype.render = function render() {
var _state = this.state,
value = _state.value,
editable = _state.editable;
var _props = this.props,
name = _props.name,
placeholder = _props.placeholder,
isclickTrigger = _props.isclickTrigger,
format = _props.format,
formItemClassName = _props.formItemClassName,
mesClassName = _props.mesClassName,
check = _props.check,
other = _objectWithoutProperties(_props, ["name", "placeholder", "isclickTrigger", "format", "formItemClassName", "mesClassName", "check"]);
var cellContent = "";
if (editable) {
cellContent = isclickTrigger ? _react2["default"].createElement(
"div",
{ className: "editable-cell-input-wrapper" },
_react2["default"].createElement(
_beeForm2["default"].FormItem,
_extends({
className: "formItem-style " + formItemClassName,
mesClassName: "errMessage-style " + mesClassName,
change: this.handleChange,
blur: this.check,
check: this.checkValidate
}, other),
_react2["default"].createElement(_beeFormControl2["default"], {
name: name,
placeholder: placeholder,
onKeyDown: this.handleKeydown,
autoFocus: true,
value: value
})
)
) : _react2["default"].createElement(
"div",
{ className: "editable-cell-input-wrapper" },
_react2["default"].createElement(
_beeForm2["default"].FormItem,
_extends({
className: "formItem-style " + formItemClassName,
mesClassName: "errMessage-style " + mesClassName,
change: this.handleChange,
blur: this.check,
check: this.checkValidate
}, other),
_react2["default"].createElement(_beeFormControl2["default"], {
name: name,
placeholder: placeholder,
onKeyDown: this.handleKeydown,
autoFocus: true,
value: value
})
),
_react2["default"].createElement(_beeIcon2["default"], {
type: "uf-correct",
className: "editable-cell-icon-check",
onClick: this.check
})
);
} else {
if (format && format === "Currency") {
value = this.formatCurrency(value);
}
cellContent = isclickTrigger ? _react2["default"].createElement(
"div",
{ className: "editable-cell-text-wrapper", onClick: this.edit },
value || " "
) : _react2["default"].createElement(
"div",
{ className: "editable-cell-text-wrapper" },
value || " ",
_react2["default"].createElement(_beeIcon2["default"], {
type: "uf-pencil",
className: "editable-cell-icon",
onClick: this.edit
})
);
}
return _react2["default"].createElement(
"div",
{ className: "editable-cell" },
cellContent
);
};
return InputRender;
}(_react.Component);
exports["default"] = InputRender;
InputRender.PropTypes = propTypes;
InputRender.defaultProps = defaultProps;
module.exports = exports["default"];
/***/ }),
/* 199 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Form = __webpack_require__(200);
var _Form2 = _interopRequireDefault(_Form);
var _FormItem = __webpack_require__(203);
var _FormItem2 = _interopRequireDefault(_FormItem);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
_Form2["default"].FormItem = _FormItem2["default"];
exports["default"] = _Form2["default"];
module.exports = exports['default'];
/***/ }),
/* 200 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _beeButton = __webpack_require__(103);
var _beeButton2 = _interopRequireDefault(_beeButton);
var _beeLayout = __webpack_require__(1);
var _beeLabel = __webpack_require__(201);
var _beeLabel2 = _interopRequireDefault(_beeLabel);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
clsPrefix: _propTypes2["default"].string,
className: _propTypes2["default"].string,
submitCallBack: _propTypes2["default"].func, //form验证的回调
submitAreaClassName: _propTypes2["default"].string, //提交区域className
submitBtnClassName: _propTypes2["default"].string, //提交按钮className
beforeSubmitBtn: _propTypes2["default"].node, //提交按钮之前的dom
afterSubmitBtn: _propTypes2["default"].node, //提交按钮之后的dom
useRow: _propTypes2["default"].bool, //是否使用栅格布局
checkFormNow: _propTypes2["default"].bool, //现在就校验(主动校验参数)
showSubmit: _propTypes2["default"].bool //是否显示提交按钮
};
var defaultProps = {
clsPrefix: 'u-form',
className: '',
submitCallBack: function submitCallBack() {}, //form验证的回调
submitAreaClassName: '',
submitBtnClassName: '',
beforeSubmitBtn: '',
afterSubmitBtn: '',
useRow: false,
checkFormNow: false,
showSubmit: true
};
var Form = function (_Component) {
_inherits(Form, _Component);
function Form(props) {
_classCallCheck(this, Form);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.checkItem = function (obj, flag) {
var items = _this.state.items;
items.forEach(function (item) {
if (item.name === obj.name) {
item.verify = obj.verify;
item.value = obj.value === undefined ? '' : obj.value;
}
});
_this.setState({
items: items
});
if (flag && items[items.length - 1] && items[items.length - 1].name === obj.name) {
_this.submit(items);
}
};
_this.getFormItems = function () {
var items = [];
if (_this.props.children.length) {
_this.props.children.map(function (item) {
if (item.props.isFormItem) {
items.push({
'name': item.props.children.props.name,
'verify': true,
'value': ''
});
}
});
} else {
var item = _this.props.children;
if (item.props.isFormItem) {
items.push({
'name': item.props.children.props.name,
'verify': true,
'value': ''
});
}
}
_this.setState({
items: items
});
};
_this.checkNow = function (onClickFn) {
_this.setState({
checkNow: true
});
typeof onClickFn === 'function' ? onClickFn() : '';
};
_this.btnCheck = function (onClickFn) {
var self = _this;
return function () {
self.checkNow(onClickFn);
};
};
_this.submit = function (items) {
var flag = true;
items.forEach(function (item) {
if (!item.verify) {
flag = false;
}
});
_this.setState({
checkNow: false
});
_this.props.submitCallBack(flag, _this.state.items);
};
_this.state = {
items: [], //验证结果对象
checkNow: false //是否立刻验证,提交按钮
};
return _this;
}
Form.prototype.componentDidMount = function componentDidMount() {
this.getFormItems();
};
Form.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (nextProps.checkFormNow) {
this.checkNow();
}
};
Form.prototype.render = function render() {
var _this2 = this;
var _props = this.props,
className = _props.className,
showSubmit = _props.showSubmit,
useRow = _props.useRow,
submitAreaClassName = _props.submitAreaClassName,
submitBtnClassName = _props.submitBtnClassName,
beforeSubmitBtn = _props.beforeSubmitBtn,
afterSubmitBtn = _props.afterSubmitBtn,
clsPrefix = _props.clsPrefix;
var childs = [];
_react2["default"].Children.map(this.props.children, function (child, index) {
var _child$props = child.props,
labelName = _child$props.labelName,
labelClassName = _child$props.labelClassName,
xs = _child$props.xs,
sm = _child$props.sm,
md = _child$props.md,
lg = _child$props.lg,
xsOffset = _child$props.xsOffset,
smOffset = _child$props.smOffset,
mdOffset = _child$props.mdOffset,
lgOffset = _child$props.lgOffset,
xsPush = _child$props.xsPush,
smPush = _child$props.smPush,
mdPush = _child$props.mdPush,
lgPush = _child$props.lgPush,
xsPull = _child$props.xsPull,
smPull = _child$props.smPull,
mdPull = _child$props.mdPull,
lgPull = _child$props.lgPull,
labelXs = _child$props.labelXs,
labelSm = _child$props.labelSm,
labelMd = _child$props.labelMd,
labelLg = _child$props.labelLg,
labelXsOffset = _child$props.labelXsOffset,
labelSmOffset = _child$props.labelSmOffset,
labelMdOffset = _child$props.labelMdOffset,
labelLgOffset = _child$props.labelLgOffset,
labelXsPush = _child$props.labelXsPush,
labelSmPush = _child$props.labelSmPush,
labelMdPush = _child$props.labelMdPush,
labelLgPush = _child$props.labelLgPush,
labelXsPull = _child$props.labelXsPull,
labelSmPull = _child$props.labelSmPull,
labelMdPull = _child$props.labelMdPull,
labelLgPull = _child$props.labelLgPull,
showMast = _child$props.showMast,
isSubmit = _child$props.isSubmit;
if (child.props.isFormItem) {
if (useRow) {
childs.push(_react2["default"].createElement(
_beeLayout.Col,
{ key: 'label' + index, xs: labelXs, sm: labelSm, md: labelMd, lg: labelLg, xsOffset: labelXsOffset, smOffset: labelSmOffset,
mdOffset: labelMdOffset, lgOffset: labelLgOffset, xsPush: labelXsPush, smPush: labelSmPush, mdPush: labelMdPush, lgPush: labelLgPush,
xsPull: labelXsPull, smPull: labelSmPull, mdPull: labelMdPull, lgPull: labelLgPull },
_react2["default"].createElement(
_beeLabel2["default"],
{ className: labelClassName ? labelClassName : '' },
showMast ? _react2["default"].createElement(
'span',
{ className: 'u-mast' },
'*'
) : '',
labelName
)
));
childs.push(_react2["default"].createElement(
_beeLayout.Col,
{ key: 'fromGroup' + index, xs: xs, sm: sm, md: md, lg: lg, xsOffset: xsOffset, smOffset: smOffset, mdOffset: mdOffset,
lgOffset: lgOffset, xsPush: xsPush, smPush: smPush, mdPush: mdPush, lgPush: lgPush,
xsPull: xsPull, smPull: smPull, mdPull: mdPull, lgPull: lgPull },
_react2["default"].cloneElement(child, {
useRow: useRow,
checkItem: _this2.checkItem,
checkNow: _this2.state.checkNow
})
));
} else {
childs.push(_react2["default"].createElement(
'span',
{ key: index },
_react2["default"].cloneElement(child, {
useRow: useRow,
checkItem: _this2.checkItem,
checkNow: _this2.state.checkNow
})
));
}
} else if (child.props.isSubmit) {
childs.push(_react2["default"].createElement(
'span',
{ key: index },
_react2["default"].cloneElement(child, {
onClick: _this2.btnCheck(child.props.onClick)
})
));
} else {
childs.push(_react2["default"].cloneElement(child));
}
});
return _react2["default"].createElement(
'form',
{ className: clsPrefix + ' ' + className, onSubmit: this.checkNow },
useRow ? _react2["default"].createElement(
_beeLayout.Row,
null,
childs
) : childs,
showSubmit ? _react2["default"].createElement(
'div',
{ className: clsPrefix + '-submit ' + submitAreaClassName },
beforeSubmitBtn,
_react2["default"].createElement(
_beeButton2["default"],
{ onClick: this.checkNow, colors: 'primary', className: clsPrefix + '-submit-btn ' + submitBtnClassName },
'\u63D0\u4EA4'
),
afterSubmitBtn
) : ''
);
};
return Form;
}(_react.Component);
;
Form.propTypes = propTypes;
Form.defaultProps = defaultProps;
exports["default"] = Form;
module.exports = exports['default'];
/***/ }),
/* 201 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Label = __webpack_require__(202);
var _Label2 = _interopRequireDefault(_Label);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports["default"] = _Label2["default"];
module.exports = exports['default'];
/***/ }),
/* 202 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var defaultProps = {
clsPrefix: 'u-label'
};
var Label = function (_Component) {
_inherits(Label, _Component);
function Label() {
_classCallCheck(this, Label);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
Label.prototype.render = function render() {
var _props = this.props,
className = _props.className,
children = _props.children,
clsPrefix = _props.clsPrefix,
others = _objectWithoutProperties(_props, ['className', 'children', 'clsPrefix']);
var classNames = (0, _classnames2["default"])(clsPrefix, className);
return _react2["default"].createElement(
'label',
_extends({}, others, {
className: classNames
}),
children
);
};
return Label;
}(_react.Component);
Label.defaultProps = defaultProps;
exports["default"] = Label;
module.exports = exports['default'];
/***/ }),
/* 203 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _beeInputGroup = __webpack_require__(204);
var _beeInputGroup2 = _interopRequireDefault(_beeInputGroup);
var _beeLabel = __webpack_require__(201);
var _beeLabel2 = _interopRequireDefault(_beeLabel);
var _lodash = __webpack_require__(209);
var _lodash2 = _interopRequireDefault(_lodash);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var regs = {
email: /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,
tel: /^1\d{10}$/,
IDCard: /^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/, //身份证
chinese: /^[\u4e00-\u9fa5]+?$/, //中文校验
password: /^[0-9a-zA-Z,.!?`~#$%^&*()-=_+<>'"\[\]\{\}\\\|]{6,15}$/, //6-15位数字英文符号
number: /^\d*$/
};
var propTypes = {
clsPrefix: _propTypes2["default"].string,
className: _propTypes2["default"].string,
isRequire: _propTypes2["default"].bool, //是否必填
errorMessage: _propTypes2["default"].oneOfType([_propTypes2["default"].node, _propTypes2["default"].array]), //错误信息
htmlType: _propTypes2["default"].oneOf(['email', 'tel', 'IDCard', 'chinese', 'password', null]), //htmlType有值的时候 reg不生效
reg: _propTypes2["default"].oneOfType([_propTypes2["default"].instanceOf(RegExp), _propTypes2["default"].array]), //校验正则,可传字符串或者数组,如果是数组,需要和errorMessage数组一一对应
method: _propTypes2["default"].oneOf(['change', 'blur', null]), //校验方式
blur: _propTypes2["default"].func, //失去焦点的回调,参数为value
change: _propTypes2["default"].func, //值改变的回调,参数为value当地售后地址
check: _propTypes2["default"].func, //验证的回调
checkItem: _propTypes2["default"].func,
useRow: _propTypes2["default"].bool,
inline: _propTypes2["default"].bool, //formItem是否行内
labelName: _propTypes2["default"].node, //label标签文字或dom
labelClassName: _propTypes2["default"].string, //label样式名
inputBefore: _propTypes2["default"].node, //input之前的
inputAfter: _propTypes2["default"].node, //input之后的
// inputBeforeSimple:PropTypes.node,//input之前的(参考输入框组的inputGroup.Button,和inputBefore不能同时使用)
// inputAfterSimple:PropTypes.node,//input之后的(参考输入框组的inputGroup.Button,和inputAfter不能同时使用)
mesClassName: _propTypes2["default"].string, //提示信息样式名
checkInitialValue: _propTypes2["default"].bool, //是否校验初始值,未开放 ...col.propTypes
showMast: _propTypes2["default"].bool, //是否显示必填项的 *
asyncCheck: _propTypes2["default"].func, //自定义校验,返回true则校验成功,false或无返回值则校验失败。参数为{name:xxx,value:xxx}
valuePropsName: _propTypes2["default"].string, //默认值的props属性key。默认为'defaultValue'
// valuePropsName: PropTypes.string,//当前值的props属性key。默认为'value'
xs: _propTypes2["default"].number, //xs显示列数
sm: _propTypes2["default"].number, //sm显示列数
md: _propTypes2["default"].number, //md显示列数
lg: _propTypes2["default"].number, //lg显示列数
xsOffset: _propTypes2["default"].number, //xs偏移列数
smOffset: _propTypes2["default"].number, //sm偏移列数
mdOffset: _propTypes2["default"].number, //md偏移列数
lgOffset: _propTypes2["default"].number, //lg偏移列数
xsPush: _propTypes2["default"].number, //xs右偏移列数
smPush: _propTypes2["default"].number, //sm右偏移列数
mdPush: _propTypes2["default"].number, //md右偏移列数
lgPush: _propTypes2["default"].number, //lg右偏移列数
xsPull: _propTypes2["default"].number, //xs左偏移列数
smPull: _propTypes2["default"].number, //sm左偏移列数`
mdPull: _propTypes2["default"].number, //md左偏移列数
lgPull: _propTypes2["default"].number, //lg左偏移列数
labelXs: _propTypes2["default"].number,
labelSm: _propTypes2["default"].number,
labelMd: _propTypes2["default"].number,
labelLg: _propTypes2["default"].number,
labelXsOffset: _propTypes2["default"].number,
labelSmOffset: _propTypes2["default"].number,
labelMdOffset: _propTypes2["default"].number,
labelLgOffset: _propTypes2["default"].number,
labelXsPush: _propTypes2["default"].number,
labelSmPush: _propTypes2["default"].number,
labelMdPush: _propTypes2["default"].number,
labelLgPush: _propTypes2["default"].number,
labelXsPull: _propTypes2["default"].number,
labelSmPull: _propTypes2["default"].number,
labelMdPull: _propTypes2["default"].number,
labelLgPull: _propTypes2["default"].number
};
var defaultProps = {
clsPrefix: 'u-form',
isRequire: false, //是否必填
errorMessage: '校验失败', //错误信息
reg: /[/w/W]*/,
method: 'change',
blur: function blur() {},
change: function change() {},
isFormItem: true,
check: function check() {},
checkItem: function checkItem() {},
inline: false,
labelName: '',
labelClassName: '',
inputBefore: '',
inputAfter: '',
// inputBeforeSimple:'',
// inputAfterSimple:'',
mesClassName: '',
checkInitialValue: false,
useRow: false,
showMast: false,
valuePropsName: 'defaultValue'
};
var FormItem = function (_Component) {
_inherits(FormItem, _Component);
function FormItem(props) {
_classCallCheck(this, FormItem);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.getNowValueName = function (item) {
return {
value: _this.state.valueNow,
name: item.props.name //item.localName 例如textarea原生元素
};
};
_this.getWidth = function (key) {
return _reactDom2["default"].findDOMNode(_this.refs[key]) ? _reactDom2["default"].findDOMNode(_this.refs[key]).clientWidth || _reactDom2["default"].findDOMNode(_this.refs[key]).offsetWidth : 0;
};
_this.handleBlur = function () {
var _this$getNowValueName = _this.getNowValueName(_this.props.children),
value = _this$getNowValueName.value,
name = _this$getNowValueName.name;
if (_this.props.method === 'blur') {
var flag = _this.itemCheck(value, name);
_this.setState({
hasError: !flag
});
_this.props.checkItem({
"verify": flag,
"name": name,
"value": value
});
}
_this.props.blur(value);
_this.props.children.props.onBlur && _this.props.children.props.onBlur(value);
};
_this.handleChange = function (selectV) {
var value = selectV;
_this.setState({
valueNow: selectV
});
var name = _this.getNowValueName(_this.props.children).name;
if (_this.props.method === 'change') {
var flag = _this.itemCheck(value, name);
_this.setState({
hasError: !flag,
value: value
});
_this.props.checkItem({
"verify": flag,
"name": name,
"value": value
});
}
_this.props.change(value);
_this.props.children.props.onChange && _this.props.children.props.onChange(value);
};
_this.itemCheck = function (value, name) {
var _this$props = _this.props,
isRequire = _this$props.isRequire,
htmlType = _this$props.htmlType,
check = _this$props.check,
asyncCheck = _this$props.asyncCheck,
errorMessage = _this$props.errorMessage;
var reg = htmlType ? regs[htmlType] : _this.props.reg;
var obj = {
"name": name,
"value": value === undefined ? '' : value
};
if (typeof asyncCheck == 'function') {
var flag = !!asyncCheck(obj);
obj.verify = flag;
check(flag, obj);
return flag;
} else {
if (reg.length) {
var _flag = true;
for (var i = 0; i < reg.length; i++) {
if (!reg[i].test(value)) {
_this.setState({
errorMessage: errorMessage[i]
});
_flag = false;
break;
}
}
obj.verify = _flag;
if (isRequire) {
if (value != undefined && value !== '') {
check(_flag, obj);
return _flag;
} else {
check(false, obj);
return false;
}
} else {
if (value != undefined && value !== '') {
check(_flag, obj);
return _flag;
} else {
check(true, obj);
return true;
}
}
} else {
var _flag2 = reg.test(value);
obj.verify = _flag2;
if (isRequire) {
if (value != undefined && value !== '') {
check(_flag2, obj);
return _flag2;
} else {
check(false, obj);
return false;
}
} else {
if (value != undefined && value !== '') {
check(_flag2, obj);
return _flag2;
} else {
check(true, obj);
return true;
}
}
}
}
};
_this.checkSelf = function (v, checkFlag) {
var value = v == undefined ? _this.getNowValueName(_this.props.children).value : v;
var name = _this.getNowValueName(_this.props.children).name;
var flag = _this.itemCheck(value, name);
_this.props.checkItem({
"verify": flag,
"name": name,
"value": value
}, checkFlag ? false : true);
_this.setState({
hasError: !flag
});
};
_this.state = {
hasError: false,
width: 0,
valueNow: props.children.props[props.valuePropsName],
maxWidth: '100%',
errorMessage: typeof props.errorMessage == 'string' ? props.errorMessage : props.errorMessage[0],
childrenWidth: '100%'
};
return _this;
}
FormItem.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
if ((0, _lodash2["default"])(this.props, nextProps) && (0, _lodash2["default"])(this.state, nextState)) {
return false;
} else {
return true;
}
};
FormItem.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var thisValue = this.props.children.props[this.props.valuePropsName];
var nextValue = nextProps.children.props[this.props.valuePropsName];
if (!(0, _lodash2["default"])(thisValue, nextValue)) {
this.checkSelf(nextValue, true);
this.setState({
valueNow: nextValue
});
}
if (nextProps.checkNow && !this.props.checkNow) {
this.checkSelf();
}
};
FormItem.prototype.componentDidMount = function componentDidMount() {
var outerWidth = this.getWidth('outer');
var width = this.getWidth('label');
var maxWidth = outerWidth ? outerWidth - width - 10 : '100%';
if (this.props.inline) {
this.setState({
width: width,
maxWidth: maxWidth
});
}
var before = this.getWidth('before');
var after = this.getWidth('after');
this.setState({
childrenWidth: maxWidth - before - after - 2
});
};
/**
* 校验方法
* @param value
* @returns {boolean}
*/
/**
* 触发校验
*/
FormItem.prototype.render = function render() {
var _this2 = this;
var _props = this.props,
showMast = _props.showMast,
useRow = _props.useRow,
children = _props.children,
inline = _props.inline,
className = _props.className,
clsPrefix = _props.clsPrefix,
inputBefore = _props.inputBefore,
inputAfter = _props.inputAfter,
mesClassName = _props.mesClassName,
labelName = _props.labelName,
labelClassName = _props.labelClassName;
var clsObj = {};
clsObj[clsPrefix + '-item'] = true;
className ? clsObj[className] = true : '';
var clsErrObj = {};
clsErrObj[clsPrefix + '-error'] = true;
if (inline) {
clsObj[clsPrefix + '-inline'] = true;
clsErrObj[clsPrefix + '-error-inline'] = true;
}
mesClassName ? clsErrObj[mesClassName] = true : '';
if (this.state.hasError) clsErrObj['show'] = true;
var childs = [];
var childrenStyles = this.props.children.props.style ? this.props.children.props.style : {};
var appendObj = {
onBlur: this.handleBlur,
onChange: this.handleChange
};
if (this.props.children.props.clsPrefix && this.props.children.props.clsPrefix.indexOf('u-form-control') != -1) {
appendObj.style = _extends({ 'width': this.state.childrenWidth }, childrenStyles);
}
_react2["default"].Children.map(this.props.children, function (child, index) {
childs.push(_react2["default"].createElement(
'div',
{ ref: 'outer', key: index },
useRow ? '' : _react2["default"].createElement(
_beeLabel2["default"],
{ ref: 'label', className: labelClassName ? labelClassName : '' },
showMast ? _react2["default"].createElement(
'span',
{ className: 'u-mast' },
'*'
) : '',
labelName
),
_react2["default"].createElement(
'span',
{ className: 'u-input-group-outer', style: { 'maxWidth': _this2.state.maxWidth } },
_react2["default"].createElement(
_beeInputGroup2["default"],
{ key: index },
inputBefore ? _react2["default"].createElement(
'span',
{ className: 'u-input-before', ref: 'before' },
inputBefore
) : '',
_react2["default"].createElement(
'span',
{ className: 'u-input-inner' },
_react2["default"].cloneElement(children, appendObj)
),
inputAfter ? _react2["default"].createElement(
'span',
{ className: 'u-input-after', ref: 'after' },
inputAfter
) : ''
)
)
));
});
return _react2["default"].createElement(
'div',
{ className: (0, _classnames2["default"])(clsObj) },
childs,
_react2["default"].createElement(
'div',
{ className: (0, _classnames2["default"])(clsErrObj), style: { 'marginLeft': this.state.width } },
this.state.errorMessage
)
);
};
return FormItem;
}(_react.Component);
;
FormItem.propTypes = propTypes;
FormItem.defaultProps = defaultProps;
exports["default"] = FormItem;
module.exports = exports['default'];
/***/ }),
/* 204 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
module.exports = __webpack_require__(205);
/***/ }),
/* 205 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _beeInputGroupAddon = __webpack_require__(206);
var _beeInputGroupAddon2 = _interopRequireDefault(_beeInputGroupAddon);
var _InputGroupButton = __webpack_require__(208);
var _InputGroupButton2 = _interopRequireDefault(_InputGroupButton);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var defaultProps = {
clsPrefix: 'u-input-group',
simple: false
};
var InputGroup = function (_React$Component) {
_inherits(InputGroup, _React$Component);
function InputGroup() {
_classCallCheck(this, InputGroup);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
InputGroup.prototype.render = function render() {
var _props = this.props,
className = _props.className,
clsPrefix = _props.clsPrefix,
simple = _props.simple,
others = _objectWithoutProperties(_props, ['className', 'clsPrefix', 'simple']);
return _react2["default"].createElement('span', _extends({}, others, {
className: (0, _classnames2["default"])(className, clsPrefix, simple && 'simple')
}));
};
return InputGroup;
}(_react2["default"].Component);
/**
* 将InputGroupAddon与InputGroupButton组件作为InputGroup的附属组件
*/
InputGroup.Addon = _beeInputGroupAddon2["default"];
InputGroup.Button = _InputGroupButton2["default"];
InputGroup.defaultProps = defaultProps;
exports["default"] = InputGroup;
module.exports = exports['default'];
/***/ }),
/* 206 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _InputGroupAddon = __webpack_require__(207);
var _InputGroupAddon2 = _interopRequireDefault(_InputGroupAddon);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports["default"] = _InputGroupAddon2["default"];
module.exports = exports['default'];
/***/ }),
/* 207 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var defaultProps = {
clsPrefix: 'u-input-group-addon'
};
var InputGroupAddon = function (_React$Component) {
_inherits(InputGroupAddon, _React$Component);
function InputGroupAddon() {
_classCallCheck(this, InputGroupAddon);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
InputGroupAddon.prototype.render = function render() {
var _props = this.props;
var className = _props.className;
var clsPrefix = _props.clsPrefix;
var others = _objectWithoutProperties(_props, ['className', 'clsPrefix']);
return _react2["default"].createElement('span', _extends({}, others, {
className: (0, _classnames2["default"])(className, clsPrefix)
}));
};
return InputGroupAddon;
}(_react2["default"].Component);
InputGroupAddon.defaultProps = defaultProps;
exports["default"] = InputGroupAddon;
module.exports = exports['default'];
/***/ }),
/* 208 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var defaultProps = {
clsPrefix: 'u-input-group-btn'
};
var InputGroupButton = function (_React$Component) {
_inherits(InputGroupButton, _React$Component);
function InputGroupButton() {
_classCallCheck(this, InputGroupButton);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
InputGroupButton.prototype.render = function render() {
var _props = this.props,
className = _props.className,
clsPrefix = _props.clsPrefix,
others = _objectWithoutProperties(_props, ['className', 'clsPrefix']);
return _react2["default"].createElement('span', _extends({}, others, {
className: (0, _classnames2["default"])(className, clsPrefix)
}));
};
return InputGroupButton;
}(_react2["default"].Component);
InputGroupButton.defaultProps = defaultProps;
exports["default"] = InputGroupButton;
module.exports = exports['default'];
/***/ }),
/* 209 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global, module) {/**
* Lodash (Custom Build)
* Build: `lodash modularize exports="npm" -o ./`
* Copyright JS Foundation and other contributors
* Released under MIT license
* Based on Underscore.js 1.8.3
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
COMPARE_UNORDERED_FLAG = 2;
/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;
/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
arrayTag = '[object Array]',
asyncTag = '[object AsyncFunction]',
boolTag = '[object Boolean]',
dateTag = '[object Date]',
errorTag = '[object Error]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
mapTag = '[object Map]',
numberTag = '[object Number]',
nullTag = '[object Null]',
objectTag = '[object Object]',
promiseTag = '[object Promise]',
proxyTag = '[object Proxy]',
regexpTag = '[object RegExp]',
setTag = '[object Set]',
stringTag = '[object String]',
symbolTag = '[object Symbol]',
undefinedTag = '[object Undefined]',
weakMapTag = '[object WeakMap]';
var arrayBufferTag = '[object ArrayBuffer]',
dataViewTag = '[object DataView]',
float32Tag = '[object Float32Array]',
float64Tag = '[object Float64Array]',
int8Tag = '[object Int8Array]',
int16Tag = '[object Int16Array]',
int32Tag = '[object Int32Array]',
uint8Tag = '[object Uint8Array]',
uint8ClampedTag = '[object Uint8ClampedArray]',
uint16Tag = '[object Uint16Array]',
uint32Tag = '[object Uint32Array]';
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;
/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false;
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
/** Detect free variable `module`. */
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;
/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;
/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
try {
return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}());
/* Node.js helper references. */
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
/**
* A specialized version of `_.filter` for arrays without support for
* iteratee shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {Array} Returns the new filtered array.
*/
function arrayFilter(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (predicate(value, index, array)) {
result[resIndex++] = value;
}
}
return result;
}
/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
/**
* A specialized version of `_.some` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} predicate The function invoked per iteration.
* @returns {boolean} Returns `true` if any element passes the predicate check,
* else `false`.
*/
function arraySome(array, predicate) {
var index = -1,
length = array == null ? 0 : array.length;
while (++index < length) {
if (predicate(array[index], index, array)) {
return true;
}
}
return false;
}
/**
* The base implementation of `_.times` without support for iteratee shorthands
* or max array length checks.
*
* @private
* @param {number} n The number of times to invoke `iteratee`.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the array of results.
*/
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
}
/**
* The base implementation of `_.unary` without support for storing metadata.
*
* @private
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new capped function.
*/
function baseUnary(func) {
return function(value) {
return func(value);
};
}
/**
* Checks if a `cache` value for `key` exists.
*
* @private
* @param {Object} cache The cache to query.
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function cacheHas(cache, key) {
return cache.has(key);
}
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
/**
* Converts `map` to its key-value pairs.
*
* @private
* @param {Object} map The map to convert.
* @returns {Array} Returns the key-value pairs.
*/
function mapToArray(map) {
var index = -1,
result = Array(map.size);
map.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
}
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
/**
* Converts `set` to an array of its values.
*
* @private
* @param {Object} set The set to convert.
* @returns {Array} Returns the values.
*/
function setToArray(set) {
var index = -1,
result = Array(set.size);
set.forEach(function(value) {
result[++index] = value;
});
return result;
}
/** Used for built-in method references. */
var arrayProto = Array.prototype,
funcProto = Function.prototype,
objectProto = Object.prototype;
/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];
/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined,
Symbol = root.Symbol,
Uint8Array = root.Uint8Array,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
splice = arrayProto.splice,
symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols,
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
nativeKeys = overArg(Object.keys, Object);
/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView'),
Map = getNative(root, 'Map'),
Promise = getNative(root, 'Promise'),
Set = getNative(root, 'Set'),
WeakMap = getNative(root, 'WeakMap'),
nativeCreate = getNative(Object, 'create');
/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
mapCtorString = toSource(Map),
promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
/**
* Creates a hash object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Hash(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the hash.
*
* @private
* @name clear
* @memberOf Hash
*/
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
this.size = 0;
}
/**
* Removes `key` and its value from the hash.
*
* @private
* @name delete
* @memberOf Hash
* @param {Object} hash The hash to modify.
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function hashDelete(key) {
var result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
}
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}
/**
* Sets the hash `key` to `value`.
*
* @private
* @name set
* @memberOf Hash
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the hash instance.
*/
function hashSet(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
return this;
}
// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
/**
* Creates an list cache object.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function ListCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the list cache.
*
* @private
* @name clear
* @memberOf ListCache
*/
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
--this.size;
return true;
}
/**
* Gets the list cache value for `key`.
*
* @private
* @name get
* @memberOf ListCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function listCacheGet(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
++this.size;
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
/**
* Creates a map cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function MapCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
/**
* Removes all key-value entries from the map.
*
* @private
* @name clear
* @memberOf MapCache
*/
function mapCacheClear() {
this.size = 0;
this.__data__ = {
'hash': new Hash,
'map': new (Map || ListCache),
'string': new Hash
};
}
/**
* Removes `key` and its value from the map.
*
* @private
* @name delete
* @memberOf MapCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function mapCacheDelete(key) {
var result = getMapData(this, key)['delete'](key);
this.size -= result ? 1 : 0;
return result;
}
/**
* Gets the map value for `key`.
*
* @private
* @name get
* @memberOf MapCache
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
/**
* Checks if a map value for `key` exists.
*
* @private
* @name has
* @memberOf MapCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
var data = getMapData(this, key),
size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
/**
*
* Creates an array cache object to store unique values.
*
* @private
* @constructor
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values == null ? 0 : values.length;
this.__data__ = new MapCache;
while (++index < length) {
this.add(values[index]);
}
}
/**
* Adds `value` to the array cache.
*
* @private
* @name add
* @memberOf SetCache
* @alias push
* @param {*} value The value to cache.
* @returns {Object} Returns the cache instance.
*/
function setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED);
return this;
}
/**
* Checks if `value` is in the array cache.
*
* @private
* @name has
* @memberOf SetCache
* @param {*} value The value to search for.
* @returns {number} Returns `true` if `value` is found, else `false`.
*/
function setCacheHas(value) {
return this.__data__.has(value);
}
// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
/**
* Creates a stack cache object to store key-value pairs.
*
* @private
* @constructor
* @param {Array} [entries] The key-value pairs to cache.
*/
function Stack(entries) {
var data = this.__data__ = new ListCache(entries);
this.size = data.size;
}
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new ListCache;
this.size = 0;
}
/**
* Removes `key` and its value from the stack.
*
* @private
* @name delete
* @memberOf Stack
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function stackDelete(key) {
var data = this.__data__,
result = data['delete'](key);
this.size = data.size;
return result;
}
/**
* Gets the stack value for `key`.
*
* @private
* @name get
* @memberOf Stack
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function stackGet(key) {
return this.__data__.get(key);
}
/**
* Checks if a stack value for `key` exists.
*
* @private
* @name has
* @memberOf Stack
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function stackHas(key) {
return this.__data__.has(key);
}
/**
* Sets the stack `key` to `value`.
*
* @private
* @name set
* @memberOf Stack
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the stack cache instance.
*/
function stackSet(key, value) {
var data = this.__data__;
if (data instanceof ListCache) {
var pairs = data.__data__;
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
pairs.push([key, value]);
this.size = ++data.size;
return this;
}
data = this.__data__ = new MapCache(pairs);
}
data.set(key, value);
this.size = data.size;
return this;
}
// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
var isArr = isArray(value),
isArg = !isArr && isArguments(value),
isBuff = !isArr && !isArg && isBuffer(value),
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
skipIndexes = isArr || isArg || isBuff || isType,
result = skipIndexes ? baseTimes(value.length, String) : [],
length = result.length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (
// Safari 9 has enumerable `arguments.length` in strict mode.
key == 'length' ||
// Node.js 0.10 has enumerable non-index properties on buffers.
(isBuff && (key == 'offset' || key == 'parent')) ||
// PhantomJS 2 has enumerable non-index properties on typed arrays.
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
// Skip index properties.
isIndex(key, length)
))) {
result.push(key);
}
}
return result;
}
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
/**
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Function} keysFunc The function to get the keys of `object`.
* @param {Function} symbolsFunc The function to get the symbols of `object`.
* @returns {Array} Returns the array of property names and symbols.
*/
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}
/**
* The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value)
: objectToString(value);
}
/**
* The base implementation of `_.isArguments`.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
*/
function baseIsArguments(value) {
return isObjectLike(value) && baseGetTag(value) == argsTag;
}
/**
* The base implementation of `_.isEqual` which supports partial comparisons
* and tracks traversed objects.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @param {boolean} bitmask The bitmask flags.
* 1 - Unordered comparison
* 2 - Partial comparison
* @param {Function} [customizer] The function to customize comparisons.
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
*/
function baseIsEqual(value, other, bitmask, customizer, stack) {
if (value === other) {
return true;
}
if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
return value !== value && other !== other;
}
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
}
/**
* A specialized version of `baseIsEqual` for arrays and objects which performs
* deep comparisons and tracks traversed objects enabling objects with circular
* references to be compared.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
var objIsArr = isArray(object),
othIsArr = isArray(other),
objTag = objIsArr ? arrayTag : getTag(object),
othTag = othIsArr ? arrayTag : getTag(other);
objTag = objTag == argsTag ? objectTag : objTag;
othTag = othTag == argsTag ? objectTag : othTag;
var objIsObj = objTag == objectTag,
othIsObj = othTag == objectTag,
isSameTag = objTag == othTag;
if (isSameTag && isBuffer(object)) {
if (!isBuffer(other)) {
return false;
}
objIsArr = true;
objIsObj = false;
}
if (isSameTag && !objIsObj) {
stack || (stack = new Stack);
return (objIsArr || isTypedArray(object))
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
}
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object.value() : object,
othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack);
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack);
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
}
/**
* The base implementation of `_.isNative` without bad shim checks.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function,
* else `false`.
*/
function baseIsNative(value) {
if (!isObject(value) || isMasked(value)) {
return false;
}
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
/**
* The base implementation of `_.isTypedArray` without Node.js optimizations.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
*/
function baseIsTypedArray(value) {
return isObjectLike(value) &&
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
}
/**
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
/**
* A specialized version of `baseIsEqualDeep` for arrays with support for
* partial deep comparisons.
*
* @private
* @param {Array} array The array to compare.
* @param {Array} other The other array to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `array` and `other` objects.
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
*/
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
arrLength = array.length,
othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(array);
if (stacked && stack.get(other)) {
return stacked == other;
}
var index = -1,
result = true,
seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
stack.set(array, other);
stack.set(other, array);
// Ignore non-index properties.
while (++index < arrLength) {
var arrValue = array[index],
othValue = other[index];
if (customizer) {
var compared = isPartial
? customizer(othValue, arrValue, index, other, array, stack)
: customizer(arrValue, othValue, index, array, other, stack);
}
if (compared !== undefined) {
if (compared) {
continue;
}
result = false;
break;
}
// Recursively compare arrays (susceptible to call stack limits).
if (seen) {
if (!arraySome(other, function(othValue, othIndex) {
if (!cacheHas(seen, othIndex) &&
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
return seen.push(othIndex);
}
})) {
result = false;
break;
}
} else if (!(
arrValue === othValue ||
equalFunc(arrValue, othValue, bitmask, customizer, stack)
)) {
result = false;
break;
}
}
stack['delete'](array);
stack['delete'](other);
return result;
}
/**
* A specialized version of `baseIsEqualDeep` for comparing objects of
* the same `toStringTag`.
*
* **Note:** This function only supports comparing values with tags of
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {string} tag The `toStringTag` of the objects to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
switch (tag) {
case dataViewTag:
if ((object.byteLength != other.byteLength) ||
(object.byteOffset != other.byteOffset)) {
return false;
}
object = object.buffer;
other = other.buffer;
case arrayBufferTag:
if ((object.byteLength != other.byteLength) ||
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
// Coerce booleans to `1` or `0` and dates to milliseconds.
// Invalid dates are coerced to `NaN`.
return eq(+object, +other);
case errorTag:
return object.name == other.name && object.message == other.message;
case regexpTag:
case stringTag:
// Coerce regexes to strings and treat strings, primitives and objects,
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
// for more details.
return object == (other + '');
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
convert || (convert = setToArray);
if (object.size != other.size && !isPartial) {
return false;
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked) {
return stacked == other;
}
bitmask |= COMPARE_UNORDERED_FLAG;
// Recursively compare objects (susceptible to call stack limits).
stack.set(object, other);
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
stack['delete'](object);
return result;
case symbolTag:
if (symbolValueOf) {
return symbolValueOf.call(object) == symbolValueOf.call(other);
}
}
return false;
}
/**
* A specialized version of `baseIsEqualDeep` for objects with support for
* partial deep comparisons.
*
* @private
* @param {Object} object The object to compare.
* @param {Object} other The other object to compare.
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
* @param {Function} customizer The function to customize comparisons.
* @param {Function} equalFunc The function to determine equivalents of values.
* @param {Object} stack Tracks traversed `object` and `other` objects.
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
*/
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
objProps = getAllKeys(object),
objLength = objProps.length,
othProps = getAllKeys(other),
othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index = objLength;
while (index--) {
var key = objProps[index];
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
return false;
}
}
// Assume cyclic values are equal.
var stacked = stack.get(object);
if (stacked && stack.get(other)) {
return stacked == other;
}
var result = true;
stack.set(object, other);
stack.set(other, object);
var skipCtor = isPartial;
while (++index < objLength) {
key = objProps[index];
var objValue = object[key],
othValue = other[key];
if (customizer) {
var compared = isPartial
? customizer(othValue, objValue, key, other, object, stack)
: customizer(objValue, othValue, key, object, other, stack);
}
// Recursively compare objects (susceptible to call stack limits).
if (!(compared === undefined
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
: compared
)) {
result = false;
break;
}
skipCtor || (skipCtor = key == 'constructor');
}
if (result && !skipCtor) {
var objCtor = object.constructor,
othCtor = other.constructor;
// Non `Object` object instances with different constructors are not equal.
if (objCtor != othCtor &&
('constructor' in object && 'constructor' in other) &&
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
result = false;
}
}
stack['delete'](object);
stack['delete'](other);
return result;
}
/**
* Creates an array of own enumerable property names and symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names and symbols.
*/
function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols);
}
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
/**
* Creates an array of the own enumerable symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
if (object == null) {
return [];
}
object = Object(object);
return arrayFilter(nativeGetSymbols(object), function(symbol) {
return propertyIsEnumerable.call(object, symbol);
});
};
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
var getTag = baseGetTag;
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
(Map && getTag(new Map) != mapTag) ||
(Promise && getTag(Promise.resolve()) != promiseTag) ||
(Set && getTag(new Set) != setTag) ||
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
getTag = function(value) {
var result = baseGetTag(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? toSource(Ctor) : '';
if (ctorString) {
switch (ctorString) {
case dataViewCtorString: return dataViewTag;
case mapCtorString: return mapTag;
case promiseCtorString: return promiseTag;
case setCtorString: return setTag;
case weakMapCtorString: return weakMapTag;
}
}
return result;
};
}
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
}
/**
* Checks if `value` is suitable for use as unique object key.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
*/
function isKeyable(value) {
var type = typeof value;
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
? (value !== '__proto__')
: (value === null);
}
/**
* Checks if `func` has its source masked.
*
* @private
* @param {Function} func The function to check.
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
*/
function isMasked(func) {
return !!maskSrcKey && (maskSrcKey in func);
}
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
}
/**
* Converts `value` to a string using `Object.prototype.toString`.
*
* @private
* @param {*} value The value to convert.
* @returns {string} Returns the converted string.
*/
function objectToString(value) {
return nativeObjectToString.call(value);
}
/**
* Converts `func` to its source code.
*
* @private
* @param {Function} func The function to convert.
* @returns {string} Returns the source code.
*/
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return (func + '');
} catch (e) {}
}
return '';
}
/**
* Performs a
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* comparison between two values to determine if they are equivalent.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.eq(object, object);
* // => true
*
* _.eq(object, other);
* // => false
*
* _.eq('a', 'a');
* // => true
*
* _.eq('a', Object('a'));
* // => false
*
* _.eq(NaN, NaN);
* // => true
*/
function eq(value, other) {
return value === other || (value !== value && other !== other);
}
/**
* Checks if `value` is likely an `arguments` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
* else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee');
};
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
/**
* Checks if `value` is array-like. A value is considered array-like if it's
* not a function and has a `value.length` that's an integer greater than or
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
* @example
*
* _.isArrayLike([1, 2, 3]);
* // => true
*
* _.isArrayLike(document.body.children);
* // => true
*
* _.isArrayLike('abc');
* // => true
*
* _.isArrayLike(_.noop);
* // => false
*/
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
/**
* Checks if `value` is a buffer.
*
* @static
* @memberOf _
* @since 4.3.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
* @example
*
* _.isBuffer(new Buffer(2));
* // => true
*
* _.isBuffer(new Uint8Array(2));
* // => false
*/
var isBuffer = nativeIsBuffer || stubFalse;
/**
* Performs a deep comparison between two values to determine if they are
* equivalent.
*
* **Note:** This method supports comparing arrays, array buffers, booleans,
* date objects, error objects, maps, numbers, `Object` objects, regexes,
* sets, strings, symbols, and typed arrays. `Object` objects are compared
* by their own, not inherited, enumerable properties. Functions and DOM
* nodes are compared by strict equality, i.e. `===`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
* @example
*
* var object = { 'a': 1 };
* var other = { 'a': 1 };
*
* _.isEqual(object, other);
* // => true
*
* object === other;
* // => false
*/
function isEqual(value, other) {
return baseIsEqual(value, other);
}
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
if (!isObject(value)) {
return false;
}
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 9 which returns 'object' for typed arrays and other constructors.
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This method is loosely based on
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
* @example
*
* _.isLength(3);
* // => true
*
* _.isLength(Number.MIN_VALUE);
* // => false
*
* _.isLength(Infinity);
* // => false
*
* _.isLength('3');
* // => false
*/
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return value != null && (type == 'object' || type == 'function');
}
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
/**
* Checks if `value` is classified as a typed array.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
* @example
*
* _.isTypedArray(new Uint8Array);
* // => true
*
* _.isTypedArray([]);
* // => false
*/
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
* for more details.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
function keys(object) {
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
}
/**
* This method returns a new empty array.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {Array} Returns the new empty array.
* @example
*
* var arrays = _.times(2, _.stubArray);
*
* console.log(arrays);
* // => [[], []]
*
* console.log(arrays[0] === arrays[1]);
* // => false
*/
function stubArray() {
return [];
}
/**
* This method returns `false`.
*
* @static
* @memberOf _
* @since 4.13.0
* @category Util
* @returns {boolean} Returns `false`.
* @example
*
* _.times(2, _.stubFalse);
* // => [false, false]
*/
function stubFalse() {
return false;
}
module.exports = isEqual;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(210)(module)))
/***/ }),
/* 210 */
/***/ (function(module, exports) {
module.exports = function(module) {
if(!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
module.children = [];
module.webpackPolyfill = 1;
}
return module;
}
/***/ }),
/* 211 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _beeIcon = __webpack_require__(125);
var _beeIcon2 = _interopRequireDefault(_beeIcon);
var _beeDatepicker = __webpack_require__(212);
var _beeDatepicker2 = _interopRequireDefault(_beeDatepicker);
var _moment = __webpack_require__(275);
var _moment2 = _interopRequireDefault(_moment);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var DateRender = function (_Component) {
_inherits(DateRender, _Component);
function DateRender() {
var _temp, _this, _ret;
_classCallCheck(this, DateRender);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = {
value: _this.props.value,
editable: false
}, _this.handleChange = function (e) {
var _ref = _this.props || "YYYY-MM-DD",
format = _ref.format;
var value = e ? e.format(format) : "";
_this.setState({ value: value, editable: false });
if (_this.props.onChange) {
_this.props.onChange(value);
}
}, _this.check = function () {
_this.setState({ editable: false });
if (_this.props.onChange) {
_this.props.onChange(_this.state.value);
}
}, _this.edit = function () {
_this.setState({ editable: true });
}, _this.handleKeydown = function (event) {
if (event.keyCode == 13) {
_this.check();
}
}, _temp), _possibleConstructorReturn(_this, _ret);
}
DateRender.prototype.render = function render() {
var _state = this.state,
value = _state.value,
editable = _state.editable;
var isclickTrigger = this.props.isclickTrigger;
var cellContent = "";
var date_value = value ? (0, _moment2["default"])(value) : value;
if (editable) {
cellContent = isclickTrigger ? _react2["default"].createElement(
"div",
{ className: "editable-cell-input-wrapper" },
_react2["default"].createElement(_beeDatepicker2["default"], _extends({}, this.props, {
value: date_value,
onChange: this.handleChange
})),
_react2["default"].createElement(_beeIcon2["default"], {
type: "uf-correct",
className: "editable-cell-icon-check",
onClick: this.check
})
) : _react2["default"].createElement(
"div",
{ className: "editable-cell-input-wrapper" },
_react2["default"].createElement(_beeDatepicker2["default"], _extends({}, this.props, {
value: date_value,
onChange: this.handleChange
})),
_react2["default"].createElement(_beeIcon2["default"], {
type: "uf-correct",
className: "editable-cell-icon-check",
onClick: this.check
})
);
} else {
cellContent = isclickTrigger ? _react2["default"].createElement(
"div",
{ className: "editable-cell-text-wrapper", onClick: this.edit },
value || " "
) : _react2["default"].createElement(
"div",
{ className: "editable-cell-text-wrapper" },
value || " ",
_react2["default"].createElement(_beeIcon2["default"], {
type: "uf-pencil",
className: "editable-cell-icon",
onClick: this.edit
})
);
}
return _react2["default"].createElement(
"div",
{ className: "editable-cell" },
cellContent
);
};
return DateRender;
}(_react.Component);
exports["default"] = DateRender;
module.exports = exports["default"];
/***/ }),
/* 212 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _DatePicker = __webpack_require__(213);
var _DatePicker2 = _interopRequireDefault(_DatePicker);
var _MonthPicker = __webpack_require__(439);
var _MonthPicker2 = _interopRequireDefault(_MonthPicker);
var _RangePicker = __webpack_require__(441);
var _RangePicker2 = _interopRequireDefault(_RangePicker);
var _WeekPicker = __webpack_require__(462);
var _WeekPicker2 = _interopRequireDefault(_WeekPicker);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
_DatePicker2["default"].MonthPicker = _MonthPicker2["default"];
_DatePicker2["default"].RangePicker = _RangePicker2["default"];
_DatePicker2["default"].WeekPicker = _WeekPicker2["default"];
exports["default"] = _DatePicker2["default"];
module.exports = exports['default'];
/***/ }),
/* 213 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _rcCalendar = __webpack_require__(214);
var _rcCalendar2 = _interopRequireDefault(_rcCalendar);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _Picker = __webpack_require__(413);
var _Picker2 = _interopRequireDefault(_Picker);
var _beeFormControl = __webpack_require__(164);
var _beeFormControl2 = _interopRequireDefault(_beeFormControl);
var _Panel = __webpack_require__(435);
var _Panel2 = _interopRequireDefault(_Panel);
var _moment = __webpack_require__(275);
var _moment2 = _interopRequireDefault(_moment);
var _beeIcon = __webpack_require__(125);
var _beeIcon2 = _interopRequireDefault(_beeIcon);
var _beeInputGroup = __webpack_require__(204);
var _beeInputGroup2 = _interopRequireDefault(_beeInputGroup);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
* Created by chief on 17/4/6.
*/
var timePickerElement = _react2["default"].createElement(_Panel2["default"], { defaultValue: (0, _moment2["default"])("00:00:00", "HH:mm:ss") });
var DatePicker = function (_Component) {
_inherits(DatePicker, _Component);
function DatePicker(props, context) {
_classCallCheck(this, DatePicker);
var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
_initialiseProps.call(_this);
_this.state = {
type: "month",
value: props.value || props.defaultValue,
open: false
};
return _this;
}
DatePicker.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if ("value" in nextProps) {
this.setState({
value: nextProps.value
});
}
};
DatePicker.prototype.render = function render() {
var _this2 = this;
var state = this.state;
var props = this.props;
var value = state.value;
var pickerChangeHandler = {};
var calendarHandler = {};
if (props.showTime) {
calendarHandler = {
// fix https://github.com/ant-design/ant-design/issues/1902
onSelect: this.handleChange
};
} else {
pickerChangeHandler = {
onChange: this.handleChange
};
}
var calendar = _react2["default"].createElement(_rcCalendar2["default"], _extends({
timePicker: props.showTime ? timePickerElement : null
}, props));
return _react2["default"].createElement(
"div",
null,
_react2["default"].createElement(
_Picker2["default"],
_extends({}, props, pickerChangeHandler, {
onOpenChange: this.onOpenChange,
animation: "slide-up",
calendar: calendar,
open: this.state.open,
defaultValue: state.value,
onChange: this.onChange
}),
function () {
return _react2["default"].createElement(
_beeInputGroup2["default"],
{ simple: true, className: "datepicker-input-group" },
_react2["default"].createElement(_beeFormControl2["default"], {
disabled: props.disabled,
readOnly: true,
placeholder: _this2.props.placeholder,
className: _this2.props.className,
value: value && value.format(props.format) || ""
}),
_react2["default"].createElement(
_beeInputGroup2["default"].Button,
{ shape: "border" },
props.renderIcon()
)
);
}
)
);
};
return DatePicker;
}(_react.Component);
var _initialiseProps = function _initialiseProps() {
var _this3 = this;
this.onChange = function (value) {
var props = _this3.props;
// // if (!('value' in props)) {
// // this.setState({ value });
// // }
_this3.setState({
value: value
});
props.onChange(value, value && value.format(props.format) || "");
};
this.onOpenChange = function (open) {
_this3.setState({
open: open
});
};
this.handleChange = function (value) {
var props = _this3.props;
if (!("value" in props)) {
_this3.setState({ value: value });
}
props.onChange(value, value && value.format(props.format) || "");
};
};
DatePicker.defaultProps = {
renderIcon: function renderIcon() {
return _react2["default"].createElement(_beeIcon2["default"], { type: "uf-calendar" });
}
};
exports["default"] = DatePicker;
module.exports = exports["default"];
/***/ }),
/* 214 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Calendar = __webpack_require__(215);
var _Calendar2 = _interopRequireDefault(_Calendar);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
exports['default'] = _Calendar2['default'];
module.exports = exports['default'];
/***/ }),
/* 215 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = __webpack_require__(216);
var _extends3 = _interopRequireDefault(_extends2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _createReactClass = __webpack_require__(85);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _KeyCode = __webpack_require__(223);
var _KeyCode2 = _interopRequireDefault(_KeyCode);
var _DateTable = __webpack_require__(224);
var _DateTable2 = _interopRequireDefault(_DateTable);
var _CalendarHeader = __webpack_require__(399);
var _CalendarHeader2 = _interopRequireDefault(_CalendarHeader);
var _CalendarFooter = __webpack_require__(405);
var _CalendarFooter2 = _interopRequireDefault(_CalendarFooter);
var _CalendarMixin = __webpack_require__(409);
var _CalendarMixin2 = _interopRequireDefault(_CalendarMixin);
var _CommonMixin = __webpack_require__(410);
var _CommonMixin2 = _interopRequireDefault(_CommonMixin);
var _DateInput = __webpack_require__(412);
var _DateInput2 = _interopRequireDefault(_DateInput);
var _util = __webpack_require__(398);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function noop() {}
function goStartMonth() {
var next = this.state.value.clone();
next.startOf('month');
this.setValue(next);
}
function goEndMonth() {
var next = this.state.value.clone();
next.endOf('month');
this.setValue(next);
}
function goTime(direction, unit) {
var next = this.state.value.clone();
next.add(direction, unit);
this.setValue(next);
}
function goMonth(direction) {
return goTime.call(this, direction, 'months');
}
function goYear(direction) {
return goTime.call(this, direction, 'years');
}
function goWeek(direction) {
return goTime.call(this, direction, 'weeks');
}
function goDay(direction) {
return goTime.call(this, direction, 'days');
}
var Calendar = (0, _createReactClass2['default'])({
displayName: 'Calendar',
propTypes: {
disabledDate: _propTypes2['default'].func,
disabledTime: _propTypes2['default'].any,
value: _propTypes2['default'].object,
selectedValue: _propTypes2['default'].object,
defaultValue: _propTypes2['default'].object,
className: _propTypes2['default'].string,
locale: _propTypes2['default'].object,
showWeekNumber: _propTypes2['default'].bool,
style: _propTypes2['default'].object,
showToday: _propTypes2['default'].bool,
showDateInput: _propTypes2['default'].bool,
visible: _propTypes2['default'].bool,
onSelect: _propTypes2['default'].func,
onOk: _propTypes2['default'].func,
showOk: _propTypes2['default'].bool,
prefixCls: _propTypes2['default'].string,
onKeyDown: _propTypes2['default'].func,
timePicker: _propTypes2['default'].element,
dateInputPlaceholder: _propTypes2['default'].any,
onClear: _propTypes2['default'].func,
onChange: _propTypes2['default'].func,
renderFooter: _propTypes2['default'].func,
renderSidebar: _propTypes2['default'].func
},
mixins: [_CommonMixin2['default'], _CalendarMixin2['default']],
getDefaultProps: function getDefaultProps() {
return {
showToday: true,
showDateInput: true,
timePicker: null,
onOk: noop
};
},
getInitialState: function getInitialState() {
return {
showTimePicker: false
};
},
onKeyDown: function onKeyDown(event) {
if (event.target.nodeName.toLowerCase() === 'input') {
return undefined;
}
var keyCode = event.keyCode;
// mac
var ctrlKey = event.ctrlKey || event.metaKey;
var disabledDate = this.props.disabledDate;
var value = this.state.value;
switch (keyCode) {
case _KeyCode2['default'].DOWN:
goWeek.call(this, 1);
event.preventDefault();
return 1;
case _KeyCode2['default'].UP:
goWeek.call(this, -1);
event.preventDefault();
return 1;
case _KeyCode2['default'].LEFT:
if (ctrlKey) {
goYear.call(this, -1);
} else {
goDay.call(this, -1);
}
event.preventDefault();
return 1;
case _KeyCode2['default'].RIGHT:
if (ctrlKey) {
goYear.call(this, 1);
} else {
goDay.call(this, 1);
}
event.preventDefault();
return 1;
case _KeyCode2['default'].HOME:
goStartMonth.call(this);
event.preventDefault();
return 1;
case _KeyCode2['default'].END:
goEndMonth.call(this);
event.preventDefault();
return 1;
case _KeyCode2['default'].PAGE_DOWN:
goMonth.call(this, 1);
event.preventDefault();
return 1;
case _KeyCode2['default'].PAGE_UP:
goMonth.call(this, -1);
event.preventDefault();
return 1;
case _KeyCode2['default'].ENTER:
if (!disabledDate || !disabledDate(value)) {
this.onSelect(value, {
source: 'keyboard'
});
}
event.preventDefault();
return 1;
default:
this.props.onKeyDown(event);
return 1;
}
},
onClear: function onClear() {
this.onSelect(null);
this.props.onClear();
},
onOk: function onOk() {
var selectedValue = this.state.selectedValue;
if (this.isAllowedDate(selectedValue)) {
this.props.onOk(selectedValue);
}
},
onDateInputChange: function onDateInputChange(value) {
this.onSelect(value, {
source: 'dateInput'
});
},
onDateTableSelect: function onDateTableSelect(value) {
var timePicker = this.props.timePicker;
var selectedValue = this.state.selectedValue;
if (!selectedValue && timePicker) {
var timePickerDefaultValue = timePicker.props.defaultValue;
if (timePickerDefaultValue) {
(0, _util.syncTime)(timePickerDefaultValue, value);
}
}
this.onSelect(value);
},
onToday: function onToday() {
var value = this.state.value;
var now = (0, _util.getTodayTime)(value);
this.onSelect(now, {
source: 'todayButton'
});
},
getRootDOMNode: function getRootDOMNode() {
return _reactDom2['default'].findDOMNode(this);
},
openTimePicker: function openTimePicker() {
this.setState({
showTimePicker: true
});
},
closeTimePicker: function closeTimePicker() {
this.setState({
showTimePicker: false
});
},
render: function render() {
var props = this.props;
var locale = props.locale,
prefixCls = props.prefixCls,
disabledDate = props.disabledDate,
dateInputPlaceholder = props.dateInputPlaceholder,
timePicker = props.timePicker,
disabledTime = props.disabledTime;
var state = this.state;
var value = state.value,
selectedValue = state.selectedValue,
showTimePicker = state.showTimePicker;
var disabledTimeConfig = showTimePicker && disabledTime && timePicker ? (0, _util.getTimeConfig)(selectedValue, disabledTime) : null;
var timePickerEle = timePicker && showTimePicker ? _react2['default'].cloneElement(timePicker, (0, _extends3['default'])({
showHour: true,
showSecond: true,
showMinute: true
}, timePicker.props, disabledTimeConfig, {
onChange: this.onDateInputChange,
defaultOpenValue: timePicker.props.defaultValue,
value: selectedValue,
disabledTime: disabledTime
})) : null;
var dateInputElement = props.showDateInput ? _react2['default'].createElement(_DateInput2['default'], {
ref: 'dateInput',
format: this.getFormat(),
key: 'date-input',
value: value,
locale: locale,
placeholder: dateInputPlaceholder,
showClear: true,
disabledTime: disabledTime,
disabledDate: disabledDate,
onClear: this.onClear,
prefixCls: prefixCls,
selectedValue: selectedValue,
onChange: this.onDateInputChange
}) : null;
var children = [props.renderSidebar(), _react2['default'].createElement(
'div',
{ className: prefixCls + '-panel', key: 'panel' },
dateInputElement,
_react2['default'].createElement(
'div',
{ className: prefixCls + '-date-panel' },
_react2['default'].createElement(_CalendarHeader2['default'], {
locale: locale,
onValueChange: this.setValue,
value: value,
showTimePicker: showTimePicker,
prefixCls: prefixCls
}),
timePicker && showTimePicker ? _react2['default'].createElement(
'div',
{ className: prefixCls + '-time-picker' },
_react2['default'].createElement(
'div',
{ className: prefixCls + '-time-picker-panel' },
timePickerEle
)
) : null,
_react2['default'].createElement(
'div',
{ className: prefixCls + '-body' },
_react2['default'].createElement(_DateTable2['default'], {
locale: locale,
value: value,
selectedValue: selectedValue,
prefixCls: prefixCls,
dateRender: props.dateRender,
onSelect: this.onDateTableSelect,
disabledDate: disabledDate,
showWeekNumber: props.showWeekNumber
})
),
_react2['default'].createElement(_CalendarFooter2['default'], {
showOk: props.showOk,
renderFooter: props.renderFooter,
locale: locale,
prefixCls: prefixCls,
showToday: props.showToday,
disabledTime: disabledTime,
showTimePicker: showTimePicker,
showDateInput: props.showDateInput,
timePicker: timePicker,
selectedValue: selectedValue,
value: value,
disabledDate: disabledDate,
okDisabled: !this.isAllowedDate(selectedValue),
onOk: this.onOk,
onSelect: this.onSelect,
onToday: this.onToday,
onOpenTimePicker: this.openTimePicker,
onCloseTimePicker: this.closeTimePicker
})
)
)];
return this.renderRoot({
children: children,
className: props.showWeekNumber ? prefixCls + '-week-number' : ''
});
}
});
exports['default'] = Calendar;
module.exports = exports['default'];
/***/ }),
/* 216 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _assign = __webpack_require__(217);
var _assign2 = _interopRequireDefault(_assign);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _assign2.default || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
/***/ }),
/* 217 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(218), __esModule: true };
/***/ }),
/* 218 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(219);
module.exports = __webpack_require__(41).Object.assign;
/***/ }),
/* 219 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.1 Object.assign(target, source)
var $export = __webpack_require__(39);
$export($export.S + $export.F, 'Object', { assign: __webpack_require__(220) });
/***/ }),
/* 220 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// 19.1.2.1 Object.assign(target, source, ...)
var getKeys = __webpack_require__(55);
var gOPS = __webpack_require__(221);
var pIE = __webpack_require__(70);
var toObject = __webpack_require__(222);
var IObject = __webpack_require__(59);
var $assign = Object.assign;
// should work with symbols and should have deterministic property order (V8 bug)
module.exports = !$assign || __webpack_require__(50)(function () {
var A = {};
var B = {};
// eslint-disable-next-line no-undef
var S = Symbol();
var K = 'abcdefghijklmnopqrst';
A[S] = 7;
K.split('').forEach(function (k) { B[k] = k; });
return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
var T = toObject(target);
var aLen = arguments.length;
var index = 1;
var getSymbols = gOPS.f;
var isEnum = pIE.f;
while (aLen > index) {
var S = IObject(arguments[index++]);
var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
var length = keys.length;
var j = 0;
var key;
while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
} return T;
} : $assign;
/***/ }),
/* 221 */
/***/ (function(module, exports) {
exports.f = Object.getOwnPropertySymbols;
/***/ }),
/* 222 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.13 ToObject(argument)
var defined = __webpack_require__(61);
module.exports = function (it) {
return Object(defined(it));
};
/***/ }),
/* 223 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* @ignore
* some key-codes definition and utils from closure-library
* @author yiminghe@gmail.com
*/
var KeyCode = {
/**
* MAC_ENTER
*/
MAC_ENTER: 3,
/**
* BACKSPACE
*/
BACKSPACE: 8,
/**
* TAB
*/
TAB: 9,
/**
* NUMLOCK on FF/Safari Mac
*/
NUM_CENTER: 12, // NUMLOCK on FF/Safari Mac
/**
* ENTER
*/
ENTER: 13,
/**
* SHIFT
*/
SHIFT: 16,
/**
* CTRL
*/
CTRL: 17,
/**
* ALT
*/
ALT: 18,
/**
* PAUSE
*/
PAUSE: 19,
/**
* CAPS_LOCK
*/
CAPS_LOCK: 20,
/**
* ESC
*/
ESC: 27,
/**
* SPACE
*/
SPACE: 32,
/**
* PAGE_UP
*/
PAGE_UP: 33, // also NUM_NORTH_EAST
/**
* PAGE_DOWN
*/
PAGE_DOWN: 34, // also NUM_SOUTH_EAST
/**
* END
*/
END: 35, // also NUM_SOUTH_WEST
/**
* HOME
*/
HOME: 36, // also NUM_NORTH_WEST
/**
* LEFT
*/
LEFT: 37, // also NUM_WEST
/**
* UP
*/
UP: 38, // also NUM_NORTH
/**
* RIGHT
*/
RIGHT: 39, // also NUM_EAST
/**
* DOWN
*/
DOWN: 40, // also NUM_SOUTH
/**
* PRINT_SCREEN
*/
PRINT_SCREEN: 44,
/**
* INSERT
*/
INSERT: 45, // also NUM_INSERT
/**
* DELETE
*/
DELETE: 46, // also NUM_DELETE
/**
* ZERO
*/
ZERO: 48,
/**
* ONE
*/
ONE: 49,
/**
* TWO
*/
TWO: 50,
/**
* THREE
*/
THREE: 51,
/**
* FOUR
*/
FOUR: 52,
/**
* FIVE
*/
FIVE: 53,
/**
* SIX
*/
SIX: 54,
/**
* SEVEN
*/
SEVEN: 55,
/**
* EIGHT
*/
EIGHT: 56,
/**
* NINE
*/
NINE: 57,
/**
* QUESTION_MARK
*/
QUESTION_MARK: 63, // needs localization
/**
* A
*/
A: 65,
/**
* B
*/
B: 66,
/**
* C
*/
C: 67,
/**
* D
*/
D: 68,
/**
* E
*/
E: 69,
/**
* F
*/
F: 70,
/**
* G
*/
G: 71,
/**
* H
*/
H: 72,
/**
* I
*/
I: 73,
/**
* J
*/
J: 74,
/**
* K
*/
K: 75,
/**
* L
*/
L: 76,
/**
* M
*/
M: 77,
/**
* N
*/
N: 78,
/**
* O
*/
O: 79,
/**
* P
*/
P: 80,
/**
* Q
*/
Q: 81,
/**
* R
*/
R: 82,
/**
* S
*/
S: 83,
/**
* T
*/
T: 84,
/**
* U
*/
U: 85,
/**
* V
*/
V: 86,
/**
* W
*/
W: 87,
/**
* X
*/
X: 88,
/**
* Y
*/
Y: 89,
/**
* Z
*/
Z: 90,
/**
* META
*/
META: 91, // WIN_KEY_LEFT
/**
* WIN_KEY_RIGHT
*/
WIN_KEY_RIGHT: 92,
/**
* CONTEXT_MENU
*/
CONTEXT_MENU: 93,
/**
* NUM_ZERO
*/
NUM_ZERO: 96,
/**
* NUM_ONE
*/
NUM_ONE: 97,
/**
* NUM_TWO
*/
NUM_TWO: 98,
/**
* NUM_THREE
*/
NUM_THREE: 99,
/**
* NUM_FOUR
*/
NUM_FOUR: 100,
/**
* NUM_FIVE
*/
NUM_FIVE: 101,
/**
* NUM_SIX
*/
NUM_SIX: 102,
/**
* NUM_SEVEN
*/
NUM_SEVEN: 103,
/**
* NUM_EIGHT
*/
NUM_EIGHT: 104,
/**
* NUM_NINE
*/
NUM_NINE: 105,
/**
* NUM_MULTIPLY
*/
NUM_MULTIPLY: 106,
/**
* NUM_PLUS
*/
NUM_PLUS: 107,
/**
* NUM_MINUS
*/
NUM_MINUS: 109,
/**
* NUM_PERIOD
*/
NUM_PERIOD: 110,
/**
* NUM_DIVISION
*/
NUM_DIVISION: 111,
/**
* F1
*/
F1: 112,
/**
* F2
*/
F2: 113,
/**
* F3
*/
F3: 114,
/**
* F4
*/
F4: 115,
/**
* F5
*/
F5: 116,
/**
* F6
*/
F6: 117,
/**
* F7
*/
F7: 118,
/**
* F8
*/
F8: 119,
/**
* F9
*/
F9: 120,
/**
* F10
*/
F10: 121,
/**
* F11
*/
F11: 122,
/**
* F12
*/
F12: 123,
/**
* NUMLOCK
*/
NUMLOCK: 144,
/**
* SEMICOLON
*/
SEMICOLON: 186, // needs localization
/**
* DASH
*/
DASH: 189, // needs localization
/**
* EQUALS
*/
EQUALS: 187, // needs localization
/**
* COMMA
*/
COMMA: 188, // needs localization
/**
* PERIOD
*/
PERIOD: 190, // needs localization
/**
* SLASH
*/
SLASH: 191, // needs localization
/**
* APOSTROPHE
*/
APOSTROPHE: 192, // needs localization
/**
* SINGLE_QUOTE
*/
SINGLE_QUOTE: 222, // needs localization
/**
* OPEN_SQUARE_BRACKET
*/
OPEN_SQUARE_BRACKET: 219, // needs localization
/**
* BACKSLASH
*/
BACKSLASH: 220, // needs localization
/**
* CLOSE_SQUARE_BRACKET
*/
CLOSE_SQUARE_BRACKET: 221, // needs localization
/**
* WIN_KEY
*/
WIN_KEY: 224,
/**
* MAC_FF_META
*/
MAC_FF_META: 224, // Firefox (Gecko) fires this for the meta key instead of 91
/**
* WIN_IME
*/
WIN_IME: 229
};
/*
whether text and modified key is entered at the same time.
*/
KeyCode.isTextModifyingKeyEvent = function isTextModifyingKeyEvent(e) {
var keyCode = e.keyCode;
if (e.altKey && !e.ctrlKey || e.metaKey ||
// Function keys don't generate text
keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) {
return false;
}
// The following keys are quite harmless, even in combination with
// CTRL, ALT or SHIFT.
switch (keyCode) {
case KeyCode.ALT:
case KeyCode.CAPS_LOCK:
case KeyCode.CONTEXT_MENU:
case KeyCode.CTRL:
case KeyCode.DOWN:
case KeyCode.END:
case KeyCode.ESC:
case KeyCode.HOME:
case KeyCode.INSERT:
case KeyCode.LEFT:
case KeyCode.MAC_FF_META:
case KeyCode.META:
case KeyCode.NUMLOCK:
case KeyCode.NUM_CENTER:
case KeyCode.PAGE_DOWN:
case KeyCode.PAGE_UP:
case KeyCode.PAUSE:
case KeyCode.PRINT_SCREEN:
case KeyCode.RIGHT:
case KeyCode.SHIFT:
case KeyCode.UP:
case KeyCode.WIN_KEY:
case KeyCode.WIN_KEY_RIGHT:
return false;
default:
return true;
}
};
/*
whether character is entered.
*/
KeyCode.isCharacterKey = function isCharacterKey(keyCode) {
if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) {
return true;
}
if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) {
return true;
}
if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) {
return true;
}
// Safari sends zero key code for non-latin characters.
if (window.navigation.userAgent.indexOf('WebKit') !== -1 && keyCode === 0) {
return true;
}
switch (keyCode) {
case KeyCode.SPACE:
case KeyCode.QUESTION_MARK:
case KeyCode.NUM_PLUS:
case KeyCode.NUM_MINUS:
case KeyCode.NUM_PERIOD:
case KeyCode.NUM_DIVISION:
case KeyCode.SEMICOLON:
case KeyCode.DASH:
case KeyCode.EQUALS:
case KeyCode.COMMA:
case KeyCode.PERIOD:
case KeyCode.SLASH:
case KeyCode.APOSTROPHE:
case KeyCode.SINGLE_QUOTE:
case KeyCode.OPEN_SQUARE_BRACKET:
case KeyCode.BACKSLASH:
case KeyCode.CLOSE_SQUARE_BRACKET:
return true;
default:
return false;
}
};
exports['default'] = KeyCode;
module.exports = exports['default'];
/***/ }),
/* 224 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(226);
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _DateTHead = __webpack_require__(273);
var _DateTHead2 = _interopRequireDefault(_DateTHead);
var _DateTBody = __webpack_require__(396);
var _DateTBody2 = _interopRequireDefault(_DateTBody);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var DateTable = function (_React$Component) {
(0, _inherits3['default'])(DateTable, _React$Component);
function DateTable() {
(0, _classCallCheck3['default'])(this, DateTable);
return (0, _possibleConstructorReturn3['default'])(this, (DateTable.__proto__ || Object.getPrototypeOf(DateTable)).apply(this, arguments));
}
(0, _createClass3['default'])(DateTable, [{
key: 'render',
value: function render() {
var props = this.props;
var prefixCls = props.prefixCls;
return _react2['default'].createElement(
'table',
{ className: prefixCls + '-table', cellSpacing: '0', role: 'grid' },
_react2['default'].createElement(_DateTHead2['default'], props),
_react2['default'].createElement(_DateTBody2['default'], props)
);
}
}]);
return DateTable;
}(_react2['default'].Component);
exports['default'] = DateTable;
module.exports = exports['default'];
/***/ }),
/* 225 */
/***/ (function(module, exports) {
"use strict";
exports.__esModule = true;
exports.default = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
/***/ }),
/* 226 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _defineProperty = __webpack_require__(227);
var _defineProperty2 = _interopRequireDefault(_defineProperty);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
(0, _defineProperty2.default)(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
/***/ }),
/* 227 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(228), __esModule: true };
/***/ }),
/* 228 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(229);
var $Object = __webpack_require__(41).Object;
module.exports = function defineProperty(it, key, desc) {
return $Object.defineProperty(it, key, desc);
};
/***/ }),
/* 229 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(39);
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
$export($export.S + $export.F * !__webpack_require__(49), 'Object', { defineProperty: __webpack_require__(45).f });
/***/ }),
/* 230 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _typeof2 = __webpack_require__(231);
var _typeof3 = _interopRequireDefault(_typeof2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
};
/***/ }),
/* 231 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _iterator = __webpack_require__(232);
var _iterator2 = _interopRequireDefault(_iterator);
var _symbol = __webpack_require__(252);
var _symbol2 = _interopRequireDefault(_symbol);
var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
return typeof obj === "undefined" ? "undefined" : _typeof(obj);
} : function (obj) {
return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
};
/***/ }),
/* 232 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(233), __esModule: true };
/***/ }),
/* 233 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(234);
__webpack_require__(247);
module.exports = __webpack_require__(251).f('iterator');
/***/ }),
/* 234 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $at = __webpack_require__(235)(true);
// 21.1.3.27 String.prototype[@@iterator]()
__webpack_require__(236)(String, 'String', function (iterated) {
this._t = String(iterated); // target
this._i = 0; // next index
// 21.1.5.2.1 %StringIteratorPrototype%.next()
}, function () {
var O = this._t;
var index = this._i;
var point;
if (index >= O.length) return { value: undefined, done: true };
point = $at(O, index);
this._i += point.length;
return { value: point, done: false };
});
/***/ }),
/* 235 */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(64);
var defined = __webpack_require__(61);
// true -> String#at
// false -> String#codePointAt
module.exports = function (TO_STRING) {
return function (that, pos) {
var s = String(defined(that));
var i = toInteger(pos);
var l = s.length;
var a, b;
if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
? TO_STRING ? s.charAt(i) : a
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
};
};
/***/ }),
/* 236 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var LIBRARY = __webpack_require__(237);
var $export = __webpack_require__(39);
var redefine = __webpack_require__(238);
var hide = __webpack_require__(44);
var has = __webpack_require__(57);
var Iterators = __webpack_require__(239);
var $iterCreate = __webpack_require__(240);
var setToStringTag = __webpack_require__(244);
var getPrototypeOf = __webpack_require__(246);
var ITERATOR = __webpack_require__(245)('iterator');
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
var FF_ITERATOR = '@@iterator';
var KEYS = 'keys';
var VALUES = 'values';
var returnThis = function () { return this; };
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
$iterCreate(Constructor, NAME, next);
var getMethod = function (kind) {
if (!BUGGY && kind in proto) return proto[kind];
switch (kind) {
case KEYS: return function keys() { return new Constructor(this, kind); };
case VALUES: return function values() { return new Constructor(this, kind); };
} return function entries() { return new Constructor(this, kind); };
};
var TAG = NAME + ' Iterator';
var DEF_VALUES = DEFAULT == VALUES;
var VALUES_BUG = false;
var proto = Base.prototype;
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
var $default = (!BUGGY && $native) || getMethod(DEFAULT);
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
var methods, key, IteratorPrototype;
// Fix native
if ($anyNative) {
IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
if (DEF_VALUES && $native && $native.name !== VALUES) {
VALUES_BUG = true;
$default = function values() { return $native.call(this); };
}
// Define iterator
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
hide(proto, ITERATOR, $default);
}
// Plug for library
Iterators[NAME] = $default;
Iterators[TAG] = returnThis;
if (DEFAULT) {
methods = {
values: DEF_VALUES ? $default : getMethod(VALUES),
keys: IS_SET ? $default : getMethod(KEYS),
entries: $entries
};
if (FORCED) for (key in methods) {
if (!(key in proto)) redefine(proto, key, methods[key]);
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
}
return methods;
};
/***/ }),
/* 237 */
/***/ (function(module, exports) {
module.exports = true;
/***/ }),
/* 238 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(44);
/***/ }),
/* 239 */
/***/ (function(module, exports) {
module.exports = {};
/***/ }),
/* 240 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var create = __webpack_require__(241);
var descriptor = __webpack_require__(53);
var setToStringTag = __webpack_require__(244);
var IteratorPrototype = {};
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
__webpack_require__(44)(IteratorPrototype, __webpack_require__(245)('iterator'), function () { return this; });
module.exports = function (Constructor, NAME, next) {
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
setToStringTag(Constructor, NAME + ' Iterator');
};
/***/ }),
/* 241 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__(46);
var dPs = __webpack_require__(242);
var enumBugKeys = __webpack_require__(69);
var IE_PROTO = __webpack_require__(66)('IE_PROTO');
var Empty = function () { /* empty */ };
var PROTOTYPE = 'prototype';
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function () {
// Thrash, waste and sodomy: IE GC bug
var iframe = __webpack_require__(51)('iframe');
var i = enumBugKeys.length;
var lt = '<';
var gt = '>';
var iframeDocument;
iframe.style.display = 'none';
__webpack_require__(243).appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
return createDict();
};
module.exports = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
Empty[PROTOTYPE] = anObject(O);
result = new Empty();
Empty[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : dPs(result, Properties);
};
/***/ }),
/* 242 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(45);
var anObject = __webpack_require__(46);
var getKeys = __webpack_require__(55);
module.exports = __webpack_require__(49) ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var keys = getKeys(Properties);
var length = keys.length;
var i = 0;
var P;
while (length > i) dP.f(O, P = keys[i++], Properties[P]);
return O;
};
/***/ }),
/* 243 */
/***/ (function(module, exports, __webpack_require__) {
var document = __webpack_require__(40).document;
module.exports = document && document.documentElement;
/***/ }),
/* 244 */
/***/ (function(module, exports, __webpack_require__) {
var def = __webpack_require__(45).f;
var has = __webpack_require__(57);
var TAG = __webpack_require__(245)('toStringTag');
module.exports = function (it, tag, stat) {
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
};
/***/ }),
/* 245 */
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__(67)('wks');
var uid = __webpack_require__(68);
var Symbol = __webpack_require__(40).Symbol;
var USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function (name) {
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ }),
/* 246 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = __webpack_require__(57);
var toObject = __webpack_require__(222);
var IE_PROTO = __webpack_require__(66)('IE_PROTO');
var ObjectProto = Object.prototype;
module.exports = Object.getPrototypeOf || function (O) {
O = toObject(O);
if (has(O, IE_PROTO)) return O[IE_PROTO];
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
return O.constructor.prototype;
} return O instanceof Object ? ObjectProto : null;
};
/***/ }),
/* 247 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(248);
var global = __webpack_require__(40);
var hide = __webpack_require__(44);
var Iterators = __webpack_require__(239);
var TO_STRING_TAG = __webpack_require__(245)('toStringTag');
var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
'TextTrackList,TouchList').split(',');
for (var i = 0; i < DOMIterables.length; i++) {
var NAME = DOMIterables[i];
var Collection = global[NAME];
var proto = Collection && Collection.prototype;
if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
Iterators[NAME] = Iterators.Array;
}
/***/ }),
/* 248 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var addToUnscopables = __webpack_require__(249);
var step = __webpack_require__(250);
var Iterators = __webpack_require__(239);
var toIObject = __webpack_require__(58);
// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
module.exports = __webpack_require__(236)(Array, 'Array', function (iterated, kind) {
this._t = toIObject(iterated); // target
this._i = 0; // next index
this._k = kind; // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function () {
var O = this._t;
var kind = this._k;
var index = this._i++;
if (!O || index >= O.length) {
this._t = undefined;
return step(1);
}
if (kind == 'keys') return step(0, index);
if (kind == 'values') return step(0, O[index]);
return step(0, [index, O[index]]);
}, 'values');
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators.Arguments = Iterators.Array;
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
/***/ }),
/* 249 */
/***/ (function(module, exports) {
module.exports = function () { /* empty */ };
/***/ }),
/* 250 */
/***/ (function(module, exports) {
module.exports = function (done, value) {
return { value: value, done: !!done };
};
/***/ }),
/* 251 */
/***/ (function(module, exports, __webpack_require__) {
exports.f = __webpack_require__(245);
/***/ }),
/* 252 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(253), __esModule: true };
/***/ }),
/* 253 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(254);
__webpack_require__(262);
__webpack_require__(263);
__webpack_require__(264);
module.exports = __webpack_require__(41).Symbol;
/***/ }),
/* 254 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// ECMAScript 6 symbols shim
var global = __webpack_require__(40);
var has = __webpack_require__(57);
var DESCRIPTORS = __webpack_require__(49);
var $export = __webpack_require__(39);
var redefine = __webpack_require__(238);
var META = __webpack_require__(255).KEY;
var $fails = __webpack_require__(50);
var shared = __webpack_require__(67);
var setToStringTag = __webpack_require__(244);
var uid = __webpack_require__(68);
var wks = __webpack_require__(245);
var wksExt = __webpack_require__(251);
var wksDefine = __webpack_require__(256);
var enumKeys = __webpack_require__(257);
var isArray = __webpack_require__(258);
var anObject = __webpack_require__(46);
var isObject = __webpack_require__(47);
var toIObject = __webpack_require__(58);
var toPrimitive = __webpack_require__(52);
var createDesc = __webpack_require__(53);
var _create = __webpack_require__(241);
var gOPNExt = __webpack_require__(259);
var $GOPD = __webpack_require__(261);
var $DP = __webpack_require__(45);
var $keys = __webpack_require__(55);
var gOPD = $GOPD.f;
var dP = $DP.f;
var gOPN = gOPNExt.f;
var $Symbol = global.Symbol;
var $JSON = global.JSON;
var _stringify = $JSON && $JSON.stringify;
var PROTOTYPE = 'prototype';
var HIDDEN = wks('_hidden');
var TO_PRIMITIVE = wks('toPrimitive');
var isEnum = {}.propertyIsEnumerable;
var SymbolRegistry = shared('symbol-registry');
var AllSymbols = shared('symbols');
var OPSymbols = shared('op-symbols');
var ObjectProto = Object[PROTOTYPE];
var USE_NATIVE = typeof $Symbol == 'function';
var QObject = global.QObject;
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
var setSymbolDesc = DESCRIPTORS && $fails(function () {
return _create(dP({}, 'a', {
get: function () { return dP(this, 'a', { value: 7 }).a; }
})).a != 7;
}) ? function (it, key, D) {
var protoDesc = gOPD(ObjectProto, key);
if (protoDesc) delete ObjectProto[key];
dP(it, key, D);
if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
} : dP;
var wrap = function (tag) {
var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
sym._k = tag;
return sym;
};
var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
return typeof it == 'symbol';
} : function (it) {
return it instanceof $Symbol;
};
var $defineProperty = function defineProperty(it, key, D) {
if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
anObject(it);
key = toPrimitive(key, true);
anObject(D);
if (has(AllSymbols, key)) {
if (!D.enumerable) {
if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
it[HIDDEN][key] = true;
} else {
if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
D = _create(D, { enumerable: createDesc(0, false) });
} return setSymbolDesc(it, key, D);
} return dP(it, key, D);
};
var $defineProperties = function defineProperties(it, P) {
anObject(it);
var keys = enumKeys(P = toIObject(P));
var i = 0;
var l = keys.length;
var key;
while (l > i) $defineProperty(it, key = keys[i++], P[key]);
return it;
};
var $create = function create(it, P) {
return P === undefined ? _create(it) : $defineProperties(_create(it), P);
};
var $propertyIsEnumerable = function propertyIsEnumerable(key) {
var E = isEnum.call(this, key = toPrimitive(key, true));
if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
};
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
it = toIObject(it);
key = toPrimitive(key, true);
if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
var D = gOPD(it, key);
if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
return D;
};
var $getOwnPropertyNames = function getOwnPropertyNames(it) {
var names = gOPN(toIObject(it));
var result = [];
var i = 0;
var key;
while (names.length > i) {
if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
} return result;
};
var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
var IS_OP = it === ObjectProto;
var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
var result = [];
var i = 0;
var key;
while (names.length > i) {
if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
} return result;
};
// 19.4.1.1 Symbol([description])
if (!USE_NATIVE) {
$Symbol = function Symbol() {
if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
var $set = function (value) {
if (this === ObjectProto) $set.call(OPSymbols, value);
if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
setSymbolDesc(this, tag, createDesc(1, value));
};
if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
return wrap(tag);
};
redefine($Symbol[PROTOTYPE], 'toString', function toString() {
return this._k;
});
$GOPD.f = $getOwnPropertyDescriptor;
$DP.f = $defineProperty;
__webpack_require__(260).f = gOPNExt.f = $getOwnPropertyNames;
__webpack_require__(70).f = $propertyIsEnumerable;
__webpack_require__(221).f = $getOwnPropertySymbols;
if (DESCRIPTORS && !__webpack_require__(237)) {
redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
}
wksExt.f = function (name) {
return wrap(wks(name));
};
}
$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
for (var es6Symbols = (
// 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
// 19.4.2.1 Symbol.for(key)
'for': function (key) {
return has(SymbolRegistry, key += '')
? SymbolRegistry[key]
: SymbolRegistry[key] = $Symbol(key);
},
// 19.4.2.5 Symbol.keyFor(sym)
keyFor: function keyFor(sym) {
if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
},
useSetter: function () { setter = true; },
useSimple: function () { setter = false; }
});
$export($export.S + $export.F * !USE_NATIVE, 'Object', {
// 19.1.2.2 Object.create(O [, Properties])
create: $create,
// 19.1.2.4 Object.defineProperty(O, P, Attributes)
defineProperty: $defineProperty,
// 19.1.2.3 Object.defineProperties(O, Properties)
defineProperties: $defineProperties,
// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
// 19.1.2.7 Object.getOwnPropertyNames(O)
getOwnPropertyNames: $getOwnPropertyNames,
// 19.1.2.8 Object.getOwnPropertySymbols(O)
getOwnPropertySymbols: $getOwnPropertySymbols
});
// 24.3.2 JSON.stringify(value [, replacer [, space]])
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
var S = $Symbol();
// MS Edge converts symbol values to JSON as {}
// WebKit converts symbol values to JSON as null
// V8 throws on boxed symbols
return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
})), 'JSON', {
stringify: function stringify(it) {
var args = [it];
var i = 1;
var replacer, $replacer;
while (arguments.length > i) args.push(arguments[i++]);
$replacer = replacer = args[1];
if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
if (!isArray(replacer)) replacer = function (key, value) {
if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
if (!isSymbol(value)) return value;
};
args[1] = replacer;
return _stringify.apply($JSON, args);
}
});
// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(44)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
// 19.4.3.5 Symbol.prototype[@@toStringTag]
setToStringTag($Symbol, 'Symbol');
// 20.2.1.9 Math[@@toStringTag]
setToStringTag(Math, 'Math', true);
// 24.3.3 JSON[@@toStringTag]
setToStringTag(global.JSON, 'JSON', true);
/***/ }),
/* 255 */
/***/ (function(module, exports, __webpack_require__) {
var META = __webpack_require__(68)('meta');
var isObject = __webpack_require__(47);
var has = __webpack_require__(57);
var setDesc = __webpack_require__(45).f;
var id = 0;
var isExtensible = Object.isExtensible || function () {
return true;
};
var FREEZE = !__webpack_require__(50)(function () {
return isExtensible(Object.preventExtensions({}));
});
var setMeta = function (it) {
setDesc(it, META, { value: {
i: 'O' + ++id, // object ID
w: {} // weak collections IDs
} });
};
var fastKey = function (it, create) {
// return primitive with prefix
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
if (!has(it, META)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return 'F';
// not necessary to add metadata
if (!create) return 'E';
// add missing metadata
setMeta(it);
// return object ID
} return it[META].i;
};
var getWeak = function (it, create) {
if (!has(it, META)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return true;
// not necessary to add metadata
if (!create) return false;
// add missing metadata
setMeta(it);
// return hash weak collections IDs
} return it[META].w;
};
// add metadata on freeze-family methods calling
var onFreeze = function (it) {
if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
return it;
};
var meta = module.exports = {
KEY: META,
NEED: false,
fastKey: fastKey,
getWeak: getWeak,
onFreeze: onFreeze
};
/***/ }),
/* 256 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(40);
var core = __webpack_require__(41);
var LIBRARY = __webpack_require__(237);
var wksExt = __webpack_require__(251);
var defineProperty = __webpack_require__(45).f;
module.exports = function (name) {
var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
};
/***/ }),
/* 257 */
/***/ (function(module, exports, __webpack_require__) {
// all enumerable object keys, includes symbols
var getKeys = __webpack_require__(55);
var gOPS = __webpack_require__(221);
var pIE = __webpack_require__(70);
module.exports = function (it) {
var result = getKeys(it);
var getSymbols = gOPS.f;
if (getSymbols) {
var symbols = getSymbols(it);
var isEnum = pIE.f;
var i = 0;
var key;
while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
} return result;
};
/***/ }),
/* 258 */
/***/ (function(module, exports, __webpack_require__) {
// 7.2.2 IsArray(argument)
var cof = __webpack_require__(60);
module.exports = Array.isArray || function isArray(arg) {
return cof(arg) == 'Array';
};
/***/ }),
/* 259 */
/***/ (function(module, exports, __webpack_require__) {
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
var toIObject = __webpack_require__(58);
var gOPN = __webpack_require__(260).f;
var toString = {}.toString;
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
? Object.getOwnPropertyNames(window) : [];
var getWindowNames = function (it) {
try {
return gOPN(it);
} catch (e) {
return windowNames.slice();
}
};
module.exports.f = function getOwnPropertyNames(it) {
return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
};
/***/ }),
/* 260 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
var $keys = __webpack_require__(56);
var hiddenKeys = __webpack_require__(69).concat('length', 'prototype');
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
return $keys(O, hiddenKeys);
};
/***/ }),
/* 261 */
/***/ (function(module, exports, __webpack_require__) {
var pIE = __webpack_require__(70);
var createDesc = __webpack_require__(53);
var toIObject = __webpack_require__(58);
var toPrimitive = __webpack_require__(52);
var has = __webpack_require__(57);
var IE8_DOM_DEFINE = __webpack_require__(48);
var gOPD = Object.getOwnPropertyDescriptor;
exports.f = __webpack_require__(49) ? gOPD : function getOwnPropertyDescriptor(O, P) {
O = toIObject(O);
P = toPrimitive(P, true);
if (IE8_DOM_DEFINE) try {
return gOPD(O, P);
} catch (e) { /* empty */ }
if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
};
/***/ }),
/* 262 */
/***/ (function(module, exports) {
/***/ }),
/* 263 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(256)('asyncIterator');
/***/ }),
/* 264 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(256)('observable');
/***/ }),
/* 265 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _setPrototypeOf = __webpack_require__(266);
var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
var _create = __webpack_require__(270);
var _create2 = _interopRequireDefault(_create);
var _typeof2 = __webpack_require__(231);
var _typeof3 = _interopRequireDefault(_typeof2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
}
subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
};
/***/ }),
/* 266 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(267), __esModule: true };
/***/ }),
/* 267 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(268);
module.exports = __webpack_require__(41).Object.setPrototypeOf;
/***/ }),
/* 268 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.3.19 Object.setPrototypeOf(O, proto)
var $export = __webpack_require__(39);
$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(269).set });
/***/ }),
/* 269 */
/***/ (function(module, exports, __webpack_require__) {
// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
var isObject = __webpack_require__(47);
var anObject = __webpack_require__(46);
var check = function (O, proto) {
anObject(O);
if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
};
module.exports = {
set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
function (test, buggy, set) {
try {
set = __webpack_require__(42)(Function.call, __webpack_require__(261).f(Object.prototype, '__proto__').set, 2);
set(test, []);
buggy = !(test instanceof Array);
} catch (e) { buggy = true; }
return function setPrototypeOf(O, proto) {
check(O, proto);
if (buggy) O.__proto__ = proto;
else set(O, proto);
return O;
};
}({}, false) : undefined),
check: check
};
/***/ }),
/* 270 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(271), __esModule: true };
/***/ }),
/* 271 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(272);
var $Object = __webpack_require__(41).Object;
module.exports = function create(P, D) {
return $Object.create(P, D);
};
/***/ }),
/* 272 */
/***/ (function(module, exports, __webpack_require__) {
var $export = __webpack_require__(39);
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
$export($export.S, 'Object', { create: __webpack_require__(241) });
/***/ }),
/* 273 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(226);
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _DateConstants = __webpack_require__(274);
var _DateConstants2 = _interopRequireDefault(_DateConstants);
var _moment = __webpack_require__(275);
var _moment2 = _interopRequireDefault(_moment);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var DateTHead = function (_React$Component) {
(0, _inherits3['default'])(DateTHead, _React$Component);
function DateTHead() {
(0, _classCallCheck3['default'])(this, DateTHead);
return (0, _possibleConstructorReturn3['default'])(this, (DateTHead.__proto__ || Object.getPrototypeOf(DateTHead)).apply(this, arguments));
}
(0, _createClass3['default'])(DateTHead, [{
key: 'render',
value: function render() {
var props = this.props;
var value = props.value;
var localeData = value.localeData();
var prefixCls = props.prefixCls;
var veryShortWeekdays = [];
var weekDays = [];
var firstDayOfWeek = localeData.firstDayOfWeek();
var showWeekNumberEl = void 0;
var now = (0, _moment2['default'])();
for (var dateColIndex = 0; dateColIndex < _DateConstants2['default'].DATE_COL_COUNT; dateColIndex++) {
var index = (firstDayOfWeek + dateColIndex) % _DateConstants2['default'].DATE_COL_COUNT;
now.day(index);
veryShortWeekdays[dateColIndex] = localeData.weekdaysMin(now);
weekDays[dateColIndex] = localeData.weekdaysShort(now);
}
if (props.showWeekNumber) {
showWeekNumberEl = _react2['default'].createElement(
'th',
{
role: 'columnheader',
className: prefixCls + '-column-header ' + prefixCls + '-week-number-header'
},
_react2['default'].createElement(
'span',
{ className: prefixCls + '-column-header-inner' },
'x'
)
);
}
var weekDaysEls = weekDays.map(function (day, xindex) {
return _react2['default'].createElement(
'th',
{
key: xindex,
role: 'columnheader',
title: day,
className: prefixCls + '-column-header'
},
_react2['default'].createElement(
'span',
{ className: prefixCls + '-column-header-inner' },
veryShortWeekdays[xindex]
)
);
});
return _react2['default'].createElement(
'thead',
null,
_react2['default'].createElement(
'tr',
{ role: 'row' },
showWeekNumberEl,
weekDaysEls
)
);
}
}]);
return DateTHead;
}(_react2['default'].Component);
exports['default'] = DateTHead;
module.exports = exports['default'];
/***/ }),
/* 274 */
/***/ (function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = {
DATE_ROW_COUNT: 6,
DATE_COL_COUNT: 7
};
module.exports = exports['default'];
/***/ }),
/* 275 */
/***/ (function(module, exports, __webpack_require__) {
var require;/* WEBPACK VAR INJECTION */(function(module) {//! moment.js
//! version : 2.20.1
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
;(function (global, factory) {
true ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.moment = factory()
}(this, (function () { 'use strict';
var hookCallback;
function hooks () {
return hookCallback.apply(null, arguments);
}
// This is done to register the method called with moment()
// without creating circular dependencies.
function setHookCallback (callback) {
hookCallback = callback;
}
function isArray(input) {
return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
}
function isObject(input) {
// IE8 will treat undefined and null as object if it wasn't for
// input != null
return input != null && Object.prototype.toString.call(input) === '[object Object]';
}
function isObjectEmpty(obj) {
if (Object.getOwnPropertyNames) {
return (Object.getOwnPropertyNames(obj).length === 0);
} else {
var k;
for (k in obj) {
if (obj.hasOwnProperty(k)) {
return false;
}
}
return true;
}
}
function isUndefined(input) {
return input === void 0;
}
function isNumber(input) {
return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
}
function isDate(input) {
return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
}
function map(arr, fn) {
var res = [], i;
for (i = 0; i < arr.length; ++i) {
res.push(fn(arr[i], i));
}
return res;
}
function hasOwnProp(a, b) {
return Object.prototype.hasOwnProperty.call(a, b);
}
function extend(a, b) {
for (var i in b) {
if (hasOwnProp(b, i)) {
a[i] = b[i];
}
}
if (hasOwnProp(b, 'toString')) {
a.toString = b.toString;
}
if (hasOwnProp(b, 'valueOf')) {
a.valueOf = b.valueOf;
}
return a;
}
function createUTC (input, format, locale, strict) {
return createLocalOrUTC(input, format, locale, strict, true).utc();
}
function defaultParsingFlags() {
// We need to deep clone this object.
return {
empty : false,
unusedTokens : [],
unusedInput : [],
overflow : -2,
charsLeftOver : 0,
nullInput : false,
invalidMonth : null,
invalidFormat : false,
userInvalidated : false,
iso : false,
parsedDateParts : [],
meridiem : null,
rfc2822 : false,
weekdayMismatch : false
};
}
function getParsingFlags(m) {
if (m._pf == null) {
m._pf = defaultParsingFlags();
}
return m._pf;
}
var some;
if (Array.prototype.some) {
some = Array.prototype.some;
} else {
some = function (fun) {
var t = Object(this);
var len = t.length >>> 0;
for (var i = 0; i < len; i++) {
if (i in t && fun.call(this, t[i], i, t)) {
return true;
}
}
return false;
};
}
function isValid(m) {
if (m._isValid == null) {
var flags = getParsingFlags(m);
var parsedParts = some.call(flags.parsedDateParts, function (i) {
return i != null;
});
var isNowValid = !isNaN(m._d.getTime()) &&
flags.overflow < 0 &&
!flags.empty &&
!flags.invalidMonth &&
!flags.invalidWeekday &&
!flags.weekdayMismatch &&
!flags.nullInput &&
!flags.invalidFormat &&
!flags.userInvalidated &&
(!flags.meridiem || (flags.meridiem && parsedParts));
if (m._strict) {
isNowValid = isNowValid &&
flags.charsLeftOver === 0 &&
flags.unusedTokens.length === 0 &&
flags.bigHour === undefined;
}
if (Object.isFrozen == null || !Object.isFrozen(m)) {
m._isValid = isNowValid;
}
else {
return isNowValid;
}
}
return m._isValid;
}
function createInvalid (flags) {
var m = createUTC(NaN);
if (flags != null) {
extend(getParsingFlags(m), flags);
}
else {
getParsingFlags(m).userInvalidated = true;
}
return m;
}
// Plugins that add properties should also add the key here (null value),
// so we can properly clone ourselves.
var momentProperties = hooks.momentProperties = [];
function copyConfig(to, from) {
var i, prop, val;
if (!isUndefined(from._isAMomentObject)) {
to._isAMomentObject = from._isAMomentObject;
}
if (!isUndefined(from._i)) {
to._i = from._i;
}
if (!isUndefined(from._f)) {
to._f = from._f;
}
if (!isUndefined(from._l)) {
to._l = from._l;
}
if (!isUndefined(from._strict)) {
to._strict = from._strict;
}
if (!isUndefined(from._tzm)) {
to._tzm = from._tzm;
}
if (!isUndefined(from._isUTC)) {
to._isUTC = from._isUTC;
}
if (!isUndefined(from._offset)) {
to._offset = from._offset;
}
if (!isUndefined(from._pf)) {
to._pf = getParsingFlags(from);
}
if (!isUndefined(from._locale)) {
to._locale = from._locale;
}
if (momentProperties.length > 0) {
for (i = 0; i < momentProperties.length; i++) {
prop = momentProperties[i];
val = from[prop];
if (!isUndefined(val)) {
to[prop] = val;
}
}
}
return to;
}
var updateInProgress = false;
// Moment prototype object
function Moment(config) {
copyConfig(this, config);
this._d = new Date(config._d != null ? config._d.getTime() : NaN);
if (!this.isValid()) {
this._d = new Date(NaN);
}
// Prevent infinite loop in case updateOffset creates new moment
// objects.
if (updateInProgress === false) {
updateInProgress = true;
hooks.updateOffset(this);
updateInProgress = false;
}
}
function isMoment (obj) {
return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
}
function absFloor (number) {
if (number < 0) {
// -0 -> 0
return Math.ceil(number) || 0;
} else {
return Math.floor(number);
}
}
function toInt(argumentForCoercion) {
var coercedNumber = +argumentForCoercion,
value = 0;
if (coercedNumber !== 0 && isFinite(coercedNumber)) {
value = absFloor(coercedNumber);
}
return value;
}
// compare two arrays, return the number of differences
function compareArrays(array1, array2, dontConvert) {
var len = Math.min(array1.length, array2.length),
lengthDiff = Math.abs(array1.length - array2.length),
diffs = 0,
i;
for (i = 0; i < len; i++) {
if ((dontConvert && array1[i] !== array2[i]) ||
(!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
diffs++;
}
}
return diffs + lengthDiff;
}
function warn(msg) {
if (hooks.suppressDeprecationWarnings === false &&
(typeof console !== 'undefined') && console.warn) {
console.warn('Deprecation warning: ' + msg);
}
}
function deprecate(msg, fn) {
var firstTime = true;
return extend(function () {
if (hooks.deprecationHandler != null) {
hooks.deprecationHandler(null, msg);
}
if (firstTime) {
var args = [];
var arg;
for (var i = 0; i < arguments.length; i++) {
arg = '';
if (typeof arguments[i] === 'object') {
arg += '\n[' + i + '] ';
for (var key in arguments[0]) {
arg += key + ': ' + arguments[0][key] + ', ';
}
arg = arg.slice(0, -2); // Remove trailing comma and space
} else {
arg = arguments[i];
}
args.push(arg);
}
warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
firstTime = false;
}
return fn.apply(this, arguments);
}, fn);
}
var deprecations = {};
function deprecateSimple(name, msg) {
if (hooks.deprecationHandler != null) {
hooks.deprecationHandler(name, msg);
}
if (!deprecations[name]) {
warn(msg);
deprecations[name] = true;
}
}
hooks.suppressDeprecationWarnings = false;
hooks.deprecationHandler = null;
function isFunction(input) {
return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
}
function set (config) {
var prop, i;
for (i in config) {
prop = config[i];
if (isFunction(prop)) {
this[i] = prop;
} else {
this['_' + i] = prop;
}
}
this._config = config;
// Lenient ordinal parsing accepts just a number in addition to
// number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
// TODO: Remove "ordinalParse" fallback in next major release.
this._dayOfMonthOrdinalParseLenient = new RegExp(
(this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
'|' + (/\d{1,2}/).source);
}
function mergeConfigs(parentConfig, childConfig) {
var res = extend({}, parentConfig), prop;
for (prop in childConfig) {
if (hasOwnProp(childConfig, prop)) {
if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
res[prop] = {};
extend(res[prop], parentConfig[prop]);
extend(res[prop], childConfig[prop]);
} else if (childConfig[prop] != null) {
res[prop] = childConfig[prop];
} else {
delete res[prop];
}
}
}
for (prop in parentConfig) {
if (hasOwnProp(parentConfig, prop) &&
!hasOwnProp(childConfig, prop) &&
isObject(parentConfig[prop])) {
// make sure changes to properties don't modify parent config
res[prop] = extend({}, res[prop]);
}
}
return res;
}
function Locale(config) {
if (config != null) {
this.set(config);
}
}
var keys;
if (Object.keys) {
keys = Object.keys;
} else {
keys = function (obj) {
var i, res = [];
for (i in obj) {
if (hasOwnProp(obj, i)) {
res.push(i);
}
}
return res;
};
}
var defaultCalendar = {
sameDay : '[Today at] LT',
nextDay : '[Tomorrow at] LT',
nextWeek : 'dddd [at] LT',
lastDay : '[Yesterday at] LT',
lastWeek : '[Last] dddd [at] LT',
sameElse : 'L'
};
function calendar (key, mom, now) {
var output = this._calendar[key] || this._calendar['sameElse'];
return isFunction(output) ? output.call(mom, now) : output;
}
var defaultLongDateFormat = {
LTS : 'h:mm:ss A',
LT : 'h:mm A',
L : 'MM/DD/YYYY',
LL : 'MMMM D, YYYY',
LLL : 'MMMM D, YYYY h:mm A',
LLLL : 'dddd, MMMM D, YYYY h:mm A'
};
function longDateFormat (key) {
var format = this._longDateFormat[key],
formatUpper = this._longDateFormat[key.toUpperCase()];
if (format || !formatUpper) {
return format;
}
this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
return val.slice(1);
});
return this._longDateFormat[key];
}
var defaultInvalidDate = 'Invalid date';
function invalidDate () {
return this._invalidDate;
}
var defaultOrdinal = '%d';
var defaultDayOfMonthOrdinalParse = /\d{1,2}/;
function ordinal (number) {
return this._ordinal.replace('%d', number);
}
var defaultRelativeTime = {
future : 'in %s',
past : '%s ago',
s : 'a few seconds',
ss : '%d seconds',
m : 'a minute',
mm : '%d minutes',
h : 'an hour',
hh : '%d hours',
d : 'a day',
dd : '%d days',
M : 'a month',
MM : '%d months',
y : 'a year',
yy : '%d years'
};
function relativeTime (number, withoutSuffix, string, isFuture) {
var output = this._relativeTime[string];
return (isFunction(output)) ?
output(number, withoutSuffix, string, isFuture) :
output.replace(/%d/i, number);
}
function pastFuture (diff, output) {
var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
return isFunction(format) ? format(output) : format.replace(/%s/i, output);
}
var aliases = {};
function addUnitAlias (unit, shorthand) {
var lowerCase = unit.toLowerCase();
aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
}
function normalizeUnits(units) {
return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
}
function normalizeObjectUnits(inputObject) {
var normalizedInput = {},
normalizedProp,
prop;
for (prop in inputObject) {
if (hasOwnProp(inputObject, prop)) {
normalizedProp = normalizeUnits(prop);
if (normalizedProp) {
normalizedInput[normalizedProp] = inputObject[prop];
}
}
}
return normalizedInput;
}
var priorities = {};
function addUnitPriority(unit, priority) {
priorities[unit] = priority;
}
function getPrioritizedUnits(unitsObj) {
var units = [];
for (var u in unitsObj) {
units.push({unit: u, priority: priorities[u]});
}
units.sort(function (a, b) {
return a.priority - b.priority;
});
return units;
}
function zeroFill(number, targetLength, forceSign) {
var absNumber = '' + Math.abs(number),
zerosToFill = targetLength - absNumber.length,
sign = number >= 0;
return (sign ? (forceSign ? '+' : '') : '-') +
Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
}
var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
var formatFunctions = {};
var formatTokenFunctions = {};
// token: 'M'
// padded: ['MM', 2]
// ordinal: 'Mo'
// callback: function () { this.month() + 1 }
function addFormatToken (token, padded, ordinal, callback) {
var func = callback;
if (typeof callback === 'string') {
func = function () {
return this[callback]();
};
}
if (token) {
formatTokenFunctions[token] = func;
}
if (padded) {
formatTokenFunctions[padded[0]] = function () {
return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
};
}
if (ordinal) {
formatTokenFunctions[ordinal] = function () {
return this.localeData().ordinal(func.apply(this, arguments), token);
};
}
}
function removeFormattingTokens(input) {
if (input.match(/\[[\s\S]/)) {
return input.replace(/^\[|\]$/g, '');
}
return input.replace(/\\/g, '');
}
function makeFormatFunction(format) {
var array = format.match(formattingTokens), i, length;
for (i = 0, length = array.length; i < length; i++) {
if (formatTokenFunctions[array[i]]) {
array[i] = formatTokenFunctions[array[i]];
} else {
array[i] = removeFormattingTokens(array[i]);
}
}
return function (mom) {
var output = '', i;
for (i = 0; i < length; i++) {
output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];
}
return output;
};
}
// format date using native date object
function formatMoment(m, format) {
if (!m.isValid()) {
return m.localeData().invalidDate();
}
format = expandFormat(format, m.localeData());
formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
return formatFunctions[format](m);
}
function expandFormat(format, locale) {
var i = 5;
function replaceLongDateFormatTokens(input) {
return locale.longDateFormat(input) || input;
}
localFormattingTokens.lastIndex = 0;
while (i >= 0 && localFormattingTokens.test(format)) {
format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
localFormattingTokens.lastIndex = 0;
i -= 1;
}
return format;
}
var match1 = /\d/; // 0 - 9
var match2 = /\d\d/; // 00 - 99
var match3 = /\d{3}/; // 000 - 999
var match4 = /\d{4}/; // 0000 - 9999
var match6 = /[+-]?\d{6}/; // -999999 - 999999
var match1to2 = /\d\d?/; // 0 - 99
var match3to4 = /\d\d\d\d?/; // 999 - 9999
var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
var match1to3 = /\d{1,3}/; // 0 - 999
var match1to4 = /\d{1,4}/; // 0 - 9999
var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
var matchUnsigned = /\d+/; // 0 - inf
var matchSigned = /[+-]?\d+/; // -inf - inf
var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
// any word (or two) characters or numbers including two/three word month in arabic.
// includes scottish gaelic two word and hyphenated months
var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;
var regexes = {};
function addRegexToken (token, regex, strictRegex) {
regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
return (isStrict && strictRegex) ? strictRegex : regex;
};
}
function getParseRegexForToken (token, config) {
if (!hasOwnProp(regexes, token)) {
return new RegExp(unescapeFormat(token));
}
return regexes[token](config._strict, config._locale);
}
// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
function unescapeFormat(s) {
return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
return p1 || p2 || p3 || p4;
}));
}
function regexEscape(s) {
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
}
var tokens = {};
function addParseToken (token, callback) {
var i, func = callback;
if (typeof token === 'string') {
token = [token];
}
if (isNumber(callback)) {
func = function (input, array) {
array[callback] = toInt(input);
};
}
for (i = 0; i < token.length; i++) {
tokens[token[i]] = func;
}
}
function addWeekParseToken (token, callback) {
addParseToken(token, function (input, array, config, token) {
config._w = config._w || {};
callback(input, config._w, config, token);
});
}
function addTimeToArrayFromToken(token, input, config) {
if (input != null && hasOwnProp(tokens, token)) {
tokens[token](input, config._a, config, token);
}
}
var YEAR = 0;
var MONTH = 1;
var DATE = 2;
var HOUR = 3;
var MINUTE = 4;
var SECOND = 5;
var MILLISECOND = 6;
var WEEK = 7;
var WEEKDAY = 8;
// FORMATTING
addFormatToken('Y', 0, 0, function () {
var y = this.year();
return y <= 9999 ? '' + y : '+' + y;
});
addFormatToken(0, ['YY', 2], 0, function () {
return this.year() % 100;
});
addFormatToken(0, ['YYYY', 4], 0, 'year');
addFormatToken(0, ['YYYYY', 5], 0, 'year');
addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
// ALIASES
addUnitAlias('year', 'y');
// PRIORITIES
addUnitPriority('year', 1);
// PARSING
addRegexToken('Y', matchSigned);
addRegexToken('YY', match1to2, match2);
addRegexToken('YYYY', match1to4, match4);
addRegexToken('YYYYY', match1to6, match6);
addRegexToken('YYYYYY', match1to6, match6);
addParseToken(['YYYYY', 'YYYYYY'], YEAR);
addParseToken('YYYY', function (input, array) {
array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
});
addParseToken('YY', function (input, array) {
array[YEAR] = hooks.parseTwoDigitYear(input);
});
addParseToken('Y', function (input, array) {
array[YEAR] = parseInt(input, 10);
});
// HELPERS
function daysInYear(year) {
return isLeapYear(year) ? 366 : 365;
}
function isLeapYear(year) {
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
}
// HOOKS
hooks.parseTwoDigitYear = function (input) {
return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
};
// MOMENTS
var getSetYear = makeGetSet('FullYear', true);
function getIsLeapYear () {
return isLeapYear(this.year());
}
function makeGetSet (unit, keepTime) {
return function (value) {
if (value != null) {
set$1(this, unit, value);
hooks.updateOffset(this, keepTime);
return this;
} else {
return get(this, unit);
}
};
}
function get (mom, unit) {
return mom.isValid() ?
mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
}
function set$1 (mom, unit, value) {
if (mom.isValid() && !isNaN(value)) {
if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));
}
else {
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
}
}
}
// MOMENTS
function stringGet (units) {
units = normalizeUnits(units);
if (isFunction(this[units])) {
return this[units]();
}
return this;
}
function stringSet (units, value) {
if (typeof units === 'object') {
units = normalizeObjectUnits(units);
var prioritized = getPrioritizedUnits(units);
for (var i = 0; i < prioritized.length; i++) {
this[prioritized[i].unit](units[prioritized[i].unit]);
}
} else {
units = normalizeUnits(units);
if (isFunction(this[units])) {
return this[units](value);
}
}
return this;
}
function mod(n, x) {
return ((n % x) + x) % x;
}
var indexOf;
if (Array.prototype.indexOf) {
indexOf = Array.prototype.indexOf;
} else {
indexOf = function (o) {
// I know
var i;
for (i = 0; i < this.length; ++i) {
if (this[i] === o) {
return i;
}
}
return -1;
};
}
function daysInMonth(year, month) {
if (isNaN(year) || isNaN(month)) {
return NaN;
}
var modMonth = mod(month, 12);
year += (month - modMonth) / 12;
return modMonth === 1 ? (isLeapYear(year) ? 29 : 28) : (31 - modMonth % 7 % 2);
}
// FORMATTING
addFormatToken('M', ['MM', 2], 'Mo', function () {
return this.month() + 1;
});
addFormatToken('MMM', 0, 0, function (format) {
return this.localeData().monthsShort(this, format);
});
addFormatToken('MMMM', 0, 0, function (format) {
return this.localeData().months(this, format);
});
// ALIASES
addUnitAlias('month', 'M');
// PRIORITY
addUnitPriority('month', 8);
// PARSING
addRegexToken('M', match1to2);
addRegexToken('MM', match1to2, match2);
addRegexToken('MMM', function (isStrict, locale) {
return locale.monthsShortRegex(isStrict);
});
addRegexToken('MMMM', function (isStrict, locale) {
return locale.monthsRegex(isStrict);
});
addParseToken(['M', 'MM'], function (input, array) {
array[MONTH] = toInt(input) - 1;
});
addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
var month = config._locale.monthsParse(input, token, config._strict);
// if we didn't find a month name, mark the date as invalid.
if (month != null) {
array[MONTH] = month;
} else {
getParsingFlags(config).invalidMonth = input;
}
});
// LOCALES
var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
function localeMonths (m, format) {
if (!m) {
return isArray(this._months) ? this._months :
this._months['standalone'];
}
return isArray(this._months) ? this._months[m.month()] :
this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
}
var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
function localeMonthsShort (m, format) {
if (!m) {
return isArray(this._monthsShort) ? this._monthsShort :
this._monthsShort['standalone'];
}
return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
}
function handleStrictParse(monthName, format, strict) {
var i, ii, mom, llc = monthName.toLocaleLowerCase();
if (!this._monthsParse) {
// this is not used
this._monthsParse = [];
this._longMonthsParse = [];
this._shortMonthsParse = [];
for (i = 0; i < 12; ++i) {
mom = createUTC([2000, i]);
this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
}
}
if (strict) {
if (format === 'MMM') {
ii = indexOf.call(this._shortMonthsParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf.call(this._longMonthsParse, llc);
return ii !== -1 ? ii : null;
}
} else {
if (format === 'MMM') {
ii = indexOf.call(this._shortMonthsParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._longMonthsParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf.call(this._longMonthsParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._shortMonthsParse, llc);
return ii !== -1 ? ii : null;
}
}
}
function localeMonthsParse (monthName, format, strict) {
var i, mom, regex;
if (this._monthsParseExact) {
return handleStrictParse.call(this, monthName, format, strict);
}
if (!this._monthsParse) {
this._monthsParse = [];
this._longMonthsParse = [];
this._shortMonthsParse = [];
}
// TODO: add sorting
// Sorting makes sure if one month (or abbr) is a prefix of another
// see sorting in computeMonthsParse
for (i = 0; i < 12; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, i]);
if (strict && !this._longMonthsParse[i]) {
this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
}
if (!strict && !this._monthsParse[i]) {
regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
}
// test the regex
if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
return i;
} else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
return i;
} else if (!strict && this._monthsParse[i].test(monthName)) {
return i;
}
}
}
// MOMENTS
function setMonth (mom, value) {
var dayOfMonth;
if (!mom.isValid()) {
// No op
return mom;
}
if (typeof value === 'string') {
if (/^\d+$/.test(value)) {
value = toInt(value);
} else {
value = mom.localeData().monthsParse(value);
// TODO: Another silent failure?
if (!isNumber(value)) {
return mom;
}
}
}
dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
return mom;
}
function getSetMonth (value) {
if (value != null) {
setMonth(this, value);
hooks.updateOffset(this, true);
return this;
} else {
return get(this, 'Month');
}
}
function getDaysInMonth () {
return daysInMonth(this.year(), this.month());
}
var defaultMonthsShortRegex = matchWord;
function monthsShortRegex (isStrict) {
if (this._monthsParseExact) {
if (!hasOwnProp(this, '_monthsRegex')) {
computeMonthsParse.call(this);
}
if (isStrict) {
return this._monthsShortStrictRegex;
} else {
return this._monthsShortRegex;
}
} else {
if (!hasOwnProp(this, '_monthsShortRegex')) {
this._monthsShortRegex = defaultMonthsShortRegex;
}
return this._monthsShortStrictRegex && isStrict ?
this._monthsShortStrictRegex : this._monthsShortRegex;
}
}
var defaultMonthsRegex = matchWord;
function monthsRegex (isStrict) {
if (this._monthsParseExact) {
if (!hasOwnProp(this, '_monthsRegex')) {
computeMonthsParse.call(this);
}
if (isStrict) {
return this._monthsStrictRegex;
} else {
return this._monthsRegex;
}
} else {
if (!hasOwnProp(this, '_monthsRegex')) {
this._monthsRegex = defaultMonthsRegex;
}
return this._monthsStrictRegex && isStrict ?
this._monthsStrictRegex : this._monthsRegex;
}
}
function computeMonthsParse () {
function cmpLenRev(a, b) {
return b.length - a.length;
}
var shortPieces = [], longPieces = [], mixedPieces = [],
i, mom;
for (i = 0; i < 12; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, i]);
shortPieces.push(this.monthsShort(mom, ''));
longPieces.push(this.months(mom, ''));
mixedPieces.push(this.months(mom, ''));
mixedPieces.push(this.monthsShort(mom, ''));
}
// Sorting makes sure if one month (or abbr) is a prefix of another it
// will match the longer piece.
shortPieces.sort(cmpLenRev);
longPieces.sort(cmpLenRev);
mixedPieces.sort(cmpLenRev);
for (i = 0; i < 12; i++) {
shortPieces[i] = regexEscape(shortPieces[i]);
longPieces[i] = regexEscape(longPieces[i]);
}
for (i = 0; i < 24; i++) {
mixedPieces[i] = regexEscape(mixedPieces[i]);
}
this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
this._monthsShortRegex = this._monthsRegex;
this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
}
function createDate (y, m, d, h, M, s, ms) {
// can't just apply() to create a date:
// https://stackoverflow.com/q/181348
var date = new Date(y, m, d, h, M, s, ms);
// the date constructor remaps years 0-99 to 1900-1999
if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
date.setFullYear(y);
}
return date;
}
function createUTCDate (y) {
var date = new Date(Date.UTC.apply(null, arguments));
// the Date.UTC function remaps years 0-99 to 1900-1999
if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
date.setUTCFullYear(y);
}
return date;
}
// start-of-first-week - start-of-year
function firstWeekOffset(year, dow, doy) {
var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
fwd = 7 + dow - doy,
// first-week day local weekday -- which local weekday is fwd
fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
return -fwdlw + fwd - 1;
}
// https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
var localWeekday = (7 + weekday - dow) % 7,
weekOffset = firstWeekOffset(year, dow, doy),
dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
resYear, resDayOfYear;
if (dayOfYear <= 0) {
resYear = year - 1;
resDayOfYear = daysInYear(resYear) + dayOfYear;
} else if (dayOfYear > daysInYear(year)) {
resYear = year + 1;
resDayOfYear = dayOfYear - daysInYear(year);
} else {
resYear = year;
resDayOfYear = dayOfYear;
}
return {
year: resYear,
dayOfYear: resDayOfYear
};
}
function weekOfYear(mom, dow, doy) {
var weekOffset = firstWeekOffset(mom.year(), dow, doy),
week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
resWeek, resYear;
if (week < 1) {
resYear = mom.year() - 1;
resWeek = week + weeksInYear(resYear, dow, doy);
} else if (week > weeksInYear(mom.year(), dow, doy)) {
resWeek = week - weeksInYear(mom.year(), dow, doy);
resYear = mom.year() + 1;
} else {
resYear = mom.year();
resWeek = week;
}
return {
week: resWeek,
year: resYear
};
}
function weeksInYear(year, dow, doy) {
var weekOffset = firstWeekOffset(year, dow, doy),
weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
}
// FORMATTING
addFormatToken('w', ['ww', 2], 'wo', 'week');
addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
// ALIASES
addUnitAlias('week', 'w');
addUnitAlias('isoWeek', 'W');
// PRIORITIES
addUnitPriority('week', 5);
addUnitPriority('isoWeek', 5);
// PARSING
addRegexToken('w', match1to2);
addRegexToken('ww', match1to2, match2);
addRegexToken('W', match1to2);
addRegexToken('WW', match1to2, match2);
addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
week[token.substr(0, 1)] = toInt(input);
});
// HELPERS
// LOCALES
function localeWeek (mom) {
return weekOfYear(mom, this._week.dow, this._week.doy).week;
}
var defaultLocaleWeek = {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
};
function localeFirstDayOfWeek () {
return this._week.dow;
}
function localeFirstDayOfYear () {
return this._week.doy;
}
// MOMENTS
function getSetWeek (input) {
var week = this.localeData().week(this);
return input == null ? week : this.add((input - week) * 7, 'd');
}
function getSetISOWeek (input) {
var week = weekOfYear(this, 1, 4).week;
return input == null ? week : this.add((input - week) * 7, 'd');
}
// FORMATTING
addFormatToken('d', 0, 'do', 'day');
addFormatToken('dd', 0, 0, function (format) {
return this.localeData().weekdaysMin(this, format);
});
addFormatToken('ddd', 0, 0, function (format) {
return this.localeData().weekdaysShort(this, format);
});
addFormatToken('dddd', 0, 0, function (format) {
return this.localeData().weekdays(this, format);
});
addFormatToken('e', 0, 0, 'weekday');
addFormatToken('E', 0, 0, 'isoWeekday');
// ALIASES
addUnitAlias('day', 'd');
addUnitAlias('weekday', 'e');
addUnitAlias('isoWeekday', 'E');
// PRIORITY
addUnitPriority('day', 11);
addUnitPriority('weekday', 11);
addUnitPriority('isoWeekday', 11);
// PARSING
addRegexToken('d', match1to2);
addRegexToken('e', match1to2);
addRegexToken('E', match1to2);
addRegexToken('dd', function (isStrict, locale) {
return locale.weekdaysMinRegex(isStrict);
});
addRegexToken('ddd', function (isStrict, locale) {
return locale.weekdaysShortRegex(isStrict);
});
addRegexToken('dddd', function (isStrict, locale) {
return locale.weekdaysRegex(isStrict);
});
addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
var weekday = config._locale.weekdaysParse(input, token, config._strict);
// if we didn't get a weekday name, mark the date as invalid
if (weekday != null) {
week.d = weekday;
} else {
getParsingFlags(config).invalidWeekday = input;
}
});
addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
week[token] = toInt(input);
});
// HELPERS
function parseWeekday(input, locale) {
if (typeof input !== 'string') {
return input;
}
if (!isNaN(input)) {
return parseInt(input, 10);
}
input = locale.weekdaysParse(input);
if (typeof input === 'number') {
return input;
}
return null;
}
function parseIsoWeekday(input, locale) {
if (typeof input === 'string') {
return locale.weekdaysParse(input) % 7 || 7;
}
return isNaN(input) ? null : input;
}
// LOCALES
var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
function localeWeekdays (m, format) {
if (!m) {
return isArray(this._weekdays) ? this._weekdays :
this._weekdays['standalone'];
}
return isArray(this._weekdays) ? this._weekdays[m.day()] :
this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
}
var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
function localeWeekdaysShort (m) {
return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
}
var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
function localeWeekdaysMin (m) {
return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
}
function handleStrictParse$1(weekdayName, format, strict) {
var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
if (!this._weekdaysParse) {
this._weekdaysParse = [];
this._shortWeekdaysParse = [];
this._minWeekdaysParse = [];
for (i = 0; i < 7; ++i) {
mom = createUTC([2000, 1]).day(i);
this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
}
}
if (strict) {
if (format === 'dddd') {
ii = indexOf.call(this._weekdaysParse, llc);
return ii !== -1 ? ii : null;
} else if (format === 'ddd') {
ii = indexOf.call(this._shortWeekdaysParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf.call(this._minWeekdaysParse, llc);
return ii !== -1 ? ii : null;
}
} else {
if (format === 'dddd') {
ii = indexOf.call(this._weekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._shortWeekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._minWeekdaysParse, llc);
return ii !== -1 ? ii : null;
} else if (format === 'ddd') {
ii = indexOf.call(this._shortWeekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._weekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._minWeekdaysParse, llc);
return ii !== -1 ? ii : null;
} else {
ii = indexOf.call(this._minWeekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._weekdaysParse, llc);
if (ii !== -1) {
return ii;
}
ii = indexOf.call(this._shortWeekdaysParse, llc);
return ii !== -1 ? ii : null;
}
}
}
function localeWeekdaysParse (weekdayName, format, strict) {
var i, mom, regex;
if (this._weekdaysParseExact) {
return handleStrictParse$1.call(this, weekdayName, format, strict);
}
if (!this._weekdaysParse) {
this._weekdaysParse = [];
this._minWeekdaysParse = [];
this._shortWeekdaysParse = [];
this._fullWeekdaysParse = [];
}
for (i = 0; i < 7; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, 1]).day(i);
if (strict && !this._fullWeekdaysParse[i]) {
this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
}
if (!this._weekdaysParse[i]) {
regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
}
// test the regex
if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
return i;
} else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
return i;
} else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
return i;
} else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
return i;
}
}
}
// MOMENTS
function getSetDayOfWeek (input) {
if (!this.isValid()) {
return input != null ? this : NaN;
}
var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
if (input != null) {
input = parseWeekday(input, this.localeData());
return this.add(input - day, 'd');
} else {
return day;
}
}
function getSetLocaleDayOfWeek (input) {
if (!this.isValid()) {
return input != null ? this : NaN;
}
var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
return input == null ? weekday : this.add(input - weekday, 'd');
}
function getSetISODayOfWeek (input) {
if (!this.isValid()) {
return input != null ? this : NaN;
}
// behaves the same as moment#day except
// as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
// as a setter, sunday should belong to the previous week.
if (input != null) {
var weekday = parseIsoWeekday(input, this.localeData());
return this.day(this.day() % 7 ? weekday : weekday - 7);
} else {
return this.day() || 7;
}
}
var defaultWeekdaysRegex = matchWord;
function weekdaysRegex (isStrict) {
if (this._weekdaysParseExact) {
if (!hasOwnProp(this, '_weekdaysRegex')) {
computeWeekdaysParse.call(this);
}
if (isStrict) {
return this._weekdaysStrictRegex;
} else {
return this._weekdaysRegex;
}
} else {
if (!hasOwnProp(this, '_weekdaysRegex')) {
this._weekdaysRegex = defaultWeekdaysRegex;
}
return this._weekdaysStrictRegex && isStrict ?
this._weekdaysStrictRegex : this._weekdaysRegex;
}
}
var defaultWeekdaysShortRegex = matchWord;
function weekdaysShortRegex (isStrict) {
if (this._weekdaysParseExact) {
if (!hasOwnProp(this, '_weekdaysRegex')) {
computeWeekdaysParse.call(this);
}
if (isStrict) {
return this._weekdaysShortStrictRegex;
} else {
return this._weekdaysShortRegex;
}
} else {
if (!hasOwnProp(this, '_weekdaysShortRegex')) {
this._weekdaysShortRegex = defaultWeekdaysShortRegex;
}
return this._weekdaysShortStrictRegex && isStrict ?
this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
}
}
var defaultWeekdaysMinRegex = matchWord;
function weekdaysMinRegex (isStrict) {
if (this._weekdaysParseExact) {
if (!hasOwnProp(this, '_weekdaysRegex')) {
computeWeekdaysParse.call(this);
}
if (isStrict) {
return this._weekdaysMinStrictRegex;
} else {
return this._weekdaysMinRegex;
}
} else {
if (!hasOwnProp(this, '_weekdaysMinRegex')) {
this._weekdaysMinRegex = defaultWeekdaysMinRegex;
}
return this._weekdaysMinStrictRegex && isStrict ?
this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
}
}
function computeWeekdaysParse () {
function cmpLenRev(a, b) {
return b.length - a.length;
}
var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
i, mom, minp, shortp, longp;
for (i = 0; i < 7; i++) {
// make the regex if we don't have it already
mom = createUTC([2000, 1]).day(i);
minp = this.weekdaysMin(mom, '');
shortp = this.weekdaysShort(mom, '');
longp = this.weekdays(mom, '');
minPieces.push(minp);
shortPieces.push(shortp);
longPieces.push(longp);
mixedPieces.push(minp);
mixedPieces.push(shortp);
mixedPieces.push(longp);
}
// Sorting makes sure if one weekday (or abbr) is a prefix of another it
// will match the longer piece.
minPieces.sort(cmpLenRev);
shortPieces.sort(cmpLenRev);
longPieces.sort(cmpLenRev);
mixedPieces.sort(cmpLenRev);
for (i = 0; i < 7; i++) {
shortPieces[i] = regexEscape(shortPieces[i]);
longPieces[i] = regexEscape(longPieces[i]);
mixedPieces[i] = regexEscape(mixedPieces[i]);
}
this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
this._weekdaysShortRegex = this._weekdaysRegex;
this._weekdaysMinRegex = this._weekdaysRegex;
this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
}
// FORMATTING
function hFormat() {
return this.hours() % 12 || 12;
}
function kFormat() {
return this.hours() || 24;
}
addFormatToken('H', ['HH', 2], 0, 'hour');
addFormatToken('h', ['hh', 2], 0, hFormat);
addFormatToken('k', ['kk', 2], 0, kFormat);
addFormatToken('hmm', 0, 0, function () {
return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
});
addFormatToken('hmmss', 0, 0, function () {
return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
zeroFill(this.seconds(), 2);
});
addFormatToken('Hmm', 0, 0, function () {
return '' + this.hours() + zeroFill(this.minutes(), 2);
});
addFormatToken('Hmmss', 0, 0, function () {
return '' + this.hours() + zeroFill(this.minutes(), 2) +
zeroFill(this.seconds(), 2);
});
function meridiem (token, lowercase) {
addFormatToken(token, 0, 0, function () {
return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
});
}
meridiem('a', true);
meridiem('A', false);
// ALIASES
addUnitAlias('hour', 'h');
// PRIORITY
addUnitPriority('hour', 13);
// PARSING
function matchMeridiem (isStrict, locale) {
return locale._meridiemParse;
}
addRegexToken('a', matchMeridiem);
addRegexToken('A', matchMeridiem);
addRegexToken('H', match1to2);
addRegexToken('h', match1to2);
addRegexToken('k', match1to2);
addRegexToken('HH', match1to2, match2);
addRegexToken('hh', match1to2, match2);
addRegexToken('kk', match1to2, match2);
addRegexToken('hmm', match3to4);
addRegexToken('hmmss', match5to6);
addRegexToken('Hmm', match3to4);
addRegexToken('Hmmss', match5to6);
addParseToken(['H', 'HH'], HOUR);
addParseToken(['k', 'kk'], function (input, array, config) {
var kInput = toInt(input);
array[HOUR] = kInput === 24 ? 0 : kInput;
});
addParseToken(['a', 'A'], function (input, array, config) {
config._isPm = config._locale.isPM(input);
config._meridiem = input;
});
addParseToken(['h', 'hh'], function (input, array, config) {
array[HOUR] = toInt(input);
getParsingFlags(config).bigHour = true;
});
addParseToken('hmm', function (input, array, config) {
var pos = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos));
array[MINUTE] = toInt(input.substr(pos));
getParsingFlags(config).bigHour = true;
});
addParseToken('hmmss', function (input, array, config) {
var pos1 = input.length - 4;
var pos2 = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos1));
array[MINUTE] = toInt(input.substr(pos1, 2));
array[SECOND] = toInt(input.substr(pos2));
getParsingFlags(config).bigHour = true;
});
addParseToken('Hmm', function (input, array, config) {
var pos = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos));
array[MINUTE] = toInt(input.substr(pos));
});
addParseToken('Hmmss', function (input, array, config) {
var pos1 = input.length - 4;
var pos2 = input.length - 2;
array[HOUR] = toInt(input.substr(0, pos1));
array[MINUTE] = toInt(input.substr(pos1, 2));
array[SECOND] = toInt(input.substr(pos2));
});
// LOCALES
function localeIsPM (input) {
// IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
// Using charAt should be more compatible.
return ((input + '').toLowerCase().charAt(0) === 'p');
}
var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
function localeMeridiem (hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'pm' : 'PM';
} else {
return isLower ? 'am' : 'AM';
}
}
// MOMENTS
// Setting the hour should keep the time, because the user explicitly
// specified which hour he wants. So trying to maintain the same hour (in
// a new timezone) makes sense. Adding/subtracting hours does not follow
// this rule.
var getSetHour = makeGetSet('Hours', true);
// months
// week
// weekdays
// meridiem
var baseConfig = {
calendar: defaultCalendar,
longDateFormat: defaultLongDateFormat,
invalidDate: defaultInvalidDate,
ordinal: defaultOrdinal,
dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
relativeTime: defaultRelativeTime,
months: defaultLocaleMonths,
monthsShort: defaultLocaleMonthsShort,
week: defaultLocaleWeek,
weekdays: defaultLocaleWeekdays,
weekdaysMin: defaultLocaleWeekdaysMin,
weekdaysShort: defaultLocaleWeekdaysShort,
meridiemParse: defaultLocaleMeridiemParse
};
// internal storage for locale config files
var locales = {};
var localeFamilies = {};
var globalLocale;
function normalizeLocale(key) {
return key ? key.toLowerCase().replace('_', '-') : key;
}
// pick the locale from the array
// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
function chooseLocale(names) {
var i = 0, j, next, locale, split;
while (i < names.length) {
split = normalizeLocale(names[i]).split('-');
j = split.length;
next = normalizeLocale(names[i + 1]);
next = next ? next.split('-') : null;
while (j > 0) {
locale = loadLocale(split.slice(0, j).join('-'));
if (locale) {
return locale;
}
if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
//the next array item is better than a shallower substring of this one
break;
}
j--;
}
i++;
}
return null;
}
function loadLocale(name) {
var oldLocale = null;
// TODO: Find a better way to register and load all the locales in Node
if (!locales[name] && (typeof module !== 'undefined') &&
module && module.exports) {
try {
oldLocale = globalLocale._abbr;
var aliasedRequire = require;
__webpack_require__(276)("./" + name);
getSetGlobalLocale(oldLocale);
} catch (e) {}
}
return locales[name];
}
// This function will load locale and then set the global locale. If
// no arguments are passed in, it will simply return the current global
// locale key.
function getSetGlobalLocale (key, values) {
var data;
if (key) {
if (isUndefined(values)) {
data = getLocale(key);
}
else {
data = defineLocale(key, values);
}
if (data) {
// moment.duration._locale = moment._locale = data;
globalLocale = data;
}
}
return globalLocale._abbr;
}
function defineLocale (name, config) {
if (config !== null) {
var parentConfig = baseConfig;
config.abbr = name;
if (locales[name] != null) {
deprecateSimple('defineLocaleOverride',
'use moment.updateLocale(localeName, config) to change ' +
'an existing locale. moment.defineLocale(localeName, ' +
'config) should only be used for creating a new locale ' +
'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
parentConfig = locales[name]._config;
} else if (config.parentLocale != null) {
if (locales[config.parentLocale] != null) {
parentConfig = locales[config.parentLocale]._config;
} else {
if (!localeFamilies[config.parentLocale]) {
localeFamilies[config.parentLocale] = [];
}
localeFamilies[config.parentLocale].push({
name: name,
config: config
});
return null;
}
}
locales[name] = new Locale(mergeConfigs(parentConfig, config));
if (localeFamilies[name]) {
localeFamilies[name].forEach(function (x) {
defineLocale(x.name, x.config);
});
}
// backwards compat for now: also set the locale
// make sure we set the locale AFTER all child locales have been
// created, so we won't end up with the child locale set.
getSetGlobalLocale(name);
return locales[name];
} else {
// useful for testing
delete locales[name];
return null;
}
}
function updateLocale(name, config) {
if (config != null) {
var locale, tmpLocale, parentConfig = baseConfig;
// MERGE
tmpLocale = loadLocale(name);
if (tmpLocale != null) {
parentConfig = tmpLocale._config;
}
config = mergeConfigs(parentConfig, config);
locale = new Locale(config);
locale.parentLocale = locales[name];
locales[name] = locale;
// backwards compat for now: also set the locale
getSetGlobalLocale(name);
} else {
// pass null for config to unupdate, useful for tests
if (locales[name] != null) {
if (locales[name].parentLocale != null) {
locales[name] = locales[name].parentLocale;
} else if (locales[name] != null) {
delete locales[name];
}
}
}
return locales[name];
}
// returns locale data
function getLocale (key) {
var locale;
if (key && key._locale && key._locale._abbr) {
key = key._locale._abbr;
}
if (!key) {
return globalLocale;
}
if (!isArray(key)) {
//short-circuit everything else
locale = loadLocale(key);
if (locale) {
return locale;
}
key = [key];
}
return chooseLocale(key);
}
function listLocales() {
return keys(locales);
}
function checkOverflow (m) {
var overflow;
var a = m._a;
if (a && getParsingFlags(m).overflow === -2) {
overflow =
a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
-1;
if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
overflow = DATE;
}
if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
overflow = WEEK;
}
if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
overflow = WEEKDAY;
}
getParsingFlags(m).overflow = overflow;
}
return m;
}
// Pick the first defined of two or three arguments.
function defaults(a, b, c) {
if (a != null) {
return a;
}
if (b != null) {
return b;
}
return c;
}
function currentDateArray(config) {
// hooks is actually the exported moment object
var nowValue = new Date(hooks.now());
if (config._useUTC) {
return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
}
return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
}
// convert an array to a date.
// the array should mirror the parameters below
// note: all values past the year are optional and will default to the lowest possible value.
// [year, month, day , hour, minute, second, millisecond]
function configFromArray (config) {
var i, date, input = [], currentDate, expectedWeekday, yearToUse;
if (config._d) {
return;
}
currentDate = currentDateArray(config);
//compute day of the year from weeks and weekdays
if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
dayOfYearFromWeekInfo(config);
}
//if the day of the year is set, figure out what it is
if (config._dayOfYear != null) {
yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
getParsingFlags(config)._overflowDayOfYear = true;
}
date = createUTCDate(yearToUse, 0, config._dayOfYear);
config._a[MONTH] = date.getUTCMonth();
config._a[DATE] = date.getUTCDate();
}
// Default to current date.
// * if no year, month, day of month are given, default to today
// * if day of month is given, default month and year
// * if month is given, default only year
// * if year is given, don't default anything
for (i = 0; i < 3 && config._a[i] == null; ++i) {
config._a[i] = input[i] = currentDate[i];
}
// Zero out whatever was not defaulted, including time
for (; i < 7; i++) {
config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
}
// Check for 24:00:00.000
if (config._a[HOUR] === 24 &&
config._a[MINUTE] === 0 &&
config._a[SECOND] === 0 &&
config._a[MILLISECOND] === 0) {
config._nextDay = true;
config._a[HOUR] = 0;
}
config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
// Apply timezone offset from input. The actual utcOffset can be changed
// with parseZone.
if (config._tzm != null) {
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
}
if (config._nextDay) {
config._a[HOUR] = 24;
}
// check for mismatching day of week
if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {
getParsingFlags(config).weekdayMismatch = true;
}
}
function dayOfYearFromWeekInfo(config) {
var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
w = config._w;
if (w.GG != null || w.W != null || w.E != null) {
dow = 1;
doy = 4;
// TODO: We need to take the current isoWeekYear, but that depends on
// how we interpret now (local, utc, fixed offset). So create
// a now version of current config (take local/utc/offset flags, and
// create now).
weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
week = defaults(w.W, 1);
weekday = defaults(w.E, 1);
if (weekday < 1 || weekday > 7) {
weekdayOverflow = true;
}
} else {
dow = config._locale._week.dow;
doy = config._locale._week.doy;
var curWeek = weekOfYear(createLocal(), dow, doy);
weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
// Default to current week.
week = defaults(w.w, curWeek.week);
if (w.d != null) {
// weekday -- low day numbers are considered next week
weekday = w.d;
if (weekday < 0 || weekday > 6) {
weekdayOverflow = true;
}
} else if (w.e != null) {
// local weekday -- counting starts from begining of week
weekday = w.e + dow;
if (w.e < 0 || w.e > 6) {
weekdayOverflow = true;
}
} else {
// default to begining of week
weekday = dow;
}
}
if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
getParsingFlags(config)._overflowWeeks = true;
} else if (weekdayOverflow != null) {
getParsingFlags(config)._overflowWeekday = true;
} else {
temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
config._a[YEAR] = temp.year;
config._dayOfYear = temp.dayOfYear;
}
}
// iso 8601 regex
// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
var isoDates = [
['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
['GGGG-[W]WW', /\d{4}-W\d\d/, false],
['YYYY-DDD', /\d{4}-\d{3}/],
['YYYY-MM', /\d{4}-\d\d/, false],
['YYYYYYMMDD', /[+-]\d{10}/],
['YYYYMMDD', /\d{8}/],
// YYYYMM is NOT allowed by the standard
['GGGG[W]WWE', /\d{4}W\d{3}/],
['GGGG[W]WW', /\d{4}W\d{2}/, false],
['YYYYDDD', /\d{7}/]
];
// iso time formats and regexes
var isoTimes = [
['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
['HH:mm:ss', /\d\d:\d\d:\d\d/],
['HH:mm', /\d\d:\d\d/],
['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
['HHmmss', /\d\d\d\d\d\d/],
['HHmm', /\d\d\d\d/],
['HH', /\d\d/]
];
var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
// date from iso format
function configFromISO(config) {
var i, l,
string = config._i,
match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
allowTime, dateFormat, timeFormat, tzFormat;
if (match) {
getParsingFlags(config).iso = true;
for (i = 0, l = isoDates.length; i < l; i++) {
if (isoDates[i][1].exec(match[1])) {
dateFormat = isoDates[i][0];
allowTime = isoDates[i][2] !== false;
break;
}
}
if (dateFormat == null) {
config._isValid = false;
return;
}
if (match[3]) {
for (i = 0, l = isoTimes.length; i < l; i++) {
if (isoTimes[i][1].exec(match[3])) {
// match[2] should be 'T' or space
timeFormat = (match[2] || ' ') + isoTimes[i][0];
break;
}
}
if (timeFormat == null) {
config._isValid = false;
return;
}
}
if (!allowTime && timeFormat != null) {
config._isValid = false;
return;
}
if (match[4]) {
if (tzRegex.exec(match[4])) {
tzFormat = 'Z';
} else {
config._isValid = false;
return;
}
}
config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
configFromStringAndFormat(config);
} else {
config._isValid = false;
}
}
// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;
function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
var result = [
untruncateYear(yearStr),
defaultLocaleMonthsShort.indexOf(monthStr),
parseInt(dayStr, 10),
parseInt(hourStr, 10),
parseInt(minuteStr, 10)
];
if (secondStr) {
result.push(parseInt(secondStr, 10));
}
return result;
}
function untruncateYear(yearStr) {
var year = parseInt(yearStr, 10);
if (year <= 49) {
return 2000 + year;
} else if (year <= 999) {
return 1900 + year;
}
return year;
}
function preprocessRFC2822(s) {
// Remove comments and folding whitespace and replace multiple-spaces with a single space
return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').trim();
}
function checkWeekday(weekdayStr, parsedInput, config) {
if (weekdayStr) {
// TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.
var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();
if (weekdayProvided !== weekdayActual) {
getParsingFlags(config).weekdayMismatch = true;
config._isValid = false;
return false;
}
}
return true;
}
var obsOffsets = {
UT: 0,
GMT: 0,
EDT: -4 * 60,
EST: -5 * 60,
CDT: -5 * 60,
CST: -6 * 60,
MDT: -6 * 60,
MST: -7 * 60,
PDT: -7 * 60,
PST: -8 * 60
};
function calculateOffset(obsOffset, militaryOffset, numOffset) {
if (obsOffset) {
return obsOffsets[obsOffset];
} else if (militaryOffset) {
// the only allowed military tz is Z
return 0;
} else {
var hm = parseInt(numOffset, 10);
var m = hm % 100, h = (hm - m) / 100;
return h * 60 + m;
}
}
// date and time from ref 2822 format
function configFromRFC2822(config) {
var match = rfc2822.exec(preprocessRFC2822(config._i));
if (match) {
var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);
if (!checkWeekday(match[1], parsedArray, config)) {
return;
}
config._a = parsedArray;
config._tzm = calculateOffset(match[8], match[9], match[10]);
config._d = createUTCDate.apply(null, config._a);
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
getParsingFlags(config).rfc2822 = true;
} else {
config._isValid = false;
}
}
// date from iso format or fallback
function configFromString(config) {
var matched = aspNetJsonRegex.exec(config._i);
if (matched !== null) {
config._d = new Date(+matched[1]);
return;
}
configFromISO(config);
if (config._isValid === false) {
delete config._isValid;
} else {
return;
}
configFromRFC2822(config);
if (config._isValid === false) {
delete config._isValid;
} else {
return;
}
// Final attempt, use Input Fallback
hooks.createFromInputFallback(config);
}
hooks.createFromInputFallback = deprecate(
'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
'discouraged and will be removed in an upcoming major release. Please refer to ' +
'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
function (config) {
config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
}
);
// constant that refers to the ISO standard
hooks.ISO_8601 = function () {};
// constant that refers to the RFC 2822 form
hooks.RFC_2822 = function () {};
// date from string and format string
function configFromStringAndFormat(config) {
// TODO: Move this to another part of the creation flow to prevent circular deps
if (config._f === hooks.ISO_8601) {
configFromISO(config);
return;
}
if (config._f === hooks.RFC_2822) {
configFromRFC2822(config);
return;
}
config._a = [];
getParsingFlags(config).empty = true;
// This array is used to make a Date, either with `new Date` or `Date.UTC`
var string = '' + config._i,
i, parsedInput, tokens, token, skipped,
stringLength = string.length,
totalParsedInputLength = 0;
tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
for (i = 0; i < tokens.length; i++) {
token = tokens[i];
parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
// console.log('token', token, 'parsedInput', parsedInput,
// 'regex', getParseRegexForToken(token, config));
if (parsedInput) {
skipped = string.substr(0, string.indexOf(parsedInput));
if (skipped.length > 0) {
getParsingFlags(config).unusedInput.push(skipped);
}
string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
totalParsedInputLength += parsedInput.length;
}
// don't parse if it's not a known token
if (formatTokenFunctions[token]) {
if (parsedInput) {
getParsingFlags(config).empty = false;
}
else {
getParsingFlags(config).unusedTokens.push(token);
}
addTimeToArrayFromToken(token, parsedInput, config);
}
else if (config._strict && !parsedInput) {
getParsingFlags(config).unusedTokens.push(token);
}
}
// add remaining unparsed input length to the string
getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
if (string.length > 0) {
getParsingFlags(config).unusedInput.push(string);
}
// clear _12h flag if hour is <= 12
if (config._a[HOUR] <= 12 &&
getParsingFlags(config).bigHour === true &&
config._a[HOUR] > 0) {
getParsingFlags(config).bigHour = undefined;
}
getParsingFlags(config).parsedDateParts = config._a.slice(0);
getParsingFlags(config).meridiem = config._meridiem;
// handle meridiem
config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
configFromArray(config);
checkOverflow(config);
}
function meridiemFixWrap (locale, hour, meridiem) {
var isPm;
if (meridiem == null) {
// nothing to do
return hour;
}
if (locale.meridiemHour != null) {
return locale.meridiemHour(hour, meridiem);
} else if (locale.isPM != null) {
// Fallback
isPm = locale.isPM(meridiem);
if (isPm && hour < 12) {
hour += 12;
}
if (!isPm && hour === 12) {
hour = 0;
}
return hour;
} else {
// this is not supposed to happen
return hour;
}
}
// date from string and array of format strings
function configFromStringAndArray(config) {
var tempConfig,
bestMoment,
scoreToBeat,
i,
currentScore;
if (config._f.length === 0) {
getParsingFlags(config).invalidFormat = true;
config._d = new Date(NaN);
return;
}
for (i = 0; i < config._f.length; i++) {
currentScore = 0;
tempConfig = copyConfig({}, config);
if (config._useUTC != null) {
tempConfig._useUTC = config._useUTC;
}
tempConfig._f = config._f[i];
configFromStringAndFormat(tempConfig);
if (!isValid(tempConfig)) {
continue;
}
// if there is any input that was not parsed add a penalty for that format
currentScore += getParsingFlags(tempConfig).charsLeftOver;
//or tokens
currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
getParsingFlags(tempConfig).score = currentScore;
if (scoreToBeat == null || currentScore < scoreToBeat) {
scoreToBeat = currentScore;
bestMoment = tempConfig;
}
}
extend(config, bestMoment || tempConfig);
}
function configFromObject(config) {
if (config._d) {
return;
}
var i = normalizeObjectUnits(config._i);
config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
return obj && parseInt(obj, 10);
});
configFromArray(config);
}
function createFromConfig (config) {
var res = new Moment(checkOverflow(prepareConfig(config)));
if (res._nextDay) {
// Adding is smart enough around DST
res.add(1, 'd');
res._nextDay = undefined;
}
return res;
}
function prepareConfig (config) {
var input = config._i,
format = config._f;
config._locale = config._locale || getLocale(config._l);
if (input === null || (format === undefined && input === '')) {
return createInvalid({nullInput: true});
}
if (typeof input === 'string') {
config._i = input = config._locale.preparse(input);
}
if (isMoment(input)) {
return new Moment(checkOverflow(input));
} else if (isDate(input)) {
config._d = input;
} else if (isArray(format)) {
configFromStringAndArray(config);
} else if (format) {
configFromStringAndFormat(config);
} else {
configFromInput(config);
}
if (!isValid(config)) {
config._d = null;
}
return config;
}
function configFromInput(config) {
var input = config._i;
if (isUndefined(input)) {
config._d = new Date(hooks.now());
} else if (isDate(input)) {
config._d = new Date(input.valueOf());
} else if (typeof input === 'string') {
configFromString(config);
} else if (isArray(input)) {
config._a = map(input.slice(0), function (obj) {
return parseInt(obj, 10);
});
configFromArray(config);
} else if (isObject(input)) {
configFromObject(config);
} else if (isNumber(input)) {
// from milliseconds
config._d = new Date(input);
} else {
hooks.createFromInputFallback(config);
}
}
function createLocalOrUTC (input, format, locale, strict, isUTC) {
var c = {};
if (locale === true || locale === false) {
strict = locale;
locale = undefined;
}
if ((isObject(input) && isObjectEmpty(input)) ||
(isArray(input) && input.length === 0)) {
input = undefined;
}
// object construction must be done this way.
// https://github.com/moment/moment/issues/1423
c._isAMomentObject = true;
c._useUTC = c._isUTC = isUTC;
c._l = locale;
c._i = input;
c._f = format;
c._strict = strict;
return createFromConfig(c);
}
function createLocal (input, format, locale, strict) {
return createLocalOrUTC(input, format, locale, strict, false);
}
var prototypeMin = deprecate(
'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
function () {
var other = createLocal.apply(null, arguments);
if (this.isValid() && other.isValid()) {
return other < this ? this : other;
} else {
return createInvalid();
}
}
);
var prototypeMax = deprecate(
'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
function () {
var other = createLocal.apply(null, arguments);
if (this.isValid() && other.isValid()) {
return other > this ? this : other;
} else {
return createInvalid();
}
}
);
// Pick a moment m from moments so that m[fn](other) is true for all
// other. This relies on the function fn to be transitive.
//
// moments should either be an array of moment objects or an array, whose
// first element is an array of moment objects.
function pickBy(fn, moments) {
var res, i;
if (moments.length === 1 && isArray(moments[0])) {
moments = moments[0];
}
if (!moments.length) {
return createLocal();
}
res = moments[0];
for (i = 1; i < moments.length; ++i) {
if (!moments[i].isValid() || moments[i][fn](res)) {
res = moments[i];
}
}
return res;
}
// TODO: Use [].sort instead?
function min () {
var args = [].slice.call(arguments, 0);
return pickBy('isBefore', args);
}
function max () {
var args = [].slice.call(arguments, 0);
return pickBy('isAfter', args);
}
var now = function () {
return Date.now ? Date.now() : +(new Date());
};
var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];
function isDurationValid(m) {
for (var key in m) {
if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
return false;
}
}
var unitHasDecimal = false;
for (var i = 0; i < ordering.length; ++i) {
if (m[ordering[i]]) {
if (unitHasDecimal) {
return false; // only allow non-integers for smallest unit
}
if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
unitHasDecimal = true;
}
}
}
return true;
}
function isValid$1() {
return this._isValid;
}
function createInvalid$1() {
return createDuration(NaN);
}
function Duration (duration) {
var normalizedInput = normalizeObjectUnits(duration),
years = normalizedInput.year || 0,
quarters = normalizedInput.quarter || 0,
months = normalizedInput.month || 0,
weeks = normalizedInput.week || 0,
days = normalizedInput.day || 0,
hours = normalizedInput.hour || 0,
minutes = normalizedInput.minute || 0,
seconds = normalizedInput.second || 0,
milliseconds = normalizedInput.millisecond || 0;
this._isValid = isDurationValid(normalizedInput);
// representation for dateAddRemove
this._milliseconds = +milliseconds +
seconds * 1e3 + // 1000
minutes * 6e4 + // 1000 * 60
hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
// Because of dateAddRemove treats 24 hours as different from a
// day when working around DST, we need to store them separately
this._days = +days +
weeks * 7;
// It is impossible to translate months into days without knowing
// which months you are are talking about, so we have to store
// it separately.
this._months = +months +
quarters * 3 +
years * 12;
this._data = {};
this._locale = getLocale();
this._bubble();
}
function isDuration (obj) {
return obj instanceof Duration;
}
function absRound (number) {
if (number < 0) {
return Math.round(-1 * number) * -1;
} else {
return Math.round(number);
}
}
// FORMATTING
function offset (token, separator) {
addFormatToken(token, 0, 0, function () {
var offset = this.utcOffset();
var sign = '+';
if (offset < 0) {
offset = -offset;
sign = '-';
}
return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
});
}
offset('Z', ':');
offset('ZZ', '');
// PARSING
addRegexToken('Z', matchShortOffset);
addRegexToken('ZZ', matchShortOffset);
addParseToken(['Z', 'ZZ'], function (input, array, config) {
config._useUTC = true;
config._tzm = offsetFromString(matchShortOffset, input);
});
// HELPERS
// timezone chunker
// '+10:00' > ['10', '00']
// '-1530' > ['-15', '30']
var chunkOffset = /([\+\-]|\d\d)/gi;
function offsetFromString(matcher, string) {
var matches = (string || '').match(matcher);
if (matches === null) {
return null;
}
var chunk = matches[matches.length - 1] || [];
var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
var minutes = +(parts[1] * 60) + toInt(parts[2]);
return minutes === 0 ?
0 :
parts[0] === '+' ? minutes : -minutes;
}
// Return a moment from input, that is local/utc/zone equivalent to model.
function cloneWithOffset(input, model) {
var res, diff;
if (model._isUTC) {
res = model.clone();
diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
// Use low-level api, because this fn is low-level api.
res._d.setTime(res._d.valueOf() + diff);
hooks.updateOffset(res, false);
return res;
} else {
return createLocal(input).local();
}
}
function getDateOffset (m) {
// On Firefox.24 Date#getTimezoneOffset returns a floating point.
// https://github.com/moment/moment/pull/1871
return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
}
// HOOKS
// This function will be called whenever a moment is mutated.
// It is intended to keep the offset in sync with the timezone.
hooks.updateOffset = function () {};
// MOMENTS
// keepLocalTime = true means only change the timezone, without
// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
// +0200, so we adjust the time as needed, to be valid.
//
// Keeping the time actually adds/subtracts (one hour)
// from the actual represented time. That is why we call updateOffset
// a second time. In case it wants us to change the offset again
// _changeInProgress == true case, then we have to adjust, because
// there is no such time in the given timezone.
function getSetOffset (input, keepLocalTime, keepMinutes) {
var offset = this._offset || 0,
localAdjust;
if (!this.isValid()) {
return input != null ? this : NaN;
}
if (input != null) {
if (typeof input === 'string') {
input = offsetFromString(matchShortOffset, input);
if (input === null) {
return this;
}
} else if (Math.abs(input) < 16 && !keepMinutes) {
input = input * 60;
}
if (!this._isUTC && keepLocalTime) {
localAdjust = getDateOffset(this);
}
this._offset = input;
this._isUTC = true;
if (localAdjust != null) {
this.add(localAdjust, 'm');
}
if (offset !== input) {
if (!keepLocalTime || this._changeInProgress) {
addSubtract(this, createDuration(input - offset, 'm'), 1, false);
} else if (!this._changeInProgress) {
this._changeInProgress = true;
hooks.updateOffset(this, true);
this._changeInProgress = null;
}
}
return this;
} else {
return this._isUTC ? offset : getDateOffset(this);
}
}
function getSetZone (input, keepLocalTime) {
if (input != null) {
if (typeof input !== 'string') {
input = -input;
}
this.utcOffset(input, keepLocalTime);
return this;
} else {
return -this.utcOffset();
}
}
function setOffsetToUTC (keepLocalTime) {
return this.utcOffset(0, keepLocalTime);
}
function setOffsetToLocal (keepLocalTime) {
if (this._isUTC) {
this.utcOffset(0, keepLocalTime);
this._isUTC = false;
if (keepLocalTime) {
this.subtract(getDateOffset(this), 'm');
}
}
return this;
}
function setOffsetToParsedOffset () {
if (this._tzm != null) {
this.utcOffset(this._tzm, false, true);
} else if (typeof this._i === 'string') {
var tZone = offsetFromString(matchOffset, this._i);
if (tZone != null) {
this.utcOffset(tZone);
}
else {
this.utcOffset(0, true);
}
}
return this;
}
function hasAlignedHourOffset (input) {
if (!this.isValid()) {
return false;
}
input = input ? createLocal(input).utcOffset() : 0;
return (this.utcOffset() - input) % 60 === 0;
}
function isDaylightSavingTime () {
return (
this.utcOffset() > this.clone().month(0).utcOffset() ||
this.utcOffset() > this.clone().month(5).utcOffset()
);
}
function isDaylightSavingTimeShifted () {
if (!isUndefined(this._isDSTShifted)) {
return this._isDSTShifted;
}
var c = {};
copyConfig(c, this);
c = prepareConfig(c);
if (c._a) {
var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
this._isDSTShifted = this.isValid() &&
compareArrays(c._a, other.toArray()) > 0;
} else {
this._isDSTShifted = false;
}
return this._isDSTShifted;
}
function isLocal () {
return this.isValid() ? !this._isUTC : false;
}
function isUtcOffset () {
return this.isValid() ? this._isUTC : false;
}
function isUtc () {
return this.isValid() ? this._isUTC && this._offset === 0 : false;
}
// ASP.NET json date format regex
var aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
// and further modified to allow for strings containing both week and day
var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
function createDuration (input, key) {
var duration = input,
// matching against regexp is expensive, do it on demand
match = null,
sign,
ret,
diffRes;
if (isDuration(input)) {
duration = {
ms : input._milliseconds,
d : input._days,
M : input._months
};
} else if (isNumber(input)) {
duration = {};
if (key) {
duration[key] = input;
} else {
duration.milliseconds = input;
}
} else if (!!(match = aspNetRegex.exec(input))) {
sign = (match[1] === '-') ? -1 : 1;
duration = {
y : 0,
d : toInt(match[DATE]) * sign,
h : toInt(match[HOUR]) * sign,
m : toInt(match[MINUTE]) * sign,
s : toInt(match[SECOND]) * sign,
ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
};
} else if (!!(match = isoRegex.exec(input))) {
sign = (match[1] === '-') ? -1 : (match[1] === '+') ? 1 : 1;
duration = {
y : parseIso(match[2], sign),
M : parseIso(match[3], sign),
w : parseIso(match[4], sign),
d : parseIso(match[5], sign),
h : parseIso(match[6], sign),
m : parseIso(match[7], sign),
s : parseIso(match[8], sign)
};
} else if (duration == null) {// checks for null or undefined
duration = {};
} else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
duration = {};
duration.ms = diffRes.milliseconds;
duration.M = diffRes.months;
}
ret = new Duration(duration);
if (isDuration(input) && hasOwnProp(input, '_locale')) {
ret._locale = input._locale;
}
return ret;
}
createDuration.fn = Duration.prototype;
createDuration.invalid = createInvalid$1;
function parseIso (inp, sign) {
// We'd normally use ~~inp for this, but unfortunately it also
// converts floats to ints.
// inp may be undefined, so careful calling replace on it.
var res = inp && parseFloat(inp.replace(',', '.'));
// apply sign while we're at it
return (isNaN(res) ? 0 : res) * sign;
}
function positiveMomentsDifference(base, other) {
var res = {milliseconds: 0, months: 0};
res.months = other.month() - base.month() +
(other.year() - base.year()) * 12;
if (base.clone().add(res.months, 'M').isAfter(other)) {
--res.months;
}
res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
return res;
}
function momentsDifference(base, other) {
var res;
if (!(base.isValid() && other.isValid())) {
return {milliseconds: 0, months: 0};
}
other = cloneWithOffset(other, base);
if (base.isBefore(other)) {
res = positiveMomentsDifference(base, other);
} else {
res = positiveMomentsDifference(other, base);
res.milliseconds = -res.milliseconds;
res.months = -res.months;
}
return res;
}
// TODO: remove 'name' arg after deprecation is removed
function createAdder(direction, name) {
return function (val, period) {
var dur, tmp;
//invert the arguments, but complain about it
if (period !== null && !isNaN(+period)) {
deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
tmp = val; val = period; period = tmp;
}
val = typeof val === 'string' ? +val : val;
dur = createDuration(val, period);
addSubtract(this, dur, direction);
return this;
};
}
function addSubtract (mom, duration, isAdding, updateOffset) {
var milliseconds = duration._milliseconds,
days = absRound(duration._days),
months = absRound(duration._months);
if (!mom.isValid()) {
// No op
return;
}
updateOffset = updateOffset == null ? true : updateOffset;
if (months) {
setMonth(mom, get(mom, 'Month') + months * isAdding);
}
if (days) {
set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
}
if (milliseconds) {
mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
}
if (updateOffset) {
hooks.updateOffset(mom, days || months);
}
}
var add = createAdder(1, 'add');
var subtract = createAdder(-1, 'subtract');
function getCalendarFormat(myMoment, now) {
var diff = myMoment.diff(now, 'days', true);
return diff < -6 ? 'sameElse' :
diff < -1 ? 'lastWeek' :
diff < 0 ? 'lastDay' :
diff < 1 ? 'sameDay' :
diff < 2 ? 'nextDay' :
diff < 7 ? 'nextWeek' : 'sameElse';
}
function calendar$1 (time, formats) {
// We want to compare the start of today, vs this.
// Getting start-of-today depends on whether we're local/utc/offset or not.
var now = time || createLocal(),
sod = cloneWithOffset(now, this).startOf('day'),
format = hooks.calendarFormat(this, sod) || 'sameElse';
var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
}
function clone () {
return new Moment(this);
}
function isAfter (input, units) {
var localInput = isMoment(input) ? input : createLocal(input);
if (!(this.isValid() && localInput.isValid())) {
return false;
}
units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
if (units === 'millisecond') {
return this.valueOf() > localInput.valueOf();
} else {
return localInput.valueOf() < this.clone().startOf(units).valueOf();
}
}
function isBefore (input, units) {
var localInput = isMoment(input) ? input : createLocal(input);
if (!(this.isValid() && localInput.isValid())) {
return false;
}
units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
if (units === 'millisecond') {
return this.valueOf() < localInput.valueOf();
} else {
return this.clone().endOf(units).valueOf() < localInput.valueOf();
}
}
function isBetween (from, to, units, inclusivity) {
inclusivity = inclusivity || '()';
return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&
(inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
}
function isSame (input, units) {
var localInput = isMoment(input) ? input : createLocal(input),
inputMs;
if (!(this.isValid() && localInput.isValid())) {
return false;
}
units = normalizeUnits(units || 'millisecond');
if (units === 'millisecond') {
return this.valueOf() === localInput.valueOf();
} else {
inputMs = localInput.valueOf();
return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
}
}
function isSameOrAfter (input, units) {
return this.isSame(input, units) || this.isAfter(input,units);
}
function isSameOrBefore (input, units) {
return this.isSame(input, units) || this.isBefore(input,units);
}
function diff (input, units, asFloat) {
var that,
zoneDelta,
delta, output;
if (!this.isValid()) {
return NaN;
}
that = cloneWithOffset(input, this);
if (!that.isValid()) {
return NaN;
}
zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
units = normalizeUnits(units);
switch (units) {
case 'year': output = monthDiff(this, that) / 12; break;
case 'month': output = monthDiff(this, that); break;
case 'quarter': output = monthDiff(this, that) / 3; break;
case 'second': output = (this - that) / 1e3; break; // 1000
case 'minute': output = (this - that) / 6e4; break; // 1000 * 60
case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60
case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst
case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst
default: output = this - that;
}
return asFloat ? output : absFloor(output);
}
function monthDiff (a, b) {
// difference in months
var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
// b is in (anchor - 1 month, anchor + 1 month)
anchor = a.clone().add(wholeMonthDiff, 'months'),
anchor2, adjust;
if (b - anchor < 0) {
anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
// linear across the month
adjust = (b - anchor) / (anchor - anchor2);
} else {
anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
// linear across the month
adjust = (b - anchor) / (anchor2 - anchor);
}
//check for negative zero, return zero if negative zero
return -(wholeMonthDiff + adjust) || 0;
}
hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
function toString () {
return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
}
function toISOString(keepOffset) {
if (!this.isValid()) {
return null;
}
var utc = keepOffset !== true;
var m = utc ? this.clone().utc() : this;
if (m.year() < 0 || m.year() > 9999) {
return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ');
}
if (isFunction(Date.prototype.toISOString)) {
// native implementation is ~50x faster, use it when we can
if (utc) {
return this.toDate().toISOString();
} else {
return new Date(this._d.valueOf()).toISOString().replace('Z', formatMoment(m, 'Z'));
}
}
return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ');
}
/**
* Return a human readable representation of a moment that can
* also be evaluated to get a new moment which is the same
*
* @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
*/
function inspect () {
if (!this.isValid()) {
return 'moment.invalid(/* ' + this._i + ' */)';
}
var func = 'moment';
var zone = '';
if (!this.isLocal()) {
func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
zone = 'Z';
}
var prefix = '[' + func + '("]';
var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';
var datetime = '-MM-DD[T]HH:mm:ss.SSS';
var suffix = zone + '[")]';
return this.format(prefix + year + datetime + suffix);
}
function format (inputString) {
if (!inputString) {
inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
}
var output = formatMoment(this, inputString);
return this.localeData().postformat(output);
}
function from (time, withoutSuffix) {
if (this.isValid() &&
((isMoment(time) && time.isValid()) ||
createLocal(time).isValid())) {
return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
} else {
return this.localeData().invalidDate();
}
}
function fromNow (withoutSuffix) {
return this.from(createLocal(), withoutSuffix);
}
function to (time, withoutSuffix) {
if (this.isValid() &&
((isMoment(time) && time.isValid()) ||
createLocal(time).isValid())) {
return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
} else {
return this.localeData().invalidDate();
}
}
function toNow (withoutSuffix) {
return this.to(createLocal(), withoutSuffix);
}
// If passed a locale key, it will set the locale for this
// instance. Otherwise, it will return the locale configuration
// variables for this instance.
function locale (key) {
var newLocaleData;
if (key === undefined) {
return this._locale._abbr;
} else {
newLocaleData = getLocale(key);
if (newLocaleData != null) {
this._locale = newLocaleData;
}
return this;
}
}
var lang = deprecate(
'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
function (key) {
if (key === undefined) {
return this.localeData();
} else {
return this.locale(key);
}
}
);
function localeData () {
return this._locale;
}
function startOf (units) {
units = normalizeUnits(units);
// the following switch intentionally omits break keywords
// to utilize falling through the cases.
switch (units) {
case 'year':
this.month(0);
/* falls through */
case 'quarter':
case 'month':
this.date(1);
/* falls through */
case 'week':
case 'isoWeek':
case 'day':
case 'date':
this.hours(0);
/* falls through */
case 'hour':
this.minutes(0);
/* falls through */
case 'minute':
this.seconds(0);
/* falls through */
case 'second':
this.milliseconds(0);
}
// weeks are a special case
if (units === 'week') {
this.weekday(0);
}
if (units === 'isoWeek') {
this.isoWeekday(1);
}
// quarters are also special
if (units === 'quarter') {
this.month(Math.floor(this.month() / 3) * 3);
}
return this;
}
function endOf (units) {
units = normalizeUnits(units);
if (units === undefined || units === 'millisecond') {
return this;
}
// 'date' is an alias for 'day', so it should be considered as such.
if (units === 'date') {
units = 'day';
}
return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
}
function valueOf () {
return this._d.valueOf() - ((this._offset || 0) * 60000);
}
function unix () {
return Math.floor(this.valueOf() / 1000);
}
function toDate () {
return new Date(this.valueOf());
}
function toArray () {
var m = this;
return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
}
function toObject () {
var m = this;
return {
years: m.year(),
months: m.month(),
date: m.date(),
hours: m.hours(),
minutes: m.minutes(),
seconds: m.seconds(),
milliseconds: m.milliseconds()
};
}
function toJSON () {
// new Date(NaN).toJSON() === null
return this.isValid() ? this.toISOString() : null;
}
function isValid$2 () {
return isValid(this);
}
function parsingFlags () {
return extend({}, getParsingFlags(this));
}
function invalidAt () {
return getParsingFlags(this).overflow;
}
function creationData() {
return {
input: this._i,
format: this._f,
locale: this._locale,
isUTC: this._isUTC,
strict: this._strict
};
}
// FORMATTING
addFormatToken(0, ['gg', 2], 0, function () {
return this.weekYear() % 100;
});
addFormatToken(0, ['GG', 2], 0, function () {
return this.isoWeekYear() % 100;
});
function addWeekYearFormatToken (token, getter) {
addFormatToken(0, [token, token.length], 0, getter);
}
addWeekYearFormatToken('gggg', 'weekYear');
addWeekYearFormatToken('ggggg', 'weekYear');
addWeekYearFormatToken('GGGG', 'isoWeekYear');
addWeekYearFormatToken('GGGGG', 'isoWeekYear');
// ALIASES
addUnitAlias('weekYear', 'gg');
addUnitAlias('isoWeekYear', 'GG');
// PRIORITY
addUnitPriority('weekYear', 1);
addUnitPriority('isoWeekYear', 1);
// PARSING
addRegexToken('G', matchSigned);
addRegexToken('g', matchSigned);
addRegexToken('GG', match1to2, match2);
addRegexToken('gg', match1to2, match2);
addRegexToken('GGGG', match1to4, match4);
addRegexToken('gggg', match1to4, match4);
addRegexToken('GGGGG', match1to6, match6);
addRegexToken('ggggg', match1to6, match6);
addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
week[token.substr(0, 2)] = toInt(input);
});
addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
week[token] = hooks.parseTwoDigitYear(input);
});
// MOMENTS
function getSetWeekYear (input) {
return getSetWeekYearHelper.call(this,
input,
this.week(),
this.weekday(),
this.localeData()._week.dow,
this.localeData()._week.doy);
}
function getSetISOWeekYear (input) {
return getSetWeekYearHelper.call(this,
input, this.isoWeek(), this.isoWeekday(), 1, 4);
}
function getISOWeeksInYear () {
return weeksInYear(this.year(), 1, 4);
}
function getWeeksInYear () {
var weekInfo = this.localeData()._week;
return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
}
function getSetWeekYearHelper(input, week, weekday, dow, doy) {
var weeksTarget;
if (input == null) {
return weekOfYear(this, dow, doy).year;
} else {
weeksTarget = weeksInYear(input, dow, doy);
if (week > weeksTarget) {
week = weeksTarget;
}
return setWeekAll.call(this, input, week, weekday, dow, doy);
}
}
function setWeekAll(weekYear, week, weekday, dow, doy) {
var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
this.year(date.getUTCFullYear());
this.month(date.getUTCMonth());
this.date(date.getUTCDate());
return this;
}
// FORMATTING
addFormatToken('Q', 0, 'Qo', 'quarter');
// ALIASES
addUnitAlias('quarter', 'Q');
// PRIORITY
addUnitPriority('quarter', 7);
// PARSING
addRegexToken('Q', match1);
addParseToken('Q', function (input, array) {
array[MONTH] = (toInt(input) - 1) * 3;
});
// MOMENTS
function getSetQuarter (input) {
return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
}
// FORMATTING
addFormatToken('D', ['DD', 2], 'Do', 'date');
// ALIASES
addUnitAlias('date', 'D');
// PRIOROITY
addUnitPriority('date', 9);
// PARSING
addRegexToken('D', match1to2);
addRegexToken('DD', match1to2, match2);
addRegexToken('Do', function (isStrict, locale) {
// TODO: Remove "ordinalParse" fallback in next major release.
return isStrict ?
(locale._dayOfMonthOrdinalParse || locale._ordinalParse) :
locale._dayOfMonthOrdinalParseLenient;
});
addParseToken(['D', 'DD'], DATE);
addParseToken('Do', function (input, array) {
array[DATE] = toInt(input.match(match1to2)[0]);
});
// MOMENTS
var getSetDayOfMonth = makeGetSet('Date', true);
// FORMATTING
addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
// ALIASES
addUnitAlias('dayOfYear', 'DDD');
// PRIORITY
addUnitPriority('dayOfYear', 4);
// PARSING
addRegexToken('DDD', match1to3);
addRegexToken('DDDD', match3);
addParseToken(['DDD', 'DDDD'], function (input, array, config) {
config._dayOfYear = toInt(input);
});
// HELPERS
// MOMENTS
function getSetDayOfYear (input) {
var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
}
// FORMATTING
addFormatToken('m', ['mm', 2], 0, 'minute');
// ALIASES
addUnitAlias('minute', 'm');
// PRIORITY
addUnitPriority('minute', 14);
// PARSING
addRegexToken('m', match1to2);
addRegexToken('mm', match1to2, match2);
addParseToken(['m', 'mm'], MINUTE);
// MOMENTS
var getSetMinute = makeGetSet('Minutes', false);
// FORMATTING
addFormatToken('s', ['ss', 2], 0, 'second');
// ALIASES
addUnitAlias('second', 's');
// PRIORITY
addUnitPriority('second', 15);
// PARSING
addRegexToken('s', match1to2);
addRegexToken('ss', match1to2, match2);
addParseToken(['s', 'ss'], SECOND);
// MOMENTS
var getSetSecond = makeGetSet('Seconds', false);
// FORMATTING
addFormatToken('S', 0, 0, function () {
return ~~(this.millisecond() / 100);
});
addFormatToken(0, ['SS', 2], 0, function () {
return ~~(this.millisecond() / 10);
});
addFormatToken(0, ['SSS', 3], 0, 'millisecond');
addFormatToken(0, ['SSSS', 4], 0, function () {
return this.millisecond() * 10;
});
addFormatToken(0, ['SSSSS', 5], 0, function () {
return this.millisecond() * 100;
});
addFormatToken(0, ['SSSSSS', 6], 0, function () {
return this.millisecond() * 1000;
});
addFormatToken(0, ['SSSSSSS', 7], 0, function () {
return this.millisecond() * 10000;
});
addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
return this.millisecond() * 100000;
});
addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
return this.millisecond() * 1000000;
});
// ALIASES
addUnitAlias('millisecond', 'ms');
// PRIORITY
addUnitPriority('millisecond', 16);
// PARSING
addRegexToken('S', match1to3, match1);
addRegexToken('SS', match1to3, match2);
addRegexToken('SSS', match1to3, match3);
var token;
for (token = 'SSSS'; token.length <= 9; token += 'S') {
addRegexToken(token, matchUnsigned);
}
function parseMs(input, array) {
array[MILLISECOND] = toInt(('0.' + input) * 1000);
}
for (token = 'S'; token.length <= 9; token += 'S') {
addParseToken(token, parseMs);
}
// MOMENTS
var getSetMillisecond = makeGetSet('Milliseconds', false);
// FORMATTING
addFormatToken('z', 0, 0, 'zoneAbbr');
addFormatToken('zz', 0, 0, 'zoneName');
// MOMENTS
function getZoneAbbr () {
return this._isUTC ? 'UTC' : '';
}
function getZoneName () {
return this._isUTC ? 'Coordinated Universal Time' : '';
}
var proto = Moment.prototype;
proto.add = add;
proto.calendar = calendar$1;
proto.clone = clone;
proto.diff = diff;
proto.endOf = endOf;
proto.format = format;
proto.from = from;
proto.fromNow = fromNow;
proto.to = to;
proto.toNow = toNow;
proto.get = stringGet;
proto.invalidAt = invalidAt;
proto.isAfter = isAfter;
proto.isBefore = isBefore;
proto.isBetween = isBetween;
proto.isSame = isSame;
proto.isSameOrAfter = isSameOrAfter;
proto.isSameOrBefore = isSameOrBefore;
proto.isValid = isValid$2;
proto.lang = lang;
proto.locale = locale;
proto.localeData = localeData;
proto.max = prototypeMax;
proto.min = prototypeMin;
proto.parsingFlags = parsingFlags;
proto.set = stringSet;
proto.startOf = startOf;
proto.subtract = subtract;
proto.toArray = toArray;
proto.toObject = toObject;
proto.toDate = toDate;
proto.toISOString = toISOString;
proto.inspect = inspect;
proto.toJSON = toJSON;
proto.toString = toString;
proto.unix = unix;
proto.valueOf = valueOf;
proto.creationData = creationData;
// Year
proto.year = getSetYear;
proto.isLeapYear = getIsLeapYear;
// Week Year
proto.weekYear = getSetWeekYear;
proto.isoWeekYear = getSetISOWeekYear;
// Quarter
proto.quarter = proto.quarters = getSetQuarter;
// Month
proto.month = getSetMonth;
proto.daysInMonth = getDaysInMonth;
// Week
proto.week = proto.weeks = getSetWeek;
proto.isoWeek = proto.isoWeeks = getSetISOWeek;
proto.weeksInYear = getWeeksInYear;
proto.isoWeeksInYear = getISOWeeksInYear;
// Day
proto.date = getSetDayOfMonth;
proto.day = proto.days = getSetDayOfWeek;
proto.weekday = getSetLocaleDayOfWeek;
proto.isoWeekday = getSetISODayOfWeek;
proto.dayOfYear = getSetDayOfYear;
// Hour
proto.hour = proto.hours = getSetHour;
// Minute
proto.minute = proto.minutes = getSetMinute;
// Second
proto.second = proto.seconds = getSetSecond;
// Millisecond
proto.millisecond = proto.milliseconds = getSetMillisecond;
// Offset
proto.utcOffset = getSetOffset;
proto.utc = setOffsetToUTC;
proto.local = setOffsetToLocal;
proto.parseZone = setOffsetToParsedOffset;
proto.hasAlignedHourOffset = hasAlignedHourOffset;
proto.isDST = isDaylightSavingTime;
proto.isLocal = isLocal;
proto.isUtcOffset = isUtcOffset;
proto.isUtc = isUtc;
proto.isUTC = isUtc;
// Timezone
proto.zoneAbbr = getZoneAbbr;
proto.zoneName = getZoneName;
// Deprecations
proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
function createUnix (input) {
return createLocal(input * 1000);
}
function createInZone () {
return createLocal.apply(null, arguments).parseZone();
}
function preParsePostFormat (string) {
return string;
}
var proto$1 = Locale.prototype;
proto$1.calendar = calendar;
proto$1.longDateFormat = longDateFormat;
proto$1.invalidDate = invalidDate;
proto$1.ordinal = ordinal;
proto$1.preparse = preParsePostFormat;
proto$1.postformat = preParsePostFormat;
proto$1.relativeTime = relativeTime;
proto$1.pastFuture = pastFuture;
proto$1.set = set;
// Month
proto$1.months = localeMonths;
proto$1.monthsShort = localeMonthsShort;
proto$1.monthsParse = localeMonthsParse;
proto$1.monthsRegex = monthsRegex;
proto$1.monthsShortRegex = monthsShortRegex;
// Week
proto$1.week = localeWeek;
proto$1.firstDayOfYear = localeFirstDayOfYear;
proto$1.firstDayOfWeek = localeFirstDayOfWeek;
// Day of Week
proto$1.weekdays = localeWeekdays;
proto$1.weekdaysMin = localeWeekdaysMin;
proto$1.weekdaysShort = localeWeekdaysShort;
proto$1.weekdaysParse = localeWeekdaysParse;
proto$1.weekdaysRegex = weekdaysRegex;
proto$1.weekdaysShortRegex = weekdaysShortRegex;
proto$1.weekdaysMinRegex = weekdaysMinRegex;
// Hours
proto$1.isPM = localeIsPM;
proto$1.meridiem = localeMeridiem;
function get$1 (format, index, field, setter) {
var locale = getLocale();
var utc = createUTC().set(setter, index);
return locale[field](utc, format);
}
function listMonthsImpl (format, index, field) {
if (isNumber(format)) {
index = format;
format = undefined;
}
format = format || '';
if (index != null) {
return get$1(format, index, field, 'month');
}
var i;
var out = [];
for (i = 0; i < 12; i++) {
out[i] = get$1(format, i, field, 'month');
}
return out;
}
// ()
// (5)
// (fmt, 5)
// (fmt)
// (true)
// (true, 5)
// (true, fmt, 5)
// (true, fmt)
function listWeekdaysImpl (localeSorted, format, index, field) {
if (typeof localeSorted === 'boolean') {
if (isNumber(format)) {
index = format;
format = undefined;
}
format = format || '';
} else {
format = localeSorted;
index = format;
localeSorted = false;
if (isNumber(format)) {
index = format;
format = undefined;
}
format = format || '';
}
var locale = getLocale(),
shift = localeSorted ? locale._week.dow : 0;
if (index != null) {
return get$1(format, (index + shift) % 7, field, 'day');
}
var i;
var out = [];
for (i = 0; i < 7; i++) {
out[i] = get$1(format, (i + shift) % 7, field, 'day');
}
return out;
}
function listMonths (format, index) {
return listMonthsImpl(format, index, 'months');
}
function listMonthsShort (format, index) {
return listMonthsImpl(format, index, 'monthsShort');
}
function listWeekdays (localeSorted, format, index) {
return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
}
function listWeekdaysShort (localeSorted, format, index) {
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
}
function listWeekdaysMin (localeSorted, format, index) {
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
}
getSetGlobalLocale('en', {
dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
ordinal : function (number) {
var b = number % 10,
output = (toInt(number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
return number + output;
}
});
// Side effect imports
hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
var mathAbs = Math.abs;
function abs () {
var data = this._data;
this._milliseconds = mathAbs(this._milliseconds);
this._days = mathAbs(this._days);
this._months = mathAbs(this._months);
data.milliseconds = mathAbs(data.milliseconds);
data.seconds = mathAbs(data.seconds);
data.minutes = mathAbs(data.minutes);
data.hours = mathAbs(data.hours);
data.months = mathAbs(data.months);
data.years = mathAbs(data.years);
return this;
}
function addSubtract$1 (duration, input, value, direction) {
var other = createDuration(input, value);
duration._milliseconds += direction * other._milliseconds;
duration._days += direction * other._days;
duration._months += direction * other._months;
return duration._bubble();
}
// supports only 2.0-style add(1, 's') or add(duration)
function add$1 (input, value) {
return addSubtract$1(this, input, value, 1);
}
// supports only 2.0-style subtract(1, 's') or subtract(duration)
function subtract$1 (input, value) {
return addSubtract$1(this, input, value, -1);
}
function absCeil (number) {
if (number < 0) {
return Math.floor(number);
} else {
return Math.ceil(number);
}
}
function bubble () {
var milliseconds = this._milliseconds;
var days = this._days;
var months = this._months;
var data = this._data;
var seconds, minutes, hours, years, monthsFromDays;
// if we have a mix of positive and negative values, bubble down first
// check: https://github.com/moment/moment/issues/2166
if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
(milliseconds <= 0 && days <= 0 && months <= 0))) {
milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
days = 0;
months = 0;
}
// The following code bubbles up values, see the tests for
// examples of what that means.
data.milliseconds = milliseconds % 1000;
seconds = absFloor(milliseconds / 1000);
data.seconds = seconds % 60;
minutes = absFloor(seconds / 60);
data.minutes = minutes % 60;
hours = absFloor(minutes / 60);
data.hours = hours % 24;
days += absFloor(hours / 24);
// convert days to months
monthsFromDays = absFloor(daysToMonths(days));
months += monthsFromDays;
days -= absCeil(monthsToDays(monthsFromDays));
// 12 months -> 1 year
years = absFloor(months / 12);
months %= 12;
data.days = days;
data.months = months;
data.years = years;
return this;
}
function daysToMonths (days) {
// 400 years have 146097 days (taking into account leap year rules)
// 400 years have 12 months === 4800
return days * 4800 / 146097;
}
function monthsToDays (months) {
// the reverse of daysToMonths
return months * 146097 / 4800;
}
function as (units) {
if (!this.isValid()) {
return NaN;
}
var days;
var months;
var milliseconds = this._milliseconds;
units = normalizeUnits(units);
if (units === 'month' || units === 'year') {
days = this._days + milliseconds / 864e5;
months = this._months + daysToMonths(days);
return units === 'month' ? months : months / 12;
} else {
// handle milliseconds separately because of floating point math errors (issue #1867)
days = this._days + Math.round(monthsToDays(this._months));
switch (units) {
case 'week' : return days / 7 + milliseconds / 6048e5;
case 'day' : return days + milliseconds / 864e5;
case 'hour' : return days * 24 + milliseconds / 36e5;
case 'minute' : return days * 1440 + milliseconds / 6e4;
case 'second' : return days * 86400 + milliseconds / 1000;
// Math.floor prevents floating point math errors here
case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
default: throw new Error('Unknown unit ' + units);
}
}
}
// TODO: Use this.as('ms')?
function valueOf$1 () {
if (!this.isValid()) {
return NaN;
}
return (
this._milliseconds +
this._days * 864e5 +
(this._months % 12) * 2592e6 +
toInt(this._months / 12) * 31536e6
);
}
function makeAs (alias) {
return function () {
return this.as(alias);
};
}
var asMilliseconds = makeAs('ms');
var asSeconds = makeAs('s');
var asMinutes = makeAs('m');
var asHours = makeAs('h');
var asDays = makeAs('d');
var asWeeks = makeAs('w');
var asMonths = makeAs('M');
var asYears = makeAs('y');
function clone$1 () {
return createDuration(this);
}
function get$2 (units) {
units = normalizeUnits(units);
return this.isValid() ? this[units + 's']() : NaN;
}
function makeGetter(name) {
return function () {
return this.isValid() ? this._data[name] : NaN;
};
}
var milliseconds = makeGetter('milliseconds');
var seconds = makeGetter('seconds');
var minutes = makeGetter('minutes');
var hours = makeGetter('hours');
var days = makeGetter('days');
var months = makeGetter('months');
var years = makeGetter('years');
function weeks () {
return absFloor(this.days() / 7);
}
var round = Math.round;
var thresholds = {
ss: 44, // a few seconds to seconds
s : 45, // seconds to minute
m : 45, // minutes to hour
h : 22, // hours to day
d : 26, // days to month
M : 11 // months to year
};
// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
}
function relativeTime$1 (posNegDuration, withoutSuffix, locale) {
var duration = createDuration(posNegDuration).abs();
var seconds = round(duration.as('s'));
var minutes = round(duration.as('m'));
var hours = round(duration.as('h'));
var days = round(duration.as('d'));
var months = round(duration.as('M'));
var years = round(duration.as('y'));
var a = seconds <= thresholds.ss && ['s', seconds] ||
seconds < thresholds.s && ['ss', seconds] ||
minutes <= 1 && ['m'] ||
minutes < thresholds.m && ['mm', minutes] ||
hours <= 1 && ['h'] ||
hours < thresholds.h && ['hh', hours] ||
days <= 1 && ['d'] ||
days < thresholds.d && ['dd', days] ||
months <= 1 && ['M'] ||
months < thresholds.M && ['MM', months] ||
years <= 1 && ['y'] || ['yy', years];
a[2] = withoutSuffix;
a[3] = +posNegDuration > 0;
a[4] = locale;
return substituteTimeAgo.apply(null, a);
}
// This function allows you to set the rounding function for relative time strings
function getSetRelativeTimeRounding (roundingFunction) {
if (roundingFunction === undefined) {
return round;
}
if (typeof(roundingFunction) === 'function') {
round = roundingFunction;
return true;
}
return false;
}
// This function allows you to set a threshold for relative time strings
function getSetRelativeTimeThreshold (threshold, limit) {
if (thresholds[threshold] === undefined) {
return false;
}
if (limit === undefined) {
return thresholds[threshold];
}
thresholds[threshold] = limit;
if (threshold === 's') {
thresholds.ss = limit - 1;
}
return true;
}
function humanize (withSuffix) {
if (!this.isValid()) {
return this.localeData().invalidDate();
}
var locale = this.localeData();
var output = relativeTime$1(this, !withSuffix, locale);
if (withSuffix) {
output = locale.pastFuture(+this, output);
}
return locale.postformat(output);
}
var abs$1 = Math.abs;
function sign(x) {
return ((x > 0) - (x < 0)) || +x;
}
function toISOString$1() {
// for ISO strings we do not use the normal bubbling rules:
// * milliseconds bubble up until they become hours
// * days do not bubble at all
// * months bubble up until they become years
// This is because there is no context-free conversion between hours and days
// (think of clock changes)
// and also not between days and months (28-31 days per month)
if (!this.isValid()) {
return this.localeData().invalidDate();
}
var seconds = abs$1(this._milliseconds) / 1000;
var days = abs$1(this._days);
var months = abs$1(this._months);
var minutes, hours, years;
// 3600 seconds -> 60 minutes -> 1 hour
minutes = absFloor(seconds / 60);
hours = absFloor(minutes / 60);
seconds %= 60;
minutes %= 60;
// 12 months -> 1 year
years = absFloor(months / 12);
months %= 12;
// inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
var Y = years;
var M = months;
var D = days;
var h = hours;
var m = minutes;
var s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
var total = this.asSeconds();
if (!total) {
// this is the same as C#'s (Noda) and python (isodate)...
// but not other JS (goog.date)
return 'P0D';
}
var totalSign = total < 0 ? '-' : '';
var ymSign = sign(this._months) !== sign(total) ? '-' : '';
var daysSign = sign(this._days) !== sign(total) ? '-' : '';
var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
return totalSign + 'P' +
(Y ? ymSign + Y + 'Y' : '') +
(M ? ymSign + M + 'M' : '') +
(D ? daysSign + D + 'D' : '') +
((h || m || s) ? 'T' : '') +
(h ? hmsSign + h + 'H' : '') +
(m ? hmsSign + m + 'M' : '') +
(s ? hmsSign + s + 'S' : '');
}
var proto$2 = Duration.prototype;
proto$2.isValid = isValid$1;
proto$2.abs = abs;
proto$2.add = add$1;
proto$2.subtract = subtract$1;
proto$2.as = as;
proto$2.asMilliseconds = asMilliseconds;
proto$2.asSeconds = asSeconds;
proto$2.asMinutes = asMinutes;
proto$2.asHours = asHours;
proto$2.asDays = asDays;
proto$2.asWeeks = asWeeks;
proto$2.asMonths = asMonths;
proto$2.asYears = asYears;
proto$2.valueOf = valueOf$1;
proto$2._bubble = bubble;
proto$2.clone = clone$1;
proto$2.get = get$2;
proto$2.milliseconds = milliseconds;
proto$2.seconds = seconds;
proto$2.minutes = minutes;
proto$2.hours = hours;
proto$2.days = days;
proto$2.weeks = weeks;
proto$2.months = months;
proto$2.years = years;
proto$2.humanize = humanize;
proto$2.toISOString = toISOString$1;
proto$2.toString = toISOString$1;
proto$2.toJSON = toISOString$1;
proto$2.locale = locale;
proto$2.localeData = localeData;
// Deprecations
proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
proto$2.lang = lang;
// Side effect imports
// FORMATTING
addFormatToken('X', 0, 0, 'unix');
addFormatToken('x', 0, 0, 'valueOf');
// PARSING
addRegexToken('x', matchSigned);
addRegexToken('X', matchTimestamp);
addParseToken('X', function (input, array, config) {
config._d = new Date(parseFloat(input, 10) * 1000);
});
addParseToken('x', function (input, array, config) {
config._d = new Date(toInt(input));
});
// Side effect imports
hooks.version = '2.20.1';
setHookCallback(createLocal);
hooks.fn = proto;
hooks.min = min;
hooks.max = max;
hooks.now = now;
hooks.utc = createUTC;
hooks.unix = createUnix;
hooks.months = listMonths;
hooks.isDate = isDate;
hooks.locale = getSetGlobalLocale;
hooks.invalid = createInvalid;
hooks.duration = createDuration;
hooks.isMoment = isMoment;
hooks.weekdays = listWeekdays;
hooks.parseZone = createInZone;
hooks.localeData = getLocale;
hooks.isDuration = isDuration;
hooks.monthsShort = listMonthsShort;
hooks.weekdaysMin = listWeekdaysMin;
hooks.defineLocale = defineLocale;
hooks.updateLocale = updateLocale;
hooks.locales = listLocales;
hooks.weekdaysShort = listWeekdaysShort;
hooks.normalizeUnits = normalizeUnits;
hooks.relativeTimeRounding = getSetRelativeTimeRounding;
hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
hooks.calendarFormat = getCalendarFormat;
hooks.prototype = proto;
// currently HTML5 input type only supports 24-hour formats
hooks.HTML5_FMT = {
DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', //
DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', //
DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', //
DATE: 'YYYY-MM-DD', //
TIME: 'HH:mm', //
TIME_SECONDS: 'HH:mm:ss', //
TIME_MS: 'HH:mm:ss.SSS', //
WEEK: 'YYYY-[W]WW', //
MONTH: 'YYYY-MM' //
};
return hooks;
})));
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(210)(module)))
/***/ }),
/* 276 */
/***/ (function(module, exports, __webpack_require__) {
var map = {
"./af": 277,
"./af.js": 277,
"./ar": 278,
"./ar-dz": 279,
"./ar-dz.js": 279,
"./ar-kw": 280,
"./ar-kw.js": 280,
"./ar-ly": 281,
"./ar-ly.js": 281,
"./ar-ma": 282,
"./ar-ma.js": 282,
"./ar-sa": 283,
"./ar-sa.js": 283,
"./ar-tn": 284,
"./ar-tn.js": 284,
"./ar.js": 278,
"./az": 285,
"./az.js": 285,
"./be": 286,
"./be.js": 286,
"./bg": 287,
"./bg.js": 287,
"./bm": 288,
"./bm.js": 288,
"./bn": 289,
"./bn.js": 289,
"./bo": 290,
"./bo.js": 290,
"./br": 291,
"./br.js": 291,
"./bs": 292,
"./bs.js": 292,
"./ca": 293,
"./ca.js": 293,
"./cs": 294,
"./cs.js": 294,
"./cv": 295,
"./cv.js": 295,
"./cy": 296,
"./cy.js": 296,
"./da": 297,
"./da.js": 297,
"./de": 298,
"./de-at": 299,
"./de-at.js": 299,
"./de-ch": 300,
"./de-ch.js": 300,
"./de.js": 298,
"./dv": 301,
"./dv.js": 301,
"./el": 302,
"./el.js": 302,
"./en-au": 303,
"./en-au.js": 303,
"./en-ca": 304,
"./en-ca.js": 304,
"./en-gb": 305,
"./en-gb.js": 305,
"./en-ie": 306,
"./en-ie.js": 306,
"./en-nz": 307,
"./en-nz.js": 307,
"./eo": 308,
"./eo.js": 308,
"./es": 309,
"./es-do": 310,
"./es-do.js": 310,
"./es-us": 311,
"./es-us.js": 311,
"./es.js": 309,
"./et": 312,
"./et.js": 312,
"./eu": 313,
"./eu.js": 313,
"./fa": 314,
"./fa.js": 314,
"./fi": 315,
"./fi.js": 315,
"./fo": 316,
"./fo.js": 316,
"./fr": 317,
"./fr-ca": 318,
"./fr-ca.js": 318,
"./fr-ch": 319,
"./fr-ch.js": 319,
"./fr.js": 317,
"./fy": 320,
"./fy.js": 320,
"./gd": 321,
"./gd.js": 321,
"./gl": 322,
"./gl.js": 322,
"./gom-latn": 323,
"./gom-latn.js": 323,
"./gu": 324,
"./gu.js": 324,
"./he": 325,
"./he.js": 325,
"./hi": 326,
"./hi.js": 326,
"./hr": 327,
"./hr.js": 327,
"./hu": 328,
"./hu.js": 328,
"./hy-am": 329,
"./hy-am.js": 329,
"./id": 330,
"./id.js": 330,
"./is": 331,
"./is.js": 331,
"./it": 332,
"./it.js": 332,
"./ja": 333,
"./ja.js": 333,
"./jv": 334,
"./jv.js": 334,
"./ka": 335,
"./ka.js": 335,
"./kk": 336,
"./kk.js": 336,
"./km": 337,
"./km.js": 337,
"./kn": 338,
"./kn.js": 338,
"./ko": 339,
"./ko.js": 339,
"./ky": 340,
"./ky.js": 340,
"./lb": 341,
"./lb.js": 341,
"./lo": 342,
"./lo.js": 342,
"./lt": 343,
"./lt.js": 343,
"./lv": 344,
"./lv.js": 344,
"./me": 345,
"./me.js": 345,
"./mi": 346,
"./mi.js": 346,
"./mk": 347,
"./mk.js": 347,
"./ml": 348,
"./ml.js": 348,
"./mr": 349,
"./mr.js": 349,
"./ms": 350,
"./ms-my": 351,
"./ms-my.js": 351,
"./ms.js": 350,
"./mt": 352,
"./mt.js": 352,
"./my": 353,
"./my.js": 353,
"./nb": 354,
"./nb.js": 354,
"./ne": 355,
"./ne.js": 355,
"./nl": 356,
"./nl-be": 357,
"./nl-be.js": 357,
"./nl.js": 356,
"./nn": 358,
"./nn.js": 358,
"./pa-in": 359,
"./pa-in.js": 359,
"./pl": 360,
"./pl.js": 360,
"./pt": 361,
"./pt-br": 362,
"./pt-br.js": 362,
"./pt.js": 361,
"./ro": 363,
"./ro.js": 363,
"./ru": 364,
"./ru.js": 364,
"./sd": 365,
"./sd.js": 365,
"./se": 366,
"./se.js": 366,
"./si": 367,
"./si.js": 367,
"./sk": 368,
"./sk.js": 368,
"./sl": 369,
"./sl.js": 369,
"./sq": 370,
"./sq.js": 370,
"./sr": 371,
"./sr-cyrl": 372,
"./sr-cyrl.js": 372,
"./sr.js": 371,
"./ss": 373,
"./ss.js": 373,
"./sv": 374,
"./sv.js": 374,
"./sw": 375,
"./sw.js": 375,
"./ta": 376,
"./ta.js": 376,
"./te": 377,
"./te.js": 377,
"./tet": 378,
"./tet.js": 378,
"./th": 379,
"./th.js": 379,
"./tl-ph": 380,
"./tl-ph.js": 380,
"./tlh": 381,
"./tlh.js": 381,
"./tr": 382,
"./tr.js": 382,
"./tzl": 383,
"./tzl.js": 383,
"./tzm": 384,
"./tzm-latn": 385,
"./tzm-latn.js": 385,
"./tzm.js": 384,
"./uk": 386,
"./uk.js": 386,
"./ur": 387,
"./ur.js": 387,
"./uz": 388,
"./uz-latn": 389,
"./uz-latn.js": 389,
"./uz.js": 388,
"./vi": 390,
"./vi.js": 390,
"./x-pseudo": 391,
"./x-pseudo.js": 391,
"./yo": 392,
"./yo.js": 392,
"./zh-cn": 393,
"./zh-cn.js": 393,
"./zh-hk": 394,
"./zh-hk.js": 394,
"./zh-tw": 395,
"./zh-tw.js": 395
};
function webpackContext(req) {
return __webpack_require__(webpackContextResolve(req));
};
function webpackContextResolve(req) {
return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }());
};
webpackContext.keys = function webpackContextKeys() {
return Object.keys(map);
};
webpackContext.resolve = webpackContextResolve;
module.exports = webpackContext;
webpackContext.id = 276;
/***/ }),
/* 277 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Afrikaans [af]
//! author : Werner Mollentze : https://github.com/wernerm
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var af = moment.defineLocale('af', {
months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),
monthsShort : 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),
weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
meridiemParse: /vm|nm/i,
isPM : function (input) {
return /^nm$/i.test(input);
},
meridiem : function (hours, minutes, isLower) {
if (hours < 12) {
return isLower ? 'vm' : 'VM';
} else {
return isLower ? 'nm' : 'NM';
}
},
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[Vandag om] LT',
nextDay : '[Môre om] LT',
nextWeek : 'dddd [om] LT',
lastDay : '[Gister om] LT',
lastWeek : '[Laas] dddd [om] LT',
sameElse : 'L'
},
relativeTime : {
future : 'oor %s',
past : '%s gelede',
s : '\'n paar sekondes',
ss : '%d sekondes',
m : '\'n minuut',
mm : '%d minute',
h : '\'n uur',
hh : '%d ure',
d : '\'n dag',
dd : '%d dae',
M : '\'n maand',
MM : '%d maande',
y : '\'n jaar',
yy : '%d jaar'
},
dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
ordinal : function (number) {
return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter
},
week : {
dow : 1, // Maandag is die eerste dag van die week.
doy : 4 // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
}
});
return af;
})));
/***/ }),
/* 278 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Arabic [ar]
//! author : Abdel Said: https://github.com/abdelsaid
//! author : Ahmed Elkhatib
//! author : forabi https://github.com/forabi
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '١',
'2': '٢',
'3': '٣',
'4': '٤',
'5': '٥',
'6': '٦',
'7': '٧',
'8': '٨',
'9': '٩',
'0': '٠'
};
var numberMap = {
'١': '1',
'٢': '2',
'٣': '3',
'٤': '4',
'٥': '5',
'٦': '6',
'٧': '7',
'٨': '8',
'٩': '9',
'٠': '0'
};
var pluralForm = function (n) {
return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
};
var plurals = {
s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
};
var pluralize = function (u) {
return function (number, withoutSuffix, string, isFuture) {
var f = pluralForm(number),
str = plurals[u][pluralForm(number)];
if (f === 2) {
str = str[withoutSuffix ? 0 : 1];
}
return str.replace(/%d/i, number);
};
};
var months = [
'يناير',
'فبراير',
'مارس',
'أبريل',
'مايو',
'يونيو',
'يوليو',
'أغسطس',
'سبتمبر',
'أكتوبر',
'نوفمبر',
'ديسمبر'
];
var ar = moment.defineLocale('ar', {
months : months,
monthsShort : months,
weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'D/\u200FM/\u200FYYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
meridiemParse: /ص|م/,
isPM : function (input) {
return 'م' === input;
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return 'ص';
} else {
return 'م';
}
},
calendar : {
sameDay: '[اليوم عند الساعة] LT',
nextDay: '[غدًا عند الساعة] LT',
nextWeek: 'dddd [عند الساعة] LT',
lastDay: '[أمس عند الساعة] LT',
lastWeek: 'dddd [عند الساعة] LT',
sameElse: 'L'
},
relativeTime : {
future : 'بعد %s',
past : 'منذ %s',
s : pluralize('s'),
ss : pluralize('s'),
m : pluralize('m'),
mm : pluralize('m'),
h : pluralize('h'),
hh : pluralize('h'),
d : pluralize('d'),
dd : pluralize('d'),
M : pluralize('M'),
MM : pluralize('M'),
y : pluralize('y'),
yy : pluralize('y')
},
preparse: function (string) {
return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
return numberMap[match];
}).replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
}).replace(/,/g, '،');
},
week : {
dow : 6, // Saturday is the first day of the week.
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
return ar;
})));
/***/ }),
/* 279 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Arabic (Algeria) [ar-dz]
//! author : Noureddine LOUAHEDJ : https://github.com/noureddineme
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var arDz = moment.defineLocale('ar-dz', {
months : 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
monthsShort : 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort : 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin : 'أح_إث_ثلا_أر_خم_جم_سب'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[اليوم على الساعة] LT',
nextDay: '[غدا على الساعة] LT',
nextWeek: 'dddd [على الساعة] LT',
lastDay: '[أمس على الساعة] LT',
lastWeek: 'dddd [على الساعة] LT',
sameElse: 'L'
},
relativeTime : {
future : 'في %s',
past : 'منذ %s',
s : 'ثوان',
ss : '%d ثانية',
m : 'دقيقة',
mm : '%d دقائق',
h : 'ساعة',
hh : '%d ساعات',
d : 'يوم',
dd : '%d أيام',
M : 'شهر',
MM : '%d أشهر',
y : 'سنة',
yy : '%d سنوات'
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 4 // The week that contains Jan 1st is the first week of the year.
}
});
return arDz;
})));
/***/ }),
/* 280 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Arabic (Kuwait) [ar-kw]
//! author : Nusret Parlak: https://github.com/nusretparlak
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var arKw = moment.defineLocale('ar-kw', {
months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[اليوم على الساعة] LT',
nextDay: '[غدا على الساعة] LT',
nextWeek: 'dddd [على الساعة] LT',
lastDay: '[أمس على الساعة] LT',
lastWeek: 'dddd [على الساعة] LT',
sameElse: 'L'
},
relativeTime : {
future : 'في %s',
past : 'منذ %s',
s : 'ثوان',
ss : '%d ثانية',
m : 'دقيقة',
mm : '%d دقائق',
h : 'ساعة',
hh : '%d ساعات',
d : 'يوم',
dd : '%d أيام',
M : 'شهر',
MM : '%d أشهر',
y : 'سنة',
yy : '%d سنوات'
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
return arKw;
})));
/***/ }),
/* 281 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Arabic (Lybia) [ar-ly]
//! author : Ali Hmer: https://github.com/kikoanis
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '1',
'2': '2',
'3': '3',
'4': '4',
'5': '5',
'6': '6',
'7': '7',
'8': '8',
'9': '9',
'0': '0'
};
var pluralForm = function (n) {
return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
};
var plurals = {
s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
};
var pluralize = function (u) {
return function (number, withoutSuffix, string, isFuture) {
var f = pluralForm(number),
str = plurals[u][pluralForm(number)];
if (f === 2) {
str = str[withoutSuffix ? 0 : 1];
}
return str.replace(/%d/i, number);
};
};
var months = [
'يناير',
'فبراير',
'مارس',
'أبريل',
'مايو',
'يونيو',
'يوليو',
'أغسطس',
'سبتمبر',
'أكتوبر',
'نوفمبر',
'ديسمبر'
];
var arLy = moment.defineLocale('ar-ly', {
months : months,
monthsShort : months,
weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'D/\u200FM/\u200FYYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
meridiemParse: /ص|م/,
isPM : function (input) {
return 'م' === input;
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return 'ص';
} else {
return 'م';
}
},
calendar : {
sameDay: '[اليوم عند الساعة] LT',
nextDay: '[غدًا عند الساعة] LT',
nextWeek: 'dddd [عند الساعة] LT',
lastDay: '[أمس عند الساعة] LT',
lastWeek: 'dddd [عند الساعة] LT',
sameElse: 'L'
},
relativeTime : {
future : 'بعد %s',
past : 'منذ %s',
s : pluralize('s'),
ss : pluralize('s'),
m : pluralize('m'),
mm : pluralize('m'),
h : pluralize('h'),
hh : pluralize('h'),
d : pluralize('d'),
dd : pluralize('d'),
M : pluralize('M'),
MM : pluralize('M'),
y : pluralize('y'),
yy : pluralize('y')
},
preparse: function (string) {
return string.replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
}).replace(/,/g, '،');
},
week : {
dow : 6, // Saturday is the first day of the week.
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
return arLy;
})));
/***/ }),
/* 282 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Arabic (Morocco) [ar-ma]
//! author : ElFadili Yassine : https://github.com/ElFadiliY
//! author : Abdel Said : https://github.com/abdelsaid
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var arMa = moment.defineLocale('ar-ma', {
months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[اليوم على الساعة] LT',
nextDay: '[غدا على الساعة] LT',
nextWeek: 'dddd [على الساعة] LT',
lastDay: '[أمس على الساعة] LT',
lastWeek: 'dddd [على الساعة] LT',
sameElse: 'L'
},
relativeTime : {
future : 'في %s',
past : 'منذ %s',
s : 'ثوان',
ss : '%d ثانية',
m : 'دقيقة',
mm : '%d دقائق',
h : 'ساعة',
hh : '%d ساعات',
d : 'يوم',
dd : '%d أيام',
M : 'شهر',
MM : '%d أشهر',
y : 'سنة',
yy : '%d سنوات'
},
week : {
dow : 6, // Saturday is the first day of the week.
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
return arMa;
})));
/***/ }),
/* 283 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Arabic (Saudi Arabia) [ar-sa]
//! author : Suhail Alkowaileet : https://github.com/xsoh
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '١',
'2': '٢',
'3': '٣',
'4': '٤',
'5': '٥',
'6': '٦',
'7': '٧',
'8': '٨',
'9': '٩',
'0': '٠'
};
var numberMap = {
'١': '1',
'٢': '2',
'٣': '3',
'٤': '4',
'٥': '5',
'٦': '6',
'٧': '7',
'٨': '8',
'٩': '9',
'٠': '0'
};
var arSa = moment.defineLocale('ar-sa', {
months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
meridiemParse: /ص|م/,
isPM : function (input) {
return 'م' === input;
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return 'ص';
} else {
return 'م';
}
},
calendar : {
sameDay: '[اليوم على الساعة] LT',
nextDay: '[غدا على الساعة] LT',
nextWeek: 'dddd [على الساعة] LT',
lastDay: '[أمس على الساعة] LT',
lastWeek: 'dddd [على الساعة] LT',
sameElse: 'L'
},
relativeTime : {
future : 'في %s',
past : 'منذ %s',
s : 'ثوان',
ss : '%d ثانية',
m : 'دقيقة',
mm : '%d دقائق',
h : 'ساعة',
hh : '%d ساعات',
d : 'يوم',
dd : '%d أيام',
M : 'شهر',
MM : '%d أشهر',
y : 'سنة',
yy : '%d سنوات'
},
preparse: function (string) {
return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
return numberMap[match];
}).replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
}).replace(/,/g, '،');
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
}
});
return arSa;
})));
/***/ }),
/* 284 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Arabic (Tunisia) [ar-tn]
//! author : Nader Toukabri : https://github.com/naderio
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var arTn = moment.defineLocale('ar-tn', {
months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact : true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[اليوم على الساعة] LT',
nextDay: '[غدا على الساعة] LT',
nextWeek: 'dddd [على الساعة] LT',
lastDay: '[أمس على الساعة] LT',
lastWeek: 'dddd [على الساعة] LT',
sameElse: 'L'
},
relativeTime: {
future: 'في %s',
past: 'منذ %s',
s: 'ثوان',
ss : '%d ثانية',
m: 'دقيقة',
mm: '%d دقائق',
h: 'ساعة',
hh: '%d ساعات',
d: 'يوم',
dd: '%d أيام',
M: 'شهر',
MM: '%d أشهر',
y: 'سنة',
yy: '%d سنوات'
},
week: {
dow: 1, // Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return arTn;
})));
/***/ }),
/* 285 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Azerbaijani [az]
//! author : topchiyev : https://github.com/topchiyev
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var suffixes = {
1: '-inci',
5: '-inci',
8: '-inci',
70: '-inci',
80: '-inci',
2: '-nci',
7: '-nci',
20: '-nci',
50: '-nci',
3: '-üncü',
4: '-üncü',
100: '-üncü',
6: '-ncı',
9: '-uncu',
10: '-uncu',
30: '-uncu',
60: '-ıncı',
90: '-ıncı'
};
var az = moment.defineLocale('az', {
months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),
monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),
weekdaysShort : 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
weekdaysMin : 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[bugün saat] LT',
nextDay : '[sabah saat] LT',
nextWeek : '[gələn həftə] dddd [saat] LT',
lastDay : '[dünən] LT',
lastWeek : '[keçən həftə] dddd [saat] LT',
sameElse : 'L'
},
relativeTime : {
future : '%s sonra',
past : '%s əvvəl',
s : 'birneçə saniyyə',
ss : '%d saniyə',
m : 'bir dəqiqə',
mm : '%d dəqiqə',
h : 'bir saat',
hh : '%d saat',
d : 'bir gün',
dd : '%d gün',
M : 'bir ay',
MM : '%d ay',
y : 'bir il',
yy : '%d il'
},
meridiemParse: /gecə|səhər|gündüz|axşam/,
isPM : function (input) {
return /^(gündüz|axşam)$/.test(input);
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'gecə';
} else if (hour < 12) {
return 'səhər';
} else if (hour < 17) {
return 'gündüz';
} else {
return 'axşam';
}
},
dayOfMonthOrdinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,
ordinal : function (number) {
if (number === 0) { // special case for zero
return number + '-ıncı';
}
var a = number % 10,
b = number % 100 - a,
c = number >= 100 ? 100 : null;
return number + (suffixes[a] || suffixes[b] || suffixes[c]);
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return az;
})));
/***/ }),
/* 286 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Belarusian [be]
//! author : Dmitry Demidov : https://github.com/demidov91
//! author: Praleska: http://praleska.pro/
//! Author : Menelion Elensúle : https://github.com/Oire
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function plural(word, num) {
var forms = word.split('_');
return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
}
function relativeTimeWithPlural(number, withoutSuffix, key) {
var format = {
'ss': withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
'dd': 'дзень_дні_дзён',
'MM': 'месяц_месяцы_месяцаў',
'yy': 'год_гады_гадоў'
};
if (key === 'm') {
return withoutSuffix ? 'хвіліна' : 'хвіліну';
}
else if (key === 'h') {
return withoutSuffix ? 'гадзіна' : 'гадзіну';
}
else {
return number + ' ' + plural(format[key], +number);
}
}
var be = moment.defineLocale('be', {
months : {
format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'),
standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_')
},
monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),
weekdays : {
format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'),
standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),
isFormat: /\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/
},
weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D MMMM YYYY г.',
LLL : 'D MMMM YYYY г., HH:mm',
LLLL : 'dddd, D MMMM YYYY г., HH:mm'
},
calendar : {
sameDay: '[Сёння ў] LT',
nextDay: '[Заўтра ў] LT',
lastDay: '[Учора ў] LT',
nextWeek: function () {
return '[У] dddd [ў] LT';
},
lastWeek: function () {
switch (this.day()) {
case 0:
case 3:
case 5:
case 6:
return '[У мінулую] dddd [ў] LT';
case 1:
case 2:
case 4:
return '[У мінулы] dddd [ў] LT';
}
},
sameElse: 'L'
},
relativeTime : {
future : 'праз %s',
past : '%s таму',
s : 'некалькі секунд',
m : relativeTimeWithPlural,
mm : relativeTimeWithPlural,
h : relativeTimeWithPlural,
hh : relativeTimeWithPlural,
d : 'дзень',
dd : relativeTimeWithPlural,
M : 'месяц',
MM : relativeTimeWithPlural,
y : 'год',
yy : relativeTimeWithPlural
},
meridiemParse: /ночы|раніцы|дня|вечара/,
isPM : function (input) {
return /^(дня|вечара)$/.test(input);
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'ночы';
} else if (hour < 12) {
return 'раніцы';
} else if (hour < 17) {
return 'дня';
} else {
return 'вечара';
}
},
dayOfMonthOrdinalParse: /\d{1,2}-(і|ы|га)/,
ordinal: function (number, period) {
switch (period) {
case 'M':
case 'd':
case 'DDD':
case 'w':
case 'W':
return (number % 10 === 2 || number % 10 === 3) && (number % 100 !== 12 && number % 100 !== 13) ? number + '-і' : number + '-ы';
case 'D':
return number + '-га';
default:
return number;
}
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return be;
})));
/***/ }),
/* 287 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Bulgarian [bg]
//! author : Krasen Borisov : https://github.com/kraz
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var bg = moment.defineLocale('bg', {
months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),
monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),
weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'D.MM.YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY H:mm',
LLLL : 'dddd, D MMMM YYYY H:mm'
},
calendar : {
sameDay : '[Днес в] LT',
nextDay : '[Утре в] LT',
nextWeek : 'dddd [в] LT',
lastDay : '[Вчера в] LT',
lastWeek : function () {
switch (this.day()) {
case 0:
case 3:
case 6:
return '[В изминалата] dddd [в] LT';
case 1:
case 2:
case 4:
case 5:
return '[В изминалия] dddd [в] LT';
}
},
sameElse : 'L'
},
relativeTime : {
future : 'след %s',
past : 'преди %s',
s : 'няколко секунди',
ss : '%d секунди',
m : 'минута',
mm : '%d минути',
h : 'час',
hh : '%d часа',
d : 'ден',
dd : '%d дни',
M : 'месец',
MM : '%d месеца',
y : 'година',
yy : '%d години'
},
dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
ordinal : function (number) {
var lastDigit = number % 10,
last2Digits = number % 100;
if (number === 0) {
return number + '-ев';
} else if (last2Digits === 0) {
return number + '-ен';
} else if (last2Digits > 10 && last2Digits < 20) {
return number + '-ти';
} else if (lastDigit === 1) {
return number + '-ви';
} else if (lastDigit === 2) {
return number + '-ри';
} else if (lastDigit === 7 || lastDigit === 8) {
return number + '-ми';
} else {
return number + '-ти';
}
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return bg;
})));
/***/ }),
/* 288 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Bambara [bm]
//! author : Estelle Comment : https://github.com/estellecomment
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
// Language contact person : Abdoufata Kane : https://github.com/abdoufata
var bm = moment.defineLocale('bm', {
months : 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split('_'),
monthsShort : 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'),
weekdays : 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'),
weekdaysShort : 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'),
weekdaysMin : 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'MMMM [tile] D [san] YYYY',
LLL : 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
LLLL : 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm'
},
calendar : {
sameDay : '[Bi lɛrɛ] LT',
nextDay : '[Sini lɛrɛ] LT',
nextWeek : 'dddd [don lɛrɛ] LT',
lastDay : '[Kunu lɛrɛ] LT',
lastWeek : 'dddd [tɛmɛnen lɛrɛ] LT',
sameElse : 'L'
},
relativeTime : {
future : '%s kɔnɔ',
past : 'a bɛ %s bɔ',
s : 'sanga dama dama',
ss : 'sekondi %d',
m : 'miniti kelen',
mm : 'miniti %d',
h : 'lɛrɛ kelen',
hh : 'lɛrɛ %d',
d : 'tile kelen',
dd : 'tile %d',
M : 'kalo kelen',
MM : 'kalo %d',
y : 'san kelen',
yy : 'san %d'
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return bm;
})));
/***/ }),
/* 289 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Bengali [bn]
//! author : Kaushik Gandhi : https://github.com/kaushikgandhi
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '১',
'2': '২',
'3': '৩',
'4': '৪',
'5': '৫',
'6': '৬',
'7': '৭',
'8': '৮',
'9': '৯',
'0': '০'
};
var numberMap = {
'১': '1',
'২': '2',
'৩': '3',
'৪': '4',
'৫': '5',
'৬': '6',
'৭': '7',
'৮': '8',
'৯': '9',
'০': '0'
};
var bn = moment.defineLocale('bn', {
months : 'জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'),
monthsShort : 'জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে'.split('_'),
weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split('_'),
weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
weekdaysMin : 'রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি'.split('_'),
longDateFormat : {
LT : 'A h:mm সময়',
LTS : 'A h:mm:ss সময়',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY, A h:mm সময়',
LLLL : 'dddd, D MMMM YYYY, A h:mm সময়'
},
calendar : {
sameDay : '[আজ] LT',
nextDay : '[আগামীকাল] LT',
nextWeek : 'dddd, LT',
lastDay : '[গতকাল] LT',
lastWeek : '[গত] dddd, LT',
sameElse : 'L'
},
relativeTime : {
future : '%s পরে',
past : '%s আগে',
s : 'কয়েক সেকেন্ড',
ss : '%d সেকেন্ড',
m : 'এক মিনিট',
mm : '%d মিনিট',
h : 'এক ঘন্টা',
hh : '%d ঘন্টা',
d : 'এক দিন',
dd : '%d দিন',
M : 'এক মাস',
MM : '%d মাস',
y : 'এক বছর',
yy : '%d বছর'
},
preparse: function (string) {
return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if ((meridiem === 'রাত' && hour >= 4) ||
(meridiem === 'দুপুর' && hour < 5) ||
meridiem === 'বিকাল') {
return hour + 12;
} else {
return hour;
}
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'রাত';
} else if (hour < 10) {
return 'সকাল';
} else if (hour < 17) {
return 'দুপুর';
} else if (hour < 20) {
return 'বিকাল';
} else {
return 'রাত';
}
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
}
});
return bn;
})));
/***/ }),
/* 290 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Tibetan [bo]
//! author : Thupten N. Chakrishar : https://github.com/vajradog
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '༡',
'2': '༢',
'3': '༣',
'4': '༤',
'5': '༥',
'6': '༦',
'7': '༧',
'8': '༨',
'9': '༩',
'0': '༠'
};
var numberMap = {
'༡': '1',
'༢': '2',
'༣': '3',
'༤': '4',
'༥': '5',
'༦': '6',
'༧': '7',
'༨': '8',
'༩': '9',
'༠': '0'
};
var bo = moment.defineLocale('bo', {
months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'),
weekdaysShort : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
weekdaysMin : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
longDateFormat : {
LT : 'A h:mm',
LTS : 'A h:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY, A h:mm',
LLLL : 'dddd, D MMMM YYYY, A h:mm'
},
calendar : {
sameDay : '[དི་རིང] LT',
nextDay : '[སང་ཉིན] LT',
nextWeek : '[བདུན་ཕྲག་རྗེས་མ], LT',
lastDay : '[ཁ་སང] LT',
lastWeek : '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',
sameElse : 'L'
},
relativeTime : {
future : '%s ལ་',
past : '%s སྔན་ལ',
s : 'ལམ་སང',
ss : '%d སྐར་ཆ།',
m : 'སྐར་མ་གཅིག',
mm : '%d སྐར་མ',
h : 'ཆུ་ཚོད་གཅིག',
hh : '%d ཆུ་ཚོད',
d : 'ཉིན་གཅིག',
dd : '%d ཉིན་',
M : 'ཟླ་བ་གཅིག',
MM : '%d ཟླ་བ',
y : 'ལོ་གཅིག',
yy : '%d ལོ'
},
preparse: function (string) {
return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if ((meridiem === 'མཚན་མོ' && hour >= 4) ||
(meridiem === 'ཉིན་གུང' && hour < 5) ||
meridiem === 'དགོང་དག') {
return hour + 12;
} else {
return hour;
}
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'མཚན་མོ';
} else if (hour < 10) {
return 'ཞོགས་ཀས';
} else if (hour < 17) {
return 'ཉིན་གུང';
} else if (hour < 20) {
return 'དགོང་དག';
} else {
return 'མཚན་མོ';
}
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
}
});
return bo;
})));
/***/ }),
/* 291 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Breton [br]
//! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function relativeTimeWithMutation(number, withoutSuffix, key) {
var format = {
'mm': 'munutenn',
'MM': 'miz',
'dd': 'devezh'
};
return number + ' ' + mutation(format[key], number);
}
function specialMutationForYears(number) {
switch (lastNumber(number)) {
case 1:
case 3:
case 4:
case 5:
case 9:
return number + ' bloaz';
default:
return number + ' vloaz';
}
}
function lastNumber(number) {
if (number > 9) {
return lastNumber(number % 10);
}
return number;
}
function mutation(text, number) {
if (number === 2) {
return softMutation(text);
}
return text;
}
function softMutation(text) {
var mutationTable = {
'm': 'v',
'b': 'v',
'd': 'z'
};
if (mutationTable[text.charAt(0)] === undefined) {
return text;
}
return mutationTable[text.charAt(0)] + text.substring(1);
}
var br = moment.defineLocale('br', {
months : 'Genver_C\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),
monthsShort : 'Gen_C\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
weekdays : 'Sul_Lun_Meurzh_Merc\'her_Yaou_Gwener_Sadorn'.split('_'),
weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'h[e]mm A',
LTS : 'h[e]mm:ss A',
L : 'DD/MM/YYYY',
LL : 'D [a viz] MMMM YYYY',
LLL : 'D [a viz] MMMM YYYY h[e]mm A',
LLLL : 'dddd, D [a viz] MMMM YYYY h[e]mm A'
},
calendar : {
sameDay : '[Hiziv da] LT',
nextDay : '[Warc\'hoazh da] LT',
nextWeek : 'dddd [da] LT',
lastDay : '[Dec\'h da] LT',
lastWeek : 'dddd [paset da] LT',
sameElse : 'L'
},
relativeTime : {
future : 'a-benn %s',
past : '%s \'zo',
s : 'un nebeud segondennoù',
ss : '%d eilenn',
m : 'ur vunutenn',
mm : relativeTimeWithMutation,
h : 'un eur',
hh : '%d eur',
d : 'un devezh',
dd : relativeTimeWithMutation,
M : 'ur miz',
MM : relativeTimeWithMutation,
y : 'ur bloaz',
yy : specialMutationForYears
},
dayOfMonthOrdinalParse: /\d{1,2}(añ|vet)/,
ordinal : function (number) {
var output = (number === 1) ? 'añ' : 'vet';
return number + output;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return br;
})));
/***/ }),
/* 292 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Bosnian [bs]
//! author : Nedim Cholich : https://github.com/frontyard
//! based on (hr) translation by Bojan Marković
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function translate(number, withoutSuffix, key) {
var result = number + ' ';
switch (key) {
case 'ss':
if (number === 1) {
result += 'sekunda';
} else if (number === 2 || number === 3 || number === 4) {
result += 'sekunde';
} else {
result += 'sekundi';
}
return result;
case 'm':
return withoutSuffix ? 'jedna minuta' : 'jedne minute';
case 'mm':
if (number === 1) {
result += 'minuta';
} else if (number === 2 || number === 3 || number === 4) {
result += 'minute';
} else {
result += 'minuta';
}
return result;
case 'h':
return withoutSuffix ? 'jedan sat' : 'jednog sata';
case 'hh':
if (number === 1) {
result += 'sat';
} else if (number === 2 || number === 3 || number === 4) {
result += 'sata';
} else {
result += 'sati';
}
return result;
case 'dd':
if (number === 1) {
result += 'dan';
} else {
result += 'dana';
}
return result;
case 'MM':
if (number === 1) {
result += 'mjesec';
} else if (number === 2 || number === 3 || number === 4) {
result += 'mjeseca';
} else {
result += 'mjeseci';
}
return result;
case 'yy':
if (number === 1) {
result += 'godina';
} else if (number === 2 || number === 3 || number === 4) {
result += 'godine';
} else {
result += 'godina';
}
return result;
}
}
var bs = moment.defineLocale('bs', {
months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'),
monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),
monthsParseExact: true,
weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY H:mm',
LLLL : 'dddd, D. MMMM YYYY H:mm'
},
calendar : {
sameDay : '[danas u] LT',
nextDay : '[sutra u] LT',
nextWeek : function () {
switch (this.day()) {
case 0:
return '[u] [nedjelju] [u] LT';
case 3:
return '[u] [srijedu] [u] LT';
case 6:
return '[u] [subotu] [u] LT';
case 1:
case 2:
case 4:
case 5:
return '[u] dddd [u] LT';
}
},
lastDay : '[jučer u] LT',
lastWeek : function () {
switch (this.day()) {
case 0:
case 3:
return '[prošlu] dddd [u] LT';
case 6:
return '[prošle] [subote] [u] LT';
case 1:
case 2:
case 4:
case 5:
return '[prošli] dddd [u] LT';
}
},
sameElse : 'L'
},
relativeTime : {
future : 'za %s',
past : 'prije %s',
s : 'par sekundi',
ss : translate,
m : translate,
mm : translate,
h : translate,
hh : translate,
d : 'dan',
dd : translate,
M : 'mjesec',
MM : translate,
y : 'godinu',
yy : translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return bs;
})));
/***/ }),
/* 293 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Catalan [ca]
//! author : Juan G. Hurtado : https://github.com/juanghurtado
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var ca = moment.defineLocale('ca', {
months : {
standalone: 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),
format: 'de gener_de febrer_de març_d\'abril_de maig_de juny_de juliol_d\'agost_de setembre_d\'octubre_de novembre_de desembre'.split('_'),
isFormat: /D[oD]?(\s)+MMMM/
},
monthsShort : 'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split('_'),
monthsParseExact : true,
weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),
weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),
weekdaysMin : 'dg_dl_dt_dc_dj_dv_ds'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM [de] YYYY',
ll : 'D MMM YYYY',
LLL : 'D MMMM [de] YYYY [a les] H:mm',
lll : 'D MMM YYYY, H:mm',
LLLL : 'dddd D MMMM [de] YYYY [a les] H:mm',
llll : 'ddd D MMM YYYY, H:mm'
},
calendar : {
sameDay : function () {
return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
},
nextDay : function () {
return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
},
nextWeek : function () {
return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
},
lastDay : function () {
return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
},
lastWeek : function () {
return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
},
sameElse : 'L'
},
relativeTime : {
future : 'd\'aquí %s',
past : 'fa %s',
s : 'uns segons',
ss : '%d segons',
m : 'un minut',
mm : '%d minuts',
h : 'una hora',
hh : '%d hores',
d : 'un dia',
dd : '%d dies',
M : 'un mes',
MM : '%d mesos',
y : 'un any',
yy : '%d anys'
},
dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
ordinal : function (number, period) {
var output = (number === 1) ? 'r' :
(number === 2) ? 'n' :
(number === 3) ? 'r' :
(number === 4) ? 't' : 'è';
if (period === 'w' || period === 'W') {
output = 'a';
}
return number + output;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return ca;
})));
/***/ }),
/* 294 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Czech [cs]
//! author : petrbela : https://github.com/petrbela
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_');
var monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');
function plural(n) {
return (n > 1) && (n < 5) && (~~(n / 10) !== 1);
}
function translate(number, withoutSuffix, key, isFuture) {
var result = number + ' ';
switch (key) {
case 's': // a few seconds / in a few seconds / a few seconds ago
return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';
case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'sekundy' : 'sekund');
} else {
return result + 'sekundami';
}
break;
case 'm': // a minute / in a minute / a minute ago
return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');
case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'minuty' : 'minut');
} else {
return result + 'minutami';
}
break;
case 'h': // an hour / in an hour / an hour ago
return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
case 'hh': // 9 hours / in 9 hours / 9 hours ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'hodiny' : 'hodin');
} else {
return result + 'hodinami';
}
break;
case 'd': // a day / in a day / a day ago
return (withoutSuffix || isFuture) ? 'den' : 'dnem';
case 'dd': // 9 days / in 9 days / 9 days ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'dny' : 'dní');
} else {
return result + 'dny';
}
break;
case 'M': // a month / in a month / a month ago
return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';
case 'MM': // 9 months / in 9 months / 9 months ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'měsíce' : 'měsíců');
} else {
return result + 'měsíci';
}
break;
case 'y': // a year / in a year / a year ago
return (withoutSuffix || isFuture) ? 'rok' : 'rokem';
case 'yy': // 9 years / in 9 years / 9 years ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'roky' : 'let');
} else {
return result + 'lety';
}
break;
}
}
var cs = moment.defineLocale('cs', {
months : months,
monthsShort : monthsShort,
monthsParse : (function (months, monthsShort) {
var i, _monthsParse = [];
for (i = 0; i < 12; i++) {
// use custom parser to solve problem with July (červenec)
_monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
}
return _monthsParse;
}(months, monthsShort)),
shortMonthsParse : (function (monthsShort) {
var i, _shortMonthsParse = [];
for (i = 0; i < 12; i++) {
_shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i');
}
return _shortMonthsParse;
}(monthsShort)),
longMonthsParse : (function (months) {
var i, _longMonthsParse = [];
for (i = 0; i < 12; i++) {
_longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i');
}
return _longMonthsParse;
}(months)),
weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'),
weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'),
longDateFormat : {
LT: 'H:mm',
LTS : 'H:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY H:mm',
LLLL : 'dddd D. MMMM YYYY H:mm',
l : 'D. M. YYYY'
},
calendar : {
sameDay: '[dnes v] LT',
nextDay: '[zítra v] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[v neděli v] LT';
case 1:
case 2:
return '[v] dddd [v] LT';
case 3:
return '[ve středu v] LT';
case 4:
return '[ve čtvrtek v] LT';
case 5:
return '[v pátek v] LT';
case 6:
return '[v sobotu v] LT';
}
},
lastDay: '[včera v] LT',
lastWeek: function () {
switch (this.day()) {
case 0:
return '[minulou neděli v] LT';
case 1:
case 2:
return '[minulé] dddd [v] LT';
case 3:
return '[minulou středu v] LT';
case 4:
case 5:
return '[minulý] dddd [v] LT';
case 6:
return '[minulou sobotu v] LT';
}
},
sameElse: 'L'
},
relativeTime : {
future : 'za %s',
past : 'před %s',
s : translate,
ss : translate,
m : translate,
mm : translate,
h : translate,
hh : translate,
d : translate,
dd : translate,
M : translate,
MM : translate,
y : translate,
yy : translate
},
dayOfMonthOrdinalParse : /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return cs;
})));
/***/ }),
/* 295 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Chuvash [cv]
//! author : Anatoly Mironov : https://github.com/mirontoli
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var cv = moment.defineLocale('cv', {
months : 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split('_'),
monthsShort : 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),
weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split('_'),
weekdaysShort : 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),
weekdaysMin : 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD-MM-YYYY',
LL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
LLL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
LLLL : 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm'
},
calendar : {
sameDay: '[Паян] LT [сехетре]',
nextDay: '[Ыран] LT [сехетре]',
lastDay: '[Ӗнер] LT [сехетре]',
nextWeek: '[Ҫитес] dddd LT [сехетре]',
lastWeek: '[Иртнӗ] dddd LT [сехетре]',
sameElse: 'L'
},
relativeTime : {
future : function (output) {
var affix = /сехет$/i.exec(output) ? 'рен' : /ҫул$/i.exec(output) ? 'тан' : 'ран';
return output + affix;
},
past : '%s каялла',
s : 'пӗр-ик ҫеккунт',
ss : '%d ҫеккунт',
m : 'пӗр минут',
mm : '%d минут',
h : 'пӗр сехет',
hh : '%d сехет',
d : 'пӗр кун',
dd : '%d кун',
M : 'пӗр уйӑх',
MM : '%d уйӑх',
y : 'пӗр ҫул',
yy : '%d ҫул'
},
dayOfMonthOrdinalParse: /\d{1,2}-мӗш/,
ordinal : '%d-мӗш',
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return cv;
})));
/***/ }),
/* 296 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Welsh [cy]
//! author : Robert Allen : https://github.com/robgallen
//! author : https://github.com/ryangreaves
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var cy = moment.defineLocale('cy', {
months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),
monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),
weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'),
weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
weekdaysParseExact : true,
// time formats are the same as en-gb
longDateFormat: {
LT: 'HH:mm',
LTS : 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Heddiw am] LT',
nextDay: '[Yfory am] LT',
nextWeek: 'dddd [am] LT',
lastDay: '[Ddoe am] LT',
lastWeek: 'dddd [diwethaf am] LT',
sameElse: 'L'
},
relativeTime: {
future: 'mewn %s',
past: '%s yn ôl',
s: 'ychydig eiliadau',
ss: '%d eiliad',
m: 'munud',
mm: '%d munud',
h: 'awr',
hh: '%d awr',
d: 'diwrnod',
dd: '%d diwrnod',
M: 'mis',
MM: '%d mis',
y: 'blwyddyn',
yy: '%d flynedd'
},
dayOfMonthOrdinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,
// traditional ordinal numbers above 31 are not commonly used in colloquial Welsh
ordinal: function (number) {
var b = number,
output = '',
lookup = [
'', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed
'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed
];
if (b > 20) {
if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {
output = 'fed'; // not 30ain, 70ain or 90ain
} else {
output = 'ain';
}
} else if (b > 0) {
output = lookup[b];
}
return number + output;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return cy;
})));
/***/ }),
/* 297 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Danish [da]
//! author : Ulrik Nielsen : https://github.com/mrbase
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var da = moment.defineLocale('da', {
months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'),
monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
weekdaysShort : 'søn_man_tir_ons_tor_fre_lør'.split('_'),
weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY HH:mm',
LLLL : 'dddd [d.] D. MMMM YYYY [kl.] HH:mm'
},
calendar : {
sameDay : '[i dag kl.] LT',
nextDay : '[i morgen kl.] LT',
nextWeek : 'på dddd [kl.] LT',
lastDay : '[i går kl.] LT',
lastWeek : '[i] dddd[s kl.] LT',
sameElse : 'L'
},
relativeTime : {
future : 'om %s',
past : '%s siden',
s : 'få sekunder',
ss : '%d sekunder',
m : 'et minut',
mm : '%d minutter',
h : 'en time',
hh : '%d timer',
d : 'en dag',
dd : '%d dage',
M : 'en måned',
MM : '%d måneder',
y : 'et år',
yy : '%d år'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return da;
})));
/***/ }),
/* 298 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : German [de]
//! author : lluchs : https://github.com/lluchs
//! author: Menelion Elensúle: https://github.com/Oire
//! author : Mikolaj Dadela : https://github.com/mik01aj
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
'm': ['eine Minute', 'einer Minute'],
'h': ['eine Stunde', 'einer Stunde'],
'd': ['ein Tag', 'einem Tag'],
'dd': [number + ' Tage', number + ' Tagen'],
'M': ['ein Monat', 'einem Monat'],
'MM': [number + ' Monate', number + ' Monaten'],
'y': ['ein Jahr', 'einem Jahr'],
'yy': [number + ' Jahre', number + ' Jahren']
};
return withoutSuffix ? format[key][0] : format[key][1];
}
var de = moment.defineLocale('de', {
months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
monthsShort : 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
monthsParseExact : true,
weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY HH:mm',
LLLL : 'dddd, D. MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[heute um] LT [Uhr]',
sameElse: 'L',
nextDay: '[morgen um] LT [Uhr]',
nextWeek: 'dddd [um] LT [Uhr]',
lastDay: '[gestern um] LT [Uhr]',
lastWeek: '[letzten] dddd [um] LT [Uhr]'
},
relativeTime : {
future : 'in %s',
past : 'vor %s',
s : 'ein paar Sekunden',
ss : '%d Sekunden',
m : processRelativeTime,
mm : '%d Minuten',
h : processRelativeTime,
hh : '%d Stunden',
d : processRelativeTime,
dd : processRelativeTime,
M : processRelativeTime,
MM : processRelativeTime,
y : processRelativeTime,
yy : processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return de;
})));
/***/ }),
/* 299 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : German (Austria) [de-at]
//! author : lluchs : https://github.com/lluchs
//! author: Menelion Elensúle: https://github.com/Oire
//! author : Martin Groller : https://github.com/MadMG
//! author : Mikolaj Dadela : https://github.com/mik01aj
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
'm': ['eine Minute', 'einer Minute'],
'h': ['eine Stunde', 'einer Stunde'],
'd': ['ein Tag', 'einem Tag'],
'dd': [number + ' Tage', number + ' Tagen'],
'M': ['ein Monat', 'einem Monat'],
'MM': [number + ' Monate', number + ' Monaten'],
'y': ['ein Jahr', 'einem Jahr'],
'yy': [number + ' Jahre', number + ' Jahren']
};
return withoutSuffix ? format[key][0] : format[key][1];
}
var deAt = moment.defineLocale('de-at', {
months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
monthsShort : 'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
monthsParseExact : true,
weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY HH:mm',
LLLL : 'dddd, D. MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[heute um] LT [Uhr]',
sameElse: 'L',
nextDay: '[morgen um] LT [Uhr]',
nextWeek: 'dddd [um] LT [Uhr]',
lastDay: '[gestern um] LT [Uhr]',
lastWeek: '[letzten] dddd [um] LT [Uhr]'
},
relativeTime : {
future : 'in %s',
past : 'vor %s',
s : 'ein paar Sekunden',
ss : '%d Sekunden',
m : processRelativeTime,
mm : '%d Minuten',
h : processRelativeTime,
hh : '%d Stunden',
d : processRelativeTime,
dd : processRelativeTime,
M : processRelativeTime,
MM : processRelativeTime,
y : processRelativeTime,
yy : processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return deAt;
})));
/***/ }),
/* 300 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : German (Switzerland) [de-ch]
//! author : sschueller : https://github.com/sschueller
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
// based on: https://www.bk.admin.ch/dokumentation/sprachen/04915/05016/index.html?lang=de#
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
'm': ['eine Minute', 'einer Minute'],
'h': ['eine Stunde', 'einer Stunde'],
'd': ['ein Tag', 'einem Tag'],
'dd': [number + ' Tage', number + ' Tagen'],
'M': ['ein Monat', 'einem Monat'],
'MM': [number + ' Monate', number + ' Monaten'],
'y': ['ein Jahr', 'einem Jahr'],
'yy': [number + ' Jahre', number + ' Jahren']
};
return withoutSuffix ? format[key][0] : format[key][1];
}
var deCh = moment.defineLocale('de-ch', {
months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
monthsShort : 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
monthsParseExact : true,
weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
weekdaysShort : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY HH:mm',
LLLL : 'dddd, D. MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[heute um] LT [Uhr]',
sameElse: 'L',
nextDay: '[morgen um] LT [Uhr]',
nextWeek: 'dddd [um] LT [Uhr]',
lastDay: '[gestern um] LT [Uhr]',
lastWeek: '[letzten] dddd [um] LT [Uhr]'
},
relativeTime : {
future : 'in %s',
past : 'vor %s',
s : 'ein paar Sekunden',
ss : '%d Sekunden',
m : processRelativeTime,
mm : '%d Minuten',
h : processRelativeTime,
hh : '%d Stunden',
d : processRelativeTime,
dd : processRelativeTime,
M : processRelativeTime,
MM : processRelativeTime,
y : processRelativeTime,
yy : processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return deCh;
})));
/***/ }),
/* 301 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Maldivian [dv]
//! author : Jawish Hameed : https://github.com/jawish
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var months = [
'ޖެނުއަރީ',
'ފެބްރުއަރީ',
'މާރިޗު',
'އޭޕްރީލު',
'މޭ',
'ޖޫން',
'ޖުލައި',
'އޯގަސްޓު',
'ސެޕްޓެމްބަރު',
'އޮކްޓޯބަރު',
'ނޮވެމްބަރު',
'ޑިސެމްބަރު'
];
var weekdays = [
'އާދިއްތަ',
'ހޯމަ',
'އަންގާރަ',
'ބުދަ',
'ބުރާސްފަތި',
'ހުކުރު',
'ހޮނިހިރު'
];
var dv = moment.defineLocale('dv', {
months : months,
monthsShort : months,
weekdays : weekdays,
weekdaysShort : weekdays,
weekdaysMin : 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'D/M/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
meridiemParse: /މކ|މފ/,
isPM : function (input) {
return 'މފ' === input;
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return 'މކ';
} else {
return 'މފ';
}
},
calendar : {
sameDay : '[މިއަދު] LT',
nextDay : '[މާދަމާ] LT',
nextWeek : 'dddd LT',
lastDay : '[އިއްޔެ] LT',
lastWeek : '[ފާއިތުވި] dddd LT',
sameElse : 'L'
},
relativeTime : {
future : 'ތެރޭގައި %s',
past : 'ކުރިން %s',
s : 'ސިކުންތުކޮޅެއް',
ss : 'd% ސިކުންތު',
m : 'މިނިޓެއް',
mm : 'މިނިޓު %d',
h : 'ގަޑިއިރެއް',
hh : 'ގަޑިއިރު %d',
d : 'ދުވަހެއް',
dd : 'ދުވަސް %d',
M : 'މަހެއް',
MM : 'މަސް %d',
y : 'އަހަރެއް',
yy : 'އަހަރު %d'
},
preparse: function (string) {
return string.replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/,/g, '،');
},
week : {
dow : 7, // Sunday is the first day of the week.
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
return dv;
})));
/***/ }),
/* 302 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Greek [el]
//! author : Aggelos Karalias : https://github.com/mehiel
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function isFunction(input) {
return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
}
var el = moment.defineLocale('el', {
monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),
monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'),
months : function (momentToFormat, format) {
if (!momentToFormat) {
return this._monthsNominativeEl;
} else if (typeof format === 'string' && /D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM'
return this._monthsGenitiveEl[momentToFormat.month()];
} else {
return this._monthsNominativeEl[momentToFormat.month()];
}
},
monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),
weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'),
weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),
weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),
meridiem : function (hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'μμ' : 'ΜΜ';
} else {
return isLower ? 'πμ' : 'ΠΜ';
}
},
isPM : function (input) {
return ((input + '').toLowerCase()[0] === 'μ');
},
meridiemParse : /[ΠΜ]\.?Μ?\.?/i,
longDateFormat : {
LT : 'h:mm A',
LTS : 'h:mm:ss A',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY h:mm A',
LLLL : 'dddd, D MMMM YYYY h:mm A'
},
calendarEl : {
sameDay : '[Σήμερα {}] LT',
nextDay : '[Αύριο {}] LT',
nextWeek : 'dddd [{}] LT',
lastDay : '[Χθες {}] LT',
lastWeek : function () {
switch (this.day()) {
case 6:
return '[το προηγούμενο] dddd [{}] LT';
default:
return '[την προηγούμενη] dddd [{}] LT';
}
},
sameElse : 'L'
},
calendar : function (key, mom) {
var output = this._calendarEl[key],
hours = mom && mom.hours();
if (isFunction(output)) {
output = output.apply(mom);
}
return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις'));
},
relativeTime : {
future : 'σε %s',
past : '%s πριν',
s : 'λίγα δευτερόλεπτα',
ss : '%d δευτερόλεπτα',
m : 'ένα λεπτό',
mm : '%d λεπτά',
h : 'μία ώρα',
hh : '%d ώρες',
d : 'μία μέρα',
dd : '%d μέρες',
M : 'ένας μήνας',
MM : '%d μήνες',
y : 'ένας χρόνος',
yy : '%d χρόνια'
},
dayOfMonthOrdinalParse: /\d{1,2}η/,
ordinal: '%dη',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4st is the first week of the year.
}
});
return el;
})));
/***/ }),
/* 303 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : English (Australia) [en-au]
//! author : Jared Morse : https://github.com/jarcoal
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var enAu = moment.defineLocale('en-au', {
months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
longDateFormat : {
LT : 'h:mm A',
LTS : 'h:mm:ss A',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY h:mm A',
LLLL : 'dddd, D MMMM YYYY h:mm A'
},
calendar : {
sameDay : '[Today at] LT',
nextDay : '[Tomorrow at] LT',
nextWeek : 'dddd [at] LT',
lastDay : '[Yesterday at] LT',
lastWeek : '[Last] dddd [at] LT',
sameElse : 'L'
},
relativeTime : {
future : 'in %s',
past : '%s ago',
s : 'a few seconds',
ss : '%d seconds',
m : 'a minute',
mm : '%d minutes',
h : 'an hour',
hh : '%d hours',
d : 'a day',
dd : '%d days',
M : 'a month',
MM : '%d months',
y : 'a year',
yy : '%d years'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal : function (number) {
var b = number % 10,
output = (~~(number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
return number + output;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return enAu;
})));
/***/ }),
/* 304 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : English (Canada) [en-ca]
//! author : Jonathan Abourbih : https://github.com/jonbca
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var enCa = moment.defineLocale('en-ca', {
months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
longDateFormat : {
LT : 'h:mm A',
LTS : 'h:mm:ss A',
L : 'YYYY-MM-DD',
LL : 'MMMM D, YYYY',
LLL : 'MMMM D, YYYY h:mm A',
LLLL : 'dddd, MMMM D, YYYY h:mm A'
},
calendar : {
sameDay : '[Today at] LT',
nextDay : '[Tomorrow at] LT',
nextWeek : 'dddd [at] LT',
lastDay : '[Yesterday at] LT',
lastWeek : '[Last] dddd [at] LT',
sameElse : 'L'
},
relativeTime : {
future : 'in %s',
past : '%s ago',
s : 'a few seconds',
ss : '%d seconds',
m : 'a minute',
mm : '%d minutes',
h : 'an hour',
hh : '%d hours',
d : 'a day',
dd : '%d days',
M : 'a month',
MM : '%d months',
y : 'a year',
yy : '%d years'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal : function (number) {
var b = number % 10,
output = (~~(number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
return number + output;
}
});
return enCa;
})));
/***/ }),
/* 305 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : English (United Kingdom) [en-gb]
//! author : Chris Gedrim : https://github.com/chrisgedrim
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var enGb = moment.defineLocale('en-gb', {
months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[Today at] LT',
nextDay : '[Tomorrow at] LT',
nextWeek : 'dddd [at] LT',
lastDay : '[Yesterday at] LT',
lastWeek : '[Last] dddd [at] LT',
sameElse : 'L'
},
relativeTime : {
future : 'in %s',
past : '%s ago',
s : 'a few seconds',
ss : '%d seconds',
m : 'a minute',
mm : '%d minutes',
h : 'an hour',
hh : '%d hours',
d : 'a day',
dd : '%d days',
M : 'a month',
MM : '%d months',
y : 'a year',
yy : '%d years'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal : function (number) {
var b = number % 10,
output = (~~(number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
return number + output;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return enGb;
})));
/***/ }),
/* 306 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : English (Ireland) [en-ie]
//! author : Chris Cartlidge : https://github.com/chriscartlidge
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var enIe = moment.defineLocale('en-ie', {
months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD-MM-YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[Today at] LT',
nextDay : '[Tomorrow at] LT',
nextWeek : 'dddd [at] LT',
lastDay : '[Yesterday at] LT',
lastWeek : '[Last] dddd [at] LT',
sameElse : 'L'
},
relativeTime : {
future : 'in %s',
past : '%s ago',
s : 'a few seconds',
ss : '%d seconds',
m : 'a minute',
mm : '%d minutes',
h : 'an hour',
hh : '%d hours',
d : 'a day',
dd : '%d days',
M : 'a month',
MM : '%d months',
y : 'a year',
yy : '%d years'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal : function (number) {
var b = number % 10,
output = (~~(number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
return number + output;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return enIe;
})));
/***/ }),
/* 307 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : English (New Zealand) [en-nz]
//! author : Luke McGregor : https://github.com/lukemcgregor
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var enNz = moment.defineLocale('en-nz', {
months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
longDateFormat : {
LT : 'h:mm A',
LTS : 'h:mm:ss A',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY h:mm A',
LLLL : 'dddd, D MMMM YYYY h:mm A'
},
calendar : {
sameDay : '[Today at] LT',
nextDay : '[Tomorrow at] LT',
nextWeek : 'dddd [at] LT',
lastDay : '[Yesterday at] LT',
lastWeek : '[Last] dddd [at] LT',
sameElse : 'L'
},
relativeTime : {
future : 'in %s',
past : '%s ago',
s : 'a few seconds',
ss : '%d seconds',
m : 'a minute',
mm : '%d minutes',
h : 'an hour',
hh : '%d hours',
d : 'a day',
dd : '%d days',
M : 'a month',
MM : '%d months',
y : 'a year',
yy : '%d years'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal : function (number) {
var b = number % 10,
output = (~~(number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
return number + output;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return enNz;
})));
/***/ }),
/* 308 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Esperanto [eo]
//! author : Colin Dean : https://github.com/colindean
//! author : Mia Nordentoft Imperatori : https://github.com/miestasmia
//! comment : miestasmia corrected the translation by colindean
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var eo = moment.defineLocale('eo', {
months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'),
monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'),
weekdays : 'dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato'.split('_'),
weekdaysShort : 'dim_lun_mard_merk_ĵaŭ_ven_sab'.split('_'),
weekdaysMin : 'di_lu_ma_me_ĵa_ve_sa'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'YYYY-MM-DD',
LL : 'D[-a de] MMMM, YYYY',
LLL : 'D[-a de] MMMM, YYYY HH:mm',
LLLL : 'dddd, [la] D[-a de] MMMM, YYYY HH:mm'
},
meridiemParse: /[ap]\.t\.m/i,
isPM: function (input) {
return input.charAt(0).toLowerCase() === 'p';
},
meridiem : function (hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'p.t.m.' : 'P.T.M.';
} else {
return isLower ? 'a.t.m.' : 'A.T.M.';
}
},
calendar : {
sameDay : '[Hodiaŭ je] LT',
nextDay : '[Morgaŭ je] LT',
nextWeek : 'dddd [je] LT',
lastDay : '[Hieraŭ je] LT',
lastWeek : '[pasinta] dddd [je] LT',
sameElse : 'L'
},
relativeTime : {
future : 'post %s',
past : 'antaŭ %s',
s : 'sekundoj',
ss : '%d sekundoj',
m : 'minuto',
mm : '%d minutoj',
h : 'horo',
hh : '%d horoj',
d : 'tago',//ne 'diurno', ĉar estas uzita por proksimumo
dd : '%d tagoj',
M : 'monato',
MM : '%d monatoj',
y : 'jaro',
yy : '%d jaroj'
},
dayOfMonthOrdinalParse: /\d{1,2}a/,
ordinal : '%da',
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return eo;
})));
/***/ }),
/* 309 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Spanish [es]
//! author : Julio Napurí : https://github.com/julionc
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_');
var monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
var monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];
var monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
var es = moment.defineLocale('es', {
months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
monthsShort : function (m, format) {
if (!m) {
return monthsShortDot;
} else if (/-MMM-/.test(format)) {
return monthsShort[m.month()];
} else {
return monthsShortDot[m.month()];
}
},
monthsRegex : monthsRegex,
monthsShortRegex : monthsRegex,
monthsStrictRegex : /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
monthsShortStrictRegex : /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
monthsParse : monthsParse,
longMonthsParse : monthsParse,
shortMonthsParse : monthsParse,
weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D [de] MMMM [de] YYYY',
LLL : 'D [de] MMMM [de] YYYY H:mm',
LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'
},
calendar : {
sameDay : function () {
return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
nextDay : function () {
return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
nextWeek : function () {
return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
lastDay : function () {
return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
lastWeek : function () {
return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
sameElse : 'L'
},
relativeTime : {
future : 'en %s',
past : 'hace %s',
s : 'unos segundos',
ss : '%d segundos',
m : 'un minuto',
mm : '%d minutos',
h : 'una hora',
hh : '%d horas',
d : 'un día',
dd : '%d días',
M : 'un mes',
MM : '%d meses',
y : 'un año',
yy : '%d años'
},
dayOfMonthOrdinalParse : /\d{1,2}º/,
ordinal : '%dº',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return es;
})));
/***/ }),
/* 310 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Spanish (Dominican Republic) [es-do]
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_');
var monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
var monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];
var monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
var esDo = moment.defineLocale('es-do', {
months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
monthsShort : function (m, format) {
if (!m) {
return monthsShortDot;
} else if (/-MMM-/.test(format)) {
return monthsShort[m.month()];
} else {
return monthsShortDot[m.month()];
}
},
monthsRegex: monthsRegex,
monthsShortRegex: monthsRegex,
monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
monthsParse: monthsParse,
longMonthsParse: monthsParse,
shortMonthsParse: monthsParse,
weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'h:mm A',
LTS : 'h:mm:ss A',
L : 'DD/MM/YYYY',
LL : 'D [de] MMMM [de] YYYY',
LLL : 'D [de] MMMM [de] YYYY h:mm A',
LLLL : 'dddd, D [de] MMMM [de] YYYY h:mm A'
},
calendar : {
sameDay : function () {
return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
nextDay : function () {
return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
nextWeek : function () {
return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
lastDay : function () {
return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
lastWeek : function () {
return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
sameElse : 'L'
},
relativeTime : {
future : 'en %s',
past : 'hace %s',
s : 'unos segundos',
ss : '%d segundos',
m : 'un minuto',
mm : '%d minutos',
h : 'una hora',
hh : '%d horas',
d : 'un día',
dd : '%d días',
M : 'un mes',
MM : '%d meses',
y : 'un año',
yy : '%d años'
},
dayOfMonthOrdinalParse : /\d{1,2}º/,
ordinal : '%dº',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return esDo;
})));
/***/ }),
/* 311 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Spanish (United States) [es-us]
//! author : bustta : https://github.com/bustta
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_');
var monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
var esUs = moment.defineLocale('es-us', {
months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
monthsShort : function (m, format) {
if (!m) {
return monthsShortDot;
} else if (/-MMM-/.test(format)) {
return monthsShort[m.month()];
} else {
return monthsShortDot[m.month()];
}
},
monthsParseExact : true,
weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'h:mm A',
LTS : 'h:mm:ss A',
L : 'MM/DD/YYYY',
LL : 'MMMM [de] D [de] YYYY',
LLL : 'MMMM [de] D [de] YYYY h:mm A',
LLLL : 'dddd, MMMM [de] D [de] YYYY h:mm A'
},
calendar : {
sameDay : function () {
return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
nextDay : function () {
return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
nextWeek : function () {
return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
lastDay : function () {
return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
lastWeek : function () {
return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
},
sameElse : 'L'
},
relativeTime : {
future : 'en %s',
past : 'hace %s',
s : 'unos segundos',
ss : '%d segundos',
m : 'un minuto',
mm : '%d minutos',
h : 'una hora',
hh : '%d horas',
d : 'un día',
dd : '%d días',
M : 'un mes',
MM : '%d meses',
y : 'un año',
yy : '%d años'
},
dayOfMonthOrdinalParse : /\d{1,2}º/,
ordinal : '%dº',
week : {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
}
});
return esUs;
})));
/***/ }),
/* 312 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Estonian [et]
//! author : Henry Kehlmann : https://github.com/madhenry
//! improvements : Illimar Tambek : https://github.com/ragulka
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'],
'ss': [number + 'sekundi', number + 'sekundit'],
'm' : ['ühe minuti', 'üks minut'],
'mm': [number + ' minuti', number + ' minutit'],
'h' : ['ühe tunni', 'tund aega', 'üks tund'],
'hh': [number + ' tunni', number + ' tundi'],
'd' : ['ühe päeva', 'üks päev'],
'M' : ['kuu aja', 'kuu aega', 'üks kuu'],
'MM': [number + ' kuu', number + ' kuud'],
'y' : ['ühe aasta', 'aasta', 'üks aasta'],
'yy': [number + ' aasta', number + ' aastat']
};
if (withoutSuffix) {
return format[key][2] ? format[key][2] : format[key][1];
}
return isFuture ? format[key][0] : format[key][1];
}
var et = moment.defineLocale('et', {
months : 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),
monthsShort : 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),
weekdays : 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),
weekdaysShort : 'P_E_T_K_N_R_L'.split('_'),
weekdaysMin : 'P_E_T_K_N_R_L'.split('_'),
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY H:mm',
LLLL : 'dddd, D. MMMM YYYY H:mm'
},
calendar : {
sameDay : '[Täna,] LT',
nextDay : '[Homme,] LT',
nextWeek : '[Järgmine] dddd LT',
lastDay : '[Eile,] LT',
lastWeek : '[Eelmine] dddd LT',
sameElse : 'L'
},
relativeTime : {
future : '%s pärast',
past : '%s tagasi',
s : processRelativeTime,
ss : processRelativeTime,
m : processRelativeTime,
mm : processRelativeTime,
h : processRelativeTime,
hh : processRelativeTime,
d : processRelativeTime,
dd : '%d päeva',
M : processRelativeTime,
MM : processRelativeTime,
y : processRelativeTime,
yy : processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return et;
})));
/***/ }),
/* 313 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Basque [eu]
//! author : Eneko Illarramendi : https://github.com/eillarra
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var eu = moment.defineLocale('eu', {
months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'),
monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'),
monthsParseExact : true,
weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'),
weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'),
weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'YYYY-MM-DD',
LL : 'YYYY[ko] MMMM[ren] D[a]',
LLL : 'YYYY[ko] MMMM[ren] D[a] HH:mm',
LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
l : 'YYYY-M-D',
ll : 'YYYY[ko] MMM D[a]',
lll : 'YYYY[ko] MMM D[a] HH:mm',
llll : 'ddd, YYYY[ko] MMM D[a] HH:mm'
},
calendar : {
sameDay : '[gaur] LT[etan]',
nextDay : '[bihar] LT[etan]',
nextWeek : 'dddd LT[etan]',
lastDay : '[atzo] LT[etan]',
lastWeek : '[aurreko] dddd LT[etan]',
sameElse : 'L'
},
relativeTime : {
future : '%s barru',
past : 'duela %s',
s : 'segundo batzuk',
ss : '%d segundo',
m : 'minutu bat',
mm : '%d minutu',
h : 'ordu bat',
hh : '%d ordu',
d : 'egun bat',
dd : '%d egun',
M : 'hilabete bat',
MM : '%d hilabete',
y : 'urte bat',
yy : '%d urte'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return eu;
})));
/***/ }),
/* 314 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Persian [fa]
//! author : Ebrahim Byagowi : https://github.com/ebraminio
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '۱',
'2': '۲',
'3': '۳',
'4': '۴',
'5': '۵',
'6': '۶',
'7': '۷',
'8': '۸',
'9': '۹',
'0': '۰'
};
var numberMap = {
'۱': '1',
'۲': '2',
'۳': '3',
'۴': '4',
'۵': '5',
'۶': '6',
'۷': '7',
'۸': '8',
'۹': '9',
'۰': '0'
};
var fa = moment.defineLocale('fa', {
months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
weekdays : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
weekdaysShort : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
meridiemParse: /قبل از ظهر|بعد از ظهر/,
isPM: function (input) {
return /بعد از ظهر/.test(input);
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return 'قبل از ظهر';
} else {
return 'بعد از ظهر';
}
},
calendar : {
sameDay : '[امروز ساعت] LT',
nextDay : '[فردا ساعت] LT',
nextWeek : 'dddd [ساعت] LT',
lastDay : '[دیروز ساعت] LT',
lastWeek : 'dddd [پیش] [ساعت] LT',
sameElse : 'L'
},
relativeTime : {
future : 'در %s',
past : '%s پیش',
s : 'چند ثانیه',
ss : 'ثانیه d%',
m : 'یک دقیقه',
mm : '%d دقیقه',
h : 'یک ساعت',
hh : '%d ساعت',
d : 'یک روز',
dd : '%d روز',
M : 'یک ماه',
MM : '%d ماه',
y : 'یک سال',
yy : '%d سال'
},
preparse: function (string) {
return string.replace(/[۰-۹]/g, function (match) {
return numberMap[match];
}).replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
}).replace(/,/g, '،');
},
dayOfMonthOrdinalParse: /\d{1,2}م/,
ordinal : '%dم',
week : {
dow : 6, // Saturday is the first day of the week.
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
return fa;
})));
/***/ }),
/* 315 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Finnish [fi]
//! author : Tarmo Aidantausta : https://github.com/bleadof
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' ');
var numbersFuture = [
'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden',
numbersPast[7], numbersPast[8], numbersPast[9]
];
function translate(number, withoutSuffix, key, isFuture) {
var result = '';
switch (key) {
case 's':
return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
case 'ss':
return isFuture ? 'sekunnin' : 'sekuntia';
case 'm':
return isFuture ? 'minuutin' : 'minuutti';
case 'mm':
result = isFuture ? 'minuutin' : 'minuuttia';
break;
case 'h':
return isFuture ? 'tunnin' : 'tunti';
case 'hh':
result = isFuture ? 'tunnin' : 'tuntia';
break;
case 'd':
return isFuture ? 'päivän' : 'päivä';
case 'dd':
result = isFuture ? 'päivän' : 'päivää';
break;
case 'M':
return isFuture ? 'kuukauden' : 'kuukausi';
case 'MM':
result = isFuture ? 'kuukauden' : 'kuukautta';
break;
case 'y':
return isFuture ? 'vuoden' : 'vuosi';
case 'yy':
result = isFuture ? 'vuoden' : 'vuotta';
break;
}
result = verbalNumber(number, isFuture) + ' ' + result;
return result;
}
function verbalNumber(number, isFuture) {
return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number;
}
var fi = moment.defineLocale('fi', {
months : 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),
monthsShort : 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),
weekdays : 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),
weekdaysShort : 'su_ma_ti_ke_to_pe_la'.split('_'),
weekdaysMin : 'su_ma_ti_ke_to_pe_la'.split('_'),
longDateFormat : {
LT : 'HH.mm',
LTS : 'HH.mm.ss',
L : 'DD.MM.YYYY',
LL : 'Do MMMM[ta] YYYY',
LLL : 'Do MMMM[ta] YYYY, [klo] HH.mm',
LLLL : 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',
l : 'D.M.YYYY',
ll : 'Do MMM YYYY',
lll : 'Do MMM YYYY, [klo] HH.mm',
llll : 'ddd, Do MMM YYYY, [klo] HH.mm'
},
calendar : {
sameDay : '[tänään] [klo] LT',
nextDay : '[huomenna] [klo] LT',
nextWeek : 'dddd [klo] LT',
lastDay : '[eilen] [klo] LT',
lastWeek : '[viime] dddd[na] [klo] LT',
sameElse : 'L'
},
relativeTime : {
future : '%s päästä',
past : '%s sitten',
s : translate,
ss : translate,
m : translate,
mm : translate,
h : translate,
hh : translate,
d : translate,
dd : translate,
M : translate,
MM : translate,
y : translate,
yy : translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return fi;
})));
/***/ }),
/* 316 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Faroese [fo]
//! author : Ragnar Johannesen : https://github.com/ragnar123
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var fo = moment.defineLocale('fo', {
months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'),
weekdaysShort : 'sun_mán_týs_mik_hós_frí_ley'.split('_'),
weekdaysMin : 'su_má_tý_mi_hó_fr_le'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D. MMMM, YYYY HH:mm'
},
calendar : {
sameDay : '[Í dag kl.] LT',
nextDay : '[Í morgin kl.] LT',
nextWeek : 'dddd [kl.] LT',
lastDay : '[Í gjár kl.] LT',
lastWeek : '[síðstu] dddd [kl] LT',
sameElse : 'L'
},
relativeTime : {
future : 'um %s',
past : '%s síðani',
s : 'fá sekund',
ss : '%d sekundir',
m : 'ein minutt',
mm : '%d minuttir',
h : 'ein tími',
hh : '%d tímar',
d : 'ein dagur',
dd : '%d dagar',
M : 'ein mánaði',
MM : '%d mánaðir',
y : 'eitt ár',
yy : '%d ár'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return fo;
})));
/***/ }),
/* 317 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : French [fr]
//! author : John Fischer : https://github.com/jfroffice
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var fr = moment.defineLocale('fr', {
months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
monthsParseExact : true,
weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
weekdaysMin : 'di_lu_ma_me_je_ve_sa'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[Aujourd’hui à] LT',
nextDay : '[Demain à] LT',
nextWeek : 'dddd [à] LT',
lastDay : '[Hier à] LT',
lastWeek : 'dddd [dernier à] LT',
sameElse : 'L'
},
relativeTime : {
future : 'dans %s',
past : 'il y a %s',
s : 'quelques secondes',
ss : '%d secondes',
m : 'une minute',
mm : '%d minutes',
h : 'une heure',
hh : '%d heures',
d : 'un jour',
dd : '%d jours',
M : 'un mois',
MM : '%d mois',
y : 'un an',
yy : '%d ans'
},
dayOfMonthOrdinalParse: /\d{1,2}(er|)/,
ordinal : function (number, period) {
switch (period) {
// TODO: Return 'e' when day of month > 1. Move this case inside
// block for masculine words below.
// See https://github.com/moment/moment/issues/3375
case 'D':
return number + (number === 1 ? 'er' : '');
// Words with masculine grammatical gender: mois, trimestre, jour
default:
case 'M':
case 'Q':
case 'DDD':
case 'd':
return number + (number === 1 ? 'er' : 'e');
// Words with feminine grammatical gender: semaine
case 'w':
case 'W':
return number + (number === 1 ? 're' : 'e');
}
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return fr;
})));
/***/ }),
/* 318 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : French (Canada) [fr-ca]
//! author : Jonathan Abourbih : https://github.com/jonbca
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var frCa = moment.defineLocale('fr-ca', {
months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
monthsParseExact : true,
weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
weekdaysMin : 'di_lu_ma_me_je_ve_sa'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'YYYY-MM-DD',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[Aujourd’hui à] LT',
nextDay : '[Demain à] LT',
nextWeek : 'dddd [à] LT',
lastDay : '[Hier à] LT',
lastWeek : 'dddd [dernier à] LT',
sameElse : 'L'
},
relativeTime : {
future : 'dans %s',
past : 'il y a %s',
s : 'quelques secondes',
ss : '%d secondes',
m : 'une minute',
mm : '%d minutes',
h : 'une heure',
hh : '%d heures',
d : 'un jour',
dd : '%d jours',
M : 'un mois',
MM : '%d mois',
y : 'un an',
yy : '%d ans'
},
dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
ordinal : function (number, period) {
switch (period) {
// Words with masculine grammatical gender: mois, trimestre, jour
default:
case 'M':
case 'Q':
case 'D':
case 'DDD':
case 'd':
return number + (number === 1 ? 'er' : 'e');
// Words with feminine grammatical gender: semaine
case 'w':
case 'W':
return number + (number === 1 ? 're' : 'e');
}
}
});
return frCa;
})));
/***/ }),
/* 319 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : French (Switzerland) [fr-ch]
//! author : Gaspard Bucher : https://github.com/gaspard
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var frCh = moment.defineLocale('fr-ch', {
months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
monthsParseExact : true,
weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
weekdaysMin : 'di_lu_ma_me_je_ve_sa'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[Aujourd’hui à] LT',
nextDay : '[Demain à] LT',
nextWeek : 'dddd [à] LT',
lastDay : '[Hier à] LT',
lastWeek : 'dddd [dernier à] LT',
sameElse : 'L'
},
relativeTime : {
future : 'dans %s',
past : 'il y a %s',
s : 'quelques secondes',
ss : '%d secondes',
m : 'une minute',
mm : '%d minutes',
h : 'une heure',
hh : '%d heures',
d : 'un jour',
dd : '%d jours',
M : 'un mois',
MM : '%d mois',
y : 'un an',
yy : '%d ans'
},
dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
ordinal : function (number, period) {
switch (period) {
// Words with masculine grammatical gender: mois, trimestre, jour
default:
case 'M':
case 'Q':
case 'D':
case 'DDD':
case 'd':
return number + (number === 1 ? 'er' : 'e');
// Words with feminine grammatical gender: semaine
case 'w':
case 'W':
return number + (number === 1 ? 're' : 'e');
}
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return frCh;
})));
/***/ }),
/* 320 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Frisian [fy]
//! author : Robin van der Vliet : https://github.com/robin0van0der0v
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_');
var monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_');
var fy = moment.defineLocale('fy', {
months : 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'),
monthsShort : function (m, format) {
if (!m) {
return monthsShortWithDots;
} else if (/-MMM-/.test(format)) {
return monthsShortWithoutDots[m.month()];
} else {
return monthsShortWithDots[m.month()];
}
},
monthsParseExact : true,
weekdays : 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'),
weekdaysShort : 'si._mo._ti._wo._to._fr._so.'.split('_'),
weekdaysMin : 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD-MM-YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[hjoed om] LT',
nextDay: '[moarn om] LT',
nextWeek: 'dddd [om] LT',
lastDay: '[juster om] LT',
lastWeek: '[ôfrûne] dddd [om] LT',
sameElse: 'L'
},
relativeTime : {
future : 'oer %s',
past : '%s lyn',
s : 'in pear sekonden',
ss : '%d sekonden',
m : 'ien minút',
mm : '%d minuten',
h : 'ien oere',
hh : '%d oeren',
d : 'ien dei',
dd : '%d dagen',
M : 'ien moanne',
MM : '%d moannen',
y : 'ien jier',
yy : '%d jierren'
},
dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
ordinal : function (number) {
return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return fy;
})));
/***/ }),
/* 321 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Scottish Gaelic [gd]
//! author : Jon Ashdown : https://github.com/jonashdown
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var months = [
'Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd'
];
var monthsShort = ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh'];
var weekdays = ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne'];
var weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'];
var weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'];
var gd = moment.defineLocale('gd', {
months : months,
monthsShort : monthsShort,
monthsParseExact : true,
weekdays : weekdays,
weekdaysShort : weekdaysShort,
weekdaysMin : weekdaysMin,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[An-diugh aig] LT',
nextDay : '[A-màireach aig] LT',
nextWeek : 'dddd [aig] LT',
lastDay : '[An-dè aig] LT',
lastWeek : 'dddd [seo chaidh] [aig] LT',
sameElse : 'L'
},
relativeTime : {
future : 'ann an %s',
past : 'bho chionn %s',
s : 'beagan diogan',
ss : '%d diogan',
m : 'mionaid',
mm : '%d mionaidean',
h : 'uair',
hh : '%d uairean',
d : 'latha',
dd : '%d latha',
M : 'mìos',
MM : '%d mìosan',
y : 'bliadhna',
yy : '%d bliadhna'
},
dayOfMonthOrdinalParse : /\d{1,2}(d|na|mh)/,
ordinal : function (number) {
var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
return number + output;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return gd;
})));
/***/ }),
/* 322 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Galician [gl]
//! author : Juan G. Hurtado : https://github.com/juanghurtado
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var gl = moment.defineLocale('gl', {
months : 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split('_'),
monthsShort : 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split('_'),
monthsParseExact: true,
weekdays : 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),
weekdaysShort : 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),
weekdaysMin : 'do_lu_ma_mé_xo_ve_sá'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D [de] MMMM [de] YYYY',
LLL : 'D [de] MMMM [de] YYYY H:mm',
LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'
},
calendar : {
sameDay : function () {
return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';
},
nextDay : function () {
return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';
},
nextWeek : function () {
return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
},
lastDay : function () {
return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT';
},
lastWeek : function () {
return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
},
sameElse : 'L'
},
relativeTime : {
future : function (str) {
if (str.indexOf('un') === 0) {
return 'n' + str;
}
return 'en ' + str;
},
past : 'hai %s',
s : 'uns segundos',
ss : '%d segundos',
m : 'un minuto',
mm : '%d minutos',
h : 'unha hora',
hh : '%d horas',
d : 'un día',
dd : '%d días',
M : 'un mes',
MM : '%d meses',
y : 'un ano',
yy : '%d anos'
},
dayOfMonthOrdinalParse : /\d{1,2}º/,
ordinal : '%dº',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return gl;
})));
/***/ }),
/* 323 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Konkani Latin script [gom-latn]
//! author : The Discoverer : https://github.com/WikiDiscoverer
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
's': ['thodde secondanim', 'thodde second'],
'ss': [number + ' secondanim', number + ' second'],
'm': ['eka mintan', 'ek minute'],
'mm': [number + ' mintanim', number + ' mintam'],
'h': ['eka horan', 'ek hor'],
'hh': [number + ' horanim', number + ' hor'],
'd': ['eka disan', 'ek dis'],
'dd': [number + ' disanim', number + ' dis'],
'M': ['eka mhoinean', 'ek mhoino'],
'MM': [number + ' mhoineanim', number + ' mhoine'],
'y': ['eka vorsan', 'ek voros'],
'yy': [number + ' vorsanim', number + ' vorsam']
};
return withoutSuffix ? format[key][0] : format[key][1];
}
var gomLatn = moment.defineLocale('gom-latn', {
months : 'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split('_'),
monthsShort : 'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split('_'),
monthsParseExact : true,
weekdays : 'Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son\'var'.split('_'),
weekdaysShort : 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'),
weekdaysMin : 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'A h:mm [vazta]',
LTS : 'A h:mm:ss [vazta]',
L : 'DD-MM-YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY A h:mm [vazta]',
LLLL : 'dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]',
llll: 'ddd, D MMM YYYY, A h:mm [vazta]'
},
calendar : {
sameDay: '[Aiz] LT',
nextDay: '[Faleam] LT',
nextWeek: '[Ieta to] dddd[,] LT',
lastDay: '[Kal] LT',
lastWeek: '[Fatlo] dddd[,] LT',
sameElse: 'L'
},
relativeTime : {
future : '%s',
past : '%s adim',
s : processRelativeTime,
ss : processRelativeTime,
m : processRelativeTime,
mm : processRelativeTime,
h : processRelativeTime,
hh : processRelativeTime,
d : processRelativeTime,
dd : processRelativeTime,
M : processRelativeTime,
MM : processRelativeTime,
y : processRelativeTime,
yy : processRelativeTime
},
dayOfMonthOrdinalParse : /\d{1,2}(er)/,
ordinal : function (number, period) {
switch (period) {
// the ordinal 'er' only applies to day of the month
case 'D':
return number + 'er';
default:
case 'M':
case 'Q':
case 'DDD':
case 'd':
case 'w':
case 'W':
return number;
}
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
},
meridiemParse: /rati|sokalli|donparam|sanje/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'rati') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'sokalli') {
return hour;
} else if (meridiem === 'donparam') {
return hour > 12 ? hour : hour + 12;
} else if (meridiem === 'sanje') {
return hour + 12;
}
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'rati';
} else if (hour < 12) {
return 'sokalli';
} else if (hour < 16) {
return 'donparam';
} else if (hour < 20) {
return 'sanje';
} else {
return 'rati';
}
}
});
return gomLatn;
})));
/***/ }),
/* 324 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Gujarati [gu]
//! author : Kaushik Thanki : https://github.com/Kaushik1987
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '૧',
'2': '૨',
'3': '૩',
'4': '૪',
'5': '૫',
'6': '૬',
'7': '૭',
'8': '૮',
'9': '૯',
'0': '૦'
};
var numberMap = {
'૧': '1',
'૨': '2',
'૩': '3',
'૪': '4',
'૫': '5',
'૬': '6',
'૭': '7',
'૮': '8',
'૯': '9',
'૦': '0'
};
var gu = moment.defineLocale('gu', {
months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split('_'),
monthsShort: 'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split('_'),
monthsParseExact: true,
weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split('_'),
weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'),
weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'),
longDateFormat: {
LT: 'A h:mm વાગ્યે',
LTS: 'A h:mm:ss વાગ્યે',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY, A h:mm વાગ્યે',
LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે'
},
calendar: {
sameDay: '[આજ] LT',
nextDay: '[કાલે] LT',
nextWeek: 'dddd, LT',
lastDay: '[ગઇકાલે] LT',
lastWeek: '[પાછલા] dddd, LT',
sameElse: 'L'
},
relativeTime: {
future: '%s મા',
past: '%s પેહલા',
s: 'અમુક પળો',
ss: '%d સેકંડ',
m: 'એક મિનિટ',
mm: '%d મિનિટ',
h: 'એક કલાક',
hh: '%d કલાક',
d: 'એક દિવસ',
dd: '%d દિવસ',
M: 'એક મહિનો',
MM: '%d મહિનો',
y: 'એક વર્ષ',
yy: '%d વર્ષ'
},
preparse: function (string) {
return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
// Gujarati notation for meridiems are quite fuzzy in practice. While there exists
// a rigid notion of a 'Pahar' it is not used as rigidly in modern Gujarati.
meridiemParse: /રાત|બપોર|સવાર|સાંજ/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'રાત') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'સવાર') {
return hour;
} else if (meridiem === 'બપોર') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'સાંજ') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'રાત';
} else if (hour < 10) {
return 'સવાર';
} else if (hour < 17) {
return 'બપોર';
} else if (hour < 20) {
return 'સાંજ';
} else {
return 'રાત';
}
},
week: {
dow: 0, // Sunday is the first day of the week.
doy: 6 // The week that contains Jan 1st is the first week of the year.
}
});
return gu;
})));
/***/ }),
/* 325 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Hebrew [he]
//! author : Tomer Cohen : https://github.com/tomer
//! author : Moshe Simantov : https://github.com/DevelopmentIL
//! author : Tal Ater : https://github.com/TalAter
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var he = moment.defineLocale('he', {
months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),
monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),
weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
weekdaysShort : 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
weekdaysMin : 'א_ב_ג_ד_ה_ו_ש'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D [ב]MMMM YYYY',
LLL : 'D [ב]MMMM YYYY HH:mm',
LLLL : 'dddd, D [ב]MMMM YYYY HH:mm',
l : 'D/M/YYYY',
ll : 'D MMM YYYY',
lll : 'D MMM YYYY HH:mm',
llll : 'ddd, D MMM YYYY HH:mm'
},
calendar : {
sameDay : '[היום ב־]LT',
nextDay : '[מחר ב־]LT',
nextWeek : 'dddd [בשעה] LT',
lastDay : '[אתמול ב־]LT',
lastWeek : '[ביום] dddd [האחרון בשעה] LT',
sameElse : 'L'
},
relativeTime : {
future : 'בעוד %s',
past : 'לפני %s',
s : 'מספר שניות',
ss : '%d שניות',
m : 'דקה',
mm : '%d דקות',
h : 'שעה',
hh : function (number) {
if (number === 2) {
return 'שעתיים';
}
return number + ' שעות';
},
d : 'יום',
dd : function (number) {
if (number === 2) {
return 'יומיים';
}
return number + ' ימים';
},
M : 'חודש',
MM : function (number) {
if (number === 2) {
return 'חודשיים';
}
return number + ' חודשים';
},
y : 'שנה',
yy : function (number) {
if (number === 2) {
return 'שנתיים';
} else if (number % 10 === 0 && number !== 10) {
return number + ' שנה';
}
return number + ' שנים';
}
},
meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,
isPM : function (input) {
return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input);
},
meridiem : function (hour, minute, isLower) {
if (hour < 5) {
return 'לפנות בוקר';
} else if (hour < 10) {
return 'בבוקר';
} else if (hour < 12) {
return isLower ? 'לפנה"צ' : 'לפני הצהריים';
} else if (hour < 18) {
return isLower ? 'אחה"צ' : 'אחרי הצהריים';
} else {
return 'בערב';
}
}
});
return he;
})));
/***/ }),
/* 326 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Hindi [hi]
//! author : Mayank Singhal : https://github.com/mayanksinghal
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '१',
'2': '२',
'3': '३',
'4': '४',
'5': '५',
'6': '६',
'7': '७',
'8': '८',
'9': '९',
'0': '०'
};
var numberMap = {
'१': '1',
'२': '2',
'३': '3',
'४': '4',
'५': '5',
'६': '6',
'७': '7',
'८': '8',
'९': '9',
'०': '0'
};
var hi = moment.defineLocale('hi', {
months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),
monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),
monthsParseExact: true,
weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
longDateFormat : {
LT : 'A h:mm बजे',
LTS : 'A h:mm:ss बजे',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY, A h:mm बजे',
LLLL : 'dddd, D MMMM YYYY, A h:mm बजे'
},
calendar : {
sameDay : '[आज] LT',
nextDay : '[कल] LT',
nextWeek : 'dddd, LT',
lastDay : '[कल] LT',
lastWeek : '[पिछले] dddd, LT',
sameElse : 'L'
},
relativeTime : {
future : '%s में',
past : '%s पहले',
s : 'कुछ ही क्षण',
ss : '%d सेकंड',
m : 'एक मिनट',
mm : '%d मिनट',
h : 'एक घंटा',
hh : '%d घंटे',
d : 'एक दिन',
dd : '%d दिन',
M : 'एक महीने',
MM : '%d महीने',
y : 'एक वर्ष',
yy : '%d वर्ष'
},
preparse: function (string) {
return string.replace(/[१२३४५६७८९०]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
// Hindi notation for meridiems are quite fuzzy in practice. While there exists
// a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
meridiemParse: /रात|सुबह|दोपहर|शाम/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'रात') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'सुबह') {
return hour;
} else if (meridiem === 'दोपहर') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'शाम') {
return hour + 12;
}
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'रात';
} else if (hour < 10) {
return 'सुबह';
} else if (hour < 17) {
return 'दोपहर';
} else if (hour < 20) {
return 'शाम';
} else {
return 'रात';
}
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
}
});
return hi;
})));
/***/ }),
/* 327 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Croatian [hr]
//! author : Bojan Marković : https://github.com/bmarkovic
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function translate(number, withoutSuffix, key) {
var result = number + ' ';
switch (key) {
case 'ss':
if (number === 1) {
result += 'sekunda';
} else if (number === 2 || number === 3 || number === 4) {
result += 'sekunde';
} else {
result += 'sekundi';
}
return result;
case 'm':
return withoutSuffix ? 'jedna minuta' : 'jedne minute';
case 'mm':
if (number === 1) {
result += 'minuta';
} else if (number === 2 || number === 3 || number === 4) {
result += 'minute';
} else {
result += 'minuta';
}
return result;
case 'h':
return withoutSuffix ? 'jedan sat' : 'jednog sata';
case 'hh':
if (number === 1) {
result += 'sat';
} else if (number === 2 || number === 3 || number === 4) {
result += 'sata';
} else {
result += 'sati';
}
return result;
case 'dd':
if (number === 1) {
result += 'dan';
} else {
result += 'dana';
}
return result;
case 'MM':
if (number === 1) {
result += 'mjesec';
} else if (number === 2 || number === 3 || number === 4) {
result += 'mjeseca';
} else {
result += 'mjeseci';
}
return result;
case 'yy':
if (number === 1) {
result += 'godina';
} else if (number === 2 || number === 3 || number === 4) {
result += 'godine';
} else {
result += 'godina';
}
return result;
}
}
var hr = moment.defineLocale('hr', {
months : {
format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_'),
standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_')
},
monthsShort : 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'),
monthsParseExact: true,
weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY H:mm',
LLLL : 'dddd, D. MMMM YYYY H:mm'
},
calendar : {
sameDay : '[danas u] LT',
nextDay : '[sutra u] LT',
nextWeek : function () {
switch (this.day()) {
case 0:
return '[u] [nedjelju] [u] LT';
case 3:
return '[u] [srijedu] [u] LT';
case 6:
return '[u] [subotu] [u] LT';
case 1:
case 2:
case 4:
case 5:
return '[u] dddd [u] LT';
}
},
lastDay : '[jučer u] LT',
lastWeek : function () {
switch (this.day()) {
case 0:
case 3:
return '[prošlu] dddd [u] LT';
case 6:
return '[prošle] [subote] [u] LT';
case 1:
case 2:
case 4:
case 5:
return '[prošli] dddd [u] LT';
}
},
sameElse : 'L'
},
relativeTime : {
future : 'za %s',
past : 'prije %s',
s : 'par sekundi',
ss : translate,
m : translate,
mm : translate,
h : translate,
hh : translate,
d : 'dan',
dd : translate,
M : 'mjesec',
MM : translate,
y : 'godinu',
yy : translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return hr;
})));
/***/ }),
/* 328 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Hungarian [hu]
//! author : Adam Brunner : https://github.com/adambrunner
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');
function translate(number, withoutSuffix, key, isFuture) {
var num = number;
switch (key) {
case 's':
return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';
case 'ss':
return num + (isFuture || withoutSuffix) ? ' másodperc' : ' másodperce';
case 'm':
return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');
case 'mm':
return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
case 'h':
return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');
case 'hh':
return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
case 'd':
return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');
case 'dd':
return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
case 'M':
return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
case 'MM':
return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
case 'y':
return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');
case 'yy':
return num + (isFuture || withoutSuffix ? ' év' : ' éve');
}
return '';
}
function week(isFuture) {
return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]';
}
var hu = moment.defineLocale('hu', {
months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),
monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),
weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'),
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'YYYY.MM.DD.',
LL : 'YYYY. MMMM D.',
LLL : 'YYYY. MMMM D. H:mm',
LLLL : 'YYYY. MMMM D., dddd H:mm'
},
meridiemParse: /de|du/i,
isPM: function (input) {
return input.charAt(1).toLowerCase() === 'u';
},
meridiem : function (hours, minutes, isLower) {
if (hours < 12) {
return isLower === true ? 'de' : 'DE';
} else {
return isLower === true ? 'du' : 'DU';
}
},
calendar : {
sameDay : '[ma] LT[-kor]',
nextDay : '[holnap] LT[-kor]',
nextWeek : function () {
return week.call(this, true);
},
lastDay : '[tegnap] LT[-kor]',
lastWeek : function () {
return week.call(this, false);
},
sameElse : 'L'
},
relativeTime : {
future : '%s múlva',
past : '%s',
s : translate,
ss : translate,
m : translate,
mm : translate,
h : translate,
hh : translate,
d : translate,
dd : translate,
M : translate,
MM : translate,
y : translate,
yy : translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return hu;
})));
/***/ }),
/* 329 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Armenian [hy-am]
//! author : Armendarabyan : https://github.com/armendarabyan
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var hyAm = moment.defineLocale('hy-am', {
months : {
format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'),
standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_')
},
monthsShort : 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),
weekdays : 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'),
weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D MMMM YYYY թ.',
LLL : 'D MMMM YYYY թ., HH:mm',
LLLL : 'dddd, D MMMM YYYY թ., HH:mm'
},
calendar : {
sameDay: '[այսօր] LT',
nextDay: '[վաղը] LT',
lastDay: '[երեկ] LT',
nextWeek: function () {
return 'dddd [օրը ժամը] LT';
},
lastWeek: function () {
return '[անցած] dddd [օրը ժամը] LT';
},
sameElse: 'L'
},
relativeTime : {
future : '%s հետո',
past : '%s առաջ',
s : 'մի քանի վայրկյան',
ss : '%d վայրկյան',
m : 'րոպե',
mm : '%d րոպե',
h : 'ժամ',
hh : '%d ժամ',
d : 'օր',
dd : '%d օր',
M : 'ամիս',
MM : '%d ամիս',
y : 'տարի',
yy : '%d տարի'
},
meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,
isPM: function (input) {
return /^(ցերեկվա|երեկոյան)$/.test(input);
},
meridiem : function (hour) {
if (hour < 4) {
return 'գիշերվա';
} else if (hour < 12) {
return 'առավոտվա';
} else if (hour < 17) {
return 'ցերեկվա';
} else {
return 'երեկոյան';
}
},
dayOfMonthOrdinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/,
ordinal: function (number, period) {
switch (period) {
case 'DDD':
case 'w':
case 'W':
case 'DDDo':
if (number === 1) {
return number + '-ին';
}
return number + '-րդ';
default:
return number;
}
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return hyAm;
})));
/***/ }),
/* 330 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Indonesian [id]
//! author : Mohammad Satrio Utomo : https://github.com/tyok
//! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var id = moment.defineLocale('id', {
months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),
weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
longDateFormat : {
LT : 'HH.mm',
LTS : 'HH.mm.ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY [pukul] HH.mm',
LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
},
meridiemParse: /pagi|siang|sore|malam/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'pagi') {
return hour;
} else if (meridiem === 'siang') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === 'sore' || meridiem === 'malam') {
return hour + 12;
}
},
meridiem : function (hours, minutes, isLower) {
if (hours < 11) {
return 'pagi';
} else if (hours < 15) {
return 'siang';
} else if (hours < 19) {
return 'sore';
} else {
return 'malam';
}
},
calendar : {
sameDay : '[Hari ini pukul] LT',
nextDay : '[Besok pukul] LT',
nextWeek : 'dddd [pukul] LT',
lastDay : '[Kemarin pukul] LT',
lastWeek : 'dddd [lalu pukul] LT',
sameElse : 'L'
},
relativeTime : {
future : 'dalam %s',
past : '%s yang lalu',
s : 'beberapa detik',
ss : '%d detik',
m : 'semenit',
mm : '%d menit',
h : 'sejam',
hh : '%d jam',
d : 'sehari',
dd : '%d hari',
M : 'sebulan',
MM : '%d bulan',
y : 'setahun',
yy : '%d tahun'
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return id;
})));
/***/ }),
/* 331 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Icelandic [is]
//! author : Hinrik Örn Sigurðsson : https://github.com/hinrik
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function plural(n) {
if (n % 100 === 11) {
return true;
} else if (n % 10 === 1) {
return false;
}
return true;
}
function translate(number, withoutSuffix, key, isFuture) {
var result = number + ' ';
switch (key) {
case 's':
return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum';
case 'ss':
if (plural(number)) {
return result + (withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum');
}
return result + 'sekúnda';
case 'm':
return withoutSuffix ? 'mínúta' : 'mínútu';
case 'mm':
if (plural(number)) {
return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum');
} else if (withoutSuffix) {
return result + 'mínúta';
}
return result + 'mínútu';
case 'hh':
if (plural(number)) {
return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum');
}
return result + 'klukkustund';
case 'd':
if (withoutSuffix) {
return 'dagur';
}
return isFuture ? 'dag' : 'degi';
case 'dd':
if (plural(number)) {
if (withoutSuffix) {
return result + 'dagar';
}
return result + (isFuture ? 'daga' : 'dögum');
} else if (withoutSuffix) {
return result + 'dagur';
}
return result + (isFuture ? 'dag' : 'degi');
case 'M':
if (withoutSuffix) {
return 'mánuður';
}
return isFuture ? 'mánuð' : 'mánuði';
case 'MM':
if (plural(number)) {
if (withoutSuffix) {
return result + 'mánuðir';
}
return result + (isFuture ? 'mánuði' : 'mánuðum');
} else if (withoutSuffix) {
return result + 'mánuður';
}
return result + (isFuture ? 'mánuð' : 'mánuði');
case 'y':
return withoutSuffix || isFuture ? 'ár' : 'ári';
case 'yy':
if (plural(number)) {
return result + (withoutSuffix || isFuture ? 'ár' : 'árum');
}
return result + (withoutSuffix || isFuture ? 'ár' : 'ári');
}
}
var is = moment.defineLocale('is', {
months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'),
monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'),
weekdaysShort : 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
weekdaysMin : 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY [kl.] H:mm',
LLLL : 'dddd, D. MMMM YYYY [kl.] H:mm'
},
calendar : {
sameDay : '[í dag kl.] LT',
nextDay : '[á morgun kl.] LT',
nextWeek : 'dddd [kl.] LT',
lastDay : '[í gær kl.] LT',
lastWeek : '[síðasta] dddd [kl.] LT',
sameElse : 'L'
},
relativeTime : {
future : 'eftir %s',
past : 'fyrir %s síðan',
s : translate,
ss : translate,
m : translate,
mm : translate,
h : 'klukkustund',
hh : translate,
d : translate,
dd : translate,
M : translate,
MM : translate,
y : translate,
yy : translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return is;
})));
/***/ }),
/* 332 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Italian [it]
//! author : Lorenzo : https://github.com/aliem
//! author: Mattia Larentis: https://github.com/nostalgiaz
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var it = moment.defineLocale('it', {
months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
weekdays : 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'),
weekdaysShort : 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
weekdaysMin : 'do_lu_ma_me_gi_ve_sa'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[Oggi alle] LT',
nextDay: '[Domani alle] LT',
nextWeek: 'dddd [alle] LT',
lastDay: '[Ieri alle] LT',
lastWeek: function () {
switch (this.day()) {
case 0:
return '[la scorsa] dddd [alle] LT';
default:
return '[lo scorso] dddd [alle] LT';
}
},
sameElse: 'L'
},
relativeTime : {
future : function (s) {
return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s;
},
past : '%s fa',
s : 'alcuni secondi',
ss : '%d secondi',
m : 'un minuto',
mm : '%d minuti',
h : 'un\'ora',
hh : '%d ore',
d : 'un giorno',
dd : '%d giorni',
M : 'un mese',
MM : '%d mesi',
y : 'un anno',
yy : '%d anni'
},
dayOfMonthOrdinalParse : /\d{1,2}º/,
ordinal: '%dº',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return it;
})));
/***/ }),
/* 333 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Japanese [ja]
//! author : LI Long : https://github.com/baryon
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var ja = moment.defineLocale('ja', {
months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
weekdaysShort : '日_月_火_水_木_金_土'.split('_'),
weekdaysMin : '日_月_火_水_木_金_土'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'YYYY/MM/DD',
LL : 'YYYY年M月D日',
LLL : 'YYYY年M月D日 HH:mm',
LLLL : 'YYYY年M月D日 HH:mm dddd',
l : 'YYYY/MM/DD',
ll : 'YYYY年M月D日',
lll : 'YYYY年M月D日 HH:mm',
llll : 'YYYY年M月D日 HH:mm dddd'
},
meridiemParse: /午前|午後/i,
isPM : function (input) {
return input === '午後';
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return '午前';
} else {
return '午後';
}
},
calendar : {
sameDay : '[今日] LT',
nextDay : '[明日] LT',
nextWeek : '[来週]dddd LT',
lastDay : '[昨日] LT',
lastWeek : '[前週]dddd LT',
sameElse : 'L'
},
dayOfMonthOrdinalParse : /\d{1,2}日/,
ordinal : function (number, period) {
switch (period) {
case 'd':
case 'D':
case 'DDD':
return number + '日';
default:
return number;
}
},
relativeTime : {
future : '%s後',
past : '%s前',
s : '数秒',
ss : '%d秒',
m : '1分',
mm : '%d分',
h : '1時間',
hh : '%d時間',
d : '1日',
dd : '%d日',
M : '1ヶ月',
MM : '%dヶ月',
y : '1年',
yy : '%d年'
}
});
return ja;
})));
/***/ }),
/* 334 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Javanese [jv]
//! author : Rony Lantip : https://github.com/lantip
//! reference: http://jv.wikipedia.org/wiki/Basa_Jawa
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var jv = moment.defineLocale('jv', {
months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split('_'),
monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),
weekdays : 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),
weekdaysShort : 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),
weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),
longDateFormat : {
LT : 'HH.mm',
LTS : 'HH.mm.ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY [pukul] HH.mm',
LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
},
meridiemParse: /enjing|siyang|sonten|ndalu/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'enjing') {
return hour;
} else if (meridiem === 'siyang') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === 'sonten' || meridiem === 'ndalu') {
return hour + 12;
}
},
meridiem : function (hours, minutes, isLower) {
if (hours < 11) {
return 'enjing';
} else if (hours < 15) {
return 'siyang';
} else if (hours < 19) {
return 'sonten';
} else {
return 'ndalu';
}
},
calendar : {
sameDay : '[Dinten puniko pukul] LT',
nextDay : '[Mbenjang pukul] LT',
nextWeek : 'dddd [pukul] LT',
lastDay : '[Kala wingi pukul] LT',
lastWeek : 'dddd [kepengker pukul] LT',
sameElse : 'L'
},
relativeTime : {
future : 'wonten ing %s',
past : '%s ingkang kepengker',
s : 'sawetawis detik',
ss : '%d detik',
m : 'setunggal menit',
mm : '%d menit',
h : 'setunggal jam',
hh : '%d jam',
d : 'sedinten',
dd : '%d dinten',
M : 'sewulan',
MM : '%d wulan',
y : 'setaun',
yy : '%d taun'
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return jv;
})));
/***/ }),
/* 335 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Georgian [ka]
//! author : Irakli Janiashvili : https://github.com/irakli-janiashvili
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var ka = moment.defineLocale('ka', {
months : {
standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'),
format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_')
},
monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
weekdays : {
standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),
format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'),
isFormat: /(წინა|შემდეგ)/
},
weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
longDateFormat : {
LT : 'h:mm A',
LTS : 'h:mm:ss A',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY h:mm A',
LLLL : 'dddd, D MMMM YYYY h:mm A'
},
calendar : {
sameDay : '[დღეს] LT[-ზე]',
nextDay : '[ხვალ] LT[-ზე]',
lastDay : '[გუშინ] LT[-ზე]',
nextWeek : '[შემდეგ] dddd LT[-ზე]',
lastWeek : '[წინა] dddd LT-ზე',
sameElse : 'L'
},
relativeTime : {
future : function (s) {
return (/(წამი|წუთი|საათი|წელი)/).test(s) ?
s.replace(/ი$/, 'ში') :
s + 'ში';
},
past : function (s) {
if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) {
return s.replace(/(ი|ე)$/, 'ის უკან');
}
if ((/წელი/).test(s)) {
return s.replace(/წელი$/, 'წლის უკან');
}
},
s : 'რამდენიმე წამი',
ss : '%d წამი',
m : 'წუთი',
mm : '%d წუთი',
h : 'საათი',
hh : '%d საათი',
d : 'დღე',
dd : '%d დღე',
M : 'თვე',
MM : '%d თვე',
y : 'წელი',
yy : '%d წელი'
},
dayOfMonthOrdinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,
ordinal : function (number) {
if (number === 0) {
return number;
}
if (number === 1) {
return number + '-ლი';
}
if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) {
return 'მე-' + number;
}
return number + '-ე';
},
week : {
dow : 1,
doy : 7
}
});
return ka;
})));
/***/ }),
/* 336 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Kazakh [kk]
//! authors : Nurlan Rakhimzhanov : https://github.com/nurlan
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var suffixes = {
0: '-ші',
1: '-ші',
2: '-ші',
3: '-ші',
4: '-ші',
5: '-ші',
6: '-шы',
7: '-ші',
8: '-ші',
9: '-шы',
10: '-шы',
20: '-шы',
30: '-шы',
40: '-шы',
50: '-ші',
60: '-шы',
70: '-ші',
80: '-ші',
90: '-шы',
100: '-ші'
};
var kk = moment.defineLocale('kk', {
months : 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split('_'),
monthsShort : 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),
weekdays : 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split('_'),
weekdaysShort : 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),
weekdaysMin : 'жк_дй_сй_ср_бй_жм_сн'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[Бүгін сағат] LT',
nextDay : '[Ертең сағат] LT',
nextWeek : 'dddd [сағат] LT',
lastDay : '[Кеше сағат] LT',
lastWeek : '[Өткен аптаның] dddd [сағат] LT',
sameElse : 'L'
},
relativeTime : {
future : '%s ішінде',
past : '%s бұрын',
s : 'бірнеше секунд',
ss : '%d секунд',
m : 'бір минут',
mm : '%d минут',
h : 'бір сағат',
hh : '%d сағат',
d : 'бір күн',
dd : '%d күн',
M : 'бір ай',
MM : '%d ай',
y : 'бір жыл',
yy : '%d жыл'
},
dayOfMonthOrdinalParse: /\d{1,2}-(ші|шы)/,
ordinal : function (number) {
var a = number % 10,
b = number >= 100 ? 100 : null;
return number + (suffixes[number] || suffixes[a] || suffixes[b]);
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return kk;
})));
/***/ }),
/* 337 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Cambodian [km]
//! author : Kruy Vanna : https://github.com/kruyvanna
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var km = moment.defineLocale('km', {
months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
weekdaysShort: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
weekdaysMin: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS : 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',
nextDay: '[ស្អែក ម៉ោង] LT',
nextWeek: 'dddd [ម៉ោង] LT',
lastDay: '[ម្សិលមិញ ម៉ោង] LT',
lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',
sameElse: 'L'
},
relativeTime: {
future: '%sទៀត',
past: '%sមុន',
s: 'ប៉ុន្មានវិនាទី',
ss: '%d វិនាទី',
m: 'មួយនាទី',
mm: '%d នាទី',
h: 'មួយម៉ោង',
hh: '%d ម៉ោង',
d: 'មួយថ្ងៃ',
dd: '%d ថ្ងៃ',
M: 'មួយខែ',
MM: '%d ខែ',
y: 'មួយឆ្នាំ',
yy: '%d ឆ្នាំ'
},
week: {
dow: 1, // Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return km;
})));
/***/ }),
/* 338 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Kannada [kn]
//! author : Rajeev Naik : https://github.com/rajeevnaikte
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '೧',
'2': '೨',
'3': '೩',
'4': '೪',
'5': '೫',
'6': '೬',
'7': '೭',
'8': '೮',
'9': '೯',
'0': '೦'
};
var numberMap = {
'೧': '1',
'೨': '2',
'೩': '3',
'೪': '4',
'೫': '5',
'೬': '6',
'೭': '7',
'೮': '8',
'೯': '9',
'೦': '0'
};
var kn = moment.defineLocale('kn', {
months : 'ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್'.split('_'),
monthsShort : 'ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬ_ಅಕ್ಟೋಬ_ನವೆಂಬ_ಡಿಸೆಂಬ'.split('_'),
monthsParseExact: true,
weekdays : 'ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ'.split('_'),
weekdaysShort : 'ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ'.split('_'),
weekdaysMin : 'ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ'.split('_'),
longDateFormat : {
LT : 'A h:mm',
LTS : 'A h:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY, A h:mm',
LLLL : 'dddd, D MMMM YYYY, A h:mm'
},
calendar : {
sameDay : '[ಇಂದು] LT',
nextDay : '[ನಾಳೆ] LT',
nextWeek : 'dddd, LT',
lastDay : '[ನಿನ್ನೆ] LT',
lastWeek : '[ಕೊನೆಯ] dddd, LT',
sameElse : 'L'
},
relativeTime : {
future : '%s ನಂತರ',
past : '%s ಹಿಂದೆ',
s : 'ಕೆಲವು ಕ್ಷಣಗಳು',
ss : '%d ಸೆಕೆಂಡುಗಳು',
m : 'ಒಂದು ನಿಮಿಷ',
mm : '%d ನಿಮಿಷ',
h : 'ಒಂದು ಗಂಟೆ',
hh : '%d ಗಂಟೆ',
d : 'ಒಂದು ದಿನ',
dd : '%d ದಿನ',
M : 'ಒಂದು ತಿಂಗಳು',
MM : '%d ತಿಂಗಳು',
y : 'ಒಂದು ವರ್ಷ',
yy : '%d ವರ್ಷ'
},
preparse: function (string) {
return string.replace(/[೧೨೩೪೫೬೭೮೯೦]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
meridiemParse: /ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'ರಾತ್ರಿ') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'ಬೆಳಿಗ್ಗೆ') {
return hour;
} else if (meridiem === 'ಮಧ್ಯಾಹ್ನ') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'ಸಂಜೆ') {
return hour + 12;
}
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'ರಾತ್ರಿ';
} else if (hour < 10) {
return 'ಬೆಳಿಗ್ಗೆ';
} else if (hour < 17) {
return 'ಮಧ್ಯಾಹ್ನ';
} else if (hour < 20) {
return 'ಸಂಜೆ';
} else {
return 'ರಾತ್ರಿ';
}
},
dayOfMonthOrdinalParse: /\d{1,2}(ನೇ)/,
ordinal : function (number) {
return number + 'ನೇ';
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
}
});
return kn;
})));
/***/ }),
/* 339 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Korean [ko]
//! author : Kyungwook, Park : https://github.com/kyungw00k
//! author : Jeeeyul Lee
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var ko = moment.defineLocale('ko', {
months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
monthsShort : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
weekdays : '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),
weekdaysShort : '일_월_화_수_목_금_토'.split('_'),
weekdaysMin : '일_월_화_수_목_금_토'.split('_'),
longDateFormat : {
LT : 'A h:mm',
LTS : 'A h:mm:ss',
L : 'YYYY.MM.DD',
LL : 'YYYY년 MMMM D일',
LLL : 'YYYY년 MMMM D일 A h:mm',
LLLL : 'YYYY년 MMMM D일 dddd A h:mm',
l : 'YYYY.MM.DD',
ll : 'YYYY년 MMMM D일',
lll : 'YYYY년 MMMM D일 A h:mm',
llll : 'YYYY년 MMMM D일 dddd A h:mm'
},
calendar : {
sameDay : '오늘 LT',
nextDay : '내일 LT',
nextWeek : 'dddd LT',
lastDay : '어제 LT',
lastWeek : '지난주 dddd LT',
sameElse : 'L'
},
relativeTime : {
future : '%s 후',
past : '%s 전',
s : '몇 초',
ss : '%d초',
m : '1분',
mm : '%d분',
h : '한 시간',
hh : '%d시간',
d : '하루',
dd : '%d일',
M : '한 달',
MM : '%d달',
y : '일 년',
yy : '%d년'
},
dayOfMonthOrdinalParse : /\d{1,2}(일|월|주)/,
ordinal : function (number, period) {
switch (period) {
case 'd':
case 'D':
case 'DDD':
return number + '일';
case 'M':
return number + '월';
case 'w':
case 'W':
return number + '주';
default:
return number;
}
},
meridiemParse : /오전|오후/,
isPM : function (token) {
return token === '오후';
},
meridiem : function (hour, minute, isUpper) {
return hour < 12 ? '오전' : '오후';
}
});
return ko;
})));
/***/ }),
/* 340 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Kyrgyz [ky]
//! author : Chyngyz Arystan uulu : https://github.com/chyngyz
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var suffixes = {
0: '-чү',
1: '-чи',
2: '-чи',
3: '-чү',
4: '-чү',
5: '-чи',
6: '-чы',
7: '-чи',
8: '-чи',
9: '-чу',
10: '-чу',
20: '-чы',
30: '-чу',
40: '-чы',
50: '-чү',
60: '-чы',
70: '-чи',
80: '-чи',
90: '-чу',
100: '-чү'
};
var ky = moment.defineLocale('ky', {
months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
monthsShort : 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),
weekdays : 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split('_'),
weekdaysShort : 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),
weekdaysMin : 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[Бүгүн саат] LT',
nextDay : '[Эртең саат] LT',
nextWeek : 'dddd [саат] LT',
lastDay : '[Кече саат] LT',
lastWeek : '[Өткен аптанын] dddd [күнү] [саат] LT',
sameElse : 'L'
},
relativeTime : {
future : '%s ичинде',
past : '%s мурун',
s : 'бирнече секунд',
ss : '%d секунд',
m : 'бир мүнөт',
mm : '%d мүнөт',
h : 'бир саат',
hh : '%d саат',
d : 'бир күн',
dd : '%d күн',
M : 'бир ай',
MM : '%d ай',
y : 'бир жыл',
yy : '%d жыл'
},
dayOfMonthOrdinalParse: /\d{1,2}-(чи|чы|чү|чу)/,
ordinal : function (number) {
var a = number % 10,
b = number >= 100 ? 100 : null;
return number + (suffixes[number] || suffixes[a] || suffixes[b]);
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return ky;
})));
/***/ }),
/* 341 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Luxembourgish [lb]
//! author : mweimerskirch : https://github.com/mweimerskirch
//! author : David Raison : https://github.com/kwisatz
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
'm': ['eng Minutt', 'enger Minutt'],
'h': ['eng Stonn', 'enger Stonn'],
'd': ['een Dag', 'engem Dag'],
'M': ['ee Mount', 'engem Mount'],
'y': ['ee Joer', 'engem Joer']
};
return withoutSuffix ? format[key][0] : format[key][1];
}
function processFutureTime(string) {
var number = string.substr(0, string.indexOf(' '));
if (eifelerRegelAppliesToNumber(number)) {
return 'a ' + string;
}
return 'an ' + string;
}
function processPastTime(string) {
var number = string.substr(0, string.indexOf(' '));
if (eifelerRegelAppliesToNumber(number)) {
return 'viru ' + string;
}
return 'virun ' + string;
}
/**
* Returns true if the word before the given number loses the '-n' ending.
* e.g. 'an 10 Deeg' but 'a 5 Deeg'
*
* @param number {integer}
* @returns {boolean}
*/
function eifelerRegelAppliesToNumber(number) {
number = parseInt(number, 10);
if (isNaN(number)) {
return false;
}
if (number < 0) {
// Negative Number --> always true
return true;
} else if (number < 10) {
// Only 1 digit
if (4 <= number && number <= 7) {
return true;
}
return false;
} else if (number < 100) {
// 2 digits
var lastDigit = number % 10, firstDigit = number / 10;
if (lastDigit === 0) {
return eifelerRegelAppliesToNumber(firstDigit);
}
return eifelerRegelAppliesToNumber(lastDigit);
} else if (number < 10000) {
// 3 or 4 digits --> recursively check first digit
while (number >= 10) {
number = number / 10;
}
return eifelerRegelAppliesToNumber(number);
} else {
// Anything larger than 4 digits: recursively check first n-3 digits
number = number / 1000;
return eifelerRegelAppliesToNumber(number);
}
}
var lb = moment.defineLocale('lb', {
months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
monthsParseExact : true,
weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),
weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
weekdaysParseExact : true,
longDateFormat: {
LT: 'H:mm [Auer]',
LTS: 'H:mm:ss [Auer]',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY H:mm [Auer]',
LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]'
},
calendar: {
sameDay: '[Haut um] LT',
sameElse: 'L',
nextDay: '[Muer um] LT',
nextWeek: 'dddd [um] LT',
lastDay: '[Gëschter um] LT',
lastWeek: function () {
// Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
switch (this.day()) {
case 2:
case 4:
return '[Leschten] dddd [um] LT';
default:
return '[Leschte] dddd [um] LT';
}
}
},
relativeTime : {
future : processFutureTime,
past : processPastTime,
s : 'e puer Sekonnen',
ss : '%d Sekonnen',
m : processRelativeTime,
mm : '%d Minutten',
h : processRelativeTime,
hh : '%d Stonnen',
d : processRelativeTime,
dd : '%d Deeg',
M : processRelativeTime,
MM : '%d Méint',
y : processRelativeTime,
yy : '%d Joer'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1, // Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return lb;
})));
/***/ }),
/* 342 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Lao [lo]
//! author : Ryan Hart : https://github.com/ryanhart2
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var lo = moment.defineLocale('lo', {
months : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),
monthsShort : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),
weekdays : 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
weekdaysShort : 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
weekdaysMin : 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'ວັນdddd D MMMM YYYY HH:mm'
},
meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/,
isPM: function (input) {
return input === 'ຕອນແລງ';
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return 'ຕອນເຊົ້າ';
} else {
return 'ຕອນແລງ';
}
},
calendar : {
sameDay : '[ມື້ນີ້ເວລາ] LT',
nextDay : '[ມື້ອື່ນເວລາ] LT',
nextWeek : '[ວັນ]dddd[ໜ້າເວລາ] LT',
lastDay : '[ມື້ວານນີ້ເວລາ] LT',
lastWeek : '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT',
sameElse : 'L'
},
relativeTime : {
future : 'ອີກ %s',
past : '%sຜ່ານມາ',
s : 'ບໍ່ເທົ່າໃດວິນາທີ',
ss : '%d ວິນາທີ' ,
m : '1 ນາທີ',
mm : '%d ນາທີ',
h : '1 ຊົ່ວໂມງ',
hh : '%d ຊົ່ວໂມງ',
d : '1 ມື້',
dd : '%d ມື້',
M : '1 ເດືອນ',
MM : '%d ເດືອນ',
y : '1 ປີ',
yy : '%d ປີ'
},
dayOfMonthOrdinalParse: /(ທີ່)\d{1,2}/,
ordinal : function (number) {
return 'ທີ່' + number;
}
});
return lo;
})));
/***/ }),
/* 343 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Lithuanian [lt]
//! author : Mindaugas Mozūras : https://github.com/mmozuras
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var units = {
'ss' : 'sekundė_sekundžių_sekundes',
'm' : 'minutė_minutės_minutę',
'mm': 'minutės_minučių_minutes',
'h' : 'valanda_valandos_valandą',
'hh': 'valandos_valandų_valandas',
'd' : 'diena_dienos_dieną',
'dd': 'dienos_dienų_dienas',
'M' : 'mėnuo_mėnesio_mėnesį',
'MM': 'mėnesiai_mėnesių_mėnesius',
'y' : 'metai_metų_metus',
'yy': 'metai_metų_metus'
};
function translateSeconds(number, withoutSuffix, key, isFuture) {
if (withoutSuffix) {
return 'kelios sekundės';
} else {
return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
}
}
function translateSingular(number, withoutSuffix, key, isFuture) {
return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);
}
function special(number) {
return number % 10 === 0 || (number > 10 && number < 20);
}
function forms(key) {
return units[key].split('_');
}
function translate(number, withoutSuffix, key, isFuture) {
var result = number + ' ';
if (number === 1) {
return result + translateSingular(number, withoutSuffix, key[0], isFuture);
} else if (withoutSuffix) {
return result + (special(number) ? forms(key)[1] : forms(key)[0]);
} else {
if (isFuture) {
return result + forms(key)[1];
} else {
return result + (special(number) ? forms(key)[1] : forms(key)[2]);
}
}
}
var lt = moment.defineLocale('lt', {
months : {
format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'),
standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'),
isFormat: /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/
},
monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
weekdays : {
format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'),
standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'),
isFormat: /dddd HH:mm/
},
weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'YYYY-MM-DD',
LL : 'YYYY [m.] MMMM D [d.]',
LLL : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
LLLL : 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
l : 'YYYY-MM-DD',
ll : 'YYYY [m.] MMMM D [d.]',
lll : 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
llll : 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]'
},
calendar : {
sameDay : '[Šiandien] LT',
nextDay : '[Rytoj] LT',
nextWeek : 'dddd LT',
lastDay : '[Vakar] LT',
lastWeek : '[Praėjusį] dddd LT',
sameElse : 'L'
},
relativeTime : {
future : 'po %s',
past : 'prieš %s',
s : translateSeconds,
ss : translate,
m : translateSingular,
mm : translate,
h : translateSingular,
hh : translate,
d : translateSingular,
dd : translate,
M : translateSingular,
MM : translate,
y : translateSingular,
yy : translate
},
dayOfMonthOrdinalParse: /\d{1,2}-oji/,
ordinal : function (number) {
return number + '-oji';
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return lt;
})));
/***/ }),
/* 344 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Latvian [lv]
//! author : Kristaps Karlsons : https://github.com/skakri
//! author : Jānis Elmeris : https://github.com/JanisE
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var units = {
'ss': 'sekundes_sekundēm_sekunde_sekundes'.split('_'),
'm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
'mm': 'minūtes_minūtēm_minūte_minūtes'.split('_'),
'h': 'stundas_stundām_stunda_stundas'.split('_'),
'hh': 'stundas_stundām_stunda_stundas'.split('_'),
'd': 'dienas_dienām_diena_dienas'.split('_'),
'dd': 'dienas_dienām_diena_dienas'.split('_'),
'M': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
'MM': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
'y': 'gada_gadiem_gads_gadi'.split('_'),
'yy': 'gada_gadiem_gads_gadi'.split('_')
};
/**
* @param withoutSuffix boolean true = a length of time; false = before/after a period of time.
*/
function format(forms, number, withoutSuffix) {
if (withoutSuffix) {
// E.g. "21 minūte", "3 minūtes".
return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3];
} else {
// E.g. "21 minūtes" as in "pēc 21 minūtes".
// E.g. "3 minūtēm" as in "pēc 3 minūtēm".
return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1];
}
}
function relativeTimeWithPlural(number, withoutSuffix, key) {
return number + ' ' + format(units[key], number, withoutSuffix);
}
function relativeTimeWithSingular(number, withoutSuffix, key) {
return format(units[key], number, withoutSuffix);
}
function relativeSeconds(number, withoutSuffix) {
return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';
}
var lv = moment.defineLocale('lv', {
months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'),
monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'),
weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'),
weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY.',
LL : 'YYYY. [gada] D. MMMM',
LLL : 'YYYY. [gada] D. MMMM, HH:mm',
LLLL : 'YYYY. [gada] D. MMMM, dddd, HH:mm'
},
calendar : {
sameDay : '[Šodien pulksten] LT',
nextDay : '[Rīt pulksten] LT',
nextWeek : 'dddd [pulksten] LT',
lastDay : '[Vakar pulksten] LT',
lastWeek : '[Pagājušā] dddd [pulksten] LT',
sameElse : 'L'
},
relativeTime : {
future : 'pēc %s',
past : 'pirms %s',
s : relativeSeconds,
ss : relativeTimeWithPlural,
m : relativeTimeWithSingular,
mm : relativeTimeWithPlural,
h : relativeTimeWithSingular,
hh : relativeTimeWithPlural,
d : relativeTimeWithSingular,
dd : relativeTimeWithPlural,
M : relativeTimeWithSingular,
MM : relativeTimeWithPlural,
y : relativeTimeWithSingular,
yy : relativeTimeWithPlural
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return lv;
})));
/***/ }),
/* 345 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Montenegrin [me]
//! author : Miodrag Nikač : https://github.com/miodragnikac
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var translator = {
words: { //Different grammatical cases
ss: ['sekund', 'sekunda', 'sekundi'],
m: ['jedan minut', 'jednog minuta'],
mm: ['minut', 'minuta', 'minuta'],
h: ['jedan sat', 'jednog sata'],
hh: ['sat', 'sata', 'sati'],
dd: ['dan', 'dana', 'dana'],
MM: ['mjesec', 'mjeseca', 'mjeseci'],
yy: ['godina', 'godine', 'godina']
},
correctGrammaticalCase: function (number, wordKey) {
return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
},
translate: function (number, withoutSuffix, key) {
var wordKey = translator.words[key];
if (key.length === 1) {
return withoutSuffix ? wordKey[0] : wordKey[1];
} else {
return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
}
}
};
var me = moment.defineLocale('me', {
months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),
monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
monthsParseExact : true,
weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
weekdaysParseExact : true,
longDateFormat: {
LT: 'H:mm',
LTS : 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY H:mm',
LLLL: 'dddd, D. MMMM YYYY H:mm'
},
calendar: {
sameDay: '[danas u] LT',
nextDay: '[sjutra u] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[u] [nedjelju] [u] LT';
case 3:
return '[u] [srijedu] [u] LT';
case 6:
return '[u] [subotu] [u] LT';
case 1:
case 2:
case 4:
case 5:
return '[u] dddd [u] LT';
}
},
lastDay : '[juče u] LT',
lastWeek : function () {
var lastWeekDays = [
'[prošle] [nedjelje] [u] LT',
'[prošlog] [ponedjeljka] [u] LT',
'[prošlog] [utorka] [u] LT',
'[prošle] [srijede] [u] LT',
'[prošlog] [četvrtka] [u] LT',
'[prošlog] [petka] [u] LT',
'[prošle] [subote] [u] LT'
];
return lastWeekDays[this.day()];
},
sameElse : 'L'
},
relativeTime : {
future : 'za %s',
past : 'prije %s',
s : 'nekoliko sekundi',
ss : translator.translate,
m : translator.translate,
mm : translator.translate,
h : translator.translate,
hh : translator.translate,
d : 'dan',
dd : translator.translate,
M : 'mjesec',
MM : translator.translate,
y : 'godinu',
yy : translator.translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return me;
})));
/***/ }),
/* 346 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Maori [mi]
//! author : John Corrigan : https://github.com/johnideal
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var mi = moment.defineLocale('mi', {
months: 'Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea'.split('_'),
monthsShort: 'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split('_'),
monthsRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
monthsStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
monthsShortRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
monthsShortStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,
weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'),
weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY [i] HH:mm',
LLLL: 'dddd, D MMMM YYYY [i] HH:mm'
},
calendar: {
sameDay: '[i teie mahana, i] LT',
nextDay: '[apopo i] LT',
nextWeek: 'dddd [i] LT',
lastDay: '[inanahi i] LT',
lastWeek: 'dddd [whakamutunga i] LT',
sameElse: 'L'
},
relativeTime: {
future: 'i roto i %s',
past: '%s i mua',
s: 'te hēkona ruarua',
ss: '%d hēkona',
m: 'he meneti',
mm: '%d meneti',
h: 'te haora',
hh: '%d haora',
d: 'he ra',
dd: '%d ra',
M: 'he marama',
MM: '%d marama',
y: 'he tau',
yy: '%d tau'
},
dayOfMonthOrdinalParse: /\d{1,2}º/,
ordinal: '%dº',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return mi;
})));
/***/ }),
/* 347 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Macedonian [mk]
//! author : Borislav Mickov : https://github.com/B0k0
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var mk = moment.defineLocale('mk', {
months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),
monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'),
weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
weekdaysMin : 'нe_пo_вт_ср_че_пе_сa'.split('_'),
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'D.MM.YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY H:mm',
LLLL : 'dddd, D MMMM YYYY H:mm'
},
calendar : {
sameDay : '[Денес во] LT',
nextDay : '[Утре во] LT',
nextWeek : '[Во] dddd [во] LT',
lastDay : '[Вчера во] LT',
lastWeek : function () {
switch (this.day()) {
case 0:
case 3:
case 6:
return '[Изминатата] dddd [во] LT';
case 1:
case 2:
case 4:
case 5:
return '[Изминатиот] dddd [во] LT';
}
},
sameElse : 'L'
},
relativeTime : {
future : 'после %s',
past : 'пред %s',
s : 'неколку секунди',
ss : '%d секунди',
m : 'минута',
mm : '%d минути',
h : 'час',
hh : '%d часа',
d : 'ден',
dd : '%d дена',
M : 'месец',
MM : '%d месеци',
y : 'година',
yy : '%d години'
},
dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
ordinal : function (number) {
var lastDigit = number % 10,
last2Digits = number % 100;
if (number === 0) {
return number + '-ев';
} else if (last2Digits === 0) {
return number + '-ен';
} else if (last2Digits > 10 && last2Digits < 20) {
return number + '-ти';
} else if (lastDigit === 1) {
return number + '-ви';
} else if (lastDigit === 2) {
return number + '-ри';
} else if (lastDigit === 7 || lastDigit === 8) {
return number + '-ми';
} else {
return number + '-ти';
}
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return mk;
})));
/***/ }),
/* 348 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Malayalam [ml]
//! author : Floyd Pink : https://github.com/floydpink
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var ml = moment.defineLocale('ml', {
months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'),
monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'),
monthsParseExact : true,
weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'),
weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),
weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),
longDateFormat : {
LT : 'A h:mm -നു',
LTS : 'A h:mm:ss -നു',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY, A h:mm -നു',
LLLL : 'dddd, D MMMM YYYY, A h:mm -നു'
},
calendar : {
sameDay : '[ഇന്ന്] LT',
nextDay : '[നാളെ] LT',
nextWeek : 'dddd, LT',
lastDay : '[ഇന്നലെ] LT',
lastWeek : '[കഴിഞ്ഞ] dddd, LT',
sameElse : 'L'
},
relativeTime : {
future : '%s കഴിഞ്ഞ്',
past : '%s മുൻപ്',
s : 'അൽപ നിമിഷങ്ങൾ',
ss : '%d സെക്കൻഡ്',
m : 'ഒരു മിനിറ്റ്',
mm : '%d മിനിറ്റ്',
h : 'ഒരു മണിക്കൂർ',
hh : '%d മണിക്കൂർ',
d : 'ഒരു ദിവസം',
dd : '%d ദിവസം',
M : 'ഒരു മാസം',
MM : '%d മാസം',
y : 'ഒരു വർഷം',
yy : '%d വർഷം'
},
meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if ((meridiem === 'രാത്രി' && hour >= 4) ||
meridiem === 'ഉച്ച കഴിഞ്ഞ്' ||
meridiem === 'വൈകുന്നേരം') {
return hour + 12;
} else {
return hour;
}
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'രാത്രി';
} else if (hour < 12) {
return 'രാവിലെ';
} else if (hour < 17) {
return 'ഉച്ച കഴിഞ്ഞ്';
} else if (hour < 20) {
return 'വൈകുന്നേരം';
} else {
return 'രാത്രി';
}
}
});
return ml;
})));
/***/ }),
/* 349 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Marathi [mr]
//! author : Harshad Kale : https://github.com/kalehv
//! author : Vivek Athalye : https://github.com/vnathalye
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '१',
'2': '२',
'3': '३',
'4': '४',
'5': '५',
'6': '६',
'7': '७',
'8': '८',
'9': '९',
'0': '०'
};
var numberMap = {
'१': '1',
'२': '2',
'३': '3',
'४': '4',
'५': '5',
'६': '6',
'७': '7',
'८': '8',
'९': '9',
'०': '0'
};
function relativeTimeMr(number, withoutSuffix, string, isFuture)
{
var output = '';
if (withoutSuffix) {
switch (string) {
case 's': output = 'काही सेकंद'; break;
case 'ss': output = '%d सेकंद'; break;
case 'm': output = 'एक मिनिट'; break;
case 'mm': output = '%d मिनिटे'; break;
case 'h': output = 'एक तास'; break;
case 'hh': output = '%d तास'; break;
case 'd': output = 'एक दिवस'; break;
case 'dd': output = '%d दिवस'; break;
case 'M': output = 'एक महिना'; break;
case 'MM': output = '%d महिने'; break;
case 'y': output = 'एक वर्ष'; break;
case 'yy': output = '%d वर्षे'; break;
}
}
else {
switch (string) {
case 's': output = 'काही सेकंदां'; break;
case 'ss': output = '%d सेकंदां'; break;
case 'm': output = 'एका मिनिटा'; break;
case 'mm': output = '%d मिनिटां'; break;
case 'h': output = 'एका तासा'; break;
case 'hh': output = '%d तासां'; break;
case 'd': output = 'एका दिवसा'; break;
case 'dd': output = '%d दिवसां'; break;
case 'M': output = 'एका महिन्या'; break;
case 'MM': output = '%d महिन्यां'; break;
case 'y': output = 'एका वर्षा'; break;
case 'yy': output = '%d वर्षां'; break;
}
}
return output.replace(/%d/i, number);
}
var mr = moment.defineLocale('mr', {
months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'),
monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),
monthsParseExact : true,
weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
longDateFormat : {
LT : 'A h:mm वाजता',
LTS : 'A h:mm:ss वाजता',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY, A h:mm वाजता',
LLLL : 'dddd, D MMMM YYYY, A h:mm वाजता'
},
calendar : {
sameDay : '[आज] LT',
nextDay : '[उद्या] LT',
nextWeek : 'dddd, LT',
lastDay : '[काल] LT',
lastWeek: '[मागील] dddd, LT',
sameElse : 'L'
},
relativeTime : {
future: '%sमध्ये',
past: '%sपूर्वी',
s: relativeTimeMr,
ss: relativeTimeMr,
m: relativeTimeMr,
mm: relativeTimeMr,
h: relativeTimeMr,
hh: relativeTimeMr,
d: relativeTimeMr,
dd: relativeTimeMr,
M: relativeTimeMr,
MM: relativeTimeMr,
y: relativeTimeMr,
yy: relativeTimeMr
},
preparse: function (string) {
return string.replace(/[१२३४५६७८९०]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'रात्री') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'सकाळी') {
return hour;
} else if (meridiem === 'दुपारी') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'सायंकाळी') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'रात्री';
} else if (hour < 10) {
return 'सकाळी';
} else if (hour < 17) {
return 'दुपारी';
} else if (hour < 20) {
return 'सायंकाळी';
} else {
return 'रात्री';
}
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
}
});
return mr;
})));
/***/ }),
/* 350 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Malay [ms]
//! author : Weldan Jamili : https://github.com/weldan
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var ms = moment.defineLocale('ms', {
months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
longDateFormat : {
LT : 'HH.mm',
LTS : 'HH.mm.ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY [pukul] HH.mm',
LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
},
meridiemParse: /pagi|tengahari|petang|malam/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'pagi') {
return hour;
} else if (meridiem === 'tengahari') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === 'petang' || meridiem === 'malam') {
return hour + 12;
}
},
meridiem : function (hours, minutes, isLower) {
if (hours < 11) {
return 'pagi';
} else if (hours < 15) {
return 'tengahari';
} else if (hours < 19) {
return 'petang';
} else {
return 'malam';
}
},
calendar : {
sameDay : '[Hari ini pukul] LT',
nextDay : '[Esok pukul] LT',
nextWeek : 'dddd [pukul] LT',
lastDay : '[Kelmarin pukul] LT',
lastWeek : 'dddd [lepas pukul] LT',
sameElse : 'L'
},
relativeTime : {
future : 'dalam %s',
past : '%s yang lepas',
s : 'beberapa saat',
ss : '%d saat',
m : 'seminit',
mm : '%d minit',
h : 'sejam',
hh : '%d jam',
d : 'sehari',
dd : '%d hari',
M : 'sebulan',
MM : '%d bulan',
y : 'setahun',
yy : '%d tahun'
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return ms;
})));
/***/ }),
/* 351 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Malay [ms-my]
//! note : DEPRECATED, the correct one is [ms]
//! author : Weldan Jamili : https://github.com/weldan
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var msMy = moment.defineLocale('ms-my', {
months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
longDateFormat : {
LT : 'HH.mm',
LTS : 'HH.mm.ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY [pukul] HH.mm',
LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
},
meridiemParse: /pagi|tengahari|petang|malam/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'pagi') {
return hour;
} else if (meridiem === 'tengahari') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === 'petang' || meridiem === 'malam') {
return hour + 12;
}
},
meridiem : function (hours, minutes, isLower) {
if (hours < 11) {
return 'pagi';
} else if (hours < 15) {
return 'tengahari';
} else if (hours < 19) {
return 'petang';
} else {
return 'malam';
}
},
calendar : {
sameDay : '[Hari ini pukul] LT',
nextDay : '[Esok pukul] LT',
nextWeek : 'dddd [pukul] LT',
lastDay : '[Kelmarin pukul] LT',
lastWeek : 'dddd [lepas pukul] LT',
sameElse : 'L'
},
relativeTime : {
future : 'dalam %s',
past : '%s yang lepas',
s : 'beberapa saat',
ss : '%d saat',
m : 'seminit',
mm : '%d minit',
h : 'sejam',
hh : '%d jam',
d : 'sehari',
dd : '%d hari',
M : 'sebulan',
MM : '%d bulan',
y : 'setahun',
yy : '%d tahun'
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return msMy;
})));
/***/ }),
/* 352 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Maltese (Malta) [mt]
//! author : Alessandro Maruccia : https://github.com/alesma
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var mt = moment.defineLocale('mt', {
months : 'Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru'.split('_'),
monthsShort : 'Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ'.split('_'),
weekdays : 'Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt'.split('_'),
weekdaysShort : 'Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib'.split('_'),
weekdaysMin : 'Ħa_Tn_Tl_Er_Ħa_Ġi_Si'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[Illum fil-]LT',
nextDay : '[Għada fil-]LT',
nextWeek : 'dddd [fil-]LT',
lastDay : '[Il-bieraħ fil-]LT',
lastWeek : 'dddd [li għadda] [fil-]LT',
sameElse : 'L'
},
relativeTime : {
future : 'f’ %s',
past : '%s ilu',
s : 'ftit sekondi',
ss : '%d sekondi',
m : 'minuta',
mm : '%d minuti',
h : 'siegħa',
hh : '%d siegħat',
d : 'ġurnata',
dd : '%d ġranet',
M : 'xahar',
MM : '%d xhur',
y : 'sena',
yy : '%d sni'
},
dayOfMonthOrdinalParse : /\d{1,2}º/,
ordinal: '%dº',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return mt;
})));
/***/ }),
/* 353 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Burmese [my]
//! author : Squar team, mysquar.com
//! author : David Rossellat : https://github.com/gholadr
//! author : Tin Aung Lin : https://github.com/thanyawzinmin
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '၁',
'2': '၂',
'3': '၃',
'4': '၄',
'5': '၅',
'6': '၆',
'7': '၇',
'8': '၈',
'9': '၉',
'0': '၀'
};
var numberMap = {
'၁': '1',
'၂': '2',
'၃': '3',
'၄': '4',
'၅': '5',
'၆': '6',
'၇': '7',
'၈': '8',
'၉': '9',
'၀': '0'
};
var my = moment.defineLocale('my', {
months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'),
monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),
weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'),
weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[ယနေ.] LT [မှာ]',
nextDay: '[မနက်ဖြန်] LT [မှာ]',
nextWeek: 'dddd LT [မှာ]',
lastDay: '[မနေ.က] LT [မှာ]',
lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',
sameElse: 'L'
},
relativeTime: {
future: 'လာမည့် %s မှာ',
past: 'လွန်ခဲ့သော %s က',
s: 'စက္ကန်.အနည်းငယ်',
ss : '%d စက္ကန့်',
m: 'တစ်မိနစ်',
mm: '%d မိနစ်',
h: 'တစ်နာရီ',
hh: '%d နာရီ',
d: 'တစ်ရက်',
dd: '%d ရက်',
M: 'တစ်လ',
MM: '%d လ',
y: 'တစ်နှစ်',
yy: '%d နှစ်'
},
preparse: function (string) {
return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
week: {
dow: 1, // Monday is the first day of the week.
doy: 4 // The week that contains Jan 1st is the first week of the year.
}
});
return my;
})));
/***/ }),
/* 354 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Norwegian Bokmål [nb]
//! authors : Espen Hovlandsdal : https://github.com/rexxars
//! Sigurd Gartmann : https://github.com/sigurdga
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var nb = moment.defineLocale('nb', {
months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
monthsShort : 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),
monthsParseExact : true,
weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
weekdaysShort : 'sø._ma._ti._on._to._fr._lø.'.split('_'),
weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY [kl.] HH:mm',
LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm'
},
calendar : {
sameDay: '[i dag kl.] LT',
nextDay: '[i morgen kl.] LT',
nextWeek: 'dddd [kl.] LT',
lastDay: '[i går kl.] LT',
lastWeek: '[forrige] dddd [kl.] LT',
sameElse: 'L'
},
relativeTime : {
future : 'om %s',
past : '%s siden',
s : 'noen sekunder',
ss : '%d sekunder',
m : 'ett minutt',
mm : '%d minutter',
h : 'en time',
hh : '%d timer',
d : 'en dag',
dd : '%d dager',
M : 'en måned',
MM : '%d måneder',
y : 'ett år',
yy : '%d år'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return nb;
})));
/***/ }),
/* 355 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Nepalese [ne]
//! author : suvash : https://github.com/suvash
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '१',
'2': '२',
'3': '३',
'4': '४',
'5': '५',
'6': '६',
'7': '७',
'8': '८',
'9': '९',
'0': '०'
};
var numberMap = {
'१': '1',
'२': '2',
'३': '3',
'४': '4',
'५': '5',
'६': '6',
'७': '7',
'८': '8',
'९': '9',
'०': '0'
};
var ne = moment.defineLocale('ne', {
months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'),
monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'),
monthsParseExact : true,
weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'),
weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),
weekdaysMin : 'आ._सो._मं._बु._बि._शु._श.'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'Aको h:mm बजे',
LTS : 'Aको h:mm:ss बजे',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY, Aको h:mm बजे',
LLLL : 'dddd, D MMMM YYYY, Aको h:mm बजे'
},
preparse: function (string) {
return string.replace(/[१२३४५६७८९०]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
meridiemParse: /राति|बिहान|दिउँसो|साँझ/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'राति') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'बिहान') {
return hour;
} else if (meridiem === 'दिउँसो') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'साँझ') {
return hour + 12;
}
},
meridiem : function (hour, minute, isLower) {
if (hour < 3) {
return 'राति';
} else if (hour < 12) {
return 'बिहान';
} else if (hour < 16) {
return 'दिउँसो';
} else if (hour < 20) {
return 'साँझ';
} else {
return 'राति';
}
},
calendar : {
sameDay : '[आज] LT',
nextDay : '[भोलि] LT',
nextWeek : '[आउँदो] dddd[,] LT',
lastDay : '[हिजो] LT',
lastWeek : '[गएको] dddd[,] LT',
sameElse : 'L'
},
relativeTime : {
future : '%sमा',
past : '%s अगाडि',
s : 'केही क्षण',
ss : '%d सेकेण्ड',
m : 'एक मिनेट',
mm : '%d मिनेट',
h : 'एक घण्टा',
hh : '%d घण्टा',
d : 'एक दिन',
dd : '%d दिन',
M : 'एक महिना',
MM : '%d महिना',
y : 'एक बर्ष',
yy : '%d बर्ष'
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
}
});
return ne;
})));
/***/ }),
/* 356 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Dutch [nl]
//! author : Joris Röling : https://github.com/jorisroling
//! author : Jacob Middag : https://github.com/middagj
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_');
var monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
var monthsParse = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];
var monthsRegex = /^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
var nl = moment.defineLocale('nl', {
months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
monthsShort : function (m, format) {
if (!m) {
return monthsShortWithDots;
} else if (/-MMM-/.test(format)) {
return monthsShortWithoutDots[m.month()];
} else {
return monthsShortWithDots[m.month()];
}
},
monthsRegex: monthsRegex,
monthsShortRegex: monthsRegex,
monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,
monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
monthsParse : monthsParse,
longMonthsParse : monthsParse,
shortMonthsParse : monthsParse,
weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),
weekdaysMin : 'zo_ma_di_wo_do_vr_za'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD-MM-YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[vandaag om] LT',
nextDay: '[morgen om] LT',
nextWeek: 'dddd [om] LT',
lastDay: '[gisteren om] LT',
lastWeek: '[afgelopen] dddd [om] LT',
sameElse: 'L'
},
relativeTime : {
future : 'over %s',
past : '%s geleden',
s : 'een paar seconden',
ss : '%d seconden',
m : 'één minuut',
mm : '%d minuten',
h : 'één uur',
hh : '%d uur',
d : 'één dag',
dd : '%d dagen',
M : 'één maand',
MM : '%d maanden',
y : 'één jaar',
yy : '%d jaar'
},
dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
ordinal : function (number) {
return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return nl;
})));
/***/ }),
/* 357 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Dutch (Belgium) [nl-be]
//! author : Joris Röling : https://github.com/jorisroling
//! author : Jacob Middag : https://github.com/middagj
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_');
var monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
var monthsParse = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];
var monthsRegex = /^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
var nlBe = moment.defineLocale('nl-be', {
months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
monthsShort : function (m, format) {
if (!m) {
return monthsShortWithDots;
} else if (/-MMM-/.test(format)) {
return monthsShortWithoutDots[m.month()];
} else {
return monthsShortWithDots[m.month()];
}
},
monthsRegex: monthsRegex,
monthsShortRegex: monthsRegex,
monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,
monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
monthsParse : monthsParse,
longMonthsParse : monthsParse,
shortMonthsParse : monthsParse,
weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),
weekdaysMin : 'zo_ma_di_wo_do_vr_za'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[vandaag om] LT',
nextDay: '[morgen om] LT',
nextWeek: 'dddd [om] LT',
lastDay: '[gisteren om] LT',
lastWeek: '[afgelopen] dddd [om] LT',
sameElse: 'L'
},
relativeTime : {
future : 'over %s',
past : '%s geleden',
s : 'een paar seconden',
ss : '%d seconden',
m : 'één minuut',
mm : '%d minuten',
h : 'één uur',
hh : '%d uur',
d : 'één dag',
dd : '%d dagen',
M : 'één maand',
MM : '%d maanden',
y : 'één jaar',
yy : '%d jaar'
},
dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
ordinal : function (number) {
return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return nlBe;
})));
/***/ }),
/* 358 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Nynorsk [nn]
//! author : https://github.com/mechuwind
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var nn = moment.defineLocale('nn', {
months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),
weekdaysShort : 'sun_mån_tys_ons_tor_fre_lau'.split('_'),
weekdaysMin : 'su_må_ty_on_to_fr_lø'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY [kl.] H:mm',
LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm'
},
calendar : {
sameDay: '[I dag klokka] LT',
nextDay: '[I morgon klokka] LT',
nextWeek: 'dddd [klokka] LT',
lastDay: '[I går klokka] LT',
lastWeek: '[Føregåande] dddd [klokka] LT',
sameElse: 'L'
},
relativeTime : {
future : 'om %s',
past : '%s sidan',
s : 'nokre sekund',
ss : '%d sekund',
m : 'eit minutt',
mm : '%d minutt',
h : 'ein time',
hh : '%d timar',
d : 'ein dag',
dd : '%d dagar',
M : 'ein månad',
MM : '%d månader',
y : 'eit år',
yy : '%d år'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return nn;
})));
/***/ }),
/* 359 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Punjabi (India) [pa-in]
//! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '੧',
'2': '੨',
'3': '੩',
'4': '੪',
'5': '੫',
'6': '੬',
'7': '੭',
'8': '੮',
'9': '੯',
'0': '੦'
};
var numberMap = {
'੧': '1',
'੨': '2',
'੩': '3',
'੪': '4',
'੫': '5',
'੬': '6',
'੭': '7',
'੮': '8',
'੯': '9',
'੦': '0'
};
var paIn = moment.defineLocale('pa-in', {
// There are months name as per Nanakshahi Calender but they are not used as rigidly in modern Punjabi.
months : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),
monthsShort : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),
weekdays : 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split('_'),
weekdaysShort : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
weekdaysMin : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
longDateFormat : {
LT : 'A h:mm ਵਜੇ',
LTS : 'A h:mm:ss ਵਜੇ',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY, A h:mm ਵਜੇ',
LLLL : 'dddd, D MMMM YYYY, A h:mm ਵਜੇ'
},
calendar : {
sameDay : '[ਅਜ] LT',
nextDay : '[ਕਲ] LT',
nextWeek : 'dddd, LT',
lastDay : '[ਕਲ] LT',
lastWeek : '[ਪਿਛਲੇ] dddd, LT',
sameElse : 'L'
},
relativeTime : {
future : '%s ਵਿੱਚ',
past : '%s ਪਿਛਲੇ',
s : 'ਕੁਝ ਸਕਿੰਟ',
ss : '%d ਸਕਿੰਟ',
m : 'ਇਕ ਮਿੰਟ',
mm : '%d ਮਿੰਟ',
h : 'ਇੱਕ ਘੰਟਾ',
hh : '%d ਘੰਟੇ',
d : 'ਇੱਕ ਦਿਨ',
dd : '%d ਦਿਨ',
M : 'ਇੱਕ ਮਹੀਨਾ',
MM : '%d ਮਹੀਨੇ',
y : 'ਇੱਕ ਸਾਲ',
yy : '%d ਸਾਲ'
},
preparse: function (string) {
return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
// Punjabi notation for meridiems are quite fuzzy in practice. While there exists
// a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi.
meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'ਰਾਤ') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'ਸਵੇਰ') {
return hour;
} else if (meridiem === 'ਦੁਪਹਿਰ') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'ਸ਼ਾਮ') {
return hour + 12;
}
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'ਰਾਤ';
} else if (hour < 10) {
return 'ਸਵੇਰ';
} else if (hour < 17) {
return 'ਦੁਪਹਿਰ';
} else if (hour < 20) {
return 'ਸ਼ਾਮ';
} else {
return 'ਰਾਤ';
}
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
}
});
return paIn;
})));
/***/ }),
/* 360 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Polish [pl]
//! author : Rafal Hirsz : https://github.com/evoL
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_');
var monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');
function plural(n) {
return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1);
}
function translate(number, withoutSuffix, key) {
var result = number + ' ';
switch (key) {
case 'ss':
return result + (plural(number) ? 'sekundy' : 'sekund');
case 'm':
return withoutSuffix ? 'minuta' : 'minutę';
case 'mm':
return result + (plural(number) ? 'minuty' : 'minut');
case 'h':
return withoutSuffix ? 'godzina' : 'godzinę';
case 'hh':
return result + (plural(number) ? 'godziny' : 'godzin');
case 'MM':
return result + (plural(number) ? 'miesiące' : 'miesięcy');
case 'yy':
return result + (plural(number) ? 'lata' : 'lat');
}
}
var pl = moment.defineLocale('pl', {
months : function (momentToFormat, format) {
if (!momentToFormat) {
return monthsNominative;
} else if (format === '') {
// Hack: if format empty we know this is used to generate
// RegExp by moment. Give then back both valid forms of months
// in RegExp ready format.
return '(' + monthsSubjective[momentToFormat.month()] + '|' + monthsNominative[momentToFormat.month()] + ')';
} else if (/D MMMM/.test(format)) {
return monthsSubjective[momentToFormat.month()];
} else {
return monthsNominative[momentToFormat.month()];
}
},
monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
weekdaysShort : 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
weekdaysMin : 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[Dziś o] LT',
nextDay: '[Jutro o] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[W niedzielę o] LT';
case 2:
return '[We wtorek o] LT';
case 3:
return '[W środę o] LT';
case 6:
return '[W sobotę o] LT';
default:
return '[W] dddd [o] LT';
}
},
lastDay: '[Wczoraj o] LT',
lastWeek: function () {
switch (this.day()) {
case 0:
return '[W zeszłą niedzielę o] LT';
case 3:
return '[W zeszłą środę o] LT';
case 6:
return '[W zeszłą sobotę o] LT';
default:
return '[W zeszły] dddd [o] LT';
}
},
sameElse: 'L'
},
relativeTime : {
future : 'za %s',
past : '%s temu',
s : 'kilka sekund',
ss : translate,
m : translate,
mm : translate,
h : translate,
hh : translate,
d : '1 dzień',
dd : '%d dni',
M : 'miesiąc',
MM : translate,
y : 'rok',
yy : translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return pl;
})));
/***/ }),
/* 361 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Portuguese [pt]
//! author : Jefferson : https://github.com/jalex79
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var pt = moment.defineLocale('pt', {
months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),
monthsShort : 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),
weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
weekdaysMin : 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D [de] MMMM [de] YYYY',
LLL : 'D [de] MMMM [de] YYYY HH:mm',
LLLL : 'dddd, D [de] MMMM [de] YYYY HH:mm'
},
calendar : {
sameDay: '[Hoje às] LT',
nextDay: '[Amanhã às] LT',
nextWeek: 'dddd [às] LT',
lastDay: '[Ontem às] LT',
lastWeek: function () {
return (this.day() === 0 || this.day() === 6) ?
'[Último] dddd [às] LT' : // Saturday + Sunday
'[Última] dddd [às] LT'; // Monday - Friday
},
sameElse: 'L'
},
relativeTime : {
future : 'em %s',
past : 'há %s',
s : 'segundos',
ss : '%d segundos',
m : 'um minuto',
mm : '%d minutos',
h : 'uma hora',
hh : '%d horas',
d : 'um dia',
dd : '%d dias',
M : 'um mês',
MM : '%d meses',
y : 'um ano',
yy : '%d anos'
},
dayOfMonthOrdinalParse: /\d{1,2}º/,
ordinal : '%dº',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return pt;
})));
/***/ }),
/* 362 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Portuguese (Brazil) [pt-br]
//! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var ptBr = moment.defineLocale('pt-br', {
months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),
monthsShort : 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),
weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
weekdaysMin : 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D [de] MMMM [de] YYYY',
LLL : 'D [de] MMMM [de] YYYY [às] HH:mm',
LLLL : 'dddd, D [de] MMMM [de] YYYY [às] HH:mm'
},
calendar : {
sameDay: '[Hoje às] LT',
nextDay: '[Amanhã às] LT',
nextWeek: 'dddd [às] LT',
lastDay: '[Ontem às] LT',
lastWeek: function () {
return (this.day() === 0 || this.day() === 6) ?
'[Último] dddd [às] LT' : // Saturday + Sunday
'[Última] dddd [às] LT'; // Monday - Friday
},
sameElse: 'L'
},
relativeTime : {
future : 'em %s',
past : '%s atrás',
s : 'poucos segundos',
ss : '%d segundos',
m : 'um minuto',
mm : '%d minutos',
h : 'uma hora',
hh : '%d horas',
d : 'um dia',
dd : '%d dias',
M : 'um mês',
MM : '%d meses',
y : 'um ano',
yy : '%d anos'
},
dayOfMonthOrdinalParse: /\d{1,2}º/,
ordinal : '%dº'
});
return ptBr;
})));
/***/ }),
/* 363 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Romanian [ro]
//! author : Vlad Gurdiga : https://github.com/gurdiga
//! author : Valentin Agachi : https://github.com/avaly
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function relativeTimeWithPlural(number, withoutSuffix, key) {
var format = {
'ss': 'secunde',
'mm': 'minute',
'hh': 'ore',
'dd': 'zile',
'MM': 'luni',
'yy': 'ani'
},
separator = ' ';
if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {
separator = ' de ';
}
return number + separator + format[key];
}
var ro = moment.defineLocale('ro', {
months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),
monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),
monthsParseExact: true,
weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY H:mm',
LLLL : 'dddd, D MMMM YYYY H:mm'
},
calendar : {
sameDay: '[azi la] LT',
nextDay: '[mâine la] LT',
nextWeek: 'dddd [la] LT',
lastDay: '[ieri la] LT',
lastWeek: '[fosta] dddd [la] LT',
sameElse: 'L'
},
relativeTime : {
future : 'peste %s',
past : '%s în urmă',
s : 'câteva secunde',
ss : relativeTimeWithPlural,
m : 'un minut',
mm : relativeTimeWithPlural,
h : 'o oră',
hh : relativeTimeWithPlural,
d : 'o zi',
dd : relativeTimeWithPlural,
M : 'o lună',
MM : relativeTimeWithPlural,
y : 'un an',
yy : relativeTimeWithPlural
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return ro;
})));
/***/ }),
/* 364 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Russian [ru]
//! author : Viktorminator : https://github.com/Viktorminator
//! Author : Menelion Elensúle : https://github.com/Oire
//! author : Коренберг Марк : https://github.com/socketpair
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function plural(word, num) {
var forms = word.split('_');
return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
}
function relativeTimeWithPlural(number, withoutSuffix, key) {
var format = {
'ss': withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
'hh': 'час_часа_часов',
'dd': 'день_дня_дней',
'MM': 'месяц_месяца_месяцев',
'yy': 'год_года_лет'
};
if (key === 'm') {
return withoutSuffix ? 'минута' : 'минуту';
}
else {
return number + ' ' + plural(format[key], +number);
}
}
var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i];
// http://new.gramota.ru/spravka/rules/139-prop : § 103
// Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637
// CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753
var ru = moment.defineLocale('ru', {
months : {
format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'),
standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_')
},
monthsShort : {
// по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку ?
format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'),
standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_')
},
weekdays : {
standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'),
isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/
},
weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
monthsParse : monthsParse,
longMonthsParse : monthsParse,
shortMonthsParse : monthsParse,
// полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки
monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
// копия предыдущего
monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
// полные названия с падежами
monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,
// Выражение, которое соотвествует только сокращённым формам
monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D MMMM YYYY г.',
LLL : 'D MMMM YYYY г., H:mm',
LLLL : 'dddd, D MMMM YYYY г., H:mm'
},
calendar : {
sameDay: '[Сегодня в] LT',
nextDay: '[Завтра в] LT',
lastDay: '[Вчера в] LT',
nextWeek: function (now) {
if (now.week() !== this.week()) {
switch (this.day()) {
case 0:
return '[В следующее] dddd [в] LT';
case 1:
case 2:
case 4:
return '[В следующий] dddd [в] LT';
case 3:
case 5:
case 6:
return '[В следующую] dddd [в] LT';
}
} else {
if (this.day() === 2) {
return '[Во] dddd [в] LT';
} else {
return '[В] dddd [в] LT';
}
}
},
lastWeek: function (now) {
if (now.week() !== this.week()) {
switch (this.day()) {
case 0:
return '[В прошлое] dddd [в] LT';
case 1:
case 2:
case 4:
return '[В прошлый] dddd [в] LT';
case 3:
case 5:
case 6:
return '[В прошлую] dddd [в] LT';
}
} else {
if (this.day() === 2) {
return '[Во] dddd [в] LT';
} else {
return '[В] dddd [в] LT';
}
}
},
sameElse: 'L'
},
relativeTime : {
future : 'через %s',
past : '%s назад',
s : 'несколько секунд',
ss : relativeTimeWithPlural,
m : relativeTimeWithPlural,
mm : relativeTimeWithPlural,
h : 'час',
hh : relativeTimeWithPlural,
d : 'день',
dd : relativeTimeWithPlural,
M : 'месяц',
MM : relativeTimeWithPlural,
y : 'год',
yy : relativeTimeWithPlural
},
meridiemParse: /ночи|утра|дня|вечера/i,
isPM : function (input) {
return /^(дня|вечера)$/.test(input);
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'ночи';
} else if (hour < 12) {
return 'утра';
} else if (hour < 17) {
return 'дня';
} else {
return 'вечера';
}
},
dayOfMonthOrdinalParse: /\d{1,2}-(й|го|я)/,
ordinal: function (number, period) {
switch (period) {
case 'M':
case 'd':
case 'DDD':
return number + '-й';
case 'D':
return number + '-го';
case 'w':
case 'W':
return number + '-я';
default:
return number;
}
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return ru;
})));
/***/ }),
/* 365 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Sindhi [sd]
//! author : Narain Sagar : https://github.com/narainsagar
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var months = [
'جنوري',
'فيبروري',
'مارچ',
'اپريل',
'مئي',
'جون',
'جولاءِ',
'آگسٽ',
'سيپٽمبر',
'آڪٽوبر',
'نومبر',
'ڊسمبر'
];
var days = [
'آچر',
'سومر',
'اڱارو',
'اربع',
'خميس',
'جمع',
'ڇنڇر'
];
var sd = moment.defineLocale('sd', {
months : months,
monthsShort : months,
weekdays : days,
weekdaysShort : days,
weekdaysMin : days,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd، D MMMM YYYY HH:mm'
},
meridiemParse: /صبح|شام/,
isPM : function (input) {
return 'شام' === input;
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return 'صبح';
}
return 'شام';
},
calendar : {
sameDay : '[اڄ] LT',
nextDay : '[سڀاڻي] LT',
nextWeek : 'dddd [اڳين هفتي تي] LT',
lastDay : '[ڪالهه] LT',
lastWeek : '[گزريل هفتي] dddd [تي] LT',
sameElse : 'L'
},
relativeTime : {
future : '%s پوء',
past : '%s اڳ',
s : 'چند سيڪنڊ',
ss : '%d سيڪنڊ',
m : 'هڪ منٽ',
mm : '%d منٽ',
h : 'هڪ ڪلاڪ',
hh : '%d ڪلاڪ',
d : 'هڪ ڏينهن',
dd : '%d ڏينهن',
M : 'هڪ مهينو',
MM : '%d مهينا',
y : 'هڪ سال',
yy : '%d سال'
},
preparse: function (string) {
return string.replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/,/g, '،');
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return sd;
})));
/***/ }),
/* 366 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Northern Sami [se]
//! authors : Bård Rolstad Henriksen : https://github.com/karamell
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var se = moment.defineLocale('se', {
months : 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'),
monthsShort : 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'),
weekdays : 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'),
weekdaysShort : 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),
weekdaysMin : 's_v_m_g_d_b_L'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'MMMM D. [b.] YYYY',
LLL : 'MMMM D. [b.] YYYY [ti.] HH:mm',
LLLL : 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm'
},
calendar : {
sameDay: '[otne ti] LT',
nextDay: '[ihttin ti] LT',
nextWeek: 'dddd [ti] LT',
lastDay: '[ikte ti] LT',
lastWeek: '[ovddit] dddd [ti] LT',
sameElse: 'L'
},
relativeTime : {
future : '%s geažes',
past : 'maŋit %s',
s : 'moadde sekunddat',
ss: '%d sekunddat',
m : 'okta minuhta',
mm : '%d minuhtat',
h : 'okta diimmu',
hh : '%d diimmut',
d : 'okta beaivi',
dd : '%d beaivvit',
M : 'okta mánnu',
MM : '%d mánut',
y : 'okta jahki',
yy : '%d jagit'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return se;
})));
/***/ }),
/* 367 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Sinhalese [si]
//! author : Sampath Sitinamaluwa : https://github.com/sampathsris
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
/*jshint -W100*/
var si = moment.defineLocale('si', {
months : 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split('_'),
monthsShort : 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split('_'),
weekdays : 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split('_'),
weekdaysShort : 'ඉරි_සඳු_අඟ_බදා_බ්රහ_සිකු_සෙන'.split('_'),
weekdaysMin : 'ඉ_ස_අ_බ_බ්ර_සි_සෙ'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'a h:mm',
LTS : 'a h:mm:ss',
L : 'YYYY/MM/DD',
LL : 'YYYY MMMM D',
LLL : 'YYYY MMMM D, a h:mm',
LLLL : 'YYYY MMMM D [වැනි] dddd, a h:mm:ss'
},
calendar : {
sameDay : '[අද] LT[ට]',
nextDay : '[හෙට] LT[ට]',
nextWeek : 'dddd LT[ට]',
lastDay : '[ඊයේ] LT[ට]',
lastWeek : '[පසුගිය] dddd LT[ට]',
sameElse : 'L'
},
relativeTime : {
future : '%sකින්',
past : '%sකට පෙර',
s : 'තත්පර කිහිපය',
ss : 'තත්පර %d',
m : 'මිනිත්තුව',
mm : 'මිනිත්තු %d',
h : 'පැය',
hh : 'පැය %d',
d : 'දිනය',
dd : 'දින %d',
M : 'මාසය',
MM : 'මාස %d',
y : 'වසර',
yy : 'වසර %d'
},
dayOfMonthOrdinalParse: /\d{1,2} වැනි/,
ordinal : function (number) {
return number + ' වැනි';
},
meridiemParse : /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,
isPM : function (input) {
return input === 'ප.ව.' || input === 'පස් වරු';
},
meridiem : function (hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'ප.ව.' : 'පස් වරු';
} else {
return isLower ? 'පෙ.ව.' : 'පෙර වරු';
}
}
});
return si;
})));
/***/ }),
/* 368 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Slovak [sk]
//! author : Martin Minka : https://github.com/k2s
//! based on work of petrbela : https://github.com/petrbela
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_');
var monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
function plural(n) {
return (n > 1) && (n < 5);
}
function translate(number, withoutSuffix, key, isFuture) {
var result = number + ' ';
switch (key) {
case 's': // a few seconds / in a few seconds / a few seconds ago
return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami';
case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'sekundy' : 'sekúnd');
} else {
return result + 'sekundami';
}
break;
case 'm': // a minute / in a minute / a minute ago
return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou');
case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'minúty' : 'minút');
} else {
return result + 'minútami';
}
break;
case 'h': // an hour / in an hour / an hour ago
return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
case 'hh': // 9 hours / in 9 hours / 9 hours ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'hodiny' : 'hodín');
} else {
return result + 'hodinami';
}
break;
case 'd': // a day / in a day / a day ago
return (withoutSuffix || isFuture) ? 'deň' : 'dňom';
case 'dd': // 9 days / in 9 days / 9 days ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'dni' : 'dní');
} else {
return result + 'dňami';
}
break;
case 'M': // a month / in a month / a month ago
return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom';
case 'MM': // 9 months / in 9 months / 9 months ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'mesiace' : 'mesiacov');
} else {
return result + 'mesiacmi';
}
break;
case 'y': // a year / in a year / a year ago
return (withoutSuffix || isFuture) ? 'rok' : 'rokom';
case 'yy': // 9 years / in 9 years / 9 years ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'roky' : 'rokov');
} else {
return result + 'rokmi';
}
break;
}
}
var sk = moment.defineLocale('sk', {
months : months,
monthsShort : monthsShort,
weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'),
weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'),
longDateFormat : {
LT: 'H:mm',
LTS : 'H:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY H:mm',
LLLL : 'dddd D. MMMM YYYY H:mm'
},
calendar : {
sameDay: '[dnes o] LT',
nextDay: '[zajtra o] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[v nedeľu o] LT';
case 1:
case 2:
return '[v] dddd [o] LT';
case 3:
return '[v stredu o] LT';
case 4:
return '[vo štvrtok o] LT';
case 5:
return '[v piatok o] LT';
case 6:
return '[v sobotu o] LT';
}
},
lastDay: '[včera o] LT',
lastWeek: function () {
switch (this.day()) {
case 0:
return '[minulú nedeľu o] LT';
case 1:
case 2:
return '[minulý] dddd [o] LT';
case 3:
return '[minulú stredu o] LT';
case 4:
case 5:
return '[minulý] dddd [o] LT';
case 6:
return '[minulú sobotu o] LT';
}
},
sameElse: 'L'
},
relativeTime : {
future : 'za %s',
past : 'pred %s',
s : translate,
ss : translate,
m : translate,
mm : translate,
h : translate,
hh : translate,
d : translate,
dd : translate,
M : translate,
MM : translate,
y : translate,
yy : translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return sk;
})));
/***/ }),
/* 369 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Slovenian [sl]
//! author : Robert Sedovšek : https://github.com/sedovsek
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var result = number + ' ';
switch (key) {
case 's':
return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';
case 'ss':
if (number === 1) {
result += withoutSuffix ? 'sekundo' : 'sekundi';
} else if (number === 2) {
result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';
} else if (number < 5) {
result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';
} else {
result += withoutSuffix || isFuture ? 'sekund' : 'sekund';
}
return result;
case 'm':
return withoutSuffix ? 'ena minuta' : 'eno minuto';
case 'mm':
if (number === 1) {
result += withoutSuffix ? 'minuta' : 'minuto';
} else if (number === 2) {
result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
} else if (number < 5) {
result += withoutSuffix || isFuture ? 'minute' : 'minutami';
} else {
result += withoutSuffix || isFuture ? 'minut' : 'minutami';
}
return result;
case 'h':
return withoutSuffix ? 'ena ura' : 'eno uro';
case 'hh':
if (number === 1) {
result += withoutSuffix ? 'ura' : 'uro';
} else if (number === 2) {
result += withoutSuffix || isFuture ? 'uri' : 'urama';
} else if (number < 5) {
result += withoutSuffix || isFuture ? 'ure' : 'urami';
} else {
result += withoutSuffix || isFuture ? 'ur' : 'urami';
}
return result;
case 'd':
return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
case 'dd':
if (number === 1) {
result += withoutSuffix || isFuture ? 'dan' : 'dnem';
} else if (number === 2) {
result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
} else {
result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
}
return result;
case 'M':
return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
case 'MM':
if (number === 1) {
result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
} else if (number === 2) {
result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
} else if (number < 5) {
result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
} else {
result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
}
return result;
case 'y':
return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
case 'yy':
if (number === 1) {
result += withoutSuffix || isFuture ? 'leto' : 'letom';
} else if (number === 2) {
result += withoutSuffix || isFuture ? 'leti' : 'letoma';
} else if (number < 5) {
result += withoutSuffix || isFuture ? 'leta' : 'leti';
} else {
result += withoutSuffix || isFuture ? 'let' : 'leti';
}
return result;
}
}
var sl = moment.defineLocale('sl', {
months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),
monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),
monthsParseExact: true,
weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY H:mm',
LLLL : 'dddd, D. MMMM YYYY H:mm'
},
calendar : {
sameDay : '[danes ob] LT',
nextDay : '[jutri ob] LT',
nextWeek : function () {
switch (this.day()) {
case 0:
return '[v] [nedeljo] [ob] LT';
case 3:
return '[v] [sredo] [ob] LT';
case 6:
return '[v] [soboto] [ob] LT';
case 1:
case 2:
case 4:
case 5:
return '[v] dddd [ob] LT';
}
},
lastDay : '[včeraj ob] LT',
lastWeek : function () {
switch (this.day()) {
case 0:
return '[prejšnjo] [nedeljo] [ob] LT';
case 3:
return '[prejšnjo] [sredo] [ob] LT';
case 6:
return '[prejšnjo] [soboto] [ob] LT';
case 1:
case 2:
case 4:
case 5:
return '[prejšnji] dddd [ob] LT';
}
},
sameElse : 'L'
},
relativeTime : {
future : 'čez %s',
past : 'pred %s',
s : processRelativeTime,
ss : processRelativeTime,
m : processRelativeTime,
mm : processRelativeTime,
h : processRelativeTime,
hh : processRelativeTime,
d : processRelativeTime,
dd : processRelativeTime,
M : processRelativeTime,
MM : processRelativeTime,
y : processRelativeTime,
yy : processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return sl;
})));
/***/ }),
/* 370 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Albanian [sq]
//! author : Flakërim Ismani : https://github.com/flakerimi
//! author : Menelion Elensúle : https://github.com/Oire
//! author : Oerd Cukalla : https://github.com/oerd
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var sq = moment.defineLocale('sq', {
months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'),
monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),
weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'),
weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
weekdaysMin : 'D_H_Ma_Më_E_P_Sh'.split('_'),
weekdaysParseExact : true,
meridiemParse: /PD|MD/,
isPM: function (input) {
return input.charAt(0) === 'M';
},
meridiem : function (hours, minutes, isLower) {
return hours < 12 ? 'PD' : 'MD';
},
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[Sot në] LT',
nextDay : '[Nesër në] LT',
nextWeek : 'dddd [në] LT',
lastDay : '[Dje në] LT',
lastWeek : 'dddd [e kaluar në] LT',
sameElse : 'L'
},
relativeTime : {
future : 'në %s',
past : '%s më parë',
s : 'disa sekonda',
ss : '%d sekonda',
m : 'një minutë',
mm : '%d minuta',
h : 'një orë',
hh : '%d orë',
d : 'një ditë',
dd : '%d ditë',
M : 'një muaj',
MM : '%d muaj',
y : 'një vit',
yy : '%d vite'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return sq;
})));
/***/ }),
/* 371 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Serbian [sr]
//! author : Milan Janačković : https://github.com/milan-j
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var translator = {
words: { //Different grammatical cases
ss: ['sekunda', 'sekunde', 'sekundi'],
m: ['jedan minut', 'jedne minute'],
mm: ['minut', 'minute', 'minuta'],
h: ['jedan sat', 'jednog sata'],
hh: ['sat', 'sata', 'sati'],
dd: ['dan', 'dana', 'dana'],
MM: ['mesec', 'meseca', 'meseci'],
yy: ['godina', 'godine', 'godina']
},
correctGrammaticalCase: function (number, wordKey) {
return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
},
translate: function (number, withoutSuffix, key) {
var wordKey = translator.words[key];
if (key.length === 1) {
return withoutSuffix ? wordKey[0] : wordKey[1];
} else {
return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
}
}
};
var sr = moment.defineLocale('sr', {
months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'),
monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
monthsParseExact: true,
weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split('_'),
weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
weekdaysParseExact : true,
longDateFormat: {
LT: 'H:mm',
LTS : 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY H:mm',
LLLL: 'dddd, D. MMMM YYYY H:mm'
},
calendar: {
sameDay: '[danas u] LT',
nextDay: '[sutra u] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[u] [nedelju] [u] LT';
case 3:
return '[u] [sredu] [u] LT';
case 6:
return '[u] [subotu] [u] LT';
case 1:
case 2:
case 4:
case 5:
return '[u] dddd [u] LT';
}
},
lastDay : '[juče u] LT',
lastWeek : function () {
var lastWeekDays = [
'[prošle] [nedelje] [u] LT',
'[prošlog] [ponedeljka] [u] LT',
'[prošlog] [utorka] [u] LT',
'[prošle] [srede] [u] LT',
'[prošlog] [četvrtka] [u] LT',
'[prošlog] [petka] [u] LT',
'[prošle] [subote] [u] LT'
];
return lastWeekDays[this.day()];
},
sameElse : 'L'
},
relativeTime : {
future : 'za %s',
past : 'pre %s',
s : 'nekoliko sekundi',
ss : translator.translate,
m : translator.translate,
mm : translator.translate,
h : translator.translate,
hh : translator.translate,
d : 'dan',
dd : translator.translate,
M : 'mesec',
MM : translator.translate,
y : 'godinu',
yy : translator.translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return sr;
})));
/***/ }),
/* 372 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Serbian Cyrillic [sr-cyrl]
//! author : Milan Janačković : https://github.com/milan-j
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var translator = {
words: { //Different grammatical cases
ss: ['секунда', 'секунде', 'секунди'],
m: ['један минут', 'једне минуте'],
mm: ['минут', 'минуте', 'минута'],
h: ['један сат', 'једног сата'],
hh: ['сат', 'сата', 'сати'],
dd: ['дан', 'дана', 'дана'],
MM: ['месец', 'месеца', 'месеци'],
yy: ['година', 'године', 'година']
},
correctGrammaticalCase: function (number, wordKey) {
return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]);
},
translate: function (number, withoutSuffix, key) {
var wordKey = translator.words[key];
if (key.length === 1) {
return withoutSuffix ? wordKey[0] : wordKey[1];
} else {
return number + ' ' + translator.correctGrammaticalCase(number, wordKey);
}
}
};
var srCyrl = moment.defineLocale('sr-cyrl', {
months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split('_'),
monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split('_'),
monthsParseExact: true,
weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),
weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),
weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),
weekdaysParseExact : true,
longDateFormat: {
LT: 'H:mm',
LTS : 'H:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY H:mm',
LLLL: 'dddd, D. MMMM YYYY H:mm'
},
calendar: {
sameDay: '[данас у] LT',
nextDay: '[сутра у] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[у] [недељу] [у] LT';
case 3:
return '[у] [среду] [у] LT';
case 6:
return '[у] [суботу] [у] LT';
case 1:
case 2:
case 4:
case 5:
return '[у] dddd [у] LT';
}
},
lastDay : '[јуче у] LT',
lastWeek : function () {
var lastWeekDays = [
'[прошле] [недеље] [у] LT',
'[прошлог] [понедељка] [у] LT',
'[прошлог] [уторка] [у] LT',
'[прошле] [среде] [у] LT',
'[прошлог] [четвртка] [у] LT',
'[прошлог] [петка] [у] LT',
'[прошле] [суботе] [у] LT'
];
return lastWeekDays[this.day()];
},
sameElse : 'L'
},
relativeTime : {
future : 'за %s',
past : 'пре %s',
s : 'неколико секунди',
ss : translator.translate,
m : translator.translate,
mm : translator.translate,
h : translator.translate,
hh : translator.translate,
d : 'дан',
dd : translator.translate,
M : 'месец',
MM : translator.translate,
y : 'годину',
yy : translator.translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return srCyrl;
})));
/***/ }),
/* 373 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : siSwati [ss]
//! author : Nicolai Davies : https://github.com/nicolaidavies
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var ss = moment.defineLocale('ss', {
months : "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split('_'),
monthsShort : 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),
weekdays : 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split('_'),
weekdaysShort : 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),
weekdaysMin : 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'h:mm A',
LTS : 'h:mm:ss A',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY h:mm A',
LLLL : 'dddd, D MMMM YYYY h:mm A'
},
calendar : {
sameDay : '[Namuhla nga] LT',
nextDay : '[Kusasa nga] LT',
nextWeek : 'dddd [nga] LT',
lastDay : '[Itolo nga] LT',
lastWeek : 'dddd [leliphelile] [nga] LT',
sameElse : 'L'
},
relativeTime : {
future : 'nga %s',
past : 'wenteka nga %s',
s : 'emizuzwana lomcane',
ss : '%d mzuzwana',
m : 'umzuzu',
mm : '%d emizuzu',
h : 'lihora',
hh : '%d emahora',
d : 'lilanga',
dd : '%d emalanga',
M : 'inyanga',
MM : '%d tinyanga',
y : 'umnyaka',
yy : '%d iminyaka'
},
meridiemParse: /ekuseni|emini|entsambama|ebusuku/,
meridiem : function (hours, minutes, isLower) {
if (hours < 11) {
return 'ekuseni';
} else if (hours < 15) {
return 'emini';
} else if (hours < 19) {
return 'entsambama';
} else {
return 'ebusuku';
}
},
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'ekuseni') {
return hour;
} else if (meridiem === 'emini') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === 'entsambama' || meridiem === 'ebusuku') {
if (hour === 0) {
return 0;
}
return hour + 12;
}
},
dayOfMonthOrdinalParse: /\d{1,2}/,
ordinal : '%d',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return ss;
})));
/***/ }),
/* 374 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Swedish [sv]
//! author : Jens Alm : https://github.com/ulmus
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var sv = moment.defineLocale('sv', {
months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),
monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
weekdaysShort : 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
weekdaysMin : 'sö_må_ti_on_to_fr_lö'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'YYYY-MM-DD',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY [kl.] HH:mm',
LLLL : 'dddd D MMMM YYYY [kl.] HH:mm',
lll : 'D MMM YYYY HH:mm',
llll : 'ddd D MMM YYYY HH:mm'
},
calendar : {
sameDay: '[Idag] LT',
nextDay: '[Imorgon] LT',
lastDay: '[Igår] LT',
nextWeek: '[På] dddd LT',
lastWeek: '[I] dddd[s] LT',
sameElse: 'L'
},
relativeTime : {
future : 'om %s',
past : 'för %s sedan',
s : 'några sekunder',
ss : '%d sekunder',
m : 'en minut',
mm : '%d minuter',
h : 'en timme',
hh : '%d timmar',
d : 'en dag',
dd : '%d dagar',
M : 'en månad',
MM : '%d månader',
y : 'ett år',
yy : '%d år'
},
dayOfMonthOrdinalParse: /\d{1,2}(e|a)/,
ordinal : function (number) {
var b = number % 10,
output = (~~(number % 100 / 10) === 1) ? 'e' :
(b === 1) ? 'a' :
(b === 2) ? 'a' :
(b === 3) ? 'e' : 'e';
return number + output;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return sv;
})));
/***/ }),
/* 375 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Swahili [sw]
//! author : Fahad Kassim : https://github.com/fadsel
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var sw = moment.defineLocale('sw', {
months : 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split('_'),
monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),
weekdays : 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split('_'),
weekdaysShort : 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),
weekdaysMin : 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[leo saa] LT',
nextDay : '[kesho saa] LT',
nextWeek : '[wiki ijayo] dddd [saat] LT',
lastDay : '[jana] LT',
lastWeek : '[wiki iliyopita] dddd [saat] LT',
sameElse : 'L'
},
relativeTime : {
future : '%s baadaye',
past : 'tokea %s',
s : 'hivi punde',
ss : 'sekunde %d',
m : 'dakika moja',
mm : 'dakika %d',
h : 'saa limoja',
hh : 'masaa %d',
d : 'siku moja',
dd : 'masiku %d',
M : 'mwezi mmoja',
MM : 'miezi %d',
y : 'mwaka mmoja',
yy : 'miaka %d'
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return sw;
})));
/***/ }),
/* 376 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Tamil [ta]
//! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '௧',
'2': '௨',
'3': '௩',
'4': '௪',
'5': '௫',
'6': '௬',
'7': '௭',
'8': '௮',
'9': '௯',
'0': '௦'
};
var numberMap = {
'௧': '1',
'௨': '2',
'௩': '3',
'௪': '4',
'௫': '5',
'௬': '6',
'௭': '7',
'௮': '8',
'௯': '9',
'௦': '0'
};
var ta = moment.defineLocale('ta', {
months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'),
weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'),
weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY, HH:mm',
LLLL : 'dddd, D MMMM YYYY, HH:mm'
},
calendar : {
sameDay : '[இன்று] LT',
nextDay : '[நாளை] LT',
nextWeek : 'dddd, LT',
lastDay : '[நேற்று] LT',
lastWeek : '[கடந்த வாரம்] dddd, LT',
sameElse : 'L'
},
relativeTime : {
future : '%s இல்',
past : '%s முன்',
s : 'ஒரு சில விநாடிகள்',
ss : '%d விநாடிகள்',
m : 'ஒரு நிமிடம்',
mm : '%d நிமிடங்கள்',
h : 'ஒரு மணி நேரம்',
hh : '%d மணி நேரம்',
d : 'ஒரு நாள்',
dd : '%d நாட்கள்',
M : 'ஒரு மாதம்',
MM : '%d மாதங்கள்',
y : 'ஒரு வருடம்',
yy : '%d ஆண்டுகள்'
},
dayOfMonthOrdinalParse: /\d{1,2}வது/,
ordinal : function (number) {
return number + 'வது';
},
preparse: function (string) {
return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
// refer http://ta.wikipedia.org/s/1er1
meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,
meridiem : function (hour, minute, isLower) {
if (hour < 2) {
return ' யாமம்';
} else if (hour < 6) {
return ' வைகறை'; // வைகறை
} else if (hour < 10) {
return ' காலை'; // காலை
} else if (hour < 14) {
return ' நண்பகல்'; // நண்பகல்
} else if (hour < 18) {
return ' எற்பாடு'; // எற்பாடு
} else if (hour < 22) {
return ' மாலை'; // மாலை
} else {
return ' யாமம்';
}
},
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'யாமம்') {
return hour < 2 ? hour : hour + 12;
} else if (meridiem === 'வைகறை' || meridiem === 'காலை') {
return hour;
} else if (meridiem === 'நண்பகல்') {
return hour >= 10 ? hour : hour + 12;
} else {
return hour + 12;
}
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
}
});
return ta;
})));
/***/ }),
/* 377 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Telugu [te]
//! author : Krishna Chaitanya Thota : https://github.com/kcthota
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var te = moment.defineLocale('te', {
months : 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split('_'),
monthsShort : 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'),
monthsParseExact : true,
weekdays : 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split('_'),
weekdaysShort : 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),
weekdaysMin : 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),
longDateFormat : {
LT : 'A h:mm',
LTS : 'A h:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY, A h:mm',
LLLL : 'dddd, D MMMM YYYY, A h:mm'
},
calendar : {
sameDay : '[నేడు] LT',
nextDay : '[రేపు] LT',
nextWeek : 'dddd, LT',
lastDay : '[నిన్న] LT',
lastWeek : '[గత] dddd, LT',
sameElse : 'L'
},
relativeTime : {
future : '%s లో',
past : '%s క్రితం',
s : 'కొన్ని క్షణాలు',
ss : '%d సెకన్లు',
m : 'ఒక నిమిషం',
mm : '%d నిమిషాలు',
h : 'ఒక గంట',
hh : '%d గంటలు',
d : 'ఒక రోజు',
dd : '%d రోజులు',
M : 'ఒక నెల',
MM : '%d నెలలు',
y : 'ఒక సంవత్సరం',
yy : '%d సంవత్సరాలు'
},
dayOfMonthOrdinalParse : /\d{1,2}వ/,
ordinal : '%dవ',
meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'రాత్రి') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'ఉదయం') {
return hour;
} else if (meridiem === 'మధ్యాహ్నం') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'సాయంత్రం') {
return hour + 12;
}
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'రాత్రి';
} else if (hour < 10) {
return 'ఉదయం';
} else if (hour < 17) {
return 'మధ్యాహ్నం';
} else if (hour < 20) {
return 'సాయంత్రం';
} else {
return 'రాత్రి';
}
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
}
});
return te;
})));
/***/ }),
/* 378 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Tetun Dili (East Timor) [tet]
//! author : Joshua Brooks : https://github.com/joshbrooks
//! author : Onorio De J. Afonso : https://github.com/marobo
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var tet = moment.defineLocale('tet', {
months : 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juniu_Juliu_Augustu_Setembru_Outubru_Novembru_Dezembru'.split('_'),
monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Aug_Set_Out_Nov_Dez'.split('_'),
weekdays : 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sexta_Sabadu'.split('_'),
weekdaysShort : 'Dom_Seg_Ters_Kua_Kint_Sext_Sab'.split('_'),
weekdaysMin : 'Do_Seg_Te_Ku_Ki_Sex_Sa'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[Ohin iha] LT',
nextDay: '[Aban iha] LT',
nextWeek: 'dddd [iha] LT',
lastDay: '[Horiseik iha] LT',
lastWeek: 'dddd [semana kotuk] [iha] LT',
sameElse: 'L'
},
relativeTime : {
future : 'iha %s',
past : '%s liuba',
s : 'minutu balun',
ss : 'minutu %d',
m : 'minutu ida',
mm : 'minutus %d',
h : 'horas ida',
hh : 'horas %d',
d : 'loron ida',
dd : 'loron %d',
M : 'fulan ida',
MM : 'fulan %d',
y : 'tinan ida',
yy : 'tinan %d'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal : function (number) {
var b = number % 10,
output = (~~(number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
return number + output;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return tet;
})));
/***/ }),
/* 379 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Thai [th]
//! author : Kridsada Thanabulpong : https://github.com/sirn
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var th = moment.defineLocale('th', {
months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),
monthsShort : 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split('_'),
monthsParseExact: true,
weekdays : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
weekdaysShort : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference
weekdaysMin : 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY เวลา H:mm',
LLLL : 'วันddddที่ D MMMM YYYY เวลา H:mm'
},
meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
isPM: function (input) {
return input === 'หลังเที่ยง';
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return 'ก่อนเที่ยง';
} else {
return 'หลังเที่ยง';
}
},
calendar : {
sameDay : '[วันนี้ เวลา] LT',
nextDay : '[พรุ่งนี้ เวลา] LT',
nextWeek : 'dddd[หน้า เวลา] LT',
lastDay : '[เมื่อวานนี้ เวลา] LT',
lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT',
sameElse : 'L'
},
relativeTime : {
future : 'อีก %s',
past : '%sที่แล้ว',
s : 'ไม่กี่วินาที',
ss : '%d วินาที',
m : '1 นาที',
mm : '%d นาที',
h : '1 ชั่วโมง',
hh : '%d ชั่วโมง',
d : '1 วัน',
dd : '%d วัน',
M : '1 เดือน',
MM : '%d เดือน',
y : '1 ปี',
yy : '%d ปี'
}
});
return th;
})));
/***/ }),
/* 380 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Tagalog (Philippines) [tl-ph]
//! author : Dan Hagman : https://github.com/hagmandan
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var tlPh = moment.defineLocale('tl-ph', {
months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'),
monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'),
weekdaysShort : 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
weekdaysMin : 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'MM/D/YYYY',
LL : 'MMMM D, YYYY',
LLL : 'MMMM D, YYYY HH:mm',
LLLL : 'dddd, MMMM DD, YYYY HH:mm'
},
calendar : {
sameDay: 'LT [ngayong araw]',
nextDay: '[Bukas ng] LT',
nextWeek: 'LT [sa susunod na] dddd',
lastDay: 'LT [kahapon]',
lastWeek: 'LT [noong nakaraang] dddd',
sameElse: 'L'
},
relativeTime : {
future : 'sa loob ng %s',
past : '%s ang nakalipas',
s : 'ilang segundo',
ss : '%d segundo',
m : 'isang minuto',
mm : '%d minuto',
h : 'isang oras',
hh : '%d oras',
d : 'isang araw',
dd : '%d araw',
M : 'isang buwan',
MM : '%d buwan',
y : 'isang taon',
yy : '%d taon'
},
dayOfMonthOrdinalParse: /\d{1,2}/,
ordinal : function (number) {
return number;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return tlPh;
})));
/***/ }),
/* 381 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Klingon [tlh]
//! author : Dominika Kruk : https://github.com/amaranthrose
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');
function translateFuture(output) {
var time = output;
time = (output.indexOf('jaj') !== -1) ?
time.slice(0, -3) + 'leS' :
(output.indexOf('jar') !== -1) ?
time.slice(0, -3) + 'waQ' :
(output.indexOf('DIS') !== -1) ?
time.slice(0, -3) + 'nem' :
time + ' pIq';
return time;
}
function translatePast(output) {
var time = output;
time = (output.indexOf('jaj') !== -1) ?
time.slice(0, -3) + 'Hu’' :
(output.indexOf('jar') !== -1) ?
time.slice(0, -3) + 'wen' :
(output.indexOf('DIS') !== -1) ?
time.slice(0, -3) + 'ben' :
time + ' ret';
return time;
}
function translate(number, withoutSuffix, string, isFuture) {
var numberNoun = numberAsNoun(number);
switch (string) {
case 'ss':
return numberNoun + ' lup';
case 'mm':
return numberNoun + ' tup';
case 'hh':
return numberNoun + ' rep';
case 'dd':
return numberNoun + ' jaj';
case 'MM':
return numberNoun + ' jar';
case 'yy':
return numberNoun + ' DIS';
}
}
function numberAsNoun(number) {
var hundred = Math.floor((number % 1000) / 100),
ten = Math.floor((number % 100) / 10),
one = number % 10,
word = '';
if (hundred > 0) {
word += numbersNouns[hundred] + 'vatlh';
}
if (ten > 0) {
word += ((word !== '') ? ' ' : '') + numbersNouns[ten] + 'maH';
}
if (one > 0) {
word += ((word !== '') ? ' ' : '') + numbersNouns[one];
}
return (word === '') ? 'pagh' : word;
}
var tlh = moment.defineLocale('tlh', {
months : 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'),
monthsShort : 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'),
monthsParseExact : true,
weekdays : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
weekdaysShort : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
weekdaysMin : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[DaHjaj] LT',
nextDay: '[wa’leS] LT',
nextWeek: 'LLL',
lastDay: '[wa’Hu’] LT',
lastWeek: 'LLL',
sameElse: 'L'
},
relativeTime : {
future : translateFuture,
past : translatePast,
s : 'puS lup',
ss : translate,
m : 'wa’ tup',
mm : translate,
h : 'wa’ rep',
hh : translate,
d : 'wa’ jaj',
dd : translate,
M : 'wa’ jar',
MM : translate,
y : 'wa’ DIS',
yy : translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return tlh;
})));
/***/ }),
/* 382 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Turkish [tr]
//! authors : Erhan Gundogan : https://github.com/erhangundogan,
//! Burak Yiğit Kaya: https://github.com/BYK
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var suffixes = {
1: '\'inci',
5: '\'inci',
8: '\'inci',
70: '\'inci',
80: '\'inci',
2: '\'nci',
7: '\'nci',
20: '\'nci',
50: '\'nci',
3: '\'üncü',
4: '\'üncü',
100: '\'üncü',
6: '\'ncı',
9: '\'uncu',
10: '\'uncu',
30: '\'uncu',
60: '\'ıncı',
90: '\'ıncı'
};
var tr = moment.defineLocale('tr', {
months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),
monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),
weekdaysShort : 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
weekdaysMin : 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[bugün saat] LT',
nextDay : '[yarın saat] LT',
nextWeek : '[gelecek] dddd [saat] LT',
lastDay : '[dün] LT',
lastWeek : '[geçen] dddd [saat] LT',
sameElse : 'L'
},
relativeTime : {
future : '%s sonra',
past : '%s önce',
s : 'birkaç saniye',
ss : '%d saniye',
m : 'bir dakika',
mm : '%d dakika',
h : 'bir saat',
hh : '%d saat',
d : 'bir gün',
dd : '%d gün',
M : 'bir ay',
MM : '%d ay',
y : 'bir yıl',
yy : '%d yıl'
},
dayOfMonthOrdinalParse: /\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,
ordinal : function (number) {
if (number === 0) { // special case for zero
return number + '\'ıncı';
}
var a = number % 10,
b = number % 100 - a,
c = number >= 100 ? 100 : null;
return number + (suffixes[a] || suffixes[b] || suffixes[c]);
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return tr;
})));
/***/ }),
/* 383 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Talossan [tzl]
//! author : Robin van der Vliet : https://github.com/robin0van0der0v
//! author : Iustì Canun
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
// After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals.
// This is currently too difficult (maybe even impossible) to add.
var tzl = moment.defineLocale('tzl', {
months : 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split('_'),
monthsShort : 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),
weekdays : 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),
weekdaysShort : 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),
weekdaysMin : 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),
longDateFormat : {
LT : 'HH.mm',
LTS : 'HH.mm.ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM [dallas] YYYY',
LLL : 'D. MMMM [dallas] YYYY HH.mm',
LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm'
},
meridiemParse: /d\'o|d\'a/i,
isPM : function (input) {
return 'd\'o' === input.toLowerCase();
},
meridiem : function (hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'd\'o' : 'D\'O';
} else {
return isLower ? 'd\'a' : 'D\'A';
}
},
calendar : {
sameDay : '[oxhi à] LT',
nextDay : '[demà à] LT',
nextWeek : 'dddd [à] LT',
lastDay : '[ieiri à] LT',
lastWeek : '[sür el] dddd [lasteu à] LT',
sameElse : 'L'
},
relativeTime : {
future : 'osprei %s',
past : 'ja%s',
s : processRelativeTime,
ss : processRelativeTime,
m : processRelativeTime,
mm : processRelativeTime,
h : processRelativeTime,
hh : processRelativeTime,
d : processRelativeTime,
dd : processRelativeTime,
M : processRelativeTime,
MM : processRelativeTime,
y : processRelativeTime,
yy : processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
's': ['viensas secunds', '\'iensas secunds'],
'ss': [number + ' secunds', '' + number + ' secunds'],
'm': ['\'n míut', '\'iens míut'],
'mm': [number + ' míuts', '' + number + ' míuts'],
'h': ['\'n þora', '\'iensa þora'],
'hh': [number + ' þoras', '' + number + ' þoras'],
'd': ['\'n ziua', '\'iensa ziua'],
'dd': [number + ' ziuas', '' + number + ' ziuas'],
'M': ['\'n mes', '\'iens mes'],
'MM': [number + ' mesen', '' + number + ' mesen'],
'y': ['\'n ar', '\'iens ar'],
'yy': [number + ' ars', '' + number + ' ars']
};
return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1]);
}
return tzl;
})));
/***/ }),
/* 384 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Central Atlas Tamazight [tzm]
//! author : Abdel Said : https://github.com/abdelsaid
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var tzm = moment.defineLocale('tzm', {
months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
weekdaysShort : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
weekdaysMin : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS: 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',
nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',
nextWeek: 'dddd [ⴴ] LT',
lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',
lastWeek: 'dddd [ⴴ] LT',
sameElse: 'L'
},
relativeTime : {
future : 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',
past : 'ⵢⴰⵏ %s',
s : 'ⵉⵎⵉⴽ',
ss : '%d ⵉⵎⵉⴽ',
m : 'ⵎⵉⵏⵓⴺ',
mm : '%d ⵎⵉⵏⵓⴺ',
h : 'ⵙⴰⵄⴰ',
hh : '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',
d : 'ⴰⵙⵙ',
dd : '%d oⵙⵙⴰⵏ',
M : 'ⴰⵢoⵓⵔ',
MM : '%d ⵉⵢⵢⵉⵔⵏ',
y : 'ⴰⵙⴳⴰⵙ',
yy : '%d ⵉⵙⴳⴰⵙⵏ'
},
week : {
dow : 6, // Saturday is the first day of the week.
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
return tzm;
})));
/***/ }),
/* 385 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Central Atlas Tamazight Latin [tzm-latn]
//! author : Abdel Said : https://github.com/abdelsaid
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var tzmLatn = moment.defineLocale('tzm-latn', {
months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
weekdaysShort : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
weekdaysMin : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[asdkh g] LT',
nextDay: '[aska g] LT',
nextWeek: 'dddd [g] LT',
lastDay: '[assant g] LT',
lastWeek: 'dddd [g] LT',
sameElse: 'L'
},
relativeTime : {
future : 'dadkh s yan %s',
past : 'yan %s',
s : 'imik',
ss : '%d imik',
m : 'minuḍ',
mm : '%d minuḍ',
h : 'saɛa',
hh : '%d tassaɛin',
d : 'ass',
dd : '%d ossan',
M : 'ayowr',
MM : '%d iyyirn',
y : 'asgas',
yy : '%d isgasn'
},
week : {
dow : 6, // Saturday is the first day of the week.
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
return tzmLatn;
})));
/***/ }),
/* 386 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Ukrainian [uk]
//! author : zemlanin : https://github.com/zemlanin
//! Author : Menelion Elensúle : https://github.com/Oire
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function plural(word, num) {
var forms = word.split('_');
return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
}
function relativeTimeWithPlural(number, withoutSuffix, key) {
var format = {
'ss': withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',
'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
'dd': 'день_дні_днів',
'MM': 'місяць_місяці_місяців',
'yy': 'рік_роки_років'
};
if (key === 'm') {
return withoutSuffix ? 'хвилина' : 'хвилину';
}
else if (key === 'h') {
return withoutSuffix ? 'година' : 'годину';
}
else {
return number + ' ' + plural(format[key], +number);
}
}
function weekdaysCaseReplace(m, format) {
var weekdays = {
'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),
'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),
'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')
};
if (!m) {
return weekdays['nominative'];
}
var nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ?
'accusative' :
((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ?
'genitive' :
'nominative');
return weekdays[nounCase][m.day()];
}
function processHoursFunction(str) {
return function () {
return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
};
}
var uk = moment.defineLocale('uk', {
months : {
'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'),
'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_')
},
monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),
weekdays : weekdaysCaseReplace,
weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D MMMM YYYY р.',
LLL : 'D MMMM YYYY р., HH:mm',
LLLL : 'dddd, D MMMM YYYY р., HH:mm'
},
calendar : {
sameDay: processHoursFunction('[Сьогодні '),
nextDay: processHoursFunction('[Завтра '),
lastDay: processHoursFunction('[Вчора '),
nextWeek: processHoursFunction('[У] dddd ['),
lastWeek: function () {
switch (this.day()) {
case 0:
case 3:
case 5:
case 6:
return processHoursFunction('[Минулої] dddd [').call(this);
case 1:
case 2:
case 4:
return processHoursFunction('[Минулого] dddd [').call(this);
}
},
sameElse: 'L'
},
relativeTime : {
future : 'за %s',
past : '%s тому',
s : 'декілька секунд',
ss : relativeTimeWithPlural,
m : relativeTimeWithPlural,
mm : relativeTimeWithPlural,
h : 'годину',
hh : relativeTimeWithPlural,
d : 'день',
dd : relativeTimeWithPlural,
M : 'місяць',
MM : relativeTimeWithPlural,
y : 'рік',
yy : relativeTimeWithPlural
},
// M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
meridiemParse: /ночі|ранку|дня|вечора/,
isPM: function (input) {
return /^(дня|вечора)$/.test(input);
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'ночі';
} else if (hour < 12) {
return 'ранку';
} else if (hour < 17) {
return 'дня';
} else {
return 'вечора';
}
},
dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/,
ordinal: function (number, period) {
switch (period) {
case 'M':
case 'd':
case 'DDD':
case 'w':
case 'W':
return number + '-й';
case 'D':
return number + '-го';
default:
return number;
}
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return uk;
})));
/***/ }),
/* 387 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Urdu [ur]
//! author : Sawood Alam : https://github.com/ibnesayeed
//! author : Zack : https://github.com/ZackVision
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var months = [
'جنوری',
'فروری',
'مارچ',
'اپریل',
'مئی',
'جون',
'جولائی',
'اگست',
'ستمبر',
'اکتوبر',
'نومبر',
'دسمبر'
];
var days = [
'اتوار',
'پیر',
'منگل',
'بدھ',
'جمعرات',
'جمعہ',
'ہفتہ'
];
var ur = moment.defineLocale('ur', {
months : months,
monthsShort : months,
weekdays : days,
weekdaysShort : days,
weekdaysMin : days,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd، D MMMM YYYY HH:mm'
},
meridiemParse: /صبح|شام/,
isPM : function (input) {
return 'شام' === input;
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return 'صبح';
}
return 'شام';
},
calendar : {
sameDay : '[آج بوقت] LT',
nextDay : '[کل بوقت] LT',
nextWeek : 'dddd [بوقت] LT',
lastDay : '[گذشتہ روز بوقت] LT',
lastWeek : '[گذشتہ] dddd [بوقت] LT',
sameElse : 'L'
},
relativeTime : {
future : '%s بعد',
past : '%s قبل',
s : 'چند سیکنڈ',
ss : '%d سیکنڈ',
m : 'ایک منٹ',
mm : '%d منٹ',
h : 'ایک گھنٹہ',
hh : '%d گھنٹے',
d : 'ایک دن',
dd : '%d دن',
M : 'ایک ماہ',
MM : '%d ماہ',
y : 'ایک سال',
yy : '%d سال'
},
preparse: function (string) {
return string.replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/,/g, '،');
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return ur;
})));
/***/ }),
/* 388 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Uzbek [uz]
//! author : Sardor Muminov : https://github.com/muminoff
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var uz = moment.defineLocale('uz', {
months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'),
monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),
weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
weekdaysMin : 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'D MMMM YYYY, dddd HH:mm'
},
calendar : {
sameDay : '[Бугун соат] LT [да]',
nextDay : '[Эртага] LT [да]',
nextWeek : 'dddd [куни соат] LT [да]',
lastDay : '[Кеча соат] LT [да]',
lastWeek : '[Утган] dddd [куни соат] LT [да]',
sameElse : 'L'
},
relativeTime : {
future : 'Якин %s ичида',
past : 'Бир неча %s олдин',
s : 'фурсат',
ss : '%d фурсат',
m : 'бир дакика',
mm : '%d дакика',
h : 'бир соат',
hh : '%d соат',
d : 'бир кун',
dd : '%d кун',
M : 'бир ой',
MM : '%d ой',
y : 'бир йил',
yy : '%d йил'
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 4th is the first week of the year.
}
});
return uz;
})));
/***/ }),
/* 389 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Uzbek Latin [uz-latn]
//! author : Rasulbek Mirzayev : github.com/Rasulbeeek
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var uzLatn = moment.defineLocale('uz-latn', {
months : 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split('_'),
monthsShort : 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'),
weekdays : 'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split('_'),
weekdaysShort : 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'),
weekdaysMin : 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'D MMMM YYYY, dddd HH:mm'
},
calendar : {
sameDay : '[Bugun soat] LT [da]',
nextDay : '[Ertaga] LT [da]',
nextWeek : 'dddd [kuni soat] LT [da]',
lastDay : '[Kecha soat] LT [da]',
lastWeek : '[O\'tgan] dddd [kuni soat] LT [da]',
sameElse : 'L'
},
relativeTime : {
future : 'Yaqin %s ichida',
past : 'Bir necha %s oldin',
s : 'soniya',
ss : '%d soniya',
m : 'bir daqiqa',
mm : '%d daqiqa',
h : 'bir soat',
hh : '%d soat',
d : 'bir kun',
dd : '%d kun',
M : 'bir oy',
MM : '%d oy',
y : 'bir yil',
yy : '%d yil'
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return uzLatn;
})));
/***/ }),
/* 390 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Vietnamese [vi]
//! author : Bang Nguyen : https://github.com/bangnk
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var vi = moment.defineLocale('vi', {
months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'),
monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),
monthsParseExact : true,
weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),
weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
weekdaysParseExact : true,
meridiemParse: /sa|ch/i,
isPM : function (input) {
return /^ch$/i.test(input);
},
meridiem : function (hours, minutes, isLower) {
if (hours < 12) {
return isLower ? 'sa' : 'SA';
} else {
return isLower ? 'ch' : 'CH';
}
},
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM [năm] YYYY',
LLL : 'D MMMM [năm] YYYY HH:mm',
LLLL : 'dddd, D MMMM [năm] YYYY HH:mm',
l : 'DD/M/YYYY',
ll : 'D MMM YYYY',
lll : 'D MMM YYYY HH:mm',
llll : 'ddd, D MMM YYYY HH:mm'
},
calendar : {
sameDay: '[Hôm nay lúc] LT',
nextDay: '[Ngày mai lúc] LT',
nextWeek: 'dddd [tuần tới lúc] LT',
lastDay: '[Hôm qua lúc] LT',
lastWeek: 'dddd [tuần rồi lúc] LT',
sameElse: 'L'
},
relativeTime : {
future : '%s tới',
past : '%s trước',
s : 'vài giây',
ss : '%d giây' ,
m : 'một phút',
mm : '%d phút',
h : 'một giờ',
hh : '%d giờ',
d : 'một ngày',
dd : '%d ngày',
M : 'một tháng',
MM : '%d tháng',
y : 'một năm',
yy : '%d năm'
},
dayOfMonthOrdinalParse: /\d{1,2}/,
ordinal : function (number) {
return number;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return vi;
})));
/***/ }),
/* 391 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Pseudo [x-pseudo]
//! author : Andrew Hood : https://github.com/andrewhood125
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var xPseudo = moment.defineLocale('x-pseudo', {
months : 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split('_'),
monthsShort : 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split('_'),
monthsParseExact : true,
weekdays : 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split('_'),
weekdaysShort : 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),
weekdaysMin : 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[T~ódá~ý át] LT',
nextDay : '[T~ómó~rró~w át] LT',
nextWeek : 'dddd [át] LT',
lastDay : '[Ý~ést~érdá~ý át] LT',
lastWeek : '[L~ást] dddd [át] LT',
sameElse : 'L'
},
relativeTime : {
future : 'í~ñ %s',
past : '%s á~gó',
s : 'á ~féw ~sécó~ñds',
ss : '%d s~écóñ~ds',
m : 'á ~míñ~úté',
mm : '%d m~íñú~tés',
h : 'á~ñ hó~úr',
hh : '%d h~óúrs',
d : 'á ~dáý',
dd : '%d d~áýs',
M : 'á ~móñ~th',
MM : '%d m~óñt~hs',
y : 'á ~ýéár',
yy : '%d ý~éárs'
},
dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
ordinal : function (number) {
var b = number % 10,
output = (~~(number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
return number + output;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return xPseudo;
})));
/***/ }),
/* 392 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Yoruba Nigeria [yo]
//! author : Atolagbe Abisoye : https://github.com/andela-batolagbe
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var yo = moment.defineLocale('yo', {
months : 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split('_'),
monthsShort : 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'),
weekdays : 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'),
weekdaysShort : 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'),
weekdaysMin : 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'),
longDateFormat : {
LT : 'h:mm A',
LTS : 'h:mm:ss A',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY h:mm A',
LLLL : 'dddd, D MMMM YYYY h:mm A'
},
calendar : {
sameDay : '[Ònì ni] LT',
nextDay : '[Ọ̀la ni] LT',
nextWeek : 'dddd [Ọsẹ̀ tón\'bọ] [ni] LT',
lastDay : '[Àna ni] LT',
lastWeek : 'dddd [Ọsẹ̀ tólọ́] [ni] LT',
sameElse : 'L'
},
relativeTime : {
future : 'ní %s',
past : '%s kọjá',
s : 'ìsẹjú aayá die',
ss :'aayá %d',
m : 'ìsẹjú kan',
mm : 'ìsẹjú %d',
h : 'wákati kan',
hh : 'wákati %d',
d : 'ọjọ́ kan',
dd : 'ọjọ́ %d',
M : 'osù kan',
MM : 'osù %d',
y : 'ọdún kan',
yy : 'ọdún %d'
},
dayOfMonthOrdinalParse : /ọjọ́\s\d{1,2}/,
ordinal : 'ọjọ́ %d',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return yo;
})));
/***/ }),
/* 393 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Chinese (China) [zh-cn]
//! author : suupic : https://github.com/suupic
//! author : Zeno Zeng : https://github.com/zenozeng
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var zhCn = moment.defineLocale('zh-cn', {
months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'),
weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'YYYY/MM/DD',
LL : 'YYYY年M月D日',
LLL : 'YYYY年M月D日Ah点mm分',
LLLL : 'YYYY年M月D日ddddAh点mm分',
l : 'YYYY/M/D',
ll : 'YYYY年M月D日',
lll : 'YYYY年M月D日 HH:mm',
llll : 'YYYY年M月D日dddd HH:mm'
},
meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === '凌晨' || meridiem === '早上' ||
meridiem === '上午') {
return hour;
} else if (meridiem === '下午' || meridiem === '晚上') {
return hour + 12;
} else {
// '中午'
return hour >= 11 ? hour : hour + 12;
}
},
meridiem : function (hour, minute, isLower) {
var hm = hour * 100 + minute;
if (hm < 600) {
return '凌晨';
} else if (hm < 900) {
return '早上';
} else if (hm < 1130) {
return '上午';
} else if (hm < 1230) {
return '中午';
} else if (hm < 1800) {
return '下午';
} else {
return '晚上';
}
},
calendar : {
sameDay : '[今天]LT',
nextDay : '[明天]LT',
nextWeek : '[下]ddddLT',
lastDay : '[昨天]LT',
lastWeek : '[上]ddddLT',
sameElse : 'L'
},
dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/,
ordinal : function (number, period) {
switch (period) {
case 'd':
case 'D':
case 'DDD':
return number + '日';
case 'M':
return number + '月';
case 'w':
case 'W':
return number + '周';
default:
return number;
}
},
relativeTime : {
future : '%s内',
past : '%s前',
s : '几秒',
ss : '%d 秒',
m : '1 分钟',
mm : '%d 分钟',
h : '1 小时',
hh : '%d 小时',
d : '1 天',
dd : '%d 天',
M : '1 个月',
MM : '%d 个月',
y : '1 年',
yy : '%d 年'
},
week : {
// GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return zhCn;
})));
/***/ }),
/* 394 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Chinese (Hong Kong) [zh-hk]
//! author : Ben : https://github.com/ben-lin
//! author : Chris Lam : https://github.com/hehachris
//! author : Konstantin : https://github.com/skfd
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var zhHk = moment.defineLocale('zh-hk', {
months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),
weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'YYYY/MM/DD',
LL : 'YYYY年M月D日',
LLL : 'YYYY年M月D日 HH:mm',
LLLL : 'YYYY年M月D日dddd HH:mm',
l : 'YYYY/M/D',
ll : 'YYYY年M月D日',
lll : 'YYYY年M月D日 HH:mm',
llll : 'YYYY年M月D日dddd HH:mm'
},
meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
return hour;
} else if (meridiem === '中午') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === '下午' || meridiem === '晚上') {
return hour + 12;
}
},
meridiem : function (hour, minute, isLower) {
var hm = hour * 100 + minute;
if (hm < 600) {
return '凌晨';
} else if (hm < 900) {
return '早上';
} else if (hm < 1130) {
return '上午';
} else if (hm < 1230) {
return '中午';
} else if (hm < 1800) {
return '下午';
} else {
return '晚上';
}
},
calendar : {
sameDay : '[今天]LT',
nextDay : '[明天]LT',
nextWeek : '[下]ddddLT',
lastDay : '[昨天]LT',
lastWeek : '[上]ddddLT',
sameElse : 'L'
},
dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
ordinal : function (number, period) {
switch (period) {
case 'd' :
case 'D' :
case 'DDD' :
return number + '日';
case 'M' :
return number + '月';
case 'w' :
case 'W' :
return number + '週';
default :
return number;
}
},
relativeTime : {
future : '%s內',
past : '%s前',
s : '幾秒',
ss : '%d 秒',
m : '1 分鐘',
mm : '%d 分鐘',
h : '1 小時',
hh : '%d 小時',
d : '1 天',
dd : '%d 天',
M : '1 個月',
MM : '%d 個月',
y : '1 年',
yy : '%d 年'
}
});
return zhHk;
})));
/***/ }),
/* 395 */
/***/ (function(module, exports, __webpack_require__) {
//! moment.js locale configuration
//! locale : Chinese (Taiwan) [zh-tw]
//! author : Ben : https://github.com/ben-lin
//! author : Chris Lam : https://github.com/hehachris
;(function (global, factory) {
true ? factory(__webpack_require__(275)) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var zhTw = moment.defineLocale('zh-tw', {
months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),
weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'YYYY/MM/DD',
LL : 'YYYY年M月D日',
LLL : 'YYYY年M月D日 HH:mm',
LLLL : 'YYYY年M月D日dddd HH:mm',
l : 'YYYY/M/D',
ll : 'YYYY年M月D日',
lll : 'YYYY年M月D日 HH:mm',
llll : 'YYYY年M月D日dddd HH:mm'
},
meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
return hour;
} else if (meridiem === '中午') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === '下午' || meridiem === '晚上') {
return hour + 12;
}
},
meridiem : function (hour, minute, isLower) {
var hm = hour * 100 + minute;
if (hm < 600) {
return '凌晨';
} else if (hm < 900) {
return '早上';
} else if (hm < 1130) {
return '上午';
} else if (hm < 1230) {
return '中午';
} else if (hm < 1800) {
return '下午';
} else {
return '晚上';
}
},
calendar : {
sameDay : '[今天]LT',
nextDay : '[明天]LT',
nextWeek : '[下]ddddLT',
lastDay : '[昨天]LT',
lastWeek : '[上]ddddLT',
sameElse : 'L'
},
dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
ordinal : function (number, period) {
switch (period) {
case 'd' :
case 'D' :
case 'DDD' :
return number + '日';
case 'M' :
return number + '月';
case 'w' :
case 'W' :
return number + '週';
default :
return number;
}
},
relativeTime : {
future : '%s內',
past : '%s前',
s : '幾秒',
ss : '%d 秒',
m : '1 分鐘',
mm : '%d 分鐘',
h : '1 小時',
hh : '%d 小時',
d : '1 天',
dd : '%d 天',
M : '1 個月',
MM : '%d 個月',
y : '1 年',
yy : '%d 年'
}
});
return zhTw;
})));
/***/ }),
/* 396 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _defineProperty2 = __webpack_require__(397);
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _createReactClass = __webpack_require__(85);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _DateConstants = __webpack_require__(274);
var _DateConstants2 = _interopRequireDefault(_DateConstants);
var _util = __webpack_require__(398);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function isSameDay(one, two) {
return one && two && one.isSame(two, 'day');
}
function beforeCurrentMonthYear(current, today) {
if (current.year() < today.year()) {
return 1;
}
return current.year() === today.year() && current.month() < today.month();
}
function afterCurrentMonthYear(current, today) {
if (current.year() > today.year()) {
return 1;
}
return current.year() === today.year() && current.month() > today.month();
}
function getIdFromDate(date) {
return 'rc-calendar-' + date.year() + '-' + date.month() + '-' + date.date();
}
var DateTBody = (0, _createReactClass2['default'])({
displayName: 'DateTBody',
propTypes: {
contentRender: _propTypes2['default'].func,
dateRender: _propTypes2['default'].func,
disabledDate: _propTypes2['default'].func,
prefixCls: _propTypes2['default'].string,
selectedValue: _propTypes2['default'].oneOfType([_propTypes2['default'].object, _propTypes2['default'].arrayOf(_propTypes2['default'].object)]),
value: _propTypes2['default'].object,
hoverValue: _propTypes2['default'].any,
showWeekNumber: _propTypes2['default'].bool
},
getDefaultProps: function getDefaultProps() {
return {
hoverValue: []
};
},
render: function render() {
var props = this.props;
var contentRender = props.contentRender,
prefixCls = props.prefixCls,
selectedValue = props.selectedValue,
value = props.value,
showWeekNumber = props.showWeekNumber,
dateRender = props.dateRender,
disabledDate = props.disabledDate,
hoverValue = props.hoverValue;
var iIndex = void 0;
var jIndex = void 0;
var current = void 0;
var dateTable = [];
var today = (0, _util.getTodayTime)(value);
var cellClass = prefixCls + '-cell';
var weekNumberCellClass = prefixCls + '-week-number-cell';
var dateClass = prefixCls + '-date';
var todayClass = prefixCls + '-today';
var selectedClass = prefixCls + '-selected-day';
var selectedDateClass = prefixCls + '-selected-date'; // do not move with mouse operation
var inRangeClass = prefixCls + '-in-range-cell';
var lastMonthDayClass = prefixCls + '-last-month-cell';
var nextMonthDayClass = prefixCls + '-next-month-btn-day';
var disabledClass = prefixCls + '-disabled-cell';
var firstDisableClass = prefixCls + '-disabled-cell-first-of-row';
var lastDisableClass = prefixCls + '-disabled-cell-last-of-row';
var month1 = value.clone();
month1.date(1);
var day = month1.day();
var lastMonthDiffDay = (day + 7 - value.localeData().firstDayOfWeek()) % 7;
// calculate last month
var lastMonth1 = month1.clone();
lastMonth1.add(0 - lastMonthDiffDay, 'days');
var passed = 0;
for (iIndex = 0; iIndex < _DateConstants2['default'].DATE_ROW_COUNT; iIndex++) {
for (jIndex = 0; jIndex < _DateConstants2['default'].DATE_COL_COUNT; jIndex++) {
current = lastMonth1;
if (passed) {
current = current.clone();
current.add(passed, 'days');
}
dateTable.push(current);
passed++;
}
}
var tableHtml = [];
passed = 0;
for (iIndex = 0; iIndex < _DateConstants2['default'].DATE_ROW_COUNT; iIndex++) {
var _cx;
var isCurrentWeek = void 0;
var weekNumberCell = void 0;
var isActiveWeek = false;
var dateCells = [];
if (showWeekNumber) {
weekNumberCell = _react2['default'].createElement(
'td',
{
key: dateTable[passed].week(),
role: 'gridcell',
className: weekNumberCellClass
},
dateTable[passed].week()
);
}
for (jIndex = 0; jIndex < _DateConstants2['default'].DATE_COL_COUNT; jIndex++) {
var next = null;
var last = null;
current = dateTable[passed];
if (jIndex < _DateConstants2['default'].DATE_COL_COUNT - 1) {
next = dateTable[passed + 1];
}
if (jIndex > 0) {
last = dateTable[passed - 1];
}
var cls = cellClass;
var disabled = false;
var selected = false;
if (isSameDay(current, today)) {
cls += ' ' + todayClass;
isCurrentWeek = true;
}
var isBeforeCurrentMonthYear = beforeCurrentMonthYear(current, value);
var isAfterCurrentMonthYear = afterCurrentMonthYear(current, value);
if (selectedValue && Array.isArray(selectedValue)) {
var rangeValue = hoverValue.length ? hoverValue : selectedValue;
if (!isBeforeCurrentMonthYear && !isAfterCurrentMonthYear) {
var startValue = rangeValue[0];
var endValue = rangeValue[1];
if (startValue) {
if (isSameDay(current, startValue)) {
selected = true;
isActiveWeek = true;
}
}
if (startValue && endValue) {
if (isSameDay(current, endValue)) {
selected = true;
isActiveWeek = true;
} else if (current.isAfter(startValue, 'day') && current.isBefore(endValue, 'day')) {
cls += ' ' + inRangeClass;
}
}
}
} else if (isSameDay(current, value)) {
// keyboard change value, highlight works
selected = true;
isActiveWeek = true;
}
if (isSameDay(current, selectedValue)) {
cls += ' ' + selectedDateClass;
}
if (isBeforeCurrentMonthYear) {
cls += ' ' + lastMonthDayClass;
}
if (isAfterCurrentMonthYear) {
cls += ' ' + nextMonthDayClass;
}
if (disabledDate) {
if (disabledDate(current, value)) {
disabled = true;
if (!last || !disabledDate(last, value)) {
cls += ' ' + firstDisableClass;
}
if (!next || !disabledDate(next, value)) {
cls += ' ' + lastDisableClass;
}
}
}
if (selected) {
cls += ' ' + selectedClass;
}
if (disabled) {
cls += ' ' + disabledClass;
}
var dateHtml = void 0;
if (dateRender) {
dateHtml = dateRender(current, value);
} else {
var content = contentRender ? contentRender(current, value) : current.date();
dateHtml = _react2['default'].createElement(
'div',
{
key: getIdFromDate(current),
className: dateClass,
'aria-selected': selected,
'aria-disabled': disabled
},
content
);
}
dateCells.push(_react2['default'].createElement(
'td',
{
key: passed,
onClick: disabled ? undefined : props.onSelect.bind(null, current),
onMouseEnter: disabled ? undefined : props.onDayHover && props.onDayHover.bind(null, current) || undefined,
role: 'gridcell',
title: (0, _util.getTitleString)(current), className: cls
},
dateHtml
));
passed++;
}
tableHtml.push(_react2['default'].createElement(
'tr',
{
key: iIndex,
role: 'row',
className: (0, _classnames2['default'])((_cx = {}, (0, _defineProperty3['default'])(_cx, prefixCls + '-current-week', isCurrentWeek), (0, _defineProperty3['default'])(_cx, prefixCls + '-active-week', isActiveWeek), _cx))
},
weekNumberCell,
dateCells
));
}
return _react2['default'].createElement(
'tbody',
{ className: prefixCls + '-tbody' },
tableHtml
);
}
});
exports['default'] = DateTBody;
module.exports = exports['default'];
/***/ }),
/* 397 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _defineProperty = __webpack_require__(227);
var _defineProperty2 = _interopRequireDefault(_defineProperty);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (obj, key, value) {
if (key in obj) {
(0, _defineProperty2.default)(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
};
/***/ }),
/* 398 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = __webpack_require__(216);
var _extends3 = _interopRequireDefault(_extends2);
exports.getTodayTime = getTodayTime;
exports.getTitleString = getTitleString;
exports.getTodayTimeStr = getTodayTimeStr;
exports.getMonthName = getMonthName;
exports.syncTime = syncTime;
exports.getTimeConfig = getTimeConfig;
exports.isTimeValidByConfig = isTimeValidByConfig;
exports.isTimeValid = isTimeValid;
exports.isAllowedDate = isAllowedDate;
var _moment = __webpack_require__(275);
var _moment2 = _interopRequireDefault(_moment);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var defaultDisabledTime = {
disabledHours: function disabledHours() {
return [];
},
disabledMinutes: function disabledMinutes() {
return [];
},
disabledSeconds: function disabledSeconds() {
return [];
}
};
function getTodayTime(value) {
var today = (0, _moment2['default'])();
today.locale(value.locale()).utcOffset(value.utcOffset());
return today;
}
function getTitleString(value) {
return value.format('L');
}
function getTodayTimeStr(value) {
var today = getTodayTime(value);
return getTitleString(today);
}
function getMonthName(month) {
var locale = month.locale();
var localeData = month.localeData();
return localeData[locale === 'zh-cn' ? 'months' : 'monthsShort'](month);
}
function syncTime(from, to) {
if (!_moment2['default'].isMoment(from) || !_moment2['default'].isMoment(to)) return;
to.hour(from.hour());
to.minute(from.minute());
to.second(from.second());
}
function getTimeConfig(value, disabledTime) {
var disabledTimeConfig = disabledTime ? disabledTime(value) : {};
disabledTimeConfig = (0, _extends3['default'])({}, defaultDisabledTime, disabledTimeConfig);
return disabledTimeConfig;
}
function isTimeValidByConfig(value, disabledTimeConfig) {
var invalidTime = false;
if (value) {
var hour = value.hour();
var minutes = value.minute();
var seconds = value.second();
var disabledHours = disabledTimeConfig.disabledHours();
if (disabledHours.indexOf(hour) === -1) {
var disabledMinutes = disabledTimeConfig.disabledMinutes(hour);
if (disabledMinutes.indexOf(minutes) === -1) {
var disabledSeconds = disabledTimeConfig.disabledSeconds(hour, minutes);
invalidTime = disabledSeconds.indexOf(seconds) !== -1;
} else {
invalidTime = true;
}
} else {
invalidTime = true;
}
}
return !invalidTime;
}
function isTimeValid(value, disabledTime) {
var disabledTimeConfig = getTimeConfig(value, disabledTime);
return isTimeValidByConfig(value, disabledTimeConfig);
}
function isAllowedDate(value, disabledDate, disabledTime) {
if (disabledDate) {
if (disabledDate(value)) {
return false;
}
}
if (disabledTime) {
if (!isTimeValid(value, disabledTime)) {
return false;
}
}
return true;
}
/***/ }),
/* 399 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _createReactClass = __webpack_require__(85);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _MonthPanel = __webpack_require__(400);
var _MonthPanel2 = _interopRequireDefault(_MonthPanel);
var _YearPanel = __webpack_require__(401);
var _YearPanel2 = _interopRequireDefault(_YearPanel);
var _mapSelf = __webpack_require__(404);
var _mapSelf2 = _interopRequireDefault(_mapSelf);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function goMonth(direction) {
var next = this.props.value.clone();
next.add(direction, 'months');
this.props.onValueChange(next);
}
function goYear(direction) {
var next = this.props.value.clone();
next.add(direction, 'years');
this.props.onValueChange(next);
}
function showIf(condition, el) {
return condition ? el : null;
}
var CalendarHeader = (0, _createReactClass2['default'])({
displayName: 'CalendarHeader',
propTypes: {
prefixCls: _propTypes2['default'].string,
value: _propTypes2['default'].object,
onValueChange: _propTypes2['default'].func,
showTimePicker: _propTypes2['default'].bool,
showMonthPanel: _propTypes2['default'].bool,
showYearPanel: _propTypes2['default'].bool,
onPanelChange: _propTypes2['default'].func,
locale: _propTypes2['default'].object,
enablePrev: _propTypes2['default'].any,
enableNext: _propTypes2['default'].any,
disabledMonth: _propTypes2['default'].func
},
getDefaultProps: function getDefaultProps() {
return {
enableNext: 1,
enablePrev: 1,
onPanelChange: function onPanelChange() {},
onValueChange: function onValueChange() {}
};
},
getInitialState: function getInitialState() {
this.nextMonth = goMonth.bind(this, 1);
this.previousMonth = goMonth.bind(this, -1);
this.nextYear = goYear.bind(this, 1);
this.previousYear = goYear.bind(this, -1);
var _props = this.props,
showMonthPanel = _props.showMonthPanel,
showYearPanel = _props.showYearPanel;
return { showMonthPanel: showMonthPanel, showYearPanel: showYearPanel };
},
componentWillReceiveProps: function componentWillReceiveProps() {
var props = this.props;
if ('showMonthpanel' in props) {
this.setState({ showMonthPanel: props.showMonthPanel });
}
if ('showYearpanel' in props) {
this.setState({ showYearPanel: props.showYearPanel });
}
},
onSelect: function onSelect(value) {
this.triggerPanelChange({
showMonthPanel: 0,
showYearPanel: 0
});
this.props.onValueChange(value);
},
triggerPanelChange: function triggerPanelChange(panelStatus) {
if (!('showMonthPanel' in this.props)) {
this.setState({ showMonthPanel: panelStatus.showMonthPanel });
}
if (!('showYearPanel' in this.props)) {
this.setState({ showYearPanel: panelStatus.showYearPanel });
}
this.props.onPanelChange(panelStatus);
},
monthYearElement: function monthYearElement(showTimePicker) {
var props = this.props;
var prefixCls = props.prefixCls;
var locale = props.locale;
var value = props.value;
var localeData = value.localeData();
var monthBeforeYear = locale.monthBeforeYear;
var selectClassName = prefixCls + '-' + (monthBeforeYear ? 'my-select' : 'ym-select');
var year = _react2['default'].createElement(
'a',
{
className: prefixCls + '-year-select',
role: 'button',
onClick: showTimePicker ? null : this.showYearPanel,
title: locale.yearSelect
},
value.format(locale.yearFormat)
);
var month = _react2['default'].createElement(
'a',
{
className: prefixCls + '-month-select',
role: 'button',
onClick: showTimePicker ? null : this.showMonthPanel,
title: locale.monthSelect
},
localeData.monthsShort(value)
);
var day = void 0;
if (showTimePicker) {
day = _react2['default'].createElement(
'a',
{
className: prefixCls + '-day-select',
role: 'button'
},
value.format(locale.dayFormat)
);
}
var my = [];
if (monthBeforeYear) {
my = [month, day, year];
} else {
my = [year, month, day];
}
return _react2['default'].createElement(
'span',
{ className: selectClassName },
(0, _mapSelf2['default'])(my)
);
},
showMonthPanel: function showMonthPanel() {
this.triggerPanelChange({
showMonthPanel: 1,
showYearPanel: 0
});
},
showYearPanel: function showYearPanel() {
this.triggerPanelChange({
showMonthPanel: 0,
showYearPanel: 1
});
},
render: function render() {
var props = this.props,
state = this.state;
var prefixCls = props.prefixCls,
locale = props.locale,
value = props.value,
showTimePicker = props.showTimePicker,
enableNext = props.enableNext,
enablePrev = props.enablePrev,
disabledMonth = props.disabledMonth;
var panel = null;
if (state.showMonthPanel) {
panel = _react2['default'].createElement(_MonthPanel2['default'], {
locale: locale,
defaultValue: value,
rootPrefixCls: prefixCls,
onSelect: this.onSelect,
disabledDate: disabledMonth
});
} else if (state.showYearPanel) {
panel = _react2['default'].createElement(_YearPanel2['default'], {
locale: locale,
defaultValue: value,
rootPrefixCls: prefixCls,
onSelect: this.onSelect
});
}
return _react2['default'].createElement(
'div',
{ className: prefixCls + '-header' },
_react2['default'].createElement(
'div',
{ style: { position: 'relative' } },
showIf(enablePrev && !showTimePicker, _react2['default'].createElement('a', {
className: prefixCls + '-prev-year-btn',
role: 'button',
onClick: this.previousYear,
title: locale.previousYear
})),
showIf(enablePrev && !showTimePicker, _react2['default'].createElement('a', {
className: prefixCls + '-prev-month-btn',
role: 'button',
onClick: this.previousMonth,
title: locale.previousMonth
})),
this.monthYearElement(showTimePicker),
showIf(enableNext && !showTimePicker, _react2['default'].createElement('a', {
className: prefixCls + '-next-month-btn',
onClick: this.nextMonth,
title: locale.nextMonth
})),
showIf(enableNext && !showTimePicker, _react2['default'].createElement('a', {
className: prefixCls + '-next-year-btn',
onClick: this.nextYear,
title: locale.nextYear
}))
),
panel
);
}
});
exports['default'] = CalendarHeader;
module.exports = exports['default'];
/***/ }),
/* 400 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _createReactClass = __webpack_require__(85);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _YearPanel = __webpack_require__(401);
var _YearPanel2 = _interopRequireDefault(_YearPanel);
var _MonthTable = __webpack_require__(403);
var _MonthTable2 = _interopRequireDefault(_MonthTable);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function goYear(direction) {
var next = this.state.value.clone();
next.add(direction, 'year');
this.setAndChangeValue(next);
}
function noop() {}
var MonthPanel = (0, _createReactClass2['default'])({
displayName: 'MonthPanel',
propTypes: {
onChange: _propTypes2['default'].func,
disabledDate: _propTypes2['default'].func,
onSelect: _propTypes2['default'].func
},
getDefaultProps: function getDefaultProps() {
return {
onChange: noop,
onSelect: noop
};
},
getInitialState: function getInitialState() {
var props = this.props;
// bind methods
this.nextYear = goYear.bind(this, 1);
this.previousYear = goYear.bind(this, -1);
this.prefixCls = props.rootPrefixCls + '-month-panel';
return {
value: props.value || props.defaultValue
};
},
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
if ('value' in nextProps) {
this.setState({
value: nextProps.value
});
}
},
onYearPanelSelect: function onYearPanelSelect(current) {
this.setState({
showYearPanel: 0
});
this.setAndChangeValue(current);
},
setAndChangeValue: function setAndChangeValue(value) {
this.setValue(value);
this.props.onChange(value);
},
setAndSelectValue: function setAndSelectValue(value) {
this.setValue(value);
this.props.onSelect(value);
},
setValue: function setValue(value) {
if (!('value' in this.props)) {
this.setState({
value: value
});
}
},
showYearPanel: function showYearPanel() {
this.setState({
showYearPanel: 1
});
},
render: function render() {
var props = this.props;
var value = this.state.value;
var cellRender = props.cellRender;
var contentRender = props.contentRender;
var locale = props.locale;
var year = value.year();
var prefixCls = this.prefixCls;
var yearPanel = void 0;
if (this.state.showYearPanel) {
yearPanel = _react2['default'].createElement(_YearPanel2['default'], {
locale: locale,
value: value,
rootPrefixCls: props.rootPrefixCls,
onSelect: this.onYearPanelSelect
});
}
return _react2['default'].createElement(
'div',
{ className: prefixCls, style: props.style },
_react2['default'].createElement(
'div',
null,
_react2['default'].createElement(
'div',
{ className: prefixCls + '-header' },
_react2['default'].createElement('a', {
className: prefixCls + '-prev-year-btn',
role: 'button',
onClick: this.previousYear,
title: locale.previousYear
}),
_react2['default'].createElement(
'a',
{
className: prefixCls + '-year-select',
role: 'button',
onClick: this.showYearPanel,
title: locale.yearSelect
},
_react2['default'].createElement(
'span',
{ className: prefixCls + '-year-select-content' },
year
),
_react2['default'].createElement(
'span',
{ className: prefixCls + '-year-select-arrow' },
'x'
)
),
_react2['default'].createElement('a', {
className: prefixCls + '-next-year-btn',
role: 'button',
onClick: this.nextYear,
title: locale.nextYear
})
),
_react2['default'].createElement(
'div',
{ className: prefixCls + '-body' },
_react2['default'].createElement(_MonthTable2['default'], {
disabledDate: props.disabledDate,
onSelect: this.setAndSelectValue,
locale: locale,
value: value,
cellRender: cellRender,
contentRender: contentRender,
prefixCls: prefixCls
})
)
),
yearPanel
);
}
});
exports['default'] = MonthPanel;
module.exports = exports['default'];
/***/ }),
/* 401 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _defineProperty2 = __webpack_require__(397);
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(226);
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _DecadePanel = __webpack_require__(402);
var _DecadePanel2 = _interopRequireDefault(_DecadePanel);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var ROW = 4;
var COL = 3;
function goYear(direction) {
var value = this.state.value.clone();
value.add(direction, 'year');
this.setState({
value: value
});
}
function chooseYear(year) {
var value = this.state.value.clone();
value.year(year);
value.month(this.state.value.month());
this.props.onSelect(value);
}
var YearPanel = function (_React$Component) {
(0, _inherits3['default'])(YearPanel, _React$Component);
function YearPanel(props) {
(0, _classCallCheck3['default'])(this, YearPanel);
var _this = (0, _possibleConstructorReturn3['default'])(this, (YearPanel.__proto__ || Object.getPrototypeOf(YearPanel)).call(this, props));
_this.prefixCls = props.rootPrefixCls + '-year-panel';
_this.state = {
value: props.value || props.defaultValue
};
_this.nextDecade = goYear.bind(_this, 10);
_this.previousDecade = goYear.bind(_this, -10);
['showDecadePanel', 'onDecadePanelSelect'].forEach(function (method) {
_this[method] = _this[method].bind(_this);
});
return _this;
}
(0, _createClass3['default'])(YearPanel, [{
key: 'onDecadePanelSelect',
value: function onDecadePanelSelect(current) {
this.setState({
value: current,
showDecadePanel: 0
});
}
}, {
key: 'years',
value: function years() {
var value = this.state.value;
var currentYear = value.year();
var startYear = parseInt(currentYear / 10, 10) * 10;
var previousYear = startYear - 1;
var years = [];
var index = 0;
for (var rowIndex = 0; rowIndex < ROW; rowIndex++) {
years[rowIndex] = [];
for (var colIndex = 0; colIndex < COL; colIndex++) {
var year = previousYear + index;
var content = String(year);
years[rowIndex][colIndex] = {
content: content,
year: year,
title: content
};
index++;
}
}
return years;
}
}, {
key: 'showDecadePanel',
value: function showDecadePanel() {
this.setState({
showDecadePanel: 1
});
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var props = this.props;
var value = this.state.value;
var locale = props.locale;
var years = this.years();
var currentYear = value.year();
var startYear = parseInt(currentYear / 10, 10) * 10;
var endYear = startYear + 9;
var prefixCls = this.prefixCls;
var yeasEls = years.map(function (row, index) {
var tds = row.map(function (yearData) {
var _classNameMap;
var classNameMap = (_classNameMap = {}, (0, _defineProperty3['default'])(_classNameMap, prefixCls + '-cell', 1), (0, _defineProperty3['default'])(_classNameMap, prefixCls + '-selected-cell', yearData.year === currentYear), (0, _defineProperty3['default'])(_classNameMap, prefixCls + '-last-decade-cell', yearData.year < startYear), (0, _defineProperty3['default'])(_classNameMap, prefixCls + '-next-decade-cell', yearData.year > endYear), _classNameMap);
var clickHandler = void 0;
if (yearData.year < startYear) {
clickHandler = _this2.previousDecade;
} else if (yearData.year > endYear) {
clickHandler = _this2.nextDecade;
} else {
clickHandler = chooseYear.bind(_this2, yearData.year);
}
return _react2['default'].createElement(
'td',
{
role: 'gridcell',
title: yearData.title,
key: yearData.content,
onClick: clickHandler,
className: (0, _classnames2['default'])(classNameMap)
},
_react2['default'].createElement(
'a',
{
className: prefixCls + '-year'
},
yearData.content
)
);
});
return _react2['default'].createElement(
'tr',
{ key: index, role: 'row' },
tds
);
});
var decadePanel = void 0;
if (this.state.showDecadePanel) {
decadePanel = _react2['default'].createElement(_DecadePanel2['default'], {
locale: locale,
value: value,
rootPrefixCls: props.rootPrefixCls,
onSelect: this.onDecadePanelSelect
});
}
return _react2['default'].createElement(
'div',
{ className: this.prefixCls },
_react2['default'].createElement(
'div',
null,
_react2['default'].createElement(
'div',
{ className: prefixCls + '-header' },
_react2['default'].createElement('a', {
className: prefixCls + '-prev-decade-btn',
role: 'button',
onClick: this.previousDecade,
title: locale.previousDecade
}),
_react2['default'].createElement(
'a',
{
className: prefixCls + '-decade-select',
role: 'button',
onClick: this.showDecadePanel,
title: locale.decadeSelect
},
_react2['default'].createElement(
'span',
{ className: prefixCls + '-decade-select-content' },
startYear,
'-',
endYear
),
_react2['default'].createElement(
'span',
{ className: prefixCls + '-decade-select-arrow' },
'x'
)
),
_react2['default'].createElement('a', {
className: prefixCls + '-next-decade-btn',
role: 'button',
onClick: this.nextDecade,
title: locale.nextDecade
})
),
_react2['default'].createElement(
'div',
{ className: prefixCls + '-body' },
_react2['default'].createElement(
'table',
{ className: prefixCls + '-table', cellSpacing: '0', role: 'grid' },
_react2['default'].createElement(
'tbody',
{ className: prefixCls + '-tbody' },
yeasEls
)
)
)
),
decadePanel
);
}
}]);
return YearPanel;
}(_react2['default'].Component);
exports['default'] = YearPanel;
YearPanel.propTypes = {
rootPrefixCls: _propTypes2['default'].string,
value: _propTypes2['default'].object,
defaultValue: _propTypes2['default'].object
};
YearPanel.defaultProps = {
onSelect: function onSelect() {}
};
module.exports = exports['default'];
/***/ }),
/* 402 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _defineProperty2 = __webpack_require__(397);
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(226);
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var ROW = 4;
var COL = 3;
function goYear(direction) {
var next = this.state.value.clone();
next.add(direction, 'years');
this.setState({
value: next
});
}
function chooseDecade(year, event) {
var next = this.state.value.clone();
next.year(year);
next.month(this.state.value.month());
this.props.onSelect(next);
event.preventDefault();
}
var DecadePanel = function (_React$Component) {
(0, _inherits3['default'])(DecadePanel, _React$Component);
function DecadePanel(props) {
(0, _classCallCheck3['default'])(this, DecadePanel);
var _this = (0, _possibleConstructorReturn3['default'])(this, (DecadePanel.__proto__ || Object.getPrototypeOf(DecadePanel)).call(this, props));
_this.state = {
value: props.value || props.defaultValue
};
// bind methods
_this.prefixCls = props.rootPrefixCls + '-decade-panel';
_this.nextCentury = goYear.bind(_this, 100);
_this.previousCentury = goYear.bind(_this, -100);
return _this;
}
(0, _createClass3['default'])(DecadePanel, [{
key: 'render',
value: function render() {
var _this2 = this;
var value = this.state.value;
var locale = this.props.locale;
var currentYear = value.year();
var startYear = parseInt(currentYear / 100, 10) * 100;
var preYear = startYear - 10;
var endYear = startYear + 99;
var decades = [];
var index = 0;
var prefixCls = this.prefixCls;
for (var rowIndex = 0; rowIndex < ROW; rowIndex++) {
decades[rowIndex] = [];
for (var colIndex = 0; colIndex < COL; colIndex++) {
var startDecade = preYear + index * 10;
var endDecade = preYear + index * 10 + 9;
decades[rowIndex][colIndex] = {
startDecade: startDecade,
endDecade: endDecade
};
index++;
}
}
var decadesEls = decades.map(function (row, decadeIndex) {
var tds = row.map(function (decadeData) {
var _classNameMap;
var dStartDecade = decadeData.startDecade;
var dEndDecade = decadeData.endDecade;
var isLast = dStartDecade < startYear;
var isNext = dEndDecade > endYear;
var classNameMap = (_classNameMap = {}, (0, _defineProperty3['default'])(_classNameMap, prefixCls + '-cell', 1), (0, _defineProperty3['default'])(_classNameMap, prefixCls + '-selected-cell', dStartDecade <= currentYear && currentYear <= dEndDecade), (0, _defineProperty3['default'])(_classNameMap, prefixCls + '-last-century-cell', isLast), (0, _defineProperty3['default'])(_classNameMap, prefixCls + '-next-century-cell', isNext), _classNameMap);
var content = dStartDecade + '-' + dEndDecade;
var clickHandler = void 0;
if (isLast) {
clickHandler = _this2.previousCentury;
} else if (isNext) {
clickHandler = _this2.nextCentury;
} else {
clickHandler = chooseDecade.bind(_this2, dStartDecade);
}
return _react2['default'].createElement(
'td',
{
key: dStartDecade,
onClick: clickHandler,
role: 'gridcell',
className: (0, _classnames2['default'])(classNameMap)
},
_react2['default'].createElement(
'a',
{
className: prefixCls + '-decade'
},
content
)
);
});
return _react2['default'].createElement(
'tr',
{ key: decadeIndex, role: 'row' },
tds
);
});
return _react2['default'].createElement(
'div',
{ className: this.prefixCls },
_react2['default'].createElement(
'div',
{ className: prefixCls + '-header' },
_react2['default'].createElement('a', {
className: prefixCls + '-prev-century-btn',
role: 'button',
onClick: this.previousCentury,
title: locale.previousCentury
}),
_react2['default'].createElement(
'div',
{ className: prefixCls + '-century' },
startYear,
'-',
endYear
),
_react2['default'].createElement('a', {
className: prefixCls + '-next-century-btn',
role: 'button',
onClick: this.nextCentury,
title: locale.nextCentury
})
),
_react2['default'].createElement(
'div',
{ className: prefixCls + '-body' },
_react2['default'].createElement(
'table',
{ className: prefixCls + '-table', cellSpacing: '0', role: 'grid' },
_react2['default'].createElement(
'tbody',
{ className: prefixCls + '-tbody' },
decadesEls
)
)
)
);
}
}]);
return DecadePanel;
}(_react2['default'].Component);
exports['default'] = DecadePanel;
DecadePanel.propTypes = {
locale: _propTypes2['default'].object,
value: _propTypes2['default'].object,
defaultValue: _propTypes2['default'].object,
rootPrefixCls: _propTypes2['default'].string
};
DecadePanel.defaultProps = {
onSelect: function onSelect() {}
};
module.exports = exports['default'];
/***/ }),
/* 403 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _defineProperty2 = __webpack_require__(397);
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(226);
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _index = __webpack_require__(398);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var ROW = 4;
var COL = 3;
function chooseMonth(month) {
var next = this.state.value.clone();
next.month(month);
this.setAndSelectValue(next);
}
function noop() {}
var MonthTable = function (_Component) {
(0, _inherits3['default'])(MonthTable, _Component);
function MonthTable(props) {
(0, _classCallCheck3['default'])(this, MonthTable);
var _this = (0, _possibleConstructorReturn3['default'])(this, (MonthTable.__proto__ || Object.getPrototypeOf(MonthTable)).call(this, props));
_this.state = {
value: props.value
};
return _this;
}
(0, _createClass3['default'])(MonthTable, [{
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
if ('value' in nextProps) {
this.setState({
value: nextProps.value
});
}
}
}, {
key: 'setAndSelectValue',
value: function setAndSelectValue(value) {
this.setState({
value: value
});
this.props.onSelect(value);
}
}, {
key: 'months',
value: function months() {
var value = this.state.value;
var current = value.clone();
var months = [];
var index = 0;
for (var rowIndex = 0; rowIndex < ROW; rowIndex++) {
months[rowIndex] = [];
for (var colIndex = 0; colIndex < COL; colIndex++) {
current.month(index);
var content = (0, _index.getMonthName)(current);
months[rowIndex][colIndex] = {
value: index,
content: content,
title: content
};
index++;
}
}
return months;
}
}, {
key: 'render',
value: function render() {
var _this2 = this;
var props = this.props;
var value = this.state.value;
var today = (0, _index.getTodayTime)(value);
var months = this.months();
var currentMonth = value.month();
var prefixCls = props.prefixCls,
locale = props.locale,
contentRender = props.contentRender,
cellRender = props.cellRender;
var monthsEls = months.map(function (month, index) {
var tds = month.map(function (monthData) {
var _classNameMap;
var disabled = false;
if (props.disabledDate) {
var testValue = value.clone();
testValue.month(monthData.value);
disabled = props.disabledDate(testValue);
}
var classNameMap = (_classNameMap = {}, (0, _defineProperty3['default'])(_classNameMap, prefixCls + '-cell', 1), (0, _defineProperty3['default'])(_classNameMap, prefixCls + '-cell-disabled', disabled), (0, _defineProperty3['default'])(_classNameMap, prefixCls + '-selected-cell', monthData.value === currentMonth), (0, _defineProperty3['default'])(_classNameMap, prefixCls + '-current-cell', today.year() === value.year() && monthData.value === today.month()), _classNameMap);
var cellEl = void 0;
if (cellRender) {
var currentValue = value.clone();
currentValue.month(monthData.value);
cellEl = cellRender(currentValue, locale);
} else {
var content = void 0;
if (contentRender) {
var _currentValue = value.clone();
_currentValue.month(monthData.value);
content = contentRender(_currentValue, locale);
} else {
content = monthData.content;
}
cellEl = _react2['default'].createElement(
'a',
{ className: prefixCls + '-month' },
content
);
}
return _react2['default'].createElement(
'td',
{
role: 'gridcell',
key: monthData.value,
onClick: disabled ? null : chooseMonth.bind(_this2, monthData.value),
title: monthData.title,
className: (0, _classnames2['default'])(classNameMap)
},
cellEl
);
});
return _react2['default'].createElement(
'tr',
{ key: index, role: 'row' },
tds
);
});
return _react2['default'].createElement(
'table',
{ className: prefixCls + '-table', cellSpacing: '0', role: 'grid' },
_react2['default'].createElement(
'tbody',
{ className: prefixCls + '-tbody' },
monthsEls
)
);
}
}]);
return MonthTable;
}(_react.Component);
MonthTable.defaultProps = {
onSelect: noop
};
MonthTable.propTypes = {
onSelect: _propTypes2['default'].func,
cellRender: _propTypes2['default'].func,
prefixCls: _propTypes2['default'].string,
value: _propTypes2['default'].object
};
exports['default'] = MonthTable;
module.exports = exports['default'];
/***/ }),
/* 404 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = mapSelf;
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function mirror(o) {
return o;
}
function mapSelf(children) {
// return ReactFragment
return _react2['default'].Children.map(children, mirror);
}
module.exports = exports['default'];
/***/ }),
/* 405 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _defineProperty2 = __webpack_require__(397);
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _extends2 = __webpack_require__(216);
var _extends3 = _interopRequireDefault(_extends2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _createReactClass = __webpack_require__(85);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _mapSelf = __webpack_require__(404);
var _mapSelf2 = _interopRequireDefault(_mapSelf);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _TodayButton = __webpack_require__(406);
var _TodayButton2 = _interopRequireDefault(_TodayButton);
var _OkButton = __webpack_require__(407);
var _OkButton2 = _interopRequireDefault(_OkButton);
var _TimePickerButton = __webpack_require__(408);
var _TimePickerButton2 = _interopRequireDefault(_TimePickerButton);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var CalendarFooter = (0, _createReactClass2['default'])({
displayName: 'CalendarFooter',
propTypes: {
prefixCls: _propTypes2['default'].string,
showDateInput: _propTypes2['default'].bool,
disabledTime: _propTypes2['default'].any,
timePicker: _propTypes2['default'].element,
selectedValue: _propTypes2['default'].any,
showOk: _propTypes2['default'].bool,
onSelect: _propTypes2['default'].func,
value: _propTypes2['default'].object,
renderFooter: _propTypes2['default'].func,
defaultValue: _propTypes2['default'].object
},
onSelect: function onSelect(value) {
this.props.onSelect(value);
},
getRootDOMNode: function getRootDOMNode() {
return _reactDom2['default'].findDOMNode(this);
},
render: function render() {
var props = this.props;
var value = props.value,
prefixCls = props.prefixCls,
showOk = props.showOk,
timePicker = props.timePicker,
renderFooter = props.renderFooter;
var footerEl = null;
var extraFooter = renderFooter();
if (props.showToday || timePicker || extraFooter) {
var _cx;
var nowEl = void 0;
if (props.showToday) {
nowEl = _react2['default'].createElement(_TodayButton2['default'], (0, _extends3['default'])({}, props, { value: value }));
}
var okBtn = void 0;
if (showOk === true || showOk !== false && !!props.timePicker) {
okBtn = _react2['default'].createElement(_OkButton2['default'], props);
}
var timePickerBtn = void 0;
if (!!props.timePicker) {
timePickerBtn = _react2['default'].createElement(_TimePickerButton2['default'], props);
}
var footerBtn = void 0;
if (nowEl || timePickerBtn || okBtn) {
footerBtn = _react2['default'].createElement(
'span',
{ className: prefixCls + '-footer-btn' },
(0, _mapSelf2['default'])([nowEl, timePickerBtn, okBtn])
);
}
var cls = (0, _classnames2['default'])((_cx = {}, (0, _defineProperty3['default'])(_cx, prefixCls + '-footer', true), (0, _defineProperty3['default'])(_cx, prefixCls + '-footer-show-ok', okBtn), _cx));
footerEl = _react2['default'].createElement(
'div',
{ className: cls },
extraFooter,
footerBtn
);
}
return footerEl;
}
});
exports['default'] = CalendarFooter;
module.exports = exports['default'];
/***/ }),
/* 406 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = TodayButton;
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _util = __webpack_require__(398);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function TodayButton(_ref) {
var prefixCls = _ref.prefixCls,
locale = _ref.locale,
value = _ref.value,
timePicker = _ref.timePicker,
disabled = _ref.disabled,
disabledDate = _ref.disabledDate,
onToday = _ref.onToday,
text = _ref.text;
var localeNow = (!text && timePicker ? locale.now : text) || locale.today;
var disabledToday = disabledDate && !(0, _util.isAllowedDate)((0, _util.getTodayTime)(value), disabledDate);
var isDisabled = disabledToday || disabled;
var disabledTodayClass = isDisabled ? prefixCls + '-today-btn-disabled' : '';
return _react2['default'].createElement(
'a',
{
className: prefixCls + '-today-btn ' + disabledTodayClass,
role: 'button',
onClick: isDisabled ? null : onToday,
title: (0, _util.getTodayTimeStr)(value)
},
localeNow
);
}
module.exports = exports['default'];
/***/ }),
/* 407 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = OkButton;
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function OkButton(_ref) {
var prefixCls = _ref.prefixCls,
locale = _ref.locale,
okDisabled = _ref.okDisabled,
onOk = _ref.onOk;
var className = prefixCls + "-ok-btn";
if (okDisabled) {
className += " " + prefixCls + "-ok-btn-disabled";
}
return _react2["default"].createElement(
"a",
{
className: className,
role: "button",
onClick: okDisabled ? null : onOk
},
locale.ok
);
}
module.exports = exports['default'];
/***/ }),
/* 408 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _defineProperty2 = __webpack_require__(397);
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
exports['default'] = TimePickerButton;
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _classnames2 = __webpack_require__(3);
var _classnames3 = _interopRequireDefault(_classnames2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function TimePickerButton(_ref) {
var _classnames;
var prefixCls = _ref.prefixCls,
locale = _ref.locale,
showTimePicker = _ref.showTimePicker,
onOpenTimePicker = _ref.onOpenTimePicker,
onCloseTimePicker = _ref.onCloseTimePicker,
timePickerDisabled = _ref.timePickerDisabled;
var className = (0, _classnames3['default'])((_classnames = {}, (0, _defineProperty3['default'])(_classnames, prefixCls + '-time-picker-btn', true), (0, _defineProperty3['default'])(_classnames, prefixCls + '-time-picker-btn-disabled', timePickerDisabled), _classnames));
var onClick = null;
if (!timePickerDisabled) {
onClick = showTimePicker ? onCloseTimePicker : onOpenTimePicker;
}
return _react2['default'].createElement(
'a',
{
className: className,
role: 'button',
onClick: onClick
},
showTimePicker ? locale.dateSelect : locale.timeSelect
);
}
module.exports = exports['default'];
/***/ }),
/* 409 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _defineProperty2 = __webpack_require__(397);
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _moment = __webpack_require__(275);
var _moment2 = _interopRequireDefault(_moment);
var _index = __webpack_require__(398);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function noop() {}
function getNow() {
return (0, _moment2['default'])();
}
function getNowByCurrentStateValue(value) {
var ret = void 0;
if (value) {
ret = (0, _index.getTodayTime)(value);
} else {
ret = getNow();
}
return ret;
}
var CalendarMixin = {
propTypes: {
value: _propTypes2['default'].object,
defaultValue: _propTypes2['default'].object,
onKeyDown: _propTypes2['default'].func
},
getDefaultProps: function getDefaultProps() {
return {
onKeyDown: noop
};
},
getInitialState: function getInitialState() {
var props = this.props;
var value = props.value || props.defaultValue || getNow();
return {
value: value,
selectedValue: props.selectedValue || props.defaultSelectedValue
};
},
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
var value = nextProps.value;
var selectedValue = nextProps.selectedValue;
if ('value' in nextProps) {
value = value || nextProps.defaultValue || getNowByCurrentStateValue(this.state.value);
this.setState({
value: value
});
}
if ('selectedValue' in nextProps) {
this.setState({
selectedValue: selectedValue
});
}
},
onSelect: function onSelect(value, cause) {
if (value) {
this.setValue(value);
}
this.setSelectedValue(value, cause);
},
renderRoot: function renderRoot(newProps) {
var _className;
var props = this.props;
var prefixCls = props.prefixCls;
var className = (_className = {}, (0, _defineProperty3['default'])(_className, prefixCls, 1), (0, _defineProperty3['default'])(_className, prefixCls + '-hidden', !props.visible), (0, _defineProperty3['default'])(_className, props.className, !!props.className), (0, _defineProperty3['default'])(_className, newProps.className, !!newProps.className), _className);
return _react2['default'].createElement(
'div',
{
ref: 'root',
className: '' + (0, _classnames2['default'])(className),
style: this.props.style,
tabIndex: '0',
onKeyDown: this.onKeyDown
},
newProps.children
);
},
setSelectedValue: function setSelectedValue(selectedValue, cause) {
// if (this.isAllowedDate(selectedValue)) {
if (!('selectedValue' in this.props)) {
this.setState({
selectedValue: selectedValue
});
}
this.props.onSelect(selectedValue, cause);
// }
},
setValue: function setValue(value) {
var originalValue = this.state.value;
if (!('value' in this.props)) {
this.setState({
value: value
});
}
if (originalValue && value && !originalValue.isSame(value) || !originalValue && value || originalValue && !value) {
this.props.onChange(value);
}
},
isAllowedDate: function isAllowedDate(value) {
var disabledDate = this.props.disabledDate;
var disabledTime = this.props.disabledTime;
return (0, _index.isAllowedDate)(value, disabledDate, disabledTime);
}
};
exports['default'] = CalendarMixin;
module.exports = exports['default'];
/***/ }),
/* 410 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _en_US = __webpack_require__(411);
var _en_US2 = _interopRequireDefault(_en_US);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function noop() {}
exports['default'] = {
propTypes: {
className: _propTypes2['default'].string,
locale: _propTypes2['default'].object,
style: _propTypes2['default'].object,
visible: _propTypes2['default'].bool,
onSelect: _propTypes2['default'].func,
prefixCls: _propTypes2['default'].string,
onChange: _propTypes2['default'].func,
onOk: _propTypes2['default'].func
},
getDefaultProps: function getDefaultProps() {
return {
locale: _en_US2['default'],
style: {},
visible: true,
prefixCls: 'rc-calendar',
className: '',
onSelect: noop,
onChange: noop,
onClear: noop,
renderFooter: function renderFooter() {
return null;
},
renderSidebar: function renderSidebar() {
return null;
}
};
},
shouldComponentUpdate: function shouldComponentUpdate(nextProps) {
return this.props.visible || nextProps.visible;
},
getFormat: function getFormat() {
var format = this.props.format;
var _props = this.props,
locale = _props.locale,
timePicker = _props.timePicker;
if (!format) {
if (timePicker) {
format = locale.dateTimeFormat;
} else {
format = locale.dateFormat;
}
}
return format;
},
focus: function focus() {
if (this.refs.root) {
this.refs.root.focus();
}
}
};
module.exports = exports['default'];
/***/ }),
/* 411 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = {
today: 'Today',
now: 'Now',
backToToday: 'Back to today',
ok: 'Ok',
clear: 'Clear',
month: 'Month',
year: 'Year',
timeSelect: 'Select time',
dateSelect: 'Select date',
monthSelect: 'Choose a month',
yearSelect: 'Choose a year',
decadeSelect: 'Choose a decade',
yearFormat: 'YYYY',
dateFormat: 'M/D/YYYY',
dayFormat: 'D',
dateTimeFormat: 'M/D/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'Previous month (PageUp)',
nextMonth: 'Next month (PageDown)',
previousYear: 'Last year (Control + left)',
nextYear: 'Next year (Control + right)',
previousDecade: 'Last decade',
nextDecade: 'Next decade',
previousCentury: 'Last century',
nextCentury: 'Next century'
};
module.exports = exports['default'];
/***/ }),
/* 412 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _createReactClass = __webpack_require__(85);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _moment = __webpack_require__(275);
var _moment2 = _interopRequireDefault(_moment);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var DateInput = (0, _createReactClass2['default'])({
displayName: 'DateInput',
propTypes: {
prefixCls: _propTypes2['default'].string,
timePicker: _propTypes2['default'].object,
value: _propTypes2['default'].object,
disabledTime: _propTypes2['default'].any,
format: _propTypes2['default'].string,
locale: _propTypes2['default'].object,
disabledDate: _propTypes2['default'].func,
onChange: _propTypes2['default'].func,
onClear: _propTypes2['default'].func,
placeholder: _propTypes2['default'].string,
onSelect: _propTypes2['default'].func,
selectedValue: _propTypes2['default'].object
},
getInitialState: function getInitialState() {
var selectedValue = this.props.selectedValue;
return {
str: selectedValue && selectedValue.format(this.props.format) || '',
invalid: false
};
},
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
// when popup show, click body will call this, bug!
var selectedValue = nextProps.selectedValue;
this.setState({
str: selectedValue && selectedValue.format(nextProps.format) || '',
invalid: false
});
},
onInputChange: function onInputChange(event) {
var str = event.target.value;
this.setState({
str: str
});
var value = void 0;
var _props = this.props,
disabledDate = _props.disabledDate,
format = _props.format,
onChange = _props.onChange;
if (str) {
var parsed = (0, _moment2['default'])(str, format, true);
if (!parsed.isValid()) {
this.setState({
invalid: true
});
return;
}
value = this.props.value.clone();
value.year(parsed.year()).month(parsed.month()).date(parsed.date()).hour(parsed.hour()).minute(parsed.minute()).second(parsed.second());
if (value && (!disabledDate || !disabledDate(value))) {
var originalValue = this.props.selectedValue;
if (originalValue && value) {
if (!originalValue.isSame(value)) {
onChange(value);
}
} else if (originalValue !== value) {
onChange(value);
}
} else {
this.setState({
invalid: true
});
return;
}
} else {
onChange(null);
}
this.setState({
invalid: false
});
},
onClear: function onClear() {
this.setState({
str: ''
});
this.props.onClear(null);
},
getRootDOMNode: function getRootDOMNode() {
return _reactDom2['default'].findDOMNode(this);
},
focus: function focus() {
this.refs.dateInput.focus();
},
render: function render() {
var props = this.props;
var _state = this.state,
invalid = _state.invalid,
str = _state.str;
var locale = props.locale,
prefixCls = props.prefixCls,
placeholder = props.placeholder;
var invalidClass = invalid ? prefixCls + '-input-invalid' : '';
return _react2['default'].createElement(
'div',
{ className: prefixCls + '-input-wrap' },
_react2['default'].createElement(
'div',
{ className: prefixCls + '-date-input-wrap' },
_react2['default'].createElement('input', {
ref: 'dateInput',
className: prefixCls + '-input ' + invalidClass,
value: str,
disabled: props.disabled,
placeholder: placeholder,
onChange: this.onInputChange
})
),
props.showClear ? _react2['default'].createElement('a', {
className: prefixCls + '-clear-btn',
role: 'button',
title: locale.clear,
onClick: this.onClear
}) : null
);
}
});
exports['default'] = DateInput;
module.exports = exports['default'];
/***/ }),
/* 413 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _createReactClass = __webpack_require__(85);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _createChainedFunction = __webpack_require__(414);
var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
var _KeyCode = __webpack_require__(223);
var _KeyCode2 = _interopRequireDefault(_KeyCode);
var _placements = __webpack_require__(415);
var _placements2 = _interopRequireDefault(_placements);
var _rcTrigger = __webpack_require__(416);
var _rcTrigger2 = _interopRequireDefault(_rcTrigger);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function noop() {}
function refFn(field, component) {
this[field] = component;
}
var Picker = (0, _createReactClass2['default'])({
displayName: 'Picker',
propTypes: {
animation: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].string]),
disabled: _propTypes2['default'].bool,
transitionName: _propTypes2['default'].string,
onChange: _propTypes2['default'].func,
onOpenChange: _propTypes2['default'].func,
children: _propTypes2['default'].func,
getCalendarContainer: _propTypes2['default'].func,
calendar: _propTypes2['default'].element,
style: _propTypes2['default'].object,
open: _propTypes2['default'].bool,
defaultOpen: _propTypes2['default'].bool,
prefixCls: _propTypes2['default'].string,
placement: _propTypes2['default'].any,
value: _propTypes2['default'].oneOfType([_propTypes2['default'].object, _propTypes2['default'].array]),
defaultValue: _propTypes2['default'].oneOfType([_propTypes2['default'].object, _propTypes2['default'].array]),
align: _propTypes2['default'].object
},
getDefaultProps: function getDefaultProps() {
return {
prefixCls: 'rc-calendar-picker',
style: {},
align: {},
placement: 'bottomLeft',
defaultOpen: false,
onChange: noop,
onOpenChange: noop
};
},
getInitialState: function getInitialState() {
var props = this.props;
var open = void 0;
if ('open' in props) {
open = props.open;
} else {
open = props.defaultOpen;
}
var value = props.value || props.defaultValue;
this.saveCalendarRef = refFn.bind(this, 'calendarInstance');
return {
open: open,
value: value
};
},
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
var value = nextProps.value,
open = nextProps.open;
if ('value' in nextProps) {
this.setState({
value: value
});
}
if (open !== undefined) {
this.setState({
open: open
});
}
},
componentDidUpdate: function componentDidUpdate(_, prevState) {
if (!prevState.open && this.state.open) {
// setTimeout is for making sure saveCalendarRef happen before focusCalendar
this.focusTimeout = setTimeout(this.focusCalendar, 0, this);
}
},
componentWillUnmount: function componentWillUnmount() {
clearTimeout(this.focusTimeout);
},
onCalendarKeyDown: function onCalendarKeyDown(event) {
if (event.keyCode === _KeyCode2['default'].ESC) {
event.stopPropagation();
this.close(this.focus);
}
},
onCalendarSelect: function onCalendarSelect(value) {
var cause = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var props = this.props;
if (!('value' in props)) {
this.setState({
value: value
});
}
if (cause.source === 'keyboard' || !props.calendar.props.timePicker && cause.source !== 'dateInput' || cause.source === 'todayButton') {
this.close(this.focus);
}
props.onChange(value);
},
onKeyDown: function onKeyDown(event) {
if (event.keyCode === _KeyCode2['default'].DOWN && !this.state.open) {
this.open();
event.preventDefault();
}
},
onCalendarOk: function onCalendarOk() {
this.close(this.focus);
},
onCalendarClear: function onCalendarClear() {
this.close(this.focus);
},
onVisibleChange: function onVisibleChange(open) {
this.setOpen(open);
},
getCalendarElement: function getCalendarElement() {
var props = this.props;
var state = this.state;
var calendarProps = props.calendar.props;
var value = state.value;
var defaultValue = value;
var extraProps = {
ref: this.saveCalendarRef,
defaultValue: defaultValue || calendarProps.defaultValue,
selectedValue: value,
onKeyDown: this.onCalendarKeyDown,
onOk: (0, _createChainedFunction2['default'])(calendarProps.onOk, this.onCalendarOk),
onSelect: (0, _createChainedFunction2['default'])(calendarProps.onSelect, this.onCalendarSelect),
onClear: (0, _createChainedFunction2['default'])(calendarProps.onClear, this.onCalendarClear)
};
return _react2['default'].cloneElement(props.calendar, extraProps);
},
setOpen: function setOpen(open, callback) {
var onOpenChange = this.props.onOpenChange;
if (this.state.open !== open) {
if (!('open' in this.props)) {
this.setState({
open: open
}, callback);
}
onOpenChange(open);
}
},
open: function open(callback) {
this.setOpen(true, callback);
},
close: function close(callback) {
this.setOpen(false, callback);
},
focus: function focus() {
if (!this.state.open) {
_reactDom2['default'].findDOMNode(this).focus();
}
},
focusCalendar: function focusCalendar() {
if (this.state.open && this.calendarInstance !== null) {
this.calendarInstance.focus();
}
},
render: function render() {
var props = this.props;
var prefixCls = props.prefixCls,
placement = props.placement,
style = props.style,
getCalendarContainer = props.getCalendarContainer,
align = props.align,
animation = props.animation,
disabled = props.disabled,
transitionName = props.transitionName,
children = props.children;
var state = this.state;
return _react2['default'].createElement(
_rcTrigger2['default'],
{
popup: this.getCalendarElement(),
popupAlign: align,
builtinPlacements: _placements2['default'],
popupPlacement: placement,
action: disabled && !state.open ? [] : ['click'],
destroyPopupOnHide: true,
getPopupContainer: getCalendarContainer,
popupStyle: style,
popupAnimation: animation,
popupTransitionName: transitionName,
popupVisible: state.open,
onPopupVisibleChange: this.onVisibleChange,
prefixCls: prefixCls
},
_react2['default'].cloneElement(children(state, props), { onKeyDown: this.onKeyDown })
);
}
});
exports['default'] = Picker;
module.exports = exports['default'];
/***/ }),
/* 414 */
/***/ (function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = createChainedFunction;
/**
* Safe chained function
*
* Will only create a new function if needed,
* otherwise will pass back existing functions or null.
*
* @returns {function|null}
*/
function createChainedFunction() {
var args = [].slice.call(arguments, 0);
if (args.length === 1) {
return args[0];
}
return function chainedFunction() {
for (var i = 0; i < args.length; i++) {
if (args[i] && args[i].apply) {
args[i].apply(this, arguments);
}
}
};
}
module.exports = exports['default'];
/***/ }),
/* 415 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var autoAdjustOverflow = {
adjustX: 1,
adjustY: 1
};
var targetOffset = [0, 0];
var placements = {
bottomLeft: {
points: ['tl', 'tl'],
overflow: autoAdjustOverflow,
offset: [0, -3],
targetOffset: targetOffset
},
bottomRight: {
points: ['tr', 'tr'],
overflow: autoAdjustOverflow,
offset: [0, -3],
targetOffset: targetOffset
},
topRight: {
points: ['br', 'br'],
overflow: autoAdjustOverflow,
offset: [0, 3],
targetOffset: targetOffset
},
topLeft: {
points: ['bl', 'bl'],
overflow: autoAdjustOverflow,
offset: [0, 3],
targetOffset: targetOffset
}
};
exports['default'] = placements;
module.exports = exports['default'];
/***/ }),
/* 416 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends2 = __webpack_require__(216);
var _extends3 = _interopRequireDefault(_extends2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(12);
var _createReactClass = __webpack_require__(85);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _contains = __webpack_require__(417);
var _contains2 = _interopRequireDefault(_contains);
var _addEventListener = __webpack_require__(418);
var _addEventListener2 = _interopRequireDefault(_addEventListener);
var _Popup = __webpack_require__(419);
var _Popup2 = _interopRequireDefault(_Popup);
var _utils = __webpack_require__(432);
var _getContainerRenderMixin = __webpack_require__(433);
var _getContainerRenderMixin2 = _interopRequireDefault(_getContainerRenderMixin);
var _Portal = __webpack_require__(434);
var _Portal2 = _interopRequireDefault(_Portal);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function noop() {}
function returnEmptyString() {
return '';
}
function returnDocument() {
return window.document;
}
var ALL_HANDLERS = ['onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter', 'onMouseLeave', 'onFocus', 'onBlur', 'onContextMenu'];
var IS_REACT_16 = !!_reactDom.createPortal;
var mixins = [];
if (!IS_REACT_16) {
mixins.push((0, _getContainerRenderMixin2['default'])({
autoMount: false,
isVisible: function isVisible(instance) {
return instance.state.popupVisible;
},
isForceRender: function isForceRender(instance) {
return instance.props.forceRender;
},
getContainer: function getContainer(instance) {
return instance.getContainer();
}
}));
}
var Trigger = (0, _createReactClass2['default'])({
displayName: 'Trigger',
propTypes: {
children: _propTypes2['default'].any,
action: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].arrayOf(_propTypes2['default'].string)]),
showAction: _propTypes2['default'].any,
hideAction: _propTypes2['default'].any,
getPopupClassNameFromAlign: _propTypes2['default'].any,
onPopupVisibleChange: _propTypes2['default'].func,
afterPopupVisibleChange: _propTypes2['default'].func,
popup: _propTypes2['default'].oneOfType([_propTypes2['default'].node, _propTypes2['default'].func]).isRequired,
popupStyle: _propTypes2['default'].object,
prefixCls: _propTypes2['default'].string,
popupClassName: _propTypes2['default'].string,
popupPlacement: _propTypes2['default'].string,
builtinPlacements: _propTypes2['default'].object,
popupTransitionName: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].object]),
popupAnimation: _propTypes2['default'].any,
mouseEnterDelay: _propTypes2['default'].number,
mouseLeaveDelay: _propTypes2['default'].number,
zIndex: _propTypes2['default'].number,
focusDelay: _propTypes2['default'].number,
blurDelay: _propTypes2['default'].number,
getPopupContainer: _propTypes2['default'].func,
getDocument: _propTypes2['default'].func,
forceRender: _propTypes2['default'].bool,
destroyPopupOnHide: _propTypes2['default'].bool,
mask: _propTypes2['default'].bool,
maskClosable: _propTypes2['default'].bool,
onPopupAlign: _propTypes2['default'].func,
popupAlign: _propTypes2['default'].object,
popupVisible: _propTypes2['default'].bool,
maskTransitionName: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].object]),
maskAnimation: _propTypes2['default'].string
},
mixins: mixins,
getDefaultProps: function getDefaultProps() {
return {
prefixCls: 'rc-trigger-popup',
getPopupClassNameFromAlign: returnEmptyString,
getDocument: returnDocument,
onPopupVisibleChange: noop,
afterPopupVisibleChange: noop,
onPopupAlign: noop,
popupClassName: '',
mouseEnterDelay: 0,
mouseLeaveDelay: 0.1,
focusDelay: 0,
blurDelay: 0.15,
popupStyle: {},
destroyPopupOnHide: false,
popupAlign: {},
defaultPopupVisible: false,
mask: false,
maskClosable: true,
action: [],
showAction: [],
hideAction: []
};
},
getInitialState: function getInitialState() {
var props = this.props;
var popupVisible = void 0;
if ('popupVisible' in props) {
popupVisible = !!props.popupVisible;
} else {
popupVisible = !!props.defaultPopupVisible;
}
this.prevPopupVisible = popupVisible;
return {
popupVisible: popupVisible
};
},
componentWillMount: function componentWillMount() {
var _this = this;
ALL_HANDLERS.forEach(function (h) {
_this['fire' + h] = function (e) {
_this.fireEvents(h, e);
};
});
},
componentDidMount: function componentDidMount() {
this.componentDidUpdate({}, {
popupVisible: this.state.popupVisible
});
},
componentWillReceiveProps: function componentWillReceiveProps(_ref) {
var popupVisible = _ref.popupVisible;
if (popupVisible !== undefined) {
this.setState({
popupVisible: popupVisible
});
}
},
componentDidUpdate: function componentDidUpdate(_, prevState) {
var props = this.props;
var state = this.state;
var triggerAfterPopupVisibleChange = function triggerAfterPopupVisibleChange() {
if (prevState.popupVisible !== state.popupVisible) {
props.afterPopupVisibleChange(state.popupVisible);
}
};
if (!IS_REACT_16) {
this.renderComponent(null, triggerAfterPopupVisibleChange);
}
this.prevPopupVisible = prevState.popupVisible;
// We must listen to `mousedown` or `touchstart`, edge case:
// https://github.com/ant-design/ant-design/issues/5804
// https://github.com/react-component/calendar/issues/250
// https://github.com/react-component/trigger/issues/50
if (state.popupVisible) {
var currentDocument = void 0;
if (!this.clickOutsideHandler && (this.isClickToHide() || this.isContextMenuToShow())) {
currentDocument = props.getDocument();
this.clickOutsideHandler = (0, _addEventListener2['default'])(currentDocument, 'mousedown', this.onDocumentClick);
}
// always hide on mobile
if (!this.touchOutsideHandler) {
currentDocument = currentDocument || props.getDocument();
this.touchOutsideHandler = (0, _addEventListener2['default'])(currentDocument, 'touchstart', this.onDocumentClick);
}
// close popup when trigger type contains 'onContextMenu' and document is scrolling.
if (!this.contextMenuOutsideHandler1 && this.isContextMenuToShow()) {
currentDocument = currentDocument || props.getDocument();
this.contextMenuOutsideHandler1 = (0, _addEventListener2['default'])(currentDocument, 'scroll', this.onContextMenuClose);
}
// close popup when trigger type contains 'onContextMenu' and window is blur.
if (!this.contextMenuOutsideHandler2 && this.isContextMenuToShow()) {
this.contextMenuOutsideHandler2 = (0, _addEventListener2['default'])(window, 'blur', this.onContextMenuClose);
}
return;
}
this.clearOutsideHandler();
},
componentWillUnmount: function componentWillUnmount() {
this.clearDelayTimer();
this.clearOutsideHandler();
},
onMouseEnter: function onMouseEnter(e) {
this.fireEvents('onMouseEnter', e);
this.delaySetPopupVisible(true, this.props.mouseEnterDelay);
},
onMouseLeave: function onMouseLeave(e) {
this.fireEvents('onMouseLeave', e);
this.delaySetPopupVisible(false, this.props.mouseLeaveDelay);
},
onPopupMouseEnter: function onPopupMouseEnter() {
this.clearDelayTimer();
},
onPopupMouseLeave: function onPopupMouseLeave(e) {
// https://github.com/react-component/trigger/pull/13
// react bug?
if (e.relatedTarget && !e.relatedTarget.setTimeout && this._component && this._component.getPopupDomNode && (0, _contains2['default'])(this._component.getPopupDomNode(), e.relatedTarget)) {
return;
}
this.delaySetPopupVisible(false, this.props.mouseLeaveDelay);
},
onFocus: function onFocus(e) {
this.fireEvents('onFocus', e);
// incase focusin and focusout
this.clearDelayTimer();
if (this.isFocusToShow()) {
this.focusTime = Date.now();
this.delaySetPopupVisible(true, this.props.focusDelay);
}
},
onMouseDown: function onMouseDown(e) {
this.fireEvents('onMouseDown', e);
this.preClickTime = Date.now();
},
onTouchStart: function onTouchStart(e) {
this.fireEvents('onTouchStart', e);
this.preTouchTime = Date.now();
},
onBlur: function onBlur(e) {
this.fireEvents('onBlur', e);
this.clearDelayTimer();
if (this.isBlurToHide()) {
this.delaySetPopupVisible(false, this.props.blurDelay);
}
},
onContextMenu: function onContextMenu(e) {
e.preventDefault();
this.fireEvents('onContextMenu', e);
this.setPopupVisible(true);
},
onContextMenuClose: function onContextMenuClose() {
if (this.isContextMenuToShow()) {
this.close();
}
},
onClick: function onClick(event) {
this.fireEvents('onClick', event);
// focus will trigger click
if (this.focusTime) {
var preTime = void 0;
if (this.preClickTime && this.preTouchTime) {
preTime = Math.min(this.preClickTime, this.preTouchTime);
} else if (this.preClickTime) {
preTime = this.preClickTime;
} else if (this.preTouchTime) {
preTime = this.preTouchTime;
}
if (Math.abs(preTime - this.focusTime) < 20) {
return;
}
this.focusTime = 0;
}
this.preClickTime = 0;
this.preTouchTime = 0;
event.preventDefault();
var nextVisible = !this.state.popupVisible;
if (this.isClickToHide() && !nextVisible || nextVisible && this.isClickToShow()) {
this.setPopupVisible(!this.state.popupVisible);
}
},
onDocumentClick: function onDocumentClick(event) {
if (this.props.mask && !this.props.maskClosable) {
return;
}
var target = event.target;
var root = (0, _reactDom.findDOMNode)(this);
var popupNode = this.getPopupDomNode();
if (!(0, _contains2['default'])(root, target) && !(0, _contains2['default'])(popupNode, target)) {
this.close();
}
},
handlePortalUpdate: function handlePortalUpdate() {
if (this.prevPopupVisible !== this.state.popupVisible) {
this.props.afterPopupVisibleChange(this.state.popupVisible);
}
},
getPopupDomNode: function getPopupDomNode() {
// for test
if (this._component && this._component.getPopupDomNode) {
return this._component.getPopupDomNode();
}
return null;
},
getRootDomNode: function getRootDomNode() {
return (0, _reactDom.findDOMNode)(this);
},
getPopupClassNameFromAlign: function getPopupClassNameFromAlign(align) {
var className = [];
var props = this.props;
var popupPlacement = props.popupPlacement,
builtinPlacements = props.builtinPlacements,
prefixCls = props.prefixCls;
if (popupPlacement && builtinPlacements) {
className.push((0, _utils.getPopupClassNameFromAlign)(builtinPlacements, prefixCls, align));
}
if (props.getPopupClassNameFromAlign) {
className.push(props.getPopupClassNameFromAlign(align));
}
return className.join(' ');
},
getPopupAlign: function getPopupAlign() {
var props = this.props;
var popupPlacement = props.popupPlacement,
popupAlign = props.popupAlign,
builtinPlacements = props.builtinPlacements;
if (popupPlacement && builtinPlacements) {
return (0, _utils.getAlignFromPlacement)(builtinPlacements, popupPlacement, popupAlign);
}
return popupAlign;
},
getComponent: function getComponent() {
var props = this.props,
state = this.state;
var mouseProps = {};
if (this.isMouseEnterToShow()) {
mouseProps.onMouseEnter = this.onPopupMouseEnter;
}
if (this.isMouseLeaveToHide()) {
mouseProps.onMouseLeave = this.onPopupMouseLeave;
}
return _react2['default'].createElement(
_Popup2['default'],
(0, _extends3['default'])({
prefixCls: props.prefixCls,
destroyPopupOnHide: props.destroyPopupOnHide,
visible: state.popupVisible,
className: props.popupClassName,
action: props.action,
align: this.getPopupAlign(),
onAlign: props.onPopupAlign,
animation: props.popupAnimation,
getClassNameFromAlign: this.getPopupClassNameFromAlign
}, mouseProps, {
getRootDomNode: this.getRootDomNode,
style: props.popupStyle,
mask: props.mask,
zIndex: props.zIndex,
transitionName: props.popupTransitionName,
maskAnimation: props.maskAnimation,
maskTransitionName: props.maskTransitionName,
ref: this.savePopup
}),
typeof props.popup === 'function' ? props.popup() : props.popup
);
},
getContainer: function getContainer() {
var props = this.props;
var popupContainer = document.createElement('div');
// Make sure default popup container will never cause scrollbar appearing
// https://github.com/react-component/trigger/issues/41
popupContainer.style.position = 'absolute';
popupContainer.style.top = '0';
popupContainer.style.left = '0';
popupContainer.style.width = '100%';
var mountNode = props.getPopupContainer ? props.getPopupContainer((0, _reactDom.findDOMNode)(this)) : props.getDocument().body;
mountNode.appendChild(popupContainer);
return popupContainer;
},
setPopupVisible: function setPopupVisible(popupVisible) {
this.clearDelayTimer();
if (this.state.popupVisible !== popupVisible) {
if (!('popupVisible' in this.props)) {
this.setState({
popupVisible: popupVisible
});
}
this.props.onPopupVisibleChange(popupVisible);
}
},
delaySetPopupVisible: function delaySetPopupVisible(visible, delayS) {
var _this2 = this;
var delay = delayS * 1000;
this.clearDelayTimer();
if (delay) {
this.delayTimer = setTimeout(function () {
_this2.setPopupVisible(visible);
_this2.clearDelayTimer();
}, delay);
} else {
this.setPopupVisible(visible);
}
},
clearDelayTimer: function clearDelayTimer() {
if (this.delayTimer) {
clearTimeout(this.delayTimer);
this.delayTimer = null;
}
},
clearOutsideHandler: function clearOutsideHandler() {
if (this.clickOutsideHandler) {
this.clickOutsideHandler.remove();
this.clickOutsideHandler = null;
}
if (this.contextMenuOutsideHandler1) {
this.contextMenuOutsideHandler1.remove();
this.contextMenuOutsideHandler1 = null;
}
if (this.contextMenuOutsideHandler2) {
this.contextMenuOutsideHandler2.remove();
this.contextMenuOutsideHandler2 = null;
}
if (this.touchOutsideHandler) {
this.touchOutsideHandler.remove();
this.touchOutsideHandler = null;
}
},
createTwoChains: function createTwoChains(event) {
var childPros = this.props.children.props;
var props = this.props;
if (childPros[event] && props[event]) {
return this['fire' + event];
}
return childPros[event] || props[event];
},
isClickToShow: function isClickToShow() {
var _props = this.props,
action = _props.action,
showAction = _props.showAction;
return action.indexOf('click') !== -1 || showAction.indexOf('click') !== -1;
},
isContextMenuToShow: function isContextMenuToShow() {
var _props2 = this.props,
action = _props2.action,
showAction = _props2.showAction;
return action.indexOf('contextMenu') !== -1 || showAction.indexOf('contextMenu') !== -1;
},
isClickToHide: function isClickToHide() {
var _props3 = this.props,
action = _props3.action,
hideAction = _props3.hideAction;
return action.indexOf('click') !== -1 || hideAction.indexOf('click') !== -1;
},
isMouseEnterToShow: function isMouseEnterToShow() {
var _props4 = this.props,
action = _props4.action,
showAction = _props4.showAction;
return action.indexOf('hover') !== -1 || showAction.indexOf('mouseEnter') !== -1;
},
isMouseLeaveToHide: function isMouseLeaveToHide() {
var _props5 = this.props,
action = _props5.action,
hideAction = _props5.hideAction;
return action.indexOf('hover') !== -1 || hideAction.indexOf('mouseLeave') !== -1;
},
isFocusToShow: function isFocusToShow() {
var _props6 = this.props,
action = _props6.action,
showAction = _props6.showAction;
return action.indexOf('focus') !== -1 || showAction.indexOf('focus') !== -1;
},
isBlurToHide: function isBlurToHide() {
var _props7 = this.props,
action = _props7.action,
hideAction = _props7.hideAction;
return action.indexOf('focus') !== -1 || hideAction.indexOf('blur') !== -1;
},
forcePopupAlign: function forcePopupAlign() {
if (this.state.popupVisible && this._component && this._component.alignInstance) {
this._component.alignInstance.forceAlign();
}
},
fireEvents: function fireEvents(type, e) {
var childCallback = this.props.children.props[type];
if (childCallback) {
childCallback(e);
}
var callback = this.props[type];
if (callback) {
callback(e);
}
},
close: function close() {
this.setPopupVisible(false);
},
savePopup: function savePopup(node) {
if (IS_REACT_16) {
this._component = node;
}
},
render: function render() {
var popupVisible = this.state.popupVisible;
var props = this.props;
var children = props.children;
var child = _react2['default'].Children.only(children);
var newChildProps = { key: 'trigger' };
if (this.isContextMenuToShow()) {
newChildProps.onContextMenu = this.onContextMenu;
} else {
newChildProps.onContextMenu = this.createTwoChains('onContextMenu');
}
if (this.isClickToHide() || this.isClickToShow()) {
newChildProps.onClick = this.onClick;
newChildProps.onMouseDown = this.onMouseDown;
newChildProps.onTouchStart = this.onTouchStart;
} else {
newChildProps.onClick = this.createTwoChains('onClick');
newChildProps.onMouseDown = this.createTwoChains('onMouseDown');
newChildProps.onTouchStart = this.createTwoChains('onTouchStart');
}
if (this.isMouseEnterToShow()) {
newChildProps.onMouseEnter = this.onMouseEnter;
} else {
newChildProps.onMouseEnter = this.createTwoChains('onMouseEnter');
}
if (this.isMouseLeaveToHide()) {
newChildProps.onMouseLeave = this.onMouseLeave;
} else {
newChildProps.onMouseLeave = this.createTwoChains('onMouseLeave');
}
if (this.isFocusToShow() || this.isBlurToHide()) {
newChildProps.onFocus = this.onFocus;
newChildProps.onBlur = this.onBlur;
} else {
newChildProps.onFocus = this.createTwoChains('onFocus');
newChildProps.onBlur = this.createTwoChains('onBlur');
}
var trigger = _react2['default'].cloneElement(child, newChildProps);
if (!IS_REACT_16) {
return trigger;
}
var portal = void 0;
// prevent unmounting after it's rendered
if (popupVisible || this._component || props.forceRender) {
portal = _react2['default'].createElement(
_Portal2['default'],
{
key: 'portal',
getContainer: this.getContainer,
didUpdate: this.handlePortalUpdate
},
this.getComponent()
);
}
return [trigger, portal];
}
});
exports['default'] = Trigger;
module.exports = exports['default'];
/***/ }),
/* 417 */
/***/ (function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = contains;
function contains(root, n) {
var node = n;
while (node) {
if (node === root) {
return true;
}
node = node.parentNode;
}
return false;
}
module.exports = exports['default'];
/***/ }),
/* 418 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = addEventListenerWrap;
var _addDomEventListener = __webpack_require__(75);
var _addDomEventListener2 = _interopRequireDefault(_addDomEventListener);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function addEventListenerWrap(target, eventType, cb) {
/* eslint camelcase: 2 */
var callback = _reactDom2['default'].unstable_batchedUpdates ? function run(e) {
_reactDom2['default'].unstable_batchedUpdates(cb, e);
} : cb;
return (0, _addDomEventListener2['default'])(target, eventType, callback);
}
module.exports = exports['default'];
/***/ }),
/* 419 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends2 = __webpack_require__(216);
var _extends3 = _interopRequireDefault(_extends2);
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _rcAlign = __webpack_require__(420);
var _rcAlign2 = _interopRequireDefault(_rcAlign);
var _rcAnimate = __webpack_require__(423);
var _rcAnimate2 = _interopRequireDefault(_rcAnimate);
var _PopupInner = __webpack_require__(429);
var _PopupInner2 = _interopRequireDefault(_PopupInner);
var _LazyRenderBox = __webpack_require__(430);
var _LazyRenderBox2 = _interopRequireDefault(_LazyRenderBox);
var _utils = __webpack_require__(432);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var Popup = function (_Component) {
(0, _inherits3['default'])(Popup, _Component);
function Popup(props) {
(0, _classCallCheck3['default'])(this, Popup);
var _this = (0, _possibleConstructorReturn3['default'])(this, _Component.call(this, props));
_initialiseProps.call(_this);
_this.savePopupRef = _utils.saveRef.bind(_this, 'popupInstance');
_this.saveAlignRef = _utils.saveRef.bind(_this, 'alignInstance');
return _this;
}
Popup.prototype.componentDidMount = function componentDidMount() {
this.rootNode = this.getPopupDomNode();
};
Popup.prototype.getPopupDomNode = function getPopupDomNode() {
return _reactDom2['default'].findDOMNode(this.popupInstance);
};
Popup.prototype.getMaskTransitionName = function getMaskTransitionName() {
var props = this.props;
var transitionName = props.maskTransitionName;
var animation = props.maskAnimation;
if (!transitionName && animation) {
transitionName = props.prefixCls + '-' + animation;
}
return transitionName;
};
Popup.prototype.getTransitionName = function getTransitionName() {
var props = this.props;
var transitionName = props.transitionName;
if (!transitionName && props.animation) {
transitionName = props.prefixCls + '-' + props.animation;
}
return transitionName;
};
Popup.prototype.getClassName = function getClassName(currentAlignClassName) {
return this.props.prefixCls + ' ' + this.props.className + ' ' + currentAlignClassName;
};
Popup.prototype.getPopupElement = function getPopupElement() {
var savePopupRef = this.savePopupRef,
props = this.props;
var align = props.align,
style = props.style,
visible = props.visible,
prefixCls = props.prefixCls,
destroyPopupOnHide = props.destroyPopupOnHide;
var className = this.getClassName(this.currentAlignClassName || props.getClassNameFromAlign(align));
var hiddenClassName = prefixCls + '-hidden';
if (!visible) {
this.currentAlignClassName = null;
}
var newStyle = (0, _extends3['default'])({}, style, this.getZIndexStyle());
var popupInnerProps = {
className: className,
prefixCls: prefixCls,
ref: savePopupRef,
onMouseEnter: props.onMouseEnter,
onMouseLeave: props.onMouseLeave,
style: newStyle
};
if (destroyPopupOnHide) {
return _react2['default'].createElement(
_rcAnimate2['default'],
{
component: '',
exclusive: true,
transitionAppear: true,
transitionName: this.getTransitionName()
},
visible ? _react2['default'].createElement(
_rcAlign2['default'],
{
target: this.getTarget,
key: 'popup',
ref: this.saveAlignRef,
monitorWindowResize: true,
align: align,
onAlign: this.onAlign
},
_react2['default'].createElement(
_PopupInner2['default'],
(0, _extends3['default'])({
visible: true
}, popupInnerProps),
props.children
)
) : null
);
}
return _react2['default'].createElement(
_rcAnimate2['default'],
{
component: '',
exclusive: true,
transitionAppear: true,
transitionName: this.getTransitionName(),
showProp: 'xVisible'
},
_react2['default'].createElement(
_rcAlign2['default'],
{
target: this.getTarget,
key: 'popup',
ref: this.saveAlignRef,
monitorWindowResize: true,
xVisible: visible,
childrenProps: { visible: 'xVisible' },
disabled: !visible,
align: align,
onAlign: this.onAlign
},
_react2['default'].createElement(
_PopupInner2['default'],
(0, _extends3['default'])({
hiddenClassName: hiddenClassName
}, popupInnerProps),
props.children
)
)
);
};
Popup.prototype.getZIndexStyle = function getZIndexStyle() {
var style = {};
var props = this.props;
if (props.zIndex !== undefined) {
style.zIndex = props.zIndex;
}
return style;
};
Popup.prototype.getMaskElement = function getMaskElement() {
var props = this.props;
var maskElement = void 0;
if (props.mask) {
var maskTransition = this.getMaskTransitionName();
maskElement = _react2['default'].createElement(_LazyRenderBox2['default'], {
style: this.getZIndexStyle(),
key: 'mask',
className: props.prefixCls + '-mask',
hiddenClassName: props.prefixCls + '-mask-hidden',
visible: props.visible
});
if (maskTransition) {
maskElement = _react2['default'].createElement(
_rcAnimate2['default'],
{
key: 'mask',
showProp: 'visible',
transitionAppear: true,
component: '',
transitionName: maskTransition
},
maskElement
);
}
}
return maskElement;
};
Popup.prototype.render = function render() {
return _react2['default'].createElement(
'div',
null,
this.getMaskElement(),
this.getPopupElement()
);
};
return Popup;
}(_react.Component);
Popup.propTypes = {
visible: _propTypes2['default'].bool,
style: _propTypes2['default'].object,
getClassNameFromAlign: _propTypes2['default'].func,
onAlign: _propTypes2['default'].func,
getRootDomNode: _propTypes2['default'].func,
onMouseEnter: _propTypes2['default'].func,
align: _propTypes2['default'].any,
destroyPopupOnHide: _propTypes2['default'].bool,
className: _propTypes2['default'].string,
prefixCls: _propTypes2['default'].string,
onMouseLeave: _propTypes2['default'].func
};
var _initialiseProps = function _initialiseProps() {
var _this2 = this;
this.onAlign = function (popupDomNode, align) {
var props = _this2.props;
var currentAlignClassName = props.getClassNameFromAlign(align);
// FIX: https://github.com/react-component/trigger/issues/56
// FIX: https://github.com/react-component/tooltip/issues/79
if (_this2.currentAlignClassName !== currentAlignClassName) {
_this2.currentAlignClassName = currentAlignClassName;
popupDomNode.className = _this2.getClassName(currentAlignClassName);
}
props.onAlign(popupDomNode, align);
};
this.getTarget = function () {
return _this2.props.getRootDomNode();
};
};
exports['default'] = Popup;
module.exports = exports['default'];
/***/ }),
/* 420 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _Align = __webpack_require__(421);
var _Align2 = _interopRequireDefault(_Align);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
exports['default'] = _Align2['default']; // export this package's api
module.exports = exports['default'];
/***/ }),
/* 421 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _domAlign = __webpack_require__(91);
var _domAlign2 = _interopRequireDefault(_domAlign);
var _addEventListener = __webpack_require__(418);
var _addEventListener2 = _interopRequireDefault(_addEventListener);
var _isWindow = __webpack_require__(422);
var _isWindow2 = _interopRequireDefault(_isWindow);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function buffer(fn, ms) {
var timer = void 0;
function clear() {
if (timer) {
clearTimeout(timer);
timer = null;
}
}
function bufferFn() {
clear();
timer = setTimeout(fn, ms);
}
bufferFn.clear = clear;
return bufferFn;
}
var Align = function (_Component) {
(0, _inherits3['default'])(Align, _Component);
function Align() {
var _temp, _this, _ret;
(0, _classCallCheck3['default'])(this, Align);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.forceAlign = function () {
var props = _this.props;
if (!props.disabled) {
var source = _reactDom2['default'].findDOMNode(_this);
props.onAlign(source, (0, _domAlign2['default'])(source, props.target(), props.align));
}
}, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
}
Align.prototype.componentDidMount = function componentDidMount() {
var props = this.props;
// if parent ref not attached .... use document.getElementById
this.forceAlign();
if (!props.disabled && props.monitorWindowResize) {
this.startMonitorWindowResize();
}
};
Align.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
var reAlign = false;
var props = this.props;
if (!props.disabled) {
if (prevProps.disabled || prevProps.align !== props.align) {
reAlign = true;
} else {
var lastTarget = prevProps.target();
var currentTarget = props.target();
if ((0, _isWindow2['default'])(lastTarget) && (0, _isWindow2['default'])(currentTarget)) {
reAlign = false;
} else if (lastTarget !== currentTarget) {
reAlign = true;
}
}
}
if (reAlign) {
this.forceAlign();
}
if (props.monitorWindowResize && !props.disabled) {
this.startMonitorWindowResize();
} else {
this.stopMonitorWindowResize();
}
};
Align.prototype.componentWillUnmount = function componentWillUnmount() {
this.stopMonitorWindowResize();
};
Align.prototype.startMonitorWindowResize = function startMonitorWindowResize() {
if (!this.resizeHandler) {
this.bufferMonitor = buffer(this.forceAlign, this.props.monitorBufferTime);
this.resizeHandler = (0, _addEventListener2['default'])(window, 'resize', this.bufferMonitor);
}
};
Align.prototype.stopMonitorWindowResize = function stopMonitorWindowResize() {
if (this.resizeHandler) {
this.bufferMonitor.clear();
this.resizeHandler.remove();
this.resizeHandler = null;
}
};
Align.prototype.render = function render() {
var _props = this.props,
childrenProps = _props.childrenProps,
children = _props.children;
var child = _react2['default'].Children.only(children);
if (childrenProps) {
var newProps = {};
for (var prop in childrenProps) {
if (childrenProps.hasOwnProperty(prop)) {
newProps[prop] = this.props[childrenProps[prop]];
}
}
return _react2['default'].cloneElement(child, newProps);
}
return child;
};
return Align;
}(_react.Component);
Align.propTypes = {
childrenProps: _propTypes2['default'].object,
align: _propTypes2['default'].object.isRequired,
target: _propTypes2['default'].func,
onAlign: _propTypes2['default'].func,
monitorBufferTime: _propTypes2['default'].number,
monitorWindowResize: _propTypes2['default'].bool,
disabled: _propTypes2['default'].bool,
children: _propTypes2['default'].any
};
Align.defaultProps = {
target: function target() {
return window;
},
onAlign: function onAlign() {},
monitorBufferTime: 50,
monitorWindowResize: false,
disabled: false
};
exports['default'] = Align;
module.exports = exports['default'];
/***/ }),
/* 422 */
/***/ (function(module, exports) {
"use strict";
exports.__esModule = true;
exports["default"] = isWindow;
function isWindow(obj) {
/* eslint no-eq-null: 0 */
/* eslint eqeqeq: 0 */
return obj != null && obj == obj.window;
}
module.exports = exports['default'];
/***/ }),
/* 423 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = __webpack_require__(216);
var _extends3 = _interopRequireDefault(_extends2);
var _defineProperty2 = __webpack_require__(397);
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(226);
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _ChildrenUtils = __webpack_require__(424);
var _AnimateChild = __webpack_require__(425);
var _AnimateChild2 = _interopRequireDefault(_AnimateChild);
var _util = __webpack_require__(428);
var _util2 = _interopRequireDefault(_util);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var defaultKey = 'rc_animate_' + Date.now();
function getChildrenFromProps(props) {
var children = props.children;
if (_react2['default'].isValidElement(children)) {
if (!children.key) {
return _react2['default'].cloneElement(children, {
key: defaultKey
});
}
}
return children;
}
function noop() {}
var Animate = function (_React$Component) {
(0, _inherits3['default'])(Animate, _React$Component);
// eslint-disable-line
function Animate(props) {
(0, _classCallCheck3['default'])(this, Animate);
var _this = (0, _possibleConstructorReturn3['default'])(this, (Animate.__proto__ || Object.getPrototypeOf(Animate)).call(this, props));
_initialiseProps.call(_this);
_this.currentlyAnimatingKeys = {};
_this.keysToEnter = [];
_this.keysToLeave = [];
_this.state = {
children: (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props))
};
_this.childrenRefs = {};
return _this;
}
(0, _createClass3['default'])(Animate, [{
key: 'componentDidMount',
value: function componentDidMount() {
var _this2 = this;
var showProp = this.props.showProp;
var children = this.state.children;
if (showProp) {
children = children.filter(function (child) {
return !!child.props[showProp];
});
}
children.forEach(function (child) {
if (child) {
_this2.performAppear(child.key);
}
});
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
var _this3 = this;
this.nextProps = nextProps;
var nextChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(nextProps));
var props = this.props;
// exclusive needs immediate response
if (props.exclusive) {
Object.keys(this.currentlyAnimatingKeys).forEach(function (key) {
_this3.stop(key);
});
}
var showProp = props.showProp;
var currentlyAnimatingKeys = this.currentlyAnimatingKeys;
// last props children if exclusive
var currentChildren = props.exclusive ? (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props)) : this.state.children;
// in case destroy in showProp mode
var newChildren = [];
if (showProp) {
currentChildren.forEach(function (currentChild) {
var nextChild = currentChild && (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, currentChild.key);
var newChild = void 0;
if ((!nextChild || !nextChild.props[showProp]) && currentChild.props[showProp]) {
newChild = _react2['default'].cloneElement(nextChild || currentChild, (0, _defineProperty3['default'])({}, showProp, true));
} else {
newChild = nextChild;
}
if (newChild) {
newChildren.push(newChild);
}
});
nextChildren.forEach(function (nextChild) {
if (!nextChild || !(0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, nextChild.key)) {
newChildren.push(nextChild);
}
});
} else {
newChildren = (0, _ChildrenUtils.mergeChildren)(currentChildren, nextChildren);
}
// need render to avoid update
this.setState({
children: newChildren
});
nextChildren.forEach(function (child) {
var key = child && child.key;
if (child && currentlyAnimatingKeys[key]) {
return;
}
var hasPrev = child && (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key);
if (showProp) {
var showInNext = child.props[showProp];
if (hasPrev) {
var showInNow = (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp);
if (!showInNow && showInNext) {
_this3.keysToEnter.push(key);
}
} else if (showInNext) {
_this3.keysToEnter.push(key);
}
} else if (!hasPrev) {
_this3.keysToEnter.push(key);
}
});
currentChildren.forEach(function (child) {
var key = child && child.key;
if (child && currentlyAnimatingKeys[key]) {
return;
}
var hasNext = child && (0, _ChildrenUtils.findChildInChildrenByKey)(nextChildren, key);
if (showProp) {
var showInNow = child.props[showProp];
if (hasNext) {
var showInNext = (0, _ChildrenUtils.findShownChildInChildrenByKey)(nextChildren, key, showProp);
if (!showInNext && showInNow) {
_this3.keysToLeave.push(key);
}
} else if (showInNow) {
_this3.keysToLeave.push(key);
}
} else if (!hasNext) {
_this3.keysToLeave.push(key);
}
});
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {
var keysToEnter = this.keysToEnter;
this.keysToEnter = [];
keysToEnter.forEach(this.performEnter);
var keysToLeave = this.keysToLeave;
this.keysToLeave = [];
keysToLeave.forEach(this.performLeave);
}
}, {
key: 'isValidChildByKey',
value: function isValidChildByKey(currentChildren, key) {
var showProp = this.props.showProp;
if (showProp) {
return (0, _ChildrenUtils.findShownChildInChildrenByKey)(currentChildren, key, showProp);
}
return (0, _ChildrenUtils.findChildInChildrenByKey)(currentChildren, key);
}
}, {
key: 'stop',
value: function stop(key) {
delete this.currentlyAnimatingKeys[key];
var component = this.childrenRefs[key];
if (component) {
component.stop();
}
}
}, {
key: 'render',
value: function render() {
var _this4 = this;
var props = this.props;
this.nextProps = props;
var stateChildren = this.state.children;
var children = null;
if (stateChildren) {
children = stateChildren.map(function (child) {
if (child === null || child === undefined) {
return child;
}
if (!child.key) {
throw new Error('must set key for children');
}
return _react2['default'].createElement(
_AnimateChild2['default'],
{
key: child.key,
ref: function ref(node) {
return _this4.childrenRefs[child.key] = node;
},
animation: props.animation,
transitionName: props.transitionName,
transitionEnter: props.transitionEnter,
transitionAppear: props.transitionAppear,
transitionLeave: props.transitionLeave
},
child
);
});
}
var Component = props.component;
if (Component) {
var passedProps = props;
if (typeof Component === 'string') {
passedProps = (0, _extends3['default'])({
className: props.className,
style: props.style
}, props.componentProps);
}
return _react2['default'].createElement(
Component,
passedProps,
children
);
}
return children[0] || null;
}
}]);
return Animate;
}(_react2['default'].Component);
Animate.isAnimate = true;
Animate.propTypes = {
component: _propTypes2['default'].any,
componentProps: _propTypes2['default'].object,
animation: _propTypes2['default'].object,
transitionName: _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].object]),
transitionEnter: _propTypes2['default'].bool,
transitionAppear: _propTypes2['default'].bool,
exclusive: _propTypes2['default'].bool,
transitionLeave: _propTypes2['default'].bool,
onEnd: _propTypes2['default'].func,
onEnter: _propTypes2['default'].func,
onLeave: _propTypes2['default'].func,
onAppear: _propTypes2['default'].func,
showProp: _propTypes2['default'].string
};
Animate.defaultProps = {
animation: {},
component: 'span',
componentProps: {},
transitionEnter: true,
transitionLeave: true,
transitionAppear: false,
onEnd: noop,
onEnter: noop,
onLeave: noop,
onAppear: noop
};
var _initialiseProps = function _initialiseProps() {
var _this5 = this;
this.performEnter = function (key) {
// may already remove by exclusive
if (_this5.childrenRefs[key]) {
_this5.currentlyAnimatingKeys[key] = true;
_this5.childrenRefs[key].componentWillEnter(_this5.handleDoneAdding.bind(_this5, key, 'enter'));
}
};
this.performAppear = function (key) {
if (_this5.childrenRefs[key]) {
_this5.currentlyAnimatingKeys[key] = true;
_this5.childrenRefs[key].componentWillAppear(_this5.handleDoneAdding.bind(_this5, key, 'appear'));
}
};
this.handleDoneAdding = function (key, type) {
var props = _this5.props;
delete _this5.currentlyAnimatingKeys[key];
// if update on exclusive mode, skip check
if (props.exclusive && props !== _this5.nextProps) {
return;
}
var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props));
if (!_this5.isValidChildByKey(currentChildren, key)) {
// exclusive will not need this
_this5.performLeave(key);
} else {
if (type === 'appear') {
if (_util2['default'].allowAppearCallback(props)) {
props.onAppear(key);
props.onEnd(key, true);
}
} else {
if (_util2['default'].allowEnterCallback(props)) {
props.onEnter(key);
props.onEnd(key, true);
}
}
}
};
this.performLeave = function (key) {
// may already remove by exclusive
if (_this5.childrenRefs[key]) {
_this5.currentlyAnimatingKeys[key] = true;
_this5.childrenRefs[key].componentWillLeave(_this5.handleDoneLeaving.bind(_this5, key));
}
};
this.handleDoneLeaving = function (key) {
var props = _this5.props;
delete _this5.currentlyAnimatingKeys[key];
// if update on exclusive mode, skip check
if (props.exclusive && props !== _this5.nextProps) {
return;
}
var currentChildren = (0, _ChildrenUtils.toArrayChildren)(getChildrenFromProps(props));
// in case state change is too fast
if (_this5.isValidChildByKey(currentChildren, key)) {
_this5.performEnter(key);
} else {
var end = function end() {
if (_util2['default'].allowLeaveCallback(props)) {
props.onLeave(key);
props.onEnd(key, false);
}
};
if (!(0, _ChildrenUtils.isSameChildren)(_this5.state.children, currentChildren, props.showProp)) {
_this5.setState({
children: currentChildren
}, end);
} else {
end();
}
}
};
};
exports['default'] = Animate;
module.exports = exports['default'];
/***/ }),
/* 424 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.toArrayChildren = toArrayChildren;
exports.findChildInChildrenByKey = findChildInChildrenByKey;
exports.findShownChildInChildrenByKey = findShownChildInChildrenByKey;
exports.findHiddenChildInChildrenByKey = findHiddenChildInChildrenByKey;
exports.isSameChildren = isSameChildren;
exports.mergeChildren = mergeChildren;
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function toArrayChildren(children) {
var ret = [];
_react2['default'].Children.forEach(children, function (child) {
ret.push(child);
});
return ret;
}
function findChildInChildrenByKey(children, key) {
var ret = null;
if (children) {
children.forEach(function (child) {
if (ret) {
return;
}
if (child && child.key === key) {
ret = child;
}
});
}
return ret;
}
function findShownChildInChildrenByKey(children, key, showProp) {
var ret = null;
if (children) {
children.forEach(function (child) {
if (child && child.key === key && child.props[showProp]) {
if (ret) {
throw new Error('two child with same key for children');
}
ret = child;
}
});
}
return ret;
}
function findHiddenChildInChildrenByKey(children, key, showProp) {
var found = 0;
if (children) {
children.forEach(function (child) {
if (found) {
return;
}
found = child && child.key === key && !child.props[showProp];
});
}
return found;
}
function isSameChildren(c1, c2, showProp) {
var same = c1.length === c2.length;
if (same) {
c1.forEach(function (child, index) {
var child2 = c2[index];
if (child && child2) {
if (child && !child2 || !child && child2) {
same = false;
} else if (child.key !== child2.key) {
same = false;
} else if (showProp && child.props[showProp] !== child2.props[showProp]) {
same = false;
}
}
});
}
return same;
}
function mergeChildren(prev, next) {
var ret = [];
// For each key of `next`, the list of keys to insert before that key in
// the combined list
var nextChildrenPending = {};
var pendingChildren = [];
prev.forEach(function (child) {
if (child && findChildInChildrenByKey(next, child.key)) {
if (pendingChildren.length) {
nextChildrenPending[child.key] = pendingChildren;
pendingChildren = [];
}
} else {
pendingChildren.push(child);
}
});
next.forEach(function (child) {
if (child && nextChildrenPending.hasOwnProperty(child.key)) {
ret = ret.concat(nextChildrenPending[child.key]);
}
ret.push(child);
});
ret = ret.concat(pendingChildren);
return ret;
}
/***/ }),
/* 425 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof2 = __webpack_require__(231);
var _typeof3 = _interopRequireDefault(_typeof2);
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(226);
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _cssAnimation = __webpack_require__(426);
var _cssAnimation2 = _interopRequireDefault(_cssAnimation);
var _util = __webpack_require__(428);
var _util2 = _interopRequireDefault(_util);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var transitionMap = {
enter: 'transitionEnter',
appear: 'transitionAppear',
leave: 'transitionLeave'
};
var AnimateChild = function (_React$Component) {
(0, _inherits3['default'])(AnimateChild, _React$Component);
function AnimateChild() {
(0, _classCallCheck3['default'])(this, AnimateChild);
return (0, _possibleConstructorReturn3['default'])(this, (AnimateChild.__proto__ || Object.getPrototypeOf(AnimateChild)).apply(this, arguments));
}
(0, _createClass3['default'])(AnimateChild, [{
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.stop();
}
}, {
key: 'componentWillEnter',
value: function componentWillEnter(done) {
if (_util2['default'].isEnterSupported(this.props)) {
this.transition('enter', done);
} else {
done();
}
}
}, {
key: 'componentWillAppear',
value: function componentWillAppear(done) {
if (_util2['default'].isAppearSupported(this.props)) {
this.transition('appear', done);
} else {
done();
}
}
}, {
key: 'componentWillLeave',
value: function componentWillLeave(done) {
if (_util2['default'].isLeaveSupported(this.props)) {
this.transition('leave', done);
} else {
// always sync, do not interupt with react component life cycle
// update hidden -> animate hidden ->
// didUpdate -> animate leave -> unmount (if animate is none)
done();
}
}
}, {
key: 'transition',
value: function transition(animationType, finishCallback) {
var _this2 = this;
var node = _reactDom2['default'].findDOMNode(this);
var props = this.props;
var transitionName = props.transitionName;
var nameIsObj = (typeof transitionName === 'undefined' ? 'undefined' : (0, _typeof3['default'])(transitionName)) === 'object';
this.stop();
var end = function end() {
_this2.stopper = null;
finishCallback();
};
if ((_cssAnimation.isCssAnimationSupported || !props.animation[animationType]) && transitionName && props[transitionMap[animationType]]) {
var name = nameIsObj ? transitionName[animationType] : transitionName + '-' + animationType;
var activeName = name + '-active';
if (nameIsObj && transitionName[animationType + 'Active']) {
activeName = transitionName[animationType + 'Active'];
}
this.stopper = (0, _cssAnimation2['default'])(node, {
name: name,
active: activeName
}, end);
} else {
this.stopper = props.animation[animationType](node, end);
}
}
}, {
key: 'stop',
value: function stop() {
var stopper = this.stopper;
if (stopper) {
this.stopper = null;
stopper.stop();
}
}
}, {
key: 'render',
value: function render() {
return this.props.children;
}
}]);
return AnimateChild;
}(_react2['default'].Component);
AnimateChild.propTypes = {
children: _propTypes2['default'].any
};
exports['default'] = AnimateChild;
module.exports = exports['default'];
/***/ }),
/* 426 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isCssAnimationSupported = undefined;
var _typeof2 = __webpack_require__(231);
var _typeof3 = _interopRequireDefault(_typeof2);
var _Event = __webpack_require__(427);
var _Event2 = _interopRequireDefault(_Event);
var _componentClasses = __webpack_require__(81);
var _componentClasses2 = _interopRequireDefault(_componentClasses);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var isCssAnimationSupported = _Event2['default'].endEvents.length !== 0;
var capitalPrefixes = ['Webkit', 'Moz', 'O',
// ms is special .... !
'ms'];
var prefixes = ['-webkit-', '-moz-', '-o-', 'ms-', ''];
function getStyleProperty(node, name) {
// old ff need null, https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle
var style = window.getComputedStyle(node, null);
var ret = '';
for (var i = 0; i < prefixes.length; i++) {
ret = style.getPropertyValue(prefixes[i] + name);
if (ret) {
break;
}
}
return ret;
}
function fixBrowserByTimeout(node) {
if (isCssAnimationSupported) {
var transitionDelay = parseFloat(getStyleProperty(node, 'transition-delay')) || 0;
var transitionDuration = parseFloat(getStyleProperty(node, 'transition-duration')) || 0;
var animationDelay = parseFloat(getStyleProperty(node, 'animation-delay')) || 0;
var animationDuration = parseFloat(getStyleProperty(node, 'animation-duration')) || 0;
var time = Math.max(transitionDuration + transitionDelay, animationDuration + animationDelay);
// sometimes, browser bug
node.rcEndAnimTimeout = setTimeout(function () {
node.rcEndAnimTimeout = null;
if (node.rcEndListener) {
node.rcEndListener();
}
}, time * 1000 + 200);
}
}
function clearBrowserBugTimeout(node) {
if (node.rcEndAnimTimeout) {
clearTimeout(node.rcEndAnimTimeout);
node.rcEndAnimTimeout = null;
}
}
var cssAnimation = function cssAnimation(node, transitionName, endCallback) {
var nameIsObj = (typeof transitionName === 'undefined' ? 'undefined' : (0, _typeof3['default'])(transitionName)) === 'object';
var className = nameIsObj ? transitionName.name : transitionName;
var activeClassName = nameIsObj ? transitionName.active : transitionName + '-active';
var end = endCallback;
var start = void 0;
var active = void 0;
var nodeClasses = (0, _componentClasses2['default'])(node);
if (endCallback && Object.prototype.toString.call(endCallback) === '[object Object]') {
end = endCallback.end;
start = endCallback.start;
active = endCallback.active;
}
if (node.rcEndListener) {
node.rcEndListener();
}
node.rcEndListener = function (e) {
if (e && e.target !== node) {
return;
}
if (node.rcAnimTimeout) {
clearTimeout(node.rcAnimTimeout);
node.rcAnimTimeout = null;
}
clearBrowserBugTimeout(node);
nodeClasses.remove(className);
nodeClasses.remove(activeClassName);
_Event2['default'].removeEndEventListener(node, node.rcEndListener);
node.rcEndListener = null;
// Usually this optional end is used for informing an owner of
// a leave animation and telling it to remove the child.
if (end) {
end();
}
};
_Event2['default'].addEndEventListener(node, node.rcEndListener);
if (start) {
start();
}
nodeClasses.add(className);
node.rcAnimTimeout = setTimeout(function () {
node.rcAnimTimeout = null;
nodeClasses.add(activeClassName);
if (active) {
setTimeout(active, 0);
}
fixBrowserByTimeout(node);
// 30ms for firefox
}, 30);
return {
stop: function stop() {
if (node.rcEndListener) {
node.rcEndListener();
}
}
};
};
cssAnimation.style = function (node, style, callback) {
if (node.rcEndListener) {
node.rcEndListener();
}
node.rcEndListener = function (e) {
if (e && e.target !== node) {
return;
}
if (node.rcAnimTimeout) {
clearTimeout(node.rcAnimTimeout);
node.rcAnimTimeout = null;
}
clearBrowserBugTimeout(node);
_Event2['default'].removeEndEventListener(node, node.rcEndListener);
node.rcEndListener = null;
// Usually this optional callback is used for informing an owner of
// a leave animation and telling it to remove the child.
if (callback) {
callback();
}
};
_Event2['default'].addEndEventListener(node, node.rcEndListener);
node.rcAnimTimeout = setTimeout(function () {
for (var s in style) {
if (style.hasOwnProperty(s)) {
node.style[s] = style[s];
}
}
node.rcAnimTimeout = null;
fixBrowserByTimeout(node);
}, 0);
};
cssAnimation.setTransition = function (node, p, value) {
var property = p;
var v = value;
if (value === undefined) {
v = property;
property = '';
}
property = property || '';
capitalPrefixes.forEach(function (prefix) {
node.style[prefix + 'Transition' + property] = v;
});
};
cssAnimation.isCssAnimationSupported = isCssAnimationSupported;
exports.isCssAnimationSupported = isCssAnimationSupported;
exports['default'] = cssAnimation;
/***/ }),
/* 427 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var EVENT_NAME_MAP = {
transitionend: {
transition: 'transitionend',
WebkitTransition: 'webkitTransitionEnd',
MozTransition: 'mozTransitionEnd',
OTransition: 'oTransitionEnd',
msTransition: 'MSTransitionEnd'
},
animationend: {
animation: 'animationend',
WebkitAnimation: 'webkitAnimationEnd',
MozAnimation: 'mozAnimationEnd',
OAnimation: 'oAnimationEnd',
msAnimation: 'MSAnimationEnd'
}
};
var endEvents = [];
function detectEvents() {
var testEl = document.createElement('div');
var style = testEl.style;
if (!('AnimationEvent' in window)) {
delete EVENT_NAME_MAP.animationend.animation;
}
if (!('TransitionEvent' in window)) {
delete EVENT_NAME_MAP.transitionend.transition;
}
for (var baseEventName in EVENT_NAME_MAP) {
if (EVENT_NAME_MAP.hasOwnProperty(baseEventName)) {
var baseEvents = EVENT_NAME_MAP[baseEventName];
for (var styleName in baseEvents) {
if (styleName in style) {
endEvents.push(baseEvents[styleName]);
break;
}
}
}
}
}
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
detectEvents();
}
function addEventListener(node, eventName, eventListener) {
node.addEventListener(eventName, eventListener, false);
}
function removeEventListener(node, eventName, eventListener) {
node.removeEventListener(eventName, eventListener, false);
}
var TransitionEvents = {
addEndEventListener: function addEndEventListener(node, eventListener) {
if (endEvents.length === 0) {
window.setTimeout(eventListener, 0);
return;
}
endEvents.forEach(function (endEvent) {
addEventListener(node, endEvent, eventListener);
});
},
endEvents: endEvents,
removeEndEventListener: function removeEndEventListener(node, eventListener) {
if (endEvents.length === 0) {
return;
}
endEvents.forEach(function (endEvent) {
removeEventListener(node, endEvent, eventListener);
});
}
};
exports['default'] = TransitionEvents;
module.exports = exports['default'];
/***/ }),
/* 428 */
/***/ (function(module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var util = {
isAppearSupported: function isAppearSupported(props) {
return props.transitionName && props.transitionAppear || props.animation.appear;
},
isEnterSupported: function isEnterSupported(props) {
return props.transitionName && props.transitionEnter || props.animation.enter;
},
isLeaveSupported: function isLeaveSupported(props) {
return props.transitionName && props.transitionLeave || props.animation.leave;
},
allowAppearCallback: function allowAppearCallback(props) {
return props.transitionAppear || props.animation.appear;
},
allowEnterCallback: function allowEnterCallback(props) {
return props.transitionEnter || props.animation.enter;
},
allowLeaveCallback: function allowLeaveCallback(props) {
return props.transitionLeave || props.animation.leave;
}
};
exports["default"] = util;
module.exports = exports['default'];
/***/ }),
/* 429 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _LazyRenderBox = __webpack_require__(430);
var _LazyRenderBox2 = _interopRequireDefault(_LazyRenderBox);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var PopupInner = function (_Component) {
(0, _inherits3['default'])(PopupInner, _Component);
function PopupInner() {
(0, _classCallCheck3['default'])(this, PopupInner);
return (0, _possibleConstructorReturn3['default'])(this, _Component.apply(this, arguments));
}
PopupInner.prototype.render = function render() {
var props = this.props;
var className = props.className;
if (!props.visible) {
className += ' ' + props.hiddenClassName;
}
return _react2['default'].createElement(
'div',
{
className: className,
onMouseEnter: props.onMouseEnter,
onMouseLeave: props.onMouseLeave,
style: props.style
},
_react2['default'].createElement(
_LazyRenderBox2['default'],
{ className: props.prefixCls + '-content', visible: props.visible },
props.children
)
);
};
return PopupInner;
}(_react.Component);
PopupInner.propTypes = {
hiddenClassName: _propTypes2['default'].string,
className: _propTypes2['default'].string,
prefixCls: _propTypes2['default'].string,
onMouseEnter: _propTypes2['default'].func,
onMouseLeave: _propTypes2['default'].func,
children: _propTypes2['default'].any
};
exports['default'] = PopupInner;
module.exports = exports['default'];
/***/ }),
/* 430 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _objectWithoutProperties2 = __webpack_require__(431);
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var LazyRenderBox = function (_Component) {
(0, _inherits3['default'])(LazyRenderBox, _Component);
function LazyRenderBox() {
(0, _classCallCheck3['default'])(this, LazyRenderBox);
return (0, _possibleConstructorReturn3['default'])(this, _Component.apply(this, arguments));
}
LazyRenderBox.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
return nextProps.hiddenClassName || nextProps.visible;
};
LazyRenderBox.prototype.render = function render() {
var _props = this.props,
hiddenClassName = _props.hiddenClassName,
visible = _props.visible,
props = (0, _objectWithoutProperties3['default'])(_props, ['hiddenClassName', 'visible']);
if (hiddenClassName || _react2['default'].Children.count(props.children) > 1) {
if (!visible && hiddenClassName) {
props.className += ' ' + hiddenClassName;
}
return _react2['default'].createElement('div', props);
}
return _react2['default'].Children.only(props.children);
};
return LazyRenderBox;
}(_react.Component);
LazyRenderBox.propTypes = {
children: _propTypes2['default'].any,
className: _propTypes2['default'].string,
visible: _propTypes2['default'].bool,
hiddenClassName: _propTypes2['default'].string
};
exports['default'] = LazyRenderBox;
module.exports = exports['default'];
/***/ }),
/* 431 */
/***/ (function(module, exports) {
"use strict";
exports.__esModule = true;
exports.default = function (obj, keys) {
var target = {};
for (var i in obj) {
if (keys.indexOf(i) >= 0) continue;
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
target[i] = obj[i];
}
return target;
};
/***/ }),
/* 432 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
exports.__esModule = true;
var _extends2 = __webpack_require__(216);
var _extends3 = _interopRequireDefault(_extends2);
exports.getAlignFromPlacement = getAlignFromPlacement;
exports.getPopupClassNameFromAlign = getPopupClassNameFromAlign;
exports.saveRef = saveRef;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function isPointsEq(a1, a2) {
return a1[0] === a2[0] && a1[1] === a2[1];
}
function getAlignFromPlacement(builtinPlacements, placementStr, align) {
var baseAlign = builtinPlacements[placementStr] || {};
return (0, _extends3['default'])({}, baseAlign, align);
}
function getPopupClassNameFromAlign(builtinPlacements, prefixCls, align) {
var points = align.points;
for (var placement in builtinPlacements) {
if (builtinPlacements.hasOwnProperty(placement)) {
if (isPointsEq(builtinPlacements[placement].points, points)) {
return prefixCls + '-placement-' + placement;
}
}
}
return '';
}
function saveRef(name, component) {
this[name] = component;
}
/***/ }),
/* 433 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = __webpack_require__(216);
var _extends3 = _interopRequireDefault(_extends2);
exports['default'] = getContainerRenderMixin;
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function defaultGetContainer() {
var container = document.createElement('div');
document.body.appendChild(container);
return container;
}
function getContainerRenderMixin(config) {
var _config$autoMount = config.autoMount,
autoMount = _config$autoMount === undefined ? true : _config$autoMount,
_config$autoDestroy = config.autoDestroy,
autoDestroy = _config$autoDestroy === undefined ? true : _config$autoDestroy,
isVisible = config.isVisible,
isForceRender = config.isForceRender,
getComponent = config.getComponent,
_config$getContainer = config.getContainer,
getContainer = _config$getContainer === undefined ? defaultGetContainer : _config$getContainer;
var mixin = void 0;
function _renderComponent(instance, componentArg, ready) {
if (!isVisible || instance._component || isVisible(instance) || isForceRender && isForceRender(instance)) {
if (!instance._container) {
instance._container = getContainer(instance);
}
var component = void 0;
if (instance.getComponent) {
component = instance.getComponent(componentArg);
} else {
component = getComponent(instance, componentArg);
}
_reactDom2['default'].unstable_renderSubtreeIntoContainer(instance, component, instance._container, function callback() {
instance._component = this;
if (ready) {
ready.call(this);
}
});
}
}
if (autoMount) {
mixin = (0, _extends3['default'])({}, mixin, {
componentDidMount: function componentDidMount() {
_renderComponent(this);
},
componentDidUpdate: function componentDidUpdate() {
_renderComponent(this);
}
});
}
if (!autoMount || !autoDestroy) {
mixin = (0, _extends3['default'])({}, mixin, {
renderComponent: function renderComponent(componentArg, ready) {
_renderComponent(this, componentArg, ready);
}
});
}
function _removeContainer(instance) {
if (instance._container) {
var container = instance._container;
_reactDom2['default'].unmountComponentAtNode(container);
container.parentNode.removeChild(container);
instance._container = null;
}
}
if (autoDestroy) {
mixin = (0, _extends3['default'])({}, mixin, {
componentWillUnmount: function componentWillUnmount() {
_removeContainer(this);
}
});
} else {
mixin = (0, _extends3['default'])({}, mixin, {
removeContainer: function removeContainer() {
_removeContainer(this);
}
});
}
return mixin;
}
module.exports = exports['default'];
/***/ }),
/* 434 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(226);
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var Portal = function (_React$Component) {
(0, _inherits3['default'])(Portal, _React$Component);
function Portal() {
(0, _classCallCheck3['default'])(this, Portal);
return (0, _possibleConstructorReturn3['default'])(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).apply(this, arguments));
}
(0, _createClass3['default'])(Portal, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.createContainer();
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(prevProps) {
var didUpdate = this.props.didUpdate;
if (didUpdate) {
didUpdate(prevProps);
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.removeContainer();
}
}, {
key: 'createContainer',
value: function createContainer() {
this._container = this.props.getContainer();
this.forceUpdate();
}
}, {
key: 'removeContainer',
value: function removeContainer() {
if (this._container) {
this._container.parentNode.removeChild(this._container);
}
}
}, {
key: 'render',
value: function render() {
if (this._container) {
return _reactDom2['default'].createPortal(this.props.children, this._container);
}
return null;
}
}]);
return Portal;
}(_react2['default'].Component);
Portal.propTypes = {
getContainer: _propTypes2['default'].func.isRequired,
children: _propTypes2['default'].node.isRequired,
didUpdate: _propTypes2['default'].func
};
exports['default'] = Portal;
module.exports = exports['default'];
/***/ }),
/* 435 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _defineProperty2 = __webpack_require__(397);
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(226);
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Header = __webpack_require__(436);
var _Header2 = _interopRequireDefault(_Header);
var _Combobox = __webpack_require__(437);
var _Combobox2 = _interopRequireDefault(_Combobox);
var _moment = __webpack_require__(275);
var _moment2 = _interopRequireDefault(_moment);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function noop() {}
function generateOptions(length, disabledOptions, hideDisabledOptions) {
var step = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
var arr = [];
for (var value = 0; value < length; value += step) {
if (!disabledOptions || disabledOptions.indexOf(value) < 0 || !hideDisabledOptions) {
arr.push(value);
}
}
return arr;
}
var Panel = function (_Component) {
(0, _inherits3['default'])(Panel, _Component);
function Panel(props) {
(0, _classCallCheck3['default'])(this, Panel);
var _this = (0, _possibleConstructorReturn3['default'])(this, (Panel.__proto__ || Object.getPrototypeOf(Panel)).call(this, props));
_this.onChange = function (newValue) {
_this.setState({ value: newValue });
_this.props.onChange(newValue);
};
_this.onCurrentSelectPanelChange = function (currentSelectPanel) {
_this.setState({ currentSelectPanel: currentSelectPanel });
};
_this.state = {
value: props.value,
selectionRange: []
};
return _this;
}
(0, _createClass3['default'])(Panel, [{
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
var value = nextProps.value;
if (value) {
this.setState({
value: value
});
}
}
}, {
key: 'close',
// https://github.com/ant-design/ant-design/issues/5829
value: function close() {
this.props.onEsc();
}
}, {
key: 'render',
value: function render() {
var _classNames;
var _props = this.props,
prefixCls = _props.prefixCls,
className = _props.className,
placeholder = _props.placeholder,
disabledHours = _props.disabledHours,
disabledMinutes = _props.disabledMinutes,
disabledSeconds = _props.disabledSeconds,
hideDisabledOptions = _props.hideDisabledOptions,
allowEmpty = _props.allowEmpty,
showHour = _props.showHour,
showMinute = _props.showMinute,
showSecond = _props.showSecond,
format = _props.format,
defaultOpenValue = _props.defaultOpenValue,
clearText = _props.clearText,
onEsc = _props.onEsc,
addon = _props.addon,
use12Hours = _props.use12Hours,
onClear = _props.onClear,
focusOnOpen = _props.focusOnOpen,
onKeyDown = _props.onKeyDown,
hourStep = _props.hourStep,
minuteStep = _props.minuteStep,
secondStep = _props.secondStep;
var _state = this.state,
value = _state.value,
currentSelectPanel = _state.currentSelectPanel;
var disabledHourOptions = disabledHours();
var disabledMinuteOptions = disabledMinutes(value ? value.hour() : null);
var disabledSecondOptions = disabledSeconds(value ? value.hour() : null, value ? value.minute() : null);
var hourOptions = generateOptions(24, disabledHourOptions, hideDisabledOptions, hourStep);
var minuteOptions = generateOptions(60, disabledMinuteOptions, hideDisabledOptions, minuteStep);
var secondOptions = generateOptions(60, disabledSecondOptions, hideDisabledOptions, secondStep);
return _react2['default'].createElement(
'div',
{ className: (0, _classnames2['default'])((_classNames = {}, (0, _defineProperty3['default'])(_classNames, prefixCls + '-inner', true), (0, _defineProperty3['default'])(_classNames, className, !!className), _classNames)) },
_react2['default'].createElement(_Header2['default'], {
clearText: clearText,
prefixCls: prefixCls,
defaultOpenValue: defaultOpenValue,
value: value,
currentSelectPanel: currentSelectPanel,
onEsc: onEsc,
format: format,
placeholder: placeholder,
hourOptions: hourOptions,
minuteOptions: minuteOptions,
secondOptions: secondOptions,
disabledHours: disabledHours,
disabledMinutes: disabledMinutes,
disabledSeconds: disabledSeconds,
onChange: this.onChange,
onClear: onClear,
allowEmpty: allowEmpty,
focusOnOpen: focusOnOpen,
onKeyDown: onKeyDown
}),
_react2['default'].createElement(_Combobox2['default'], {
prefixCls: prefixCls,
value: value,
defaultOpenValue: defaultOpenValue,
format: format,
onChange: this.onChange,
showHour: showHour,
showMinute: showMinute,
showSecond: showSecond,
hourOptions: hourOptions,
minuteOptions: minuteOptions,
secondOptions: secondOptions,
disabledHours: disabledHours,
disabledMinutes: disabledMinutes,
disabledSeconds: disabledSeconds,
onCurrentSelectPanelChange: this.onCurrentSelectPanelChange,
use12Hours: use12Hours
}),
addon(this)
);
}
}]);
return Panel;
}(_react.Component);
Panel.propTypes = {
clearText: _propTypes2['default'].string,
prefixCls: _propTypes2['default'].string,
className: _propTypes2['default'].string,
defaultOpenValue: _propTypes2['default'].object,
value: _propTypes2['default'].object,
placeholder: _propTypes2['default'].string,
format: _propTypes2['default'].string,
disabledHours: _propTypes2['default'].func,
disabledMinutes: _propTypes2['default'].func,
disabledSeconds: _propTypes2['default'].func,
hideDisabledOptions: _propTypes2['default'].bool,
onChange: _propTypes2['default'].func,
onEsc: _propTypes2['default'].func,
allowEmpty: _propTypes2['default'].bool,
showHour: _propTypes2['default'].bool,
showMinute: _propTypes2['default'].bool,
showSecond: _propTypes2['default'].bool,
onClear: _propTypes2['default'].func,
use12Hours: _propTypes2['default'].bool,
hourStep: _propTypes2['default'].number,
minuteStep: _propTypes2['default'].number,
secondStep: _propTypes2['default'].number,
addon: _propTypes2['default'].func,
focusOnOpen: _propTypes2['default'].bool,
onKeyDown: _propTypes2['default'].func
};
Panel.defaultProps = {
prefixCls: 'rc-time-picker-panel',
onChange: noop,
onClear: noop,
disabledHours: noop,
disabledMinutes: noop,
disabledSeconds: noop,
defaultOpenValue: (0, _moment2['default'])(),
use12Hours: false,
addon: noop,
onKeyDown: noop
};
exports['default'] = Panel;
module.exports = exports['default'];
/***/ }),
/* 436 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(226);
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _moment = __webpack_require__(275);
var _moment2 = _interopRequireDefault(_moment);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var Header = function (_Component) {
(0, _inherits3['default'])(Header, _Component);
function Header(props) {
(0, _classCallCheck3['default'])(this, Header);
var _this = (0, _possibleConstructorReturn3['default'])(this, (Header.__proto__ || Object.getPrototypeOf(Header)).call(this, props));
_initialiseProps.call(_this);
var value = props.value,
format = props.format;
_this.state = {
str: value && value.format(format) || '',
invalid: false
};
return _this;
}
(0, _createClass3['default'])(Header, [{
key: 'componentDidMount',
value: function componentDidMount() {
var _this2 = this;
if (this.props.focusOnOpen) {
// Wait one frame for the panel to be positioned before focusing
var requestAnimationFrame = window.requestAnimationFrame || window.setTimeout;
requestAnimationFrame(function () {
_this2.refs.input.focus();
_this2.refs.input.select();
});
}
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
var value = nextProps.value,
format = nextProps.format;
this.setState({
str: value && value.format(format) || '',
invalid: false
});
}
}, {
key: 'getClearButton',
value: function getClearButton() {
var _props = this.props,
prefixCls = _props.prefixCls,
allowEmpty = _props.allowEmpty;
if (!allowEmpty) {
return null;
}
return _react2['default'].createElement('a', {
className: prefixCls + '-clear-btn',
role: 'button',
title: this.props.clearText,
onMouseDown: this.onClear
});
}
}, {
key: 'getProtoValue',
value: function getProtoValue() {
return this.props.value || this.props.defaultOpenValue;
}
}, {
key: 'getInput',
value: function getInput() {
var _props2 = this.props,
prefixCls = _props2.prefixCls,
placeholder = _props2.placeholder;
var _state = this.state,
invalid = _state.invalid,
str = _state.str;
var invalidClass = invalid ? prefixCls + '-input-invalid' : '';
return _react2['default'].createElement('input', {
className: prefixCls + '-input ' + invalidClass,
ref: 'input',
onKeyDown: this.onKeyDown,
value: str,
placeholder: placeholder,
onChange: this.onInputChange
});
}
}, {
key: 'render',
value: function render() {
var prefixCls = this.props.prefixCls;
return _react2['default'].createElement(
'div',
{ className: prefixCls + '-input-wrap' },
this.getInput(),
this.getClearButton()
);
}
}]);
return Header;
}(_react.Component);
Header.propTypes = {
format: _propTypes2['default'].string,
prefixCls: _propTypes2['default'].string,
disabledDate: _propTypes2['default'].func,
placeholder: _propTypes2['default'].string,
clearText: _propTypes2['default'].string,
value: _propTypes2['default'].object,
hourOptions: _propTypes2['default'].array,
minuteOptions: _propTypes2['default'].array,
secondOptions: _propTypes2['default'].array,
disabledHours: _propTypes2['default'].func,
disabledMinutes: _propTypes2['default'].func,
disabledSeconds: _propTypes2['default'].func,
onChange: _propTypes2['default'].func,
onClear: _propTypes2['default'].func,
onEsc: _propTypes2['default'].func,
allowEmpty: _propTypes2['default'].bool,
defaultOpenValue: _propTypes2['default'].object,
currentSelectPanel: _propTypes2['default'].string,
focusOnOpen: _propTypes2['default'].bool,
onKeyDown: _propTypes2['default'].func
};
var _initialiseProps = function _initialiseProps() {
var _this3 = this;
this.onInputChange = function (event) {
var str = event.target.value;
_this3.setState({
str: str
});
var _props3 = _this3.props,
format = _props3.format,
hourOptions = _props3.hourOptions,
minuteOptions = _props3.minuteOptions,
secondOptions = _props3.secondOptions,
disabledHours = _props3.disabledHours,
disabledMinutes = _props3.disabledMinutes,
disabledSeconds = _props3.disabledSeconds,
onChange = _props3.onChange,
allowEmpty = _props3.allowEmpty;
if (str) {
var originalValue = _this3.props.value;
var value = _this3.getProtoValue().clone();
var parsed = (0, _moment2['default'])(str, format, true);
if (!parsed.isValid()) {
_this3.setState({
invalid: true
});
return;
}
value.hour(parsed.hour()).minute(parsed.minute()).second(parsed.second());
// if time value not allowed, response warning.
if (hourOptions.indexOf(value.hour()) < 0 || minuteOptions.indexOf(value.minute()) < 0 || secondOptions.indexOf(value.second()) < 0) {
_this3.setState({
invalid: true
});
return;
}
// if time value is disabled, response warning.
var disabledHourOptions = disabledHours();
var disabledMinuteOptions = disabledMinutes(value.hour());
var disabledSecondOptions = disabledSeconds(value.hour(), value.minute());
if (disabledHourOptions && disabledHourOptions.indexOf(value.hour()) >= 0 || disabledMinuteOptions && disabledMinuteOptions.indexOf(value.minute()) >= 0 || disabledSecondOptions && disabledSecondOptions.indexOf(value.second()) >= 0) {
_this3.setState({
invalid: true
});
return;
}
if (originalValue) {
if (originalValue.hour() !== value.hour() || originalValue.minute() !== value.minute() || originalValue.second() !== value.second()) {
// keep other fields for rc-calendar
var changedValue = originalValue.clone();
changedValue.hour(value.hour());
changedValue.minute(value.minute());
changedValue.second(value.second());
onChange(changedValue);
}
} else if (originalValue !== value) {
onChange(value);
}
} else if (allowEmpty) {
onChange(null);
} else {
_this3.setState({
invalid: true
});
return;
}
_this3.setState({
invalid: false
});
};
this.onKeyDown = function (e) {
var _props4 = _this3.props,
onEsc = _props4.onEsc,
onKeyDown = _props4.onKeyDown;
if (e.keyCode === 27) {
onEsc();
}
onKeyDown(e);
};
this.onClear = function () {
_this3.setState({ str: '' });
_this3.props.onClear();
};
};
exports['default'] = Header;
module.exports = exports['default'];
/***/ }),
/* 437 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(226);
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Select = __webpack_require__(438);
var _Select2 = _interopRequireDefault(_Select);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var formatOption = function formatOption(option, disabledOptions) {
var value = '' + option;
if (option < 10) {
value = '0' + option;
}
var disabled = false;
if (disabledOptions && disabledOptions.indexOf(option) >= 0) {
disabled = true;
}
return {
value: value,
disabled: disabled
};
};
var Combobox = function (_Component) {
(0, _inherits3['default'])(Combobox, _Component);
function Combobox() {
var _ref;
var _temp, _this, _ret;
(0, _classCallCheck3['default'])(this, Combobox);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, (_ref = Combobox.__proto__ || Object.getPrototypeOf(Combobox)).call.apply(_ref, [this].concat(args))), _this), _this.onItemChange = function (type, itemValue) {
var _this$props = _this.props,
onChange = _this$props.onChange,
defaultOpenValue = _this$props.defaultOpenValue,
use12Hours = _this$props.use12Hours;
var value = (_this.props.value || defaultOpenValue).clone();
if (type === 'hour') {
if (use12Hours) {
if (_this.isAM()) {
value.hour(+itemValue % 12);
} else {
value.hour(+itemValue % 12 + 12);
}
} else {
value.hour(+itemValue);
}
} else if (type === 'minute') {
value.minute(+itemValue);
} else if (type === 'ampm') {
var ampm = itemValue.toUpperCase();
if (use12Hours) {
if (ampm === 'PM' && value.hour() < 12) {
value.hour(value.hour() % 12 + 12);
}
if (ampm === 'AM') {
if (value.hour() >= 12) {
value.hour(value.hour() - 12);
}
}
}
} else {
value.second(+itemValue);
}
onChange(value);
}, _this.onEnterSelectPanel = function (range) {
_this.props.onCurrentSelectPanelChange(range);
}, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
}
(0, _createClass3['default'])(Combobox, [{
key: 'getHourSelect',
value: function getHourSelect(hour) {
var _props = this.props,
prefixCls = _props.prefixCls,
hourOptions = _props.hourOptions,
disabledHours = _props.disabledHours,
showHour = _props.showHour,
use12Hours = _props.use12Hours;
if (!showHour) {
return null;
}
var disabledOptions = disabledHours();
var hourOptionsAdj = void 0;
var hourAdj = void 0;
if (use12Hours) {
hourOptionsAdj = [12].concat(hourOptions.filter(function (h) {
return h < 12 && h > 0;
}));
hourAdj = hour % 12 || 12;
} else {
hourOptionsAdj = hourOptions;
hourAdj = hour;
}
return _react2['default'].createElement(_Select2['default'], {
prefixCls: prefixCls,
options: hourOptionsAdj.map(function (option) {
return formatOption(option, disabledOptions);
}),
selectedIndex: hourOptionsAdj.indexOf(hourAdj),
type: 'hour',
onSelect: this.onItemChange,
onMouseEnter: this.onEnterSelectPanel.bind(this, 'hour')
});
}
}, {
key: 'getMinuteSelect',
value: function getMinuteSelect(minute) {
var _props2 = this.props,
prefixCls = _props2.prefixCls,
minuteOptions = _props2.minuteOptions,
disabledMinutes = _props2.disabledMinutes,
defaultOpenValue = _props2.defaultOpenValue,
showMinute = _props2.showMinute;
if (!showMinute) {
return null;
}
var value = this.props.value || defaultOpenValue;
var disabledOptions = disabledMinutes(value.hour());
return _react2['default'].createElement(_Select2['default'], {
prefixCls: prefixCls,
options: minuteOptions.map(function (option) {
return formatOption(option, disabledOptions);
}),
selectedIndex: minuteOptions.indexOf(minute),
type: 'minute',
onSelect: this.onItemChange,
onMouseEnter: this.onEnterSelectPanel.bind(this, 'minute')
});
}
}, {
key: 'getSecondSelect',
value: function getSecondSelect(second) {
var _props3 = this.props,
prefixCls = _props3.prefixCls,
secondOptions = _props3.secondOptions,
disabledSeconds = _props3.disabledSeconds,
showSecond = _props3.showSecond,
defaultOpenValue = _props3.defaultOpenValue;
if (!showSecond) {
return null;
}
var value = this.props.value || defaultOpenValue;
var disabledOptions = disabledSeconds(value.hour(), value.minute());
return _react2['default'].createElement(_Select2['default'], {
prefixCls: prefixCls,
options: secondOptions.map(function (option) {
return formatOption(option, disabledOptions);
}),
selectedIndex: secondOptions.indexOf(second),
type: 'second',
onSelect: this.onItemChange,
onMouseEnter: this.onEnterSelectPanel.bind(this, 'second')
});
}
}, {
key: 'getAMPMSelect',
value: function getAMPMSelect() {
var _props4 = this.props,
prefixCls = _props4.prefixCls,
use12Hours = _props4.use12Hours,
format = _props4.format;
if (!use12Hours) {
return null;
}
var AMPMOptions = ['am', 'pm'] // If format has A char, then we should uppercase AM/PM
.map(function (c) {
return format.match(/\sA/) ? c.toUpperCase() : c;
}).map(function (c) {
return { value: c };
});
var selected = this.isAM() ? 0 : 1;
return _react2['default'].createElement(_Select2['default'], {
prefixCls: prefixCls,
options: AMPMOptions,
selectedIndex: selected,
type: 'ampm',
onSelect: this.onItemChange,
onMouseEnter: this.onEnterSelectPanel.bind(this, 'ampm')
});
}
}, {
key: 'isAM',
value: function isAM() {
var value = this.props.value || this.props.defaultOpenValue;
return value.hour() >= 0 && value.hour() < 12;
}
}, {
key: 'render',
value: function render() {
var _props5 = this.props,
prefixCls = _props5.prefixCls,
defaultOpenValue = _props5.defaultOpenValue;
var value = this.props.value || defaultOpenValue;
return _react2['default'].createElement(
'div',
{ className: prefixCls + '-combobox' },
this.getHourSelect(value.hour()),
this.getMinuteSelect(value.minute()),
this.getSecondSelect(value.second()),
this.getAMPMSelect(value.hour())
);
}
}]);
return Combobox;
}(_react.Component);
Combobox.propTypes = {
format: _propTypes2['default'].string,
defaultOpenValue: _propTypes2['default'].object,
prefixCls: _propTypes2['default'].string,
value: _propTypes2['default'].object,
onChange: _propTypes2['default'].func,
showHour: _propTypes2['default'].bool,
showMinute: _propTypes2['default'].bool,
showSecond: _propTypes2['default'].bool,
hourOptions: _propTypes2['default'].array,
minuteOptions: _propTypes2['default'].array,
secondOptions: _propTypes2['default'].array,
disabledHours: _propTypes2['default'].func,
disabledMinutes: _propTypes2['default'].func,
disabledSeconds: _propTypes2['default'].func,
onCurrentSelectPanelChange: _propTypes2['default'].func,
use12Hours: _propTypes2['default'].bool
};
exports['default'] = Combobox;
module.exports = exports['default'];
/***/ }),
/* 438 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _defineProperty2 = __webpack_require__(397);
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _classCallCheck2 = __webpack_require__(225);
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = __webpack_require__(226);
var _createClass3 = _interopRequireDefault(_createClass2);
var _possibleConstructorReturn2 = __webpack_require__(230);
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
var _inherits2 = __webpack_require__(265);
var _inherits3 = _interopRequireDefault(_inherits2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _classnames3 = __webpack_require__(3);
var _classnames4 = _interopRequireDefault(_classnames3);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var scrollTo = function scrollTo(element, to, duration) {
var requestAnimationFrame = window.requestAnimationFrame || function requestAnimationFrameTimeout() {
return setTimeout(arguments[0], 10);
};
// jump to target if duration zero
if (duration <= 0) {
element.scrollTop = to;
return;
}
var difference = to - element.scrollTop;
var perTick = difference / duration * 10;
requestAnimationFrame(function () {
element.scrollTop = element.scrollTop + perTick;
if (element.scrollTop === to) return;
scrollTo(element, to, duration - 10);
});
};
var Select = function (_Component) {
(0, _inherits3['default'])(Select, _Component);
function Select() {
var _ref;
var _temp, _this, _ret;
(0, _classCallCheck3['default'])(this, Select);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, (_ref = Select.__proto__ || Object.getPrototypeOf(Select)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
active: false
}, _this.onSelect = function (value) {
var _this$props = _this.props,
onSelect = _this$props.onSelect,
type = _this$props.type;
onSelect(type, value);
}, _this.handleMouseEnter = function (e) {
_this.setState({ active: true });
_this.props.onMouseEnter(e);
}, _this.handleMouseLeave = function () {
_this.setState({ active: false });
}, _this.saveList = function (node) {
_this.list = node;
}, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
}
(0, _createClass3['default'])(Select, [{
key: 'componentDidMount',
value: function componentDidMount() {
// jump to selected option
this.scrollToSelected(0);
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(prevProps) {
// smooth scroll to selected option
if (prevProps.selectedIndex !== this.props.selectedIndex) {
this.scrollToSelected(120);
}
}
}, {
key: 'getOptions',
value: function getOptions() {
var _this2 = this;
var _props = this.props,
options = _props.options,
selectedIndex = _props.selectedIndex,
prefixCls = _props.prefixCls;
return options.map(function (item, index) {
var _classnames;
var cls = (0, _classnames4['default'])((_classnames = {}, (0, _defineProperty3['default'])(_classnames, prefixCls + '-select-option-selected', selectedIndex === index), (0, _defineProperty3['default'])(_classnames, prefixCls + '-select-option-disabled', item.disabled), _classnames));
var onclick = null;
if (!item.disabled) {
onclick = _this2.onSelect.bind(_this2, item.value);
}
return _react2['default'].createElement(
'li',
{
className: cls,
key: index,
onClick: onclick,
disabled: item.disabled
},
item.value
);
});
}
}, {
key: 'scrollToSelected',
value: function scrollToSelected(duration) {
// move to selected item
var select = _reactDom2['default'].findDOMNode(this);
var list = _reactDom2['default'].findDOMNode(this.list);
if (!list) {
return;
}
var index = this.props.selectedIndex;
if (index < 0) {
index = 0;
}
var topOption = list.children[index];
var to = topOption.offsetTop;
scrollTo(select, to, duration);
}
}, {
key: 'render',
value: function render() {
var _classnames2;
if (this.props.options.length === 0) {
return null;
}
var prefixCls = this.props.prefixCls;
var cls = (0, _classnames4['default'])((_classnames2 = {}, (0, _defineProperty3['default'])(_classnames2, prefixCls + '-select', 1), (0, _defineProperty3['default'])(_classnames2, prefixCls + '-select-active', this.state.active), _classnames2));
return _react2['default'].createElement(
'div',
{
className: cls,
onMouseEnter: this.handleMouseEnter,
onMouseLeave: this.handleMouseLeave
},
_react2['default'].createElement(
'ul',
{ ref: this.saveList },
this.getOptions()
)
);
}
}]);
return Select;
}(_react.Component);
Select.propTypes = {
prefixCls: _propTypes2['default'].string,
options: _propTypes2['default'].array,
selectedIndex: _propTypes2['default'].number,
type: _propTypes2['default'].string,
onSelect: _propTypes2['default'].func,
onMouseEnter: _propTypes2['default'].func
};
exports['default'] = Select;
module.exports = exports['default'];
/***/ }),
/* 439 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _MonthCalendar = __webpack_require__(440);
var _MonthCalendar2 = _interopRequireDefault(_MonthCalendar);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _Picker = __webpack_require__(413);
var _Picker2 = _interopRequireDefault(_Picker);
var _beeFormControl = __webpack_require__(164);
var _beeFormControl2 = _interopRequireDefault(_beeFormControl);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
* Created by chief on 17/4/6.
*/
var MonthPicker = function (_Component) {
_inherits(MonthPicker, _Component);
function MonthPicker(props, context) {
_classCallCheck(this, MonthPicker);
var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
_this.onChange = function (value) {
_this.setState({
value: value
});
};
_this.onOpenChange = function (open) {
_this.setState({
open: open
});
};
_this.onTypeChange = function (type) {
_this.setState({
type: type
});
};
_this.state = {
type: "month",
value: props.value || props.defaultValue,
open: false
};
return _this;
}
MonthPicker.prototype.render = function render() {
var _this2 = this;
var state = this.state;
var props = this.props;
var monthCalendar = _react2["default"].createElement(_MonthCalendar2["default"], props);
return _react2["default"].createElement(
"div",
null,
_react2["default"].createElement(
_Picker2["default"],
{
onOpenChange: this.onOpenChange,
animation: "slide-up",
calendar: monthCalendar,
open: this.state.open,
value: state.value,
onChange: this.onChange
},
function (_ref) {
var value = _ref.value;
return _react2["default"].createElement(_beeFormControl2["default"], {
placeholder: _this2.props.placeholder,
className: _this2.props.className,
value: value && value.format(props.format) || ""
});
}
)
);
};
return MonthPicker;
}(_react.Component);
exports["default"] = MonthPicker;
module.exports = exports["default"];
/***/ }),
/* 440 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _createReactClass = __webpack_require__(85);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _KeyCode = __webpack_require__(223);
var _KeyCode2 = _interopRequireDefault(_KeyCode);
var _MonthPanel = __webpack_require__(400);
var _MonthPanel2 = _interopRequireDefault(_MonthPanel);
var _CalendarMixin = __webpack_require__(409);
var _CalendarMixin2 = _interopRequireDefault(_CalendarMixin);
var _CommonMixin = __webpack_require__(410);
var _CommonMixin2 = _interopRequireDefault(_CommonMixin);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var MonthCalendar = (0, _createReactClass2['default'])({
displayName: 'MonthCalendar',
propTypes: {
monthCellRender: _propTypes2['default'].func,
dateCellRender: _propTypes2['default'].func
},
mixins: [_CommonMixin2['default'], _CalendarMixin2['default']],
onKeyDown: function onKeyDown(event) {
var keyCode = event.keyCode;
var ctrlKey = event.ctrlKey || event.metaKey;
var stateValue = this.state.value;
var disabledDate = this.props.disabledDate;
var value = stateValue;
switch (keyCode) {
case _KeyCode2['default'].DOWN:
value = stateValue.clone();
value.add(3, 'months');
break;
case _KeyCode2['default'].UP:
value = stateValue.clone();
value.add(-3, 'months');
break;
case _KeyCode2['default'].LEFT:
value = stateValue.clone();
if (ctrlKey) {
value.add(-1, 'years');
} else {
value.add(-1, 'months');
}
break;
case _KeyCode2['default'].RIGHT:
value = stateValue.clone();
if (ctrlKey) {
value.add(1, 'years');
} else {
value.add(1, 'months');
}
break;
case _KeyCode2['default'].ENTER:
if (!disabledDate || !disabledDate(stateValue)) {
this.onSelect(stateValue);
}
event.preventDefault();
return 1;
default:
return undefined;
}
if (value !== stateValue) {
this.setValue(value);
event.preventDefault();
return 1;
}
},
render: function render() {
var props = this.props;
var children = _react2['default'].createElement(_MonthPanel2['default'], {
locale: props.locale,
disabledDate: props.disabledDate,
style: { position: 'relative' },
value: this.state.value,
cellRender: props.monthCellRender,
contentRender: props.monthCellContentRender,
rootPrefixCls: props.prefixCls,
onChange: this.setValue,
onSelect: this.onSelect
});
return this.renderRoot({
children: children
});
}
});
exports['default'] = MonthCalendar;
module.exports = exports['default'];
/***/ }),
/* 441 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _RangeCalendar = __webpack_require__(442);
var _RangeCalendar2 = _interopRequireDefault(_RangeCalendar);
var _beeFormControl = __webpack_require__(164);
var _beeFormControl2 = _interopRequireDefault(_beeFormControl);
var _Picker = __webpack_require__(413);
var _Picker2 = _interopRequireDefault(_Picker);
var _zh_CN = __webpack_require__(461);
var _zh_CN2 = _interopRequireDefault(_zh_CN);
var _en_US = __webpack_require__(411);
var _en_US2 = _interopRequireDefault(_en_US);
var _moment = __webpack_require__(275);
var _moment2 = _interopRequireDefault(_moment);
__webpack_require__(393);
__webpack_require__(305);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
* Created by chief on 17/4/6.
*/
function format(v) {
return v ? v.format(formatStr) : '';
}
var formatStr = 'YYYY-MM-DD';
var fullFormat = "YYYY-MM-DD";
var cn = location.search.indexOf("cn") !== -1;
var now = (0, _moment2["default"])();
function onStandaloneChange(value) {
console.log('onChange');
console.log(value[0] && format(value[0]), value[1] && format(value[1]));
}
function onStandaloneSelect(value) {
console.log('onSelect');
console.log(format(value[0]), format(value[1]));
}
function isValidRange(v) {
return v && v[0] && v[1];
}
if (cn) {
now.locale("zh-cn").utcOffset(8);
} else {
now.locale("en-gb").utcOffset(0);
}
var Picker = function (_Component) {
_inherits(Picker, _Component);
function Picker(props, context) {
_classCallCheck(this, Picker);
var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
_this.onChange = function (value) {
console.log('onChange', value);
_this.setState({ value: value });
};
_this.onHoverChange = function (hoverValue) {
_this.setState({ hoverValue: hoverValue });
};
_this.state = {
hoverValue: [],
value: []
};
return _this;
}
Picker.prototype.render = function render() {
var _this2 = this;
var props = this.props;
var showValue = props.showValue;
var calendar = _react2["default"].createElement(_RangeCalendar2["default"], _extends({}, props, {
hoverValue: this.state.hoverValue,
onHoverChange: this.onHoverChange,
showWeekNumber: false,
format: formatStr,
dateInputPlaceholder: ['start', 'end'],
defaultValue: [now, now.clone().add(1, 'months')],
locale: cn ? _zh_CN2["default"] : _en_US2["default"],
onChange: props.onChange,
disabledDate: props.disabledDate
}));
return _react2["default"].createElement(
_Picker2["default"],
{
value: this.state.value,
onChange: this.onChange,
animation: "slide-up",
calendar: calendar
},
function (_ref) {
var value = _ref.value;
return _react2["default"].createElement(
"div",
{ className: 'calendar-picker' },
_react2["default"].createElement(_beeFormControl2["default"], {
placeholder: _this2.props.placeholder ? _this2.props.placeholder : 'start ~ end',
value: isValidRange(value) && format(value[0]) + " ~ " + format(value[1]) || ''
})
);
}
);
};
return Picker;
}(_react.Component);
exports["default"] = Picker;
module.exports = exports["default"];
/***/ }),
/* 442 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = __webpack_require__(216);
var _extends3 = _interopRequireDefault(_extends2);
var _defineProperty2 = __webpack_require__(397);
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _toConsumableArray2 = __webpack_require__(443);
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
var _slicedToArray2 = __webpack_require__(453);
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _createReactClass = __webpack_require__(85);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _moment = __webpack_require__(275);
var _moment2 = _interopRequireDefault(_moment);
var _classnames2 = __webpack_require__(3);
var _classnames3 = _interopRequireDefault(_classnames2);
var _CalendarPart = __webpack_require__(460);
var _CalendarPart2 = _interopRequireDefault(_CalendarPart);
var _TodayButton = __webpack_require__(406);
var _TodayButton2 = _interopRequireDefault(_TodayButton);
var _OkButton = __webpack_require__(407);
var _OkButton2 = _interopRequireDefault(_OkButton);
var _TimePickerButton = __webpack_require__(408);
var _TimePickerButton2 = _interopRequireDefault(_TimePickerButton);
var _CommonMixin = __webpack_require__(410);
var _CommonMixin2 = _interopRequireDefault(_CommonMixin);
var _util = __webpack_require__(398);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function noop() {}
function isEmptyArray(arr) {
return Array.isArray(arr) && (arr.length === 0 || arr.every(function (i) {
return !i;
}));
}
function getValueFromSelectedValue(selectedValue) {
var _selectedValue = (0, _slicedToArray3['default'])(selectedValue, 2),
start = _selectedValue[0],
end = _selectedValue[1];
var newEnd = end && end.isSame(start, 'month') ? end.clone().add(1, 'month') : end;
return [start, newEnd];
}
function normalizeAnchor(props, init) {
var selectedValue = props.selectedValue || init && props.defaultSelectedValue;
var value = props.value || init && props.defaultValue;
var normalizedValue = value ? getValueFromSelectedValue(value) : getValueFromSelectedValue(selectedValue);
return !isEmptyArray(normalizedValue) ? normalizedValue : init && [(0, _moment2['default'])(), (0, _moment2['default'])().add(1, 'months')];
}
function generateOptions(length) {
var arr = [];
for (var value = 0; value < length; value++) {
arr.push(value);
}
return arr;
}
function onInputSelect(direction, value) {
if (!value) {
return;
}
var originalValue = this.state.selectedValue;
var selectedValue = originalValue.concat();
var index = direction === 'left' ? 0 : 1;
selectedValue[index] = value;
if (selectedValue[0] && this.compare(selectedValue[0], selectedValue[1]) > 0) {
selectedValue[1 - index] = this.state.showTimePicker ? selectedValue[index] : undefined;
}
this.fireSelectValueChange(selectedValue);
}
var RangeCalendar = (0, _createReactClass2['default'])({
displayName: 'RangeCalendar',
propTypes: {
prefixCls: _propTypes2['default'].string,
dateInputPlaceholder: _propTypes2['default'].any,
defaultValue: _propTypes2['default'].any,
value: _propTypes2['default'].any,
hoverValue: _propTypes2['default'].any,
timePicker: _propTypes2['default'].any,
showOk: _propTypes2['default'].bool,
showToday: _propTypes2['default'].bool,
defaultSelectedValue: _propTypes2['default'].array,
selectedValue: _propTypes2['default'].array,
onOk: _propTypes2['default'].func,
showClear: _propTypes2['default'].bool,
locale: _propTypes2['default'].object,
onChange: _propTypes2['default'].func,
onSelect: _propTypes2['default'].func,
onValueChange: _propTypes2['default'].func,
onHoverChange: _propTypes2['default'].func,
format: _propTypes2['default'].oneOfType([_propTypes2['default'].object, _propTypes2['default'].string]),
onClear: _propTypes2['default'].func,
type: _propTypes2['default'].any,
disabledDate: _propTypes2['default'].func,
disabledTime: _propTypes2['default'].func
},
mixins: [_CommonMixin2['default']],
getDefaultProps: function getDefaultProps() {
return {
type: 'both',
defaultSelectedValue: [],
onValueChange: noop,
onHoverChange: noop,
disabledTime: noop,
showToday: true
};
},
getInitialState: function getInitialState() {
var props = this.props;
var selectedValue = props.selectedValue || props.defaultSelectedValue;
var value = normalizeAnchor(props, 1);
return {
selectedValue: selectedValue,
prevSelectedValue: selectedValue,
firstSelectedValue: null,
hoverValue: props.hoverValue || [],
value: value,
showTimePicker: false,
isStartMonthYearPanelShow: false,
isEndMonthYearPanelShow: false
};
},
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
var newState = {};
if ('value' in nextProps) {
if (nextProps.value) {
newState.value = nextProps.value;
} else {
newState.value = normalizeAnchor(nextProps, 0);
}
this.setState(newState);
}
if ('hoverValue' in nextProps) {
this.setState({ hoverValue: nextProps.hoverValue });
}
if ('selectedValue' in nextProps) {
newState.selectedValue = nextProps.selectedValue;
newState.prevSelectedValue = nextProps.selectedValue;
this.setState(newState);
}
},
onDatePanelEnter: function onDatePanelEnter() {
if (this.hasSelectedValue()) {
this.fireHoverValueChange(this.state.selectedValue.concat());
}
},
onDatePanelLeave: function onDatePanelLeave() {
if (this.hasSelectedValue()) {
this.fireHoverValueChange([]);
}
},
onSelect: function onSelect(value) {
var type = this.props.type;
var _state = this.state,
selectedValue = _state.selectedValue,
prevSelectedValue = _state.prevSelectedValue,
firstSelectedValue = _state.firstSelectedValue;
var nextSelectedValue = void 0;
if (type === 'both') {
if (!firstSelectedValue) {
(0, _util.syncTime)(prevSelectedValue[0], value);
nextSelectedValue = [value];
} else if (this.compare(firstSelectedValue, value) < 0) {
(0, _util.syncTime)(prevSelectedValue[1], value);
nextSelectedValue = [firstSelectedValue, value];
} else {
(0, _util.syncTime)(prevSelectedValue[0], value);
(0, _util.syncTime)(prevSelectedValue[1], firstSelectedValue);
nextSelectedValue = [value, firstSelectedValue];
}
} else if (type === 'start') {
(0, _util.syncTime)(prevSelectedValue[0], value);
var endValue = selectedValue[1];
nextSelectedValue = endValue && this.compare(endValue, value) > 0 ? [value, endValue] : [value];
} else {
// type === 'end'
var startValue = selectedValue[0];
if (startValue && this.compare(startValue, value) <= 0) {
(0, _util.syncTime)(prevSelectedValue[1], value);
nextSelectedValue = [startValue, value];
} else {
(0, _util.syncTime)(prevSelectedValue[0], value);
nextSelectedValue = [value];
}
}
this.fireSelectValueChange(nextSelectedValue);
},
onDayHover: function onDayHover(value) {
var hoverValue = [];
var _state2 = this.state,
selectedValue = _state2.selectedValue,
firstSelectedValue = _state2.firstSelectedValue;
var type = this.props.type;
if (type === 'start' && selectedValue[1]) {
hoverValue = this.compare(value, selectedValue[1]) < 0 ? [value, selectedValue[1]] : [value];
} else if (type === 'end' && selectedValue[0]) {
hoverValue = this.compare(value, selectedValue[0]) > 0 ? [selectedValue[0], value] : [];
} else {
if (!firstSelectedValue) {
return;
}
hoverValue = this.compare(value, firstSelectedValue) < 0 ? [value, firstSelectedValue] : [firstSelectedValue, value];
}
this.fireHoverValueChange(hoverValue);
},
onToday: function onToday() {
var startValue = (0, _util.getTodayTime)(this.state.value[0]);
var endValue = startValue.clone().add(1, 'months');
this.setState({ value: [startValue, endValue] });
},
onOpenTimePicker: function onOpenTimePicker() {
this.setState({
showTimePicker: true
});
},
onCloseTimePicker: function onCloseTimePicker() {
this.setState({
showTimePicker: false
});
},
onOk: function onOk() {
var selectedValue = this.state.selectedValue;
if (this.isAllowedDateAndTime(selectedValue)) {
this.props.onOk(this.state.selectedValue);
}
},
onStartInputSelect: function onStartInputSelect() {
for (var _len = arguments.length, oargs = Array(_len), _key = 0; _key < _len; _key++) {
oargs[_key] = arguments[_key];
}
var args = ['left'].concat(oargs);
return onInputSelect.apply(this, args);
},
onEndInputSelect: function onEndInputSelect() {
for (var _len2 = arguments.length, oargs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
oargs[_key2] = arguments[_key2];
}
var args = ['right'].concat(oargs);
return onInputSelect.apply(this, args);
},
onStartValueChange: function onStartValueChange(leftValue) {
var value = [].concat((0, _toConsumableArray3['default'])(this.state.value));
value[0] = leftValue;
return this.fireValueChange(value);
},
onEndValueChange: function onEndValueChange(rightValue) {
var value = [].concat((0, _toConsumableArray3['default'])(this.state.value));
value[1] = rightValue;
return this.fireValueChange(value);
},
onStartPanelChange: function onStartPanelChange(_ref) {
var showMonthPanel = _ref.showMonthPanel,
showYearPanel = _ref.showYearPanel;
this.setState({ isStartMonthYearPanelShow: showMonthPanel || showYearPanel });
},
onEndPanelChange: function onEndPanelChange(_ref2) {
var showMonthPanel = _ref2.showMonthPanel,
showYearPanel = _ref2.showYearPanel;
this.setState({ isEndMonthYearPanelShow: showMonthPanel || showYearPanel });
},
getStartValue: function getStartValue() {
var value = this.state.value[0];
var selectedValue = this.state.selectedValue;
// keep selectedTime when select date
if (selectedValue[0] && this.props.timePicker) {
value = value.clone();
(0, _util.syncTime)(selectedValue[0], value);
}
if (this.state.showTimePicker && selectedValue[0]) {
return selectedValue[0];
}
return value;
},
getEndValue: function getEndValue() {
var _state3 = this.state,
value = _state3.value,
selectedValue = _state3.selectedValue,
showTimePicker = _state3.showTimePicker;
var endValue = value[1] ? value[1].clone() : value[0].clone().add(1, 'month');
// keep selectedTime when select date
if (selectedValue[1] && this.props.timePicker) {
(0, _util.syncTime)(selectedValue[1], endValue);
}
if (showTimePicker) {
return selectedValue[1] ? selectedValue[1] : this.getStartValue();
}
return endValue;
},
// get disabled hours for second picker
getEndDisableTime: function getEndDisableTime() {
var _state4 = this.state,
selectedValue = _state4.selectedValue,
value = _state4.value;
var startValue = selectedValue && selectedValue[0] || value[0].clone();
// if startTime and endTime is same day..
// the second time picker will not able to pick time before first time picker
if (!selectedValue[1] || startValue.isSame(selectedValue[1], 'day')) {
var hours = startValue.hour();
var minutes = startValue.minute();
var second = startValue.second();
var _disabledHours = generateOptions(hours);
var _disabledMinutes = generateOptions(minutes);
var _disabledSeconds = generateOptions(second);
return {
disabledHours: function disabledHours() {
return _disabledHours;
},
disabledMinutes: function disabledMinutes(hour) {
if (hour === hours) {
return _disabledMinutes;
}
return [];
},
disabledSeconds: function disabledSeconds(hour, minute) {
if (hour === hours && minute === minutes) {
return _disabledSeconds;
}
return [];
}
};
}
return null;
},
isAllowedDateAndTime: function isAllowedDateAndTime(selectedValue) {
return (0, _util.isAllowedDate)(selectedValue[0], this.props.disabledDate, this.disabledStartTime) && (0, _util.isAllowedDate)(selectedValue[1], this.props.disabledDate, this.disabledEndTime);
},
hasSelectedValue: function hasSelectedValue() {
var selectedValue = this.state.selectedValue;
return !!selectedValue[1] && !!selectedValue[0];
},
compare: function compare(v1, v2) {
if (this.props.timePicker) {
return v1.diff(v2);
}
return v1.diff(v2, 'days');
},
fireSelectValueChange: function fireSelectValueChange(selectedValue, direct) {
var timePicker = this.props.timePicker;
var prevSelectedValue = this.state.prevSelectedValue;
if (timePicker && timePicker.props.defaultValue) {
var timePickerDefaultValue = timePicker.props.defaultValue;
if (!prevSelectedValue[0] && selectedValue[0]) {
(0, _util.syncTime)(timePickerDefaultValue[0], selectedValue[0]);
}
if (!prevSelectedValue[1] && selectedValue[1]) {
(0, _util.syncTime)(timePickerDefaultValue[1], selectedValue[1]);
}
}
if (!('selectedValue' in this.props)) {
this.setState({
selectedValue: selectedValue
});
}
// 尚未选择过时间,直接输入的话
if (!this.state.selectedValue[0] || !this.state.selectedValue[1]) {
var startValue = selectedValue[0] || (0, _moment2['default'])();
var endValue = selectedValue[1] || startValue.clone().add(1, 'months');
this.setState({
selectedValue: selectedValue,
value: getValueFromSelectedValue([startValue, endValue])
});
}
if (selectedValue[0] && !selectedValue[1]) {
this.setState({ firstSelectedValue: selectedValue[0] });
this.fireHoverValueChange(selectedValue.concat());
}
this.props.onChange(selectedValue);
if (direct || selectedValue[0] && selectedValue[1]) {
this.setState({
prevSelectedValue: selectedValue,
firstSelectedValue: null
});
this.fireHoverValueChange([]);
this.props.onSelect(selectedValue);
}
},
fireValueChange: function fireValueChange(value) {
var props = this.props;
if (!('value' in props)) {
this.setState({
value: value
});
}
props.onValueChange(value);
},
fireHoverValueChange: function fireHoverValueChange(hoverValue) {
var props = this.props;
if (!('hoverValue' in props)) {
this.setState({ hoverValue: hoverValue });
}
props.onHoverChange(hoverValue);
},
clear: function clear() {
this.fireSelectValueChange([], true);
this.props.onClear();
},
disabledStartTime: function disabledStartTime(time) {
return this.props.disabledTime(time, 'start');
},
disabledEndTime: function disabledEndTime(time) {
return this.props.disabledTime(time, 'end');
},
disabledStartMonth: function disabledStartMonth(month) {
var value = this.state.value;
return month.isSameOrAfter(value[1], 'month');
},
disabledEndMonth: function disabledEndMonth(month) {
var value = this.state.value;
return month.isSameOrBefore(value[0], 'month');
},
render: function render() {
var _className, _classnames;
var props = this.props;
var state = this.state;
var showTimePicker = state.showTimePicker,
isStartMonthYearPanelShow = state.isStartMonthYearPanelShow,
isEndMonthYearPanelShow = state.isEndMonthYearPanelShow;
var prefixCls = props.prefixCls,
dateInputPlaceholder = props.dateInputPlaceholder,
timePicker = props.timePicker,
showOk = props.showOk,
locale = props.locale,
showClear = props.showClear,
showToday = props.showToday,
type = props.type;
var hoverValue = state.hoverValue,
selectedValue = state.selectedValue;
var className = (_className = {}, (0, _defineProperty3['default'])(_className, props.className, !!props.className), (0, _defineProperty3['default'])(_className, prefixCls, 1), (0, _defineProperty3['default'])(_className, prefixCls + '-hidden', !props.visible), (0, _defineProperty3['default'])(_className, prefixCls + '-range', 1), (0, _defineProperty3['default'])(_className, prefixCls + '-show-time-picker', showTimePicker), (0, _defineProperty3['default'])(_className, prefixCls + '-week-number', props.showWeekNumber), _className);
var classes = (0, _classnames3['default'])(className);
var newProps = {
selectedValue: state.selectedValue,
onSelect: this.onSelect,
onDayHover: type === 'start' && selectedValue[1] || type === 'end' && selectedValue[0] || !!hoverValue.length ? this.onDayHover : undefined
};
var placeholder1 = void 0;
var placeholder2 = void 0;
if (dateInputPlaceholder) {
if (Array.isArray(dateInputPlaceholder)) {
var _dateInputPlaceholder = (0, _slicedToArray3['default'])(dateInputPlaceholder, 2);
placeholder1 = _dateInputPlaceholder[0];
placeholder2 = _dateInputPlaceholder[1];
} else {
placeholder1 = placeholder2 = dateInputPlaceholder;
}
}
var showOkButton = showOk === true || showOk !== false && !!timePicker;
var cls = (0, _classnames3['default'])((_classnames = {}, (0, _defineProperty3['default'])(_classnames, prefixCls + '-footer', true), (0, _defineProperty3['default'])(_classnames, prefixCls + '-range-bottom', true), (0, _defineProperty3['default'])(_classnames, prefixCls + '-footer-show-ok', showOkButton), _classnames));
var startValue = this.getStartValue();
var endValue = this.getEndValue();
var todayTime = (0, _util.getTodayTime)(startValue);
var thisMonth = todayTime.month();
var thisYear = todayTime.year();
var isTodayInView = startValue.year() === thisYear && startValue.month() === thisMonth || endValue.year() === thisYear && endValue.month() === thisMonth;
var nextMonthOfStart = startValue.clone().add(1, 'months');
var isClosestMonths = nextMonthOfStart.year() === endValue.year() && nextMonthOfStart.month() === endValue.month();
return _react2['default'].createElement(
'div',
{
ref: 'root',
className: classes,
style: props.style,
tabIndex: '0'
},
props.renderSidebar(),
_react2['default'].createElement(
'div',
{ className: prefixCls + '-panel' },
showClear && selectedValue[0] && selectedValue[1] ? _react2['default'].createElement('a', {
className: prefixCls + '-clear-btn',
role: 'button',
title: locale.clear,
onClick: this.clear
}) : null,
_react2['default'].createElement(
'div',
{
className: prefixCls + '-date-panel',
onMouseLeave: type !== 'both' ? this.onDatePanelLeave : undefined,
onMouseEnter: type !== 'both' ? this.onDatePanelEnter : undefined
},
_react2['default'].createElement(_CalendarPart2['default'], (0, _extends3['default'])({}, props, newProps, {
hoverValue: hoverValue,
direction: 'left',
disabledTime: this.disabledStartTime,
disabledMonth: this.disabledStartMonth,
format: this.getFormat(),
value: startValue,
placeholder: placeholder1,
onInputSelect: this.onStartInputSelect,
onValueChange: this.onStartValueChange,
onPanelChange: this.onStartPanelChange,
timePicker: timePicker,
showTimePicker: showTimePicker,
enablePrev: true,
enableNext: !isClosestMonths || isEndMonthYearPanelShow
})),
_react2['default'].createElement(
'span',
{ className: prefixCls + '-range-middle' },
'~'
),
_react2['default'].createElement(_CalendarPart2['default'], (0, _extends3['default'])({}, props, newProps, {
hoverValue: hoverValue,
direction: 'right',
format: this.getFormat(),
timePickerDisabledTime: this.getEndDisableTime(),
placeholder: placeholder2,
value: endValue,
onInputSelect: this.onEndInputSelect,
onValueChange: this.onEndValueChange,
onPanelChange: this.onEndPanelChange,
timePicker: timePicker,
showTimePicker: showTimePicker,
disabledTime: this.disabledEndTime,
disabledMonth: this.disabledEndMonth,
enablePrev: !isClosestMonths || isStartMonthYearPanelShow,
enableNext: true
}))
),
_react2['default'].createElement(
'div',
{ className: cls },
props.renderFooter(),
showToday || props.timePicker || showOkButton ? _react2['default'].createElement(
'div',
{ className: prefixCls + '-footer-btn' },
showToday ? _react2['default'].createElement(_TodayButton2['default'], (0, _extends3['default'])({}, props, {
disabled: isTodayInView,
value: state.value[0],
onToday: this.onToday,
text: locale.backToToday
})) : null,
props.timePicker ? _react2['default'].createElement(_TimePickerButton2['default'], (0, _extends3['default'])({}, props, {
showTimePicker: showTimePicker,
onOpenTimePicker: this.onOpenTimePicker,
onCloseTimePicker: this.onCloseTimePicker,
timePickerDisabled: !this.hasSelectedValue() || hoverValue.length
})) : null,
showOkButton ? _react2['default'].createElement(_OkButton2['default'], (0, _extends3['default'])({}, props, {
onOk: this.onOk,
okDisabled: !this.isAllowedDateAndTime(selectedValue) || !this.hasSelectedValue() || hoverValue.length
})) : null
) : null
)
)
);
}
});
exports['default'] = RangeCalendar;
module.exports = exports['default'];
/***/ }),
/* 443 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _from = __webpack_require__(444);
var _from2 = _interopRequireDefault(_from);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
arr2[i] = arr[i];
}
return arr2;
} else {
return (0, _from2.default)(arr);
}
};
/***/ }),
/* 444 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(445), __esModule: true };
/***/ }),
/* 445 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(234);
__webpack_require__(446);
module.exports = __webpack_require__(41).Array.from;
/***/ }),
/* 446 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var ctx = __webpack_require__(42);
var $export = __webpack_require__(39);
var toObject = __webpack_require__(222);
var call = __webpack_require__(447);
var isArrayIter = __webpack_require__(448);
var toLength = __webpack_require__(63);
var createProperty = __webpack_require__(449);
var getIterFn = __webpack_require__(450);
$export($export.S + $export.F * !__webpack_require__(452)(function (iter) { Array.from(iter); }), 'Array', {
// 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
var O = toObject(arrayLike);
var C = typeof this == 'function' ? this : Array;
var aLen = arguments.length;
var mapfn = aLen > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
var index = 0;
var iterFn = getIterFn(O);
var length, result, step, iterator;
if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
// if object isn't iterable or it's array with default iterator - use simple case
if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
}
} else {
length = toLength(O.length);
for (result = new C(length); length > index; index++) {
createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
}
}
result.length = index;
return result;
}
});
/***/ }),
/* 447 */
/***/ (function(module, exports, __webpack_require__) {
// call something on iterator step with safe closing on error
var anObject = __webpack_require__(46);
module.exports = function (iterator, fn, value, entries) {
try {
return entries ? fn(anObject(value)[0], value[1]) : fn(value);
// 7.4.6 IteratorClose(iterator, completion)
} catch (e) {
var ret = iterator['return'];
if (ret !== undefined) anObject(ret.call(iterator));
throw e;
}
};
/***/ }),
/* 448 */
/***/ (function(module, exports, __webpack_require__) {
// check on default Array iterator
var Iterators = __webpack_require__(239);
var ITERATOR = __webpack_require__(245)('iterator');
var ArrayProto = Array.prototype;
module.exports = function (it) {
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
};
/***/ }),
/* 449 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var $defineProperty = __webpack_require__(45);
var createDesc = __webpack_require__(53);
module.exports = function (object, index, value) {
if (index in object) $defineProperty.f(object, index, createDesc(0, value));
else object[index] = value;
};
/***/ }),
/* 450 */
/***/ (function(module, exports, __webpack_require__) {
var classof = __webpack_require__(451);
var ITERATOR = __webpack_require__(245)('iterator');
var Iterators = __webpack_require__(239);
module.exports = __webpack_require__(41).getIteratorMethod = function (it) {
if (it != undefined) return it[ITERATOR]
|| it['@@iterator']
|| Iterators[classof(it)];
};
/***/ }),
/* 451 */
/***/ (function(module, exports, __webpack_require__) {
// getting tag from 19.1.3.6 Object.prototype.toString()
var cof = __webpack_require__(60);
var TAG = __webpack_require__(245)('toStringTag');
// ES3 wrong here
var ARG = cof(function () { return arguments; }()) == 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
try {
return it[key];
} catch (e) { /* empty */ }
};
module.exports = function (it) {
var O, T, B;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
// builtinTag case
: ARG ? cof(O)
// ES3 arguments fallback
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};
/***/ }),
/* 452 */
/***/ (function(module, exports, __webpack_require__) {
var ITERATOR = __webpack_require__(245)('iterator');
var SAFE_CLOSING = false;
try {
var riter = [7][ITERATOR]();
riter['return'] = function () { SAFE_CLOSING = true; };
// eslint-disable-next-line no-throw-literal
Array.from(riter, function () { throw 2; });
} catch (e) { /* empty */ }
module.exports = function (exec, skipClosing) {
if (!skipClosing && !SAFE_CLOSING) return false;
var safe = false;
try {
var arr = [7];
var iter = arr[ITERATOR]();
iter.next = function () { return { done: safe = true }; };
arr[ITERATOR] = function () { return iter; };
exec(arr);
} catch (e) { /* empty */ }
return safe;
};
/***/ }),
/* 453 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _isIterable2 = __webpack_require__(454);
var _isIterable3 = _interopRequireDefault(_isIterable2);
var _getIterator2 = __webpack_require__(457);
var _getIterator3 = _interopRequireDefault(_getIterator2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function () {
function sliceIterator(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"]) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
return function (arr, i) {
if (Array.isArray(arr)) {
return arr;
} else if ((0, _isIterable3.default)(Object(arr))) {
return sliceIterator(arr, i);
} else {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
};
}();
/***/ }),
/* 454 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(455), __esModule: true };
/***/ }),
/* 455 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(247);
__webpack_require__(234);
module.exports = __webpack_require__(456);
/***/ }),
/* 456 */
/***/ (function(module, exports, __webpack_require__) {
var classof = __webpack_require__(451);
var ITERATOR = __webpack_require__(245)('iterator');
var Iterators = __webpack_require__(239);
module.exports = __webpack_require__(41).isIterable = function (it) {
var O = Object(it);
return O[ITERATOR] !== undefined
|| '@@iterator' in O
// eslint-disable-next-line no-prototype-builtins
|| Iterators.hasOwnProperty(classof(O));
};
/***/ }),
/* 457 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(458), __esModule: true };
/***/ }),
/* 458 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(247);
__webpack_require__(234);
module.exports = __webpack_require__(459);
/***/ }),
/* 459 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(46);
var get = __webpack_require__(450);
module.exports = __webpack_require__(41).getIterator = function (it) {
var iterFn = get(it);
if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
return anObject(iterFn.call(it));
};
/***/ }),
/* 460 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = __webpack_require__(216);
var _extends3 = _interopRequireDefault(_extends2);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _createReactClass = __webpack_require__(85);
var _createReactClass2 = _interopRequireDefault(_createReactClass);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _CalendarHeader = __webpack_require__(399);
var _CalendarHeader2 = _interopRequireDefault(_CalendarHeader);
var _DateTable = __webpack_require__(224);
var _DateTable2 = _interopRequireDefault(_DateTable);
var _DateInput = __webpack_require__(412);
var _DateInput2 = _interopRequireDefault(_DateInput);
var _index = __webpack_require__(398);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var CalendarPart = (0, _createReactClass2['default'])({
displayName: 'CalendarPart',
propTypes: {
prefixCls: _propTypes2['default'].string,
value: _propTypes2['default'].any,
hoverValue: _propTypes2['default'].any,
selectedValue: _propTypes2['default'].any,
direction: _propTypes2['default'].any,
locale: _propTypes2['default'].any,
showTimePicker: _propTypes2['default'].bool,
format: _propTypes2['default'].any,
placeholder: _propTypes2['default'].any,
disabledDate: _propTypes2['default'].any,
timePicker: _propTypes2['default'].any,
disabledTime: _propTypes2['default'].any,
onInputSelect: _propTypes2['default'].func,
timePickerDisabledTime: _propTypes2['default'].object,
enableNext: _propTypes2['default'].any,
enablePrev: _propTypes2['default'].any
},
render: function render() {
var props = this.props;
var prefixCls = props.prefixCls,
value = props.value,
hoverValue = props.hoverValue,
selectedValue = props.selectedValue,
direction = props.direction,
locale = props.locale,
format = props.format,
placeholder = props.placeholder,
disabledDate = props.disabledDate,
timePicker = props.timePicker,
disabledTime = props.disabledTime,
timePickerDisabledTime = props.timePickerDisabledTime,
showTimePicker = props.showTimePicker,
onInputSelect = props.onInputSelect,
enablePrev = props.enablePrev,
enableNext = props.enableNext;
var shouldShowTimePicker = showTimePicker && timePicker;
var disabledTimeConfig = shouldShowTimePicker && disabledTime ? (0, _index.getTimeConfig)(selectedValue, disabledTime) : null;
var rangeClassName = prefixCls + '-range';
var newProps = {
locale: locale,
value: value,
prefixCls: prefixCls,
showTimePicker: showTimePicker
};
var index = direction === 'left' ? 0 : 1;
var timePickerEle = shouldShowTimePicker && _react2['default'].cloneElement(timePicker, (0, _extends3['default'])({
showHour: true,
showMinute: true,
showSecond: true
}, timePicker.props, disabledTimeConfig, timePickerDisabledTime, {
onChange: onInputSelect,
defaultOpenValue: value,
value: selectedValue[index]
}));
return _react2['default'].createElement(
'div',
{ className: rangeClassName + '-part ' + rangeClassName + '-' + direction },
_react2['default'].createElement(_DateInput2['default'], {
format: format,
locale: locale,
prefixCls: prefixCls,
timePicker: timePicker,
disabledDate: disabledDate,
placeholder: placeholder,
disabledTime: disabledTime,
value: value,
showClear: false,
selectedValue: selectedValue[index],
onChange: onInputSelect
}),
_react2['default'].createElement(
'div',
{ style: { outline: 'none' } },
_react2['default'].createElement(_CalendarHeader2['default'], (0, _extends3['default'])({}, newProps, {
enableNext: enableNext,
enablePrev: enablePrev,
onValueChange: props.onValueChange,
onPanelChange: props.onPanelChange,
disabledMonth: props.disabledMonth
})),
showTimePicker ? _react2['default'].createElement(
'div',
{ className: prefixCls + '-time-picker' },
_react2['default'].createElement(
'div',
{ className: prefixCls + '-time-picker-panel' },
timePickerEle
)
) : null,
_react2['default'].createElement(
'div',
{ className: prefixCls + '-body' },
_react2['default'].createElement(_DateTable2['default'], (0, _extends3['default'])({}, newProps, {
hoverValue: hoverValue,
selectedValue: selectedValue,
dateRender: props.dateRender,
onSelect: props.onSelect,
onDayHover: props.onDayHover,
disabledDate: disabledDate,
showWeekNumber: props.showWeekNumber
}))
)
)
);
}
});
exports['default'] = CalendarPart;
module.exports = exports['default'];
/***/ }),
/* 461 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = {
today: '今天',
now: '此刻',
backToToday: '返回今天',
ok: '确定',
timeSelect: '选择时间',
dateSelect: '选择日期',
clear: '清除',
month: '月',
year: '年',
previousMonth: '上个月 (翻页上键)',
nextMonth: '下个月 (翻页下键)',
monthSelect: '选择月份',
yearSelect: '选择年份',
decadeSelect: '选择年代',
yearFormat: 'YYYY年',
dayFormat: 'D日',
dateFormat: 'YYYY年M月D日',
dateTimeFormat: 'YYYY年M月D日 HH时mm分ss秒',
previousYear: '上一年 (Control键加左方向键)',
nextYear: '下一年 (Control键加右方向键)',
previousDecade: '上一年代',
nextDecade: '下一年代',
previousCentury: '上一世纪',
nextCentury: '下一世纪'
};
module.exports = exports['default'];
/***/ }),
/* 462 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _rcCalendar = __webpack_require__(214);
var _rcCalendar2 = _interopRequireDefault(_rcCalendar);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _Picker = __webpack_require__(413);
var _Picker2 = _interopRequireDefault(_Picker);
var _beeFormControl = __webpack_require__(164);
var _beeFormControl2 = _interopRequireDefault(_beeFormControl);
var _zh_CN = __webpack_require__(461);
var _zh_CN2 = _interopRequireDefault(_zh_CN);
var _en_US = __webpack_require__(411);
var _en_US2 = _interopRequireDefault(_en_US);
var _moment = __webpack_require__(275);
var _moment2 = _interopRequireDefault(_moment);
__webpack_require__(393);
__webpack_require__(305);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
* Created by chief on 17/4/6.
*/
var cn = location.search.indexOf("cn") !== -1;
var now = (0, _moment2["default"])();
if (cn) {
now.locale("zh-cn").utcOffset(8);
} else {
now.locale("en-gb").utcOffset(0);
}
var format = "YYYY-Wo";
var style = "\n.week-calendar {\n width: 386px;\n}\n.week-calendar .rc-calendar-tbody > tr:hover\n.rc-calendar-date {\n background: #ebfaff;\n}\n\n.week-calendar .rc-calendar-tbody > tr:hover\n.rc-calendar-selected-day .rc-calendar-date {\n background: #3fc7fa;\n}\n\n.week-calendar .week-calendar-sidebar {\n position:absolute;\n top:0;\n left:0;\n bottom:0;\n width:100px;\n border-right: 1px solid #ccc;\n}\n.week-calendar .rc-calendar-panel {\n margin-left: 100px;\n}\n";
var WeekPicker = function (_Component) {
_inherits(WeekPicker, _Component);
function WeekPicker(props, context) {
_classCallCheck(this, WeekPicker);
var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
_this.onChange = function (value) {
_this.setState({
value: value
});
};
_this.onOpenChange = function (open) {
_this.setState({
open: open
});
};
_this.dateRender = function (current) {
var selectedValue = _this.state.value;
if (selectedValue && current.year() === selectedValue.year() && current.week() === selectedValue.week()) {
return _react2["default"].createElement(
"div",
{ className: "rc-calendar-selected-day" },
_react2["default"].createElement(
"div",
{ className: "rc-calendar-date" },
current.date()
)
);
}
return _react2["default"].createElement(
"div",
{ className: "rc-calendar-date" },
current.date()
);
};
_this.lastWeek = function () {
var value = _this.state.value || now;
value.add(-1, "weeks");
_this.setState({
value: value,
open: false
});
};
_this.renderSidebar = function () {
return _react2["default"].createElement(
"div",
{ className: "week-calendar-sidebar", key: "sidebar" },
_react2["default"].createElement(
"button",
{
className: "week-calendar-sidebar-button",
onClick: _this.lastWeek.bind(_this),
style: { margin: 8 }
},
"\u4E0A\u4E00\u5468"
)
);
};
_this.onTypeChange = function (type) {
_this.setState({
type: type
});
};
_this.state = {
value: props.value || props.defaultValue,
open: false
};
return _this;
}
WeekPicker.prototype.render = function render() {
var _this2 = this;
var state = this.state;
var calendar = _react2["default"].createElement(_rcCalendar2["default"], {
className: "week-calendar",
showWeekNumber: true,
renderSidebar: this.renderSidebar,
dateRender: this.dateRender,
locale: cn ? _zh_CN2["default"] : _en_US2["default"],
format: format,
dateInputPlaceholder: this.props.placeholder,
defaultValue: now,
showDateInput: true
});
return _react2["default"].createElement(
"div",
null,
_react2["default"].createElement("style", { dangerouslySetInnerHTML: { __html: style } }),
_react2["default"].createElement(
_Picker2["default"],
{
onOpenChange: this.onOpenChange,
open: this.state.open,
animation: "slide-up",
calendar: calendar,
value: state.value,
onChange: this.onChange
},
function (_ref) {
var value = _ref.value;
return _react2["default"].createElement(_beeFormControl2["default"], {
placeholder: _this2.props.placeholder,
disabled: state.disabled,
readOnly: true,
tabIndex: "-1",
className: _this2.props.className,
value: value && value.format(format) || ""
});
}
)
);
};
return WeekPicker;
}(_react.Component);
exports["default"] = WeekPicker;
module.exports = exports["default"];
/***/ }),
/* 463 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _beeIcon = __webpack_require__(125);
var _beeIcon2 = _interopRequireDefault(_beeIcon);
var _beeSelect = __webpack_require__(166);
var _beeSelect2 = _interopRequireDefault(_beeSelect);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
dataSource: _propTypes2["default"].array
};
var SelectRender = function (_Component) {
_inherits(SelectRender, _Component);
function SelectRender() {
var _temp, _this, _ret;
_classCallCheck(this, SelectRender);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = {
value: _this.props.value,
editable: false
}, _this.handleChange = function (e) {
var value = e;
if (_this.props.onChange) {
_this.props.onChange(value);
}
_this.setState({ value: value });
setTimeout(function () {
_this.setState({ editable: false });
}, 0);
}, _this.check = function () {
_this.setState({ editable: false });
if (_this.props.onChange) {
_this.props.onChange(_this.state.value);
}
}, _this.edit = function () {
_this.setState({ editable: true });
}, _temp), _possibleConstructorReturn(_this, _ret);
}
SelectRender.prototype.render = function render() {
var _state = this.state,
value = _state.value,
editable = _state.editable;
var _props = this.props,
isclickTrigger = _props.isclickTrigger,
dataSource = _props.dataSource;
var cellContent = "";
if (editable) {
cellContent = isclickTrigger ? _react2["default"].createElement(
"div",
{ className: "editable-cell-input-wrapper" },
_react2["default"].createElement(
_beeSelect2["default"],
_extends({}, this.props, {
value: this.state.value,
onChange: this.handleChange
}),
this.props.children
),
_react2["default"].createElement(_beeIcon2["default"], {
type: "uf-correct",
className: "editable-cell-icon-check",
onClick: this.check
})
) : _react2["default"].createElement(
"div",
{ className: "editable-cell-input-wrapper" },
_react2["default"].createElement(
_beeSelect2["default"],
_extends({}, this.props, {
value: this.state.value,
onChange: this.handleChange
}),
this.props.children
),
_react2["default"].createElement(_beeIcon2["default"], {
type: "uf-correct",
className: "editable-cell-icon-check",
onClick: this.check
})
);
} else {
if (dataSource && dataSource.length > 0) {
for (var index = 0; index < dataSource.length; index++) {
var element = dataSource[index];
if (element.value === value) {
value = element.key;
break;
}
}
}
cellContent = isclickTrigger ? _react2["default"].createElement(
"div",
{ className: "editable-cell-text-wrapper", onClick: this.edit },
value || " "
) : _react2["default"].createElement(
"div",
{ className: "editable-cell-text-wrapper" },
value || " ",
_react2["default"].createElement(_beeIcon2["default"], {
type: "uf-pencil",
className: "editable-cell-icon",
onClick: this.edit
})
);
}
return _react2["default"].createElement(
"div",
{ className: "editable-cell" },
cellContent
);
};
return SelectRender;
}(_react.Component);
exports["default"] = SelectRender;
SelectRender.propTypes = propTypes;
module.exports = exports["default"];
/***/ }),
/* 464 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 表格行/列合并
* @description 表头只支持列合并,使用 column 里的 colSpan 进行设置。表格支持行/列合并,使用 render 里的单元格属性 colSpan 或者 rowSpan 设值为 0 时,设置的表格不会渲染。
*
*/
var renderContent = function renderContent(value, row, index) {
var obj = {
children: value,
props: {}
};
if (index === 4) {
obj.props.colSpan = 0;
}
return obj;
};
var columns = [{
title: 'Name',
key: "name",
dataIndex: 'name',
render: function render(text, row, index) {
if (index < 4) {
return _react2["default"].createElement(
"a",
{ href: "#" },
text
);
}
return {
children: _react2["default"].createElement(
"a",
{ href: "#" },
text
),
props: {
colSpan: 5
}
};
}
}, {
title: 'Age',
key: "Age",
dataIndex: 'age',
render: renderContent
}, {
title: 'Home phone',
colSpan: 2,
key: "tel",
dataIndex: 'tel',
render: function render(value, row, index) {
var obj = {
children: value,
props: {}
};
if (index === 2) {
obj.props.rowSpan = 2;
}
if (index === 3) {
obj.props.rowSpan = 0;
}
if (index === 4) {
obj.props.colSpan = 0;
}
return obj;
}
}, {
title: 'Phone',
colSpan: 0,
key: "phone",
dataIndex: 'phone',
render: renderContent
}, {
title: 'Address',
key: "address",
dataIndex: 'address',
render: renderContent
}];
var data = [{
key: '1',
name: 'John Brown',
age: 32,
tel: '0571-22098909',
phone: 18889898989,
address: 'New York No. 1 Lake Park'
}, {
key: '2',
name: 'Jim Green',
tel: '0571-22098333',
phone: 18889898888,
age: 42,
address: 'London No. 1 Lake Park'
}, {
key: '3',
name: 'Joe Black',
age: 32,
tel: '0575-22098909',
phone: 18900010002,
address: 'Sidney No. 1 Lake Park'
}, {
key: '4',
name: 'Jim Red',
age: 18,
tel: '0575-22098909',
phone: 18900010002,
address: 'London No. 2 Lake Park'
}, {
key: '5',
name: 'Jake White',
age: 18,
tel: '0575-22098909',
phone: 18900010002,
address: 'Dublin No. 2 Lake Park'
}];
var Demo15 = function (_Component) {
_inherits(Demo15, _Component);
function Demo15() {
_classCallCheck(this, Demo15);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
Demo15.prototype.render = function render() {
return _react2["default"].createElement(_src2["default"], { columns: columns, data: data });
};
return Demo15;
}(_react.Component);
exports["default"] = Demo15;
module.exports = exports["default"];
/***/ }),
/* 465 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 嵌套子表格
* @description 通过expandedRowRender参数来实现子表格
*
*/
var columns16 = [{ title: "用户名", dataIndex: "a", key: "a", width: 100 }, { id: "123", title: "性别", dataIndex: "b", key: "b", width: 100 }, { title: "年龄", dataIndex: "c", key: "c", width: 200 }, {
title: "操作",
dataIndex: "d",
key: "d",
render: function render(text, record, index) {
return _react2["default"].createElement(
"a",
{
href: "#",
onClick: function onClick() {
alert("这是第" + index + "列,内容为:" + text);
}
},
"\u4E00\u4E9B\u64CD\u4F5C"
);
}
}];
var data16 = [{ a: "令狐冲", b: "男", c: 41, d: "操作", key: "1" }, { a: "杨过", b: "男", c: 67, d: "操作", key: "2" }, { a: "郭靖", b: "男", c: 25, d: "操作", key: "3" }];
var Demo16 = function (_Component) {
_inherits(Demo16, _Component);
function Demo16(props) {
_classCallCheck(this, Demo16);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.expandedRowRender = function () {
return _react2["default"].createElement(_src2["default"], {
columns: columns16,
data: _this.state.data,
title: function title(currentData) {
return _react2["default"].createElement(
"div",
null,
"\u6807\u9898: \u8FD9\u662F\u4E00\u4E2A\u6807\u9898"
);
},
footer: function footer(currentData) {
return _react2["default"].createElement(
"div",
null,
"\u8868\u5C3E: \u6211\u662F\u5C0F\u5C3E\u5DF4"
);
}
});
};
_this.getData = function (expanded, record) {
//当点击展开的时候才去请求数据
if (expanded) {
if (record.key === '1') {
_this.setState({
data: [{ a: "令狐冲", b: "男", c: 41, d: "操作", key: "1" }, { a: "杨过", b: "男", c: 67, d: "操作", key: "2" }]
});
} else {
_this.setState({
data: [{ a: "令狐冲", b: "男", c: 41, d: "操作", key: "1" }]
});
}
}
};
_this.state = {
data: data16
};
return _this;
}
Demo16.prototype.render = function render() {
return _react2["default"].createElement(_src2["default"], {
columns: columns16,
data: data16,
onExpand: this.getData,
expandedRowRender: this.expandedRowRender,
title: function title(currentData) {
return _react2["default"].createElement(
"div",
null,
"\u6807\u9898: \u8FD9\u662F\u4E00\u4E2A\u6807\u9898"
);
},
footer: function footer(currentData) {
return _react2["default"].createElement(
"div",
null,
"\u8868\u5C3E: \u6211\u662F\u5C0F\u5C3E\u5DF4"
);
}
});
};
return Demo16;
}(_react.Component);
exports["default"] = Demo16;
module.exports = exports["default"];
/***/ }),
/* 466 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _beeButton = __webpack_require__(103);
var _beeButton2 = _interopRequireDefault(_beeButton);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
var _beeAnimate = __webpack_require__(135);
var _beeAnimate2 = _interopRequireDefault(_beeAnimate);
var _beeIcon = __webpack_require__(125);
var _beeIcon2 = _interopRequireDefault(_beeIcon);
var _beeFormControl = __webpack_require__(164);
var _beeFormControl2 = _interopRequireDefault(_beeFormControl);
var _beePopconfirm = __webpack_require__(467);
var _beePopconfirm2 = _interopRequireDefault(_beePopconfirm);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 增删改表格
* @description 这是带有增删改功能的表格(此编辑功能未使用render组件)
*
*/
var EditableCell = function (_React$Component) {
_inherits(EditableCell, _React$Component);
function EditableCell() {
var _temp, _this, _ret;
_classCallCheck(this, EditableCell);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
value: _this.props.value,
editable: false
}, _this.handleChange = function (e) {
var value = e.target.value;
_this.setState({ value: value });
}, _this.check = function () {
_this.setState({ editable: false });
if (_this.props.onChange) {
_this.props.onChange(_this.state.value);
}
}, _this.edit = function () {
_this.setState({ editable: true });
}, _this.handleKeydown = function (event) {
if (event.keyCode == 13) {
_this.check();
}
}, _temp), _possibleConstructorReturn(_this, _ret);
}
EditableCell.prototype.render = function render() {
var _state = this.state,
value = _state.value,
editable = _state.editable;
return _react2["default"].createElement(
"div",
{ className: "editable-cell" },
editable ? _react2["default"].createElement(
"div",
{ className: "editable-cell-input-wrapper" },
_react2["default"].createElement(_beeFormControl2["default"], {
value: value,
onChange: this.handleChange,
onKeyDown: this.handleKeydown
}),
_react2["default"].createElement(_beeIcon2["default"], {
type: "uf-correct",
className: "editable-cell-icon-check",
onClick: this.check
})
) : _react2["default"].createElement(
"div",
{ className: "editable-cell-text-wrapper" },
value || " ",
_react2["default"].createElement(_beeIcon2["default"], {
type: "uf-pencil",
className: "editable-cell-icon",
onClick: this.edit
})
)
);
};
return EditableCell;
}(_react2["default"].Component);
var Demo2 = function (_React$Component2) {
_inherits(Demo2, _React$Component2);
function Demo2(props) {
_classCallCheck(this, Demo2);
var _this2 = _possibleConstructorReturn(this, _React$Component2.call(this, props));
_this2.onCellChange = function (index, key) {
return function (value) {
var dataSource = [].concat(_toConsumableArray(_this2.state.dataSource));
dataSource[index][key] = value;
_this2.setState({ dataSource: dataSource });
};
};
_this2.onDelete = function (index) {
return function () {
var dataSource = [].concat(_toConsumableArray(_this2.state.dataSource));
dataSource.splice(index, 1);
_this2.setState({ dataSource: dataSource });
};
};
_this2.handleAdd = function () {
var _this2$state = _this2.state,
count = _this2$state.count,
dataSource = _this2$state.dataSource;
var newData = {
key: count,
name: "\u51E4\u59D0 " + count,
age: 32,
address: "100 100 100"
};
_this2.setState({
dataSource: [].concat(_toConsumableArray(dataSource), [newData]),
count: count + 1
});
};
_this2.getBodyWrapper = function (body) {
return _react2["default"].createElement(
_beeAnimate2["default"],
{
transitionName: "move",
component: "tbody",
className: body.props.className
},
body.props.children
);
};
_this2.columns = [{
title: "姓名",
dataIndex: "name",
key: "name",
width: "30%",
render: function render(text, record, index) {
return _react2["default"].createElement(EditableCell, {
value: text,
onChange: _this2.onCellChange(index, "name")
});
}
}, {
title: "年龄",
dataIndex: "age",
key: "age"
}, {
title: "你懂的",
dataIndex: "address",
key: "address"
}, {
title: "操作",
dataIndex: "operation",
key: "operation",
render: function render(text, record, index) {
return _this2.state.dataSource.length > 1 ? _react2["default"].createElement(
_beePopconfirm2["default"],
{ content: "\u786E\u8BA4\u5220\u9664?", id: "aa", onClose: _this2.onDelete(index) },
_react2["default"].createElement(_beeIcon2["default"], { type: "uf-del" })
) : null;
}
}];
_this2.state = {
dataSource: [{
key: "0",
name: "沉鱼",
age: "18",
address: "96, 77, 89"
}, {
key: "1",
name: "落雁",
age: "16",
address: "90, 70, 80"
}, {
key: "2",
name: "闭月",
age: "17",
address: "80, 60, 80"
}, {
key: "3",
name: "羞花",
age: "20",
address: "120, 60, 90"
}],
count: 4
};
return _this2;
}
Demo2.prototype.render = function render() {
var dataSource = this.state.dataSource;
var columns = this.columns;
return _react2["default"].createElement(
"div",
null,
_react2["default"].createElement(
_beeButton2["default"],
{
className: "editable-add-btn",
type: "ghost",
onClick: this.handleAdd
},
"\u6DFB\u52A0"
),
_react2["default"].createElement(_src2["default"], {
data: dataSource,
columns: columns,
getBodyWrapper: this.getBodyWrapper
})
);
};
return Demo2;
}(_react2["default"].Component);
exports["default"] = Demo2;
module.exports = exports["default"];
/***/ }),
/* 467 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Popconfirm = __webpack_require__(468);
var _Popconfirm2 = _interopRequireDefault(_Popconfirm);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports["default"] = _Popconfirm2["default"];
module.exports = exports['default'];
/***/ }),
/* 468 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _reactDom = __webpack_require__(12);
var _reactDom2 = _interopRequireDefault(_reactDom);
var _createChainedFunction = __webpack_require__(71);
var _createChainedFunction2 = _interopRequireDefault(_createChainedFunction);
var _splitComponent = __webpack_require__(35);
var _splitComponent2 = _interopRequireDefault(_splitComponent);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _Overlay = __webpack_require__(148);
var _Overlay2 = _interopRequireDefault(_Overlay);
var _Portal = __webpack_require__(144);
var _Portal2 = _interopRequireDefault(_Portal);
var _Confirm = __webpack_require__(469);
var _Confirm2 = _interopRequireDefault(_Confirm);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var isReact16 = _reactDom2["default"].createPortal !== undefined;
var propTypes = _extends({}, _Overlay2["default"].propTypes, {
// FIXME: This should be `defaultShow`.
/**
* 覆盖的初始可见性状态。对于更细微的可见性控制,请考虑直接使用覆盖组件。
*/
defaultOverlayShown: _propTypes2["default"].bool,
/**
* 要覆盖在目标旁边的元素或文本。
*/
content: _propTypes2["default"].node.isRequired,
/**
* @private
*/
onClick: _propTypes2["default"].func,
onClose: _propTypes2["default"].func,
onCancel: _propTypes2["default"].func,
// Overridden props from ``.
/**
* @private
*/
target: _propTypes2["default"].oneOf([null]),
/**
* @private
*/
onHide: _propTypes2["default"].oneOf([null]),
/**
* @private
*/
show: _propTypes2["default"].oneOf([null])
});
var defaultProps = {
defaultOverlayShown: false
};
var Popconfirm = function (_Component) {
_inherits(Popconfirm, _Component);
function Popconfirm(props, context) {
_classCallCheck(this, Popconfirm);
var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
_this.handleToggle = _this.handleToggle.bind(_this);
_this.handleHide = _this.handleHide.bind(_this);
_this.makeOverlay = _this.makeOverlay.bind(_this);
_this.handleClose = _this.handleClose.bind(_this);
_this.handleCancel = _this.handleCancel.bind(_this);
_this._mountNode = null;
_this.state = {
show: props.defaultOverlayShown
};
return _this;
}
Popconfirm.prototype.componentDidMount = function componentDidMount() {
this._mountNode = document.createElement('div');
!isReact16 && this.renderOverlay();
};
Popconfirm.prototype.componentDidUpdate = function componentDidUpdate() {
!isReact16 && this.renderOverlay();
};
Popconfirm.prototype.componentWillUnmount = function componentWillUnmount() {
!isReact16 && _reactDom2["default"].unmountComponentAtNode(this._mountNode);
this._mountNode = null;
};
Popconfirm.prototype.handleToggle = function handleToggle() {
if (!this.state.show) {
this.show();
}
};
Popconfirm.prototype.handleClose = function handleClose() {
var onClose = this.props.onClose;
this.hide();
onClose && onClose();
};
Popconfirm.prototype.handleCancel = function handleCancel() {
var onCancel = this.props.onCancel;
this.hide();
onCancel && onCancel();
};
Popconfirm.prototype.handleHide = function handleHide() {
this.hide();
};
Popconfirm.prototype.show = function show() {
this.setState({ show: true });
};
Popconfirm.prototype.hide = function hide() {
this.setState({ show: false });
};
Popconfirm.prototype.makeOverlay = function makeOverlay(overlay, props) {
return _react2["default"].createElement(
_Overlay2["default"],
_extends({}, props, {
show: this.state.show,
onHide: this.handleHide,
target: this
}),
overlay
);
};
Popconfirm.prototype.renderOverlay = function renderOverlay() {
_reactDom2["default"].unstable_renderSubtreeIntoContainer(this, this._overlay, this._mountNode);
};
Popconfirm.prototype.render = function render() {
var _props = this.props,
content = _props.content,
children = _props.children,
onClick = _props.onClick,
props = _objectWithoutProperties(_props, ['content', 'children', 'onClick']);
delete props.defaultOverlayShown;
var _splitComponentProps = (0, _splitComponent2["default"])(props, _Overlay2["default"]),
_splitComponentProps2 = _slicedToArray(_splitComponentProps, 2),
overlayProps = _splitComponentProps2[0],
confirmProps = _splitComponentProps2[1];
var child = _react2["default"].Children.only(children);
var childProps = child.props;
var overlay = _react2["default"].createElement(
_Confirm2["default"],
_extends({}, confirmProps, {
onClose: this.handleClose,
onCancel: this.handleCancel,
placement: props.placement }),
content
);
var triggerProps = {
'aria-describedby': overlay.props.id
};
// FIXME: 这里用于传递这个组件上的处理程序的逻辑是不一致的。我们不应该通过任何这些道具。
triggerProps.onClick = (0, _createChainedFunction2["default"])(childProps.onClick, onClick);
triggerProps.onClick = (0, _createChainedFunction2["default"])(triggerProps.onClick, this.handleToggle);
this._overlay = this.makeOverlay(overlay, overlayProps);
if (!isReact16) {
return (0, _react.cloneElement)(child, triggerProps);
}
triggerProps.key = 'overlay';
var portal = _react2["default"].createElement(
_Portal2["default"],
{
key: 'portal',
container: props.container },
this._overlay
);
return [(0, _react.cloneElement)(child, triggerProps), portal];
};
return Popconfirm;
}(_react.Component);
Popconfirm.propTypes = propTypes;
Popconfirm.defaultProps = defaultProps;
exports["default"] = Popconfirm;
module.exports = exports['default'];
/***/ }),
/* 469 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _i18n = __webpack_require__(470);
var _i18n2 = _interopRequireDefault(_i18n);
var _beeButton = __webpack_require__(103);
var _beeButton2 = _interopRequireDefault(_beeButton);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
var _tool = __webpack_require__(471);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
/**
* Sets the direction the Popover is positioned towards.
*/
placement: _propTypes2["default"].oneOf(['top', 'right', 'bottom', 'left']),
/**
* The "top" position value for the Popover.
*/
positionTop: _propTypes2["default"].oneOfType([_propTypes2["default"].number, _propTypes2["default"].string]),
/**
* The "left" position value for the Popover.
*/
positionLeft: _propTypes2["default"].oneOfType([_propTypes2["default"].number, _propTypes2["default"].string]),
/**
* The "top" position value for the Popover arrow.
*/
arrowOffsetTop: _propTypes2["default"].oneOfType([_propTypes2["default"].number, _propTypes2["default"].string]),
/**
* The "left" position value for the Popover arrow.
*/
arrowOffsetLeft: _propTypes2["default"].oneOfType([_propTypes2["default"].number, _propTypes2["default"].string]),
/**
* Title content
*/
title: _propTypes2["default"].node,
onClose: _propTypes2["default"].func,
onCancel: _propTypes2["default"].func,
color: _propTypes2["default"].oneOf(['dark'])
};
var defaultProps = {
placement: 'right',
clsPrefix: 'u-popconfirm',
locale: {}
};
var Confirm = function (_React$Component) {
_inherits(Confirm, _React$Component);
function Confirm(props) {
_classCallCheck(this, Confirm);
return _possibleConstructorReturn(this, _React$Component.call(this, props));
}
Confirm.prototype.render = function render() {
var _classes;
var _props = this.props,
placement = _props.placement,
positionTop = _props.positionTop,
positionLeft = _props.positionLeft,
arrowOffsetTop = _props.arrowOffsetTop,
arrowOffsetLeft = _props.arrowOffsetLeft,
clsPrefix = _props.clsPrefix,
trigger = _props.trigger,
title = _props.title,
className = _props.className,
style = _props.style,
children = _props.children,
locale = _props.locale,
onClose = _props.onClose,
color = _props.color,
onCancel = _props.onCancel,
props = _objectWithoutProperties(_props, ['placement', 'positionTop', 'positionLeft', 'arrowOffsetTop', 'arrowOffsetLeft', 'clsPrefix', 'trigger', 'title', 'className', 'style', 'children', 'locale', 'onClose', 'color', 'onCancel']);
var local = (0, _tool.getComponentLocale)(this.props, this.context, 'Popconfirm', function () {
return _i18n2["default"];
});
//const [bsProps, elementProps] = splitBsProps(props);
var classes = (_classes = {}, _defineProperty(_classes, '' + clsPrefix, true), _defineProperty(_classes, placement, true), _defineProperty(_classes, clsPrefix + '-' + color, color), _classes);
var outerStyle = _extends({
display: 'block',
top: positionTop,
left: positionLeft
}, style);
var arrowStyle = {
top: arrowOffsetTop,
left: arrowOffsetLeft
};
return _react2["default"].createElement(
'div',
_extends({}, props, {
role: 'tooltip',
className: (0, _classnames2["default"])(className, classes),
style: outerStyle
}),
_react2["default"].createElement('div', { className: 'arrow', style: arrowStyle }),
_react2["default"].createElement(
'div',
{ className: (0, _classnames2["default"])(clsPrefix + '-content') },
children
),
_react2["default"].createElement(
'div',
{ className: (0, _classnames2["default"])(clsPrefix + '-confirm') },
_react2["default"].createElement(
_beeButton2["default"],
{ onClick: onCancel, size: 'sm', style: { minWidth: 50 },
shape: 'border' },
local['cancel']
),
_react2["default"].createElement(
_beeButton2["default"],
{ onClick: onClose, size: 'sm', style: { minWidth: 50 }, colors: 'primary' },
local['ok']
)
)
);
};
return Confirm;
}(_react2["default"].Component);
Confirm.propTypes = propTypes;
Confirm.defaultProps = defaultProps;
Confirm.contextTypes = {
beeLocale: _propTypes2["default"].object
};
exports["default"] = Confirm;
module.exports = exports['default'];
/***/ }),
/* 470 */
/***/ (function(module, exports) {
'use strict';
module.exports = {
'lang': 'zh-cn',
'ok': '确定',
'cancel': '取消',
'en-us': {
'ok': 'ok',
'cancel': 'cancel'
}
};
/***/ }),
/* 471 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports.getComponentLocale = getComponentLocale;
exports.getLocaleCode = getLocaleCode;
function getComponentLocale(props, context, componentName, getDefaultLocale) {
var locale = {};
if (context && context.beeLocale && context.beeLocale[componentName]) {
locale = context.beeLocale[componentName];
} else {
var defaultLocale = getDefaultLocale();
locale = defaultLocale["default"] || defaultLocale;
}
var result = _extends({}, locale, props.locale);
result.lang = _extends({}, locale.lang, props.locale.lang);
return result;
}
function getLocaleCode(context) {
var localeCode = context.beeLocale && context.beeLocale.lang;
// Had use LocaleProvide but didn't set locale
if (context.beeLocale && context.beeLocale.exist && !localeCode) {
return 'zh-cn';
}
return localeCode;
}
/***/ }),
/* 472 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _beeButton = __webpack_require__(103);
var _beeButton2 = _interopRequireDefault(_beeButton);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 表头分组
* @description columns[n] 可以内嵌 children,以渲染分组表头。
*
*/
var ColumnGroup = _src2["default"].ColumnGroup,
Column = _src2["default"].Column;
var columns = [{
title: "Name",
dataIndex: "name",
key: "name",
width: 100,
fixed: "left"
}, {
title: "Other",
children: [{
title: "Age",
dataIndex: "age",
key: "age",
width: 200
}, {
title: "Address",
children: [{
title: "Street",
dataIndex: "street",
key: "street",
width: 200
}, {
title: "Block",
children: [{
title: "Building",
dataIndex: "building",
key: "building",
width: 100
}, {
title: "Door No.",
dataIndex: "number",
key: "number",
width: 100
}]
}]
}]
}, {
title: "Company",
children: [{
title: "Company Address",
dataIndex: "companyAddress",
key: "companyAddress"
}, {
title: "Company Name",
dataIndex: "companyName",
key: "companyName"
}]
}, {
title: "Gender",
dataIndex: "gender",
key: "gender",
width: 60,
fixed: "right"
}];
var data = [];
for (var i = 0; i < 20; i++) {
data.push({
key: i,
name: "John Brown",
age: i + 1,
street: "Lake Park",
building: "C",
number: 2035,
companyAddress: "Lake Street 42",
companyName: "SoftLake Co",
gender: "M"
});
}
var Demo3 = function (_Component) {
_inherits(Demo3, _Component);
function Demo3() {
_classCallCheck(this, Demo3);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
Demo3.prototype.render = function render() {
return _react2["default"].createElement(_src2["default"], {
columns: columns,
data: data,
bordered: true,
scroll: { x: "130%", y: 240 }
});
};
return Demo3;
}(_react.Component);
exports["default"] = Demo3;
module.exports = exports["default"];
/***/ }),
/* 473 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 树形数据展示
* @description 通过在data中配置children数据,来自动生成树形数据
*
*/
var columns4 = [{
title: "Name",
dataIndex: "name",
key: "name",
width: "40%"
}, {
title: "Age",
dataIndex: "age",
key: "age",
width: "30%"
}, {
title: "Address",
dataIndex: "address",
key: "address"
}];
var data4 = [{
key: 1,
name: "John Brown sr.",
age: 60,
address: "New York No. 1 Lake Park",
children: [{
key: 11,
name: "John Brown",
age: 42,
address: "New York No. 2 Lake Park"
}, {
key: 12,
name: "John Brown jr.",
age: 30,
address: "New York No. 3 Lake Park",
children: [{
key: 121,
name: "Jimmy Brown",
age: 16,
address: "New York No. 3 Lake Park"
}]
}, {
key: 13,
name: "Jim Green sr.",
age: 72,
address: "London No. 1 Lake Park",
children: [{
key: 131,
name: "Jim Green",
age: 42,
address: "London No. 2 Lake Park",
children: [{
key: 1311,
name: "Jim Green jr.",
age: 25,
address: "London No. 3 Lake Park"
}, {
key: 1312,
name: "Jimmy Green sr.",
age: 18,
address: "London No. 4 Lake Park"
}]
}]
}]
}, {
key: 2,
name: "Joe Black",
age: 32,
address: "Sidney No. 1 Lake Park"
}];
var Demo4 = function (_Component) {
_inherits(Demo4, _Component);
function Demo4() {
_classCallCheck(this, Demo4);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
Demo4.prototype.render = function render() {
return _react2['default'].createElement(_src2['default'], { columns: columns4, data: data4 });
};
return Demo4;
}(_react.Component);
exports['default'] = Demo4;
module.exports = exports['default'];
/***/ }),
/* 474 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 固定列
* @description 固定列到表格的某侧
*
*/
var columns5 = [{
title: "Full Name",
width: 100,
dataIndex: "name",
key: "name",
fixed: "left"
}, { title: "Age", width: 100, dataIndex: "age", key: "age", fixed: "left" }, { title: "Column 1", dataIndex: "address", key: "1" }, { title: "Column 2", dataIndex: "address", key: "2" }, { title: "Column 3", dataIndex: "address", key: "3" }, { title: "Column 4", dataIndex: "address", key: "4" }, { title: "Column 5", dataIndex: "address", key: "5" }, { title: "Column 6", dataIndex: "address", key: "6" }, { title: "Column 7", dataIndex: "address", key: "7" }, { title: "Column 8", dataIndex: "address", key: "8" }];
var data5 = [{
key: "1",
name: "John Brown",
age: 32,
address: "New York Park"
}, {
key: "2",
name: "Jim Green",
age: 40,
address: "London Park"
}, {
key: "3",
name: "Jim Green",
age: 40,
address: "London Park"
}, {
key: "4",
name: "Jim Green",
age: 40,
address: "London Park"
}];
var Demo5 = function (_Component) {
_inherits(Demo5, _Component);
function Demo5() {
_classCallCheck(this, Demo5);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
Demo5.prototype.render = function render() {
return _react2['default'].createElement(_src2['default'], { columns: columns5, data: data5, scroll: { x: "130%", y: 140 } });
};
return Demo5;
}(_react.Component);
exports['default'] = Demo5;
module.exports = exports['default'];
/***/ }),
/* 475 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 固定表头
* @description 方便一页内展示大量数据。需要指定 column 的 width 属性,否则列头和内容可能不对齐。(还可以设置scroll来支持横向或纵向滚动)
*
*/
var columns6 = [{
title: "Full Name",
width: 100,
dataIndex: "name",
key: "name"
}, { title: "Age", width: 100, dataIndex: "age", key: "age" }, { title: "Address", dataIndex: "address", key: "1" }];
var data6 = [{
key: "1",
name: "John Brown",
age: 32,
address: "New York Park"
}, {
key: "2",
name: "Jim Green",
age: 40,
address: "London Park"
}, {
key: "3",
name: "Jim Green",
age: 40,
address: "London Park"
}, {
key: "4",
name: "Jim Green",
age: 40,
address: "London Park"
}, {
key: "11",
name: "John Brown",
age: 32,
address: "New York Park"
}, {
key: "12",
name: "Jim Green",
age: 40,
address: "London Park"
}, {
key: "13",
name: "Jim Green",
age: 40,
address: "London Park"
}, {
key: "14",
name: "Jim Green",
age: 40,
address: "London Park"
}];
var Demo6 = function (_Component) {
_inherits(Demo6, _Component);
function Demo6() {
_classCallCheck(this, Demo6);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
Demo6.prototype.render = function render() {
return _react2['default'].createElement(_src2['default'], { columns: columns6, data: data6, scroll: { y: 150 } });
};
return Demo6;
}(_react.Component);
exports['default'] = Demo6;
module.exports = exports['default'];
/***/ }),
/* 476 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 主子表
* @description 主表点击子表联动
*
*/
var columns7 = [{ title: "班级", dataIndex: "a", key: "a" }, { title: "人数", dataIndex: "b", key: "b" }, { title: "班主任", dataIndex: "c", key: "c" }, {
title: "武功级别",
dataIndex: "d",
key: "d"
}];
var data7 = [{ a: "02级一班", b: "2", c: "欧阳锋", d: "大侠", key: "1" }, { a: "03级二班", b: "3", c: "归海一刀", d: "大侠", key: "2" }, { a: "05级三班", b: "1", c: "一拳超人", d: "愣头青", key: "3" }];
var columns7_1 = [{ title: "姓名", dataIndex: "a", key: "a" }, { title: "班级", dataIndex: "b", key: "b" }, { title: "系别", dataIndex: "c", key: "c" }];
var Demo7 = function (_Component) {
_inherits(Demo7, _Component);
function Demo7(props) {
_classCallCheck(this, Demo7);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.rowclick = function (record, index) {
if (record.a === "02级一班") {
_this.setState({
children_data: [{ a: "郭靖", b: "02级一班", c: "文学系", key: "1" }, { a: "黄蓉", b: "02级一班", c: "文学系", key: "2" }]
});
} else if (record.a === "03级二班") {
_this.setState({
children_data: [{ a: "杨过", b: "03级二班", c: "外语系", key: "1" }, { a: "小龙女", b: "03级二班", c: "外语系", key: "2" }, { a: "傻姑", b: "03级二班", c: "外语系", key: "3" }]
});
} else if (record.a === "05级三班") {
_this.setState({
children_data: [{ a: "金圣叹", b: "05级三班", c: "美术系", key: "1" }]
});
}
};
_this.state = {
children_data: []
};
return _this;
}
Demo7.prototype.render = function render() {
return _react2["default"].createElement(
"div",
null,
_react2["default"].createElement(_src2["default"], {
columns: columns7,
data: data7,
onRowClick: this.rowclick,
title: function title(currentData) {
return _react2["default"].createElement(
"div",
null,
"\u6807\u9898: \u6211\u662F\u4E3B\u8868"
);
}
}),
_react2["default"].createElement(_src2["default"], {
style: { marginTop: 40 },
columns: columns7_1,
data: this.state.children_data,
title: function title(currentData) {
return _react2["default"].createElement(
"div",
null,
"\u6807\u9898: \u6211\u662F\u5B50\u8868"
);
}
})
);
};
return Demo7;
}(_react.Component);
exports["default"] = Demo7;
module.exports = exports["default"];
/***/ }),
/* 477 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
var _beePagination = __webpack_require__(478);
var _beePagination2 = _interopRequireDefault(_beePagination);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 表格+分页
* @description 点击分页联动表格
*
*import {Table} from 'tinper-bee';
*/
var columns8 = [{ title: "姓名", dataIndex: "a", key: "a", width: 100 }, { id: "123", title: "性别", dataIndex: "b", key: "b", width: 100 }, { title: "年龄", dataIndex: "c", key: "c", width: 200 }, {
title: "武功级别",
dataIndex: "d",
key: "d"
}];
var pageData = {
1: [{ a: "杨过", b: "男", c: 30, d: "内行", key: "2" }, { a: "令狐冲", b: "男", c: 41, d: "大侠", key: "1" }, { a: "郭靖", b: "男", c: 25, d: "大侠", key: "3" }],
2: [{ a: "芙蓉姐姐", b: "女", c: 23, d: "大侠", key: "1" }, { a: "芙蓉妹妹", b: "女", c: 23, d: "内行", key: "2" }]
};
var Demo8 = function (_Component) {
_inherits(Demo8, _Component);
function Demo8(props) {
_classCallCheck(this, Demo8);
var _this = _possibleConstructorReturn(this, _Component.call(this, props));
_this.state = {
data: pageData[1],
activePage: 1
};
return _this;
}
Demo8.prototype.handleSelect = function handleSelect(eventKey) {
this.setState({
data: pageData[eventKey],
activePage: eventKey
});
};
Demo8.prototype.render = function render() {
return _react2["default"].createElement(
"div",
null,
_react2["default"].createElement(_src2["default"], { columns: columns8, data: this.state.data }),
_react2["default"].createElement(_beePagination2["default"], {
first: true,
last: true,
prev: true,
next: true,
boundaryLinks: true,
items: 2,
maxButtons: 5,
activePage: this.state.activePage,
onSelect: this.handleSelect.bind(this)
})
);
};
return Demo8;
}(_react.Component);
exports["default"] = Demo8;
module.exports = exports["default"];
/***/ }),
/* 478 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _Pagination = __webpack_require__(479);
var _Pagination2 = _interopRequireDefault(_Pagination);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
exports["default"] = _Pagination2["default"];
module.exports = exports['default'];
/***/ }),
/* 479 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _PaginationButton = __webpack_require__(480);
var _PaginationButton2 = _interopRequireDefault(_PaginationButton);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
/**
* 当前激活状态页
*/
activePage: _propTypes2["default"].number,
/**
* 总页数
*/
items: _propTypes2["default"].number,
/**
* 显示按钮从1到maxButton的按钮数
*/
maxButtons: _propTypes2["default"].number,
/**
* 当为true,不管切换到多少页都显示第一页和最后一页的按钮
*/
boundaryLinks: _propTypes2["default"].bool,
/**
* 当为true,显示省略号,否则
*
*/
ellipsis: _propTypes2["default"].oneOfType([_propTypes2["default"].bool, _propTypes2["default"].node]),
/**
* 当为true,显示点击到第一页的按钮
*/
first: _propTypes2["default"].oneOfType([_propTypes2["default"].bool, _propTypes2["default"].node]),
/**
* 当为true,显示点击到最后一页的按钮
*/
last: _propTypes2["default"].oneOfType([_propTypes2["default"].bool, _propTypes2["default"].node]),
/**
* 当为true,显示前一页按钮
*/
prev: _propTypes2["default"].oneOfType([_propTypes2["default"].bool, _propTypes2["default"].node]),
/**
* 当为true,显示下一页按钮
*/
next: _propTypes2["default"].oneOfType([_propTypes2["default"].bool, _propTypes2["default"].node]),
/**
* 暴露给用户的切换页的方法
*/
onSelect: _propTypes2["default"].func,
/**
* You can use a custom element for the buttons
*/
buttonComponentClass: _propTypes2["default"].oneOfType([_propTypes2["default"].element, _propTypes2["default"].string])
};
var defaultProps = {
activePage: 1,
items: 1,
maxButtons: 0,
first: false,
last: false,
prev: false,
next: false,
ellipsis: true,
boundaryLinks: false,
clsPrefix: "u-pagination",
gap: false,
noBorder: false
};
var Pagination = function (_React$Component) {
_inherits(Pagination, _React$Component);
function Pagination() {
_classCallCheck(this, Pagination);
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
}
Pagination.prototype.renderPageButtons = function renderPageButtons(activePage, items, maxButtons, boundaryLinks, ellipsis, buttonProps) {
var pageButtons = [];
var startPage = void 0;
var endPage = void 0;
var hasHiddenPagesAfter = void 0;
if (maxButtons) {
//根据max很当前activepage计算出应隐藏activeButton之前的页数
var hiddenPagesBefore = activePage - parseInt(maxButtons / 2, 10);
startPage = hiddenPagesBefore > 2 ? hiddenPagesBefore : 1;
//计算出是否存在隐藏activeButton之后的页数
hasHiddenPagesAfter = startPage + maxButtons < items + 1;
if (!hasHiddenPagesAfter) {
endPage = items;
startPage = items - maxButtons + 1;
if (startPage < 1) {
startPage = 1;
}
} else {
endPage = startPage + maxButtons - 1;
}
} else {
startPage = 1;
endPage = items;
}
//将所有的button循环渲染出来
for (var pagenumber = startPage; pagenumber <= endPage; pagenumber++) {
pageButtons.push(_react2["default"].createElement(
_PaginationButton2["default"],
_extends({}, buttonProps, {
key: pagenumber,
eventKey: pagenumber,
active: pagenumber === activePage
}),
pagenumber
));
}
//如果boundaryLinks和eclipsis且startPage!=1 需要加上before More Button
if (boundaryLinks && ellipsis && startPage !== 1) {
pageButtons.unshift(_react2["default"].createElement(
_PaginationButton2["default"],
{
key: "ellipsisFirst",
disabled: true,
componentClass: buttonProps.componentClass
},
_react2["default"].createElement(
"span",
{ "aria-label": "More" },
ellipsis === true ? "\u2026" : ellipsis
)
));
//加上最小边界 Button
pageButtons.unshift(_react2["default"].createElement(
_PaginationButton2["default"],
_extends({}, buttonProps, { key: 1, eventKey: 1, active: false }),
"1"
));
}
//如果maxButtons和eclipsis且hasHiddenPagesAfter 需加上after More Button
if (maxButtons && hasHiddenPagesAfter && ellipsis) {
pageButtons.push(_react2["default"].createElement(
_PaginationButton2["default"],
{
key: "ellipsis",
disabled: true,
componentClass: buttonProps.componentClass
},
_react2["default"].createElement(
"span",
{ "aria-label": "More" },
ellipsis === true ? "\u2026" : ellipsis
)
));
//如果最后一个页数按钮不等于总页数 且 边界为true 需加上最大边界按钮
if (boundaryLinks && endPage !== items) {
pageButtons.push(_react2["default"].createElement(
_PaginationButton2["default"],
_extends({}, buttonProps, {
key: items,
eventKey: items,
active: false
}),
items
));
}
}
return pageButtons;
};
Pagination.prototype.render = function render() {
var _props = this.props,
activePage = _props.activePage,
items = _props.items,
maxButtons = _props.maxButtons,
boundaryLinks = _props.boundaryLinks,
ellipsis = _props.ellipsis,
first = _props.first,
last = _props.last,
prev = _props.prev,
next = _props.next,
onSelect = _props.onSelect,
buttonComponentClass = _props.buttonComponentClass,
noBorder = _props.noBorder,
className = _props.className,
clsPrefix = _props.clsPrefix,
size = _props.size,
gap = _props.gap,
others = _objectWithoutProperties(_props, ["activePage", "items", "maxButtons", "boundaryLinks", "ellipsis", "first", "last", "prev", "next", "onSelect", "buttonComponentClass", "noBorder", "className", "clsPrefix", "size", "gap"]);
var classes = {};
if (noBorder) {
classes[clsPrefix + "-no-border"] = true;
}
if (size) {
classes[clsPrefix + "-" + size] = true;
}
if (gap) {
classes[clsPrefix + "-gap"] = true;
}
var classNames = (0, _classnames2["default"])(clsPrefix, classes);
/**
* 页按钮属性
* onSelect:暴露在外层交互动作,也是与父组件Pagination的交流接口
* componentClass: 用户定义的按钮dom元素类型
*/
var buttonProps = {
onSelect: onSelect,
componentClass: buttonComponentClass
};
return _react2["default"].createElement(
"ul",
_extends({}, others, { className: (0, _classnames2["default"])(className, classNames) }),
first && _react2["default"].createElement(
_PaginationButton2["default"],
_extends({}, buttonProps, {
eventKey: 1,
disabled: activePage === 1
}),
_react2["default"].createElement(
"span",
{ "aria-label": "First" },
first === true ? "\xAB" : first
)
),
prev && _react2["default"].createElement(
_PaginationButton2["default"],
_extends({}, buttonProps, {
eventKey: activePage - 1,
disabled: activePage === 1
}),
_react2["default"].createElement(
"span",
{ "aria-label": "Previous" },
prev === true ? "\u2039" : prev
)
),
this.renderPageButtons(activePage, items, maxButtons, boundaryLinks, ellipsis, buttonProps),
next && _react2["default"].createElement(
_PaginationButton2["default"],
_extends({}, buttonProps, {
eventKey: activePage + 1,
disabled: activePage >= items
}),
_react2["default"].createElement(
"span",
{ "aria-label": "Next" },
next === true ? "\u203A" : next
)
),
last && _react2["default"].createElement(
_PaginationButton2["default"],
_extends({}, buttonProps, {
eventKey: items,
disabled: activePage >= items
}),
_react2["default"].createElement(
"span",
{ "aria-label": "Last" },
last === true ? "\xBB" : last
)
)
);
};
return Pagination;
}(_react2["default"].Component);
Pagination.propTypes = propTypes;
Pagination.defaultProps = defaultProps;
exports["default"] = Pagination;
module.exports = exports["default"];
/***/ }),
/* 480 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _classnames = __webpack_require__(3);
var _classnames2 = _interopRequireDefault(_classnames);
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _propTypes = __webpack_require__(5);
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
var propTypes = {
className: _propTypes2["default"].string,
eventKey: _propTypes2["default"].any,
onSelect: _propTypes2["default"].func,
disabled: _propTypes2["default"].bool,
active: _propTypes2["default"].bool,
onClick: _propTypes2["default"].func
};
var defaultProps = {
componentClass: 'a',
active: false,
disabled: false
};
var PaginationButton = function (_React$Component) {
_inherits(PaginationButton, _React$Component);
function PaginationButton(props, context) {
_classCallCheck(this, PaginationButton);
var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context));
_this.handleClick = _this.handleClick.bind(_this);
return _this;
}
PaginationButton.prototype.handleClick = function handleClick(event) {
var _props = this.props,
disabled = _props.disabled,
onSelect = _props.onSelect,
eventKey = _props.eventKey;
if (disabled) {
return;
}
if (onSelect) {
onSelect(eventKey, event);
}
};
PaginationButton.prototype.render = function render() {
var _props2 = this.props,
Component = _props2.componentClass,
active = _props2.active,
disabled = _props2.disabled,
onClick = _props2.onClick,
eventKey = _props2.eventKey,
className = _props2.className,
style = _props2.style,
props = _objectWithoutProperties(_props2, ['componentClass', 'active', 'disabled', 'onClick', 'eventKey', 'className', 'style']);
delete props.onSelect;
return _react2["default"].createElement(
'li',
{
className: (0, _classnames2["default"])(className, { active: active, disabled: disabled }),
style: style
},
_react2["default"].createElement(Component, _extends({}, props, {
disabled: disabled,
onClick: this.handleClick
}))
);
};
return PaginationButton;
}(_react2["default"].Component);
PaginationButton.propTypes = propTypes;
PaginationButton.defaultProps = defaultProps;
exports["default"] = PaginationButton;
module.exports = exports['default'];
/***/ }),
/* 481 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = __webpack_require__(4);
var _react2 = _interopRequireDefault(_react);
var _src = __webpack_require__(106);
var _src2 = _interopRequireDefault(_src);
var _beeIcon = __webpack_require__(125);
var _beeIcon2 = _interopRequireDefault(_beeIcon);
var _beeInputGroup = __webpack_require__(204);
var _beeInputGroup2 = _interopRequireDefault(_beeInputGroup);
var _beeFormControl = __webpack_require__(164);
var _beeFormControl2 = _interopRequireDefault(_beeFormControl);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); } /**
*
* @title 表格+搜索
* @description 搜索刷新表格数据
*
*
* import {Table} from 'tinper-bee';
*/
var Search = function (_Component) {
_inherits(Search, _Component);
function Search() {
var _temp, _this, _ret;
_classCallCheck(this, Search);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.state = {
searchValue: "",
empty: false
}, _this.handleSearch = function () {
var onSearch = _this.props.onSearch;
_this.setState({
empty: true
});
onSearch && onSearch(_this.state.searchValue);
}, _this.handleKeyDown = function (e) {
if (e.keyCode === 13) {
_this.handleSearch();
}
}, _this.handleChange = function (e) {
_this.setState({
searchValue: e.target.value
});
}, _this.emptySearch = function () {
var onEmpty = _this.props.onEmpty;
_this.setState({
searchValue: "",
empty: false
});
onEmpty && onEmpty();
}, _temp), _possibleConstructorReturn(_this, _ret);
}
/**
* 搜索
*/
/**
* 捕获回车
* @param e
*/
/**
* 输入框改变
* @param e
*/
/**
* 清空输入框
*/
Search.prototype.render = function render() {
return _react2["default"].createElement(
_beeInputGroup2["default"],
{ simple: true, className: "search-component" },
_react2["default"].createElement(_beeFormControl2["default"], {
onChange: this.handleChange,
value: this.state.searchValue,
onKeyDown: this.handleKeyDown,
placeholder: "\u8BF7\u8F93\u5165\u7528\u6237\u540D",
type: "text"
}),
this.state.empty ? _react2["default"].createElement(_beeIcon2["default"], {
type: "uf-close-c",
onClick: this.emptySearch,
className: "empty-search"
}) : null,
_react2["default"].createElement(
_beeInputGroup2["default"].Button,
{ onClick: this.handleSearch, shape: "border" },
_react2["default"].createElement(_beeIcon2["default"], { type: "uf-search" })
)
);
};
return Search;
}(_react.Component);
var columns9 = [{
title: "姓名",
dataIndex: "a",
key: "a",
width: 100
}, {
title: "性别",
dataIndex: "b",
key: "b",
width: 100
}, {
title: "年龄",
dataIndex: "c",
key: "c",
width: 200
}, {
title: "武功级别",
dataIndex: "d",
key: "d"
}];
var userData = [{ a: "杨过", b: "男", c: 30, d: "内行", key: "2" }, { a: "令狐冲", b: "男", c: 41, d: "大侠", key: "1" }, { a: "郭靖", b: "男", c: 25, d: "大侠", key: "3" }];
var Demo9 = function (_Component2) {
_inherits(Demo9, _Component2);
function Demo9(props) {
_classCallCheck(this, Demo9);
var _this2 = _possibleConstructorReturn(this, _Component2.call(this, props));
_this2.handleSearch = function (value) {
if (value === "") {
return _this2.setState({
data: userData
});
}
var regExp = new RegExp(value, "ig");
var data = userData.filter(function (item) {
return regExp.test(item.a);
});
_this2.setState({
data: data
});
};
_this2.handleEmpty = function () {
_this2.setState({
data: userData
});
};
_this2.state = {
data: userData
};
return _this2;
}
Demo9.prototype.render = function render() {
return _react2["default"].createElement(
"div",
null,
_react2["default"].createElement(
"div",
{ className: "clearfix" },
_react2["default"].createElement(Search, { onSearch: this.handleSearch, onEmpty: this.handleEmpty })
),
_react2["default"].createElement(_src2["default"], { columns: columns9, data: this.state.data })
);
};
return Demo9;
}(_react.Component);
exports["default"] = Demo9;
module.exports = exports["default"];
/***/ })
/******/ ]);
//# sourceMappingURL=demo.js.map