@mwater/visualization 5.3.2 → 5.4.1
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 +17 -17
- 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 +6 -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 +36 -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 +47 -47
- 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
|
@@ -2,7 +2,6 @@ import React from "react";
|
|
|
2
2
|
import AsyncLoadComponent from "@mwater/react-library/lib/AsyncLoadComponent";
|
|
3
3
|
import { DataSource, LiteralType, Schema } from "@mwater/expressions";
|
|
4
4
|
import * as ui from "../UIComponents";
|
|
5
|
-
import AxisColorEditorComponent from "./AxisColorEditorComponent";
|
|
6
5
|
import CategoryMapComponent from "./CategoryMapComponent";
|
|
7
6
|
import { JsonQLFilter } from "../JsonQLFilter";
|
|
8
7
|
import { Axis } from "./Axis";
|
|
@@ -53,8 +52,8 @@ export default class AxisComponent extends AsyncLoadComponent<AxisComponentProps
|
|
|
53
52
|
handleXformChange: (xform: any) => void;
|
|
54
53
|
cleanAxis(axis: any): Axis | null;
|
|
55
54
|
renderXform(axis: any): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement> | React.CElement<ui.RadioToggleComponentProps, ui.RadioToggleComponent> | null;
|
|
56
|
-
renderColorMap(axis: any):
|
|
57
|
-
renderExcludedValues(axis: any): (React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement> | React.CElement<
|
|
55
|
+
renderColorMap(axis: any): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement>[] | null;
|
|
56
|
+
renderExcludedValues(axis: any): (React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement> | React.CElement<import("./CategoryMapComponent").CategoryMapComponentProps, CategoryMapComponent>)[] | null;
|
|
58
57
|
renderFormat(axis: any): React.DetailedReactHTMLElement<{
|
|
59
58
|
className: string;
|
|
60
59
|
}, HTMLElement> | null;
|
|
@@ -84,7 +84,7 @@ class AxisComponent extends AsyncLoadComponent_1.default {
|
|
|
84
84
|
values.push(axis.expr.value);
|
|
85
85
|
}
|
|
86
86
|
// Get categories (value + label)
|
|
87
|
-
let categories = axisBuilder.getCategories(axis, values);
|
|
87
|
+
let categories = axisBuilder.getCategories(axis, values, { locale: this.context });
|
|
88
88
|
// Just "None" and so doesn't count
|
|
89
89
|
if (lodash_1.default.any(categories, (category) => category.value != null)) {
|
|
90
90
|
callback({ categories });
|
|
@@ -134,7 +134,7 @@ class AxisComponent extends AsyncLoadComponent_1.default {
|
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
// Set expression and clear xform
|
|
137
|
-
|
|
137
|
+
this.props.onChange(this.cleanAxis(lodash_1.default.extend({}, lodash_1.default.omit(this.props.value || {}, ["drawOrder"]), { expr })));
|
|
138
138
|
};
|
|
139
139
|
handleFormatChange = (ev) => {
|
|
140
140
|
return this.props.onChange((0, immer_1.default)(this.props.value, (draft) => {
|
|
@@ -226,9 +226,9 @@ class AxisComponent extends AsyncLoadComponent_1.default {
|
|
|
226
226
|
return R("div", null, R(ui.RadioToggleComponent, {
|
|
227
227
|
value: axis.xform ? axis.xform.type : null,
|
|
228
228
|
options: [
|
|
229
|
-
{ value: "bin", label:
|
|
230
|
-
{ value: "ranges", label:
|
|
231
|
-
{ value: "floor", label:
|
|
229
|
+
{ value: "bin", label: T `Equal Bins` },
|
|
230
|
+
{ value: "ranges", label: T `Custom Ranges` },
|
|
231
|
+
{ value: "floor", label: T `Whole Numbers` }
|
|
232
232
|
],
|
|
233
233
|
onChange: this.handleXformTypeChange
|
|
234
234
|
}), comp);
|
|
@@ -240,13 +240,13 @@ class AxisComponent extends AsyncLoadComponent_1.default {
|
|
|
240
240
|
return R(ui.RadioToggleComponent, {
|
|
241
241
|
value: axis.xform ? axis.xform.type : null,
|
|
242
242
|
options: [
|
|
243
|
-
{ value: null, label:
|
|
244
|
-
{ value: "year", label:
|
|
245
|
-
{ value: "yearmonth", label:
|
|
246
|
-
{ value: "month", label:
|
|
247
|
-
{ value: "week", label:
|
|
248
|
-
{ value: "yearweek", label:
|
|
249
|
-
{ value: "yearquarter", label:
|
|
243
|
+
{ value: null, label: T `Exact Date` },
|
|
244
|
+
{ value: "year", label: T `Year` },
|
|
245
|
+
{ value: "yearmonth", label: T `Year/Month` },
|
|
246
|
+
{ value: "month", label: T `Month` },
|
|
247
|
+
{ value: "week", label: T `Week` },
|
|
248
|
+
{ value: "yearweek", label: T `Year/Week` },
|
|
249
|
+
{ value: "yearquarter", label: T `Year/Quarter` }
|
|
250
250
|
],
|
|
251
251
|
onChange: this.handleXformTypeChange
|
|
252
252
|
});
|
|
@@ -254,13 +254,13 @@ class AxisComponent extends AsyncLoadComponent_1.default {
|
|
|
254
254
|
return R(ui.RadioToggleComponent, {
|
|
255
255
|
value: axis.xform ? axis.xform.type : null,
|
|
256
256
|
options: [
|
|
257
|
-
{ value: "date", label:
|
|
258
|
-
{ value: "year", label:
|
|
259
|
-
{ value: "yearmonth", label:
|
|
260
|
-
{ value: "month", label:
|
|
261
|
-
{ value: "week", label:
|
|
262
|
-
{ value: "yearweek", label:
|
|
263
|
-
{ value: "yearquarter", label:
|
|
257
|
+
{ value: "date", label: T `Date` },
|
|
258
|
+
{ value: "year", label: T `Year` },
|
|
259
|
+
{ value: "yearmonth", label: T `Year/Month` },
|
|
260
|
+
{ value: "month", label: T `Month` },
|
|
261
|
+
{ value: "week", label: T `Week` },
|
|
262
|
+
{ value: "yearweek", label: T `Year/Week` },
|
|
263
|
+
{ value: "yearquarter", label: T `Year/Quarter` }
|
|
264
264
|
],
|
|
265
265
|
onChange: this.handleXformTypeChange
|
|
266
266
|
});
|
|
@@ -319,7 +319,7 @@ class AxisComponent extends AsyncLoadComponent_1.default {
|
|
|
319
319
|
if (!formats) {
|
|
320
320
|
return null;
|
|
321
321
|
}
|
|
322
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" },
|
|
322
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, T `Format`), ": ", R("select", {
|
|
323
323
|
value: axis.format != null ? axis.format : (0, valueFormatter_2.getDefaultFormat)(valueType),
|
|
324
324
|
className: "form-select",
|
|
325
325
|
style: { width: "auto", display: "inline-block" },
|
|
@@ -64,15 +64,15 @@ class BinsComponent extends react_1.default.Component {
|
|
|
64
64
|
return (this.unmounted = true);
|
|
65
65
|
}
|
|
66
66
|
render() {
|
|
67
|
-
return R("div", null, R("div", { key: "vals" }, R(LabeledInlineComponent, { key: "min", label:
|
|
67
|
+
return R("div", null, R("div", { key: "vals" }, R(LabeledInlineComponent, { key: "min", label: T `Min:` }, R(NumberInputComponent_1.default, {
|
|
68
68
|
small: true,
|
|
69
69
|
value: this.props.xform.min,
|
|
70
70
|
onChange: (v) => this.props.onChange((0, update_object_1.default)(this.props.xform, { min: { $set: v } }))
|
|
71
|
-
})), " ", R(LabeledInlineComponent, { key: "max", label:
|
|
71
|
+
})), " ", R(LabeledInlineComponent, { key: "max", label: T `Max:` }, R(NumberInputComponent_1.default, {
|
|
72
72
|
small: true,
|
|
73
73
|
value: this.props.xform.max,
|
|
74
74
|
onChange: (v) => this.props.onChange((0, update_object_1.default)(this.props.xform, { max: { $set: v } }))
|
|
75
|
-
})), " ", R(LabeledInlineComponent, { key: "numBins", label:
|
|
75
|
+
})), " ", R(LabeledInlineComponent, { key: "numBins", label: T `# of Bins:` }, R(NumberInputComponent_1.default, {
|
|
76
76
|
small: true,
|
|
77
77
|
value: this.props.xform.numBins,
|
|
78
78
|
decimal: false,
|
|
@@ -82,12 +82,12 @@ class BinsComponent extends react_1.default.Component {
|
|
|
82
82
|
return R("i", { className: "fa fa-spinner fa-spin" });
|
|
83
83
|
}
|
|
84
84
|
else if (this.props.xform.min == null || this.props.xform.max == null || !this.props.xform.numBins) {
|
|
85
|
-
return R("span", { className: "text-danger", style: { paddingLeft: 10 } },
|
|
85
|
+
return R("span", { className: "text-danger", style: { paddingLeft: 10 } }, T `Min and max are required`);
|
|
86
86
|
}
|
|
87
87
|
return null;
|
|
88
88
|
})()), this.props.xform.min != null && this.props.xform.max != null && this.props.xform.numBins ? (react_1.default.createElement("div", { key: "excludes" },
|
|
89
|
-
react_1.default.createElement(bootstrap_1.Checkbox, { key: "lower", inline: true, value: !this.props.xform.excludeLower, onChange: (value) => this.props.onChange((0, update_object_1.default)(this.props.xform, { excludeLower: { $set: !value } })) }, `Include < ${this.props.xform.min}`),
|
|
90
|
-
react_1.default.createElement(bootstrap_1.Checkbox, { key: "upper", inline: true, value: !this.props.xform.excludeUpper, onChange: (value) => this.props.onChange((0, update_object_1.default)(this.props.xform, { excludeUpper: { $set: !value } })) }, `Include > ${this.props.xform.max}`))) : undefined);
|
|
89
|
+
react_1.default.createElement(bootstrap_1.Checkbox, { key: "lower", inline: true, value: !this.props.xform.excludeLower, onChange: (value) => this.props.onChange((0, update_object_1.default)(this.props.xform, { excludeLower: { $set: !value } })) }, T `Include < ${this.props.xform.min}`),
|
|
90
|
+
react_1.default.createElement(bootstrap_1.Checkbox, { key: "upper", inline: true, value: !this.props.xform.excludeUpper, onChange: (value) => this.props.onChange((0, update_object_1.default)(this.props.xform, { excludeUpper: { $set: !value } })) }, T `Include > ${this.props.xform.max}`))) : undefined);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
exports.default = BinsComponent;
|
|
@@ -17,7 +17,8 @@ interface CategoryMapComponentState {
|
|
|
17
17
|
collapsed: any;
|
|
18
18
|
}
|
|
19
19
|
export default class CategoryMapComponent extends React.Component<CategoryMapComponentProps, CategoryMapComponentState> {
|
|
20
|
-
|
|
20
|
+
static contextType: React.Context<string>;
|
|
21
|
+
constructor(props: CategoryMapComponentProps);
|
|
21
22
|
handleReorder: (map: any) => void;
|
|
22
23
|
handleColorChange: (value: any, color: any) => void;
|
|
23
24
|
handleExcludeChange: (value: any, ev: any) => void;
|
|
@@ -10,9 +10,11 @@ const update_object_1 = __importDefault(require("update-object"));
|
|
|
10
10
|
const ColorComponent_1 = __importDefault(require("../ColorComponent"));
|
|
11
11
|
const ReorderableListComponent_1 = __importDefault(require("@mwater/react-library/lib/reorderable/ReorderableListComponent"));
|
|
12
12
|
const immer_1 = __importDefault(require("immer"));
|
|
13
|
+
const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
13
14
|
// Category map for an axis. Controls the colorMap values and excludedValues
|
|
14
15
|
// Can be collapsed
|
|
15
16
|
class CategoryMapComponent extends react_1.default.Component {
|
|
17
|
+
static contextType = expressions_ui_1.LocaleContext;
|
|
16
18
|
constructor(props) {
|
|
17
19
|
super(props);
|
|
18
20
|
this.state = {
|
|
@@ -51,7 +53,7 @@ class CategoryMapComponent extends react_1.default.Component {
|
|
|
51
53
|
return null;
|
|
52
54
|
}
|
|
53
55
|
handleNullLabelChange = (e) => {
|
|
54
|
-
const name = prompt(
|
|
56
|
+
const name = prompt(T `Enter label for none value`, this.props.axis.nullLabel || T `None`);
|
|
55
57
|
if (name) {
|
|
56
58
|
return this.props.onChange((0, update_object_1.default)(this.props.axis, { nullLabel: { $set: name } }));
|
|
57
59
|
}
|
|
@@ -61,7 +63,7 @@ class CategoryMapComponent extends react_1.default.Component {
|
|
|
61
63
|
if (this.props.axis.categoryLabels) {
|
|
62
64
|
label = this.props.axis.categoryLabels[JSON.stringify(category.value)] || label;
|
|
63
65
|
}
|
|
64
|
-
const name = prompt(
|
|
66
|
+
const name = prompt(T `Enter label or blank to reset`, label);
|
|
65
67
|
if (name != null) {
|
|
66
68
|
if (name) {
|
|
67
69
|
return this.props.onChange((0, immer_1.default)(this.props.axis, (draft) => {
|
|
@@ -93,7 +95,7 @@ class CategoryMapComponent extends react_1.default.Component {
|
|
|
93
95
|
}, label);
|
|
94
96
|
}
|
|
95
97
|
else {
|
|
96
|
-
return R("a", { className: "link-plain", onClick: this.handleNullLabelChange, style: { cursor: "pointer" } }, label, R("span", { style: { fontSize: 12, marginLeft: 4 } },
|
|
98
|
+
return R("a", { className: "link-plain", onClick: this.handleNullLabelChange, style: { cursor: "pointer" } }, label, R("span", { style: { fontSize: 12, marginLeft: 4 } }, T `(click to change label for none value)`));
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
// Category is { value: category value, label: category label }
|
|
@@ -154,10 +156,10 @@ class CategoryMapComponent extends react_1.default.Component {
|
|
|
154
156
|
}
|
|
155
157
|
renderToggle() {
|
|
156
158
|
if (this.state.collapsed) {
|
|
157
|
-
return R("div", null, R("a", { className: "link-plain", onClick: this.handleToggle },
|
|
159
|
+
return R("div", null, R("a", { className: "link-plain", onClick: this.handleToggle }, T `Show Values `, R("i", { className: "fa fa-caret-down" })));
|
|
158
160
|
}
|
|
159
161
|
else {
|
|
160
|
-
return R("div", null, R("a", { className: "link-plain", onClick: this.handleToggle },
|
|
162
|
+
return R("div", null, R("a", { className: "link-plain", onClick: this.handleToggle }, T `Hide Values `, R("i", { className: "fa fa-caret-up" })));
|
|
161
163
|
}
|
|
162
164
|
}
|
|
163
165
|
render() {
|
|
@@ -119,7 +119,7 @@ function ColorPaletteCollectionComponent(props) {
|
|
|
119
119
|
}
|
|
120
120
|
const onPaletteSelected = (index) => {
|
|
121
121
|
// Generate color map
|
|
122
|
-
const scheme = generatePaletteColors(palettes[index],
|
|
122
|
+
const scheme = generatePaletteColors(palettes[index], numColors);
|
|
123
123
|
const colorMap = lodash_1.default.map(props.categories, (category, i) => ({
|
|
124
124
|
value: category.value,
|
|
125
125
|
color: category.value === null ? "#aaaaaa" : scheme[i % scheme.length]
|
|
@@ -129,7 +129,7 @@ function ColorPaletteCollectionComponent(props) {
|
|
|
129
129
|
const renderCancel = () => {
|
|
130
130
|
if (props.axis.colorMap) {
|
|
131
131
|
return (react_1.default.createElement("div", null,
|
|
132
|
-
react_1.default.createElement("a", { className: "link-plain", onClick: props.onCancel, key: "cancel-customize" },
|
|
132
|
+
react_1.default.createElement("a", { className: "link-plain", onClick: props.onCancel, key: "cancel-customize" }, T `Cancel`)));
|
|
133
133
|
}
|
|
134
134
|
return null;
|
|
135
135
|
};
|
|
@@ -137,7 +137,7 @@ function ColorPaletteCollectionComponent(props) {
|
|
|
137
137
|
return (react_1.default.createElement(ColorPaletteComponent, { key: index, index: index, colorSet: generatePaletteColors(palette, 6), onPaletteSelected: onPaletteSelected }));
|
|
138
138
|
}
|
|
139
139
|
return (react_1.default.createElement("div", null,
|
|
140
|
-
react_1.default.createElement("p", null,
|
|
140
|
+
react_1.default.createElement("p", null, T `Please select a color scheme`),
|
|
141
141
|
palettes.map((palette, index) => renderPalette(palette, index)),
|
|
142
142
|
renderCancel()));
|
|
143
143
|
}
|
|
@@ -44,7 +44,7 @@ class RangesComponent extends react_1.default.Component {
|
|
|
44
44
|
};
|
|
45
45
|
render() {
|
|
46
46
|
return R("div", null, R("table", null, this.props.xform.ranges.length > 0
|
|
47
|
-
? R("thead", null, R("tr", null, R("th", null, " "), R("th", { key: "min", colSpan: 2, style: { textAlign: "center" } },
|
|
47
|
+
? R("thead", null, R("tr", null, R("th", null, " "), R("th", { key: "min", colSpan: 2, style: { textAlign: "center" } }, T `From`), R("th", { key: "and" }, ""), R("th", { key: "max", colSpan: 2, style: { textAlign: "center" } }, T `To`), R("th", { key: "label", colSpan: 1, style: { textAlign: "center" } }, T `Label`), R("th", { key: "remove" })))
|
|
48
48
|
: undefined, react_1.default.createElement(ReorderableListComponent_1.default, {
|
|
49
49
|
items: this.props.xform.ranges,
|
|
50
50
|
onReorder: this.handleReorder,
|
|
@@ -54,7 +54,7 @@ class RangesComponent extends react_1.default.Component {
|
|
|
54
54
|
})),
|
|
55
55
|
// _.map @props.xform.ranges, (range, i) =>
|
|
56
56
|
// R RangeComponent, key: range.id, range: range, onChange: @handleRangeChange.bind(null, i), onRemove: @handleRemoveRange.bind(null, i)
|
|
57
|
-
R("button", { className: "btn btn-link btn-sm", type: "button", onClick: this.handleAddRange }, R("span", { className: "fas fa-plus" }),
|
|
57
|
+
R("button", { className: "btn btn-link btn-sm", type: "button", onClick: this.handleAddRange }, R("span", { className: "fas fa-plus" }), T ` Add Range`));
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
exports.default = RangesComponent;
|
|
@@ -88,7 +88,7 @@ class RangeComponent extends react_1.default.Component {
|
|
|
88
88
|
}
|
|
89
89
|
if (this.props.range.maxValue != null) {
|
|
90
90
|
if (placeholder) {
|
|
91
|
-
placeholder +=
|
|
91
|
+
placeholder += T ` and `;
|
|
92
92
|
}
|
|
93
93
|
if (this.props.range.maxOpen) {
|
|
94
94
|
placeholder += `< ${this.props.range.maxValue}`;
|
|
@@ -99,24 +99,24 @@ class RangeComponent extends react_1.default.Component {
|
|
|
99
99
|
}
|
|
100
100
|
return this.props.connectDragPreview(this.props.connectDropTarget(R("tr", null, R("td", null, this.props.connectDragSource(R("span", { className: "fa fa-bars" }))), R("td", { key: "minOpen" }, R(expressions_ui_1.LinkComponent, {
|
|
101
101
|
dropdownItems: [
|
|
102
|
-
{ id: "true", name:
|
|
103
|
-
{ id: "false", name:
|
|
102
|
+
{ id: "true", name: T `greater than` },
|
|
103
|
+
{ id: "false", name: T `greater than or equal to` }
|
|
104
104
|
],
|
|
105
105
|
onDropdownItemClicked: (id) => this.handleMinOpenChange(id === "true")
|
|
106
|
-
}, this.props.range.minOpen ?
|
|
106
|
+
}, this.props.range.minOpen ? T `greater than` : T `greater than or equal to`)), R("td", { key: "minValue" }, R(NumberInputComponent_1.default, {
|
|
107
107
|
value: this.props.range.minValue ?? undefined,
|
|
108
|
-
placeholder:
|
|
108
|
+
placeholder: T `None`,
|
|
109
109
|
small: true,
|
|
110
110
|
onChange: (v) => this.props.onChange((0, update_object_1.default)(this.props.range, { minValue: { $set: v } }))
|
|
111
|
-
})), R("td", { key: "and" }, "\
|
|
111
|
+
})), R("td", { key: "and" }, "\u00A0" + T `and` + "\u00A0"), R("td", { key: "maxOpen" }, R(expressions_ui_1.LinkComponent, {
|
|
112
112
|
dropdownItems: [
|
|
113
|
-
{ id: "true", name:
|
|
114
|
-
{ id: "false", name:
|
|
113
|
+
{ id: "true", name: T `less than` },
|
|
114
|
+
{ id: "false", name: T `less than or equal to` }
|
|
115
115
|
],
|
|
116
116
|
onDropdownItemClicked: (id) => this.handleMaxOpenChange(id === "true")
|
|
117
|
-
}, this.props.range.maxOpen ?
|
|
117
|
+
}, this.props.range.maxOpen ? T `less than` : T `less than or equal to`)), R("td", { key: "maxValue" }, R(NumberInputComponent_1.default, {
|
|
118
118
|
value: this.props.range.maxValue ?? undefined,
|
|
119
|
-
placeholder:
|
|
119
|
+
placeholder: T `None`,
|
|
120
120
|
small: true,
|
|
121
121
|
onChange: (v) => this.props.onChange((0, update_object_1.default)(this.props.range, { maxValue: { $set: v } }))
|
|
122
122
|
})), R("td", { key: "label" }, R("input", {
|
package/lib/compressJson.js
CHANGED
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = compressJson;
|
|
6
7
|
const pako_1 = __importDefault(require("pako"));
|
|
7
8
|
/**
|
|
8
9
|
* Gzips and base64 encodes JSON object if larger than 100 bytes
|
|
@@ -16,4 +17,3 @@ function compressJson(json) {
|
|
|
16
17
|
return str;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
|
-
exports.default = compressJson;
|
|
@@ -37,6 +37,8 @@ export interface DashboardComponentProps {
|
|
|
37
37
|
filters?: JsonQLFilter[];
|
|
38
38
|
/** True to hide title bar and related controls */
|
|
39
39
|
hideTitleBar?: boolean;
|
|
40
|
+
/** Called when the edit mode changes */
|
|
41
|
+
onEditModeChange?: (editing: boolean) => void;
|
|
40
42
|
}
|
|
41
43
|
export interface DashboardComponentState {
|
|
42
44
|
undoStack: UndoStack;
|
|
@@ -59,6 +59,9 @@ class DashboardComponent extends react_1.default.Component {
|
|
|
59
59
|
hideQuickfilters: layoutOptions.hideQuickfiltersWidth != null && layoutOptions.hideQuickfiltersWidth > document.body.clientWidth,
|
|
60
60
|
refreshKey: 1
|
|
61
61
|
};
|
|
62
|
+
if (props.onEditModeChange) {
|
|
63
|
+
props.onEditModeChange(this.state.editing);
|
|
64
|
+
}
|
|
62
65
|
}
|
|
63
66
|
// Get the values of the quick filters
|
|
64
67
|
getQuickfilterValues = () => {
|
|
@@ -106,7 +109,11 @@ class DashboardComponent extends react_1.default.Component {
|
|
|
106
109
|
this.settings.show(this.props.design);
|
|
107
110
|
};
|
|
108
111
|
handleToggleEditing = () => {
|
|
109
|
-
|
|
112
|
+
const editing = !this.state.editing;
|
|
113
|
+
this.setState({ editing });
|
|
114
|
+
if (this.props.onEditModeChange) {
|
|
115
|
+
this.props.onEditModeChange(editing);
|
|
116
|
+
}
|
|
110
117
|
};
|
|
111
118
|
handleOpenLayoutOptions = () => {
|
|
112
119
|
this.setState({ layoutOptionsOpen: true });
|
|
@@ -139,10 +146,10 @@ class DashboardComponent extends react_1.default.Component {
|
|
|
139
146
|
key: "edit",
|
|
140
147
|
className: `btn btn-primary btn-sm ${this.state.editing ? "active" : ""}`,
|
|
141
148
|
onClick: this.handleToggleEditing
|
|
142
|
-
}, R("span", { className: "fas fa-pencil-alt" }), this.state.editing ?
|
|
149
|
+
}, R("span", { className: "fas fa-pencil-alt" }), this.state.editing ? T ` Editing` : T ` Edit`);
|
|
143
150
|
}
|
|
144
151
|
renderStyle() {
|
|
145
|
-
return R("button", { type: "button", key: "style", className: "btn btn-link btn-sm", onClick: this.handleOpenLayoutOptions }, R("span", { className: "fa fa-mobile" }), R("span", { className: "hide-600px" },
|
|
152
|
+
return R("button", { type: "button", key: "style", className: "btn btn-link btn-sm", onClick: this.handleOpenLayoutOptions }, R("span", { className: "fa fa-mobile" }), R("span", { className: "hide-600px" }, T ` Layout `));
|
|
146
153
|
}
|
|
147
154
|
renderActionLinks() {
|
|
148
155
|
return R("div", null, this.state.editing
|
|
@@ -151,22 +158,22 @@ class DashboardComponent extends react_1.default.Component {
|
|
|
151
158
|
key: "undo",
|
|
152
159
|
className: `btn btn-link btn-sm ${!this.state.undoStack.canUndo() ? "disabled" : ""}`,
|
|
153
160
|
onClick: this.handleUndo
|
|
154
|
-
}, R("span", { className: "fas fa-caret-left" }), R("span", { className: "hide-600px" },
|
|
161
|
+
}, R("span", { className: "fas fa-caret-left" }), R("span", { className: "hide-600px" }, T ` Undo`)),
|
|
155
162
|
" ",
|
|
156
163
|
R("a", {
|
|
157
164
|
key: "redo",
|
|
158
165
|
className: `btn btn-link btn-sm ${!this.state.undoStack.canRedo() ? "disabled" : ""}`,
|
|
159
166
|
onClick: this.handleRedo
|
|
160
|
-
}, R("span", { className: "fas fa-caret-right" }), R("span", { className: "hide-600px" },
|
|
167
|
+
}, R("span", { className: "fas fa-caret-right" }), R("span", { className: "hide-600px" }, T ` Redo`))
|
|
161
168
|
]
|
|
162
|
-
: undefined, R("a", { key: "print", className: "btn btn-link btn-sm", onClick: this.handlePrint }, R("span", { className: "fas fa-print" }), R("span", { className: "hide-600px" },
|
|
163
|
-
? R("a", { key: "showQuickfilters", className: "btn btn-link btn-sm", onClick: this.handleShowQuickfilters }, R("span", { className: "fa fa-filter" }), R("span", { className: "hide-600px" },
|
|
169
|
+
: undefined, R("a", { key: "print", className: "btn btn-link btn-sm", onClick: this.handlePrint }, R("span", { className: "fas fa-print" }), R("span", { className: "hide-600px" }, T ` Print`)), R("a", { key: "refresh", className: "btn btn-link btn-sm", onClick: this.handleRefreshData }, R("span", { className: "fas fa-sync" }), R("span", { className: "hide-600px" }, T ` Refresh`)), this.state.hideQuickfilters && this.props.design.quickfilters && this.props.design.quickfilters.length > 0
|
|
170
|
+
? R("a", { key: "showQuickfilters", className: "btn btn-link btn-sm", onClick: this.handleShowQuickfilters }, R("span", { className: "fa fa-filter" }), R("span", { className: "hide-600px" }, T ` Show Quickfilters`))
|
|
164
171
|
: undefined,
|
|
165
172
|
// R 'a', key: "export", className: "btn btn-link btn-sm", onClick: @handleSaveDesignFile,
|
|
166
173
|
// R('span', className: "glyphicon glyphicon-download-alt")
|
|
167
174
|
// " Export"
|
|
168
175
|
this.state.editing
|
|
169
|
-
? R("a", { key: "settings", className: "btn btn-link btn-sm", onClick: this.handleSettings }, R("span", { className: "fas fa-cog" }), R("span", { className: "hide-600px" },
|
|
176
|
+
? R("a", { key: "settings", className: "btn btn-link btn-sm", onClick: this.handleSettings }, R("span", { className: "fas fa-cog" }), R("span", { className: "hide-600px" }, T ` Settings`))
|
|
170
177
|
: undefined, this.state.editing ? this.renderStyle() : undefined, this.props.extraTitleButtonsElem, this.props.onDesignChange != null ? this.renderEditingSwitch() : undefined);
|
|
171
178
|
}
|
|
172
179
|
renderTitleBar() {
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getFilterableTables = getFilterableTables;
|
|
7
|
+
exports.getCompiledFilters = getCompiledFilters;
|
|
7
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
9
|
const expressions_1 = require("@mwater/expressions");
|
|
9
10
|
const LayoutManager_1 = __importDefault(require("../layouts/LayoutManager"));
|
|
@@ -23,7 +24,6 @@ function getFilterableTables(design, schema) {
|
|
|
23
24
|
filterableTables = lodash_1.default.filter(lodash_1.default.uniq(filterableTables), (table) => schema.getTable(table));
|
|
24
25
|
return filterableTables;
|
|
25
26
|
}
|
|
26
|
-
exports.getFilterableTables = getFilterableTables;
|
|
27
27
|
/** Get filters from props filters combined with dashboard filters */
|
|
28
28
|
function getCompiledFilters(design, schema, filterableTables) {
|
|
29
29
|
let expr, jsonql, table;
|
|
@@ -66,4 +66,3 @@ function getCompiledFilters(design, schema, filterableTables) {
|
|
|
66
66
|
}
|
|
67
67
|
return compiledFilters;
|
|
68
68
|
}
|
|
69
|
-
exports.getCompiledFilters = getCompiledFilters;
|
|
@@ -39,7 +39,7 @@ const layoutOptions_1 = require("./layoutOptions");
|
|
|
39
39
|
const WidgetComponent_1 = require("./WidgetComponent");
|
|
40
40
|
const vectorMaps_1 = require("../maps/vectorMaps");
|
|
41
41
|
const WidgetDataSourcePrioritizer_1 = require("./WidgetDataSourcePrioritizer");
|
|
42
|
-
const
|
|
42
|
+
const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
43
43
|
/**
|
|
44
44
|
* Displays a dashboard, handling removing of widgets. No title bar or other decorations.
|
|
45
45
|
* Handles scoping and stores the state of scope
|
|
@@ -99,7 +99,7 @@ const DashboardViewComponent = react_1.default.forwardRef((props, ref) => {
|
|
|
99
99
|
setForceUpdate(forceUpdate + 1);
|
|
100
100
|
}
|
|
101
101
|
catch (err) {
|
|
102
|
-
return alert(
|
|
102
|
+
return alert(T `Clipboard not available`);
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
const getClipboardContents = () => {
|
|
@@ -168,7 +168,7 @@ const DashboardViewComponent = react_1.default.forwardRef((props, ref) => {
|
|
|
168
168
|
const clipboardContents = getClipboardContents();
|
|
169
169
|
// Check if can't paste because of missing table
|
|
170
170
|
if (clipboardContents && !lodash_1.default.all(clipboardContents.tables, (table) => props.schema.getTable(table))) {
|
|
171
|
-
cantPasteMessage =
|
|
171
|
+
cantPasteMessage = T `Dashboard is missing one or more data sources needed for the copied item.`;
|
|
172
172
|
}
|
|
173
173
|
const renderWidget = (options) => {
|
|
174
174
|
const widgetDataSource = widgetDataSourcePrioritizer.getWidgetDataSource(options.type, options.id, options.priority ?? 0);
|
|
@@ -195,7 +195,7 @@ const DashboardViewComponent = react_1.default.forwardRef((props, ref) => {
|
|
|
195
195
|
style.overflowX = "auto";
|
|
196
196
|
}
|
|
197
197
|
// Render widget container
|
|
198
|
-
return (react_1.default.createElement(
|
|
198
|
+
return (react_1.default.createElement(expressions_ui_1.LocaleContext.Provider, { value: props.design.locale ?? "en" },
|
|
199
199
|
react_1.default.createElement("div", { style: style },
|
|
200
200
|
!props.hideScopes ? renderScopes() : undefined,
|
|
201
201
|
layoutManager.renderLayout({
|
|
@@ -48,7 +48,7 @@ const FontStyleEditor = ({ value, onChange }) => {
|
|
|
48
48
|
fontSize: `${value.size}px`,
|
|
49
49
|
fontWeight: value.weight,
|
|
50
50
|
color: value.color
|
|
51
|
-
} },
|
|
51
|
+
} }, T `Sample`),
|
|
52
52
|
react_1.default.createElement("div", { style: { fontSize: '10px', color: '#888', marginTop: '2px' } },
|
|
53
53
|
value.family,
|
|
54
54
|
", ",
|
|
@@ -92,7 +92,7 @@ const FontEditorModal = ({ initialValue, onSave, onCancel }) => {
|
|
|
92
92
|
else {
|
|
93
93
|
fontWeightOptions.push("400", "700");
|
|
94
94
|
}
|
|
95
|
-
return (react_1.default.createElement(ActionCancelModalComponent_1.default, { title:
|
|
95
|
+
return (react_1.default.createElement(ActionCancelModalComponent_1.default, { title: T `Edit Font`, onAction: () => onSave(currentValue), onCancel: onCancel },
|
|
96
96
|
react_1.default.createElement("div", { style: {
|
|
97
97
|
border: '1px solid #ccc',
|
|
98
98
|
padding: '10px',
|
|
@@ -103,14 +103,14 @@ const FontEditorModal = ({ initialValue, onSave, onCancel }) => {
|
|
|
103
103
|
marginBottom: '10px',
|
|
104
104
|
fontSize: '14px',
|
|
105
105
|
fontWeight: 'bold'
|
|
106
|
-
} },
|
|
106
|
+
} }, T `Sample Text:`),
|
|
107
107
|
react_1.default.createElement("div", { style: {
|
|
108
108
|
fontFamily: (0, layoutOptions_1.expandFontFamily)(currentValue.family),
|
|
109
109
|
fontSize: `${currentValue.size}px`,
|
|
110
110
|
fontWeight: currentValue.weight,
|
|
111
111
|
color: currentValue.color
|
|
112
|
-
} },
|
|
113
|
-
react_1.default.createElement(bootstrap_1.FormGroup, { label:
|
|
112
|
+
} }, T `The quick brown fox jumps over the lazy dog.`)),
|
|
113
|
+
react_1.default.createElement(bootstrap_1.FormGroup, { label: T `Font Family` },
|
|
114
114
|
react_1.default.createElement(react_select_1.default, { value: { value: currentValue.family, label: currentValue.family }, onChange: (option) => handleChange('family', option?.value || ''), options: [
|
|
115
115
|
{ value: 'Helvetica Neue', label: 'Helvetica Neue' },
|
|
116
116
|
{ value: 'Georgia', label: 'Georgia' },
|
|
@@ -121,10 +121,10 @@ const FontEditorModal = ({ initialValue, onSave, onCancel }) => {
|
|
|
121
121
|
{ value: 'Merriweather', label: 'Merriweather' },
|
|
122
122
|
{ value: 'Roboto', label: 'Roboto' },
|
|
123
123
|
], formatOptionLabel: (option) => (react_1.default.createElement("span", { style: { fontFamily: (0, layoutOptions_1.expandFontFamily)(option.value) } }, option.label)), isClearable: false, menuPortalTarget: document.body, styles: { menuPortal: (style) => ({ ...style, zIndex: 2000 }) } })),
|
|
124
|
-
react_1.default.createElement(bootstrap_1.FormGroup, { label:
|
|
124
|
+
react_1.default.createElement(bootstrap_1.FormGroup, { label: T `Font Size:`, horizontal: true },
|
|
125
125
|
react_1.default.createElement(bootstrap_1.Select, { value: currentValue.size, onChange: (value) => handleChange('size', value || 12), options: fontSizeOptions })),
|
|
126
|
-
react_1.default.createElement(bootstrap_1.FormGroup, { label:
|
|
126
|
+
react_1.default.createElement(bootstrap_1.FormGroup, { label: T `Font Weight:`, horizontal: true },
|
|
127
127
|
react_1.default.createElement(bootstrap_1.Select, { value: currentValue.weight, onChange: (value) => handleChange('weight', value), options: fontWeightOptions.map(weight => ({ value: weight, label: weight })) })),
|
|
128
|
-
react_1.default.createElement(bootstrap_1.FormGroup, { label:
|
|
128
|
+
react_1.default.createElement(bootstrap_1.FormGroup, { label: T `Font Color:`, horizontal: true },
|
|
129
129
|
react_1.default.createElement(ColorComponent_1.default, { color: currentValue.color, onChange: (value) => handleChange('color', value), disableReset: true }))));
|
|
130
130
|
};
|