dtable-ui-component 6.0.37-beta → 6.0.37-beta2

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.
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
+ var _dtableUtils = require("dtable-utils");
9
10
  var _InputItem = _interopRequireDefault(require("../../../InputItem"));
10
11
  var _toaster = _interopRequireDefault(require("../../../toaster"));
11
12
  var _MobileFullScreenPage = _interopRequireDefault(require("../../../MobileFullScreenPage"));
@@ -325,6 +326,60 @@ class MapEditor extends _react.default.Component {
325
326
  this.onClose = () => {
326
327
  this.props.onToggle();
327
328
  };
329
+ this.getNumericValue = value => {
330
+ const {
331
+ lng,
332
+ lat
333
+ } = value || {};
334
+ const numLng = typeof lng === 'string' ? parseFloat(lng.trim()) : lng;
335
+ const numLat = typeof lat === 'string' ? parseFloat(lat.trim()) : lat;
336
+ return {
337
+ lng: numLng,
338
+ lat: numLat
339
+ };
340
+ };
341
+ this.handleLatitudeChange = value => {
342
+ this.setState({
343
+ value: {
344
+ ...this.state.value,
345
+ lat: value
346
+ }
347
+ }, () => {
348
+ const numericValue = this.getNumericValue(this.state.value);
349
+ this.rerenderMapMarker(numericValue);
350
+ });
351
+ };
352
+ this.handleLongitudeChange = value => {
353
+ this.setState({
354
+ value: {
355
+ ...this.state.value,
356
+ lng: value
357
+ }
358
+ }, () => {
359
+ const numericValue = this.getNumericValue(this.state.value);
360
+ this.rerenderMapMarker(numericValue);
361
+ });
362
+ };
363
+ this.rerenderMapMarker = _ref => {
364
+ let {
365
+ lng,
366
+ lat
367
+ } = _ref;
368
+ if (!(0, _dtableUtils.isNumber)(lng) || !(0, _dtableUtils.isNumber)(lat)) {
369
+ return;
370
+ }
371
+ if (this.map) {
372
+ if (this.mapType === _mapEditorUtils.MAP_TYPES.G_MAP || this.mapType === _mapEditorUtils.MAP_TYPES.M_MAP) {
373
+ this.map.setCenter({
374
+ lng,
375
+ lat
376
+ });
377
+ } else {
378
+ this.map.setCenter(new window.BMap.Point(lng, lat));
379
+ }
380
+ }
381
+ this.addMarkerByPosition(lng, lat);
382
+ };
328
383
  this.renderMap = () => {
329
384
  const {
330
385
  isLoading,
@@ -227,7 +227,7 @@ class MapEditor extends _react.Component {
227
227
  lat
228
228
  } = _ref;
229
229
  if (!(0, _dtableUtils.isNumber)(lng) || !(0, _dtableUtils.isNumber)(lat)) {
230
- this.props.setValue(this.props.value);
230
+ this.props.setValue(null);
231
231
  return;
232
232
  }
233
233
  const newValue = {
@@ -187,7 +187,7 @@ class LargeMapEditorDialog extends _react.default.Component {
187
187
  lat
188
188
  } = _ref;
189
189
  if (!(0, _dtableUtils.isNumber)(lng) || !(0, _dtableUtils.isNumber)(lat)) {
190
- this.props.setValue(this.props.value);
190
+ this.props.setValue(null);
191
191
  return;
192
192
  }
193
193
  this.props.setValue({
@@ -132,8 +132,6 @@
132
132
  "Select_location": "Auswählen",
133
133
  "Positioning_failed": "Die Positionierung ist gescheitert.",
134
134
  "Address": "Adresse",
135
- "Enter_longitude_and_latitude": "Längengrad und Breitengrad eingeben",
136
- "Enter_latitude_and_longitude": "Längen- und Breitengrad eingeben",
137
135
  "The_map_plugin_is_not_properly_configured_contact_the_administrator": "Das Karten-Plugin ist nicht richtig konfiguriert. Kontaktieren Sie den Administrator.",
138
136
  "Fill_in": "Ausfüllen",
139
137
  "Search_failed_please_enter_detailed_address": "Die Suche ist fehlgeschlagen. Geben Sie die Adresse mit mehr Details ein.",
@@ -165,5 +163,9 @@
165
163
  "Add_participants": "Teilnehmer hinzufügen",
166
164
  "Edit_long_text": "Langtext bearbeiten",
167
165
  "Choose_a_department": "Bereich wählen",
168
- "Close": "Schließen"
166
+ "Close": "Schließen",
167
+ "Latitude_abbr": "Breite",
168
+ "Longitude_abbr": "Länge",
169
+ "Enter_latitude": "Breitengrad eingeben",
170
+ "Enter_longitude": "Längengrad eingeben"
169
171
  }
@@ -132,8 +132,6 @@
132
132
  "Select_location": "Select",
133
133
  "Positioning_failed": "Positioning failed",
134
134
  "Address": "Address",
135
- "Enter_longitude_and_latitude": "Enter longitude and latitude",
136
- "Enter_latitude_and_longitude": "Enter latitude and longitude",
137
135
  "The_map_plugin_is_not_properly_configured_contact_the_administrator": "The map plugin is not properly configured. Contact the administrator.",
138
136
  "Fill_in": "Fill in",
139
137
  "Search_failed_please_enter_detailed_address": "Search failed, please enter detailed address",
@@ -165,5 +163,9 @@
165
163
  "Add_participants": "Add participants",
166
164
  "Edit_long_text": "Edit long text",
167
165
  "Choose_a_department": "Choose a department",
168
- "Close": "Close"
166
+ "Close": "Close",
167
+ "Latitude_abbr": "Lat",
168
+ "Longitude_abbr": "Lng",
169
+ "Enter_latitude": "Enter latitude",
170
+ "Enter_longitude": "Enter longitude"
169
171
  }
@@ -132,8 +132,6 @@
132
132
  "Select_location": "Elegir",
133
133
  "Positioning_failed": "El posicionamiento ha fallado",
134
134
  "Address": "Dirección",
135
- "Enter_longitude_and_latitude": "Introduce longitud y latitud",
136
- "Enter_latitude_and_longitude": "Introduce latitud y longitud",
137
135
  "The_map_plugin_is_not_properly_configured_contact_the_administrator": "El plugin de mapas no está bien configurado. Contacta con el administrador.",
138
136
  "Fill_in": "Rellenar",
139
137
  "Search_failed_please_enter_detailed_address": "La búsqueda ha fallado, por favor introduce la dirección completa",
@@ -165,5 +163,9 @@
165
163
  "Add_participants": "Añadir participantes",
166
164
  "Edit_long_text": "Edit long text",
167
165
  "Choose_a_department": "Choose a department",
168
- "Close": "Cerrar"
166
+ "Close": "Cerrar",
167
+ "Latitude_abbr": "Lat",
168
+ "Longitude_abbr": "Lng",
169
+ "Enter_latitude": "Enter latitude",
170
+ "Enter_longitude": "Enter longitude"
169
171
  }
@@ -132,8 +132,6 @@
132
132
  "Select_location": "Sélectionner",
133
133
  "Positioning_failed": "La localisation a échoué.",
134
134
  "Address": "Adresse",
135
- "Enter_longitude_and_latitude": "Entrer longitude et latitude",
136
- "Enter_latitude_and_longitude": "Entrer latitude et longitude",
137
135
  "The_map_plugin_is_not_properly_configured_contact_the_administrator": "Le plugin de carte n'est pas correctement configuré. Veuillez contacter l'administrateur.",
138
136
  "Fill_in": "Remplir",
139
137
  "Search_failed_please_enter_detailed_address": "La recherche a échoué. Veuillez entrer une adresse détailée.",
@@ -165,5 +163,9 @@
165
163
  "Add_participants": "Ajouter des participants",
166
164
  "Edit_long_text": "Modifier le texte long",
167
165
  "Choose_a_department": "Sélectionner un département",
168
- "Close": "Fermer"
166
+ "Close": "Fermer",
167
+ "Latitude_abbr": "Lat",
168
+ "Longitude_abbr": "Lng",
169
+ "Enter_latitude": "Enter latitude",
170
+ "Enter_longitude": "Enter longitude"
169
171
  }
@@ -132,8 +132,6 @@
132
132
  "Select_location": "Selecione",
133
133
  "Positioning_failed": "Posicionamento falhou",
134
134
  "Address": "Endereço",
135
- "Enter_longitude_and_latitude": "Entre longitude e latitude",
136
- "Enter_latitude_and_longitude": "Entre na latitude e longitude",
137
135
  "The_map_plugin_is_not_properly_configured_contact_the_administrator": "O plug -in de mapa não está configurado corretamente. Entre em contato com o administrador.",
138
136
  "Fill_in": "Fill in",
139
137
  "Search_failed_please_enter_detailed_address": "Search failed, please enter detailed address",
@@ -165,5 +163,9 @@
165
163
  "Add_participants": "Adicione participantes",
166
164
  "Edit_long_text": "Editar texto longo",
167
165
  "Choose_a_department": "Choose a department",
168
- "Close": "Fechar"
166
+ "Close": "Fechar",
167
+ "Latitude_abbr": "Lat",
168
+ "Longitude_abbr": "Lng",
169
+ "Enter_latitude": "Enter latitude",
170
+ "Enter_longitude": "Enter longitude"
169
171
  }
@@ -132,8 +132,6 @@
132
132
  "Select_location": "Выбирать",
133
133
  "Positioning_failed": "Позиционирование не удалось",
134
134
  "Address": "Адрес",
135
- "Enter_longitude_and_latitude": "Введите долготу и широту",
136
- "Enter_latitude_and_longitude": "Введите широту и долготу",
137
135
  "The_map_plugin_is_not_properly_configured_contact_the_administrator": "Плагин Карты не настроен должным образом. Обратитесь к администратору.",
138
136
  "Fill_in": "Заполнить",
139
137
  "Search_failed_please_enter_detailed_address": "Поиск не удался, пожалуйста, введите подробный адрес",
@@ -165,5 +163,9 @@
165
163
  "Add_participants": "Добавить участников",
166
164
  "Edit_long_text": "Редактировать длинный текст",
167
165
  "Choose_a_department": "Выберите отдел",
168
- "Close": "Закрыть"
166
+ "Close": "Закрыть",
167
+ "Latitude_abbr": "Lat",
168
+ "Longitude_abbr": "Lng",
169
+ "Enter_latitude": "Enter latitude",
170
+ "Enter_longitude": "Enter longitude"
169
171
  }
@@ -132,8 +132,6 @@
132
132
  "Select_location": "选择",
133
133
  "Positioning_failed": "定位失败",
134
134
  "Address": "地址",
135
- "Enter_longitude_and_latitude": "输入经度和纬度",
136
- "Enter_latitude_and_longitude": "输入经度和纬度",
137
135
  "The_map_plugin_is_not_properly_configured_contact_the_administrator": "地图插件未正确配置。请与管理员联系。",
138
136
  "Fill_in": "填入",
139
137
  "Search_failed_please_enter_detailed_address": "搜索失败,请输入详细地址",
@@ -165,5 +163,9 @@
165
163
  "Add_participants": "添加参与人",
166
164
  "Edit_long_text": "编辑长文本",
167
165
  "Choose_a_department": "选择一个部门",
168
- "Close": "关闭"
166
+ "Close": "关闭",
167
+ "Latitude_abbr": "纬度",
168
+ "Longitude_abbr": "经度",
169
+ "Enter_latitude": "输入纬度",
170
+ "Enter_longitude": "输入经度"
169
171
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "6.0.37beta",
3
+ "version": "6.0.37beta2",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "4.0.2",