alaska-field-geo
Advanced tools
Comparing version 0.11.12 to 0.12.0
25
index.js
@@ -1,14 +0,11 @@ | ||
// @flow | ||
'use strict'; | ||
import { Field } from 'alaska'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
export default class GeoField extends Field { | ||
static plain = Array; | ||
static defaultOptions = { | ||
index: '2dsphere', | ||
coordinate: 'wgs84', | ||
cell: 'GeoFieldCell', | ||
view: 'GeoFieldView' | ||
}; | ||
var _alaska = require('alaska'); | ||
class GeoField extends _alaska.Field { | ||
init() { | ||
@@ -28,1 +25,9 @@ this.set = function (value) { | ||
} | ||
exports.default = GeoField; | ||
GeoField.plain = Array; | ||
GeoField.defaultOptions = { | ||
index: '2dsphere', | ||
coordinate: 'wgs84', | ||
cell: 'GeoFieldCell', | ||
view: 'GeoFieldView' | ||
}; |
{ | ||
"name": "alaska-field-geo", | ||
"version": "0.11.12", | ||
"version": "0.12.0", | ||
"description": "Alaska geo field", | ||
@@ -9,6 +9,7 @@ "keywords": [ | ||
], | ||
"alaska": "field", | ||
"main": "index.js", | ||
"repository": "https://github.com/maichong/alaska/tree/master/packages/alaska-field-geo", | ||
"repository": "https://github.com/maichong/alaska/tree/master/src/alaska-field-geo", | ||
"author": "Liang <liang@maichong.it> (https://github.com/liangxingchen)", | ||
"license": "MIT" | ||
} |
@@ -6,4 +6,3 @@ // @flow | ||
export default class GeoFieldCell extends React.Component { | ||
export default class GeoFieldCell extends React.Component<Alaska$view$Field$Cell$Props> { | ||
static contextTypes = { | ||
@@ -13,3 +12,3 @@ t: PropTypes.func, | ||
shouldComponentUpdate(props: Object) { | ||
shouldComponentUpdate(props: Alaska$view$Field$Cell$Props) { | ||
return props.value !== this.props.value; | ||
@@ -23,12 +22,13 @@ } | ||
} | ||
const t = this.context.t; | ||
const { t } = this.context; | ||
return (<a | ||
href={ | ||
'http://m.amap.com/navi/?dest=' + value[0] + ',' + value[1] | ||
+ '&destName=%E4%BD%8D%E7%BD%AE&key=e67780f754ee572d50e97c58d5a633cd' | ||
} | ||
'http://m.amap.com/navi/?dest=' + value[0] + ',' + value[1] | ||
+ '&destName=%E4%BD%8D%E7%BD%AE&key=e67780f754ee572d50e97c58d5a633cd' | ||
} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
>{t('GEO')}</a>); | ||
>{t('GEO')} | ||
</a>); | ||
} | ||
} |
@@ -7,4 +7,3 @@ // @flow | ||
export default class GeoFieldView extends React.Component { | ||
export default class GeoFieldView extends React.Component<Alaska$view$Field$View$Props> { | ||
static contextTypes = { | ||
@@ -14,13 +13,4 @@ t: PropTypes.func, | ||
props: { | ||
className: string, | ||
model: Object, | ||
field: Object, | ||
errorText: string, | ||
disabled: boolean, | ||
value: any, | ||
}; | ||
shouldComponentUpdate(props: Object) { | ||
return !shallowEqualWithout(props, this.props, 'data', 'onChange', 'model', 'field'); | ||
shouldComponentUpdate(props: Alaska$view$Field$View$Props) { | ||
return !shallowEqualWithout(props, this.props, 'record', 'onChange', 'model', 'field'); | ||
} | ||
@@ -35,4 +25,4 @@ | ||
} = this.props; | ||
const t = this.context.t; | ||
let help = field.help; | ||
const { t } = this.context; | ||
let { help } = field; | ||
className += ' geo-field'; | ||
@@ -54,3 +44,4 @@ if (errorText) { | ||
rel="noopener noreferrer" | ||
>{t('LNG')}:{value[0]} {t('LAT')}:{value[1]}</a>; | ||
>{t('LNG')}:{value[0]} {t('LAT')}:{value[1]} | ||
</a>; | ||
} else { | ||
@@ -57,0 +48,0 @@ value = null; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
3664
117