@mwater/visualization 5.1.0 → 5.3.0
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/lib/ColorComponent.d.ts +10 -11
- package/lib/ColorComponent.js +78 -29
- package/lib/ColorSchemeFactory.d.ts +13 -2
- package/lib/ColorSchemeFactory.js +7 -5
- package/lib/CustomColorsContext.d.ts +6 -0
- package/lib/CustomColorsContext.js +6 -0
- package/lib/FiltersDesignerComponent.d.ts +1 -4
- package/lib/FiltersDesignerComponent.js +2 -3
- package/lib/GlobalFilter.d.ts +13 -0
- package/lib/GlobalFilter.js +2 -0
- package/lib/LocaleContextInjector.d.ts +5 -11
- package/lib/LocaleContextInjector.js +4 -12
- package/lib/MWaterAddRelatedFormComponent.js +3 -3
- package/lib/MWaterAddRelatedIndicatorComponent.d.ts +1 -4
- package/lib/MWaterAddRelatedIndicatorComponent.js +6 -6
- package/lib/MWaterCompleteTableSelectComponent.d.ts +7 -25
- package/lib/MWaterCompleteTableSelectComponent.js +36 -36
- package/lib/MWaterContextComponent.d.ts +19 -9
- package/lib/MWaterContextComponent.js +38 -22
- package/lib/MWaterCustomTablesetListComponent.js +9 -3
- package/lib/MWaterGlobalFiltersComponent.d.ts +6 -5
- package/lib/MWaterGlobalFiltersComponent.js +4 -4
- package/lib/MWaterLoaderComponent.d.ts +15 -3
- package/lib/MWaterLoaderComponent.js +11 -2
- package/lib/MWaterTableSelectComponent.d.ts +1 -4
- package/lib/MWaterTableSelectComponent.js +10 -12
- package/lib/UIComponents.d.ts +2 -2
- package/lib/UIComponents.js +4 -12
- package/lib/axes/Axis.d.ts +20 -25
- package/lib/axes/AxisBuilder.d.ts +7 -4
- package/lib/axes/AxisBuilder.js +12 -8
- package/lib/axes/AxisComponent.d.ts +6 -9
- package/lib/axes/AxisComponent.js +1 -2
- package/lib/axes/ColorPaletteCollectionComponent.d.ts +5 -12
- package/lib/axes/ColorPaletteCollectionComponent.js +67 -36
- package/lib/dashboards/DashboardComponent.d.ts +4 -17
- package/lib/dashboards/DashboardComponent.js +20 -67
- package/lib/dashboards/DashboardDesign.d.ts +5 -20
- package/lib/dashboards/DashboardUpgrader.js +36 -1
- package/lib/dashboards/DashboardViewComponent.d.ts +5 -34
- package/lib/dashboards/DashboardViewComponent.js +112 -136
- package/lib/dashboards/FontStyleEditor.d.ts +8 -0
- package/lib/dashboards/FontStyleEditor.js +130 -0
- package/lib/dashboards/LayoutOptionsComponent.d.ts +0 -1
- package/lib/dashboards/LayoutOptionsComponent.js +209 -39
- package/lib/dashboards/ServerDashboardDataSource.d.ts +1 -2
- package/lib/dashboards/ServerDashboardDataSource.js +52 -33
- package/lib/dashboards/SettingsModalComponent.d.ts +4 -15
- package/lib/dashboards/SettingsModalComponent.js +24 -38
- package/lib/dashboards/WidgetComponent.d.ts +3 -3
- package/lib/dashboards/WidgetComponent.js +3 -6
- package/lib/dashboards/WidgetDataSourcePrioritizer.d.ts +20 -0
- package/lib/dashboards/WidgetDataSourcePrioritizer.js +72 -0
- package/lib/dashboards/layoutOptions.d.ts +83 -0
- package/lib/dashboards/layoutOptions.js +436 -10
- package/lib/datagrids/DatagridComponent.d.ts +2 -9
- package/lib/datagrids/DatagridDataSource.d.ts +3 -3
- package/lib/datagrids/DatagridDataSource.js +0 -14
- package/lib/datagrids/DatagridDesign.d.ts +7 -6
- package/lib/datagrids/DatagridDesignerComponent.d.ts +2 -93
- package/lib/datagrids/DatagridDesignerComponent.js +8 -6
- package/lib/datagrids/DatagridViewComponent.js +1 -1
- package/lib/datagrids/FindReplaceModalComponent.d.ts +4 -20
- package/lib/datagrids/FindReplaceModalComponent.js +27 -13
- package/lib/datagrids/ServerDatagridDataSource.d.ts +8 -7
- package/lib/datagrids/ServerDatagridDataSource.js +88 -36
- package/lib/demo.js +4 -4
- package/lib/index.css +5 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +0 -1
- package/lib/layouts/LayoutManager.d.ts +33 -29
- package/lib/layouts/LayoutManager.js +2 -8
- package/lib/layouts/blocks/BlocksDisplayComponent.d.ts +26 -56
- package/lib/layouts/blocks/BlocksDisplayComponent.js +122 -205
- package/lib/layouts/blocks/BlocksLayoutManager.d.ts +6 -22
- package/lib/layouts/blocks/BlocksLayoutManager.js +5 -14
- package/lib/layouts/blocks/HorizontalBlockComponent.d.ts +5 -4
- package/lib/layouts/blocks/HorizontalBlockComponent.js +5 -5
- package/lib/layouts/grid/GridLayoutManager.d.ts +2 -1
- package/lib/mWaterLoader.d.ts +2 -0
- package/lib/mWaterLoader.js +2 -1
- package/lib/maps/AddLayerComponent.d.ts +6 -8
- package/lib/maps/AddLayerComponent.js +6 -6
- package/lib/maps/BingLayer.js +10 -20
- package/lib/maps/BufferLayer.js +5 -2
- package/lib/maps/ChoroplethLayer.js +2 -1
- package/lib/maps/ClusterLayer.js +3 -1
- package/lib/maps/DirectMapDataSource.d.ts +5 -2
- package/lib/maps/DirectMapDataSource.js +2 -1
- package/lib/maps/EditPopupComponent.js +2 -1
- package/lib/maps/GridLayer.js +5 -3
- package/lib/maps/GridLayerDesigner.js +0 -1
- package/lib/maps/LayerSwitcherComponent.js +1 -1
- package/lib/maps/MapComponent.d.ts +3 -11
- package/lib/maps/MapComponent.js +3 -3
- package/lib/maps/MapDesign.d.ts +2 -13
- package/lib/maps/MapFiltersDesignerComponent.d.ts +0 -4
- package/lib/maps/MapFiltersDesignerComponent.js +4 -5
- package/lib/maps/MarkersLayer.js +30 -25
- package/lib/maps/RasterMapViewComponent.d.ts +3 -13
- package/lib/maps/RasterMapViewComponent.js +3 -3
- package/lib/maps/RegionSelectComponent.d.ts +2 -1
- package/lib/maps/ServerMapDataSource.d.ts +3 -4
- package/lib/maps/ServerMapDataSource.js +5 -5
- package/lib/maps/VectorMapViewComponent.js +2 -1
- package/lib/maps/mapSymbols.js +2 -0
- package/lib/maps/symbols/font-awesome/cloud-rain.png +0 -0
- package/lib/maps/vectorMaps.d.ts +1 -0
- package/lib/maps/vectorMaps.js +70 -56
- package/lib/quickfilter/QuickfilterCompiler.d.ts +1 -1
- package/lib/quickfilter/QuickfiltersComponent.d.ts +1 -4
- package/lib/quickfilter/QuickfiltersComponent.js +3 -3
- package/lib/richtext/DropdownPaletteItem.d.ts +32 -0
- package/lib/richtext/DropdownPaletteItem.js +82 -0
- package/lib/richtext/FontColorPaletteItem.d.ts +1 -5
- package/lib/richtext/FontColorPaletteItem.js +32 -27
- package/lib/richtext/ItemsHtmlConverter.js +12 -3
- package/lib/richtext/RichTextComponent.d.ts +26 -52
- package/lib/richtext/RichTextComponent.js +166 -128
- package/lib/valueFormatter.js +6 -1
- package/lib/wellknown.d.ts +5 -0
- package/lib/wellknown.js +288 -0
- package/lib/widgets/DropdownWidgetComponent.d.ts +8 -25
- package/lib/widgets/DropdownWidgetComponent.js +48 -25
- package/lib/widgets/IFrameWidgetComponent.d.ts +3 -11
- package/lib/widgets/ImageWidgetComponent.d.ts +8 -27
- package/lib/widgets/MapWidget.d.ts +4 -7
- package/lib/widgets/MapWidget.js +2 -1
- package/lib/widgets/MarkdownWidget.d.ts +2 -7
- package/lib/widgets/TOCWidget.d.ts +2 -9
- package/lib/widgets/TOCWidget.js +2 -1
- package/lib/widgets/Widget.d.ts +2 -0
- package/lib/widgets/WidgetDataSource.d.ts +3 -1
- package/lib/widgets/charts/Chart.d.ts +0 -1
- package/lib/widgets/charts/ChartViewComponent.d.ts +4 -0
- package/lib/widgets/charts/ChartViewComponent.js +11 -3
- package/lib/widgets/charts/ChartWidget.d.ts +1 -74
- package/lib/widgets/charts/ChartWidget.js +4 -183
- package/lib/widgets/charts/ChartWidgetComponent.d.ts +51 -0
- package/lib/widgets/charts/ChartWidgetComponent.js +167 -0
- package/lib/widgets/charts/calendar/CalendarChartViewComponent.d.ts +1 -4
- package/lib/widgets/charts/calendar/CalendarChartViewComponent.js +4 -4
- package/lib/widgets/charts/imagemosaic/ImagePopupComponent.d.ts +2 -7
- package/lib/widgets/charts/layered/LayeredChart.d.ts +5 -10
- package/lib/widgets/charts/layered/LayeredChart.js +6 -7
- package/lib/widgets/charts/layered/LayeredChartCompiler.d.ts +4 -2
- package/lib/widgets/charts/layered/LayeredChartCompiler.js +46 -32
- package/lib/widgets/charts/layered/LayeredChartDesign.d.ts +4 -0
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.d.ts +5 -31
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +21 -3
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.d.ts +1 -7
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +2 -1
- package/lib/widgets/charts/layered/LayeredChartViewComponent.d.ts +1 -4
- package/lib/widgets/charts/layered/LayeredChartViewComponent.js +89 -38
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.d.ts +5 -105
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.js +122 -166
- package/lib/widgets/charts/pivot/PivotChart.d.ts +6 -0
- package/lib/widgets/charts/pivot/PivotChart.js +47 -17
- package/lib/widgets/charts/pivot/PivotChartDesign.d.ts +11 -0
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +11 -7
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +1 -1
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.d.ts +2 -2
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.js +20 -36
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +0 -1
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.d.ts +23 -2
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.js +215 -181
- package/lib/widgets/charts/pivot/PivotChartUtils.d.ts +2 -2
- package/lib/widgets/charts/pivot/PivotChartViewComponent.d.ts +9 -47
- package/lib/widgets/charts/pivot/PivotChartViewComponent.js +20 -60
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +55 -58
- package/lib/widgets/charts/table/TableChart.js +8 -4
- package/lib/widgets/charts/table/TableChartDesignerComponent.js +3 -3
- package/lib/widgets/charts/table/TableChartViewComponent.js +30 -16
- package/lib/widgets/text/ExprInsertModalComponent.d.ts +2 -13
- package/lib/widgets/text/ExprUpdateModalComponent.d.ts +2 -13
- package/lib/widgets/text/TextComponent.d.ts +5 -12
- package/lib/widgets/text/TextComponent.js +19 -39
- package/lib/widgets/text/TextWidget.d.ts +2 -1
- package/lib/widgets/text/TextWidget.js +5 -1
- package/lib/widgets/text/TextWidgetComponent.d.ts +15 -3
- package/lib/widgets/text/TextWidgetComponent.js +76 -19
- package/lib/widgets/text/TextWidgetDesign.d.ts +16 -2
- package/lib/widgets/text/TextWidgetDesign.js +6 -0
- package/package.json +4 -4
- package/src/ColorComponent.tsx +177 -0
- package/src/ColorSchemeFactory.ts +12 -6
- package/src/CustomColorsContext.tsx +8 -0
- package/src/FiltersDesignerComponent.ts +3 -4
- package/src/GlobalFilter.ts +17 -0
- package/src/LocaleContextInjector.tsx +14 -13
- package/src/MWaterAddRelatedFormComponent.ts +3 -3
- package/src/MWaterAddRelatedIndicatorComponent.ts +6 -6
- package/src/MWaterCompleteTableSelectComponent.tsx +36 -36
- package/src/MWaterContextComponent.tsx +42 -33
- package/src/MWaterCustomTablesetListComponent.tsx +21 -3
- package/src/MWaterGlobalFiltersComponent.ts +8 -8
- package/src/MWaterLoaderComponent.ts +14 -4
- package/src/MWaterTableSelectComponent.tsx +11 -12
- package/src/{UIComponents.ts → UIComponents.tsx} +7 -15
- package/src/axes/Axis.ts +24 -25
- package/src/axes/AxisBuilder.ts +16 -13
- package/src/axes/AxisComponent.ts +3 -4
- package/src/axes/{ColorPaletteCollectionComponent.ts → ColorPaletteCollectionComponent.tsx} +87 -61
- package/src/dashboards/DashboardComponent.tsx +73 -147
- package/src/dashboards/DashboardDesign.ts +5 -25
- package/src/dashboards/DashboardUpgrader.ts +41 -1
- package/src/dashboards/DashboardViewComponent.tsx +313 -0
- package/src/dashboards/FontStyleEditor.tsx +166 -0
- package/src/dashboards/LayoutOptionsComponent.tsx +377 -71
- package/src/dashboards/ServerDashboardDataSource.ts +52 -33
- package/src/dashboards/SettingsModalComponent.tsx +170 -0
- package/src/dashboards/WidgetComponent.tsx +6 -12
- package/src/dashboards/WidgetDataSourcePrioritizer.ts +82 -0
- package/src/dashboards/layoutOptions.tsx +581 -0
- package/src/datagrids/DatagridDataSource.ts +6 -12
- package/src/datagrids/DatagridDesign.ts +8 -3
- package/src/datagrids/DatagridDesignerComponent.tsx +22 -18
- package/src/datagrids/DatagridViewComponent.ts +3 -3
- package/src/datagrids/ExprCellComponent.ts +0 -1
- package/src/datagrids/FindReplaceModalComponent.ts +39 -22
- package/src/datagrids/ServerDatagridDataSource.ts +107 -45
- package/src/demo.ts +4 -4
- package/src/index.css +5 -0
- package/src/index.ts +2 -1
- package/src/layouts/LayoutManager.ts +44 -42
- package/src/layouts/blocks/BlocksDisplayComponent.tsx +498 -0
- package/src/layouts/blocks/BlocksLayoutManager.ts +6 -15
- package/src/layouts/blocks/HorizontalBlockComponent.ts +9 -8
- package/src/mWaterLoader.ts +4 -1
- package/src/maps/AddLayerComponent.ts +9 -9
- package/src/maps/BingLayer.ts +16 -26
- package/src/maps/BufferLayer.ts +5 -2
- package/src/maps/ChoroplethLayer.ts +2 -1
- package/src/maps/ClusterLayer.ts +3 -1
- package/src/maps/DirectMapDataSource.ts +12 -3
- package/src/maps/EditPopupComponent.ts +2 -1
- package/src/maps/GridLayer.ts +5 -3
- package/src/maps/GridLayerDesigner.tsx +0 -1
- package/src/maps/LayerSwitcherComponent.tsx +1 -1
- package/src/maps/MapComponent.ts +3 -3
- package/src/maps/MapDesign.ts +2 -17
- package/src/maps/{MapFiltersDesignerComponent.ts → MapFiltersDesignerComponent.tsx} +25 -25
- package/src/maps/MarkersLayer.ts +38 -41
- package/src/maps/RasterMapViewComponent.ts +3 -3
- package/src/maps/ServerMapDataSource.ts +8 -8
- package/src/maps/VectorMapViewComponent.tsx +2 -2
- package/src/maps/mapSymbols.ts +2 -0
- package/src/maps/symbols/font-awesome/cloud-rain.png +0 -0
- package/src/maps/vectorMaps.tsx +88 -74
- package/src/quickfilter/QuickfilterCompiler.ts +1 -1
- package/src/quickfilter/QuickfiltersComponent.ts +3 -3
- package/src/richtext/DropdownPaletteItem.tsx +144 -0
- package/src/richtext/FontColorPaletteItem.tsx +160 -0
- package/src/richtext/ItemsHtmlConverter.ts +15 -5
- package/src/richtext/RichTextComponent.tsx +274 -232
- package/src/valueFormatter.ts +5 -1
- package/src/wellknown.ts +286 -0
- package/src/widgets/DropdownWidgetComponent.tsx +75 -0
- package/src/widgets/MapWidget.ts +5 -2
- package/src/widgets/TOCWidget.ts +2 -1
- package/src/widgets/Widget.ts +3 -0
- package/src/widgets/WidgetDataSource.ts +3 -1
- package/src/widgets/charts/Chart.ts +1 -1
- package/src/widgets/charts/ChartViewComponent.ts +16 -3
- package/src/widgets/charts/ChartWidget.ts +3 -275
- package/src/widgets/charts/ChartWidgetComponent.tsx +281 -0
- package/src/widgets/charts/calendar/CalendarChartViewComponent.tsx +4 -4
- package/src/widgets/charts/layered/LayeredChart.ts +4 -6
- package/src/widgets/charts/layered/LayeredChartCompiler.ts +80 -63
- package/src/widgets/charts/layered/LayeredChartDesign.ts +7 -1
- package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +43 -10
- package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +6 -6
- package/src/widgets/charts/layered/LayeredChartViewComponent.ts +140 -88
- package/src/widgets/charts/pivot/IntersectionDesignerComponent.tsx +305 -221
- package/src/widgets/charts/pivot/PivotChart.ts +56 -18
- package/src/widgets/charts/pivot/PivotChartDesign.ts +12 -0
- package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +4 -3
- package/src/widgets/charts/pivot/PivotChartLayoutBuilder.ts +39 -76
- package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +0 -1
- package/src/widgets/charts/pivot/PivotChartQueryBuilder.ts +230 -189
- package/src/widgets/charts/pivot/PivotChartUtils.ts +4 -4
- package/src/widgets/charts/pivot/{PivotChartViewComponent.ts → PivotChartViewComponent.tsx} +86 -89
- package/src/widgets/charts/table/TableChart.ts +8 -4
- package/src/widgets/charts/table/TableChartDesignerComponent.ts +4 -4
- package/src/widgets/charts/table/TableChartViewComponent.ts +32 -19
- package/src/widgets/text/TextComponent.tsx +47 -49
- package/src/widgets/text/TextWidget.ts +8 -3
- package/src/widgets/text/TextWidgetComponent.tsx +249 -0
- package/src/widgets/text/TextWidgetDesign.ts +26 -2
- package/src/ColorComponent.ts +0 -117
- package/src/dashboards/DashboardViewComponent.ts +0 -304
- package/src/dashboards/SettingsModalComponent.ts +0 -169
- package/src/dashboards/layoutOptions.ts +0 -40
- package/src/layout-styles.css +0 -263
- package/src/layouts/blocks/BlocksDisplayComponent.ts +0 -461
- package/src/layouts/grid/GridLayoutComponent.ts +0 -67
- package/src/layouts/grid/GridLayoutManager.ts +0 -185
- package/src/layouts/grid/LegoLayoutEngine.ts +0 -142
- package/src/layouts/grid/PaletteItemComponent.ts +0 -28
- package/src/layouts/grid/README.md +0 -14
- package/src/layouts/grid/WidgetContainerComponent.ts +0 -420
- package/src/richtext/FontColorPaletteItem.ts +0 -172
- package/src/richtext/FontSizePaletteItem.ts +0 -110
- package/src/widgets/DropdownWidgetComponent.ts +0 -78
- package/src/widgets/text/TextWidgetComponent.ts +0 -120
package/lib/wellknown.js
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
|
|
4
|
+
https://github.com/mapbox/wellknown
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2016, Mapbox
|
|
7
|
+
|
|
8
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
9
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
10
|
+
copyright notice and this permission notice appear in all copies.
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
13
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
14
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
15
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
16
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
17
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
18
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
19
|
+
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.stringify = exports.parse = void 0;
|
|
23
|
+
const numberRegexp = /[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/;
|
|
24
|
+
// Matches sequences like '100 100' or '100 100 100'.
|
|
25
|
+
const tuples = new RegExp('^' + numberRegexp.source + '(\\s' + numberRegexp.source + '){1,}');
|
|
26
|
+
/*
|
|
27
|
+
* Parse WKT and return GeoJSON.
|
|
28
|
+
*
|
|
29
|
+
* @param {string} _ A WKT geometry
|
|
30
|
+
* @return {?Object} A GeoJSON geometry object
|
|
31
|
+
*/
|
|
32
|
+
function parse(input) {
|
|
33
|
+
let parts = input.split(';');
|
|
34
|
+
let _ = parts.pop();
|
|
35
|
+
let srid = (parts.shift() || '').split('=').pop() || '';
|
|
36
|
+
let i = 0;
|
|
37
|
+
function $(re) {
|
|
38
|
+
let match = _.substring(i).match(re);
|
|
39
|
+
if (!match)
|
|
40
|
+
return null;
|
|
41
|
+
else {
|
|
42
|
+
i += match[0].length;
|
|
43
|
+
return match[0];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function crs(obj) {
|
|
47
|
+
if (obj && srid.match(/\d+/)) {
|
|
48
|
+
obj.crs = {
|
|
49
|
+
type: 'name',
|
|
50
|
+
properties: {
|
|
51
|
+
name: 'urn:ogc:def:crs:EPSG::' + srid
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return obj;
|
|
56
|
+
}
|
|
57
|
+
function white() { $(/^\s*/); }
|
|
58
|
+
function multicoords() {
|
|
59
|
+
white();
|
|
60
|
+
let depth = 0;
|
|
61
|
+
let rings = [];
|
|
62
|
+
let stack = [rings];
|
|
63
|
+
let pointer = rings;
|
|
64
|
+
let elem;
|
|
65
|
+
while (elem =
|
|
66
|
+
$(/^(\()/) ||
|
|
67
|
+
$(/^(\))/) ||
|
|
68
|
+
$(/^(,)/) ||
|
|
69
|
+
$(tuples)) {
|
|
70
|
+
if (elem === '(') {
|
|
71
|
+
stack.push(pointer);
|
|
72
|
+
pointer = [];
|
|
73
|
+
stack[stack.length - 1].push(pointer);
|
|
74
|
+
depth++;
|
|
75
|
+
}
|
|
76
|
+
else if (elem === ')') {
|
|
77
|
+
// For the case: Polygon(), ...
|
|
78
|
+
if (pointer.length === 0)
|
|
79
|
+
return null;
|
|
80
|
+
pointer = stack.pop() || [];
|
|
81
|
+
// the stack was empty, input was malformed
|
|
82
|
+
if (!pointer)
|
|
83
|
+
return null;
|
|
84
|
+
depth--;
|
|
85
|
+
if (depth === 0)
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
else if (elem === ',') {
|
|
89
|
+
pointer = [];
|
|
90
|
+
stack[stack.length - 1].push(pointer);
|
|
91
|
+
}
|
|
92
|
+
else if (!elem.split(/\s/g).some(s => isNaN(s))) {
|
|
93
|
+
Array.prototype.push.apply(pointer, elem.split(/\s/g).map(parseFloat));
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
white();
|
|
99
|
+
}
|
|
100
|
+
if (depth !== 0)
|
|
101
|
+
return null;
|
|
102
|
+
return rings;
|
|
103
|
+
}
|
|
104
|
+
function coords() {
|
|
105
|
+
let list = [];
|
|
106
|
+
let item;
|
|
107
|
+
let pt;
|
|
108
|
+
while (pt =
|
|
109
|
+
$(tuples) ||
|
|
110
|
+
$(/^(,)/)) {
|
|
111
|
+
if (pt === ',') {
|
|
112
|
+
list.push(item);
|
|
113
|
+
item = [];
|
|
114
|
+
}
|
|
115
|
+
else if (!pt.split(/\s/g).some(s => isNaN(s))) {
|
|
116
|
+
if (!item)
|
|
117
|
+
item = [];
|
|
118
|
+
Array.prototype.push.apply(item, pt.split(/\s/g).map(parseFloat));
|
|
119
|
+
}
|
|
120
|
+
white();
|
|
121
|
+
}
|
|
122
|
+
if (item)
|
|
123
|
+
list.push(item);
|
|
124
|
+
else
|
|
125
|
+
return null;
|
|
126
|
+
return list.length ? list : null;
|
|
127
|
+
}
|
|
128
|
+
function point() {
|
|
129
|
+
if (!$(/^(point(\sz)?)/i))
|
|
130
|
+
return null;
|
|
131
|
+
white();
|
|
132
|
+
if (!$(/^(\()/))
|
|
133
|
+
return null;
|
|
134
|
+
let c = coords();
|
|
135
|
+
if (!c)
|
|
136
|
+
return null;
|
|
137
|
+
white();
|
|
138
|
+
if (!$(/^(\))/))
|
|
139
|
+
return null;
|
|
140
|
+
return {
|
|
141
|
+
type: 'Point',
|
|
142
|
+
coordinates: c[0]
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function multipoint() {
|
|
146
|
+
if (!$(/^(multipoint(\sz)?)/i))
|
|
147
|
+
return null;
|
|
148
|
+
white();
|
|
149
|
+
let newCoordsFormat = _
|
|
150
|
+
.substring(_.indexOf('(') + 1, _.length - 1)
|
|
151
|
+
.replace(/\(/g, '')
|
|
152
|
+
.replace(/\)/g, '');
|
|
153
|
+
_ = 'MULTIPOINT (' + newCoordsFormat + ')';
|
|
154
|
+
let c = multicoords();
|
|
155
|
+
if (!c)
|
|
156
|
+
return null;
|
|
157
|
+
white();
|
|
158
|
+
return {
|
|
159
|
+
type: 'MultiPoint',
|
|
160
|
+
coordinates: c
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function multilinestring() {
|
|
164
|
+
if (!$(/^(multilinestring(\sz)?)/i))
|
|
165
|
+
return null;
|
|
166
|
+
white();
|
|
167
|
+
let c = multicoords();
|
|
168
|
+
if (!c)
|
|
169
|
+
return null;
|
|
170
|
+
white();
|
|
171
|
+
return {
|
|
172
|
+
type: 'MultiLineString',
|
|
173
|
+
coordinates: c
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function linestring() {
|
|
177
|
+
if (!$(/^(linestring(\sz)?)/i))
|
|
178
|
+
return null;
|
|
179
|
+
white();
|
|
180
|
+
if (!$(/^(\()/))
|
|
181
|
+
return null;
|
|
182
|
+
let c = coords();
|
|
183
|
+
if (!c)
|
|
184
|
+
return null;
|
|
185
|
+
if (!$(/^(\))/))
|
|
186
|
+
return null;
|
|
187
|
+
return {
|
|
188
|
+
type: 'LineString',
|
|
189
|
+
coordinates: c
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
function polygon() {
|
|
193
|
+
if (!$(/^(polygon(\sz)?)/i))
|
|
194
|
+
return null;
|
|
195
|
+
white();
|
|
196
|
+
let c = multicoords();
|
|
197
|
+
if (!c)
|
|
198
|
+
return null;
|
|
199
|
+
return {
|
|
200
|
+
type: 'Polygon',
|
|
201
|
+
coordinates: c
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function multipolygon() {
|
|
205
|
+
if (!$(/^(multipolygon(\sz)?)/i))
|
|
206
|
+
return null;
|
|
207
|
+
white();
|
|
208
|
+
let c = multicoords();
|
|
209
|
+
if (!c)
|
|
210
|
+
return null;
|
|
211
|
+
return {
|
|
212
|
+
type: 'MultiPolygon',
|
|
213
|
+
coordinates: c
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function geometrycollection() {
|
|
217
|
+
let geometries = [];
|
|
218
|
+
let geometry;
|
|
219
|
+
if (!$(/^(geometrycollection)/i))
|
|
220
|
+
return null;
|
|
221
|
+
white();
|
|
222
|
+
if (!$(/^(\()/))
|
|
223
|
+
return null;
|
|
224
|
+
while (geometry = root()) {
|
|
225
|
+
geometries.push(geometry);
|
|
226
|
+
white();
|
|
227
|
+
$(/^(,)/);
|
|
228
|
+
white();
|
|
229
|
+
}
|
|
230
|
+
if (!$(/^(\))/))
|
|
231
|
+
return null;
|
|
232
|
+
return {
|
|
233
|
+
type: 'GeometryCollection',
|
|
234
|
+
geometries: geometries
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function root() {
|
|
238
|
+
return point() ||
|
|
239
|
+
linestring() ||
|
|
240
|
+
polygon() ||
|
|
241
|
+
multipoint() ||
|
|
242
|
+
multilinestring() ||
|
|
243
|
+
multipolygon() ||
|
|
244
|
+
geometrycollection();
|
|
245
|
+
}
|
|
246
|
+
return crs(root());
|
|
247
|
+
}
|
|
248
|
+
exports.parse = parse;
|
|
249
|
+
/**
|
|
250
|
+
* Stringifies a GeoJSON object into WKT
|
|
251
|
+
*/
|
|
252
|
+
function stringify(gj) {
|
|
253
|
+
if (gj.type === 'Feature') {
|
|
254
|
+
gj = gj.geometry;
|
|
255
|
+
}
|
|
256
|
+
function pairWKT(c) {
|
|
257
|
+
return c.join(' ');
|
|
258
|
+
}
|
|
259
|
+
function ringWKT(r) {
|
|
260
|
+
return r.map(pairWKT).join(', ');
|
|
261
|
+
}
|
|
262
|
+
function ringsWKT(r) {
|
|
263
|
+
return r.map(ringWKT).map(wrapParens).join(', ');
|
|
264
|
+
}
|
|
265
|
+
function multiRingsWKT(r) {
|
|
266
|
+
return r.map(ringsWKT).map(wrapParens).join(', ');
|
|
267
|
+
}
|
|
268
|
+
function wrapParens(s) { return '(' + s + ')'; }
|
|
269
|
+
switch (gj.type) {
|
|
270
|
+
case 'Point':
|
|
271
|
+
return 'POINT (' + pairWKT(gj.coordinates) + ')';
|
|
272
|
+
case 'LineString':
|
|
273
|
+
return 'LINESTRING (' + ringWKT(gj.coordinates) + ')';
|
|
274
|
+
case 'Polygon':
|
|
275
|
+
return 'POLYGON (' + ringsWKT(gj.coordinates) + ')';
|
|
276
|
+
case 'MultiPoint':
|
|
277
|
+
return 'MULTIPOINT (' + ringWKT(gj.coordinates) + ')';
|
|
278
|
+
case 'MultiPolygon':
|
|
279
|
+
return 'MULTIPOLYGON (' + multiRingsWKT(gj.coordinates) + ')';
|
|
280
|
+
case 'MultiLineString':
|
|
281
|
+
return 'MULTILINESTRING (' + ringsWKT(gj.coordinates) + ')';
|
|
282
|
+
case 'GeometryCollection':
|
|
283
|
+
return 'GEOMETRYCOLLECTION (' + gj.geometries.map(stringify).join(', ') + ')';
|
|
284
|
+
default:
|
|
285
|
+
throw new Error('stringify requires a valid GeoJSON Feature or geometry object as input');
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
exports.stringify = stringify;
|
|
@@ -1,31 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="bootstrap" />
|
|
3
|
-
import React from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
4
2
|
export interface DropdownWidgetComponentProps {
|
|
5
3
|
/** Width specification */
|
|
6
4
|
width?: any;
|
|
7
5
|
/** Height specification */
|
|
8
6
|
height?: any;
|
|
9
|
-
dropdownItems:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
style: {
|
|
15
|
-
position: string;
|
|
16
|
-
right: number;
|
|
17
|
-
top: number;
|
|
18
|
-
cursor: string;
|
|
19
|
-
zIndex: number;
|
|
20
|
-
};
|
|
21
|
-
}, string | React.JSXElementConstructor<any>> | null;
|
|
22
|
-
closeMenu: () => JQuery<HTMLElement>;
|
|
23
|
-
render(): React.DetailedReactHTMLElement<{
|
|
24
|
-
className: string;
|
|
25
|
-
onMouseLeave: () => JQuery<HTMLElement>;
|
|
26
|
-
style: {
|
|
27
|
-
width: any;
|
|
28
|
-
height: any;
|
|
29
|
-
};
|
|
30
|
-
}, HTMLElement>;
|
|
7
|
+
dropdownItems: {
|
|
8
|
+
label: ReactNode;
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
}[];
|
|
11
|
+
children?: ReactNode;
|
|
31
12
|
}
|
|
13
|
+
declare const DropdownWidgetComponent: (props: DropdownWidgetComponentProps) => React.JSX.Element;
|
|
14
|
+
export default DropdownWidgetComponent;
|
|
@@ -1,20 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const jquery_1 = __importDefault(require("jquery"));
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const react_dom_1 = __importDefault(require("react-dom"));
|
|
10
|
-
const R = react_1.default.createElement;
|
|
26
|
+
const react_1 = __importStar(require("react"));
|
|
11
27
|
// Widget wrapper that adds a dropdown menu in a gear floating
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
28
|
+
const DropdownWidgetComponent = (props) => {
|
|
29
|
+
const { width, height, dropdownItems, children } = props;
|
|
30
|
+
const dropdownRef = (0, react_1.useRef)(null);
|
|
31
|
+
const renderDropdownItem = (item, i) => {
|
|
32
|
+
return (react_1.default.createElement("li", { key: `${i}` },
|
|
33
|
+
react_1.default.createElement("a", { className: "dropdown-item", onClick: item.onClick }, item.label)));
|
|
15
34
|
};
|
|
16
|
-
renderDropdown() {
|
|
17
|
-
if (
|
|
35
|
+
const renderDropdown = () => {
|
|
36
|
+
if (dropdownItems.length === 0) {
|
|
18
37
|
return null;
|
|
19
38
|
}
|
|
20
39
|
const dropdownStyle = {
|
|
@@ -24,18 +43,22 @@ class DropdownWidgetComponent extends react_1.default.Component {
|
|
|
24
43
|
cursor: "pointer",
|
|
25
44
|
zIndex: 1029
|
|
26
45
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
46
|
+
return (react_1.default.createElement("div", { style: dropdownStyle, ref: dropdownRef },
|
|
47
|
+
react_1.default.createElement("div", { style: dropdownStyle, "data-bs-toggle": "dropdown" },
|
|
48
|
+
react_1.default.createElement("div", { className: "mwater-visualization-simple-widget-gear-button" },
|
|
49
|
+
react_1.default.createElement("span", { className: "fas fa-cog" }))),
|
|
50
|
+
react_1.default.createElement("ul", { className: "dropdown-menu dropdown-menu-end", style: { top: 25 } }, dropdownItems.map(renderDropdownItem))));
|
|
32
51
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
52
|
+
const closeMenu = (0, react_1.useCallback)(() => {
|
|
53
|
+
if (dropdownRef.current) {
|
|
54
|
+
const dropdownToggle = dropdownRef.current.querySelector('[data-bs-toggle="dropdown"]');
|
|
55
|
+
if (dropdownToggle) {
|
|
56
|
+
dropdownToggle.parentElement?.classList.remove('open');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}, []);
|
|
60
|
+
return (react_1.default.createElement("div", { className: "mwater-visualization-simple-widget", onMouseLeave: closeMenu, style: { width, height } },
|
|
61
|
+
children,
|
|
62
|
+
renderDropdown()));
|
|
63
|
+
};
|
|
41
64
|
exports.default = DropdownWidgetComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import ModalPopupComponent from "@mwater/react-library/lib/ModalPopupComponent";
|
|
3
3
|
export interface IFrameWidgetComponentProps {
|
|
4
4
|
design: any;
|
|
5
5
|
/** Called with new design. null/undefined for readonly */
|
|
@@ -15,19 +15,11 @@ export default class IFrameWidgetComponent extends React.Component<IFrameWidgetC
|
|
|
15
15
|
constructor(props: any);
|
|
16
16
|
handleStartEditing: () => void;
|
|
17
17
|
handleEndEditing: () => any;
|
|
18
|
-
renderEditor(): React.CElement<
|
|
19
|
-
header: string;
|
|
20
|
-
showCloseX: boolean;
|
|
21
|
-
onClose: () => any;
|
|
22
|
-
}, React.Component<{
|
|
23
|
-
header: string;
|
|
24
|
-
showCloseX: boolean;
|
|
25
|
-
onClose: () => any;
|
|
26
|
-
}, any, any>> | null;
|
|
18
|
+
renderEditor(): React.CElement<import("@mwater/react-library/lib/ModalPopupComponent").ModalPopupComponentProps, ModalPopupComponent> | null;
|
|
27
19
|
renderEditLink(): React.DetailedReactHTMLElement<{
|
|
28
20
|
className: string;
|
|
29
21
|
onClick: () => void;
|
|
30
22
|
}, HTMLElement>;
|
|
31
|
-
render(): React.
|
|
23
|
+
render(): React.FunctionComponentElement<import("./DropdownWidgetComponent").DropdownWidgetComponentProps>;
|
|
32
24
|
}
|
|
33
25
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import AsyncLoadComponent from "@mwater/react-library/lib/AsyncLoadComponent";
|
|
3
|
-
import
|
|
3
|
+
import AutoSizeComponent from "@mwater/react-library/lib/AutoSizeComponent";
|
|
4
|
+
import ModalPopupComponent from "@mwater/react-library/lib/ModalPopupComponent";
|
|
4
5
|
import { DataSource, Schema } from "@mwater/expressions";
|
|
5
6
|
import { WidgetDataSource } from "./WidgetDataSource";
|
|
6
7
|
import { ImageWidgetDesign } from "./ImageWidget";
|
|
@@ -23,24 +24,16 @@ export default class ImageWidgetComponent extends AsyncLoadComponent<ImageWidget
|
|
|
23
24
|
}> {
|
|
24
25
|
editor: ImageWidgetDesignComponent | null;
|
|
25
26
|
isLoadNeeded(newProps: ImageWidgetComponentProps, oldProps: ImageWidgetComponentProps): boolean;
|
|
26
|
-
load(props: ImageWidgetComponentProps, prevProps: ImageWidgetComponentProps, callback: any): void;
|
|
27
|
+
load(props: ImageWidgetComponentProps, prevProps: ImageWidgetComponentProps, callback: any): void | AbortController | undefined;
|
|
27
28
|
handleStartEditing: () => void;
|
|
28
29
|
renderEditLink(): React.DetailedReactHTMLElement<{
|
|
29
30
|
className: string;
|
|
30
31
|
onClick: () => void;
|
|
31
32
|
}, HTMLElement>;
|
|
32
33
|
renderEditor(): React.CElement<any, ImageWidgetDesignComponent>;
|
|
33
|
-
renderExpression(): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement> | React.CElement<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
injectHeight: boolean;
|
|
37
|
-
}, any, any>> | null;
|
|
38
|
-
renderContent(): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement> | React.CElement<{
|
|
39
|
-
injectHeight: boolean;
|
|
40
|
-
}, React.Component<{
|
|
41
|
-
injectHeight: boolean;
|
|
42
|
-
}, any, any>> | React.CElement<RotatedImageComponentProps, RotatedImageComponent> | null;
|
|
43
|
-
render(): React.CElement<import("./DropdownWidgetComponent").DropdownWidgetComponentProps, DropdownWidgetComponent>;
|
|
34
|
+
renderExpression(): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement> | React.CElement<import("@mwater/react-library/lib/AutoSizeComponent").AutoSizeComponentProps, AutoSizeComponent> | null;
|
|
35
|
+
renderContent(): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement> | React.CElement<import("@mwater/react-library/lib/AutoSizeComponent").AutoSizeComponentProps, AutoSizeComponent> | React.CElement<RotatedImageComponentProps, RotatedImageComponent> | null;
|
|
36
|
+
render(): React.FunctionComponentElement<import("./DropdownWidgetComponent").DropdownWidgetComponentProps>;
|
|
44
37
|
}
|
|
45
38
|
interface ImageWidgetDesignComponentProps {
|
|
46
39
|
design: any;
|
|
@@ -96,13 +89,7 @@ declare class ImageWidgetDesignComponent extends React.Component<ImageWidgetDesi
|
|
|
96
89
|
renderUrlEditor(): React.DetailedReactHTMLElement<{
|
|
97
90
|
className: string;
|
|
98
91
|
}, HTMLElement>;
|
|
99
|
-
render(): React.CElement<
|
|
100
|
-
header: string;
|
|
101
|
-
footer: React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
102
|
-
}, React.Component<{
|
|
103
|
-
header: string;
|
|
104
|
-
footer: React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
105
|
-
}, any, any>> | null;
|
|
92
|
+
render(): React.CElement<import("@mwater/react-library/lib/ModalPopupComponent").ModalPopupComponentProps, ModalPopupComponent> | null;
|
|
106
93
|
}
|
|
107
94
|
interface RotatedImageComponentProps {
|
|
108
95
|
/** Url of the image */
|
|
@@ -114,12 +101,6 @@ interface RotatedImageComponentProps {
|
|
|
114
101
|
openUrlInSameTab?: boolean;
|
|
115
102
|
}
|
|
116
103
|
declare class RotatedImageComponent extends React.Component<RotatedImageComponentProps> {
|
|
117
|
-
render(): React.CElement<
|
|
118
|
-
injectWidth: boolean;
|
|
119
|
-
injectHeight: boolean;
|
|
120
|
-
}, React.Component<{
|
|
121
|
-
injectWidth: boolean;
|
|
122
|
-
injectHeight: boolean;
|
|
123
|
-
}, any, any>>;
|
|
104
|
+
render(): React.CElement<import("@mwater/react-library/lib/AutoSizeComponent").AutoSizeComponentProps, AutoSizeComponent>;
|
|
124
105
|
}
|
|
125
106
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Widget, { CreateViewElementOptions } from "./Widget";
|
|
3
|
+
import ModalWindowComponent from "@mwater/react-library/lib/ModalWindowComponent";
|
|
3
4
|
import { DataSource, Schema } from "@mwater/expressions";
|
|
4
5
|
import { WidgetDataSource } from "./WidgetDataSource";
|
|
5
6
|
export default class MapWidget extends Widget {
|
|
@@ -25,6 +26,8 @@ interface MapWidgetComponentProps {
|
|
|
25
26
|
/** called with (scope) as a scope to apply to self and filter to apply to other widgets. See WidgetScoper for details */
|
|
26
27
|
onScopeChange?: any;
|
|
27
28
|
onRowClick?: any;
|
|
29
|
+
/** TODO: implement refreshing */
|
|
30
|
+
refreshKey?: any;
|
|
28
31
|
}
|
|
29
32
|
interface MapWidgetComponentState {
|
|
30
33
|
editDesign: any;
|
|
@@ -36,13 +39,7 @@ declare class MapWidgetComponent extends React.Component<MapWidgetComponentProps
|
|
|
36
39
|
handleStartEditing: () => void;
|
|
37
40
|
handleEndEditing: () => void;
|
|
38
41
|
handleEditDesignChange: (design: any) => void;
|
|
39
|
-
renderEditor(): React.CElement<
|
|
40
|
-
isOpen: boolean;
|
|
41
|
-
onRequestClose: () => void;
|
|
42
|
-
}, React.Component<{
|
|
43
|
-
isOpen: boolean;
|
|
44
|
-
onRequestClose: () => void;
|
|
45
|
-
}, any, any>> | null;
|
|
42
|
+
renderEditor(): React.CElement<import("@mwater/react-library/lib/ModalWindowComponent").ModalWindowComponentProps, ModalWindowComponent> | null;
|
|
46
43
|
renderContent(design: any, onDesignChange: any, width: any, height: any): React.DetailedReactHTMLElement<{
|
|
47
44
|
style: {
|
|
48
45
|
width: any;
|
package/lib/widgets/MapWidget.js
CHANGED
|
@@ -60,7 +60,8 @@ class MapWidget extends Widget_1.default {
|
|
|
60
60
|
onScopeChange: options.onScopeChange,
|
|
61
61
|
width: options.width,
|
|
62
62
|
height: options.height,
|
|
63
|
-
onRowClick: options.onRowClick
|
|
63
|
+
onRowClick: options.onRowClick,
|
|
64
|
+
refreshKey: options.refreshKey
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
67
|
// Get a list of table ids that can be filtered on
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Widget, { CreateViewElementOptions } from "./Widget";
|
|
3
|
+
import ModalWindowComponent from "@mwater/react-library/lib/ModalWindowComponent";
|
|
3
4
|
export default class MarkdownWidget extends Widget {
|
|
4
5
|
createViewElement(options: CreateViewElementOptions): React.CElement<any, MarkdownWidgetComponent>;
|
|
5
6
|
isAutoHeight(): boolean;
|
|
@@ -20,13 +21,7 @@ declare class MarkdownWidgetComponent extends React.Component<MarkdownWidgetComp
|
|
|
20
21
|
handleStartEditing: () => void;
|
|
21
22
|
handleEndEditing: () => void;
|
|
22
23
|
handleEditDesignChange: (design: any) => void;
|
|
23
|
-
renderEditor(): React.CElement<
|
|
24
|
-
isOpen: boolean;
|
|
25
|
-
onRequestClose: () => void;
|
|
26
|
-
}, React.Component<{
|
|
27
|
-
isOpen: boolean;
|
|
28
|
-
onRequestClose: () => void;
|
|
29
|
-
}, any, any>> | null;
|
|
24
|
+
renderEditor(): React.CElement<import("@mwater/react-library/lib/ModalWindowComponent").ModalWindowComponentProps, ModalWindowComponent> | null;
|
|
30
25
|
renderContent(design: any): React.CElement<MarkdownWidgetViewComponentProps, MarkdownWidgetViewComponent>;
|
|
31
26
|
render(): React.DetailedReactHTMLElement<{
|
|
32
27
|
onDoubleClick: () => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import PropTypes from "prop-types";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import Widget, { CreateViewElementOptions } from "./Widget";
|
|
4
|
+
import ModalPopupComponent from "@mwater/react-library/lib/ModalPopupComponent";
|
|
4
5
|
export default class TOCWidget extends Widget {
|
|
5
6
|
createViewElement(options: CreateViewElementOptions): React.CElement<any, TOCWidgetComponent>;
|
|
6
7
|
isAutoHeight(): boolean;
|
|
@@ -22,15 +23,7 @@ declare class TOCWidgetComponent extends React.Component {
|
|
|
22
23
|
constructor(props: any);
|
|
23
24
|
handleStartEditing: () => void;
|
|
24
25
|
handleEndEditing: () => void;
|
|
25
|
-
renderEditor(): React.CElement<
|
|
26
|
-
showCloseX: boolean;
|
|
27
|
-
header: string;
|
|
28
|
-
onClose: () => void;
|
|
29
|
-
}, React.Component<{
|
|
30
|
-
showCloseX: boolean;
|
|
31
|
-
header: string;
|
|
32
|
-
onClose: () => void;
|
|
33
|
-
}, any, any>> | null;
|
|
26
|
+
renderEditor(): React.CElement<import("@mwater/react-library/lib/ModalPopupComponent").ModalPopupComponentProps, ModalPopupComponent> | null;
|
|
34
27
|
renderContent(): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
35
28
|
render(): React.DetailedReactHTMLElement<{
|
|
36
29
|
onDoubleClick: () => void;
|
package/lib/widgets/TOCWidget.js
CHANGED
|
@@ -151,6 +151,7 @@ class TOCWidgetViewComponent extends react_1.default.Component {
|
|
|
151
151
|
onScrollToTOCEntry: prop_types_1.default.func
|
|
152
152
|
};
|
|
153
153
|
handleEntryClick = (tocEntry) => {
|
|
154
|
+
debugger;
|
|
154
155
|
return this.props.onScrollToTOCEntry?.(tocEntry.widgetId, tocEntry.id);
|
|
155
156
|
};
|
|
156
157
|
renderTOCEntry(tocEntry, index) {
|
|
@@ -203,7 +204,7 @@ class TOCWidgetViewComponent extends react_1.default.Component {
|
|
|
203
204
|
return this.renderTOCEntry(tocEntry, i);
|
|
204
205
|
}),
|
|
205
206
|
// Add placeholder if none and editable
|
|
206
|
-
this.props.onDesignChange && this.props.tocEntries.length === 0
|
|
207
|
+
this.props.onDesignChange && (this.props.tocEntries || []).length === 0
|
|
207
208
|
? R("div", { className: "text-muted" }, "Table of Contents will appear here as text blocks with headings are added to the dashboard")
|
|
208
209
|
: undefined);
|
|
209
210
|
}
|
package/lib/widgets/Widget.d.ts
CHANGED
|
@@ -39,6 +39,8 @@ export interface CreateViewElementOptions {
|
|
|
39
39
|
widgetRef?: (widget: any) => void;
|
|
40
40
|
/** called with (widgetId, tocEntryId) to scroll to TOC entry */
|
|
41
41
|
onScrollToTOCEntry?: (widgetId: string, tocEntryId: string) => void;
|
|
42
|
+
/** A key that changes when the widget should be refreshed */
|
|
43
|
+
refreshKey?: any;
|
|
42
44
|
}
|
|
43
45
|
export default class Widget {
|
|
44
46
|
/** Creates a React element that is a view of the widget */
|
|
@@ -10,8 +10,10 @@ export interface WidgetDataSource {
|
|
|
10
10
|
* design: design of the widget. Ignored in the case of server-side rendering
|
|
11
11
|
* filters: array of filters to apply. Each is { table: table id, jsonql: jsonql condition with {alias} for tableAlias. Use injectAlias to correct
|
|
12
12
|
* callback: (error, data)
|
|
13
|
+
*
|
|
14
|
+
* Can be aborted by cancelling the AbortController
|
|
13
15
|
*/
|
|
14
|
-
getData(design: any, filters: JsonQLFilter[], callback: (error: any, data?: any) => void): void;
|
|
16
|
+
getData(design: any, filters: JsonQLFilter[], callback: (error: any, data?: any) => void): AbortController | void | undefined;
|
|
15
17
|
/** For map widgets, the following is required */
|
|
16
18
|
getMapDataSource?(design: MapDesign): MapDataSource;
|
|
17
19
|
/** Get the url to download an image (by id from an image or imagelist column)
|
|
@@ -48,7 +48,6 @@ export default class Chart {
|
|
|
48
48
|
createViewElement(options: ChartCreateViewElementOptions): ReactNode;
|
|
49
49
|
createDropdownItems(design: any, schema: Schema, widgetDataSource: WidgetDataSource, filters: any): {
|
|
50
50
|
label: ReactNode;
|
|
51
|
-
icon?: string;
|
|
52
51
|
onClick: () => void;
|
|
53
52
|
}[];
|
|
54
53
|
createDataTable(design: any, schema: Schema, dataSource: DataSource, data: any, locale: any): any[][];
|