@mwater/visualization 5.4.5 → 5.6.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/MWaterContextComponent.d.ts +1 -1
- package/lib/MWaterContextComponent.js +1 -1
- package/lib/MWaterGlobalFiltersComponent.d.ts +2 -2
- package/lib/MWaterGlobalFiltersComponent.js +11 -20
- package/lib/MWaterLoaderComponent.d.ts +5 -14
- package/lib/MWaterLoaderComponent.js +2 -11
- package/lib/UndoStack.d.ts +2 -1
- package/lib/UndoStack.js +12 -6
- package/lib/dashboards/DashboardComponent.js +7 -5
- package/lib/dashboards/DashboardDesign.d.ts +1 -1
- package/lib/dashboards/LayoutOptionsComponent.js +18 -11
- package/lib/dashboards/ServerDashboardDataSource.d.ts +10 -1
- package/lib/dashboards/ServerDashboardDataSource.js +29 -10
- package/lib/dashboards/SettingsModalComponent.js +1 -1
- package/lib/dashboards/layoutOptions.d.ts +5 -1
- package/lib/datagrids/DatagridComponent.js +23 -3
- package/lib/datagrids/DatagridDesignerComponent.d.ts +2 -3
- package/lib/datagrids/DatagridDesignerComponent.js +108 -120
- package/lib/datagrids/DatagridViewComponent.js +3 -2
- package/lib/datagrids/ExprCellComponent.d.ts +1 -0
- package/lib/datagrids/ExprCellComponent.js +22 -20
- package/lib/datagrids/OrderBysDesignerComponent.d.ts +7 -7
- package/lib/datagrids/OrderBysDesignerComponent.js +19 -28
- package/lib/index.css +45 -2
- package/lib/index.d.ts +5 -5
- package/lib/index.js +2 -3
- package/lib/layouts/blocks/BlocksDisplayComponent.d.ts +8 -1
- package/lib/layouts/blocks/BlocksDisplayComponent.js +46 -4
- package/lib/maps/BufferLayer.d.ts +18 -0
- package/lib/maps/BufferLayer.js +36 -14
- package/lib/maps/BufferLayerDesign.d.ts +1 -1
- package/lib/maps/BufferLayerDesignerComponent.js +2 -2
- package/lib/maps/ChoroplethLayer.d.ts +18 -0
- package/lib/maps/ChoroplethLayer.js +46 -25
- package/lib/maps/ChoroplethLayerDesign.d.ts +7 -3
- package/lib/maps/ChoroplethLayerDesigner.d.ts +10 -22
- package/lib/maps/ChoroplethLayerDesigner.js +58 -89
- package/lib/maps/DirectMapDataSource.js +17 -10
- package/lib/maps/EditHoverOver.d.ts +4 -3
- package/lib/maps/EditHoverOver.js +64 -35
- package/lib/maps/HoverContent.d.ts +10 -5
- package/lib/maps/HoverContent.js +7 -36
- package/lib/maps/Layer.d.ts +37 -0
- package/lib/maps/Layer.js +30 -4
- package/lib/maps/LeafletMapComponent.js +10 -19
- package/lib/maps/MWaterServerLayer.d.ts +2 -2
- package/lib/maps/MWaterServerLayer.js +6 -6
- package/lib/maps/MapComponent.js +0 -1
- package/lib/maps/MapLayerDataSource.d.ts +9 -0
- package/lib/maps/MapUtils.d.ts +19 -1
- package/lib/maps/MapUtils.js +80 -1
- package/lib/maps/MarkersLayer.d.ts +18 -0
- package/lib/maps/MarkersLayer.js +42 -26
- package/lib/maps/MarkersLayerDesign.d.ts +1 -1
- package/lib/maps/MarkersLayerDesignerComponent.d.ts +12 -28
- package/lib/maps/MarkersLayerDesignerComponent.js +81 -111
- package/lib/maps/RasterMapViewComponent.js +1 -1
- package/lib/maps/ServerMapDataSource.d.ts +9 -0
- package/lib/maps/ServerMapDataSource.js +29 -10
- package/lib/maps/VectorMapViewComponent.js +7 -15
- package/lib/maps/maps.d.ts +4 -2
- package/lib/maps/symbols/font-awesome/asterisk.png +0 -0
- package/lib/maps/symbols/font-awesome/ban.png +0 -0
- package/lib/maps/symbols/font-awesome/beer.png +0 -0
- package/lib/maps/symbols/font-awesome/bell.png +0 -0
- package/lib/maps/symbols/font-awesome/bolt.png +0 -0
- package/lib/maps/symbols/font-awesome/building.png +0 -0
- package/lib/maps/symbols/font-awesome/bullseye.png +0 -0
- package/lib/maps/symbols/font-awesome/bus.png +0 -0
- package/lib/maps/symbols/font-awesome/caret-up.png +0 -0
- package/lib/maps/symbols/font-awesome/certificate.png +0 -0
- package/lib/maps/symbols/font-awesome/check-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/check.png +0 -0
- package/lib/maps/symbols/font-awesome/chevron-circle-down.png +0 -0
- package/lib/maps/symbols/font-awesome/chevron-circle-up.png +0 -0
- package/lib/maps/symbols/font-awesome/cloud-rain.png +0 -0
- package/lib/maps/symbols/font-awesome/cloud.png +0 -0
- package/lib/maps/symbols/font-awesome/comment.png +0 -0
- package/lib/maps/symbols/font-awesome/crosshairs.png +0 -0
- package/lib/maps/symbols/font-awesome/dot-circle-o.png +0 -0
- package/lib/maps/symbols/font-awesome/exclamation-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/exclamation-triangle.png +0 -0
- package/lib/maps/symbols/font-awesome/female.png +0 -0
- package/lib/maps/symbols/font-awesome/file.png +0 -0
- package/lib/maps/symbols/font-awesome/flag.png +0 -0
- package/lib/maps/symbols/font-awesome/flask.png +0 -0
- package/lib/maps/symbols/font-awesome/h-square.png +0 -0
- package/lib/maps/symbols/font-awesome/home.png +0 -0
- package/lib/maps/symbols/font-awesome/info-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/male.png +0 -0
- package/lib/maps/symbols/font-awesome/medkit.png +0 -0
- package/lib/maps/symbols/font-awesome/mobile.png +0 -0
- package/lib/maps/symbols/font-awesome/plus-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/plus-square.png +0 -0
- package/lib/maps/symbols/font-awesome/plus.png +0 -0
- package/lib/maps/symbols/font-awesome/square.png +0 -0
- package/lib/maps/symbols/font-awesome/star.png +0 -0
- package/lib/maps/symbols/font-awesome/thumbs-down.png +0 -0
- package/lib/maps/symbols/font-awesome/thumbs-up.png +0 -0
- package/lib/maps/symbols/font-awesome/ticket.png +0 -0
- package/lib/maps/symbols/font-awesome/times-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/times.png +0 -0
- package/lib/maps/symbols/font-awesome/tint.png +0 -0
- package/lib/maps/symbols/font-awesome/tree.png +0 -0
- package/lib/maps/symbols/font-awesome/university.png +0 -0
- package/lib/maps/symbols/font-awesome/usd.png +0 -0
- package/lib/maps/symbols/font-awesome/user.png +0 -0
- package/lib/maps/symbols/font-awesome/users.png +0 -0
- package/lib/maps/symbols/font-awesome/wheelchair.png +0 -0
- package/lib/maps/symbols/sdf-ize.sh +93 -0
- package/lib/maps/vectorMaps.d.ts +1 -0
- package/lib/maps/vectorMaps.js +20 -36
- package/lib/mwater_table_selection/FormsListComponent.d.ts +33 -0
- package/lib/mwater_table_selection/FormsListComponent.js +141 -0
- package/lib/mwater_table_selection/IndicatorsListComponent.d.ts +49 -0
- package/lib/mwater_table_selection/IndicatorsListComponent.js +251 -0
- package/lib/mwater_table_selection/IssuesListComponent.d.ts +29 -0
- package/lib/mwater_table_selection/IssuesListComponent.js +123 -0
- package/lib/mwater_table_selection/MWaterAccountingSystemListComponent.d.ts +20 -0
- package/lib/mwater_table_selection/MWaterAccountingSystemListComponent.js +157 -0
- package/lib/mwater_table_selection/MWaterAssetSystemsListComponent.d.ts +17 -0
- package/lib/mwater_table_selection/MWaterAssetSystemsListComponent.js +79 -0
- package/lib/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.d.ts +18 -0
- package/lib/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.js +80 -0
- package/lib/mwater_table_selection/MWaterCompleteTableSelectComponent.d.ts +63 -0
- package/lib/mwater_table_selection/MWaterCompleteTableSelectComponent.js +461 -0
- package/lib/mwater_table_selection/MWaterCustomTablesetListComponent.d.ts +17 -0
- package/lib/mwater_table_selection/MWaterCustomTablesetListComponent.js +94 -0
- package/lib/mwater_table_selection/MWaterMetricsTableListComponent.d.ts +17 -0
- package/lib/mwater_table_selection/MWaterMetricsTableListComponent.js +80 -0
- package/lib/mwater_table_selection/MWaterTableSelectComponent.d.ts +32 -0
- package/lib/mwater_table_selection/MWaterTableSelectComponent.js +163 -0
- package/lib/mwater_table_selection/MWaterWorkflowsSelectComponent.d.ts +19 -0
- package/lib/mwater_table_selection/MWaterWorkflowsSelectComponent.js +111 -0
- package/lib/quickfilter/QuickfiltersComponent.d.ts +3 -102
- package/lib/quickfilter/QuickfiltersComponent.js +53 -110
- package/lib/quickfilter/TextLiteralComponent.d.ts +23 -47
- package/lib/quickfilter/TextLiteralComponent.js +85 -82
- package/lib/widgets/MapWidget.js +4 -2
- package/lib/widgets/charts/Chart.d.ts +11 -0
- package/lib/widgets/charts/Chart.js +15 -0
- package/lib/widgets/charts/ChartWidgetComponent.d.ts +1 -0
- package/lib/widgets/charts/ChartWidgetComponent.js +27 -1
- package/lib/widgets/charts/layered/LayeredChartDesign.d.ts +1 -1
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.d.ts +1 -1
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +5 -12
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.d.ts +43 -57
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +113 -110
- package/lib/widgets/charts/layered/LayeredChartUtils.d.ts +2 -1
- package/lib/widgets/charts/layered/LayeredChartUtils.js +0 -2
- package/lib/widgets/charts/pivot/PivotChart.d.ts +2 -0
- package/lib/widgets/charts/pivot/PivotChart.js +156 -0
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +5 -20
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +31 -61
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.d.ts +4 -0
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.js +4 -2
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.d.ts +5 -44
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +38 -63
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +7 -68
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.js +58 -106
- package/lib/widgets/charts/table/TableChart.d.ts +2 -0
- package/lib/widgets/charts/table/TableChart.js +172 -1
- package/lib/widgets/charts/table/TableChartDesignerComponent.d.ts +7 -17
- package/lib/widgets/charts/table/TableChartDesignerComponent.js +79 -95
- package/lib/widgets/charts/table/TableChartViewComponent.d.ts +1 -7
- package/lib/widgets/charts/table/TableChartViewComponent.js +19 -27
- package/lib/widgets/text/ExprItemEditorComponent.d.ts +3 -8
- package/lib/widgets/text/ExprItemEditorComponent.js +36 -33
- package/lib/widgets/text/ExprUpdateModalComponent.d.ts +1 -0
- package/package.json +4 -10
- package/src/MWaterContextComponent.tsx +2 -2
- package/src/{MWaterGlobalFiltersComponent.ts → MWaterGlobalFiltersComponent.tsx} +32 -33
- package/src/{MWaterLoaderComponent.ts → MWaterLoaderComponent.tsx} +18 -19
- package/src/UndoStack.ts +14 -6
- package/src/dashboards/DashboardComponent.tsx +7 -5
- package/src/dashboards/DashboardDesign.ts +1 -1
- package/src/dashboards/LayoutOptionsComponent.tsx +22 -10
- package/src/dashboards/ServerDashboardDataSource.ts +36 -13
- package/src/dashboards/SettingsModalComponent.tsx +1 -1
- package/src/dashboards/layoutOptions.tsx +5 -1
- package/src/datagrids/DatagridComponent.tsx +31 -3
- package/src/datagrids/DatagridDesignerComponent.tsx +241 -229
- package/src/datagrids/DatagridViewComponent.tsx +3 -2
- package/src/datagrids/ExprCellComponent.tsx +23 -20
- package/src/datagrids/OrderBysDesignerComponent.tsx +61 -70
- package/src/index.css +45 -2
- package/src/index.ts +5 -11
- package/src/layouts/blocks/BlocksDisplayComponent.tsx +60 -5
- package/src/maps/BufferLayer.ts +48 -20
- package/src/maps/BufferLayerDesign.ts +1 -1
- package/src/maps/BufferLayerDesignerComponent.tsx +2 -1
- package/src/maps/ChoroplethLayer.ts +70 -39
- package/src/maps/ChoroplethLayerDesign.ts +6 -2
- package/src/maps/ChoroplethLayerDesigner.tsx +171 -167
- package/src/maps/DirectMapDataSource.ts +21 -13
- package/src/maps/EditHoverOver.tsx +98 -54
- package/src/maps/HoverContent.tsx +17 -48
- package/src/maps/Layer.ts +42 -4
- package/src/maps/LeafletMapComponent.tsx +10 -19
- package/src/maps/MWaterServerLayer.ts +6 -6
- package/src/maps/MapComponent.ts +0 -1
- package/src/maps/MapLayerDataSource.ts +8 -0
- package/src/maps/MapUtils.ts +82 -3
- package/src/maps/MarkersLayer.ts +54 -27
- package/src/maps/MarkersLayerDesign.ts +1 -1
- package/src/maps/MarkersLayerDesignerComponent.tsx +360 -0
- package/src/maps/RasterMapViewComponent.ts +1 -1
- package/src/maps/ServerMapDataSource.ts +35 -12
- package/src/maps/VectorMapViewComponent.tsx +8 -19
- package/src/maps/maps.ts +4 -2
- package/src/maps/symbols/font-awesome/asterisk.png +0 -0
- package/src/maps/symbols/font-awesome/ban.png +0 -0
- package/src/maps/symbols/font-awesome/beer.png +0 -0
- package/src/maps/symbols/font-awesome/bell.png +0 -0
- package/src/maps/symbols/font-awesome/bolt.png +0 -0
- package/src/maps/symbols/font-awesome/building.png +0 -0
- package/src/maps/symbols/font-awesome/bullseye.png +0 -0
- package/src/maps/symbols/font-awesome/bus.png +0 -0
- package/src/maps/symbols/font-awesome/caret-up.png +0 -0
- package/src/maps/symbols/font-awesome/certificate.png +0 -0
- package/src/maps/symbols/font-awesome/check-circle.png +0 -0
- package/src/maps/symbols/font-awesome/check.png +0 -0
- package/src/maps/symbols/font-awesome/chevron-circle-down.png +0 -0
- package/src/maps/symbols/font-awesome/chevron-circle-up.png +0 -0
- package/src/maps/symbols/font-awesome/cloud-rain.png +0 -0
- package/src/maps/symbols/font-awesome/cloud.png +0 -0
- package/src/maps/symbols/font-awesome/comment.png +0 -0
- package/src/maps/symbols/font-awesome/crosshairs.png +0 -0
- package/src/maps/symbols/font-awesome/dot-circle-o.png +0 -0
- package/src/maps/symbols/font-awesome/exclamation-circle.png +0 -0
- package/src/maps/symbols/font-awesome/exclamation-triangle.png +0 -0
- package/src/maps/symbols/font-awesome/female.png +0 -0
- package/src/maps/symbols/font-awesome/file.png +0 -0
- package/src/maps/symbols/font-awesome/flag.png +0 -0
- package/src/maps/symbols/font-awesome/flask.png +0 -0
- package/src/maps/symbols/font-awesome/h-square.png +0 -0
- package/src/maps/symbols/font-awesome/home.png +0 -0
- package/src/maps/symbols/font-awesome/info-circle.png +0 -0
- package/src/maps/symbols/font-awesome/male.png +0 -0
- package/src/maps/symbols/font-awesome/medkit.png +0 -0
- package/src/maps/symbols/font-awesome/mobile.png +0 -0
- package/src/maps/symbols/font-awesome/plus-circle.png +0 -0
- package/src/maps/symbols/font-awesome/plus-square.png +0 -0
- package/src/maps/symbols/font-awesome/plus.png +0 -0
- package/src/maps/symbols/font-awesome/square.png +0 -0
- package/src/maps/symbols/font-awesome/star.png +0 -0
- package/src/maps/symbols/font-awesome/thumbs-down.png +0 -0
- package/src/maps/symbols/font-awesome/thumbs-up.png +0 -0
- package/src/maps/symbols/font-awesome/ticket.png +0 -0
- package/src/maps/symbols/font-awesome/times-circle.png +0 -0
- package/src/maps/symbols/font-awesome/times.png +0 -0
- package/src/maps/symbols/font-awesome/tint.png +0 -0
- package/src/maps/symbols/font-awesome/tree.png +0 -0
- package/src/maps/symbols/font-awesome/university.png +0 -0
- package/src/maps/symbols/font-awesome/usd.png +0 -0
- package/src/maps/symbols/font-awesome/user.png +0 -0
- package/src/maps/symbols/font-awesome/users.png +0 -0
- package/src/maps/symbols/font-awesome/wheelchair.png +0 -0
- package/src/maps/symbols/sdf-ize.sh +93 -0
- package/src/maps/vectorMaps.tsx +20 -44
- package/src/mwater_table_selection/FormsListComponent.tsx +188 -0
- package/src/mwater_table_selection/IndicatorsListComponent.tsx +411 -0
- package/src/mwater_table_selection/IssuesListComponent.tsx +167 -0
- package/src/mwater_table_selection/MWaterAccountingSystemListComponent.tsx +225 -0
- package/src/{MWaterAssetSystemsListComponent.tsx → mwater_table_selection/MWaterAssetSystemsListComponent.tsx} +2 -2
- package/src/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.tsx +111 -0
- package/src/mwater_table_selection/MWaterCompleteTableSelectComponent.tsx +713 -0
- package/src/{MWaterCustomTablesetListComponent.tsx → mwater_table_selection/MWaterCustomTablesetListComponent.tsx} +1 -1
- package/src/{MWaterMetricsTableListComponent.tsx → mwater_table_selection/MWaterMetricsTableListComponent.tsx} +1 -1
- package/src/{MWaterTableSelectComponent.tsx → mwater_table_selection/MWaterTableSelectComponent.tsx} +91 -90
- package/src/mwater_table_selection/MWaterWorkflowsSelectComponent.tsx +159 -0
- package/src/quickfilter/{QuickfiltersComponent.ts → QuickfiltersComponent.tsx} +165 -158
- package/src/quickfilter/TextLiteralComponent.tsx +197 -0
- package/src/widgets/MapWidget.tsx +9 -1
- package/src/widgets/charts/Chart.ts +17 -0
- package/src/widgets/charts/ChartWidgetComponent.tsx +36 -1
- package/src/widgets/charts/layered/LayeredChartDesign.ts +1 -1
- package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +23 -24
- package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +260 -211
- package/src/widgets/charts/layered/LayeredChartUtils.ts +7 -7
- package/src/widgets/charts/pivot/PivotChart.ts +191 -0
- package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +124 -129
- package/src/widgets/charts/pivot/PivotChartLayoutBuilder.ts +4 -2
- package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +120 -149
- package/src/widgets/charts/pivot/SegmentDesignerComponent.tsx +178 -198
- package/src/widgets/charts/table/TableChart.ts +177 -1
- package/src/widgets/charts/table/TableChartDesignerComponent.tsx +422 -0
- package/src/widgets/charts/table/{TableChartViewComponent.ts → TableChartViewComponent.tsx} +65 -60
- package/src/widgets/text/ExprItemEditorComponent.tsx +83 -77
- package/src/widgets/text/ExprUpdateModalComponent.tsx +1 -0
- package/test/UndoStackTests.ts +52 -1
- package/.storybook/config.js +0 -7
- package/.storybook/head.html +0 -4
- package/.storybook/webpack.config.js +0 -15
- package/src/MWaterCompleteTableSelectComponent.tsx +0 -975
- package/src/maps/BingLayer.ts +0 -146
- package/src/maps/MarkersLayerDesignerComponent.ts +0 -374
- package/src/quickfilter/TextLiteralComponent.ts +0 -165
- package/src/widgets/charts/table/TableChartDesignerComponent.ts +0 -441
- package/stories/UpdateableComponent.js +0 -29
- package/stories/consoles.js +0 -202
- package/stories/dashboards.js +0 -217
- package/stories/datagridDesign.js +0 -114
- package/stories/datagrids.js +0 -69
- package/stories/dates.js +0 -80
- package/stories/exprcomponent.js +0 -43
- package/stories/index.js +0 -18
- package/stories/leaflet.js +0 -59
- package/stories/maps.js +0 -24
- package/stories/pivotChart.js +0 -235
|
@@ -39,51 +39,54 @@ export default class ExprCellComponent extends React.Component<ExprCellComponent
|
|
|
39
39
|
return <a href={url} key={id} target="_blank" style={{ paddingLeft: 5, paddingRight: 5 }}>{T`Image`}</a>
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
let node
|
|
44
|
-
const exprUtils = new ExprUtils(this.props.schema)
|
|
42
|
+
renderCellContent() {
|
|
45
43
|
let { value } = this.props
|
|
46
44
|
|
|
45
|
+
const exprUtils = new ExprUtils(this.props.schema)
|
|
46
|
+
|
|
47
47
|
if (value == null || !this.props.expr) {
|
|
48
|
-
|
|
48
|
+
return null
|
|
49
49
|
} else {
|
|
50
50
|
// Parse if should be JSON
|
|
51
51
|
if (["image", "imagelist", "geometry", "text[]"].includes(this.props.exprType) && _.isString(value)) {
|
|
52
|
-
|
|
52
|
+
try {
|
|
53
|
+
value = JSON.parse(value)
|
|
54
|
+
} catch (e) {
|
|
55
|
+
console.error("Error parsing JSON", e)
|
|
56
|
+
return "???"
|
|
57
|
+
}
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
// Format if possible
|
|
56
61
|
if (canFormatType(this.props.exprType)) {
|
|
57
|
-
|
|
62
|
+
return formatValue(this.props.exprType, value, this.props.format)
|
|
58
63
|
} else {
|
|
59
64
|
// Convert to node based on type
|
|
60
65
|
switch (this.props.exprType) {
|
|
61
66
|
case "text":
|
|
62
|
-
|
|
63
|
-
break
|
|
67
|
+
return <Linkify properties={{ target: "_blank" }}>{value}</Linkify>
|
|
64
68
|
case "boolean":
|
|
65
69
|
case "enum":
|
|
66
70
|
case "enumset":
|
|
67
71
|
case "text[]":
|
|
68
|
-
|
|
69
|
-
break
|
|
72
|
+
return exprUtils.stringifyExprLiteral(this.props.expr, value, this.props.locale)
|
|
70
73
|
case "date":
|
|
71
|
-
|
|
72
|
-
break
|
|
74
|
+
return moment(value, "YYYY-MM-DD").format("ll")
|
|
73
75
|
case "datetime":
|
|
74
|
-
|
|
75
|
-
break
|
|
76
|
+
return moment(value, moment.ISO_8601).format("lll")
|
|
76
77
|
case "image":
|
|
77
|
-
|
|
78
|
-
break
|
|
78
|
+
return this.renderImage(value.id)
|
|
79
79
|
case "imagelist":
|
|
80
|
-
|
|
81
|
-
break
|
|
80
|
+
return _.map(value, (v: any) => this.renderImage(v.id))
|
|
82
81
|
default:
|
|
83
|
-
|
|
82
|
+
return "" + value
|
|
84
83
|
}
|
|
85
84
|
}
|
|
86
85
|
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
render() {
|
|
89
|
+
const content = this.renderCellContent()
|
|
87
90
|
|
|
88
91
|
return (
|
|
89
92
|
<div
|
|
@@ -101,7 +104,7 @@ export default class ExprCellComponent extends React.Component<ExprCellComponent
|
|
|
101
104
|
onClick={this.props.onClick}
|
|
102
105
|
onDoubleClick={this.props.onDoubleClick}
|
|
103
106
|
>
|
|
104
|
-
{
|
|
107
|
+
{content}
|
|
105
108
|
</div>
|
|
106
109
|
)
|
|
107
110
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import PropTypes from "prop-types"
|
|
2
1
|
import _ from "lodash"
|
|
3
2
|
import React from "react"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { DataSource, ExprUtils, Schema } from "@mwater/expressions"
|
|
3
|
+
import { DataSource, Schema } from "@mwater/expressions"
|
|
7
4
|
import { ExprComponent } from "@mwater/expressions-ui"
|
|
8
|
-
import {
|
|
5
|
+
import { Toggle } from "@mwater/react-library/lib/bootstrap"
|
|
6
|
+
import { DatagridDesignOrderBy } from "./DatagridDesign"
|
|
9
7
|
|
|
10
8
|
export interface OrderBysDesignerComponentProps {
|
|
11
9
|
/** schema to use */
|
|
@@ -13,10 +11,9 @@ export interface OrderBysDesignerComponentProps {
|
|
|
13
11
|
/** dataSource to use */
|
|
14
12
|
dataSource: DataSource
|
|
15
13
|
table: string
|
|
16
|
-
|
|
17
|
-
orderBys: any
|
|
14
|
+
orderBys: DatagridDesignOrderBy[]
|
|
18
15
|
/** Called when columns changes */
|
|
19
|
-
onChange:
|
|
16
|
+
onChange: (orderBys: DatagridDesignOrderBy[]) => void
|
|
20
17
|
}
|
|
21
18
|
|
|
22
19
|
// Edits an orderBys which is a list of expressions and directions. See README.md
|
|
@@ -42,40 +39,38 @@ export default class OrderBysDesignerComponent extends React.Component<OrderBysD
|
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
render() {
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
})
|
|
58
|
-
}),
|
|
42
|
+
return (
|
|
43
|
+
<div>
|
|
44
|
+
{_.map(this.props.orderBys, (orderBy, index) => {
|
|
45
|
+
return <OrderByDesignerComponent
|
|
46
|
+
key={index}
|
|
47
|
+
schema={this.props.schema}
|
|
48
|
+
table={this.props.table}
|
|
49
|
+
dataSource={this.props.dataSource}
|
|
50
|
+
orderBy={orderBy}
|
|
51
|
+
onChange={this.handleChange.bind(null, index)}
|
|
52
|
+
onRemove={this.handleRemove.bind(null, index)}
|
|
53
|
+
/>
|
|
54
|
+
})}
|
|
59
55
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
)
|
|
56
|
+
<button
|
|
57
|
+
key="add"
|
|
58
|
+
type="button"
|
|
59
|
+
className="btn btn-link"
|
|
60
|
+
onClick={this.handleAdd}
|
|
61
|
+
>
|
|
62
|
+
<span className="fas fa-plus" />
|
|
63
|
+
{" " + T`Add Ordering`}
|
|
64
|
+
</button>
|
|
65
|
+
</div>
|
|
71
66
|
)
|
|
72
67
|
}
|
|
73
68
|
}
|
|
74
69
|
|
|
75
70
|
interface OrderByDesignerComponentProps {
|
|
76
|
-
orderBy:
|
|
77
|
-
onChange:
|
|
78
|
-
onRemove:
|
|
71
|
+
orderBy: DatagridDesignOrderBy
|
|
72
|
+
onChange: (orderBy: DatagridDesignOrderBy) => void
|
|
73
|
+
onRemove: () => void
|
|
79
74
|
schema: Schema
|
|
80
75
|
dataSource: DataSource
|
|
81
76
|
table?: string
|
|
@@ -86,43 +81,39 @@ class OrderByDesignerComponent extends React.Component<OrderByDesignerComponentP
|
|
|
86
81
|
return this.props.onChange(_.extend({}, this.props.orderBy, { expr }))
|
|
87
82
|
}
|
|
88
83
|
|
|
89
|
-
handleDirectionChange = (
|
|
90
|
-
return this.props.onChange(_.extend({}, this.props.orderBy, { direction
|
|
84
|
+
handleDirectionChange = (direction: string) => {
|
|
85
|
+
return this.props.onChange(_.extend({}, this.props.orderBy, { direction }))
|
|
91
86
|
}
|
|
92
87
|
|
|
93
88
|
render() {
|
|
94
|
-
return
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
{ className: "btn btn-sm btn-link", type: "button", onClick: this.props.onRemove },
|
|
123
|
-
R("span", { className: "fas fa-times" })
|
|
124
|
-
)
|
|
125
|
-
)
|
|
89
|
+
return (
|
|
90
|
+
<div style={{ display: "flex", alignItems: "center", gap: "8px", marginBottom: "8px" }}>
|
|
91
|
+
<div style={{ flex: 1 }}>
|
|
92
|
+
<ExprComponent
|
|
93
|
+
schema={this.props.schema}
|
|
94
|
+
dataSource={this.props.dataSource}
|
|
95
|
+
table={this.props.table}
|
|
96
|
+
types={["text", "number", "boolean", "date", "datetime"]}
|
|
97
|
+
aggrStatuses={["individual", "literal", "aggregate"]}
|
|
98
|
+
value={this.props.orderBy.expr}
|
|
99
|
+
onChange={this.handleExprChange}
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
<div style={{ display: "flex", alignItems: "center", gap: "8px" }}>
|
|
103
|
+
<Toggle
|
|
104
|
+
size="xs"
|
|
105
|
+
value={this.props.orderBy.direction}
|
|
106
|
+
onChange={this.handleDirectionChange}
|
|
107
|
+
options={[
|
|
108
|
+
{ value: "asc", label: T`Ascending` },
|
|
109
|
+
{ value: "desc", label: T`Descending` }
|
|
110
|
+
]}
|
|
111
|
+
/>
|
|
112
|
+
<button className="btn btn-sm btn-link" type="button" onClick={this.props.onRemove}>
|
|
113
|
+
<span className="fas fa-times" />
|
|
114
|
+
</button>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
126
117
|
)
|
|
127
118
|
}
|
|
128
119
|
}
|
package/src/index.css
CHANGED
|
@@ -55,6 +55,12 @@ Lato, Lora, Inter, Merriweather, Roboto
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
@media only screen and (max-width: 800px) {
|
|
59
|
+
.hide-800px {
|
|
60
|
+
display: none;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
58
64
|
/* Dashed thresholds */
|
|
59
65
|
.bb-grid line {
|
|
60
66
|
stroke-dasharray: 3;
|
|
@@ -133,6 +139,20 @@ Lato, Lora, Inter, Merriweather, Roboto
|
|
|
133
139
|
visibility: visible;
|
|
134
140
|
}
|
|
135
141
|
|
|
142
|
+
/* Use these to make a grandchild that displays only when parent is hovered */
|
|
143
|
+
.hover-display-parent > * > .hover-display-grandchild {
|
|
144
|
+
visibility: hidden;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.hover-display-parent:hover > * > .hover-display-grandchild {
|
|
148
|
+
visibility: visible;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Use these to set a faint background on hover */
|
|
152
|
+
.hover-grey:hover {
|
|
153
|
+
background-color: #f8f8f8;
|
|
154
|
+
}
|
|
155
|
+
|
|
136
156
|
.bb-title {
|
|
137
157
|
font: 14px sans-serif;
|
|
138
158
|
font-weight: bold;
|
|
@@ -342,6 +362,29 @@ Lato, Lora, Inter, Merriweather, Roboto
|
|
|
342
362
|
background-color: #363b3e;
|
|
343
363
|
padding: 5px;
|
|
344
364
|
padding-top: 6px;
|
|
365
|
+
transform: translateX(-100%);
|
|
366
|
+
animation: slideIn 0.3s ease-in-out;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
@keyframes slideIn {
|
|
370
|
+
from {
|
|
371
|
+
transform: translateX(-100%);
|
|
372
|
+
}
|
|
373
|
+
to {
|
|
374
|
+
transform: translateX(0);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.mwater-visualization-palette-container {
|
|
379
|
+
position: absolute;
|
|
380
|
+
top: 0;
|
|
381
|
+
left: 0;
|
|
382
|
+
height: 100%;
|
|
383
|
+
z-index: 1000;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.mwater-visualization-palette-container:not(.hidden) .mwater-visualization-palette {
|
|
387
|
+
transform: translateX(0);
|
|
345
388
|
}
|
|
346
389
|
|
|
347
390
|
.mwater-visualization-palette-item {
|
|
@@ -543,11 +586,11 @@ Lato, Lora, Inter, Merriweather, Roboto
|
|
|
543
586
|
background-color: rgba(0, 0, 0, 0.075);
|
|
544
587
|
}
|
|
545
588
|
|
|
546
|
-
.
|
|
589
|
+
.mwater-visualization-cursor-hover:hover {
|
|
547
590
|
cursor: move;
|
|
548
591
|
}
|
|
549
592
|
|
|
550
|
-
.
|
|
593
|
+
.mwater-visualization-map-hover-content {
|
|
551
594
|
display: grid;
|
|
552
595
|
grid-template-columns: 1fr 2fr;
|
|
553
596
|
grid-auto-rows: min-content;
|
package/src/index.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
MapBounds,
|
|
4
|
-
TileLayer,
|
|
5
|
-
GeoJsonLayer,
|
|
6
|
-
MapLayer
|
|
7
|
-
} from "./maps/LeafletMapComponent"
|
|
1
|
+
export { default as LeafletMapComponent } from "./maps/LeafletMapComponent"
|
|
2
|
+
export type { MapBounds, TileLayer, GeoJsonLayer, MapLayer } from "./maps/LeafletMapComponent"
|
|
8
3
|
|
|
9
4
|
export { default as DateRangeComponent } from "./DateRangeComponent"
|
|
10
5
|
|
|
@@ -18,7 +13,7 @@ export { default as DashboardComponent } from "./dashboards/DashboardComponent"
|
|
|
18
13
|
export { default as DashboardDataSource } from "./dashboards/DashboardDataSource"
|
|
19
14
|
export { default as DirectDashboardDataSource } from "./dashboards/DirectDashboardDataSource"
|
|
20
15
|
export * from "./dashboards/DashboardDesign"
|
|
21
|
-
export { MapDesign, MapLayerView } from "./maps/MapDesign"
|
|
16
|
+
export type { MapDesign, MapLayerView } from "./maps/MapDesign"
|
|
22
17
|
|
|
23
18
|
export { default as compressJson } from "./compressJson"
|
|
24
19
|
|
|
@@ -32,7 +27,7 @@ export { default as Widget } from "./widgets/Widget"
|
|
|
32
27
|
export { default as DatagridUtils } from "./datagrids/DatagridUtils"
|
|
33
28
|
|
|
34
29
|
export * from "./maps/MapViewComponent"
|
|
35
|
-
export { MapScope } from "./maps/MapUtils"
|
|
30
|
+
export type { MapScope } from "./maps/MapUtils"
|
|
36
31
|
|
|
37
32
|
export { languages } from "./languages"
|
|
38
33
|
|
|
@@ -41,7 +36,7 @@ export { default as MWaterContextComponent } from "./MWaterContextComponent"
|
|
|
41
36
|
|
|
42
37
|
export { default as mWaterLoader } from "./mWaterLoader"
|
|
43
38
|
|
|
44
|
-
export { WidgetDataSource } from "./widgets/WidgetDataSource"
|
|
39
|
+
export type { WidgetDataSource } from "./widgets/WidgetDataSource"
|
|
45
40
|
export { default as DirectWidgetDataSource } from "./widgets/DirectWidgetDataSource"
|
|
46
41
|
|
|
47
42
|
import "leaflet/dist/leaflet.css"
|
|
@@ -55,7 +50,6 @@ export { setMapTilerApiKey } from "./maps/vectorMaps"
|
|
|
55
50
|
|
|
56
51
|
export { default as UndoStack } from "./UndoStack"
|
|
57
52
|
export { default as DashboardViewComponent } from "./dashboards/DashboardViewComponent"
|
|
58
|
-
export let BingLayer = require("./maps/BingLayer")
|
|
59
53
|
export let UtfGridLayer = require("./maps/UtfGridLayer")
|
|
60
54
|
export { default as LayerFactory } from "./maps/LayerFactory"
|
|
61
55
|
export { default as MapDesignerComponent } from "./maps/MapDesignerComponent"
|
|
@@ -38,11 +38,39 @@ export interface BlocksDisplayComponentProps {
|
|
|
38
38
|
cantPasteMessage?: string
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
interface BlocksDisplayComponentState {
|
|
42
|
+
isPaletteVisible: boolean
|
|
43
|
+
isManuallyHidden: boolean
|
|
44
|
+
}
|
|
45
|
+
|
|
41
46
|
/**
|
|
42
47
|
Renders the complete layout of the blocks and also optionally a palette to the left
|
|
43
48
|
that can be used to drag new items into the layout. Palette is only displayed if onItemsChange is not null
|
|
44
49
|
*/
|
|
45
|
-
class BlocksDisplayComponent extends React.Component<BlocksDisplayComponentProps> {
|
|
50
|
+
class BlocksDisplayComponent extends React.Component<BlocksDisplayComponentProps, BlocksDisplayComponentState> {
|
|
51
|
+
state: BlocksDisplayComponentState = {
|
|
52
|
+
isPaletteVisible: false,
|
|
53
|
+
isManuallyHidden: false
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
componentDidUpdate(prevProps: BlocksDisplayComponentProps) {
|
|
57
|
+
// If editing state changes (onItemsChange becomes available/unavailable)
|
|
58
|
+
if (prevProps.onItemsChange !== this.props.onItemsChange) {
|
|
59
|
+
if (this.props.onItemsChange && !this.state.isManuallyHidden) {
|
|
60
|
+
this.setState({ isPaletteVisible: true })
|
|
61
|
+
} else if (!this.props.onItemsChange) {
|
|
62
|
+
this.setState({ isPaletteVisible: false, isManuallyHidden: false })
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
handlePaletteToggle = () => {
|
|
68
|
+
this.setState(prevState => ({
|
|
69
|
+
isPaletteVisible: !prevState.isPaletteVisible,
|
|
70
|
+
isManuallyHidden: !prevState.isManuallyHidden
|
|
71
|
+
}))
|
|
72
|
+
}
|
|
73
|
+
|
|
46
74
|
handleBlockDrop = (sourceBlock: LayoutBlock, targetBlock: LayoutBlock, side: "top" | "left" | "right" | "bottom") => {
|
|
47
75
|
// Remove source from items
|
|
48
76
|
let items = blockUtils.removeBlock(this.props.items, sourceBlock)!
|
|
@@ -219,8 +247,32 @@ class BlocksDisplayComponent extends React.Component<BlocksDisplayComponentProps
|
|
|
219
247
|
|
|
220
248
|
renderPalette() {
|
|
221
249
|
return (
|
|
222
|
-
<div key="palette" style={{
|
|
250
|
+
<div key="palette" style={{
|
|
251
|
+
width: 141,
|
|
252
|
+
height: "100%",
|
|
253
|
+
position: "absolute",
|
|
254
|
+
top: 0,
|
|
255
|
+
left: 0,
|
|
256
|
+
transition: "transform 0.3s ease-in-out",
|
|
257
|
+
transform: this.state.isPaletteVisible ? "translateX(0)" : "translateX(-100%)"
|
|
258
|
+
}}>
|
|
223
259
|
<div className="mwater-visualization-palette" style={{ height: "100%" }}>
|
|
260
|
+
<div
|
|
261
|
+
style={{
|
|
262
|
+
position: "absolute",
|
|
263
|
+
right: -14,
|
|
264
|
+
top: 0,
|
|
265
|
+
background: "#363b3e",
|
|
266
|
+
color: "white",
|
|
267
|
+
padding: "5px 3px 5px 5px",
|
|
268
|
+
cursor: "pointer",
|
|
269
|
+
borderRadius: "0 3px 3px 0",
|
|
270
|
+
zIndex: 1001
|
|
271
|
+
}}
|
|
272
|
+
onClick={this.handlePaletteToggle}
|
|
273
|
+
>
|
|
274
|
+
<i className={`fa fa-chevron-${this.state.isPaletteVisible ? 'left' : 'right'}`} />
|
|
275
|
+
</div>
|
|
224
276
|
<PaletteItemComponent
|
|
225
277
|
createItem={this.createBlockItem({ type: "widget", widgetType: "Text", design: { style: "title" } })}
|
|
226
278
|
title={<i className="fa fa-font" />}
|
|
@@ -345,16 +397,19 @@ class BlocksDisplayComponent extends React.Component<BlocksDisplayComponentProps
|
|
|
345
397
|
style={{ width: "100%", height: "100%", overflow: "hidden", position: "relative" }}
|
|
346
398
|
layoutOptions={layoutOptions}
|
|
347
399
|
>
|
|
348
|
-
|
|
400
|
+
<div className="mwater-visualization-palette-container">
|
|
401
|
+
{this.renderPalette()}
|
|
402
|
+
</div>
|
|
349
403
|
<div
|
|
350
404
|
style={{
|
|
351
405
|
position: "absolute",
|
|
352
|
-
left: 141,
|
|
406
|
+
left: this.state.isPaletteVisible ? 141 : 0,
|
|
353
407
|
top: 0,
|
|
354
408
|
bottom: 0,
|
|
355
409
|
right: 0,
|
|
356
410
|
overflowX: "auto",
|
|
357
|
-
overflowY: "scroll"
|
|
411
|
+
overflowY: "scroll",
|
|
412
|
+
transition: "left 0.3s ease-in-out"
|
|
358
413
|
}}
|
|
359
414
|
className={`mwater-visualization-block-parent-outer mwater-visualization-block-editing`}
|
|
360
415
|
>
|
package/src/maps/BufferLayer.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { getDefaultLayoutOptions } from "../dashboards/layoutOptions"
|
|
|
18
18
|
import Widget from "../widgets/Widget"
|
|
19
19
|
import BlocksLayoutManager from "../layouts/blocks/BlocksLayoutManager"
|
|
20
20
|
import { getTranslatableStringsFromLayoutManager } from "../dashboards/DashboardUtils"
|
|
21
|
+
import { getSimpleHoverOverData } from "./MapUtils"
|
|
21
22
|
|
|
22
23
|
/** Layer which draws a buffer around geometries (i.e. a radius circle around points) */
|
|
23
24
|
export default class BufferLayer extends Layer<BufferLayerDesign> {
|
|
@@ -696,29 +697,16 @@ marker-fill: ` +
|
|
|
696
697
|
ev: { data: any; event: any },
|
|
697
698
|
hoverOptions: OnGridHoverOptions<BufferLayerDesign>
|
|
698
699
|
): OnGridHoverResults {
|
|
699
|
-
if (ev.data && ev.data.id) {
|
|
700
|
-
const
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
// Popup
|
|
704
|
-
if (hoverOptions.design.hoverOver) {
|
|
705
|
-
// Create filter using popupFilterJoins
|
|
706
|
-
const popupFilterJoins =
|
|
707
|
-
hoverOptions.design.popupFilterJoins || PopupFilterJoinsUtils.createDefaultPopupFilterJoins(table)
|
|
708
|
-
const popupFilters = PopupFilterJoinsUtils.createPopupFilters(
|
|
709
|
-
popupFilterJoins,
|
|
710
|
-
hoverOptions.schema,
|
|
711
|
-
table,
|
|
712
|
-
ev.data.id
|
|
713
|
-
)
|
|
714
|
-
|
|
715
|
-
results.hoverOver = React.createElement(HoverContent, {
|
|
700
|
+
if (ev.data && ev.data.id && hoverOptions.design.hoverOver && hoverOptions.design.hoverOver.items.length > 0) {
|
|
701
|
+
const results: OnGridHoverResults = {
|
|
702
|
+
hoverOver: React.createElement(HoverContent, {
|
|
716
703
|
key: ev.data.id,
|
|
717
704
|
schema: hoverOptions.schema,
|
|
718
|
-
|
|
719
|
-
|
|
705
|
+
data: ev.data,
|
|
706
|
+
mapLayerDataSource: hoverOptions.layerDataSource,
|
|
707
|
+
design: hoverOptions.design,
|
|
720
708
|
items: hoverOptions.design.hoverOver.items,
|
|
721
|
-
filters:
|
|
709
|
+
filters: hoverOptions.filters,
|
|
722
710
|
locale: hoverOptions.locale,
|
|
723
711
|
translate: hoverOptions.translate
|
|
724
712
|
})
|
|
@@ -881,6 +869,19 @@ marker-fill: ` +
|
|
|
881
869
|
})
|
|
882
870
|
|
|
883
871
|
draft.filter = exprCleaner.cleanExpr(design.filter || null, { table: design.table })
|
|
872
|
+
|
|
873
|
+
// Clean hover over expressions
|
|
874
|
+
if (design.table && design.hoverOver && design.hoverOver.items) {
|
|
875
|
+
for (let i = 0; i < design.hoverOver.items.length; i++) {
|
|
876
|
+
const item = design.hoverOver.items[i]
|
|
877
|
+
if (item.value) {
|
|
878
|
+
draft.hoverOver!.items[i].value = exprCleaner.cleanExpr(item.value || null, {
|
|
879
|
+
table: design.table,
|
|
880
|
+
aggrStatuses: ["individual", "literal"]
|
|
881
|
+
})
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
}
|
|
884
885
|
})
|
|
885
886
|
|
|
886
887
|
return design
|
|
@@ -950,4 +951,31 @@ marker-fill: ` +
|
|
|
950
951
|
// Remove duplicates
|
|
951
952
|
return _.uniq(strings)
|
|
952
953
|
}
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
/** Gets hover over data for hover over items. This should be implemented by layers that have hover over items.
|
|
957
|
+
* It will be called on the server side if using a server map data source, or on the client side if using a direct
|
|
958
|
+
* map data source.
|
|
959
|
+
*/
|
|
960
|
+
getHoverOverData(options: {
|
|
961
|
+
/** Design of the layer */
|
|
962
|
+
design: BufferLayerDesign,
|
|
963
|
+
/** Data of the current item being hovered over. e.g. { id: 123 } */
|
|
964
|
+
data: any,
|
|
965
|
+
/** Filters to apply to the hover over data, not including filtering down to the current item */
|
|
966
|
+
filters: JsonQLFilter[],
|
|
967
|
+
/** Schema to use */
|
|
968
|
+
schema: Schema,
|
|
969
|
+
/** Data source to use */
|
|
970
|
+
dataSource: DataSource,
|
|
971
|
+
}): Promise<{ [key: string]: any }> {
|
|
972
|
+
return getSimpleHoverOverData({
|
|
973
|
+
id: options.data.id,
|
|
974
|
+
table: options.design.table,
|
|
975
|
+
filters: options.filters,
|
|
976
|
+
schema: options.schema,
|
|
977
|
+
dataSource: options.dataSource,
|
|
978
|
+
hoverOverItems: options.design.hoverOver!.items,
|
|
979
|
+
})
|
|
980
|
+
}
|
|
953
981
|
}
|
|
@@ -47,7 +47,7 @@ export interface BufferLayerDesign {
|
|
|
47
47
|
popup: { items: LayoutBlock }
|
|
48
48
|
|
|
49
49
|
/** Contains items: which is HoverOverItem[] */
|
|
50
|
-
hoverOver
|
|
50
|
+
hoverOver?: { items: HoverOverItem[] }
|
|
51
51
|
|
|
52
52
|
/** Customizable filtering for popup. See PopupFilterJoins.md */
|
|
53
53
|
popupFilterJoins: PopupFilterJoins
|
|
@@ -15,7 +15,7 @@ import { Checkbox } from "@mwater/react-library/lib/bootstrap"
|
|
|
15
15
|
import { BufferLayerDesign } from "./BufferLayerDesign"
|
|
16
16
|
import { JsonQLFilter } from "../JsonQLFilter"
|
|
17
17
|
import { areVectorMapsEnabled } from "./vectorMaps"
|
|
18
|
-
import EditHoverOver from "./EditHoverOver"
|
|
18
|
+
import { EditHoverOver } from "./EditHoverOver"
|
|
19
19
|
|
|
20
20
|
export interface BufferLayerDesignerComponentProps {
|
|
21
21
|
/** Schema to use */
|
|
@@ -281,6 +281,7 @@ export default class BufferLayerDesignerComponent extends React.Component<Buffer
|
|
|
281
281
|
table={this.props.design.table}
|
|
282
282
|
idTable={this.props.design.table}
|
|
283
283
|
defaultPopupFilterJoins={PopupFilterJoinsUtils.createDefaultPopupFilterJoins(this.props.design.table)}
|
|
284
|
+
aggrStatuses={["individual", "literal"]}
|
|
284
285
|
/>
|
|
285
286
|
)
|
|
286
287
|
}
|