@mwater/visualization 5.3.1 → 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 +1 -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 +9 -9
- 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 +102 -75
- 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
package/lib/maps/vectorMaps.js
CHANGED
|
@@ -3,7 +3,18 @@ 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.setPrintingModeEnabled = setPrintingModeEnabled;
|
|
7
|
+
exports.setMapTilerApiKey = setMapTilerApiKey;
|
|
8
|
+
exports.getMapTilerApiKey = getMapTilerApiKey;
|
|
9
|
+
exports.areVectorMapsEnabled = areVectorMapsEnabled;
|
|
10
|
+
exports.useVectorMap = useVectorMap;
|
|
11
|
+
exports.useHoverCursor = useHoverCursor;
|
|
12
|
+
exports.useStyleMap = useStyleMap;
|
|
13
|
+
exports.useBaseStyle = useBaseStyle;
|
|
14
|
+
exports.mergeBaseAndUserStyle = mergeBaseAndUserStyle;
|
|
15
|
+
exports.AttributionControl = AttributionControl;
|
|
16
|
+
exports.VectorMapLogo = VectorMapLogo;
|
|
17
|
+
exports.usePersistedMapBounds = usePersistedMapBounds;
|
|
7
18
|
const maplibre_gl_1 = __importDefault(require("maplibre-gl"));
|
|
8
19
|
const react_1 = require("react");
|
|
9
20
|
const mapSymbols_1 = require("./mapSymbols");
|
|
@@ -15,7 +26,6 @@ let printingModeEnabled = false;
|
|
|
15
26
|
function setPrintingModeEnabled(val) {
|
|
16
27
|
printingModeEnabled = val;
|
|
17
28
|
}
|
|
18
|
-
exports.setPrintingModeEnabled = setPrintingModeEnabled;
|
|
19
29
|
/* Hooks and functions related to displaying a vector map */
|
|
20
30
|
let mapTilerApiKey = "";
|
|
21
31
|
/** This must be called to set the appropriate key before use. If it is not set, vector maps will not function.
|
|
@@ -24,16 +34,13 @@ let mapTilerApiKey = "";
|
|
|
24
34
|
function setMapTilerApiKey(key) {
|
|
25
35
|
mapTilerApiKey = key;
|
|
26
36
|
}
|
|
27
|
-
exports.setMapTilerApiKey = setMapTilerApiKey;
|
|
28
37
|
function getMapTilerApiKey() {
|
|
29
38
|
return mapTilerApiKey;
|
|
30
39
|
}
|
|
31
|
-
exports.getMapTilerApiKey = getMapTilerApiKey;
|
|
32
40
|
/** Check if vector maps are enabled by setting API key */
|
|
33
41
|
function areVectorMapsEnabled() {
|
|
34
42
|
return mapTilerApiKey !== "";
|
|
35
43
|
}
|
|
36
|
-
exports.areVectorMapsEnabled = areVectorMapsEnabled;
|
|
37
44
|
/** Loads a vector map, refreshing the WebGL context as needed */
|
|
38
45
|
function useVectorMap(options) {
|
|
39
46
|
const { divRef, bounds, scrollZoom, dragPan, touchZoomRotate } = options;
|
|
@@ -87,7 +94,7 @@ function useVectorMap(options) {
|
|
|
87
94
|
},
|
|
88
95
|
// Prevent scrolling outside of world bounds
|
|
89
96
|
maxBounds: [
|
|
90
|
-
[-179.9, -85],
|
|
97
|
+
[-179.9, -85], // Southwest coordinates
|
|
91
98
|
[179.9, 85] // Northeast coordinates
|
|
92
99
|
],
|
|
93
100
|
preserveDrawingBuffer: printingModeEnabled
|
|
@@ -110,7 +117,7 @@ function useVectorMap(options) {
|
|
|
110
117
|
// Dynamically load symbols
|
|
111
118
|
m.on("styleimagemissing", function (ev) {
|
|
112
119
|
// Check if known
|
|
113
|
-
const mapSymbol = mapSymbols_1.
|
|
120
|
+
const mapSymbol = (0, mapSymbols_1.getMapSymbols)().find((s) => s.value == ev.id);
|
|
114
121
|
if (mapSymbol) {
|
|
115
122
|
m.loadImage(mapSymbol.url, (err, image) => {
|
|
116
123
|
if (image && !m.hasImage(mapSymbol.value)) {
|
|
@@ -132,7 +139,6 @@ function useVectorMap(options) {
|
|
|
132
139
|
}, [mapReloadCount]);
|
|
133
140
|
return map;
|
|
134
141
|
}
|
|
135
|
-
exports.useVectorMap = useVectorMap;
|
|
136
142
|
/** Sets cursor as pointer when over any layers with the specified ids */
|
|
137
143
|
function useHoverCursor(map, layerIds) {
|
|
138
144
|
// Setup hover effect
|
|
@@ -162,7 +168,6 @@ function useHoverCursor(map, layerIds) {
|
|
|
162
168
|
};
|
|
163
169
|
}, [map, layerIds]);
|
|
164
170
|
}
|
|
165
|
-
exports.useHoverCursor = useHoverCursor;
|
|
166
171
|
/** Apply user style to a map with base style */
|
|
167
172
|
function useStyleMap(options) {
|
|
168
173
|
const { map, baseLayer, baseLayerOpacity, userStyle } = options;
|
|
@@ -181,7 +186,6 @@ function useStyleMap(options) {
|
|
|
181
186
|
map.setStyle(style);
|
|
182
187
|
}, [map, style]);
|
|
183
188
|
}
|
|
184
|
-
exports.useStyleMap = useStyleMap;
|
|
185
189
|
/** Loads a base style for the map */
|
|
186
190
|
function useBaseStyle(baseLayer) {
|
|
187
191
|
// Load base layer
|
|
@@ -220,7 +224,6 @@ function useBaseStyle(baseLayer) {
|
|
|
220
224
|
}, [baseLayer]);
|
|
221
225
|
return baseStyle;
|
|
222
226
|
}
|
|
223
|
-
exports.useBaseStyle = useBaseStyle;
|
|
224
227
|
/** Combines a base style and a user style */
|
|
225
228
|
function mergeBaseAndUserStyle(baseStyle, userStyle, baseLayerOpacity) {
|
|
226
229
|
// Merge until baseStyle and userStyle are present
|
|
@@ -254,7 +257,6 @@ function mergeBaseAndUserStyle(baseStyle, userStyle, baseLayerOpacity) {
|
|
|
254
257
|
};
|
|
255
258
|
return style;
|
|
256
259
|
}
|
|
257
|
-
exports.mergeBaseAndUserStyle = mergeBaseAndUserStyle;
|
|
258
260
|
function AttributionControl(props) {
|
|
259
261
|
if (props.baseLayer == "blank") {
|
|
260
262
|
return react_2.default.createElement("div", { className: "newmap-attribution-control" }, props.extraText ? " " + props.extraText : null);
|
|
@@ -270,7 +272,6 @@ function AttributionControl(props) {
|
|
|
270
272
|
react_2.default.createElement("a", { href: "https://www.openstreetmap.org/about/", target: "_blank" }, "\u00A9 OpenStreetMap"),
|
|
271
273
|
props.extraText ? " " + props.extraText : null));
|
|
272
274
|
}
|
|
273
|
-
exports.AttributionControl = AttributionControl;
|
|
274
275
|
function VectorMapLogo(props) {
|
|
275
276
|
if (props.baseLayer == "blank") {
|
|
276
277
|
return null;
|
|
@@ -280,7 +281,6 @@ function VectorMapLogo(props) {
|
|
|
280
281
|
}
|
|
281
282
|
return react_2.default.createElement("img", { src: require("./Maptiler-logo.png").default, style: { position: "absolute", bottom: 38, left: 11, height: 22, zIndex: 1000, pointerEvents: "none" } });
|
|
282
283
|
}
|
|
283
|
-
exports.VectorMapLogo = VectorMapLogo;
|
|
284
284
|
async function loadBingBasemap(basemapType, opacity) {
|
|
285
285
|
// Load metadata
|
|
286
286
|
const bingApiKey = "Ao26dWY2IC8PjorsJKFaoR85EPXCnCohrJdisCWXIULAXFo0JAXquGauppTMQbyU";
|
|
@@ -342,4 +342,3 @@ function usePersistedMapBounds(map, localStorageKey) {
|
|
|
342
342
|
};
|
|
343
343
|
}, [map]);
|
|
344
344
|
}
|
|
345
|
-
exports.usePersistedMapBounds = usePersistedMapBounds;
|
package/lib/memoizedDebounce.js
CHANGED
|
@@ -3,7 +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.memoizedDebounce =
|
|
6
|
+
exports.memoizedDebounce = memoizedDebounce;
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
9
|
function memoizedDebounce(func, wait = 0, options = {}, resolver) {
|
|
@@ -18,4 +18,3 @@ function memoizedDebounce(func, wait = 0, options = {}, resolver) {
|
|
|
18
18
|
};
|
|
19
19
|
return wrappedFunction;
|
|
20
20
|
}
|
|
21
|
-
exports.memoizedDebounce = memoizedDebounce;
|
|
@@ -24,6 +24,10 @@ export default class DateExprComponent extends React.Component<DateExprComponent
|
|
|
24
24
|
handleStartChange: (value: any) => any;
|
|
25
25
|
handleEndChange: (value: any) => void;
|
|
26
26
|
handlePreset: (preset: any) => void;
|
|
27
|
+
getPresets(): {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}[];
|
|
27
31
|
renderClear: () => React.DetailedReactHTMLElement<{
|
|
28
32
|
style: {
|
|
29
33
|
position: "absolute";
|
|
@@ -87,6 +87,19 @@ class DateExprComponent extends react_1.default.Component {
|
|
|
87
87
|
this.props.onChange({ type: "op", op: preset.id, exprs: [] });
|
|
88
88
|
return this.setState({ dropdownOpen: false });
|
|
89
89
|
};
|
|
90
|
+
getPresets() {
|
|
91
|
+
return [
|
|
92
|
+
{ id: "thisyear", name: T `This Year` },
|
|
93
|
+
{ id: "lastyear", name: T `Last Year` },
|
|
94
|
+
{ id: "thismonth", name: T `This Month` },
|
|
95
|
+
{ id: "lastmonth", name: T `Last Month` },
|
|
96
|
+
{ id: "today", name: T `Today` },
|
|
97
|
+
{ id: "yesterday", name: T `Yesterday` },
|
|
98
|
+
{ id: "last24hours", name: T `In Last 24 Hours` },
|
|
99
|
+
{ id: "last7days", name: T `In Last 7 Days` },
|
|
100
|
+
{ id: "last30days", name: T `In Last 30 Days` },
|
|
101
|
+
];
|
|
102
|
+
}
|
|
90
103
|
renderClear = () => {
|
|
91
104
|
return R("div", {
|
|
92
105
|
style: { position: "absolute", right: 10, top: 7, color: "#AAA" },
|
|
@@ -95,9 +108,9 @@ class DateExprComponent extends react_1.default.Component {
|
|
|
95
108
|
};
|
|
96
109
|
renderSummary() {
|
|
97
110
|
if (!this.props.value) {
|
|
98
|
-
return R("span", { className: "text-muted" },
|
|
111
|
+
return R("span", { className: "text-muted" }, T `All`);
|
|
99
112
|
}
|
|
100
|
-
const preset = lodash_1.default.findWhere(
|
|
113
|
+
const preset = lodash_1.default.findWhere(this.getPresets(), { id: this.props.value.op });
|
|
101
114
|
if (preset) {
|
|
102
115
|
return preset.name;
|
|
103
116
|
}
|
|
@@ -128,9 +141,9 @@ class DateExprComponent extends react_1.default.Component {
|
|
|
128
141
|
backgroundColor: "white",
|
|
129
142
|
borderRadius: 4
|
|
130
143
|
}
|
|
131
|
-
}, R("ul", { className: "nav nav-pills flex-column" }, lodash_1.default.map(
|
|
144
|
+
}, R("ul", { className: "nav nav-pills flex-column" }, lodash_1.default.map(this.getPresets(), (preset) => {
|
|
132
145
|
return R("li", { className: "nav-item" }, R("a", { className: "nav-link", style: { padding: 5 }, onClick: this.handlePreset.bind(null, preset) }, preset.name));
|
|
133
|
-
}), R("li", { className: "nav-item" }, R("a", { className: "nav-link", style: { padding: 5 }, onClick: () => this.setState({ custom: true }) },
|
|
146
|
+
}), R("li", { className: "nav-item" }, R("a", { className: "nav-link", style: { padding: 5 }, onClick: () => this.setState({ custom: true }) }, T `Custom Date Range...`))));
|
|
134
147
|
}
|
|
135
148
|
renderDropdown() {
|
|
136
149
|
if (this.state.custom) {
|
|
@@ -183,15 +196,3 @@ class DateExprComponent extends react_1.default.Component {
|
|
|
183
196
|
}
|
|
184
197
|
}
|
|
185
198
|
exports.default = DateExprComponent;
|
|
186
|
-
var presets = [
|
|
187
|
-
{ id: "thisyear", name: "This Year" },
|
|
188
|
-
{ id: "lastyear", name: "Last Year" },
|
|
189
|
-
{ id: "thismonth", name: "This Month" },
|
|
190
|
-
{ id: "lastmonth", name: "Last Month" },
|
|
191
|
-
{ id: "today", name: "Today" },
|
|
192
|
-
{ id: "yesterday", name: "Yesterday" },
|
|
193
|
-
{ id: "last24hours", name: "In Last 24 Hours" },
|
|
194
|
-
{ id: "last7days", name: "In Last 7 Days" },
|
|
195
|
-
{ id: "last30days", name: "In Last 30 Days" },
|
|
196
|
-
{ id: "last365days", name: "In Last 365 Days" }
|
|
197
|
-
];
|
|
@@ -21,7 +21,7 @@ class IdArrayQuickfilterComponent extends react_1.default.Component {
|
|
|
21
21
|
idTable,
|
|
22
22
|
schema: this.props.schema,
|
|
23
23
|
dataSource: this.props.dataSource,
|
|
24
|
-
placeholder:
|
|
24
|
+
placeholder: T `All`,
|
|
25
25
|
multi: this.props.multi
|
|
26
26
|
// TODO Does not use filters that are passed in
|
|
27
27
|
})), !this.props.onValueChange ? R("i", { className: "text-warning fa fa-fw fa-lock" }) : undefined);
|
|
@@ -3,7 +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.findExprValues =
|
|
6
|
+
exports.findExprValues = findExprValues;
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
8
|
const expressions_1 = require("@mwater/expressions");
|
|
9
9
|
/** Perform query to find quickfilter values for text and text[] expressions
|
|
@@ -103,4 +103,3 @@ function findExprValues(expr, schema, dataSource, filters, offset, limit, callba
|
|
|
103
103
|
callback(null, lodash_1.default.pluck(rows, "value"));
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
exports.findExprValues = findExprValues;
|
|
@@ -54,8 +54,29 @@ declare class EnumQuickfilterComponent extends React.Component<EnumQuickfilterCo
|
|
|
54
54
|
static contextType: React.Context<string>;
|
|
55
55
|
handleSingleChange: (val: any) => any;
|
|
56
56
|
handleMultiChange: (val: any) => any;
|
|
57
|
-
renderSingleSelect(options: any[]): React.FunctionComponentElement<
|
|
58
|
-
|
|
57
|
+
renderSingleSelect(options: any[]): React.FunctionComponentElement<{
|
|
58
|
+
placeholder: string;
|
|
59
|
+
value: any;
|
|
60
|
+
options: any[];
|
|
61
|
+
isClearable: boolean;
|
|
62
|
+
onChange: (value: any) => any;
|
|
63
|
+
isDisabled: boolean;
|
|
64
|
+
styles: {
|
|
65
|
+
menu: (style: import("react-select").CSSObjectWithLabel) => import("react-select").CSSObjectWithLabel;
|
|
66
|
+
};
|
|
67
|
+
}>;
|
|
68
|
+
renderMultiSelect(options: any[]): React.FunctionComponentElement<{
|
|
69
|
+
placeholder: string;
|
|
70
|
+
value: any[];
|
|
71
|
+
isClearable: boolean;
|
|
72
|
+
isMulti: boolean;
|
|
73
|
+
options: any[];
|
|
74
|
+
onChange: ((val: any) => any) | undefined;
|
|
75
|
+
isDisabled: boolean;
|
|
76
|
+
styles: {
|
|
77
|
+
menu: (style: import("react-select").CSSObjectWithLabel) => import("react-select").CSSObjectWithLabel;
|
|
78
|
+
};
|
|
79
|
+
}>;
|
|
59
80
|
render(): React.DetailedReactHTMLElement<{
|
|
60
81
|
style: {
|
|
61
82
|
display: "inline-block";
|
|
@@ -13,7 +13,7 @@ const TextLiteralComponent_1 = __importDefault(require("./TextLiteralComponent")
|
|
|
13
13
|
const DateExprComponent_1 = __importDefault(require("./DateExprComponent"));
|
|
14
14
|
const QuickfilterCompiler_1 = __importDefault(require("./QuickfilterCompiler"));
|
|
15
15
|
const IdArrayQuickfilterComponent_1 = __importDefault(require("./IdArrayQuickfilterComponent"));
|
|
16
|
-
const
|
|
16
|
+
const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
17
17
|
/** Displays quick filters and allows their value to be modified */
|
|
18
18
|
class QuickfiltersComponent extends react_1.default.Component {
|
|
19
19
|
renderQuickfilter(item, index) {
|
|
@@ -153,7 +153,7 @@ class QuickfiltersComponent extends react_1.default.Component {
|
|
|
153
153
|
exports.default = QuickfiltersComponent;
|
|
154
154
|
/** Quickfilter for an enum */
|
|
155
155
|
class EnumQuickfilterComponent extends react_1.default.Component {
|
|
156
|
-
static contextType =
|
|
156
|
+
static contextType = expressions_ui_1.LocaleContext;
|
|
157
157
|
handleSingleChange = (val) => {
|
|
158
158
|
if (val) {
|
|
159
159
|
return this.props.onValueChange(val);
|
|
@@ -102,7 +102,7 @@ class QuickfiltersDesignComponent extends react_1.default.Component {
|
|
|
102
102
|
};
|
|
103
103
|
render() {
|
|
104
104
|
return R("div", null, react_1.default.createElement(ListEditorComponent_1.ListEditorComponent, { items: this.props.design, onItemsChange: this.handleDesignChange, renderItem: this.renderQuickfilter, getReorderableKey: (item, index) => index }), this.props.tables.length > 0
|
|
105
|
-
? R("button", { type: "button", className: "btn btn-sm btn-link", onClick: this.handleAdd }, R("span", { className: "fas fa-plus" }),
|
|
105
|
+
? R("button", { type: "button", className: "btn btn-sm btn-link", onClick: this.handleAdd }, R("span", { className: "fas fa-plus" }), T `Add Quick Filter`)
|
|
106
106
|
: undefined);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -138,15 +138,15 @@ class QuickfilterDesignComponent extends react_1.default.Component {
|
|
|
138
138
|
render() {
|
|
139
139
|
// Determine type of expression
|
|
140
140
|
const exprType = new expressions_1.ExprUtils(this.props.schema).getExprType(this.props.design.expr);
|
|
141
|
-
return R("div", {}, R("div", { className: "mb-3 mt-1", key: "table" }, R("label", { className: "text-muted" },
|
|
141
|
+
return R("div", {}, R("div", { className: "mb-3 mt-1", key: "table" }, R("label", { className: "text-muted" }, T `Data Source`), R(ui.Select, {
|
|
142
142
|
value: this.state.table,
|
|
143
143
|
options: lodash_1.default.map(this.props.tables, (table) => ({
|
|
144
144
|
value: table,
|
|
145
145
|
label: expressions_1.ExprUtils.localizeString(this.props.schema.getTable(table).name)
|
|
146
146
|
})),
|
|
147
147
|
onChange: this.handleTableChange,
|
|
148
|
-
nullLabel:
|
|
149
|
-
})), R("div", { className: "mb-3", key: "expr" }, R("label", { className: "text-muted" },
|
|
148
|
+
nullLabel: T `Select...`
|
|
149
|
+
})), R("div", { className: "mb-3", key: "expr" }, R("label", { className: "text-muted" }, T `Filter By`), R("div", null, R(expressions_ui_1.ExprComponent, {
|
|
150
150
|
schema: this.props.schema,
|
|
151
151
|
dataSource: this.props.dataSource,
|
|
152
152
|
table: this.state.table,
|
|
@@ -154,23 +154,23 @@ class QuickfilterDesignComponent extends react_1.default.Component {
|
|
|
154
154
|
onChange: this.handleExprChange,
|
|
155
155
|
types: ["enum", "text", "enumset", "date", "datetime", "id[]", "text[]"],
|
|
156
156
|
}))), this.props.design.expr
|
|
157
|
-
? R("div", { className: "mb-3", key: "label" }, R("label", { className: "text-muted" },
|
|
157
|
+
? R("div", { className: "mb-3", key: "label" }, R("label", { className: "text-muted" }, T `Label`), R("input", {
|
|
158
158
|
type: "text",
|
|
159
159
|
className: "form-control form-control-sm",
|
|
160
160
|
value: this.props.design.label || "",
|
|
161
161
|
onChange: this.handleLabelChange,
|
|
162
|
-
placeholder:
|
|
162
|
+
placeholder: T `Optional Label`
|
|
163
163
|
}))
|
|
164
164
|
: undefined, this.props.mergeable
|
|
165
165
|
? R(ui.Checkbox, {
|
|
166
166
|
value: this.props.design.merged,
|
|
167
167
|
onChange: this.handleMergedChange
|
|
168
|
-
},
|
|
168
|
+
}, T `Merge with previous quickfilter `, R("span", { className: "text-muted" }, T `- displays as one single control that filters both`))
|
|
169
169
|
: undefined, ["enum", "text", "enumset", "id[]", "text[]"].includes(exprType)
|
|
170
170
|
? R(ui.Checkbox, {
|
|
171
171
|
value: this.props.design.multi,
|
|
172
172
|
onChange: this.handleMultiChange
|
|
173
|
-
},
|
|
173
|
+
}, T `Allow multiple selections`)
|
|
174
174
|
: undefined);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
@@ -22,8 +22,41 @@ export default class TextLiteralComponent extends React.Component<TextLiteralCom
|
|
|
22
22
|
handleSingleChange: (val: any) => any;
|
|
23
23
|
handleMultipleChange: (val: any) => any;
|
|
24
24
|
getOptions: (input: any, cb: any) => void;
|
|
25
|
-
renderSingle(): React.FunctionComponentElement<
|
|
26
|
-
|
|
25
|
+
renderSingle(): React.FunctionComponentElement<{
|
|
26
|
+
key: string;
|
|
27
|
+
placeholder: string;
|
|
28
|
+
value: {
|
|
29
|
+
value: any;
|
|
30
|
+
label: any;
|
|
31
|
+
} | null;
|
|
32
|
+
loadOptions: (input: any, cb: any) => void;
|
|
33
|
+
onChange: ((val: any) => any) | undefined;
|
|
34
|
+
isClearable: boolean;
|
|
35
|
+
defaultOptions: boolean;
|
|
36
|
+
isDisabled: boolean;
|
|
37
|
+
noOptionsMessage: () => string;
|
|
38
|
+
styles: {
|
|
39
|
+
menu: (style: import("react-select").CSSObjectWithLabel) => import("react-select").CSSObjectWithLabel;
|
|
40
|
+
};
|
|
41
|
+
}>;
|
|
42
|
+
renderMultiple(): React.FunctionComponentElement<{
|
|
43
|
+
placeholder: string;
|
|
44
|
+
value: {
|
|
45
|
+
value: unknown;
|
|
46
|
+
label: unknown;
|
|
47
|
+
}[] | null;
|
|
48
|
+
key: string;
|
|
49
|
+
isMulti: boolean;
|
|
50
|
+
loadOptions: (input: any, cb: any) => void;
|
|
51
|
+
defaultOptions: boolean;
|
|
52
|
+
onChange: ((val: any) => any) | undefined;
|
|
53
|
+
isClearable: boolean;
|
|
54
|
+
isDisabled: boolean;
|
|
55
|
+
noOptionsMessage: () => string;
|
|
56
|
+
styles: {
|
|
57
|
+
menu: (style: import("react-select").CSSObjectWithLabel) => import("react-select").CSSObjectWithLabel;
|
|
58
|
+
};
|
|
59
|
+
}>;
|
|
27
60
|
render(): React.DetailedReactHTMLElement<{
|
|
28
61
|
style: {
|
|
29
62
|
width: string;
|
|
@@ -87,15 +87,15 @@ class TextLiteralComponent extends react_1.default.Component {
|
|
|
87
87
|
renderSingle() {
|
|
88
88
|
const currentValue = this.props.value ? { value: this.props.value, label: this.props.value } : null;
|
|
89
89
|
return R(async_1.default, {
|
|
90
|
-
key: JSON.stringify(this.props.filters),
|
|
91
|
-
placeholder:
|
|
90
|
+
key: JSON.stringify(this.props.filters), // Include to force a change when filters change
|
|
91
|
+
placeholder: T `All`,
|
|
92
92
|
value: currentValue,
|
|
93
93
|
loadOptions: this.getOptions,
|
|
94
94
|
onChange: this.props.onChange ? this.handleSingleChange : undefined,
|
|
95
95
|
isClearable: true,
|
|
96
96
|
defaultOptions: true,
|
|
97
97
|
isDisabled: this.props.onChange == null,
|
|
98
|
-
noOptionsMessage: () =>
|
|
98
|
+
noOptionsMessage: () => T `Type to search`,
|
|
99
99
|
styles: {
|
|
100
100
|
// Keep menu above fixed data table headers
|
|
101
101
|
menu: (style) => lodash_1.default.extend({}, style, { zIndex: 2000 })
|
|
@@ -105,16 +105,16 @@ class TextLiteralComponent extends react_1.default.Component {
|
|
|
105
105
|
renderMultiple() {
|
|
106
106
|
const currentValue = this.props.value ? lodash_1.default.map(this.props.value, (v) => ({ value: v, label: v })) : null;
|
|
107
107
|
return R(async_1.default, {
|
|
108
|
-
placeholder:
|
|
108
|
+
placeholder: T `All`,
|
|
109
109
|
value: currentValue,
|
|
110
|
-
key: JSON.stringify(this.props.filters),
|
|
110
|
+
key: JSON.stringify(this.props.filters), // Include to force a change when filters change
|
|
111
111
|
isMulti: true,
|
|
112
112
|
loadOptions: this.getOptions,
|
|
113
113
|
defaultOptions: true,
|
|
114
114
|
onChange: this.props.onChange ? this.handleMultipleChange : undefined,
|
|
115
115
|
isClearable: true,
|
|
116
116
|
isDisabled: this.props.onChange == null,
|
|
117
|
-
noOptionsMessage: () =>
|
|
117
|
+
noOptionsMessage: () => T `Type to search`,
|
|
118
118
|
styles: {
|
|
119
119
|
// Keep menu above fixed data table headers
|
|
120
120
|
menu: (style) => lodash_1.default.extend({}, style, { zIndex: 2000 })
|
|
@@ -44,7 +44,7 @@ class DropdownPaletteItem extends react_1.default.Component {
|
|
|
44
44
|
react_1.default.createElement("div", { style: { display: 'flex' } },
|
|
45
45
|
react_1.default.createElement("div", { style: { flex: 1 } }, leftColumn.map(item => this.renderItem(item))),
|
|
46
46
|
react_1.default.createElement("div", { style: { flex: 1 } }, rightColumn.map(item => this.renderItem(item)))),
|
|
47
|
-
this.props.items.some(item => item.more) && !this.state.moreOpen && (react_1.default.createElement("div", { className: "dropdown-palette-menu-item", onMouseDown: this.handleMoreClick },
|
|
47
|
+
this.props.items.some(item => item.more) && !this.state.moreOpen && (react_1.default.createElement("div", { className: "dropdown-palette-menu-item", onMouseDown: this.handleMoreClick }, T `More...`))));
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
50
|
const popupPosition = {
|
|
@@ -46,7 +46,7 @@ class ExprItemsHtmlConverter extends ItemsHtmlConverter_1.default {
|
|
|
46
46
|
if (this.summarizeExprs) {
|
|
47
47
|
text = new expressions_1.ExprUtils(this.schema).summarizeExpr(exprItem.expr, this.locale);
|
|
48
48
|
if (text.length > 30) {
|
|
49
|
-
text = text.substr(0, 30) +
|
|
49
|
+
text = text.substr(0, 30) + T `...`;
|
|
50
50
|
}
|
|
51
51
|
exprHtml = lodash_1.default.escape(text);
|
|
52
52
|
}
|
|
@@ -67,25 +67,23 @@ class ExprItemsHtmlConverter extends ItemsHtmlConverter_1.default {
|
|
|
67
67
|
exprHtml = lodash_1.default.escape(text);
|
|
68
68
|
}
|
|
69
69
|
else {
|
|
70
|
-
exprHtml =
|
|
70
|
+
exprHtml = `<span style="color: #DDD">${T `---`}</span>`;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
else {
|
|
74
74
|
// Placeholder
|
|
75
|
-
exprHtml =
|
|
75
|
+
exprHtml = `<span class="text-muted">\u25a0\u25a0\u25a0</span>`;
|
|
76
76
|
}
|
|
77
77
|
// Add label
|
|
78
78
|
if (exprItem.includeLabel) {
|
|
79
|
-
const label = exprItem.labelText || new expressions_1.ExprUtils(this.schema).summarizeExpr(exprItem.expr, this.locale) +
|
|
80
|
-
exprHtml =
|
|
79
|
+
const label = exprItem.labelText || new expressions_1.ExprUtils(this.schema).summarizeExpr(exprItem.expr, this.locale) + T `:\u00A0`;
|
|
80
|
+
exprHtml = `<span class="text-muted">${lodash_1.default.escape(label)}</span>` + exprHtml;
|
|
81
81
|
}
|
|
82
82
|
if (this.designMode) {
|
|
83
83
|
html +=
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
(exprHtml || "\u00A0") +
|
|
88
|
-
"</span>\u2060";
|
|
84
|
+
`\u2060<span data-embed="${lodash_1.default.escape(JSON.stringify(item))}" class="mwater-visualization-text-widget-expr">` +
|
|
85
|
+
(exprHtml || T `\u00A0`) +
|
|
86
|
+
`</span>\u2060`;
|
|
89
87
|
}
|
|
90
88
|
else {
|
|
91
89
|
// View mode
|
|
@@ -59,13 +59,13 @@ class ColorPaletteComponent extends react_1.default.Component {
|
|
|
59
59
|
}
|
|
60
60
|
render() {
|
|
61
61
|
const baseColors = [
|
|
62
|
-
"#FF0000",
|
|
63
|
-
"#FFAA00",
|
|
64
|
-
"#FFFF00",
|
|
65
|
-
"#00FF00",
|
|
66
|
-
"#00FFFF",
|
|
67
|
-
"#0000FF",
|
|
68
|
-
"#9900FF",
|
|
62
|
+
"#FF0000", // red
|
|
63
|
+
"#FFAA00", // orange
|
|
64
|
+
"#FFFF00", // yellow
|
|
65
|
+
"#00FF00", // green
|
|
66
|
+
"#00FFFF", // cyan
|
|
67
|
+
"#0000FF", // blue
|
|
68
|
+
"#9900FF", // purple
|
|
69
69
|
"#FF00FF" // magenta
|
|
70
70
|
];
|
|
71
71
|
const customColors = this.context?.customColors || [];
|
|
@@ -4,6 +4,7 @@ import ItemsHtmlConverter, { HtmlItem } from "./ItemsHtmlConverter";
|
|
|
4
4
|
export interface RichTextComponentProps {
|
|
5
5
|
items?: HtmlItem[];
|
|
6
6
|
onItemsChange?: (items: HtmlItem[]) => void;
|
|
7
|
+
/** Called when an embed item is clicked */
|
|
7
8
|
onItemClick?: (item: HtmlItem) => void;
|
|
8
9
|
/** Optional className of editor wrapper */
|
|
9
10
|
className?: string;
|
|
@@ -59,7 +59,7 @@ class RichTextComponent extends react_1.default.Component {
|
|
|
59
59
|
// Requires a selection
|
|
60
60
|
const html = this.contentEditable.getSelectedHTML();
|
|
61
61
|
if (!html) {
|
|
62
|
-
return alert(
|
|
62
|
+
return alert(T `Please select text first to set color`);
|
|
63
63
|
}
|
|
64
64
|
this.handleCommand("foreColor", color);
|
|
65
65
|
};
|
|
@@ -151,7 +151,7 @@ class RichTextComponent extends react_1.default.Component {
|
|
|
151
151
|
// Don't lose focus
|
|
152
152
|
ev.preventDefault();
|
|
153
153
|
// Ask for url
|
|
154
|
-
const url = window.prompt(
|
|
154
|
+
const url = window.prompt(T `Enter URL to link to`);
|
|
155
155
|
if (url) {
|
|
156
156
|
document.execCommand("createLink", false, url);
|
|
157
157
|
}
|
|
@@ -204,16 +204,20 @@ class RichTextComponent extends react_1.default.Component {
|
|
|
204
204
|
react_1.default.createElement(DropdownPaletteItem_1.default, { key: "justify", items: [
|
|
205
205
|
{ label: react_1.default.createElement("span", null,
|
|
206
206
|
react_1.default.createElement("i", { className: "fas fa-align-left fa-fw" }),
|
|
207
|
-
"
|
|
207
|
+
" ",
|
|
208
|
+
T `Left`), value: "justifyLeft" },
|
|
208
209
|
{ label: react_1.default.createElement("span", null,
|
|
209
210
|
react_1.default.createElement("i", { className: "fas fa-align-center fa-fw" }),
|
|
210
|
-
"
|
|
211
|
+
" ",
|
|
212
|
+
T `Center`), value: "justifyCenter" },
|
|
211
213
|
{ label: react_1.default.createElement("span", null,
|
|
212
214
|
react_1.default.createElement("i", { className: "fas fa-align-right fa-fw" }),
|
|
213
|
-
"
|
|
215
|
+
" ",
|
|
216
|
+
T `Right`), value: "justifyRight" },
|
|
214
217
|
{ label: react_1.default.createElement("span", null,
|
|
215
218
|
react_1.default.createElement("i", { className: "fas fa-align-justify fa-fw" }),
|
|
216
|
-
"
|
|
219
|
+
" ",
|
|
220
|
+
T `Justify`), value: "justifyFull" },
|
|
217
221
|
], onSelect: (value) => this.handleCommand(value, null), position: schemeName === "over" ? "under" : "over", label: react_1.default.createElement("i", { className: "fas fa-align-left" }) }),
|
|
218
222
|
react_1.default.createElement("div", { key: "insertUnorderedList", className: "mwater-visualization-text-palette-item", onMouseDown: (ev) => this.handleCommand("insertUnorderedList", null, ev) },
|
|
219
223
|
react_1.default.createElement("i", { className: "fas fa-list-ul" })),
|
|
@@ -221,28 +225,28 @@ class RichTextComponent extends react_1.default.Component {
|
|
|
221
225
|
react_1.default.createElement("i", { className: "fas fa-list-ol" })),
|
|
222
226
|
this.props.includeHeadings && [
|
|
223
227
|
react_1.default.createElement(DropdownPaletteItem_1.default, { key: "paragraph", items: [
|
|
224
|
-
{ label:
|
|
225
|
-
{ label:
|
|
226
|
-
{ label:
|
|
227
|
-
{ label:
|
|
228
|
-
{ label:
|
|
229
|
-
{ label:
|
|
230
|
-
{ label:
|
|
231
|
-
{ label:
|
|
232
|
-
{ label:
|
|
233
|
-
{ label:
|
|
234
|
-
{ label:
|
|
235
|
-
{ label:
|
|
236
|
-
{ label:
|
|
237
|
-
{ label:
|
|
238
|
-
{ label:
|
|
239
|
-
{ label:
|
|
240
|
-
{ label:
|
|
241
|
-
{ label:
|
|
242
|
-
{ label:
|
|
243
|
-
{ label:
|
|
244
|
-
{ label:
|
|
245
|
-
{ label:
|
|
228
|
+
{ label: T `Heading 1`, value: "h1" },
|
|
229
|
+
{ label: T `Heading 2`, value: "h2" },
|
|
230
|
+
{ label: T `Extra Small`, value: "xsmall" },
|
|
231
|
+
{ label: T `Small`, value: "small" },
|
|
232
|
+
{ label: T `Normal`, value: "normal" },
|
|
233
|
+
{ label: T `Large`, value: "large" },
|
|
234
|
+
{ label: T `Extra Large`, value: "xlarge" },
|
|
235
|
+
{ label: T `6px`, value: "6px", more: true },
|
|
236
|
+
{ label: T `7px`, value: "7px", more: true },
|
|
237
|
+
{ label: T `8px`, value: "8px", more: true },
|
|
238
|
+
{ label: T `9px`, value: "9px", more: true },
|
|
239
|
+
{ label: T `10px`, value: "10px", more: true },
|
|
240
|
+
{ label: T `11px`, value: "11px", more: true },
|
|
241
|
+
{ label: T `12px`, value: "12px", more: true },
|
|
242
|
+
{ label: T `14px`, value: "14px", more: true },
|
|
243
|
+
{ label: T `16px`, value: "16px", more: true },
|
|
244
|
+
{ label: T `18px`, value: "18px", more: true },
|
|
245
|
+
{ label: T `20px`, value: "20px", more: true },
|
|
246
|
+
{ label: T `22px`, value: "22px", more: true },
|
|
247
|
+
{ label: T `24px`, value: "24px", more: true },
|
|
248
|
+
{ label: T `30px`, value: "30px", more: true },
|
|
249
|
+
{ label: T `36px`, value: "36px", more: true },
|
|
246
250
|
], onSelect: (tag) => {
|
|
247
251
|
if (tag.startsWith("h")) {
|
|
248
252
|
this.handleSetFontSize(tag, null);
|
|
@@ -276,7 +280,7 @@ class RichTextComponent extends react_1.default.Component {
|
|
|
276
280
|
if (this.props.onItemsChange != null) {
|
|
277
281
|
return (react_1.default.createElement("div", { key: "contents", style: this.props.style, className: this.props.className },
|
|
278
282
|
react_1.default.createElement(expressions_ui_1.ContentEditableComponent, { ref: this.refContentEditable, style: { outline: "none" }, html: this.createHtml(), onChange: this.handleChange, onClick: this.handleEditorClick, onFocus: this.handleFocus, onBlur: this.handleBlur }),
|
|
279
|
-
this.props.items?.[0] == null ? (react_1.default.createElement("div", { key: "placeholder", style: { color: "#DDD", position: "absolute", top: 0, left: 0, right: 0, pointerEvents: "none" } },
|
|
283
|
+
this.props.items?.[0] == null ? (react_1.default.createElement("div", { key: "placeholder", style: { color: "#DDD", position: "absolute", top: 0, left: 0, right: 0, pointerEvents: "none" } }, T `Click to Edit`)) : undefined));
|
|
280
284
|
}
|
|
281
285
|
else {
|
|
282
286
|
return (react_1.default.createElement("div", { key: "contents", style: this.props.style, className: this.props.className, dangerouslySetInnerHTML: { __html: this.createHtml() } }));
|