@mwater/visualization 5.1.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ColorComponent.d.ts +10 -11
- package/lib/ColorComponent.js +78 -29
- package/lib/ColorSchemeFactory.d.ts +13 -2
- package/lib/ColorSchemeFactory.js +7 -5
- package/lib/CustomColorsContext.d.ts +6 -0
- package/lib/CustomColorsContext.js +6 -0
- package/lib/FiltersDesignerComponent.d.ts +1 -4
- package/lib/FiltersDesignerComponent.js +2 -3
- package/lib/GlobalFilter.d.ts +13 -0
- package/lib/GlobalFilter.js +2 -0
- package/lib/LocaleContextInjector.d.ts +5 -11
- package/lib/LocaleContextInjector.js +4 -12
- package/lib/MWaterAddRelatedFormComponent.js +3 -3
- package/lib/MWaterAddRelatedIndicatorComponent.d.ts +1 -4
- package/lib/MWaterAddRelatedIndicatorComponent.js +6 -6
- package/lib/MWaterCompleteTableSelectComponent.d.ts +7 -25
- package/lib/MWaterCompleteTableSelectComponent.js +36 -36
- package/lib/MWaterContextComponent.d.ts +19 -9
- package/lib/MWaterContextComponent.js +38 -22
- package/lib/MWaterCustomTablesetListComponent.js +9 -3
- package/lib/MWaterGlobalFiltersComponent.d.ts +6 -5
- package/lib/MWaterGlobalFiltersComponent.js +4 -4
- package/lib/MWaterLoaderComponent.d.ts +15 -3
- package/lib/MWaterLoaderComponent.js +11 -2
- package/lib/MWaterTableSelectComponent.d.ts +1 -4
- package/lib/MWaterTableSelectComponent.js +10 -12
- package/lib/UIComponents.d.ts +2 -2
- package/lib/UIComponents.js +4 -12
- package/lib/axes/Axis.d.ts +20 -25
- package/lib/axes/AxisBuilder.d.ts +7 -4
- package/lib/axes/AxisBuilder.js +12 -8
- package/lib/axes/AxisComponent.d.ts +6 -9
- package/lib/axes/AxisComponent.js +1 -2
- package/lib/axes/ColorPaletteCollectionComponent.d.ts +5 -12
- package/lib/axes/ColorPaletteCollectionComponent.js +67 -36
- package/lib/dashboards/DashboardComponent.d.ts +4 -17
- package/lib/dashboards/DashboardComponent.js +20 -67
- package/lib/dashboards/DashboardDesign.d.ts +5 -20
- package/lib/dashboards/DashboardUpgrader.js +36 -1
- package/lib/dashboards/DashboardViewComponent.d.ts +5 -34
- package/lib/dashboards/DashboardViewComponent.js +112 -136
- package/lib/dashboards/FontStyleEditor.d.ts +8 -0
- package/lib/dashboards/FontStyleEditor.js +130 -0
- package/lib/dashboards/LayoutOptionsComponent.d.ts +0 -1
- package/lib/dashboards/LayoutOptionsComponent.js +209 -39
- package/lib/dashboards/ServerDashboardDataSource.d.ts +1 -2
- package/lib/dashboards/ServerDashboardDataSource.js +52 -33
- package/lib/dashboards/SettingsModalComponent.d.ts +4 -15
- package/lib/dashboards/SettingsModalComponent.js +24 -38
- package/lib/dashboards/WidgetComponent.d.ts +3 -3
- package/lib/dashboards/WidgetComponent.js +3 -6
- package/lib/dashboards/WidgetDataSourcePrioritizer.d.ts +20 -0
- package/lib/dashboards/WidgetDataSourcePrioritizer.js +72 -0
- package/lib/dashboards/layoutOptions.d.ts +83 -0
- package/lib/dashboards/layoutOptions.js +436 -10
- package/lib/datagrids/DatagridComponent.d.ts +2 -9
- package/lib/datagrids/DatagridDataSource.d.ts +3 -3
- package/lib/datagrids/DatagridDataSource.js +0 -14
- package/lib/datagrids/DatagridDesign.d.ts +7 -6
- package/lib/datagrids/DatagridDesignerComponent.d.ts +2 -93
- package/lib/datagrids/DatagridDesignerComponent.js +8 -6
- package/lib/datagrids/DatagridViewComponent.js +1 -1
- package/lib/datagrids/FindReplaceModalComponent.d.ts +4 -20
- package/lib/datagrids/FindReplaceModalComponent.js +27 -13
- package/lib/datagrids/ServerDatagridDataSource.d.ts +8 -7
- package/lib/datagrids/ServerDatagridDataSource.js +88 -36
- package/lib/demo.js +4 -4
- package/lib/index.css +5 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +0 -1
- package/lib/layouts/LayoutManager.d.ts +33 -29
- package/lib/layouts/LayoutManager.js +2 -8
- package/lib/layouts/blocks/BlocksDisplayComponent.d.ts +26 -56
- package/lib/layouts/blocks/BlocksDisplayComponent.js +122 -205
- package/lib/layouts/blocks/BlocksLayoutManager.d.ts +6 -22
- package/lib/layouts/blocks/BlocksLayoutManager.js +5 -14
- package/lib/layouts/blocks/HorizontalBlockComponent.d.ts +5 -4
- package/lib/layouts/blocks/HorizontalBlockComponent.js +5 -5
- package/lib/layouts/grid/GridLayoutManager.d.ts +2 -1
- package/lib/mWaterLoader.d.ts +2 -0
- package/lib/mWaterLoader.js +2 -1
- package/lib/maps/AddLayerComponent.d.ts +6 -8
- package/lib/maps/AddLayerComponent.js +6 -6
- package/lib/maps/BingLayer.js +10 -20
- package/lib/maps/BufferLayer.js +5 -2
- package/lib/maps/ChoroplethLayer.js +2 -1
- package/lib/maps/ClusterLayer.js +3 -1
- package/lib/maps/DirectMapDataSource.d.ts +5 -2
- package/lib/maps/DirectMapDataSource.js +2 -1
- package/lib/maps/EditPopupComponent.js +2 -1
- package/lib/maps/GridLayer.js +5 -3
- package/lib/maps/GridLayerDesigner.js +0 -1
- package/lib/maps/LayerSwitcherComponent.js +1 -1
- package/lib/maps/MapComponent.d.ts +3 -11
- package/lib/maps/MapComponent.js +3 -3
- package/lib/maps/MapDesign.d.ts +2 -13
- package/lib/maps/MapFiltersDesignerComponent.d.ts +0 -4
- package/lib/maps/MapFiltersDesignerComponent.js +4 -5
- package/lib/maps/MarkersLayer.js +30 -25
- package/lib/maps/RasterMapViewComponent.d.ts +3 -13
- package/lib/maps/RasterMapViewComponent.js +3 -3
- package/lib/maps/RegionSelectComponent.d.ts +2 -1
- package/lib/maps/ServerMapDataSource.d.ts +3 -4
- package/lib/maps/ServerMapDataSource.js +5 -5
- package/lib/maps/VectorMapViewComponent.js +2 -1
- package/lib/maps/mapSymbols.js +2 -0
- package/lib/maps/symbols/font-awesome/cloud-rain.png +0 -0
- package/lib/maps/vectorMaps.d.ts +1 -0
- package/lib/maps/vectorMaps.js +70 -56
- package/lib/quickfilter/QuickfilterCompiler.d.ts +1 -1
- package/lib/quickfilter/QuickfiltersComponent.d.ts +1 -4
- package/lib/quickfilter/QuickfiltersComponent.js +3 -3
- package/lib/richtext/DropdownPaletteItem.d.ts +32 -0
- package/lib/richtext/DropdownPaletteItem.js +82 -0
- package/lib/richtext/FontColorPaletteItem.d.ts +1 -5
- package/lib/richtext/FontColorPaletteItem.js +32 -27
- package/lib/richtext/ItemsHtmlConverter.js +12 -3
- package/lib/richtext/RichTextComponent.d.ts +26 -52
- package/lib/richtext/RichTextComponent.js +166 -128
- package/lib/valueFormatter.js +6 -1
- package/lib/wellknown.d.ts +5 -0
- package/lib/wellknown.js +288 -0
- package/lib/widgets/DropdownWidgetComponent.d.ts +8 -25
- package/lib/widgets/DropdownWidgetComponent.js +48 -25
- package/lib/widgets/IFrameWidgetComponent.d.ts +3 -11
- package/lib/widgets/ImageWidgetComponent.d.ts +8 -27
- package/lib/widgets/MapWidget.d.ts +4 -7
- package/lib/widgets/MapWidget.js +2 -1
- package/lib/widgets/MarkdownWidget.d.ts +2 -7
- package/lib/widgets/TOCWidget.d.ts +2 -9
- package/lib/widgets/TOCWidget.js +2 -1
- package/lib/widgets/Widget.d.ts +2 -0
- package/lib/widgets/WidgetDataSource.d.ts +3 -1
- package/lib/widgets/charts/Chart.d.ts +0 -1
- package/lib/widgets/charts/ChartViewComponent.d.ts +4 -0
- package/lib/widgets/charts/ChartViewComponent.js +11 -3
- package/lib/widgets/charts/ChartWidget.d.ts +1 -74
- package/lib/widgets/charts/ChartWidget.js +4 -183
- package/lib/widgets/charts/ChartWidgetComponent.d.ts +51 -0
- package/lib/widgets/charts/ChartWidgetComponent.js +167 -0
- package/lib/widgets/charts/calendar/CalendarChartViewComponent.d.ts +1 -4
- package/lib/widgets/charts/calendar/CalendarChartViewComponent.js +4 -4
- package/lib/widgets/charts/imagemosaic/ImagePopupComponent.d.ts +2 -7
- package/lib/widgets/charts/layered/LayeredChart.d.ts +5 -10
- package/lib/widgets/charts/layered/LayeredChart.js +6 -7
- package/lib/widgets/charts/layered/LayeredChartCompiler.d.ts +4 -2
- package/lib/widgets/charts/layered/LayeredChartCompiler.js +46 -32
- package/lib/widgets/charts/layered/LayeredChartDesign.d.ts +4 -0
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.d.ts +5 -31
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +21 -3
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.d.ts +1 -7
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +2 -1
- package/lib/widgets/charts/layered/LayeredChartViewComponent.d.ts +1 -4
- package/lib/widgets/charts/layered/LayeredChartViewComponent.js +89 -38
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.d.ts +5 -105
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.js +122 -166
- package/lib/widgets/charts/pivot/PivotChart.d.ts +6 -0
- package/lib/widgets/charts/pivot/PivotChart.js +47 -17
- package/lib/widgets/charts/pivot/PivotChartDesign.d.ts +11 -0
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +11 -7
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +1 -1
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.d.ts +2 -2
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.js +20 -36
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +0 -1
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.d.ts +23 -2
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.js +215 -181
- package/lib/widgets/charts/pivot/PivotChartUtils.d.ts +2 -2
- package/lib/widgets/charts/pivot/PivotChartViewComponent.d.ts +9 -47
- package/lib/widgets/charts/pivot/PivotChartViewComponent.js +20 -60
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +55 -58
- package/lib/widgets/charts/table/TableChart.js +8 -4
- package/lib/widgets/charts/table/TableChartDesignerComponent.js +3 -3
- package/lib/widgets/charts/table/TableChartViewComponent.js +30 -16
- package/lib/widgets/text/ExprInsertModalComponent.d.ts +2 -13
- package/lib/widgets/text/ExprUpdateModalComponent.d.ts +2 -13
- package/lib/widgets/text/TextComponent.d.ts +5 -12
- package/lib/widgets/text/TextComponent.js +19 -39
- package/lib/widgets/text/TextWidget.d.ts +2 -1
- package/lib/widgets/text/TextWidget.js +5 -1
- package/lib/widgets/text/TextWidgetComponent.d.ts +15 -3
- package/lib/widgets/text/TextWidgetComponent.js +76 -19
- package/lib/widgets/text/TextWidgetDesign.d.ts +16 -2
- package/lib/widgets/text/TextWidgetDesign.js +6 -0
- package/package.json +4 -4
- package/src/ColorComponent.tsx +177 -0
- package/src/ColorSchemeFactory.ts +12 -6
- package/src/CustomColorsContext.tsx +8 -0
- package/src/FiltersDesignerComponent.ts +3 -4
- package/src/GlobalFilter.ts +17 -0
- package/src/LocaleContextInjector.tsx +14 -13
- package/src/MWaterAddRelatedFormComponent.ts +3 -3
- package/src/MWaterAddRelatedIndicatorComponent.ts +6 -6
- package/src/MWaterCompleteTableSelectComponent.tsx +36 -36
- package/src/MWaterContextComponent.tsx +42 -33
- package/src/MWaterCustomTablesetListComponent.tsx +21 -3
- package/src/MWaterGlobalFiltersComponent.ts +8 -8
- package/src/MWaterLoaderComponent.ts +14 -4
- package/src/MWaterTableSelectComponent.tsx +11 -12
- package/src/{UIComponents.ts → UIComponents.tsx} +7 -15
- package/src/axes/Axis.ts +24 -25
- package/src/axes/AxisBuilder.ts +16 -13
- package/src/axes/AxisComponent.ts +3 -4
- package/src/axes/{ColorPaletteCollectionComponent.ts → ColorPaletteCollectionComponent.tsx} +87 -61
- package/src/dashboards/DashboardComponent.tsx +73 -147
- package/src/dashboards/DashboardDesign.ts +5 -25
- package/src/dashboards/DashboardUpgrader.ts +41 -1
- package/src/dashboards/DashboardViewComponent.tsx +313 -0
- package/src/dashboards/FontStyleEditor.tsx +166 -0
- package/src/dashboards/LayoutOptionsComponent.tsx +377 -71
- package/src/dashboards/ServerDashboardDataSource.ts +52 -33
- package/src/dashboards/SettingsModalComponent.tsx +170 -0
- package/src/dashboards/WidgetComponent.tsx +6 -12
- package/src/dashboards/WidgetDataSourcePrioritizer.ts +82 -0
- package/src/dashboards/layoutOptions.tsx +581 -0
- package/src/datagrids/DatagridDataSource.ts +6 -12
- package/src/datagrids/DatagridDesign.ts +8 -3
- package/src/datagrids/DatagridDesignerComponent.tsx +22 -18
- package/src/datagrids/DatagridViewComponent.ts +3 -3
- package/src/datagrids/ExprCellComponent.ts +0 -1
- package/src/datagrids/FindReplaceModalComponent.ts +39 -22
- package/src/datagrids/ServerDatagridDataSource.ts +107 -45
- package/src/demo.ts +4 -4
- package/src/index.css +5 -0
- package/src/index.ts +2 -1
- package/src/layouts/LayoutManager.ts +44 -42
- package/src/layouts/blocks/BlocksDisplayComponent.tsx +498 -0
- package/src/layouts/blocks/BlocksLayoutManager.ts +6 -15
- package/src/layouts/blocks/HorizontalBlockComponent.ts +9 -8
- package/src/mWaterLoader.ts +4 -1
- package/src/maps/AddLayerComponent.ts +9 -9
- package/src/maps/BingLayer.ts +16 -26
- package/src/maps/BufferLayer.ts +5 -2
- package/src/maps/ChoroplethLayer.ts +2 -1
- package/src/maps/ClusterLayer.ts +3 -1
- package/src/maps/DirectMapDataSource.ts +12 -3
- package/src/maps/EditPopupComponent.ts +2 -1
- package/src/maps/GridLayer.ts +5 -3
- package/src/maps/GridLayerDesigner.tsx +0 -1
- package/src/maps/LayerSwitcherComponent.tsx +1 -1
- package/src/maps/MapComponent.ts +3 -3
- package/src/maps/MapDesign.ts +2 -17
- package/src/maps/{MapFiltersDesignerComponent.ts → MapFiltersDesignerComponent.tsx} +25 -25
- package/src/maps/MarkersLayer.ts +38 -41
- package/src/maps/RasterMapViewComponent.ts +3 -3
- package/src/maps/ServerMapDataSource.ts +8 -8
- package/src/maps/VectorMapViewComponent.tsx +2 -2
- package/src/maps/mapSymbols.ts +2 -0
- package/src/maps/symbols/font-awesome/cloud-rain.png +0 -0
- package/src/maps/vectorMaps.tsx +88 -74
- package/src/quickfilter/QuickfilterCompiler.ts +1 -1
- package/src/quickfilter/QuickfiltersComponent.ts +3 -3
- package/src/richtext/DropdownPaletteItem.tsx +144 -0
- package/src/richtext/FontColorPaletteItem.tsx +160 -0
- package/src/richtext/ItemsHtmlConverter.ts +15 -5
- package/src/richtext/RichTextComponent.tsx +274 -232
- package/src/valueFormatter.ts +5 -1
- package/src/wellknown.ts +286 -0
- package/src/widgets/DropdownWidgetComponent.tsx +75 -0
- package/src/widgets/MapWidget.ts +5 -2
- package/src/widgets/TOCWidget.ts +2 -1
- package/src/widgets/Widget.ts +3 -0
- package/src/widgets/WidgetDataSource.ts +3 -1
- package/src/widgets/charts/Chart.ts +1 -1
- package/src/widgets/charts/ChartViewComponent.ts +16 -3
- package/src/widgets/charts/ChartWidget.ts +3 -275
- package/src/widgets/charts/ChartWidgetComponent.tsx +281 -0
- package/src/widgets/charts/calendar/CalendarChartViewComponent.tsx +4 -4
- package/src/widgets/charts/layered/LayeredChart.ts +4 -6
- package/src/widgets/charts/layered/LayeredChartCompiler.ts +80 -63
- package/src/widgets/charts/layered/LayeredChartDesign.ts +7 -1
- package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +43 -10
- package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +6 -6
- package/src/widgets/charts/layered/LayeredChartViewComponent.ts +140 -88
- package/src/widgets/charts/pivot/IntersectionDesignerComponent.tsx +305 -221
- package/src/widgets/charts/pivot/PivotChart.ts +56 -18
- package/src/widgets/charts/pivot/PivotChartDesign.ts +12 -0
- package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +4 -3
- package/src/widgets/charts/pivot/PivotChartLayoutBuilder.ts +39 -76
- package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +0 -1
- package/src/widgets/charts/pivot/PivotChartQueryBuilder.ts +230 -189
- package/src/widgets/charts/pivot/PivotChartUtils.ts +4 -4
- package/src/widgets/charts/pivot/{PivotChartViewComponent.ts → PivotChartViewComponent.tsx} +86 -89
- package/src/widgets/charts/table/TableChart.ts +8 -4
- package/src/widgets/charts/table/TableChartDesignerComponent.ts +4 -4
- package/src/widgets/charts/table/TableChartViewComponent.ts +32 -19
- package/src/widgets/text/TextComponent.tsx +47 -49
- package/src/widgets/text/TextWidget.ts +8 -3
- package/src/widgets/text/TextWidgetComponent.tsx +249 -0
- package/src/widgets/text/TextWidgetDesign.ts +26 -2
- package/src/ColorComponent.ts +0 -117
- package/src/dashboards/DashboardViewComponent.ts +0 -304
- package/src/dashboards/SettingsModalComponent.ts +0 -169
- package/src/dashboards/layoutOptions.ts +0 -40
- package/src/layout-styles.css +0 -263
- package/src/layouts/blocks/BlocksDisplayComponent.ts +0 -461
- package/src/layouts/grid/GridLayoutComponent.ts +0 -67
- package/src/layouts/grid/GridLayoutManager.ts +0 -185
- package/src/layouts/grid/LegoLayoutEngine.ts +0 -142
- package/src/layouts/grid/PaletteItemComponent.ts +0 -28
- package/src/layouts/grid/README.md +0 -14
- package/src/layouts/grid/WidgetContainerComponent.ts +0 -420
- package/src/richtext/FontColorPaletteItem.ts +0 -172
- package/src/richtext/FontSizePaletteItem.ts +0 -110
- package/src/widgets/DropdownWidgetComponent.ts +0 -78
- package/src/widgets/text/TextWidgetComponent.ts +0 -120
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import DashboardDataSource from './DashboardDataSource';
|
|
2
|
+
import { WidgetDataSource } from '../widgets/WidgetDataSource';
|
|
3
|
+
/**
|
|
4
|
+
* A class that prioritizes widget data sources based on the priority of the data source
|
|
5
|
+
* and ensures that only N requests is made at a time for a given widget data source.
|
|
6
|
+
*/
|
|
7
|
+
export declare class WidgetDataSourcePrioritizer {
|
|
8
|
+
private queue;
|
|
9
|
+
private dashboardDataSource;
|
|
10
|
+
/**
|
|
11
|
+
* Key is widget type + ":" + widget id + ":" + priority
|
|
12
|
+
*/
|
|
13
|
+
widgetDataSources: {
|
|
14
|
+
[key: string]: WidgetDataSource;
|
|
15
|
+
};
|
|
16
|
+
constructor(dashboardDataSource: DashboardDataSource, concurrency: number);
|
|
17
|
+
/** Get a widget data source with the given priority */
|
|
18
|
+
getWidgetDataSource(widgetType: string, widgetId: string, priority: number): WidgetDataSource;
|
|
19
|
+
cancel(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WidgetDataSourcePrioritizer = void 0;
|
|
7
|
+
const p_queue_1 = __importDefault(require("p-queue"));
|
|
8
|
+
/**
|
|
9
|
+
* A class that prioritizes widget data sources based on the priority of the data source
|
|
10
|
+
* and ensures that only N requests is made at a time for a given widget data source.
|
|
11
|
+
*/
|
|
12
|
+
class WidgetDataSourcePrioritizer {
|
|
13
|
+
queue;
|
|
14
|
+
dashboardDataSource;
|
|
15
|
+
/**
|
|
16
|
+
* Key is widget type + ":" + widget id + ":" + priority
|
|
17
|
+
*/
|
|
18
|
+
widgetDataSources;
|
|
19
|
+
constructor(dashboardDataSource, concurrency) {
|
|
20
|
+
this.dashboardDataSource = dashboardDataSource;
|
|
21
|
+
this.queue = new p_queue_1.default({ concurrency: concurrency });
|
|
22
|
+
this.widgetDataSources = {};
|
|
23
|
+
}
|
|
24
|
+
/** Get a widget data source with the given priority */
|
|
25
|
+
getWidgetDataSource(widgetType, widgetId, priority) {
|
|
26
|
+
let widgetDataSource = this.widgetDataSources[widgetType + ":" + widgetId + ":" + priority];
|
|
27
|
+
if (!widgetDataSource) {
|
|
28
|
+
const innerWidgetDataSource = this.dashboardDataSource.getWidgetDataSource(widgetType, widgetId);
|
|
29
|
+
widgetDataSource = {
|
|
30
|
+
getData: (design, filters, callback) => {
|
|
31
|
+
const task = () => new Promise((resolve, reject) => {
|
|
32
|
+
innerWidgetDataSource.getData(design, filters, (error, data) => {
|
|
33
|
+
if (error) {
|
|
34
|
+
callback(error);
|
|
35
|
+
reject(error);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
callback(null, data);
|
|
39
|
+
resolve(data);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
// Create an abort controller for this task
|
|
44
|
+
const taskAbortController = new AbortController();
|
|
45
|
+
// Queue the task and handle errors
|
|
46
|
+
this.queue.add(task, { priority: priority, signal: taskAbortController.signal }).catch((e) => {
|
|
47
|
+
console.log("Task failed", e);
|
|
48
|
+
callback(e);
|
|
49
|
+
});
|
|
50
|
+
return taskAbortController;
|
|
51
|
+
},
|
|
52
|
+
/** Get the url to download an image (by id from an image or imagelist column)
|
|
53
|
+
* Height, if specified, is minimum height needed. May return larger image */
|
|
54
|
+
getImageUrl: (imageId, height) => {
|
|
55
|
+
return innerWidgetDataSource.getImageUrl(imageId, height);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
if (innerWidgetDataSource.getMapDataSource) {
|
|
59
|
+
widgetDataSource.getMapDataSource = (design) => {
|
|
60
|
+
return innerWidgetDataSource.getMapDataSource(design);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
this.widgetDataSources[widgetType + ":" + widgetId + ":" + priority] = widgetDataSource;
|
|
64
|
+
}
|
|
65
|
+
return widgetDataSource;
|
|
66
|
+
}
|
|
67
|
+
cancel() {
|
|
68
|
+
// Clear the queue
|
|
69
|
+
this.queue.clear();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.WidgetDataSourcePrioritizer = WidgetDataSourcePrioritizer;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DashboardDesign } from "./DashboardDesign";
|
|
2
|
+
import React from "react";
|
|
2
3
|
export type DashboardTheme = "default" | "greybg" | "story";
|
|
3
4
|
/** Width buckets for dashboards */
|
|
4
5
|
export type WidthBucket = "sm" | "md" | "lg" | "xl";
|
|
@@ -13,7 +14,89 @@ export interface BlocksLayoutOptions {
|
|
|
13
14
|
maximumWidth: number | null;
|
|
14
15
|
/** Width at which to hide quickfilters. Null for never */
|
|
15
16
|
hideQuickfiltersWidth: number | null;
|
|
17
|
+
/** The padding around the entire dashboard */
|
|
18
|
+
outerPadding: number;
|
|
19
|
+
/** The background color of the dashboard */
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
/** Whether to collapse spacers on narrow screens */
|
|
22
|
+
collapseSpacers: boolean;
|
|
23
|
+
/** The font style for text widgets */
|
|
24
|
+
textWidgetFont: FontStyle;
|
|
25
|
+
/** The line height for text widgets */
|
|
26
|
+
textWidgetLineHeight: number | null;
|
|
27
|
+
/** The spacing between paragraphs in text widgets */
|
|
28
|
+
textWidgetParagraphSpacing: number;
|
|
29
|
+
/** The line height for text widgets */
|
|
30
|
+
textWidgetListLineHeight: number | null;
|
|
31
|
+
/** The margin top for H1 text widgets */
|
|
32
|
+
textWidgetH1MarginTop: number;
|
|
33
|
+
/** The font style for H1 text widgets */
|
|
34
|
+
textWidgetH1Font: FontStyle;
|
|
35
|
+
/** The margin top for H2 text widgets */
|
|
36
|
+
textWidgetH2MarginTop: number;
|
|
37
|
+
/** The font style for H2 text widgets */
|
|
38
|
+
textWidgetH2Font: FontStyle;
|
|
39
|
+
/** The font style for title widgets */
|
|
40
|
+
titleWidgetFont: FontStyle;
|
|
41
|
+
/** The margin around blocks */
|
|
42
|
+
blockMargin: Spacing;
|
|
43
|
+
/** The padding inside of blocks */
|
|
44
|
+
blockPadding: Spacing;
|
|
45
|
+
/** The border radius of blocks */
|
|
46
|
+
blockBorderRadius: number;
|
|
47
|
+
/** The background color of blocks */
|
|
48
|
+
blockBackgroundColor: string;
|
|
49
|
+
/** The font style for widget headers */
|
|
50
|
+
widgetHeaderFont: FontStyle;
|
|
51
|
+
/** The font style for widget footers */
|
|
52
|
+
widgetFooterFont: FontStyle;
|
|
53
|
+
/** The font style for charts */
|
|
54
|
+
chartFont: FontStyle;
|
|
55
|
+
/** The font style for tables */
|
|
56
|
+
tableFont: FontStyle;
|
|
57
|
+
/** The font style for pivot tables */
|
|
58
|
+
pivotTableFont: FontStyle;
|
|
59
|
+
/** Custom colors */
|
|
60
|
+
customColors: (string | null)[];
|
|
16
61
|
}
|
|
62
|
+
export interface Spacing {
|
|
63
|
+
top: number;
|
|
64
|
+
bottom: number;
|
|
65
|
+
left: number;
|
|
66
|
+
right: number;
|
|
67
|
+
}
|
|
68
|
+
export interface FontStyle {
|
|
69
|
+
size: number;
|
|
70
|
+
color: string;
|
|
71
|
+
family: string;
|
|
72
|
+
weight: string;
|
|
73
|
+
}
|
|
74
|
+
/** React context for block layout options */
|
|
75
|
+
export declare const BlocksLayoutOptionsContext: React.Context<BlocksLayoutOptions | null>;
|
|
17
76
|
/** Get default layout options for a theme */
|
|
18
77
|
export declare function getDefaultLayoutOptions(theme?: DashboardTheme | undefined): BlocksLayoutOptions;
|
|
78
|
+
/** Gets the current layout options for a design */
|
|
19
79
|
export declare function getLayoutOptions(design: DashboardDesign): BlocksLayoutOptions;
|
|
80
|
+
/**
|
|
81
|
+
* Injects the dashboard style into the child component. Also provides a context for layout options.
|
|
82
|
+
* This is to allow modals to reinject the layout options when they are opened.
|
|
83
|
+
*/
|
|
84
|
+
export declare function DashboardStyleWrapper(props: {
|
|
85
|
+
layoutOptions: BlocksLayoutOptions;
|
|
86
|
+
children: React.ReactNode;
|
|
87
|
+
style: React.CSSProperties;
|
|
88
|
+
}): React.JSX.Element;
|
|
89
|
+
/**
|
|
90
|
+
* Expands a font family to include fallbacks
|
|
91
|
+
* @param fontFamily The font family to expand
|
|
92
|
+
* @returns The expanded font family
|
|
93
|
+
*/
|
|
94
|
+
export declare function expandFontFamily(fontFamily: string): string;
|
|
95
|
+
/**
|
|
96
|
+
* Create a CSS style string from a LayoutOptions object
|
|
97
|
+
*
|
|
98
|
+
* @param scope The scope of the style (e.g. "#id_1234")
|
|
99
|
+
* @param layoutOptions The layout options
|
|
100
|
+
* @returns A CSS style string
|
|
101
|
+
*/
|
|
102
|
+
export declare function createDashboardStyles(scope: string, layoutOptions: BlocksLayoutOptions): string;
|
|
@@ -1,19 +1,445 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLayoutOptions = exports.getDefaultLayoutOptions = void 0;
|
|
6
|
+
exports.createDashboardStyles = exports.expandFontFamily = exports.DashboardStyleWrapper = exports.getLayoutOptions = exports.getDefaultLayoutOptions = exports.BlocksLayoutOptionsContext = void 0;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const react_2 = __importDefault(require("react"));
|
|
9
|
+
const CustomColorsContext_1 = require("../CustomColorsContext");
|
|
10
|
+
/** React context for block layout options */
|
|
11
|
+
exports.BlocksLayoutOptionsContext = (0, react_1.createContext)(null);
|
|
4
12
|
/** Get default layout options for a theme */
|
|
5
13
|
function getDefaultLayoutOptions(theme) {
|
|
6
|
-
theme
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
if (!theme || theme === "default") {
|
|
15
|
+
return defaultTheme;
|
|
16
|
+
}
|
|
17
|
+
if (theme === "greybg") {
|
|
18
|
+
return greybgTheme;
|
|
19
|
+
}
|
|
20
|
+
if (theme === "story") {
|
|
21
|
+
return storyTheme;
|
|
22
|
+
}
|
|
23
|
+
throw new Error(`Unknown theme: ${theme}`);
|
|
14
24
|
}
|
|
15
25
|
exports.getDefaultLayoutOptions = getDefaultLayoutOptions;
|
|
26
|
+
/** Gets the current layout options for a design */
|
|
16
27
|
function getLayoutOptions(design) {
|
|
17
|
-
|
|
28
|
+
if (!design.layoutOptions) {
|
|
29
|
+
return getDefaultLayoutOptions(design.style);
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
...getDefaultLayoutOptions(design.style),
|
|
33
|
+
...design.layoutOptions
|
|
34
|
+
};
|
|
18
35
|
}
|
|
19
36
|
exports.getLayoutOptions = getLayoutOptions;
|
|
37
|
+
/**
|
|
38
|
+
* Injects the dashboard style into the child component. Also provides a context for layout options.
|
|
39
|
+
* This is to allow modals to reinject the layout options when they are opened.
|
|
40
|
+
*/
|
|
41
|
+
function DashboardStyleWrapper(props) {
|
|
42
|
+
const scope = (0, react_1.useMemo)(() => {
|
|
43
|
+
return `id_${Math.random().toString(36).substring(7)}`;
|
|
44
|
+
}, []);
|
|
45
|
+
// Get outer custom colors from context and merge with layout options
|
|
46
|
+
const outerCustomColors = (0, react_1.useContext)(CustomColorsContext_1.CustomColorsContext) || { customColors: [] };
|
|
47
|
+
const mergedCustomColors = outerCustomColors.customColors.map((outerColor, index) => props.layoutOptions.customColors[index] || outerColor).concat(props.layoutOptions.customColors.slice(outerCustomColors.customColors.length));
|
|
48
|
+
return react_2.default.createElement("div", { id: scope, style: props.style },
|
|
49
|
+
react_2.default.createElement("style", { dangerouslySetInnerHTML: { __html: createDashboardStyles("#" + scope, props.layoutOptions) } }),
|
|
50
|
+
react_2.default.createElement(CustomColorsContext_1.CustomColorsContext.Provider, { value: { customColors: mergedCustomColors } },
|
|
51
|
+
react_2.default.createElement(exports.BlocksLayoutOptionsContext.Provider, { value: props.layoutOptions }, props.children)));
|
|
52
|
+
}
|
|
53
|
+
exports.DashboardStyleWrapper = DashboardStyleWrapper;
|
|
54
|
+
/** Bootstrap default font color */
|
|
55
|
+
const defaultFontColor = "#212529";
|
|
56
|
+
const defaultTheme = {
|
|
57
|
+
outerPadding: 30,
|
|
58
|
+
backgroundColor: "white",
|
|
59
|
+
collapseSpacers: false,
|
|
60
|
+
textWidgetFont: {
|
|
61
|
+
size: 15,
|
|
62
|
+
color: defaultFontColor,
|
|
63
|
+
family: "Helvetica Neue",
|
|
64
|
+
weight: "400"
|
|
65
|
+
},
|
|
66
|
+
textWidgetLineHeight: null,
|
|
67
|
+
textWidgetParagraphSpacing: 5,
|
|
68
|
+
textWidgetH1MarginTop: 10,
|
|
69
|
+
textWidgetH1Font: {
|
|
70
|
+
size: 19,
|
|
71
|
+
color: defaultFontColor,
|
|
72
|
+
family: "Helvetica Neue",
|
|
73
|
+
weight: "400"
|
|
74
|
+
},
|
|
75
|
+
textWidgetH2MarginTop: 8,
|
|
76
|
+
textWidgetH2Font: {
|
|
77
|
+
size: 17,
|
|
78
|
+
color: defaultFontColor,
|
|
79
|
+
family: "Helvetica Neue",
|
|
80
|
+
weight: "400"
|
|
81
|
+
},
|
|
82
|
+
titleWidgetFont: {
|
|
83
|
+
size: 25,
|
|
84
|
+
color: defaultFontColor,
|
|
85
|
+
family: "Helvetica Neue",
|
|
86
|
+
weight: "400"
|
|
87
|
+
},
|
|
88
|
+
textWidgetListLineHeight: null,
|
|
89
|
+
blockMargin: {
|
|
90
|
+
top: 0,
|
|
91
|
+
bottom: 0,
|
|
92
|
+
left: 0,
|
|
93
|
+
right: 0,
|
|
94
|
+
},
|
|
95
|
+
blockPadding: {
|
|
96
|
+
top: 0,
|
|
97
|
+
bottom: 15,
|
|
98
|
+
left: 15,
|
|
99
|
+
right: 15,
|
|
100
|
+
},
|
|
101
|
+
blockBorderRadius: 5,
|
|
102
|
+
blockBackgroundColor: "white",
|
|
103
|
+
widgetHeaderFont: {
|
|
104
|
+
size: 14,
|
|
105
|
+
color: defaultFontColor,
|
|
106
|
+
family: "Helvetica Neue",
|
|
107
|
+
weight: "600"
|
|
108
|
+
},
|
|
109
|
+
widgetFooterFont: {
|
|
110
|
+
size: 13,
|
|
111
|
+
color: defaultFontColor,
|
|
112
|
+
family: "Helvetica Neue",
|
|
113
|
+
weight: "400"
|
|
114
|
+
},
|
|
115
|
+
chartFont: {
|
|
116
|
+
size: 10,
|
|
117
|
+
color: defaultFontColor,
|
|
118
|
+
family: "Helvetica Neue",
|
|
119
|
+
weight: "400"
|
|
120
|
+
},
|
|
121
|
+
tableFont: {
|
|
122
|
+
size: 13,
|
|
123
|
+
color: defaultFontColor,
|
|
124
|
+
family: "Helvetica Neue",
|
|
125
|
+
weight: "400"
|
|
126
|
+
},
|
|
127
|
+
pivotTableFont: {
|
|
128
|
+
size: 14,
|
|
129
|
+
color: defaultFontColor,
|
|
130
|
+
family: "Helvetica Neue",
|
|
131
|
+
weight: "400"
|
|
132
|
+
},
|
|
133
|
+
collapseColumnsWidth: 600,
|
|
134
|
+
minimumWidth: 600,
|
|
135
|
+
belowMinimumWidth: "scale",
|
|
136
|
+
maximumWidth: 1600,
|
|
137
|
+
hideQuickfiltersWidth: 600,
|
|
138
|
+
customColors: []
|
|
139
|
+
};
|
|
140
|
+
const greybgTheme = {
|
|
141
|
+
...defaultTheme,
|
|
142
|
+
outerPadding: 10,
|
|
143
|
+
backgroundColor: "#ddd",
|
|
144
|
+
blockMargin: {
|
|
145
|
+
top: 9,
|
|
146
|
+
bottom: 9,
|
|
147
|
+
left: 9,
|
|
148
|
+
right: 9,
|
|
149
|
+
},
|
|
150
|
+
blockPadding: {
|
|
151
|
+
top: 8,
|
|
152
|
+
bottom: 8,
|
|
153
|
+
left: 8,
|
|
154
|
+
right: 8,
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
const storyTheme = {
|
|
158
|
+
...defaultTheme,
|
|
159
|
+
textWidgetFont: {
|
|
160
|
+
size: 18,
|
|
161
|
+
color: "#333",
|
|
162
|
+
family: "Georgia",
|
|
163
|
+
weight: "400"
|
|
164
|
+
},
|
|
165
|
+
textWidgetLineHeight: 33,
|
|
166
|
+
textWidgetParagraphSpacing: 8,
|
|
167
|
+
textWidgetListLineHeight: 28,
|
|
168
|
+
textWidgetH1MarginTop: 40,
|
|
169
|
+
textWidgetH1Font: {
|
|
170
|
+
size: 32,
|
|
171
|
+
color: "black",
|
|
172
|
+
family: "Lucida Grande",
|
|
173
|
+
weight: "700"
|
|
174
|
+
},
|
|
175
|
+
textWidgetH2MarginTop: 30,
|
|
176
|
+
textWidgetH2Font: {
|
|
177
|
+
size: 24,
|
|
178
|
+
color: "black",
|
|
179
|
+
family: "Lucida Grande",
|
|
180
|
+
weight: "700"
|
|
181
|
+
},
|
|
182
|
+
titleWidgetFont: {
|
|
183
|
+
size: 38,
|
|
184
|
+
color: "black",
|
|
185
|
+
family: "Lucida Grande",
|
|
186
|
+
weight: "700"
|
|
187
|
+
},
|
|
188
|
+
minimumWidth: 400,
|
|
189
|
+
maximumWidth: 1000,
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Expands a font family to include fallbacks
|
|
193
|
+
* @param fontFamily The font family to expand
|
|
194
|
+
* @returns The expanded font family
|
|
195
|
+
*/
|
|
196
|
+
function expandFontFamily(fontFamily) {
|
|
197
|
+
// Handle legacy font families
|
|
198
|
+
if (fontFamily === "Helvetica Neue") {
|
|
199
|
+
return `"${fontFamily}", Helvetica, Arial, sans-serif`;
|
|
200
|
+
}
|
|
201
|
+
if (fontFamily === "Lucida Grande") {
|
|
202
|
+
return `"${fontFamily}", "Lucida Sans Unicode", "Lucida Sans", Geneva, Arial, sans-serif`;
|
|
203
|
+
}
|
|
204
|
+
if (fontFamily === "Georgia") {
|
|
205
|
+
return `"${fontFamily}", Cambria, "Times New Roman", Times, serif`;
|
|
206
|
+
}
|
|
207
|
+
// Add fallback fonts
|
|
208
|
+
if (fontFamily === "Merriweather") {
|
|
209
|
+
return `"${fontFamily}", serif`;
|
|
210
|
+
}
|
|
211
|
+
return `"${fontFamily}", sans-serif`;
|
|
212
|
+
}
|
|
213
|
+
exports.expandFontFamily = expandFontFamily;
|
|
214
|
+
/**
|
|
215
|
+
* Create a CSS style string from a LayoutOptions object
|
|
216
|
+
*
|
|
217
|
+
* @param scope The scope of the style (e.g. "#id_1234")
|
|
218
|
+
* @param layoutOptions The layout options
|
|
219
|
+
* @returns A CSS style string
|
|
220
|
+
*/
|
|
221
|
+
function createDashboardStyles(scope, layoutOptions) {
|
|
222
|
+
return `
|
|
223
|
+
${scope} .mwater-visualization-block-parent-outer {
|
|
224
|
+
padding: ${layoutOptions.outerPadding}px;
|
|
225
|
+
background-color: ${layoutOptions.backgroundColor};
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
${scope} .mwater-visualization-block-parent-inner {
|
|
229
|
+
height: 100%;
|
|
230
|
+
margin-left: auto;
|
|
231
|
+
margin-right: auto;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
@media print {
|
|
235
|
+
/* Add a border on printing */
|
|
236
|
+
${scope} .mwater-visualization-block-parent-outer .mwater-visualization-block {
|
|
237
|
+
border: solid 1px ${layoutOptions.backgroundColor};
|
|
238
|
+
}
|
|
239
|
+
${scope} .mwater-visualization-block-parent-outer .mwater-visualization-block.mwater-visualization-block-spacer {
|
|
240
|
+
border: solid 1px transparent;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* --- Text widget styles --- */
|
|
245
|
+
${scope} .mwater-visualization-text-widget-style-default {
|
|
246
|
+
font-size: ${layoutOptions.textWidgetFont.size}px;
|
|
247
|
+
font-weight: ${layoutOptions.textWidgetFont.weight};
|
|
248
|
+
color: ${layoutOptions.textWidgetFont.color};
|
|
249
|
+
line-height: ${layoutOptions.textWidgetLineHeight ? `${layoutOptions.textWidgetLineHeight}px` : "inherit"};
|
|
250
|
+
font-family: ${expandFontFamily(layoutOptions.textWidgetFont.family)};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
${scope} .mwater-visualization-text-widget-style-default div:not(:first-child) {
|
|
254
|
+
margin-top: ${layoutOptions.textWidgetParagraphSpacing}px;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
${scope} .mwater-visualization-text-widget-style-default ul {
|
|
258
|
+
line-height: ${layoutOptions.textWidgetListLineHeight ? `${layoutOptions.textWidgetListLineHeight}px` : "inherit"};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
${scope} .mwater-visualization-text-widget-style-default h1:not(:first-child) {
|
|
262
|
+
margin-top: ${layoutOptions.textWidgetH1MarginTop}px;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
${scope} .mwater-visualization-text-widget-style-default h1 {
|
|
266
|
+
line-height: 1.2;
|
|
267
|
+
margin: 0px;
|
|
268
|
+
font-size: ${layoutOptions.textWidgetH1Font.size}px;
|
|
269
|
+
color: ${layoutOptions.textWidgetH1Font.color};
|
|
270
|
+
font-family: ${expandFontFamily(layoutOptions.textWidgetH1Font.family)};
|
|
271
|
+
font-weight: ${layoutOptions.textWidgetH1Font.weight};
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
${scope} .mwater-visualization-text-widget-style-default h2:not(:first-child) {
|
|
275
|
+
margin-top: ${layoutOptions.textWidgetH2MarginTop}px;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
${scope} .mwater-visualization-text-widget-style-default h2 {
|
|
279
|
+
margin: 0px;
|
|
280
|
+
line-height: 1.2;
|
|
281
|
+
|
|
282
|
+
font-size: ${layoutOptions.textWidgetH2Font.size}px;
|
|
283
|
+
font-family: ${expandFontFamily(layoutOptions.textWidgetH2Font.family)};
|
|
284
|
+
font-weight: ${layoutOptions.textWidgetH2Font.weight};
|
|
285
|
+
color: ${layoutOptions.textWidgetH2Font.color};
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/* NOTE: h3 is deprecated */
|
|
289
|
+
${scope} .mwater-visualization-text-widget-style-default h3:not(:first-child) {
|
|
290
|
+
margin-top: 5px;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
${scope} .mwater-visualization-text-widget-style-default h3 {
|
|
294
|
+
font-size: 15px;
|
|
295
|
+
margin: 0px;
|
|
296
|
+
font-weight: bold;
|
|
297
|
+
font-family: inherit;
|
|
298
|
+
line-height: 1.2;
|
|
299
|
+
color: inherit;
|
|
300
|
+
|
|
301
|
+
/* Story: TODO REMOVE
|
|
302
|
+
font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Arial, sans-serif;
|
|
303
|
+
font-size: 20px;
|
|
304
|
+
font-weight: bold;
|
|
305
|
+
margin-top: 20px;
|
|
306
|
+
color: black;
|
|
307
|
+
*/
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/* --- Title block styles --- */
|
|
311
|
+
${scope} .mwater-visualization-text-widget-style-title {
|
|
312
|
+
font-size: ${layoutOptions.titleWidgetFont.size}px;
|
|
313
|
+
color: ${layoutOptions.titleWidgetFont.color};
|
|
314
|
+
font-family: ${expandFontFamily(layoutOptions.titleWidgetFont.family)};
|
|
315
|
+
font-weight: ${layoutOptions.titleWidgetFont.weight};
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/* --- InlineExprEditorComponent --- */
|
|
319
|
+
${scope} .mwater-visualization-text-widget-expr {
|
|
320
|
+
cursor: pointer;
|
|
321
|
+
border-radius: 2px;
|
|
322
|
+
padding-left: 2px;
|
|
323
|
+
padding-right: 2px;
|
|
324
|
+
background-color: rgba(212, 235, 255, 0.8);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/* --- Block styles --- */
|
|
328
|
+
${scope} .mwater-visualization-block-parent-outer .mwater-visualization-block {
|
|
329
|
+
margin: ${layoutOptions.blockMargin.top}px ${layoutOptions.blockMargin.right}px ${layoutOptions.blockMargin.bottom}px ${layoutOptions.blockMargin.left}px;
|
|
330
|
+
padding: ${layoutOptions.blockPadding.top}px ${layoutOptions.blockPadding.right}px ${layoutOptions.blockPadding.bottom}px ${layoutOptions.blockPadding.left}px;
|
|
331
|
+
border-radius: ${layoutOptions.blockBorderRadius}px;
|
|
332
|
+
background-color: ${layoutOptions.blockBackgroundColor};
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/* Hide spacers */
|
|
336
|
+
${scope} .mwater-visualization-block-parent-outer .mwater-visualization-block-spacer {
|
|
337
|
+
background-color: ${layoutOptions.backgroundColor};
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
${layoutOptions.collapseSpacers ? `
|
|
341
|
+
/* On narrow screens, optionally collapse spacers and make all horizontal blocks take up the whole width */
|
|
342
|
+
@media only screen and (max-width: 1000px) {
|
|
343
|
+
/* Fill screen when small */
|
|
344
|
+
${scope} .mwater-visualization-block-parent-outer.mwater-visualization-block-viewing
|
|
345
|
+
.mwater-visualization-horizontal-block-item {
|
|
346
|
+
width: 100% !important;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/* Hide spacers when small */
|
|
350
|
+
${scope} .mwater-visualization-block-parent-outer.mwater-visualization-block-viewing .mwater-visualization-block-spacer {
|
|
351
|
+
display: none;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
` : ""}
|
|
355
|
+
|
|
356
|
+
/* --- TextWidgets inside of other widgets --- */
|
|
357
|
+
${scope} .mwater-visualization-text-widget-style-header {
|
|
358
|
+
text-align: center;
|
|
359
|
+
font-size: ${layoutOptions.widgetHeaderFont.size}px;
|
|
360
|
+
font-weight: ${layoutOptions.widgetHeaderFont.weight};
|
|
361
|
+
font-family: ${expandFontFamily(layoutOptions.widgetHeaderFont.family)};
|
|
362
|
+
color: ${layoutOptions.widgetHeaderFont.color};
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
${scope} .mwater-visualization-text-widget-style-footer {
|
|
366
|
+
text-align: center;
|
|
367
|
+
font-size: ${layoutOptions.widgetFooterFont.size}px;
|
|
368
|
+
font-weight: ${layoutOptions.widgetFooterFont.weight};
|
|
369
|
+
font-family: ${expandFontFamily(layoutOptions.widgetFooterFont.family)};
|
|
370
|
+
color: ${layoutOptions.widgetFooterFont.color};
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/** --- Chart styles --- */
|
|
374
|
+
${scope} .bb text {
|
|
375
|
+
font-size: ${layoutOptions.chartFont.size}px;
|
|
376
|
+
fill: ${layoutOptions.chartFont.color};
|
|
377
|
+
font-family: ${expandFontFamily(layoutOptions.chartFont.family)};
|
|
378
|
+
font-weight: ${layoutOptions.chartFont.weight};
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/* --- Table styles --- */
|
|
382
|
+
${scope} .mwater-visualization-table {
|
|
383
|
+
font-size: ${layoutOptions.tableFont.size}px;
|
|
384
|
+
color: ${layoutOptions.tableFont.color};
|
|
385
|
+
font-family: ${expandFontFamily(layoutOptions.tableFont.family)};
|
|
386
|
+
font-weight: ${layoutOptions.tableFont.weight};
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
${scope} .mwater-visualization-table > thead > tr > th {
|
|
390
|
+
background-color: ${layoutOptions.blockBackgroundColor};
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/* --- Pivot Table styles --- */
|
|
394
|
+
${scope} .pivot-chart-table {
|
|
395
|
+
font-size: ${layoutOptions.pivotTableFont.size}px;
|
|
396
|
+
color: ${layoutOptions.pivotTableFont.color};
|
|
397
|
+
font-family: ${expandFontFamily(layoutOptions.pivotTableFont.family)};
|
|
398
|
+
font-weight: ${layoutOptions.pivotTableFont.weight};
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
${scope} .pivot-chart-table .cell {
|
|
402
|
+
padding: 5px;
|
|
403
|
+
vertical-align: top;
|
|
404
|
+
background-color: ${layoutOptions.blockBackgroundColor};
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/* --- Placeholders --- */
|
|
408
|
+
${scope} .mwater-visualization-widget-placeholder {
|
|
409
|
+
position: absolute;
|
|
410
|
+
bottom: 0;
|
|
411
|
+
left: 0px;
|
|
412
|
+
right: 0px;
|
|
413
|
+
text-align: center;
|
|
414
|
+
top: 0;
|
|
415
|
+
cursor: pointer;
|
|
416
|
+
background: #f8f8f8;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
${scope} .mwater-visualization-widget-placeholder .fa,
|
|
420
|
+
${scope} .mwater-visualization-widget-placeholder .glyphicon {
|
|
421
|
+
position: absolute;
|
|
422
|
+
top: 50%;
|
|
423
|
+
left: 50%;
|
|
424
|
+
transform: translate(-50%, -50%);
|
|
425
|
+
color: #e0e0e0;
|
|
426
|
+
font-size: 60px;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
${scope} .mwater-visualization-widget-placeholder:hover .fa,
|
|
430
|
+
${scope} .mwater-visualization-widget-placeholder:hover .glyphicon {
|
|
431
|
+
color: #c0c0c0;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
${scope} .mwater-visualization-widget-placeholder-message {
|
|
435
|
+
color: #666;
|
|
436
|
+
position: absolute;
|
|
437
|
+
bottom: 10px;
|
|
438
|
+
left: 0px;
|
|
439
|
+
right: 0px;
|
|
440
|
+
font-size: 11px;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
`;
|
|
444
|
+
}
|
|
445
|
+
exports.createDashboardStyles = createDashboardStyles;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
|
+
import ActionCancelModalComponent from "@mwater/react-library/lib/ActionCancelModalComponent";
|
|
2
3
|
import { DataSource, Expr, Schema } from "@mwater/expressions";
|
|
3
4
|
import DatagridViewComponent, { RowUpdate } from "./DatagridViewComponent";
|
|
4
5
|
import FindReplaceModalComponent from "./FindReplaceModalComponent";
|
|
@@ -115,14 +116,6 @@ declare class DatagridEditorComponent extends React.Component<DatagridEditorComp
|
|
|
115
116
|
design: DatagridDesign;
|
|
116
117
|
}> {
|
|
117
118
|
constructor(props: DatagridEditorComponentProps);
|
|
118
|
-
render(): React.CElement<
|
|
119
|
-
onAction: () => void;
|
|
120
|
-
onCancel: () => void;
|
|
121
|
-
size: string;
|
|
122
|
-
}, React.Component<{
|
|
123
|
-
onAction: () => void;
|
|
124
|
-
onCancel: () => void;
|
|
125
|
-
size: string;
|
|
126
|
-
}, any, any>>;
|
|
119
|
+
render(): React.CElement<import("@mwater/react-library/lib/ActionCancelModalComponent").ActionCancelModalComponentProps, ActionCancelModalComponent>;
|
|
127
120
|
}
|
|
128
121
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Row } from "@mwater/expressions";
|
|
2
2
|
import { DatagridDesign, JsonQLFilter } from "..";
|
|
3
3
|
import { QuickfiltersDataSource } from "../quickfilter/QuickfiltersDataSource";
|
|
4
|
-
export default
|
|
4
|
+
export default interface DatagridDataSource {
|
|
5
5
|
/** Gets the rows specified */
|
|
6
|
-
getRows(design: DatagridDesign, offset: number, limit: number, filters: JsonQLFilter[] | undefined, callback: (error: any, rows
|
|
7
|
-
countRows(design: DatagridDesign, filters: JsonQLFilter[] | undefined, callback: (error: any, numRows
|
|
6
|
+
getRows(design: DatagridDesign, offset: number, limit: number, filters: JsonQLFilter[] | undefined, callback: (error: any, rows?: Row[]) => void): void;
|
|
7
|
+
countRows(design: DatagridDesign, filters: JsonQLFilter[] | undefined, callback: (error: any, numRows?: number) => void): void;
|
|
8
8
|
/** Gets the quickfilters data source */
|
|
9
9
|
getQuickfiltersDataSource(): QuickfiltersDataSource;
|
|
10
10
|
}
|
|
@@ -1,16 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class DatagridDataSource {
|
|
4
|
-
/** Gets the rows specified */
|
|
5
|
-
getRows(design, offset, limit, filters, callback) {
|
|
6
|
-
throw new Error("Not implemented");
|
|
7
|
-
}
|
|
8
|
-
countRows(design, filters, callback) {
|
|
9
|
-
throw new Error("Not implemented");
|
|
10
|
-
}
|
|
11
|
-
/** Gets the quickfilters data source */
|
|
12
|
-
getQuickfiltersDataSource() {
|
|
13
|
-
throw new Error("Not implemented");
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.default = DatagridDataSource;
|