qwc2 2025.10.9 → 2025.10.14
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.
- package/actions/display.js +30 -1
- package/actions/editing.js +22 -1
- package/actions/layerinfo.js +13 -1
- package/actions/layers.js +213 -3
- package/actions/localConfig.js +58 -1
- package/actions/locale.js +21 -1
- package/actions/locate.js +26 -1
- package/actions/logging.js +10 -1
- package/actions/map.js +105 -2
- package/actions/measurement.js +12 -1
- package/actions/processNotifications.js +37 -1
- package/actions/redlining.js +18 -1
- package/actions/redliningPick.js +12 -1
- package/actions/search.js +12 -1
- package/actions/serviceinfo.js +12 -1
- package/actions/task.js +55 -3
- package/actions/theme.js +339 -19
- package/actions/windows.js +164 -5
- package/components/AppMenu.js +435 -3
- package/components/AttributeForm.js +928 -32
- package/components/AttributeTableWidget.js +1105 -13
- package/components/AutoEditForm.js +189 -3
- package/components/CoordinateDisplayer.js +78 -2
- package/components/EditComboField.js +190 -6
- package/components/EditUploadField.js +315 -3
- package/components/ExportSelection.js +203 -2
- package/components/FullscreenSwitcher.js +90 -3
- package/components/Icon.js +81 -2
- package/components/IdentifyViewer.js +1161 -6
- package/components/ImportLayer.js +718 -20
- package/components/LayerInfoWindow.js +145 -2
- package/components/LinkFeatureForm.js +246 -5
- package/components/MapButton.js +88 -2
- package/components/MapSelection.js +287 -8
- package/components/MessageBar.js +68 -2
- package/components/NumericInputWindow.js +359 -2
- package/components/PickFeature.js +266 -2
- package/components/PluginsContainer.js +227 -8
- package/components/PrintSelection.js +620 -49
- package/components/ProcessNotifications.js +104 -2
- package/components/QtDesignerForm.js +1137 -18
- package/components/ResizeableWindow.js +591 -8
- package/components/SearchBox.js +1307 -20
- package/components/ServiceInfoWindow.js +107 -2
- package/components/SideBar.js +204 -4
- package/components/StandardApp.js +381 -20
- package/components/Swipeable.js +15 -1
- package/components/TaskBar.js +85 -2
- package/components/ThemeLayersListWindow.js +216 -4
- package/components/ThemeList.js +381 -7
- package/components/Toolbar.js +106 -2
- package/components/WindowManager.js +178 -2
- package/components/map/OlLayer.js +257 -6
- package/components/map/OlMap.js +405 -5
- package/components/map/layers/BingLayer.js +31 -2
- package/components/map/layers/GoogleLayer.js +222 -19
- package/components/map/layers/GraticuleLayer.js +21 -1
- package/components/map/layers/ImageLayer.js +15 -1
- package/components/map/layers/MVTLayer.js +52 -2
- package/components/map/layers/OSMLayer.js +24 -2
- package/components/map/layers/OverlayLayer.js +55 -3
- package/components/map/layers/VectorLayer.js +173 -8
- package/components/map/layers/WFSLayer.js +220 -6
- package/components/map/layers/WMSLayer.js +180 -6
- package/components/map/layers/WMTSLayer.js +67 -3
- package/components/map/layers/XYZLayer.js +24 -2
- package/components/map/layers/index.js +28 -1
- package/components/map3d/EditDataset3D.js +190 -3
- package/components/map3d/HeightProfile3D.js +402 -3
- package/components/map3d/ImportObjects3D.js +162 -2
- package/components/map3d/Map3D.js +1304 -38
- package/components/map3d/MapControls3D.js +392 -7
- package/components/map3d/SearchField3D.js +183 -11
- package/components/map3d/View3DSwitcher.js +98 -2
- package/components/map3d/drawtool/CreateTool3D.js +174 -4
- package/components/map3d/drawtool/EditTool3D.js +590 -6
- package/components/map3d/drawtool/NumericInput3D.js +336 -4
- package/components/map3d/layers/GeoTIFFLayer3D.js +15 -1
- package/components/map3d/layers/VectorLayer3D.js +53 -2
- package/components/map3d/layers/WFSLayer3D.js +109 -3
- package/components/map3d/layers/WMSLayer3D.js +70 -2
- package/components/map3d/layers/WMTSLayer3D.js +27 -3
- package/components/map3d/layers/index.js +14 -1
- package/components/map3d/utils/FirstPersonControls3D.js +423 -16
- package/components/map3d/utils/MiscUtils3D.js +221 -13
- package/components/map3d/utils/OrbitControls3D.js +176 -5
- package/components/map3d/utils/Tiles3DStyle.js +238 -9
- package/components/share/ShareLink.js +54 -2
- package/components/share/ShareQRCode.js +62 -2
- package/components/share/ShareSocials.js +125 -3
- package/components/timeline/FixedTimeline.js +236 -5
- package/components/timeline/InfiniteTimeline.js +347 -8
- package/components/timeline/TimelineFeaturesSlider.js +439 -5
- package/components/widgets/AccordeonWidget.js +96 -2
- package/components/widgets/ButtonBar.js +124 -2
- package/components/widgets/ColorButton.js +201 -3
- package/components/widgets/ComboBox.js +166 -2
- package/components/widgets/CopyButton.js +110 -2
- package/components/widgets/DateTimeInput.js +100 -3
- package/components/widgets/EditableSelect.js +230 -3
- package/components/widgets/FileSelector.js +128 -4
- package/components/widgets/Input.js +124 -2
- package/components/widgets/InputContainer.js +96 -2
- package/components/widgets/LayerCatalogWidget.js +219 -3
- package/components/widgets/MenuButton.js +157 -1
- package/components/widgets/ModalDialog.js +64 -2
- package/components/widgets/NavBar.js +119 -2
- package/components/widgets/NumberInput.js +226 -4
- package/components/widgets/PopupMenu.js +72 -1
- package/components/widgets/Primitives.js +6 -1
- package/components/widgets/ReCaptchaWidget.js +55 -1
- package/components/widgets/SearchWidget.js +255 -2
- package/components/widgets/Spinner.js +44 -2
- package/components/widgets/SuggestionInput.js +77 -2
- package/components/widgets/TextInput.js +308 -2
- package/components/widgets/ToggleSwitch.js +85 -2
- package/components/widgets/VectorLayerPicker.js +85 -3
- package/libs/openlayers.js +225 -5
- package/package.json +1 -1
- package/plugins/API.js +358 -15
- package/plugins/AttributeTable.js +109 -3
- package/plugins/Authentication.js +130 -5
- package/plugins/BackgroundSwitcher.js +218 -4
- package/plugins/Bookmark.js +289 -3
- package/plugins/BottomBar.js +298 -4
- package/plugins/CookiePopup.js +67 -3
- package/plugins/Cyclomedia.js +442 -5
- package/plugins/Editing.js +497 -9
- package/plugins/FeatureForm.js +366 -4
- package/plugins/FeatureSearch.js +458 -3
- package/plugins/GeometryDigitizer.js +664 -7
- package/plugins/HeightProfile.js +763 -15
- package/plugins/Help.js +102 -3
- package/plugins/HomeButton.js +80 -3
- package/plugins/Identify.js +543 -5
- package/plugins/LayerCatalog.js +215 -4
- package/plugins/LayerTree.js +1194 -6
- package/plugins/LocateButton.js +94 -3
- package/plugins/Map.js +320 -16
- package/plugins/MapCompare.js +94 -3
- package/plugins/MapCopyright.js +127 -5
- package/plugins/MapExport.js +613 -20
- package/plugins/MapFilter.js +868 -12
- package/plugins/MapInfoTooltip.js +277 -3
- package/plugins/MapLegend.js +253 -4
- package/plugins/MapTip.js +290 -4
- package/plugins/Measure.js +220 -4
- package/plugins/NewsPopup.js +137 -3
- package/plugins/OverviewMap.js +167 -7
- package/plugins/Panoramax.js +340 -2
- package/plugins/Portal.js +199 -4
- package/plugins/Print.js +1231 -15
- package/plugins/Redlining.js +750 -6
- package/plugins/Reports.js +332 -3
- package/plugins/Routing.js +1278 -15
- package/plugins/ScratchDrawing.js +173 -5
- package/plugins/Settings.js +241 -4
- package/plugins/Share.js +198 -3
- package/plugins/StartupMarker.js +84 -4
- package/plugins/TaskButton.js +88 -3
- package/plugins/ThemeSwitcher.js +164 -4
- package/plugins/TimeManager.js +971 -10
- package/plugins/TopBar.js +300 -7
- package/plugins/TourGuide.js +213 -2
- package/plugins/ValueTool.js +419 -4
- package/plugins/View3D.js +519 -14
- package/plugins/ZoomButtons.js +165 -3
- package/plugins/map/EditingSupport.js +199 -7
- package/plugins/map/LocateSupport.js +260 -4
- package/plugins/map/MeasurementSupport.js +216 -8
- package/plugins/map/RedliningPickSupport.js +201 -7
- package/plugins/map/RedliningSupport.js +726 -17
- package/plugins/map/SnapInteraction.js +101 -1
- package/plugins/map/SnapSupport.js +210 -2
- package/plugins/map/SnappingSupport.js +356 -17
- package/plugins/map3d/BackgroundSwitcher3D.js +44 -3
- package/plugins/map3d/BottomBar3D.js +118 -3
- package/plugins/map3d/Compare3D.js +422 -8
- package/plugins/map3d/Draw3D.js +353 -6
- package/plugins/map3d/ExportObjects3D.js +393 -18
- package/plugins/map3d/HideObjects3D.js +313 -12
- package/plugins/map3d/Identify3D.js +283 -12
- package/plugins/map3d/LayerTree3D.js +323 -3
- package/plugins/map3d/MapCopyright3D.js +128 -5
- package/plugins/map3d/MapExport3D.js +590 -10
- package/plugins/map3d/MapLight3D.js +553 -6
- package/plugins/map3d/Measure3D.js +571 -20
- package/plugins/map3d/OverviewMap3D.js +169 -3
- package/plugins/map3d/Settings3D.js +73 -3
- package/plugins/map3d/TopBar3D.js +207 -9
- package/plugins/redlining/RedliningBufferSupport.js +206 -3
- package/reducers/display.js +34 -2
- package/reducers/editing.js +68 -3
- package/reducers/index.js +9 -1
- package/reducers/layerinfo.js +26 -2
- package/reducers/layers.js +456 -9
- package/reducers/localConfig.js +122 -2
- package/reducers/locale.js +38 -2
- package/reducers/locate.js +40 -2
- package/reducers/map.js +176 -5
- package/reducers/measurement.js +42 -2
- package/reducers/processNotifications.js +49 -2
- package/reducers/redlining.js +50 -2
- package/reducers/redliningPick.js +27 -2
- package/reducers/search.js +20 -1
- package/reducers/serviceinfo.js +25 -2
- package/reducers/task.js +45 -2
- package/reducers/theme.js +51 -2
- package/reducers/windows.js +203 -2
- package/scripts/dist.sh +1 -1
- package/scripts/gen-plugin-docs.js +152 -2
- package/scripts/makeIconkit.js +85 -6
- package/scripts/themesConfig.js +742 -40
- package/scripts/updateTranslations.js +251 -10
- package/selectors/searchproviders.js +44 -2
- package/stores/StandardStore.js +42 -2
- package/utils/ConfigUtils.js +84 -3
- package/utils/CoordinatesUtils.js +234 -23
- package/utils/DxfUtils.js +237 -11
- package/utils/EditingInterface.js +421 -87
- package/utils/EditingUtils.js +357 -13
- package/utils/ElevationInterface.js +83 -22
- package/utils/FeatureStyles.js +429 -5
- package/utils/IdentifyUtils.js +443 -7
- package/utils/ImageEditor.js +79 -9
- package/utils/LayerUtils.js +1516 -50
- package/utils/LocaleUtils.js +117 -7
- package/utils/MapUtils.js +241 -59
- package/utils/MeasureUtils.js +323 -2
- package/utils/MiscUtils.js +189 -11
- package/utils/PermaLinkUtils.js +429 -6
- package/utils/PluginStore.js +27 -1
- package/utils/ResourceRegistry.js +15 -1
- package/utils/RoutingInterface.js +307 -7
- package/utils/SearchProviders.js +722 -19
- package/utils/ServiceLayerUtils.js +669 -14
- package/utils/Signal.js +32 -2
- package/utils/ThemeUtils.js +341 -7
- package/utils/VectorLayerUtils.js +589 -15
- package/utils/expr_grammar/grammar.js +2239 -2
- package/utils/expr_grammar/test.js +65 -3
|
@@ -1,10 +1,241 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
6
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
7
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
10
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
11
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
+
/**
|
|
2
16
|
* Copyright 2024 Sourcepole AG
|
|
3
17
|
* All rights reserved.
|
|
4
18
|
*
|
|
5
19
|
* This source code is licensed under the BSD-style license found in the
|
|
6
20
|
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import dayjs from 'dayjs';
|
|
25
|
+
import PropTypes from 'prop-types';
|
|
26
|
+
import LocaleUtils from '../../utils/LocaleUtils';
|
|
27
|
+
import MiscUtils from '../../utils/MiscUtils';
|
|
28
|
+
import Icon from '../Icon';
|
|
29
|
+
import ButtonBar from '../widgets/ButtonBar';
|
|
30
|
+
import Input from '../widgets/Input';
|
|
31
|
+
import './style/FixedTimeline.css';
|
|
32
|
+
var FixedTimeline = /*#__PURE__*/function (_React$Component) {
|
|
33
|
+
function FixedTimeline() {
|
|
34
|
+
var _this;
|
|
35
|
+
_classCallCheck(this, FixedTimeline);
|
|
36
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
37
|
+
args[_key] = arguments[_key];
|
|
38
|
+
}
|
|
39
|
+
_this = _callSuper(this, FixedTimeline, [].concat(args));
|
|
40
|
+
_defineProperty(_this, "state", {
|
|
41
|
+
ticksContainerEl: null,
|
|
42
|
+
timelineWidth: 0
|
|
43
|
+
});
|
|
44
|
+
_defineProperty(_this, "navButtonClicked", function (key) {
|
|
45
|
+
if (key === "home") {
|
|
46
|
+
_this.props.setStartTime(null);
|
|
47
|
+
_this.props.setEndTime(null);
|
|
48
|
+
} else if (key === "zoomin") {
|
|
49
|
+
var mid = 0.5 * (_this.props.startTime + _this.props.endTime);
|
|
50
|
+
_this.props.setStartTime(mid - 0.25 * _this.props.timeSpan);
|
|
51
|
+
_this.props.setEndTime(mid + 0.25 * _this.props.timeSpan);
|
|
52
|
+
} else if (key === "zoomout") {
|
|
53
|
+
var _mid = 0.5 * (_this.props.startTime + _this.props.endTime);
|
|
54
|
+
var newStartTime = Math.max(_this.props.dataStartTime, _mid - _this.props.timeSpan);
|
|
55
|
+
_this.props.setStartTime(newStartTime);
|
|
56
|
+
_this.props.setEndTime(Math.min(_this.props.dataEndTime, newStartTime + 2 * _this.props.timeSpan));
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
_defineProperty(_this, "pan", function (dir) {
|
|
60
|
+
var delta = 0.1 * _this.props.timeSpan;
|
|
61
|
+
if (dir > 0) {
|
|
62
|
+
if (_this.props.dataEndTime - _this.props.endTime > 0) {
|
|
63
|
+
var newEndTime = Math.min(_this.props.dataEndTime, _this.props.endTime + delta);
|
|
64
|
+
_this.props.setStartTime(newEndTime - _this.props.timeSpan);
|
|
65
|
+
_this.props.setEndTime(newEndTime);
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
if (_this.props.startTime - _this.props.dataStartTime > 0) {
|
|
69
|
+
var newStartTime = Math.max(_this.props.dataStartTime, _this.props.startTime - delta);
|
|
70
|
+
_this.props.setStartTime(newStartTime);
|
|
71
|
+
_this.props.setEndTime(newStartTime + _this.props.timeSpan);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
_defineProperty(_this, "startPan", function (dir) {
|
|
76
|
+
_this.pan(dir);
|
|
77
|
+
var panInterval = null;
|
|
78
|
+
var panTimeout = setTimeout(function () {
|
|
79
|
+
_this.pan(dir);
|
|
80
|
+
panInterval = setInterval(function () {
|
|
81
|
+
_this.pan(dir);
|
|
82
|
+
}, 50);
|
|
83
|
+
}, 250);
|
|
84
|
+
document.addEventListener("pointerup", function () {
|
|
85
|
+
clearInterval(panInterval);
|
|
86
|
+
clearTimeout(panTimeout);
|
|
87
|
+
}, {
|
|
88
|
+
once: true,
|
|
89
|
+
capture: true
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
_defineProperty(_this, "setTicksContainerRef", function (instance) {
|
|
93
|
+
if (_this.state.ticksContainerEl !== instance) {
|
|
94
|
+
_this.setState({
|
|
95
|
+
ticksContainerEl: instance
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
_defineProperty(_this, "renderTicks", function () {
|
|
100
|
+
// Render approx 1 tick every 100 px
|
|
101
|
+
var nTicks = Math.round(_this.state.timelineWidth / 100);
|
|
102
|
+
var tickInterval = _this.state.timelineWidth / nTicks;
|
|
103
|
+
var ticks = [];
|
|
104
|
+
for (var x = 0; x < _this.state.timelineWidth - 0.5 * tickInterval; x += tickInterval) {
|
|
105
|
+
ticks.push({
|
|
106
|
+
pixel: x,
|
|
107
|
+
time: FixedTimeline.computeTimeFromPixel(_this, x)
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
ticks.push({
|
|
111
|
+
pixel: _this.state.timelineWidth,
|
|
112
|
+
time: _this.props.endTime
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// Render ticks
|
|
116
|
+
return ticks.map(function (tick) {
|
|
117
|
+
var style = {
|
|
118
|
+
left: tick.pixel - 1 + "px"
|
|
119
|
+
};
|
|
120
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
121
|
+
className: tick.time ? "fixtimeline-ltick" : "fixtimeline-tick",
|
|
122
|
+
key: "tick" + tick.pixel,
|
|
123
|
+
style: style
|
|
124
|
+
}, tick.time ? /*#__PURE__*/React.createElement("span", null, dayjs(tick.time).format(_this.props.dateFormat)) : null);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
return _this;
|
|
128
|
+
}
|
|
129
|
+
_inherits(FixedTimeline, _React$Component);
|
|
130
|
+
return _createClass(FixedTimeline, [{
|
|
131
|
+
key: "componentDidUpdate",
|
|
132
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
133
|
+
if (this.state.ticksContainerEl && (this.props.dialogWidth !== prevProps.dialogWidth || !prevState.ticksContainerEl)) {
|
|
134
|
+
this.setState(function (state) {
|
|
135
|
+
return {
|
|
136
|
+
timelineWidth: state.ticksContainerEl.getBoundingClientRect().width
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
// Automatically pan if nearing the start/end of timeline
|
|
141
|
+
if (this.props.currentTimestamp > this.props.endTime - 0.1 * this.props.timeSpan) {
|
|
142
|
+
if (this.props.endTime - this.props.currentTimestamp > 0) {
|
|
143
|
+
this.pan(+1);
|
|
144
|
+
}
|
|
145
|
+
} else if (this.props.currentTimestamp < this.props.startTime + 0.1 * this.props.timeSpan) {
|
|
146
|
+
if (this.props.currentTimestamp - this.props.startTime > 0) {
|
|
147
|
+
this.pan(-1);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}, {
|
|
152
|
+
key: "render",
|
|
153
|
+
value: function render() {
|
|
154
|
+
var _this2 = this;
|
|
155
|
+
var navButtons = [{
|
|
156
|
+
key: "home",
|
|
157
|
+
tooltip: LocaleUtils.tr("timemanager.home"),
|
|
158
|
+
icon: "home"
|
|
159
|
+
}, {
|
|
160
|
+
key: "zoomout",
|
|
161
|
+
tooltip: LocaleUtils.tr("timemanager.zoomout"),
|
|
162
|
+
icon: "zoomout"
|
|
163
|
+
}, {
|
|
164
|
+
key: "zoomin",
|
|
165
|
+
tooltip: LocaleUtils.tr("timemanager.zoomin"),
|
|
166
|
+
icon: "zoomin"
|
|
167
|
+
}];
|
|
168
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
169
|
+
className: "fixtimeline"
|
|
170
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
171
|
+
className: "fixtimeline-toolbar"
|
|
172
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, {
|
|
173
|
+
onChange: this.props.setStartTime,
|
|
174
|
+
type: "date",
|
|
175
|
+
value: this.props.startTime.format('YYYY-MM-DD')
|
|
176
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
177
|
+
className: "fixtimeline-toolbar-spacer"
|
|
178
|
+
}), /*#__PURE__*/React.createElement(ButtonBar, {
|
|
179
|
+
buttons: navButtons,
|
|
180
|
+
onClick: this.navButtonClicked
|
|
181
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
182
|
+
className: "fixtimeline-toolbar-spacer"
|
|
183
|
+
}), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, {
|
|
184
|
+
onChange: this.props.setEndTime,
|
|
185
|
+
type: "date",
|
|
186
|
+
value: this.props.endTime.format('YYYY-MM-DD')
|
|
187
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
188
|
+
className: "fixtimeline-slider"
|
|
189
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
190
|
+
className: "button fixtimeline-pan-left",
|
|
191
|
+
disabled: this.props.startTime.isSame(this.props.dataStartTime),
|
|
192
|
+
onContextMenu: MiscUtils.killEvent,
|
|
193
|
+
onPointerDown: function onPointerDown() {
|
|
194
|
+
return _this2.startPan(-1);
|
|
195
|
+
}
|
|
196
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
197
|
+
icon: "chevron-left"
|
|
198
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
199
|
+
className: "fixtimeline-ticks",
|
|
200
|
+
ref: this.setTicksContainerRef
|
|
201
|
+
}, this.renderTicks()), /*#__PURE__*/React.createElement("button", {
|
|
202
|
+
className: "button fixtimeline-pan-right",
|
|
203
|
+
disabled: this.props.endTime.isSame(this.props.dataEndTime),
|
|
204
|
+
onContextMenu: MiscUtils.killEvent,
|
|
205
|
+
onPointerDown: function onPointerDown() {
|
|
206
|
+
return _this2.startPan(1);
|
|
207
|
+
}
|
|
208
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
209
|
+
icon: "chevron-right"
|
|
210
|
+
}))), this.props.children(function (time) {
|
|
211
|
+
return FixedTimeline.computePixelFromTime(_this2, time);
|
|
212
|
+
}, function (pixel) {
|
|
213
|
+
return FixedTimeline.computeTimeFromPixel(_this2, pixel);
|
|
214
|
+
}));
|
|
215
|
+
}
|
|
216
|
+
}], [{
|
|
217
|
+
key: "computeTimeFromPixel",
|
|
218
|
+
value: function computeTimeFromPixel(self, pixel) {
|
|
219
|
+
return self.props.startTime + pixel / self.state.timelineWidth * self.props.timeSpan;
|
|
220
|
+
}
|
|
221
|
+
}, {
|
|
222
|
+
key: "computePixelFromTime",
|
|
223
|
+
value: function computePixelFromTime(self, time) {
|
|
224
|
+
return (time - self.props.startTime) / self.props.timeSpan * self.state.timelineWidth;
|
|
225
|
+
}
|
|
226
|
+
}]);
|
|
227
|
+
}(React.Component);
|
|
228
|
+
_defineProperty(FixedTimeline, "propTypes", {
|
|
229
|
+
children: PropTypes.func,
|
|
230
|
+
currentTimestamp: PropTypes.number,
|
|
231
|
+
dataEndTime: PropTypes.object,
|
|
232
|
+
dataStartTime: PropTypes.object,
|
|
233
|
+
dateFormat: PropTypes.string,
|
|
234
|
+
dialogWidth: PropTypes.number,
|
|
235
|
+
endTime: PropTypes.object,
|
|
236
|
+
setEndTime: PropTypes.func,
|
|
237
|
+
setStartTime: PropTypes.func,
|
|
238
|
+
startTime: PropTypes.object,
|
|
239
|
+
timeSpan: PropTypes.number
|
|
240
|
+
});
|
|
241
|
+
export { FixedTimeline as default };
|
|
@@ -1,13 +1,352 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
6
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
7
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
10
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
11
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
+
/**
|
|
2
16
|
* Copyright 2024 Sourcepole AG
|
|
3
17
|
* All rights reserved.
|
|
4
18
|
*
|
|
5
19
|
* This source code is licensed under the BSD-style license found in the
|
|
6
20
|
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import dayjs from 'dayjs';
|
|
25
|
+
import PropTypes from 'prop-types';
|
|
26
|
+
import LocaleUtils from '../../utils/LocaleUtils';
|
|
27
|
+
import MiscUtils from '../../utils/MiscUtils';
|
|
28
|
+
import Icon from '../Icon';
|
|
29
|
+
import ButtonBar from '../widgets/ButtonBar';
|
|
30
|
+
import NumberInput from '../widgets/NumberInput';
|
|
31
|
+
import './style/InfiniteTimeline.css';
|
|
32
|
+
var InfiniteTimeline = /*#__PURE__*/function (_React$Component) {
|
|
33
|
+
function InfiniteTimeline() {
|
|
34
|
+
var _this;
|
|
35
|
+
_classCallCheck(this, InfiniteTimeline);
|
|
36
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
37
|
+
args[_key] = arguments[_key];
|
|
38
|
+
}
|
|
39
|
+
_this = _callSuper(this, InfiniteTimeline, [].concat(args));
|
|
40
|
+
_defineProperty(_this, "state", {
|
|
41
|
+
timelineContainerEl: null,
|
|
42
|
+
timelineWidth: 0,
|
|
43
|
+
timeScalePast: 1,
|
|
44
|
+
timeScaleFuture: 1,
|
|
45
|
+
panOffset: 0,
|
|
46
|
+
zoomFactor: 1 // 1 = [startTime, endTime] fits dialog width in linear scale,
|
|
47
|
+
});
|
|
48
|
+
_defineProperty(_this, "setTimelineContainerRef", function (instance) {
|
|
49
|
+
if (_this.state.timelineContainerEl !== instance) {
|
|
50
|
+
_this.setState({
|
|
51
|
+
timelineContainerEl: instance
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
_defineProperty(_this, "renderTicks", function () {
|
|
56
|
+
var width = _this.state.timelineWidth;
|
|
57
|
+
var now = dayjs(_this.props.currentTimestamp);
|
|
58
|
+
var xnow = 0.5 * width - _this.state.panOffset;
|
|
59
|
+
|
|
60
|
+
// Render one tick every 100px
|
|
61
|
+
var ticks = [{
|
|
62
|
+
pixel: xnow,
|
|
63
|
+
time: now
|
|
64
|
+
}];
|
|
65
|
+
// Compute ticks before current time
|
|
66
|
+
var x = xnow;
|
|
67
|
+
x -= 100;
|
|
68
|
+
while (x >= 0) {
|
|
69
|
+
if (x < width) {
|
|
70
|
+
ticks.push({
|
|
71
|
+
pixel: x,
|
|
72
|
+
time: InfiniteTimeline.computeTimeFromPixel(_this, x)
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
x -= 100;
|
|
76
|
+
}
|
|
77
|
+
// Compute ticks after current time
|
|
78
|
+
x = xnow;
|
|
79
|
+
x += 100;
|
|
80
|
+
while (x <= width) {
|
|
81
|
+
if (x > 0) {
|
|
82
|
+
ticks.push({
|
|
83
|
+
pixel: x,
|
|
84
|
+
time: InfiniteTimeline.computeTimeFromPixel(_this, x)
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
x += 100;
|
|
88
|
+
}
|
|
89
|
+
// Intermediate ticks (lines only)
|
|
90
|
+
var tickPos = [20, 40, 60, 80].map(function (p) {
|
|
91
|
+
return Math.pow(p / 100, 1 / _this.state.timeScalePast) * 100;
|
|
92
|
+
});
|
|
93
|
+
var i = 0;
|
|
94
|
+
for (x = xnow; x - tickPos[i] >= 0;) {
|
|
95
|
+
if (x - tickPos[i] < width) {
|
|
96
|
+
ticks.push({
|
|
97
|
+
pixel: x - tickPos[i]
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
i += 1;
|
|
101
|
+
if (i >= tickPos.length) {
|
|
102
|
+
x -= 100;
|
|
103
|
+
i = 0;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
i = 0;
|
|
107
|
+
tickPos = [20, 40, 60, 80].map(function (p) {
|
|
108
|
+
return Math.pow(p / 100, 1 / _this.state.timeScaleFuture) * 100;
|
|
109
|
+
});
|
|
110
|
+
for (x = xnow; x + tickPos[i] <= width;) {
|
|
111
|
+
if (x + tickPos[i] > 0) {
|
|
112
|
+
ticks.push({
|
|
113
|
+
pixel: x + tickPos[i]
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
i += 1;
|
|
117
|
+
if (i >= tickPos.length) {
|
|
118
|
+
x += 100;
|
|
119
|
+
i = 0;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// Render ticks
|
|
123
|
+
return ticks.map(function (tick) {
|
|
124
|
+
var style = {
|
|
125
|
+
left: tick.pixel - 1 + "px"
|
|
126
|
+
};
|
|
127
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
128
|
+
className: tick.time ? "inftimeline-ltick" : "inftimeline-tick",
|
|
129
|
+
key: "tick" + tick.pixel,
|
|
130
|
+
style: style
|
|
131
|
+
}, tick.time ? /*#__PURE__*/React.createElement("span", null, dayjs(tick.time).format(_this.props.dateFormat)) : null);
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
_defineProperty(_this, "onSliderWheel", function (ev) {
|
|
135
|
+
if (ev.shiftKey) {
|
|
136
|
+
if (ev.deltaY < 0) {
|
|
137
|
+
_this.setState(function (state) {
|
|
138
|
+
return {
|
|
139
|
+
zoomFactor: state.zoomFactor * 0.5
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
} else if (ev.deltaY > 0) {
|
|
143
|
+
_this.setState(function (state) {
|
|
144
|
+
return {
|
|
145
|
+
zoomFactor: state.zoomFactor * 2
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
} else {
|
|
150
|
+
if (ev.deltaX < 0) {
|
|
151
|
+
_this.setState(function (state) {
|
|
152
|
+
return {
|
|
153
|
+
panOffset: state.panOffset - 20
|
|
154
|
+
};
|
|
155
|
+
});
|
|
156
|
+
} else if (ev.deltaX > 0) {
|
|
157
|
+
_this.setState(function (state) {
|
|
158
|
+
return {
|
|
159
|
+
panOffset: state.panOffset + 20
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
ev.preventDefault();
|
|
165
|
+
ev.stopPropagation();
|
|
166
|
+
});
|
|
167
|
+
_defineProperty(_this, "navButtonClicked", function (key) {
|
|
168
|
+
if (key === "home") {
|
|
169
|
+
_this.setState({
|
|
170
|
+
panOffset: 0,
|
|
171
|
+
zoomFactor: 1
|
|
172
|
+
});
|
|
173
|
+
} else if (key === "zoomin") {
|
|
174
|
+
_this.setState(function (state) {
|
|
175
|
+
return {
|
|
176
|
+
zoomFactor: state.zoomFactor * 0.5
|
|
177
|
+
};
|
|
178
|
+
});
|
|
179
|
+
} else if (key === "zoomout") {
|
|
180
|
+
_this.setState(function (state) {
|
|
181
|
+
return {
|
|
182
|
+
zoomFactor: state.zoomFactor * 2
|
|
183
|
+
};
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
_defineProperty(_this, "setTimeScalePast", function (value) {
|
|
188
|
+
_this.props.setMarkersCanBeEnabled(value === 1 && _this.state.timeScaleFuture === 1);
|
|
189
|
+
_this.setState({
|
|
190
|
+
timeScalePast: value
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
_defineProperty(_this, "setTimeScaleFuture", function (value) {
|
|
194
|
+
_this.props.setMarkersCanBeEnabled(_this.state.timeScalePast === 1 && value === 1);
|
|
195
|
+
_this.setState({
|
|
196
|
+
timeScaleFuture: value
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
_defineProperty(_this, "pan", function (offset) {
|
|
200
|
+
_this.setState(function (state) {
|
|
201
|
+
return {
|
|
202
|
+
panOffset: state.panOffset + offset
|
|
203
|
+
};
|
|
204
|
+
});
|
|
205
|
+
var panInterval = null;
|
|
206
|
+
var panTimeout = setTimeout(function () {
|
|
207
|
+
_this.setState(function (state) {
|
|
208
|
+
return {
|
|
209
|
+
panOffset: state.panOffset + offset
|
|
210
|
+
};
|
|
211
|
+
});
|
|
212
|
+
panInterval = setInterval(function () {
|
|
213
|
+
_this.setState(function (state) {
|
|
214
|
+
return {
|
|
215
|
+
panOffset: state.panOffset + offset
|
|
216
|
+
};
|
|
217
|
+
});
|
|
218
|
+
}, 50);
|
|
219
|
+
}, 250);
|
|
220
|
+
document.addEventListener("pointerup", function () {
|
|
221
|
+
clearInterval(panInterval);
|
|
222
|
+
clearTimeout(panTimeout);
|
|
223
|
+
}, {
|
|
224
|
+
once: true,
|
|
225
|
+
capture: true
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
return _this;
|
|
229
|
+
}
|
|
230
|
+
_inherits(InfiniteTimeline, _React$Component);
|
|
231
|
+
return _createClass(InfiniteTimeline, [{
|
|
232
|
+
key: "componentDidUpdate",
|
|
233
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
234
|
+
if (this.state.timelineContainerEl && (this.props.dialogWidth !== prevProps.dialogWidth || !prevState.timelineContainerEl)) {
|
|
235
|
+
this.setState(function (state) {
|
|
236
|
+
return {
|
|
237
|
+
timelineWidth: state.timelineContainerEl.getBoundingClientRect().width
|
|
238
|
+
};
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
if (this.props.currentTimestamp !== prevProps.currentTimestamp) {
|
|
242
|
+
var pixel = InfiniteTimeline.computePixelFromTime(this, this.props.currentTimestamp);
|
|
243
|
+
if (pixel < 0 || pixel >= this.state.timelineWidth) {
|
|
244
|
+
this.setState({
|
|
245
|
+
panOffset: 0
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}, {
|
|
251
|
+
key: "render",
|
|
252
|
+
value: function render() {
|
|
253
|
+
var _this2 = this;
|
|
254
|
+
var navButtons = [{
|
|
255
|
+
key: "home",
|
|
256
|
+
tooltip: LocaleUtils.tr("timemanager.home"),
|
|
257
|
+
icon: "home"
|
|
258
|
+
}, {
|
|
259
|
+
key: "zoomout",
|
|
260
|
+
tooltip: LocaleUtils.tr("timemanager.zoomout"),
|
|
261
|
+
icon: "zoomout"
|
|
262
|
+
}, {
|
|
263
|
+
key: "zoomin",
|
|
264
|
+
tooltip: LocaleUtils.tr("timemanager.zoomin"),
|
|
265
|
+
icon: "zoomin"
|
|
266
|
+
}];
|
|
267
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
268
|
+
className: "inftimeline",
|
|
269
|
+
onWheel: this.onSliderWheel,
|
|
270
|
+
ref: this.setTimelineContainerRef
|
|
271
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
272
|
+
className: "inftimeline-toolbar"
|
|
273
|
+
}, /*#__PURE__*/React.createElement(ButtonBar, {
|
|
274
|
+
buttons: navButtons,
|
|
275
|
+
onClick: this.navButtonClicked
|
|
276
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
277
|
+
className: "inftimeline-toolbar-block"
|
|
278
|
+
}, /*#__PURE__*/React.createElement("span", null, LocaleUtils.tr("timemanager.timelinescale"), ": \xA0"), /*#__PURE__*/React.createElement(NumberInput, {
|
|
279
|
+
decimals: 2,
|
|
280
|
+
max: 10,
|
|
281
|
+
min: 0.01,
|
|
282
|
+
mobile: true,
|
|
283
|
+
onChange: this.setTimeScalePast,
|
|
284
|
+
value: this.state.timeScalePast
|
|
285
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
286
|
+
icon: "before",
|
|
287
|
+
title: LocaleUtils.tr("timemanager.past")
|
|
288
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
289
|
+
icon: "after",
|
|
290
|
+
title: LocaleUtils.tr("timemanager.future")
|
|
291
|
+
}), /*#__PURE__*/React.createElement(NumberInput, {
|
|
292
|
+
decimals: 2,
|
|
293
|
+
max: 10,
|
|
294
|
+
min: 0.01,
|
|
295
|
+
mobile: true,
|
|
296
|
+
onChange: this.setTimeScaleFuture,
|
|
297
|
+
value: this.state.timeScaleFuture
|
|
298
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
299
|
+
className: "inftimeline-toolbar-spacer"
|
|
300
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
301
|
+
className: "inftimeline-clip"
|
|
302
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
303
|
+
className: "button inftimeline-pan-left",
|
|
304
|
+
onContextMenu: MiscUtils.killEvent,
|
|
305
|
+
onPointerDown: function onPointerDown() {
|
|
306
|
+
return _this2.pan(-20);
|
|
307
|
+
}
|
|
308
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
309
|
+
icon: "chevron-left"
|
|
310
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
311
|
+
className: "inftimeline-ticks"
|
|
312
|
+
}, this.renderTicks()), /*#__PURE__*/React.createElement("button", {
|
|
313
|
+
className: "button inftimeline-pan-right",
|
|
314
|
+
onContextMenu: MiscUtils.killEvent,
|
|
315
|
+
onPointerDown: function onPointerDown() {
|
|
316
|
+
return _this2.pan(20);
|
|
317
|
+
}
|
|
318
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
319
|
+
icon: "chevron-right"
|
|
320
|
+
}))), this.props.children(function (time) {
|
|
321
|
+
return InfiniteTimeline.computePixelFromTime(_this2, time);
|
|
322
|
+
}, function (pixel) {
|
|
323
|
+
return InfiniteTimeline.computeTimeFromPixel(_this2, pixel);
|
|
324
|
+
}));
|
|
325
|
+
}
|
|
326
|
+
}], [{
|
|
327
|
+
key: "computeTimeFromPixel",
|
|
328
|
+
value: function computeTimeFromPixel(self, pixel) {
|
|
329
|
+
var dpx = self.state.panOffset + pixel - 0.5 * self.state.timelineWidth;
|
|
330
|
+
var exp = pixel - 0.5 * self.state.timelineWidth < 0 ? self.state.timeScalePast : self.state.timeScaleFuture;
|
|
331
|
+
return self.props.currentTimestamp + Math.sign(dpx) * Math.pow(Math.abs(dpx) / (0.5 * self.state.timelineWidth), exp) * 0.5 * self.props.timeSpan * self.state.zoomFactor;
|
|
332
|
+
}
|
|
333
|
+
}, {
|
|
334
|
+
key: "computePixelFromTime",
|
|
335
|
+
value: function computePixelFromTime(self, time) {
|
|
336
|
+
var dt = time - self.props.currentTimestamp;
|
|
337
|
+
var iexp = dt < 0 ? 1 / self.state.timeScalePast : 1 / self.state.timeScaleFuture;
|
|
338
|
+
return 0.5 * self.state.timelineWidth * (1 + Math.sign(dt) * Math.pow(Math.abs(dt) / (0.5 * self.props.timeSpan * self.state.zoomFactor), iexp)) - self.state.panOffset;
|
|
339
|
+
}
|
|
340
|
+
}]);
|
|
341
|
+
}(React.Component);
|
|
342
|
+
_defineProperty(InfiniteTimeline, "propTypes", {
|
|
343
|
+
children: PropTypes.func,
|
|
344
|
+
currentTimestamp: PropTypes.number,
|
|
345
|
+
dateFormat: PropTypes.string,
|
|
346
|
+
dialogWidth: PropTypes.number,
|
|
347
|
+
endTime: PropTypes.object,
|
|
348
|
+
setMarkersCanBeEnabled: PropTypes.func,
|
|
349
|
+
startTime: PropTypes.object,
|
|
350
|
+
timeSpan: PropTypes.number
|
|
351
|
+
});
|
|
352
|
+
export { InfiniteTimeline as default };
|