Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

alaska-field-geo

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alaska-field-geo - npm Package Compare versions

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"
}

16

views/GeoFieldCell.jsx

@@ -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;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc