Commit 527023d3 by hfpp2012 yinsigan

autobind

1 parent e2a8896a
{
"presets":[
"es2015", "react"
"presets": ["es2015", "stage-0", "react"],
"plugins": [
["transform-decorators-legacy"],
]
}
......@@ -7,6 +7,8 @@
"start": "webpack-dev-server"
},
"dependencies": {
"autobind-decorator": "^1.4.1",
"babel-preset-stage-0": "^6.24.1",
"halogen": "^0.2.0",
"html-webpack-plugin": "^2.28.0",
"jquery": "^3.2.1",
......@@ -14,7 +16,6 @@
"react": "^15.5.4",
"react-addons-update": "^15.5.2",
"react-alert": "^2.0.1",
"react-autobind": "^1.0.6",
"react-bootstrap": "^0.31.0",
"react-dom": "^15.5.4",
"react-router-dom": "^4.1.1",
......@@ -24,6 +25,7 @@
"devDependencies": {
"babel-core": "^6.24.1",
"babel-loader": "^7.0.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"css-loader": "^0.28.1",
......
......@@ -5,7 +5,7 @@ yarn config set registry 'https://registry.npm.taobao.org'
yarn add webpack webpack-dev-server path
yarn add babel-loader babel-core babel-preset-es2015 babel-preset-react --dev
yarn add babel-loader babel-preset-stage-0 babel-core babel-preset-es2015 babel-preset-react --dev
yarn add html-webpack-plugin
......
import React from 'react'
import Move from '../libs/move'
import EventEmitter from '../libs/eventEmitter'
import autoBind from 'react-autobind'
import autobind from 'autobind-decorator'
@autobind
export default class Element extends React.Component {
static get getDefaultProps() {
return {
......@@ -24,7 +25,6 @@ export default class Element extends React.Component {
name: this.props.name,
prev_name: this.props.name
};
autoBind(this);
}
componentDidUpdate(props, state) {
......
import React from 'react'
import Element from './Element'
import ReactAddonsUpdate from 'react-addons-update'
import autoBind from 'react-autobind'
import autobind from 'autobind-decorator'
@autobind
export default class ElementGroup extends React.Component {
constructor(props){
super(props);
......@@ -13,7 +14,6 @@ export default class ElementGroup extends React.Component {
{ id: 3, name: "药架格", initialPos: {x: 80, y: 70 + 60 * 2}, target_type: 'RegionalDesign::DrugBrandreth' }
]
};
autoBind(this);
}
cloneElement(element) {
......
......@@ -3,15 +3,15 @@ import ModalRepoForm from './ModalRepoForm'
import ReactAddonsUpdate from 'react-addons-update'
import Loader from 'halogen/PulseLoader'
import { Link } from 'react-router-dom'
import autoBind from 'react-autobind'
import autobind from 'autobind-decorator'
@autobind
export default class Header extends React.Component {
constructor(props){
super(props);
this.state = {
data: null, loading: true, error: null
};
autoBind(this);
}
componentDidMount() {
......
......@@ -3,15 +3,15 @@ import { Modal, Button } from 'react-bootstrap'
import { Form, FormGroup, Col, FormControl, ControlLabel } from 'react-bootstrap'
import EventEmitter from '../libs/eventEmitter'
import $ from 'jquery'
import autoBind from 'react-autobind'
import autobind from 'autobind-decorator'
@autobind
export default class ModalRepoForm extends React.Component {
constructor(props){
super(props);
this.state = {
showModal: false, name: ''
};
autoBind(this);
}
close() {
......
......@@ -4,15 +4,15 @@ import Element from './Element'
import ReactAddonsUpdate from 'react-addons-update'
import EventEmitter from '../libs/eventEmitter'
import $ from 'jquery'
import autoBind from 'react-autobind'
import autobind from 'autobind-decorator'
@autobind
export default class RegionalDesign extends React.Component {
constructor(props){
super(props);
this.state = {
data: null, loading: true, error: null, object_name: '', object_type: '', children_object_type: ''
};
autoBind(this);
}
getConfig(props, key) {
......
......@@ -168,6 +168,10 @@ asynckit@^0.4.0:
version "0.4.0"
resolved "http://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
autobind-decorator@^1.4.1:
version "1.4.1"
resolved "http://registry.npm.taobao.org/autobind-decorator/download/autobind-decorator-1.4.1.tgz#e05887e92e6466d43ec247c0692f8774d95ca3fd"
autoprefixer@^6.3.1:
version "6.7.7"
resolved "http://registry.npm.taobao.org/autoprefixer/download/autoprefixer-6.7.7.tgz#1dbd1c835658e35ce3f9984099db00585c782014"
......@@ -232,6 +236,22 @@ babel-generator@^6.24.1:
source-map "^0.5.0"
trim-right "^1.0.1"
babel-helper-bindify-decorators@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-helper-bindify-decorators/download/babel-helper-bindify-decorators-6.24.1.tgz#14c19e5f142d7b47f19a52431e52b1ccbc40a330"
dependencies:
babel-runtime "^6.22.0"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babel-helper-builder-binary-assignment-operator-visitor@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-helper-builder-binary-assignment-operator-visitor/download/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664"
dependencies:
babel-helper-explode-assignable-expression "^6.24.1"
babel-runtime "^6.22.0"
babel-types "^6.24.1"
babel-helper-builder-react-jsx@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-helper-builder-react-jsx/download/babel-helper-builder-react-jsx-6.24.1.tgz#0ad7917e33c8d751e646daca4e77cc19377d2cbc"
......@@ -258,6 +278,23 @@ babel-helper-define-map@^6.24.1:
babel-types "^6.24.1"
lodash "^4.2.0"
babel-helper-explode-assignable-expression@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-helper-explode-assignable-expression/download/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa"
dependencies:
babel-runtime "^6.22.0"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babel-helper-explode-class@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-helper-explode-class/download/babel-helper-explode-class-6.24.1.tgz#7dc2a3910dee007056e1e31d640ced3d54eaa9eb"
dependencies:
babel-helper-bindify-decorators "^6.24.1"
babel-runtime "^6.22.0"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babel-helper-function-name@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-helper-function-name/download/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9"
......@@ -297,6 +334,16 @@ babel-helper-regex@^6.24.1:
babel-types "^6.24.1"
lodash "^4.2.0"
babel-helper-remap-async-to-generator@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-helper-remap-async-to-generator/download/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b"
dependencies:
babel-helper-function-name "^6.24.1"
babel-runtime "^6.22.0"
babel-template "^6.24.1"
babel-traverse "^6.24.1"
babel-types "^6.24.1"
babel-helper-replace-supers@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-helper-replace-supers/download/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a"
......@@ -335,14 +382,120 @@ babel-plugin-check-es2015-constants@^6.22.0:
dependencies:
babel-runtime "^6.22.0"
babel-plugin-syntax-async-functions@^6.8.0:
version "6.13.0"
resolved "http://registry.npm.taobao.org/babel-plugin-syntax-async-functions/download/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95"
babel-plugin-syntax-async-generators@^6.5.0:
version "6.13.0"
resolved "http://registry.npm.taobao.org/babel-plugin-syntax-async-generators/download/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a"
babel-plugin-syntax-class-constructor-call@^6.18.0:
version "6.18.0"
resolved "http://registry.npm.taobao.org/babel-plugin-syntax-class-constructor-call/download/babel-plugin-syntax-class-constructor-call-6.18.0.tgz#9cb9d39fe43c8600bec8146456ddcbd4e1a76416"
babel-plugin-syntax-class-properties@^6.8.0:
version "6.13.0"
resolved "http://registry.npm.taobao.org/babel-plugin-syntax-class-properties/download/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de"
babel-plugin-syntax-decorators@^6.1.18, babel-plugin-syntax-decorators@^6.13.0:
version "6.13.0"
resolved "http://registry.npm.taobao.org/babel-plugin-syntax-decorators/download/babel-plugin-syntax-decorators-6.13.0.tgz#312563b4dbde3cc806cee3e416cceeaddd11ac0b"
babel-plugin-syntax-do-expressions@^6.8.0:
version "6.13.0"
resolved "http://registry.npm.taobao.org/babel-plugin-syntax-do-expressions/download/babel-plugin-syntax-do-expressions-6.13.0.tgz#5747756139aa26d390d09410b03744ba07e4796d"
babel-plugin-syntax-dynamic-import@^6.18.0:
version "6.18.0"
resolved "http://registry.npm.taobao.org/babel-plugin-syntax-dynamic-import/download/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da"
babel-plugin-syntax-exponentiation-operator@^6.8.0:
version "6.13.0"
resolved "http://registry.npm.taobao.org/babel-plugin-syntax-exponentiation-operator/download/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de"
babel-plugin-syntax-export-extensions@^6.8.0:
version "6.13.0"
resolved "http://registry.npm.taobao.org/babel-plugin-syntax-export-extensions/download/babel-plugin-syntax-export-extensions-6.13.0.tgz#70a1484f0f9089a4e84ad44bac353c95b9b12721"
babel-plugin-syntax-flow@^6.18.0:
version "6.18.0"
resolved "http://registry.npm.taobao.org/babel-plugin-syntax-flow/download/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d"
babel-plugin-syntax-function-bind@^6.8.0:
version "6.13.0"
resolved "http://registry.npm.taobao.org/babel-plugin-syntax-function-bind/download/babel-plugin-syntax-function-bind-6.13.0.tgz#48c495f177bdf31a981e732f55adc0bdd2601f46"
babel-plugin-syntax-jsx@^6.3.13, babel-plugin-syntax-jsx@^6.8.0:
version "6.18.0"
resolved "http://registry.npm.taobao.org/babel-plugin-syntax-jsx/download/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946"
babel-plugin-syntax-object-rest-spread@^6.8.0:
version "6.13.0"
resolved "http://registry.npm.taobao.org/babel-plugin-syntax-object-rest-spread/download/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5"
babel-plugin-syntax-trailing-function-commas@^6.22.0:
version "6.22.0"
resolved "http://registry.npm.taobao.org/babel-plugin-syntax-trailing-function-commas/download/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3"
babel-plugin-transform-async-generator-functions@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-async-generator-functions/download/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db"
dependencies:
babel-helper-remap-async-to-generator "^6.24.1"
babel-plugin-syntax-async-generators "^6.5.0"
babel-runtime "^6.22.0"
babel-plugin-transform-async-to-generator@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-async-to-generator/download/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761"
dependencies:
babel-helper-remap-async-to-generator "^6.24.1"
babel-plugin-syntax-async-functions "^6.8.0"
babel-runtime "^6.22.0"
babel-plugin-transform-class-constructor-call@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-class-constructor-call/download/babel-plugin-transform-class-constructor-call-6.24.1.tgz#80dc285505ac067dcb8d6c65e2f6f11ab7765ef9"
dependencies:
babel-plugin-syntax-class-constructor-call "^6.18.0"
babel-runtime "^6.22.0"
babel-template "^6.24.1"
babel-plugin-transform-class-properties@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-class-properties/download/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac"
dependencies:
babel-helper-function-name "^6.24.1"
babel-plugin-syntax-class-properties "^6.8.0"
babel-runtime "^6.22.0"
babel-template "^6.24.1"
babel-plugin-transform-decorators-legacy@^1.3.4:
version "1.3.4"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-decorators-legacy/download/babel-plugin-transform-decorators-legacy-1.3.4.tgz#741b58f6c5bce9e6027e0882d9c994f04f366925"
dependencies:
babel-plugin-syntax-decorators "^6.1.18"
babel-runtime "^6.2.0"
babel-template "^6.3.0"
babel-plugin-transform-decorators@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-decorators/download/babel-plugin-transform-decorators-6.24.1.tgz#788013d8f8c6b5222bdf7b344390dfd77569e24d"
dependencies:
babel-helper-explode-class "^6.24.1"
babel-plugin-syntax-decorators "^6.13.0"
babel-runtime "^6.22.0"
babel-template "^6.24.1"
babel-types "^6.24.1"
babel-plugin-transform-do-expressions@^6.22.0:
version "6.22.0"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-do-expressions/download/babel-plugin-transform-do-expressions-6.22.0.tgz#28ccaf92812d949c2cd1281f690c8fdc468ae9bb"
dependencies:
babel-plugin-syntax-do-expressions "^6.8.0"
babel-runtime "^6.22.0"
babel-plugin-transform-es2015-arrow-functions@^6.22.0:
version "6.22.0"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-arrow-functions/download/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221"
......@@ -511,6 +664,21 @@ babel-plugin-transform-es2015-unicode-regex@^6.24.1:
babel-runtime "^6.22.0"
regexpu-core "^2.0.0"
babel-plugin-transform-exponentiation-operator@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-exponentiation-operator/download/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e"
dependencies:
babel-helper-builder-binary-assignment-operator-visitor "^6.24.1"
babel-plugin-syntax-exponentiation-operator "^6.8.0"
babel-runtime "^6.22.0"
babel-plugin-transform-export-extensions@^6.22.0:
version "6.22.0"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-export-extensions/download/babel-plugin-transform-export-extensions-6.22.0.tgz#53738b47e75e8218589eea946cbbd39109bbe653"
dependencies:
babel-plugin-syntax-export-extensions "^6.8.0"
babel-runtime "^6.22.0"
babel-plugin-transform-flow-strip-types@^6.22.0:
version "6.22.0"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-flow-strip-types/download/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf"
......@@ -518,6 +686,20 @@ babel-plugin-transform-flow-strip-types@^6.22.0:
babel-plugin-syntax-flow "^6.18.0"
babel-runtime "^6.22.0"
babel-plugin-transform-function-bind@^6.22.0:
version "6.22.0"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-function-bind/download/babel-plugin-transform-function-bind-6.22.0.tgz#c6fb8e96ac296a310b8cf8ea401462407ddf6a97"
dependencies:
babel-plugin-syntax-function-bind "^6.8.0"
babel-runtime "^6.22.0"
babel-plugin-transform-object-rest-spread@^6.22.0:
version "6.23.0"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-object-rest-spread/download/babel-plugin-transform-object-rest-spread-6.23.0.tgz#875d6bc9be761c58a2ae3feee5dc4895d8c7f921"
dependencies:
babel-plugin-syntax-object-rest-spread "^6.8.0"
babel-runtime "^6.22.0"
babel-plugin-transform-react-display-name@^6.23.0:
version "6.23.0"
resolved "http://registry.npm.taobao.org/babel-plugin-transform-react-display-name/download/babel-plugin-transform-react-display-name-6.23.0.tgz#4398910c358441dc4cef18787264d0412ed36b37"
......@@ -605,6 +787,41 @@ babel-preset-react@^6.24.1:
babel-plugin-transform-react-jsx-source "^6.22.0"
babel-preset-flow "^6.23.0"
babel-preset-stage-0@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-preset-stage-0/download/babel-preset-stage-0-6.24.1.tgz#5642d15042f91384d7e5af8bc88b1db95b039e6a"
dependencies:
babel-plugin-transform-do-expressions "^6.22.0"
babel-plugin-transform-function-bind "^6.22.0"
babel-preset-stage-1 "^6.24.1"
babel-preset-stage-1@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-preset-stage-1/download/babel-preset-stage-1-6.24.1.tgz#7692cd7dcd6849907e6ae4a0a85589cfb9e2bfb0"
dependencies:
babel-plugin-transform-class-constructor-call "^6.24.1"
babel-plugin-transform-export-extensions "^6.22.0"
babel-preset-stage-2 "^6.24.1"
babel-preset-stage-2@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-preset-stage-2/download/babel-preset-stage-2-6.24.1.tgz#d9e2960fb3d71187f0e64eec62bc07767219bdc1"
dependencies:
babel-plugin-syntax-dynamic-import "^6.18.0"
babel-plugin-transform-class-properties "^6.24.1"
babel-plugin-transform-decorators "^6.24.1"
babel-preset-stage-3 "^6.24.1"
babel-preset-stage-3@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-preset-stage-3/download/babel-preset-stage-3-6.24.1.tgz#836ada0a9e7a7fa37cb138fb9326f87934a48395"
dependencies:
babel-plugin-syntax-trailing-function-commas "^6.22.0"
babel-plugin-transform-async-generator-functions "^6.24.1"
babel-plugin-transform-async-to-generator "^6.24.1"
babel-plugin-transform-exponentiation-operator "^6.24.1"
babel-plugin-transform-object-rest-spread "^6.22.0"
babel-register@^6.24.1:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-register/download/babel-register-6.24.1.tgz#7e10e13a2f71065bdfad5a1787ba45bca6ded75f"
......@@ -617,14 +834,14 @@ babel-register@^6.24.1:
mkdirp "^0.5.1"
source-map-support "^0.4.2"
babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.22.0:
babel-runtime@^6.11.6, babel-runtime@^6.18.0, babel-runtime@^6.2.0, babel-runtime@^6.22.0:
version "6.23.0"
resolved "http://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b"
dependencies:
core-js "^2.4.0"
regenerator-runtime "^0.10.0"
babel-template@^6.24.1:
babel-template@^6.24.1, babel-template@^6.3.0:
version "6.24.1"
resolved "http://registry.npm.taobao.org/babel-template/download/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333"
dependencies:
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!