dtable-ui-component 6.0.29-beta12 → 6.0.29-beta14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -132,7 +132,8 @@ class CountryEditor extends _react.Component {
132
132
  config
133
133
  } = this.props;
134
134
  const {
135
- mediaUrl
135
+ mediaUrl,
136
+ server
136
137
  } = {
137
138
  ...((_window = window) === null || _window === void 0 ? void 0 : _window.dtable),
138
139
  ...config
@@ -141,7 +142,7 @@ class CountryEditor extends _react.Component {
141
142
  if (this.lang === 'cn') {
142
143
  geoFileName = 'cn-region-location';
143
144
  }
144
- return fetch("".concat(mediaUrl, "geo-data/").concat(geoFileName, ".json")).then(res => {
145
+ return fetch("".concat(server).concat(mediaUrl, "geo-data/").concat(geoFileName, ".json").replaceAll('//', '/')).then(res => {
145
146
  return res.json();
146
147
  }).catch(() => {
147
148
  // get locations from local
@@ -205,7 +205,6 @@
205
205
  }
206
206
 
207
207
  .dtable-ui-geolocation-map-editor .search-tables-input {
208
- line-height: 38px;
209
208
  padding-right: 30px;
210
209
  border-bottom: 0;
211
210
  background: #fff;
@@ -217,6 +217,9 @@ class GeolocationEditor extends _react.default.Component {
217
217
  this.state = {
218
218
  editorPosition: null
219
219
  };
220
+ if (!window.app) {
221
+ window.app = {};
222
+ }
220
223
  this.editor = null;
221
224
  }
222
225
  componentDidMount() {
@@ -68,14 +68,15 @@ class LocationEditor extends _react.Component {
68
68
  config
69
69
  } = this.props;
70
70
  const {
71
- mediaUrl
71
+ mediaUrl,
72
+ server
72
73
  } = {
73
74
  ...((_window = window) === null || _window === void 0 ? void 0 : _window.dtable),
74
75
  ...config
75
76
  };
76
77
 
77
78
  // get locations from server
78
- return fetch("".concat(mediaUrl, "geo-data/cn-location.json")).then(res => {
79
+ return fetch("".concat(server).concat(mediaUrl, "geo-data/cn-location.json").replaceAll('//', '/')).then(res => {
79
80
  return res.json();
80
81
  }).catch(() => {
81
82
  // get locations from local
@@ -26,7 +26,7 @@ class MapEditor extends _react.Component {
26
26
  serverDomainUrl,
27
27
  spriteUrl,
28
28
  serviceUrl
29
- } = (0, _mapEditorUtils.getMineMapUrl)();
29
+ } = (0, _mapEditorUtils.getMineMapUrl)(this.props.config);
30
30
  window.minemap.domainUrl = domainUrl;
31
31
  window.minemap.dataDomainUrl = dataDomainUrl;
32
32
  window.minemap.serverDomainUrl = serverDomainUrl;
@@ -51,7 +51,6 @@
51
51
  }
52
52
 
53
53
  .dtable-ui-large-map-editor-dialog .dtable-ui-geolocation-map-editor-large .search-tables-input {
54
- line-height: 38px;
55
54
  padding-right: 30px;
56
55
  border-bottom: 0;
57
56
  background: #fff;
@@ -26,7 +26,7 @@ class LargeMapEditorDialog extends _react.default.Component {
26
26
  serverDomainUrl,
27
27
  spriteUrl,
28
28
  serviceUrl
29
- } = (0, _mapEditorUtils.getMineMapUrl)();
29
+ } = (0, _mapEditorUtils.getMineMapUrl)(this.props.config);
30
30
  window.minemap.domainUrl = domainUrl;
31
31
  window.minemap.dataDomainUrl = dataDomainUrl;
32
32
  window.minemap.serverDomainUrl = serverDomainUrl;
@@ -349,7 +349,7 @@ class MapSelectionEditor extends _react.Component {
349
349
  }
350
350
  }
351
351
  componentWillUnmount() {
352
- if (this.mapType === _mapEditorUtils.MAP_TYPES.B_MAP) {
352
+ if (this.map && this.mapType === _mapEditorUtils.MAP_TYPES.B_MAP) {
353
353
  let center = {};
354
354
  center.zoom = this.map.getZoom();
355
355
  let coordinate = this.map.getCenter();
@@ -355,7 +355,7 @@ class LargeMapSelectionEditorDialog extends _react.default.Component {
355
355
  }
356
356
  }
357
357
  componentWillUnmount() {
358
- if (this.mapType === _mapEditorUtils.MAP_TYPES.B_MAP) {
358
+ if (this.map && this.mapType === _mapEditorUtils.MAP_TYPES.B_MAP) {
359
359
  let center = {};
360
360
  center.zoom = this.map.getZoom();
361
361
  let coordinate = this.map.getCenter();
@@ -56,14 +56,15 @@ class ProvinceCityEditor extends _react.Component {
56
56
  config
57
57
  } = this.props;
58
58
  const {
59
- mediaUrl
59
+ mediaUrl,
60
+ server
60
61
  } = {
61
62
  ...((_window = window) === null || _window === void 0 ? void 0 : _window.dtable),
62
63
  ...config
63
64
  };
64
65
 
65
66
  // get locations from server
66
- return fetch("".concat(mediaUrl, "geo-data/cn-location.json")).then(res => {
67
+ return fetch("".concat(server).concat(mediaUrl, "geo-data/cn-location.json").replaceAll('//', '/')).then(res => {
67
68
  return res.json();
68
69
  }).catch(() => {
69
70
  // get locations from local
@@ -21,13 +21,14 @@ class ProvinceEditor extends _react.Component {
21
21
  config
22
22
  } = this.props;
23
23
  const {
24
- mediaUrl
24
+ mediaUrl,
25
+ server
25
26
  } = {
26
27
  ...((_window = window) === null || _window === void 0 ? void 0 : _window.dtable),
27
28
  ...config
28
29
  };
29
30
  // get locations from server
30
- return fetch("".concat(mediaUrl, "geo-data/cn-location.json")).then(res => {
31
+ return fetch("".concat(server).concat(mediaUrl, "geo-data/cn-location.json").replaceAll('//', '/')).then(res => {
31
32
  return res.json();
32
33
  }).catch(() => {
33
34
  // get locations from local
@@ -147,7 +147,8 @@ class RowExpandGeolocationEditor extends _react.default.Component {
147
147
  render() {
148
148
  const {
149
149
  column,
150
- row
150
+ row,
151
+ config
151
152
  } = this.props;
152
153
  const {
153
154
  value
@@ -159,6 +160,7 @@ class RowExpandGeolocationEditor extends _react.default.Component {
159
160
  ref: ref => this.geoEditor = ref,
160
161
  isInModal: true,
161
162
  column: column,
163
+ config: config,
162
164
  row: row,
163
165
  value: value,
164
166
  onCommit: this.onCommit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.29-beta12",
3
+ "version": "6.0.29-beta14",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "4.0.2",