@mwater/visualization 5.3.2 → 5.4.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 +1 -1
- package/lib/ColorComponent.js +2 -2
- package/lib/CustomColorsContext.d.ts +0 -1
- package/lib/DateRangeComponent.js +10 -10
- package/lib/LocaleContextInjector.js +2 -2
- package/lib/MWaterAddRelatedFormComponent.js +8 -8
- package/lib/MWaterAddRelatedIndicatorComponent.d.ts +0 -1
- package/lib/MWaterAddRelatedIndicatorComponent.js +6 -6
- package/lib/MWaterAssetSystemsListComponent.d.ts +3 -3
- package/lib/MWaterAssetSystemsListComponent.js +4 -3
- package/lib/MWaterCompleteTableSelectComponent.d.ts +33 -34
- package/lib/MWaterCompleteTableSelectComponent.js +39 -38
- package/lib/MWaterCustomTablesetListComponent.d.ts +3 -3
- package/lib/MWaterCustomTablesetListComponent.js +5 -4
- package/lib/MWaterGlobalFiltersComponent.js +4 -4
- package/lib/MWaterLoaderComponent.d.ts +5 -5
- package/lib/MWaterLoaderComponent.js +1 -1
- package/lib/MWaterMetricsTableListComponent.d.ts +3 -3
- package/lib/MWaterMetricsTableListComponent.js +4 -3
- package/lib/MWaterResponsesFilterComponent.js +4 -4
- package/lib/MWaterTableSelectComponent.d.ts +1 -1
- package/lib/MWaterTableSelectComponent.js +5 -5
- package/lib/PopoverComponent.d.ts +4 -4
- package/lib/UIComponents.d.ts +5 -2
- package/lib/axes/AxisBuilder.js +42 -43
- package/lib/axes/AxisColorEditorComponent.d.ts +4 -4
- package/lib/axes/AxisColorEditorComponent.js +25 -60
- package/lib/axes/AxisComponent.d.ts +2 -3
- package/lib/axes/AxisComponent.js +20 -20
- package/lib/axes/BinsComponent.js +6 -6
- package/lib/axes/CategoryMapComponent.d.ts +2 -1
- package/lib/axes/CategoryMapComponent.js +7 -5
- package/lib/axes/ColorPaletteCollectionComponent.js +3 -3
- package/lib/axes/RangesComponent.js +12 -12
- package/lib/compressJson.js +1 -1
- package/lib/dashboards/DashboardComponent.d.ts +2 -0
- package/lib/dashboards/DashboardComponent.js +15 -8
- package/lib/dashboards/DashboardUtils.js +2 -3
- package/lib/dashboards/DashboardViewComponent.js +4 -4
- package/lib/dashboards/FontStyleEditor.js +8 -8
- package/lib/dashboards/LayoutOptionsComponent.js +101 -74
- package/lib/dashboards/SettingsModalComponent.d.ts +3 -4
- package/lib/dashboards/SettingsModalComponent.js +54 -40
- package/lib/dashboards/WidgetComponent.d.ts +0 -1
- package/lib/dashboards/WidgetComponent.js +1 -2
- package/lib/dashboards/layoutOptions.js +11 -7
- package/lib/datagrids/DatagridComponent.d.ts +1 -8
- package/lib/datagrids/DatagridComponent.js +14 -13
- package/lib/datagrids/DatagridDesignerComponent.js +18 -18
- package/lib/datagrids/DatagridQueryBuilder.d.ts +4 -4
- package/lib/datagrids/DatagridUtils.js +2 -2
- package/lib/datagrids/DatagridViewComponent.js +4 -4
- package/lib/datagrids/ExprCellComponent.js +1 -1
- package/lib/datagrids/FindReplaceModalComponent.js +17 -17
- package/lib/datagrids/OrderBysDesignerComponent.js +2 -2
- package/lib/languages.js +2 -2
- package/lib/layouts/DecoratedBlockComponent.js +2 -2
- package/lib/layouts/blocks/BlocksDisplayComponent.js +13 -13
- package/lib/layouts/blocks/BlocksLayoutManager.d.ts +2 -1
- package/lib/layouts/blocks/ClipboardPaletteItemComponent.js +3 -3
- package/lib/layouts/blocks/HorizontalBlockComponent.js +3 -3
- package/lib/layouts/blocks/blockUtils.js +4 -5
- package/lib/mWaterLoader.js +1 -1
- package/lib/maps/AddLayerComponent.js +13 -13
- package/lib/maps/AdminScopeAndDetailLevelComponent.js +5 -5
- package/lib/maps/BaseLayerDesignerComponent.js +2 -2
- package/lib/maps/BufferLayer.js +7 -7
- package/lib/maps/BufferLayerDesignerComponent.js +8 -8
- package/lib/maps/ChoroplethLayer.js +6 -6
- package/lib/maps/ChoroplethLayerDesigner.js +16 -16
- package/lib/maps/ClusterLayer.js +3 -3
- package/lib/maps/ClusterLayerDesignerComponent.js +5 -5
- package/lib/maps/DetailLevelSelectComponent.d.ts +11 -1
- package/lib/maps/DetailLevelSelectComponent.js +3 -3
- package/lib/maps/DirectMapDataSource.js +1 -2
- package/lib/maps/EditHoverOver.js +7 -5
- package/lib/maps/EditPopupComponent.js +2 -2
- package/lib/maps/GridLayer.js +5 -5
- package/lib/maps/GridLayerDesigner.js +15 -15
- package/lib/maps/LayerSwitcherComponent.js +1 -2
- package/lib/maps/LeafletMapComponent.d.ts +1 -1
- package/lib/maps/LeafletMapComponent.js +1 -1
- package/lib/maps/LegendComponent.js +1 -1
- package/lib/maps/MWaterServerLayer.d.ts +0 -1
- package/lib/maps/MWaterServerLayer.js +1 -1
- package/lib/maps/MapComponent.js +8 -8
- package/lib/maps/MapControlComponent.js +1 -1
- package/lib/maps/MapDesignerComponent.js +16 -16
- package/lib/maps/MapFiltersDesignerComponent.js +2 -2
- package/lib/maps/MapLayerViewDesignerComponent.js +8 -8
- package/lib/maps/MapUtils.js +6 -7
- package/lib/maps/MapViewComponent.js +1 -2
- package/lib/maps/MarkerSymbolSelectComponent.js +3 -3
- package/lib/maps/MarkersLayer.js +6 -7
- package/lib/maps/MarkersLayerDesignerComponent.js +22 -22
- package/lib/maps/PopupFilterJoinsEditComponent.js +4 -4
- package/lib/maps/PopupFilterJoinsUtils.js +2 -3
- package/lib/maps/RasterMapViewComponent.d.ts +3 -3
- package/lib/maps/RasterMapViewComponent.js +4 -4
- package/lib/maps/RegionSelectComponent.d.ts +1 -3
- package/lib/maps/RegionSelectComponent.js +1 -2
- package/lib/maps/ScopeAndDetailLevelComponent.js +3 -3
- package/lib/maps/TileUrlLayer.d.ts +1 -1
- package/lib/maps/TileUrlLayer.js +3 -3
- package/lib/maps/VectorMapViewComponent.js +6 -7
- package/lib/maps/ZoomLevelsComponent.js +5 -5
- package/lib/maps/mapSymbols.d.ts +1 -1
- package/lib/maps/mapSymbols.js +51 -50
- package/lib/maps/mapboxUtils.js +2 -3
- package/lib/maps/maps.d.ts +0 -1
- package/lib/maps/vectorMaps.js +14 -15
- package/lib/memoizedDebounce.js +1 -2
- package/lib/quickfilter/DateExprComponent.d.ts +4 -0
- package/lib/quickfilter/DateExprComponent.js +17 -16
- package/lib/quickfilter/IdArrayQuickfilterComponent.js +1 -1
- package/lib/quickfilter/QuickfilterUtils.js +1 -2
- package/lib/quickfilter/QuickfiltersComponent.d.ts +23 -2
- package/lib/quickfilter/QuickfiltersComponent.js +2 -2
- package/lib/quickfilter/QuickfiltersDesignComponent.js +8 -8
- package/lib/quickfilter/TextLiteralComponent.d.ts +35 -2
- package/lib/quickfilter/TextLiteralComponent.js +6 -6
- package/lib/richtext/DropdownPaletteItem.js +1 -1
- package/lib/richtext/ExprItemsHtmlConverter.js +8 -10
- package/lib/richtext/FontColorPaletteItem.js +7 -7
- package/lib/richtext/ItemsHtmlConverter.js +0 -1
- package/lib/richtext/RichTextComponent.d.ts +1 -0
- package/lib/richtext/RichTextComponent.js +33 -29
- package/lib/valueFormatter.js +18 -19
- package/lib/wellknown.js +2 -3
- package/lib/widgets/IFrameWidgetComponent.d.ts +9 -1
- package/lib/widgets/IFrameWidgetComponent.js +3 -3
- package/lib/widgets/ImageUploaderComponent.js +5 -5
- package/lib/widgets/ImageWidget.js +2 -2
- package/lib/widgets/ImageWidgetComponent.d.ts +9 -1
- package/lib/widgets/ImageWidgetComponent.js +20 -20
- package/lib/widgets/ImagelistCarouselComponent.js +1 -1
- package/lib/widgets/MapWidget.js +2 -2
- package/lib/widgets/MarkdownWidget.d.ts +1 -1
- package/lib/widgets/MarkdownWidget.js +1 -1
- package/lib/widgets/TOCWidget.js +11 -12
- package/lib/widgets/WidgetScopesViewComponent.js +1 -1
- package/lib/widgets/charts/Chart.js +1 -1
- package/lib/widgets/charts/ChartViewComponent.js +9 -9
- package/lib/widgets/charts/ChartWidgetComponent.js +4 -4
- package/lib/widgets/charts/calendar/CalendarChart.js +4 -4
- package/lib/widgets/charts/calendar/CalendarChartDesignerComponent.js +7 -7
- package/lib/widgets/charts/calendar/CalendarChartViewComponent.js +3 -3
- package/lib/widgets/charts/imagemosaic/ImageMosaicChart.d.ts +18 -5
- package/lib/widgets/charts/imagemosaic/ImageMosaicChart.js +3 -4
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.js +5 -5
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.d.ts +5 -19
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.js +66 -70
- package/lib/widgets/charts/imagemosaic/ImagePopupComponent.js +1 -1
- package/lib/widgets/charts/layered/LayeredChart.d.ts +1 -1
- package/lib/widgets/charts/layered/LayeredChart.js +9 -9
- package/lib/widgets/charts/layered/LayeredChartCompiler.d.ts +8 -8
- package/lib/widgets/charts/layered/LayeredChartCompiler.js +15 -15
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +33 -33
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +16 -16
- package/lib/widgets/charts/layered/LayeredChartUtils.js +1 -2
- package/lib/widgets/charts/layered/LayeredChartViewComponent.js +4 -4
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.js +18 -17
- package/lib/widgets/charts/pivot/PivotChart.d.ts +1 -1
- package/lib/widgets/charts/pivot/PivotChart.js +12 -4
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +5 -5
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +10 -10
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +5 -5
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.d.ts +1 -1
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.js +5 -6
- package/lib/widgets/charts/pivot/PivotChartUtils.js +11 -12
- package/lib/widgets/charts/pivot/PivotChartViewComponent.js +9 -9
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +30 -30
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.js +28 -26
- package/lib/widgets/charts/table/OrderingsComponent.js +2 -2
- package/lib/widgets/charts/table/TableChart.js +3 -3
- package/lib/widgets/charts/table/TableChartDesignerComponent.js +17 -17
- package/lib/widgets/charts/table/TableChartViewComponent.js +3 -3
- package/lib/widgets/text/ExprInsertModalComponent.d.ts +2 -3
- package/lib/widgets/text/ExprInsertModalComponent.js +2 -14
- package/lib/widgets/text/ExprItemEditorComponent.js +4 -4
- package/lib/widgets/text/ExprUpdateModalComponent.d.ts +2 -3
- package/lib/widgets/text/ExprUpdateModalComponent.js +3 -15
- package/lib/widgets/text/TextComponent.js +3 -3
- package/lib/widgets/text/TextWidget.d.ts +1 -1
- package/lib/widgets/text/TextWidgetComponent.js +11 -11
- package/lib/widgets/text/TextWidgetDesign.d.ts +2 -1
- package/lib/widgets/text/TextWidgetDesign.js +1 -2
- package/package.json +3 -3
- package/src/ColorComponent.tsx +2 -2
- package/src/DateRangeComponent.ts +10 -10
- package/src/LocaleContextInjector.tsx +1 -1
- package/src/MWaterAddRelatedFormComponent.ts +7 -7
- package/src/MWaterAddRelatedIndicatorComponent.ts +5 -5
- package/src/MWaterAssetSystemsListComponent.tsx +3 -3
- package/src/MWaterCompleteTableSelectComponent.tsx +36 -35
- package/src/MWaterCustomTablesetListComponent.tsx +4 -4
- package/src/MWaterGlobalFiltersComponent.ts +4 -4
- package/src/MWaterLoaderComponent.ts +1 -1
- package/src/MWaterMetricsTableListComponent.tsx +3 -3
- package/src/MWaterResponsesFilterComponent.ts +6 -6
- package/src/MWaterTableSelectComponent.tsx +6 -7
- package/src/axes/AxisBuilder.ts +42 -44
- package/src/axes/AxisColorEditorComponent.tsx +178 -0
- package/src/axes/AxisComponent.ts +20 -20
- package/src/axes/BinsComponent.tsx +6 -6
- package/src/axes/CategoryMapComponent.ts +10 -10
- package/src/axes/ColorPaletteCollectionComponent.tsx +3 -3
- package/src/axes/RangesComponent.ts +14 -14
- package/src/dashboards/DashboardComponent.tsx +21 -9
- package/src/dashboards/DashboardViewComponent.tsx +3 -3
- package/src/dashboards/FontStyleEditor.tsx +8 -8
- package/src/dashboards/LayoutOptionsComponent.tsx +74 -74
- package/src/dashboards/SettingsModalComponent.tsx +134 -107
- package/src/dashboards/layoutOptions.tsx +5 -1
- package/src/datagrids/DatagridComponent.ts +65 -62
- package/src/datagrids/DatagridDesignerComponent.tsx +17 -17
- package/src/datagrids/DatagridUtils.ts +2 -2
- package/src/datagrids/DatagridViewComponent.ts +3 -3
- package/src/datagrids/ExprCellComponent.ts +1 -1
- package/src/datagrids/FindReplaceModalComponent.ts +13 -13
- package/src/datagrids/OrderBysDesignerComponent.tsx +2 -2
- package/src/globals.d.ts +7 -1
- package/src/languages.ts +2 -2
- package/src/layouts/blocks/BlocksDisplayComponent.tsx +13 -13
- package/src/layouts/blocks/BlocksLayoutManager.ts +3 -2
- package/src/layouts/blocks/ClipboardPaletteItemComponent.ts +3 -3
- package/src/maps/AddLayerComponent.ts +13 -13
- package/src/maps/AdminScopeAndDetailLevelComponent.ts +5 -5
- package/src/maps/BaseLayerDesignerComponent.ts +8 -8
- package/src/maps/BufferLayer.ts +5 -5
- package/src/maps/BufferLayerDesignerComponent.ts +8 -8
- package/src/maps/ChoroplethLayer.ts +3 -3
- package/src/maps/ChoroplethLayerDesigner.tsx +16 -16
- package/src/maps/ClusterLayer.ts +3 -3
- package/src/maps/ClusterLayerDesignerComponent.ts +5 -5
- package/src/maps/DetailLevelSelectComponent.ts +3 -3
- package/src/maps/EditHoverOver.tsx +5 -5
- package/src/maps/EditPopupComponent.ts +2 -2
- package/src/maps/GridLayer.ts +5 -5
- package/src/maps/GridLayerDesigner.tsx +15 -16
- package/src/maps/MWaterServerLayer.ts +1 -1
- package/src/maps/MapComponent.ts +6 -6
- package/src/maps/MapControlComponent.ts +1 -1
- package/src/maps/MapDesignerComponent.tsx +20 -20
- package/src/maps/MapFiltersDesignerComponent.tsx +3 -3
- package/src/maps/MapLayerViewDesignerComponent.ts +9 -9
- package/src/maps/MarkerSymbolSelectComponent.ts +4 -5
- package/src/maps/MarkersLayerDesignerComponent.ts +22 -22
- package/src/maps/PopupFilterJoinsEditComponent.ts +4 -4
- package/src/maps/RasterMapViewComponent.ts +2 -2
- package/src/maps/RegionSelectComponent.ts +1 -2
- package/src/maps/ScopeAndDetailLevelComponent.ts +3 -3
- package/src/maps/TileUrlLayer.tsx +3 -3
- package/src/maps/VectorMapViewComponent.tsx +5 -5
- package/src/maps/ZoomLevelsComponent.ts +6 -6
- package/src/maps/mapSymbols.ts +49 -49
- package/src/maps/vectorMaps.tsx +2 -2
- package/src/quickfilter/DateExprComponent.ts +19 -18
- package/src/quickfilter/IdArrayQuickfilterComponent.ts +1 -1
- package/src/quickfilter/QuickfiltersComponent.ts +1 -1
- package/src/quickfilter/QuickfiltersDesignComponent.tsx +9 -9
- package/src/quickfilter/TextLiteralComponent.ts +4 -4
- package/src/richtext/DropdownPaletteItem.tsx +1 -1
- package/src/richtext/ExprItemsHtmlConverter.ts +8 -10
- package/src/richtext/ItemsHtmlConverter.ts +0 -1
- package/src/richtext/RichTextComponent.tsx +31 -31
- package/src/valueFormatter.ts +14 -14
- package/src/widgets/IFrameWidgetComponent.ts +3 -3
- package/src/widgets/ImageUploaderComponent.tsx +5 -5
- package/src/widgets/ImageWidget.ts +2 -2
- package/src/widgets/ImageWidgetComponent.ts +26 -26
- package/src/widgets/ImagelistCarouselComponent.ts +2 -2
- package/src/widgets/MapWidget.ts +1 -1
- package/src/widgets/MarkdownWidget.ts +1 -1
- package/src/widgets/TOCWidget.ts +13 -14
- package/src/widgets/WidgetScopesViewComponent.ts +1 -1
- package/src/widgets/charts/Chart.ts +1 -1
- package/src/widgets/charts/ChartViewComponent.ts +4 -4
- package/src/widgets/charts/ChartWidgetComponent.tsx +3 -3
- package/src/widgets/charts/calendar/CalendarChart.ts +4 -4
- package/src/widgets/charts/calendar/CalendarChartDesignerComponent.ts +7 -7
- package/src/widgets/charts/calendar/CalendarChartViewComponent.tsx +2 -2
- package/src/widgets/charts/imagemosaic/ImageMosaicChart.ts +25 -8
- package/src/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.ts +5 -5
- package/src/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.tsx +128 -0
- package/src/widgets/charts/layered/LayeredChart.ts +9 -9
- package/src/widgets/charts/layered/LayeredChartCompiler.ts +45 -45
- package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +39 -39
- package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +18 -19
- package/src/widgets/charts/layered/LayeredChartViewComponent.ts +1 -1
- package/src/widgets/charts/pivot/IntersectionDesignerComponent.tsx +22 -23
- package/src/widgets/charts/pivot/PivotChart.ts +15 -5
- package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +12 -12
- package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +5 -5
- package/src/widgets/charts/pivot/PivotChartQueryBuilder.ts +7 -8
- package/src/widgets/charts/pivot/PivotChartViewComponent.tsx +6 -6
- package/src/widgets/charts/pivot/SegmentDesignerComponent.tsx +30 -30
- package/src/widgets/charts/table/OrderingsComponent.tsx +2 -2
- package/src/widgets/charts/table/TableChart.ts +3 -3
- package/src/widgets/charts/table/TableChartDesignerComponent.ts +16 -16
- package/src/widgets/charts/table/TableChartViewComponent.ts +2 -2
- package/src/widgets/text/{ExprInsertModalComponent.ts → ExprInsertModalComponent.tsx} +18 -20
- package/src/widgets/text/ExprItemEditorComponent.tsx +4 -4
- package/src/widgets/text/{ExprUpdateModalComponent.ts → ExprUpdateModalComponent.tsx} +18 -20
- package/src/widgets/text/TextComponent.tsx +2 -2
- package/src/widgets/text/TextWidgetComponent.tsx +10 -10
- package/src/widgets/text/TextWidgetDesign.ts +3 -1
- package/src/axes/AxisColorEditorComponent.ts +0 -210
- package/src/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.ts +0 -117
|
@@ -83,7 +83,7 @@ export default class ExprItemEditorComponent extends React.Component<
|
|
|
83
83
|
return R(
|
|
84
84
|
"div",
|
|
85
85
|
{ className: "mb-3" },
|
|
86
|
-
R("label", { className: "text-muted" },
|
|
86
|
+
R("label", { className: "text-muted" }, T`Format`),
|
|
87
87
|
": ",
|
|
88
88
|
R(
|
|
89
89
|
"select",
|
|
@@ -105,7 +105,7 @@ export default class ExprItemEditorComponent extends React.Component<
|
|
|
105
105
|
R(
|
|
106
106
|
"div",
|
|
107
107
|
{ className: "mb-3" },
|
|
108
|
-
R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ",
|
|
108
|
+
R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", T`Data Source`),
|
|
109
109
|
": ",
|
|
110
110
|
R(TableSelectComponent, {
|
|
111
111
|
schema: this.props.schema,
|
|
@@ -119,7 +119,7 @@ export default class ExprItemEditorComponent extends React.Component<
|
|
|
119
119
|
? R(
|
|
120
120
|
"div",
|
|
121
121
|
{ className: "mb-3" },
|
|
122
|
-
R("label", { className: "text-muted" },
|
|
122
|
+
R("label", { className: "text-muted" }, T`Field`),
|
|
123
123
|
": ",
|
|
124
124
|
R(ExprComponent, {
|
|
125
125
|
schema: this.props.schema,
|
|
@@ -142,7 +142,7 @@ export default class ExprItemEditorComponent extends React.Component<
|
|
|
142
142
|
value={this.props.exprItem.includeLabel}
|
|
143
143
|
onChange={this.handleIncludeLabelChange}
|
|
144
144
|
>
|
|
145
|
-
Include Label
|
|
145
|
+
{T`Include Label`}
|
|
146
146
|
</Checkbox>,
|
|
147
147
|
|
|
148
148
|
this.props.exprItem.includeLabel
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import React from "react"
|
|
2
|
-
const R = React.createElement
|
|
3
|
-
|
|
4
2
|
import { DataSource, Schema } from "@mwater/expressions"
|
|
5
3
|
import ActionCancelModalComponent from "@mwater/react-library/lib/ActionCancelModalComponent"
|
|
6
4
|
import ExprItemEditorComponent from "./ExprItemEditorComponent"
|
|
@@ -35,7 +33,7 @@ export default class ExprUpdateModalComponent extends React.Component<
|
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
35
|
|
|
38
|
-
open(item:
|
|
36
|
+
open(item: HtmlItemExpr, onUpdate: (item: HtmlItemExpr) => void) {
|
|
39
37
|
return this.setState({ open: true, exprItem: item, onUpdate })
|
|
40
38
|
}
|
|
41
39
|
|
|
@@ -44,27 +42,27 @@ export default class ExprUpdateModalComponent extends React.Component<
|
|
|
44
42
|
return null
|
|
45
43
|
}
|
|
46
44
|
|
|
47
|
-
return
|
|
48
|
-
ActionCancelModalComponent
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
onAction: () => {
|
|
45
|
+
return (
|
|
46
|
+
<ActionCancelModalComponent
|
|
47
|
+
actionLabel={T`Update`}
|
|
48
|
+
onAction={() => {
|
|
52
49
|
// Close first to avoid strange effects when mixed with pojoviews
|
|
53
50
|
this.setState({ open: false }, () => {
|
|
54
51
|
return this.state.onUpdate!(this.state.exprItem!)
|
|
55
52
|
})
|
|
56
|
-
}
|
|
57
|
-
onCancel
|
|
58
|
-
title
|
|
59
|
-
size
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
}}
|
|
54
|
+
onCancel={() => this.setState({ open: false })}
|
|
55
|
+
title={T`Update Field`}
|
|
56
|
+
size="x-large"
|
|
57
|
+
>
|
|
58
|
+
<ExprItemEditorComponent
|
|
59
|
+
schema={this.props.schema}
|
|
60
|
+
dataSource={this.props.dataSource}
|
|
61
|
+
exprItem={this.state.exprItem!}
|
|
62
|
+
onChange={(exprItem: HtmlItemExpr) => this.setState({ exprItem })}
|
|
63
|
+
singleRowTable={this.props.singleRowTable}
|
|
64
|
+
/>
|
|
65
|
+
</ActionCancelModalComponent>
|
|
68
66
|
)
|
|
69
67
|
}
|
|
70
68
|
}
|
|
@@ -6,7 +6,7 @@ import ExprUpdateModalComponent from "./ExprUpdateModalComponent"
|
|
|
6
6
|
import ExprItemsHtmlConverter from "../../richtext/ExprItemsHtmlConverter"
|
|
7
7
|
import { TextWidgetDesign } from "./TextWidgetDesign"
|
|
8
8
|
import { DataSource, Schema } from "@mwater/expressions"
|
|
9
|
-
import { LocaleContext } from "@mwater/expressions-ui
|
|
9
|
+
import { LocaleContext } from "@mwater/expressions-ui"
|
|
10
10
|
|
|
11
11
|
export interface TextComponentProps {
|
|
12
12
|
design: TextWidgetDesign
|
|
@@ -89,7 +89,7 @@ export default class TextComponent extends React.Component<TextComponentProps> {
|
|
|
89
89
|
return (
|
|
90
90
|
<div key="expr" className="mwater-visualization-text-palette-item" onMouseDown={this.handleAddExpr}>
|
|
91
91
|
<i className="fa fa-plus" />
|
|
92
|
-
{
|
|
92
|
+
{T` Expression`}
|
|
93
93
|
</div>
|
|
94
94
|
)
|
|
95
95
|
}
|
|
@@ -139,34 +139,34 @@ export default class TextWidgetComponent extends AsyncLoadComponent<TextWidgetCo
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
const spacingOptions = [0, 5, 10, 15, 20, 25, 30, 35, 40].map(value => ({ value, label: `${value}px` }))
|
|
142
|
-
const borderThicknessOptions = [0, 1, 2, 3, 4, 5].map(value => ({ value, label: value === 0 ?
|
|
142
|
+
const borderThicknessOptions = [0, 1, 2, 3, 4, 5].map(value => ({ value, label: value === 0 ? T`None` : `${value}px` }))
|
|
143
143
|
|
|
144
144
|
return (
|
|
145
145
|
<ActionCancelModalComponent
|
|
146
|
-
title=
|
|
146
|
+
title={T`Edit Text Widget`}
|
|
147
147
|
onCancel={this.handleEditModalClose}
|
|
148
148
|
onAction={this.handleEditModalClose}
|
|
149
149
|
>
|
|
150
|
-
<FormGroup label=
|
|
150
|
+
<FormGroup label={T`Background Color`}>
|
|
151
151
|
<ColorComponent
|
|
152
152
|
color={this.props.design.backgroundColor || null}
|
|
153
153
|
onChange={this.handleBackgroundColorChange}
|
|
154
154
|
/>
|
|
155
155
|
<div className="text-muted">
|
|
156
|
-
Choose a background color for the text widget
|
|
156
|
+
{T`Choose a background color for the text widget`}
|
|
157
157
|
</div>
|
|
158
158
|
</FormGroup>
|
|
159
|
-
<FormGroup label=
|
|
159
|
+
<FormGroup label={T`Padding`}>
|
|
160
160
|
<Select
|
|
161
161
|
value={this.props.design.padding ?? 0}
|
|
162
162
|
onChange={this.handleSpacingChange}
|
|
163
163
|
options={spacingOptions}
|
|
164
164
|
/>
|
|
165
165
|
<div className="text-muted">
|
|
166
|
-
Choose extra padding for the text widget
|
|
166
|
+
{T`Choose extra padding for the text widget`}
|
|
167
167
|
</div>
|
|
168
168
|
</FormGroup>
|
|
169
|
-
<FormGroup label=
|
|
169
|
+
<FormGroup label={T`Border Thickness`} help={T`Choose the border thickness for the text widget`}>
|
|
170
170
|
<Select
|
|
171
171
|
value={this.props.design.borderThickness ?? 0}
|
|
172
172
|
onChange={this.handleBorderThicknessChange}
|
|
@@ -174,7 +174,7 @@ export default class TextWidgetComponent extends AsyncLoadComponent<TextWidgetCo
|
|
|
174
174
|
/>
|
|
175
175
|
</FormGroup>
|
|
176
176
|
{this.props.design.borderThickness &&
|
|
177
|
-
<FormGroup label=
|
|
177
|
+
<FormGroup label={T`Border Color`} help={T`Choose the border color for the text widget`}>
|
|
178
178
|
<ColorComponent
|
|
179
179
|
color={this.props.design.borderColor || null}
|
|
180
180
|
onChange={this.handleBorderColorChange}
|
|
@@ -182,7 +182,7 @@ export default class TextWidgetComponent extends AsyncLoadComponent<TextWidgetCo
|
|
|
182
182
|
</FormGroup>
|
|
183
183
|
}
|
|
184
184
|
{this.props.design.borderThickness &&
|
|
185
|
-
<FormGroup label=
|
|
185
|
+
<FormGroup label={T`Border Radius`} help={T`Choose the border radius for the text widget`}>
|
|
186
186
|
<Select
|
|
187
187
|
value={this.props.design.borderRadius ?? 0}
|
|
188
188
|
onChange={this.handleBorderRadiusChange}
|
|
@@ -233,7 +233,7 @@ export default class TextWidgetComponent extends AsyncLoadComponent<TextWidgetCo
|
|
|
233
233
|
{this.props.onDesignChange ? (
|
|
234
234
|
<DropdownWidgetComponent
|
|
235
235
|
dropdownItems={[{
|
|
236
|
-
label:
|
|
236
|
+
label: T`Edit`,
|
|
237
237
|
onClick: this.handleEditClick
|
|
238
238
|
}]}
|
|
239
239
|
>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { HtmlItemExpr } from "../../richtext/ExprItemsHtmlConverter"
|
|
2
2
|
import { HtmlItem } from "../../richtext/ItemsHtmlConverter"
|
|
3
3
|
|
|
4
|
+
export type TextWidgetItem = HtmlItem | HtmlItemExpr
|
|
5
|
+
|
|
4
6
|
export interface TextWidgetDesign {
|
|
5
7
|
/** Text widget stores its content as array of items. See ItemsHtmlConverter TODO */
|
|
6
|
-
items:
|
|
8
|
+
items: TextWidgetItem[]
|
|
7
9
|
|
|
8
10
|
/** "title" for title block. default is "default" */
|
|
9
11
|
style?: "title" | "default" | "header" | "footer"
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import _ from "lodash"
|
|
2
|
-
import React from "react"
|
|
3
|
-
const R = React.createElement
|
|
4
|
-
import CategoryMapComponent from "./CategoryMapComponent"
|
|
5
|
-
import ColorSchemeFactory from "../ColorSchemeFactory"
|
|
6
|
-
import ColorPaletteCollectionComponent from "./ColorPaletteCollectionComponent"
|
|
7
|
-
import AxisBuilder from "./AxisBuilder"
|
|
8
|
-
import produce from "immer"
|
|
9
|
-
import { Axis, AxisCategory, ColorMap } from "./Axis"
|
|
10
|
-
import { Schema } from "@mwater/expressions"
|
|
11
|
-
|
|
12
|
-
export interface AxisColorEditorComponentProps {
|
|
13
|
-
schema: Schema
|
|
14
|
-
axis: Axis
|
|
15
|
-
/** Called with new axis */
|
|
16
|
-
onChange: (axis: Axis) => void
|
|
17
|
-
|
|
18
|
-
/** Categories of the axis */
|
|
19
|
-
categories?: AxisCategory[]
|
|
20
|
-
|
|
21
|
-
/** is the color map reorderable */
|
|
22
|
-
reorderable?: boolean
|
|
23
|
-
|
|
24
|
-
defaultColor?: string
|
|
25
|
-
/** True to allow excluding of values via checkboxes */
|
|
26
|
-
allowExcludedValues?: boolean
|
|
27
|
-
/** True to start values expanded */
|
|
28
|
-
initiallyExpanded?: boolean
|
|
29
|
-
/** True to automatically set the colors if blank */
|
|
30
|
-
autosetColors?: boolean
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface AxisColorEditorComponentState {
|
|
34
|
-
mode: any
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Color editor for axis. Allows switching between editing individial colors (using CategoryMapComponent)
|
|
38
|
-
// and setting the colors from a palette (using ColorPaletteCollectionComponent)
|
|
39
|
-
export default class AxisColorEditorComponent extends React.Component<
|
|
40
|
-
AxisColorEditorComponentProps,
|
|
41
|
-
AxisColorEditorComponentState
|
|
42
|
-
> {
|
|
43
|
-
static defaultProps = {
|
|
44
|
-
reorderable: false,
|
|
45
|
-
autosetColors: true
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
constructor(props: any) {
|
|
49
|
-
super(props)
|
|
50
|
-
|
|
51
|
-
this.state = {
|
|
52
|
-
mode: "normal"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
componentWillMount() {
|
|
57
|
-
return this.updateColorMap()
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
componentDidUpdate() {
|
|
61
|
-
return this.updateColorMap()
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Update color map if categories no longer match
|
|
65
|
-
updateColorMap() {
|
|
66
|
-
const axisBuilder = new AxisBuilder({ schema: this.props.schema })
|
|
67
|
-
|
|
68
|
-
// If no categories, can't do anything
|
|
69
|
-
if (!this.props.categories) {
|
|
70
|
-
return
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// If no color map or color map values have changed
|
|
74
|
-
if (
|
|
75
|
-
!this.props.axis.colorMap ||
|
|
76
|
-
!_.isEqual(_.pluck(this.props.axis.colorMap, "value").sort(), _.pluck(this.props.categories, "value").sort())
|
|
77
|
-
) {
|
|
78
|
-
let colorMap
|
|
79
|
-
if (this.props.autosetColors) {
|
|
80
|
-
colorMap = ColorSchemeFactory.createColorMapForCategories(
|
|
81
|
-
this.props.categories,
|
|
82
|
-
axisBuilder.isCategorical(this.props.axis)
|
|
83
|
-
)
|
|
84
|
-
} else {
|
|
85
|
-
// Keep existing
|
|
86
|
-
const existing = _.indexBy(this.props.axis.colorMap || [], "value")
|
|
87
|
-
colorMap = _.map(this.props.categories, (category, i) => ({
|
|
88
|
-
value: category.value,
|
|
89
|
-
color: existing[category.value] ? existing[category.value].color : null
|
|
90
|
-
}))
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
this.handlePaletteChange(colorMap)
|
|
94
|
-
return this.setState({ mode: "normal" })
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
handleSelectPalette = () => {
|
|
99
|
-
return this.setState({ mode: "palette" })
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
handleResetPalette = () => {
|
|
103
|
-
// Completely reset
|
|
104
|
-
const colorMap = _.map(this.props.categories || [], (category, i) => ({
|
|
105
|
-
value: category.value,
|
|
106
|
-
color: null
|
|
107
|
-
}))
|
|
108
|
-
|
|
109
|
-
this.handlePaletteChange(colorMap)
|
|
110
|
-
return this.setState({ mode: "normal" })
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
handlePaletteChange = (palette: ColorMap) => {
|
|
114
|
-
this.props.onChange(
|
|
115
|
-
produce(this.props.axis, (draft) => {
|
|
116
|
-
draft.colorMap = palette
|
|
117
|
-
draft.drawOrder = _.pluck(palette, "value")
|
|
118
|
-
})
|
|
119
|
-
)
|
|
120
|
-
this.setState({ mode: "normal" })
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
handleCancelCustomize = () => {
|
|
124
|
-
return this.setState({ mode: "normal" })
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// renderPreview() {
|
|
128
|
-
// return R(
|
|
129
|
-
// "div",
|
|
130
|
-
// { className: "axis-palette" },
|
|
131
|
-
// _.map(this.props.categories.slice(0, 6), (category, i) => {
|
|
132
|
-
// const color = _.find(this.props.axis.colorMap, { value: category.value })
|
|
133
|
-
// const cellStyle = {
|
|
134
|
-
// display: "inline-block",
|
|
135
|
-
// height: 20,
|
|
136
|
-
// width: 20,
|
|
137
|
-
// backgroundColor: color ? color.color : this.props.defaultColor
|
|
138
|
-
// }
|
|
139
|
-
// return R("div", { style: cellStyle, key: i }, " ")
|
|
140
|
-
// })
|
|
141
|
-
// )
|
|
142
|
-
// }
|
|
143
|
-
|
|
144
|
-
render() {
|
|
145
|
-
return R(
|
|
146
|
-
"div",
|
|
147
|
-
null,
|
|
148
|
-
(() => {
|
|
149
|
-
if (this.state.mode === "palette") {
|
|
150
|
-
if (this.props.categories) {
|
|
151
|
-
return R(ColorPaletteCollectionComponent, {
|
|
152
|
-
onPaletteSelected: this.handlePaletteChange,
|
|
153
|
-
axis: this.props.axis,
|
|
154
|
-
categories: this.props.categories,
|
|
155
|
-
onCancel: this.handleCancelCustomize
|
|
156
|
-
})
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return null
|
|
160
|
-
})(),
|
|
161
|
-
this.state.mode === "normal"
|
|
162
|
-
? R(
|
|
163
|
-
"div",
|
|
164
|
-
null,
|
|
165
|
-
R(
|
|
166
|
-
"p",
|
|
167
|
-
null,
|
|
168
|
-
R(
|
|
169
|
-
"a",
|
|
170
|
-
{ className: "link-plain", onClick: this.handleSelectPalette, key: "select-palette" },
|
|
171
|
-
"Change color scheme"
|
|
172
|
-
),
|
|
173
|
-
!this.props.autosetColors
|
|
174
|
-
? R(
|
|
175
|
-
"a",
|
|
176
|
-
{
|
|
177
|
-
className: "btn btn-sm btn-link",
|
|
178
|
-
onClick: this.handleResetPalette,
|
|
179
|
-
key: "reset-palette"
|
|
180
|
-
},
|
|
181
|
-
"Reset colors"
|
|
182
|
-
)
|
|
183
|
-
: undefined
|
|
184
|
-
),
|
|
185
|
-
this.props.axis.colorMap
|
|
186
|
-
? R(
|
|
187
|
-
"div",
|
|
188
|
-
{ key: "selected-palette" },
|
|
189
|
-
R(
|
|
190
|
-
"div",
|
|
191
|
-
null,
|
|
192
|
-
R(CategoryMapComponent, {
|
|
193
|
-
schema: this.props.schema,
|
|
194
|
-
axis: this.props.axis,
|
|
195
|
-
onChange: this.props.onChange,
|
|
196
|
-
categories: this.props.categories,
|
|
197
|
-
key: "colorMap",
|
|
198
|
-
reorderable: this.props.reorderable,
|
|
199
|
-
allowExcludedValues: this.props.allowExcludedValues,
|
|
200
|
-
showColorMap: true,
|
|
201
|
-
initiallyExpanded: this.props.initiallyExpanded
|
|
202
|
-
})
|
|
203
|
-
)
|
|
204
|
-
)
|
|
205
|
-
: undefined
|
|
206
|
-
)
|
|
207
|
-
: undefined
|
|
208
|
-
)
|
|
209
|
-
}
|
|
210
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import _ from "lodash"
|
|
2
|
-
import React from "react"
|
|
3
|
-
const R = React.createElement
|
|
4
|
-
|
|
5
|
-
import { LazyLoadComponent as LazyLoad } from "react-lazy-load-image-component"
|
|
6
|
-
import RotationAwareImageComponent from "@mwater/forms/lib/RotationAwareImageComponent"
|
|
7
|
-
import ImagePopupComponent from "./ImagePopupComponent"
|
|
8
|
-
import { DataSource } from "@mwater/expressions"
|
|
9
|
-
|
|
10
|
-
export interface ImageMosaicChartViewComponentProps {
|
|
11
|
-
/** Design of chart */
|
|
12
|
-
design: any
|
|
13
|
-
/** Data that the chart has requested. In format [image: {image data or imagelist data}] */
|
|
14
|
-
data: any
|
|
15
|
-
/** Data source to use */
|
|
16
|
-
dataSource: DataSource
|
|
17
|
-
width?: number
|
|
18
|
-
height?: number
|
|
19
|
-
onRowClick?: any
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** creates a d3 calendar visualization */
|
|
23
|
-
export default class ImageMosaicChartViewComponent extends React.Component<ImageMosaicChartViewComponentProps> {
|
|
24
|
-
imagePopup: ImagePopupComponent | null
|
|
25
|
-
shouldComponentUpdate(prevProps: any) {
|
|
26
|
-
return !_.isEqual(prevProps, this.props)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
handleClick = (primaryKey: any, image: any) => {
|
|
30
|
-
if (this.props.onRowClick) {
|
|
31
|
-
return this.props.onRowClick(this.props.design.table, primaryKey)
|
|
32
|
-
} else {
|
|
33
|
-
return this.imagePopup?.show(image)
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Render a single image
|
|
38
|
-
renderImage = (primaryKey: any, image: any, imageManager: any) => {
|
|
39
|
-
return R(
|
|
40
|
-
LazyLoad,
|
|
41
|
-
{ key: image.id },
|
|
42
|
-
R(RotationAwareImageComponent, {
|
|
43
|
-
imageManager,
|
|
44
|
-
image,
|
|
45
|
-
thumbnail: true,
|
|
46
|
-
height: 120,
|
|
47
|
-
width: 80,
|
|
48
|
-
onClick: () => this.handleClick(primaryKey, image)
|
|
49
|
-
})
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Render images
|
|
54
|
-
renderImages(imageManager: any) {
|
|
55
|
-
const imageElems = []
|
|
56
|
-
|
|
57
|
-
// For each image
|
|
58
|
-
return (() => {
|
|
59
|
-
const result = []
|
|
60
|
-
for (var row of this.props.data) {
|
|
61
|
-
let imageObj = row.image
|
|
62
|
-
|
|
63
|
-
// Ignore nulls (https://github.com/mWater/mwater-server/issues/202)
|
|
64
|
-
if (!imageObj) {
|
|
65
|
-
continue
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (_.isString(imageObj)) {
|
|
69
|
-
imageObj = JSON.parse(imageObj)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (_.isArray(imageObj)) {
|
|
73
|
-
result.push(imageObj.map((image) => this.renderImage(row.id, image, imageManager)))
|
|
74
|
-
} else {
|
|
75
|
-
result.push(this.renderImage(row.id, imageObj, imageManager))
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return result
|
|
79
|
-
})()
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
render() {
|
|
83
|
-
const titleStyle = {
|
|
84
|
-
textAlign: "center",
|
|
85
|
-
fontSize: "14px",
|
|
86
|
-
fontWeight: "bold"
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const style = {
|
|
90
|
-
width: this.props.width,
|
|
91
|
-
height: this.props.height,
|
|
92
|
-
position: "relative",
|
|
93
|
-
overflowY: "auto"
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const title = this.props.design.titleText
|
|
97
|
-
|
|
98
|
-
const imageManager = {
|
|
99
|
-
getImageThumbnailUrl: (id: any, success: any, error: any) => success(this.props.dataSource.getImageUrl(id, 100)),
|
|
100
|
-
getImageUrl: (id: any, success: any, error: any) => success(this.props.dataSource.getImageUrl(id))
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return R(
|
|
104
|
-
"div",
|
|
105
|
-
{ style, className: "image-mosaic" },
|
|
106
|
-
title ? R("p", { style: titleStyle }, title) : undefined,
|
|
107
|
-
|
|
108
|
-
R(ImagePopupComponent, {
|
|
109
|
-
ref: (c: ImagePopupComponent | null) => {
|
|
110
|
-
this.imagePopup = c
|
|
111
|
-
},
|
|
112
|
-
imageManager
|
|
113
|
-
}),
|
|
114
|
-
R("div", null, this.renderImages(imageManager))
|
|
115
|
-
)
|
|
116
|
-
}
|
|
117
|
-
}
|