@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
|
@@ -18,6 +18,7 @@ const QuickfiltersComponent_1 = __importDefault(require("../quickfilter/Quickfil
|
|
|
18
18
|
const QuickfilterCompiler_1 = __importDefault(require("../quickfilter/QuickfilterCompiler"));
|
|
19
19
|
const FindReplaceModalComponent_1 = __importDefault(require("./FindReplaceModalComponent"));
|
|
20
20
|
const d3_format_1 = require("d3-format");
|
|
21
|
+
const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
21
22
|
// Datagrid with decorations
|
|
22
23
|
// See README.md for description of datagrid format
|
|
23
24
|
// Design should be cleaned already before being passed in (see DatagridUtils)
|
|
@@ -28,9 +29,9 @@ class DatagridComponent extends react_1.default.Component {
|
|
|
28
29
|
constructor(props) {
|
|
29
30
|
super(props);
|
|
30
31
|
this.state = {
|
|
31
|
-
editingDesign: false,
|
|
32
|
-
cellEditingEnabled: false,
|
|
33
|
-
quickfiltersHeight: null,
|
|
32
|
+
editingDesign: false, // is design being edited
|
|
33
|
+
cellEditingEnabled: false, // True if cells can be edited directly
|
|
34
|
+
quickfiltersHeight: null, // Height of quickfilters
|
|
34
35
|
quickfiltersValues: null,
|
|
35
36
|
refreshKey: 1
|
|
36
37
|
};
|
|
@@ -58,7 +59,7 @@ class DatagridComponent extends react_1.default.Component {
|
|
|
58
59
|
this.props.datagridDataSource.countRows(this.props.design, filters, (error, numRows) => {
|
|
59
60
|
if (error) {
|
|
60
61
|
console.error(error);
|
|
61
|
-
alert(T
|
|
62
|
+
alert(T `Error loading data`);
|
|
62
63
|
return;
|
|
63
64
|
}
|
|
64
65
|
console.log(numRows);
|
|
@@ -93,7 +94,7 @@ class DatagridComponent extends react_1.default.Component {
|
|
|
93
94
|
return this.setState({ cellEditingEnabled: false });
|
|
94
95
|
}
|
|
95
96
|
else {
|
|
96
|
-
if (confirm(T
|
|
97
|
+
if (confirm(T `Turn on cell editing? This will allow you to edit the live data and is an advanced feature.`)) {
|
|
97
98
|
return this.setState({ cellEditingEnabled: true });
|
|
98
99
|
}
|
|
99
100
|
}
|
|
@@ -157,7 +158,7 @@ class DatagridComponent extends react_1.default.Component {
|
|
|
157
158
|
const label = [
|
|
158
159
|
R("i", { className: this.state.cellEditingEnabled ? "fa fa-fw fa-check-square" : "fa fa-fw fa-square-o" }),
|
|
159
160
|
" ",
|
|
160
|
-
T
|
|
161
|
+
T `Cell Editing`
|
|
161
162
|
];
|
|
162
163
|
return R("a", {
|
|
163
164
|
key: "cell-edit",
|
|
@@ -173,7 +174,7 @@ class DatagridComponent extends react_1.default.Component {
|
|
|
173
174
|
type: "button",
|
|
174
175
|
className: "btn btn-primary",
|
|
175
176
|
onClick: this.handleEdit
|
|
176
|
-
}, R("span", { className: "fas fa-cog" }), " ", T
|
|
177
|
+
}, R("span", { className: "fas fa-cog" }), " ", T `Settings`);
|
|
177
178
|
}
|
|
178
179
|
renderFindReplace() {
|
|
179
180
|
if (!this.state.cellEditingEnabled) {
|
|
@@ -183,10 +184,10 @@ class DatagridComponent extends react_1.default.Component {
|
|
|
183
184
|
key: "findreplace",
|
|
184
185
|
className: "btn btn-link btn-sm",
|
|
185
186
|
onClick: () => this.findReplaceModal.show()
|
|
186
|
-
}, T
|
|
187
|
+
}, T `Find/Replace`);
|
|
187
188
|
}
|
|
188
189
|
renderTitleBar() {
|
|
189
|
-
return R("div", { style: { position: "absolute", top: 0, left: 0, right: 0, height: 40, padding: 4 } }, R("div", { style: { float: "right" } }, this.props.design.showNumRows && this.state.numRows ? R("small", { className: 'text-muted text-sm' }, `${(0, d3_format_1.format)(',')(this.state.numRows)} rows`) : undefined, this.renderFindReplace(), this.renderCellEdit(), this.renderEditButton(), R("a", { key: "refresh", className: "btn btn-link btn-sm", onClick: this.handleRefreshData }, R("span", { className: "fas fa-sync" }), R("span", { className: "hide-600px" },
|
|
190
|
+
return R("div", { style: { position: "absolute", top: 0, left: 0, right: 0, height: 40, padding: 4 } }, R("div", { style: { float: "right" } }, this.props.design.showNumRows && this.state.numRows ? R("small", { className: 'text-muted text-sm' }, `${(0, d3_format_1.format)(',')(this.state.numRows)} rows`) : undefined, this.renderFindReplace(), this.renderCellEdit(), this.renderEditButton(), R("a", { key: "refresh", className: "btn btn-link btn-sm", onClick: this.handleRefreshData }, R("span", { className: "fas fa-sync" }), R("span", { className: "hide-600px" }, T `Refresh`)), this.props.extraTitleButtonsElem), this.props.titleElem);
|
|
190
191
|
}
|
|
191
192
|
renderQuickfilter() {
|
|
192
193
|
return R("div", {
|
|
@@ -246,7 +247,7 @@ class DatagridComponent extends react_1.default.Component {
|
|
|
246
247
|
let filters = this.props.filters || [];
|
|
247
248
|
// Compile quickfilters
|
|
248
249
|
filters = filters.concat(this.getQuickfilterFilters());
|
|
249
|
-
return R("div", {
|
|
250
|
+
return R(expressions_ui_1.LocaleContext.Provider, { value: this.props.design.locale || "en" }, R("div", {
|
|
250
251
|
style: {
|
|
251
252
|
width: "100%",
|
|
252
253
|
height: "100%",
|
|
@@ -261,7 +262,7 @@ class DatagridComponent extends react_1.default.Component {
|
|
|
261
262
|
ref: (view) => {
|
|
262
263
|
this.datagridView = view;
|
|
263
264
|
},
|
|
264
|
-
width: size.width - 1,
|
|
265
|
+
width: size.width - 1, // minus 1 px to test if it solves the jitter with scroll
|
|
265
266
|
height: size.height - 1,
|
|
266
267
|
pageSize: 100,
|
|
267
268
|
schema: this.props.schema,
|
|
@@ -278,12 +279,12 @@ class DatagridComponent extends react_1.default.Component {
|
|
|
278
279
|
});
|
|
279
280
|
}
|
|
280
281
|
else if (this.props.onDesignChange) {
|
|
281
|
-
return R("div", { style: { textAlign: "center", marginTop: size.height / 2 } }, R("a", { className: "btn btn-link", onClick: this.handleEdit }, T
|
|
282
|
+
return R("div", { style: { textAlign: "center", marginTop: size.height / 2 } }, R("a", { className: "btn btn-link", onClick: this.handleEdit }, T `Click Here to Configure`));
|
|
282
283
|
}
|
|
283
284
|
else {
|
|
284
285
|
return null;
|
|
285
286
|
}
|
|
286
|
-
}));
|
|
287
|
+
})));
|
|
287
288
|
}
|
|
288
289
|
}
|
|
289
290
|
exports.default = DatagridComponent;
|
|
@@ -75,7 +75,7 @@ class DatagridDesignerComponent extends react_1.default.Component {
|
|
|
75
75
|
tabs: [
|
|
76
76
|
{
|
|
77
77
|
id: "columns",
|
|
78
|
-
label: T
|
|
78
|
+
label: T `Columns`,
|
|
79
79
|
elem: R(ColumnsDesignerComponent, {
|
|
80
80
|
schema: this.props.schema,
|
|
81
81
|
dataSource: this.props.dataSource,
|
|
@@ -86,7 +86,7 @@ class DatagridDesignerComponent extends react_1.default.Component {
|
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
id: "filter",
|
|
89
|
-
label: T
|
|
89
|
+
label: T `Filter`,
|
|
90
90
|
// Here because of modal scroll issue
|
|
91
91
|
elem: R("div", { style: { marginBottom: 200 } }, R(expressions_ui_2.FilterExprComponent, {
|
|
92
92
|
schema: this.props.schema,
|
|
@@ -107,7 +107,7 @@ class DatagridDesignerComponent extends react_1.default.Component {
|
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
109
|
id: "order",
|
|
110
|
-
label: T
|
|
110
|
+
label: T `Sorting`,
|
|
111
111
|
elem: R("div", { style: { marginBottom: 200 } }, R(OrderBysDesignerComponent_1.default, {
|
|
112
112
|
schema: this.props.schema,
|
|
113
113
|
dataSource: this.props.dataSource,
|
|
@@ -118,7 +118,7 @@ class DatagridDesignerComponent extends react_1.default.Component {
|
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
id: "quickfilters",
|
|
121
|
-
label: T
|
|
121
|
+
label: T `Quickfilters`,
|
|
122
122
|
elem: R("div", { style: { marginBottom: 200 } }, R(QuickfiltersDesignComponent_1.default, {
|
|
123
123
|
design: this.props.design.quickfilters || [],
|
|
124
124
|
onDesignChange: (design) => this.props.onDesignChange((0, update_object_1.default)(this.props.design, { quickfilters: { $set: design } })),
|
|
@@ -129,7 +129,7 @@ class DatagridDesignerComponent extends react_1.default.Component {
|
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
id: "options",
|
|
132
|
-
label: T
|
|
132
|
+
label: T `Options`,
|
|
133
133
|
elem: R("div", { style: { marginBottom: 200 } }, R(DatagridOptionsComponent, {
|
|
134
134
|
design: this.props.design,
|
|
135
135
|
onDesignChange: this.props.onDesignChange
|
|
@@ -139,7 +139,7 @@ class DatagridDesignerComponent extends react_1.default.Component {
|
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
render() {
|
|
142
|
-
return R("div", null, R("label", null, T
|
|
142
|
+
return R("div", null, R("label", null, T `Data Source:`), R(expressions_ui_3.TableSelectComponent, {
|
|
143
143
|
schema: this.props.schema,
|
|
144
144
|
value: this.props.design.table,
|
|
145
145
|
onChange: this.handleTableChange
|
|
@@ -156,9 +156,9 @@ function DatagridOptionsComponent(props) {
|
|
|
156
156
|
})), "label");
|
|
157
157
|
}, []);
|
|
158
158
|
return react_1.default.createElement("div", null,
|
|
159
|
-
react_1.default.createElement(ui.Checkbox, { value: props.design.showRowNumbers, onChange: (showRowNumbers) => props.onDesignChange({ ...props.design, showRowNumbers }) }, T
|
|
160
|
-
react_1.default.createElement(ui.Checkbox, { value: props.design.showNumRows, onChange: (showNumRows) => props.onDesignChange({ ...props.design, showNumRows }) }, T
|
|
161
|
-
react_1.default.createElement(ui.FormGroup, { label: T
|
|
159
|
+
react_1.default.createElement(ui.Checkbox, { value: props.design.showRowNumbers, onChange: (showRowNumbers) => props.onDesignChange({ ...props.design, showRowNumbers }) }, T `Show row numbers`),
|
|
160
|
+
react_1.default.createElement(ui.Checkbox, { value: props.design.showNumRows, onChange: (showNumRows) => props.onDesignChange({ ...props.design, showNumRows }) }, T `Show number of rows`),
|
|
161
|
+
react_1.default.createElement(ui.FormGroup, { label: T `Language`, hint: T `Preferred language of the datagrid` },
|
|
162
162
|
react_1.default.createElement(react_select_1.default, { value: localeOptions.find(opt => opt.value == (props.design.locale || "en")) || null, options: localeOptions, onChange: (locale) => props.onDesignChange({ ...props.design, locale: locale.value }) })));
|
|
163
163
|
}
|
|
164
164
|
// Columns list
|
|
@@ -191,7 +191,7 @@ class ColumnsDesignerComponent extends react_1.default.Component {
|
|
|
191
191
|
type: "expr",
|
|
192
192
|
width: 150,
|
|
193
193
|
expr: { type: "id", table: this.props.table },
|
|
194
|
-
label: T
|
|
194
|
+
label: T `Unique Id`
|
|
195
195
|
});
|
|
196
196
|
return this.props.onColumnsChange(columns);
|
|
197
197
|
};
|
|
@@ -206,7 +206,7 @@ class ColumnsDesignerComponent extends react_1.default.Component {
|
|
|
206
206
|
id: (0, uuid_1.default)(),
|
|
207
207
|
width: 150,
|
|
208
208
|
type: "expr",
|
|
209
|
-
label: null,
|
|
209
|
+
label: null, // Use default label instead. # labeledExpr.label
|
|
210
210
|
expr: labeledExpr.expr
|
|
211
211
|
});
|
|
212
212
|
}
|
|
@@ -235,12 +235,12 @@ class ColumnsDesignerComponent extends react_1.default.Component {
|
|
|
235
235
|
type: "button",
|
|
236
236
|
className: "btn btn-link btn-sm",
|
|
237
237
|
onClick: this.handleAddDefaultColumns
|
|
238
|
-
}, R("span", { className: "fas fa-plus" }), " " + T
|
|
238
|
+
}, R("span", { className: "fas fa-plus" }), " " + T `Add Default Columns`), R("button", {
|
|
239
239
|
key: "removeAll",
|
|
240
240
|
type: "button",
|
|
241
241
|
className: "btn btn-link btn-sm",
|
|
242
242
|
onClick: this.handleRemoveAllColumns
|
|
243
|
-
}, R("span", { className: "fas fa-times" }), " " + T
|
|
243
|
+
}, R("span", { className: "fas fa-times" }), " " + T `Remove All Columns`)), R(ReorderableListComponent_1.default, {
|
|
244
244
|
items: this.props.columns,
|
|
245
245
|
onReorder: this.props.onColumnsChange,
|
|
246
246
|
renderItem: this.renderColumn,
|
|
@@ -250,12 +250,12 @@ class ColumnsDesignerComponent extends react_1.default.Component {
|
|
|
250
250
|
type: "button",
|
|
251
251
|
className: "btn btn-link",
|
|
252
252
|
onClick: this.handleAddColumn
|
|
253
|
-
}, R("span", { className: "fas fa-plus" }), " " + T
|
|
253
|
+
}, R("span", { className: "fas fa-plus" }), " " + T `Add Column`), R("button", {
|
|
254
254
|
key: "add-id",
|
|
255
255
|
type: "button",
|
|
256
256
|
className: "btn btn-link",
|
|
257
257
|
onClick: this.handleAddIdColumn
|
|
258
|
-
}, R("span", { className: "fas fa-plus" }), " " + T
|
|
258
|
+
}, R("span", { className: "fas fa-plus" }), " " + T `Add Unique Id (advanced)`)));
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
// Column item
|
|
@@ -317,10 +317,10 @@ class ColumnDesignerComponent extends react_1.default.Component {
|
|
|
317
317
|
const exprType = exprUtils.getExprType(this.props.column.expr);
|
|
318
318
|
switch (exprType) {
|
|
319
319
|
case "enumset":
|
|
320
|
-
return R("a", { className: "btn btn-sm btn-link", onClick: this.handleSplitEnumset }, R("i", { className: "fa fa-chain-broken" }), " " + T
|
|
320
|
+
return R("a", { className: "btn btn-sm btn-link", onClick: this.handleSplitEnumset }, R("i", { className: "fa fa-chain-broken" }), " " + T `Split by options`);
|
|
321
321
|
break;
|
|
322
322
|
case "geometry":
|
|
323
|
-
return R("a", { className: "btn btn-sm btn-link", onClick: this.handleSplitGeometry }, R("i", { className: "fa fa-chain-broken" }), " " + T
|
|
323
|
+
return R("a", { className: "btn btn-sm btn-link", onClick: this.handleSplitGeometry }, R("i", { className: "fa fa-chain-broken" }), " " + T `Split by lat/lng`);
|
|
324
324
|
break;
|
|
325
325
|
}
|
|
326
326
|
return null;
|
|
@@ -335,7 +335,7 @@ class ColumnDesignerComponent extends react_1.default.Component {
|
|
|
335
335
|
if (!formats) {
|
|
336
336
|
return null;
|
|
337
337
|
}
|
|
338
|
-
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, T
|
|
338
|
+
return R("div", { className: "mb-3" }, R("label", { className: "text-muted" }, T `Format`), ": ", R("select", {
|
|
339
339
|
value: this.props.column.format != null ? this.props.column.format : (0, valueFormatter_2.getDefaultFormat)(exprType),
|
|
340
340
|
className: "form-select",
|
|
341
341
|
style: { width: "auto", display: "inline-block" },
|
|
@@ -47,13 +47,13 @@ export default class DatagridQueryBuilder {
|
|
|
47
47
|
}): JsonQLQuery;
|
|
48
48
|
createComplexSubtableQuery(design: DatagridDesign, options: {
|
|
49
49
|
/** start at row offset */
|
|
50
|
-
offset?: number
|
|
50
|
+
offset?: number;
|
|
51
51
|
/** limit rows */
|
|
52
|
-
limit?: number
|
|
52
|
+
limit?: number;
|
|
53
53
|
/** array of additional filters to apply. Each is { table: table id, jsonql: jsonql condition with {alias} for tableAlias. } */
|
|
54
|
-
extraFilters?: JsonQLFilter[]
|
|
54
|
+
extraFilters?: JsonQLFilter[];
|
|
55
55
|
/** repeat main level values in subtable rows instead of leaving blank */
|
|
56
|
-
fillSubtableRows?: boolean
|
|
56
|
+
fillSubtableRows?: boolean;
|
|
57
57
|
} | undefined, subtable: any, subtableIndex: any): JsonQLQuery;
|
|
58
58
|
getMainOrderByExprs(design: DatagridDesign, isAggr?: boolean): JsonQLExpr[];
|
|
59
59
|
getMainOrderByDirections(design: any, isAggr?: boolean): any[];
|
|
@@ -69,10 +69,10 @@ class DatagridUtils {
|
|
|
69
69
|
}
|
|
70
70
|
validateDesign(design) {
|
|
71
71
|
if (!design.table) {
|
|
72
|
-
return
|
|
72
|
+
return T `Missing table`;
|
|
73
73
|
}
|
|
74
74
|
if (!design.columns || !design.columns[0]) {
|
|
75
|
-
return
|
|
75
|
+
return T `No columns`;
|
|
76
76
|
}
|
|
77
77
|
// Validate column exprs
|
|
78
78
|
for (const column of design.columns) {
|
|
@@ -24,7 +24,7 @@ class DatagridViewComponent extends react_1.default.Component {
|
|
|
24
24
|
this.state = {
|
|
25
25
|
rows: [],
|
|
26
26
|
entirelyLoaded: false,
|
|
27
|
-
editingCell: null,
|
|
27
|
+
editingCell: null, // set to { rowIndex: 0, 1, 2, columnIndex: 0, 1, 2... } if editing a cell
|
|
28
28
|
savingCell: false // True when saving a cell's contents
|
|
29
29
|
};
|
|
30
30
|
}
|
|
@@ -54,7 +54,7 @@ class DatagridViewComponent extends react_1.default.Component {
|
|
|
54
54
|
this.props.datagridDataSource.getRows(loadState.design, loadState.offset, loadState.limit, loadState.filters, (error, newRows) => {
|
|
55
55
|
if (error) {
|
|
56
56
|
console.error(error);
|
|
57
|
-
alert(T
|
|
57
|
+
alert(T `Error loading data`);
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
// Check that the required load state has not changed
|
|
@@ -101,7 +101,7 @@ class DatagridViewComponent extends react_1.default.Component {
|
|
|
101
101
|
this.props.datagridDataSource.getRows(this.props.design, 0, 1, filters, (error, rows) => {
|
|
102
102
|
if (error) {
|
|
103
103
|
console.error(error);
|
|
104
|
-
alert(T
|
|
104
|
+
alert(T `Error loading data`);
|
|
105
105
|
callback();
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
@@ -189,7 +189,7 @@ class DatagridViewComponent extends react_1.default.Component {
|
|
|
189
189
|
this.setState({ editingCell: null, savingCell: false });
|
|
190
190
|
});
|
|
191
191
|
}).catch(error => {
|
|
192
|
-
alert(T
|
|
192
|
+
alert(T `Error saving data`);
|
|
193
193
|
console.error(error);
|
|
194
194
|
});
|
|
195
195
|
});
|
|
@@ -19,7 +19,7 @@ class ExprCellComponent extends react_1.default.Component {
|
|
|
19
19
|
};
|
|
20
20
|
renderImage(id) {
|
|
21
21
|
const url = this.props.dataSource.getImageUrl(id);
|
|
22
|
-
return R("a", { href: url, key: id, target: "_blank", style: { paddingLeft: 5, paddingRight: 5 } },
|
|
22
|
+
return R("a", { href: url, key: id, target: "_blank", style: { paddingLeft: 5, paddingRight: 5 } }, T `Image`);
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
25
|
let node;
|
|
@@ -21,10 +21,10 @@ class FindReplaceModalComponent extends react_1.default.Component {
|
|
|
21
21
|
constructor(props) {
|
|
22
22
|
super(props);
|
|
23
23
|
this.state = {
|
|
24
|
-
open: false,
|
|
25
|
-
replaceColumn: null,
|
|
26
|
-
withExpr: null,
|
|
27
|
-
conditionExpr: null,
|
|
24
|
+
open: false, // True if modal is open
|
|
25
|
+
replaceColumn: null, // Column id to replace
|
|
26
|
+
withExpr: null, // Replace with expression
|
|
27
|
+
conditionExpr: null, // Condition expr
|
|
28
28
|
busy: false
|
|
29
29
|
};
|
|
30
30
|
}
|
|
@@ -112,7 +112,7 @@ class FindReplaceModalComponent extends react_1.default.Component {
|
|
|
112
112
|
try {
|
|
113
113
|
const rows = await this.props.dataSource.performQuery(query);
|
|
114
114
|
// Confirm
|
|
115
|
-
if (!confirm(T
|
|
115
|
+
if (!confirm(T `Replace ${rows.length} values? This cannot be undone.`)) {
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
// Perform updates
|
|
@@ -121,7 +121,7 @@ class FindReplaceModalComponent extends react_1.default.Component {
|
|
|
121
121
|
expr: replaceExpr,
|
|
122
122
|
value: exprType === "geometry" ? JSON.parse(row.withValue) : row.withValue
|
|
123
123
|
})));
|
|
124
|
-
alert(T
|
|
124
|
+
alert(T `Successfully replaced ${rows.length} values`);
|
|
125
125
|
this.setState({ open: false });
|
|
126
126
|
this.props.onUpdate();
|
|
127
127
|
}
|
|
@@ -194,13 +194,13 @@ class FindReplaceModalComponent extends react_1.default.Component {
|
|
|
194
194
|
}));
|
|
195
195
|
// Show progress
|
|
196
196
|
if (this.state.busy) {
|
|
197
|
-
return R("div", null, R("h3", null, T
|
|
197
|
+
return R("div", null, R("h3", null, T `Working...`), R("div", { className: "progress" }, R("div", { className: "progress-bar progress-bar-striped progress-bar-animated", style: { width: `100%` } })));
|
|
198
198
|
}
|
|
199
|
-
return R("div", null, R("div", { key: "replace", className: "mb-3" }, R("label", null, T
|
|
199
|
+
return R("div", null, R("div", { key: "replace", className: "mb-3" }, R("label", null, T `Column with data to replace` + ": "), R(react_select_1.default, {
|
|
200
200
|
options: replaceColumnOptions,
|
|
201
201
|
value: lodash_1.default.findWhere(replaceColumnOptions, { value: this.state.replaceColumn }) || null,
|
|
202
202
|
onChange: (opt) => this.setState({ replaceColumn: opt.value }),
|
|
203
|
-
placeholder: T
|
|
203
|
+
placeholder: T `Select Column...`,
|
|
204
204
|
styles: {
|
|
205
205
|
// Keep menu above fixed data table headers
|
|
206
206
|
menu: style => lodash_1.default.extend({}, style, { zIndex: 2 })
|
|
@@ -209,7 +209,7 @@ class FindReplaceModalComponent extends react_1.default.Component {
|
|
|
209
209
|
if (this.state.replaceColumn) {
|
|
210
210
|
// Get expr of replace column
|
|
211
211
|
const replaceExpr = lodash_1.default.findWhere(this.props.design.columns, { id: this.state.replaceColumn }).expr;
|
|
212
|
-
return R("div", { key: "with", className: "mb-3" }, R("label", null, T
|
|
212
|
+
return R("div", { key: "with", className: "mb-3" }, R("label", null, T `Value to replace data with` + ": "), R(expressions_ui_1.ExprComponent, {
|
|
213
213
|
schema: this.props.schema,
|
|
214
214
|
dataSource: this.props.dataSource,
|
|
215
215
|
table: this.props.design.table,
|
|
@@ -219,20 +219,20 @@ class FindReplaceModalComponent extends react_1.default.Component {
|
|
|
219
219
|
enumValues: exprUtils.getExprEnumValues(replaceExpr) || undefined,
|
|
220
220
|
idTable: exprUtils.getExprIdTable(replaceExpr) || undefined,
|
|
221
221
|
preferLiteral: true,
|
|
222
|
-
placeholder: T(
|
|
222
|
+
placeholder: T `(Blank)`,
|
|
223
223
|
refExpr: replaceExpr
|
|
224
224
|
}));
|
|
225
225
|
}
|
|
226
226
|
return null;
|
|
227
|
-
})(), R("div", { key: "condition", className: "mb-3" }, R("label", null, T
|
|
227
|
+
})(), R("div", { key: "condition", className: "mb-3" }, R("label", null, T `Only in rows that (optional)` + ":"), R(expressions_ui_1.ExprComponent, {
|
|
228
228
|
schema: this.props.schema,
|
|
229
229
|
dataSource: this.props.dataSource,
|
|
230
230
|
table: this.props.design.table,
|
|
231
231
|
value: this.state.conditionExpr,
|
|
232
232
|
onChange: value => this.setState({ conditionExpr: value }),
|
|
233
233
|
types: ["boolean"],
|
|
234
|
-
placeholder: T
|
|
235
|
-
})), R("div", { key: "preview" }, R("h4", null, T
|
|
234
|
+
placeholder: T `All Rows`
|
|
235
|
+
})), R("div", { key: "preview" }, R("h4", null, T `Preview`), this.renderPreview()));
|
|
236
236
|
}
|
|
237
237
|
render() {
|
|
238
238
|
if (!this.state.open) {
|
|
@@ -240,21 +240,21 @@ class FindReplaceModalComponent extends react_1.default.Component {
|
|
|
240
240
|
}
|
|
241
241
|
return R(ModalPopupComponent_1.default, {
|
|
242
242
|
size: "large",
|
|
243
|
-
header: T
|
|
243
|
+
header: T `Find/Replace`,
|
|
244
244
|
footer: [
|
|
245
245
|
R("button", {
|
|
246
246
|
key: "cancel",
|
|
247
247
|
type: "button",
|
|
248
248
|
onClick: () => this.setState({ open: false }),
|
|
249
249
|
className: "btn btn-secondary"
|
|
250
|
-
}, T
|
|
250
|
+
}, T `Cancel`),
|
|
251
251
|
R("button", {
|
|
252
252
|
key: "apply",
|
|
253
253
|
type: "button",
|
|
254
254
|
disabled: !this.state.replaceColumn || this.state.busy,
|
|
255
255
|
onClick: () => this.performReplace(),
|
|
256
256
|
className: "btn btn-primary"
|
|
257
|
-
}, T
|
|
257
|
+
}, T `Apply`)
|
|
258
258
|
]
|
|
259
259
|
}, this.renderContents());
|
|
260
260
|
}
|
|
@@ -42,7 +42,7 @@ class OrderBysDesignerComponent extends react_1.default.Component {
|
|
|
42
42
|
type: "button",
|
|
43
43
|
className: "btn btn-link",
|
|
44
44
|
onClick: this.handleAdd
|
|
45
|
-
}, R("span", { className: "fas fa-plus" }), " " + T
|
|
45
|
+
}, R("span", { className: "fas fa-plus" }), " " + T `Add Ordering`));
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
exports.default = OrderBysDesignerComponent;
|
|
@@ -62,6 +62,6 @@ class OrderByDesignerComponent extends react_1.default.Component {
|
|
|
62
62
|
aggrStatuses: ["individual", "literal", "aggregate"],
|
|
63
63
|
value: this.props.orderBy.expr,
|
|
64
64
|
onChange: this.handleExprChange
|
|
65
|
-
})), R("div", { className: "col-3" }, react_1.default.createElement(bootstrap_1.Checkbox, { inline: true, value: this.props.orderBy.direction === "desc", onChange: this.handleDirectionChange }, T
|
|
65
|
+
})), R("div", { className: "col-3" }, react_1.default.createElement(bootstrap_1.Checkbox, { inline: true, value: this.props.orderBy.direction === "desc", onChange: this.handleDirectionChange }, T `Reverse`)), R("div", { className: "col-1" }, R("button", { className: "btn btn-sm btn-link", type: "button", onClick: this.props.onRemove }, R("span", { className: "fas fa-times" }))));
|
|
66
66
|
}
|
|
67
67
|
}
|
package/lib/languages.js
CHANGED
|
@@ -11,8 +11,8 @@ class DecoratedBlockComponent extends react_1.default.Component {
|
|
|
11
11
|
constructor(props) {
|
|
12
12
|
super(props);
|
|
13
13
|
this.state = {
|
|
14
|
-
aspectDragY: null,
|
|
15
|
-
initialAspectDragY: null,
|
|
14
|
+
aspectDragY: null, // y position of aspect ratio drag
|
|
15
|
+
initialAspectDragY: null, // Initial y position of aspect ratio drag
|
|
16
16
|
initialClientY: null // first y of mousemove (for calculating difference)
|
|
17
17
|
};
|
|
18
18
|
}
|
|
@@ -123,15 +123,15 @@ class BlocksDisplayComponent extends react_1.default.Component {
|
|
|
123
123
|
renderPalette() {
|
|
124
124
|
return (react_1.default.createElement("div", { key: "palette", style: { width: 141, height: "100%", position: "absolute", top: 0, left: 0 } },
|
|
125
125
|
react_1.default.createElement("div", { className: "mwater-visualization-palette", style: { height: "100%" } },
|
|
126
|
-
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({ type: "widget", widgetType: "Text", design: { style: "title" } }), title: react_1.default.createElement("i", { className: "fa fa-font" }), subtitle:
|
|
127
|
-
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({ type: "widget", widgetType: "Text", design: {} }), title: react_1.default.createElement("i", { className: "fa fa-align-left" }), subtitle:
|
|
128
|
-
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({ type: "widget", aspectRatio: 1.4, widgetType: "Image", design: {} }), title: react_1.default.createElement("i", { className: "fa fa-picture-o" }), subtitle:
|
|
126
|
+
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({ type: "widget", widgetType: "Text", design: { style: "title" } }), title: react_1.default.createElement("i", { className: "fa fa-font" }), subtitle: T `Title` }),
|
|
127
|
+
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({ type: "widget", widgetType: "Text", design: {} }), title: react_1.default.createElement("i", { className: "fa fa-align-left" }), subtitle: T `Text` }),
|
|
128
|
+
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({ type: "widget", aspectRatio: 1.4, widgetType: "Image", design: {} }), title: react_1.default.createElement("i", { className: "fa fa-picture-o" }), subtitle: T `Image` }),
|
|
129
129
|
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({
|
|
130
130
|
type: "widget",
|
|
131
131
|
aspectRatio: 1.4,
|
|
132
132
|
widgetType: "LayeredChart",
|
|
133
133
|
design: {}
|
|
134
|
-
}), title: react_1.default.createElement("i", { className: "fa fa-bar-chart" }), subtitle:
|
|
134
|
+
}), title: react_1.default.createElement("i", { className: "fa fa-bar-chart" }), subtitle: T `Chart` }),
|
|
135
135
|
!this.props.disableMaps && (react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({
|
|
136
136
|
type: "widget",
|
|
137
137
|
aspectRatio: 2,
|
|
@@ -142,33 +142,33 @@ class BlocksDisplayComponent extends react_1.default.Component {
|
|
|
142
142
|
filters: {},
|
|
143
143
|
bounds: { w: -40, n: 25, e: 40, s: -25 }
|
|
144
144
|
}
|
|
145
|
-
}), title: react_1.default.createElement("i", { className: "fa fa-map-o" }), subtitle:
|
|
146
|
-
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({ type: "widget", aspectRatio: 1.4, widgetType: "TableChart", design: {} }), title: react_1.default.createElement("i", { className: "fa fa-table" }), subtitle:
|
|
147
|
-
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({ type: "widget", widgetType: "PivotChart", design: {} }), title: react_1.default.createElement("img", { width: 24, height: 24, src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAb0lEQVRIx91VQQrAIAwzo/7/ydllG0MQS21EzMW2ICFtoyBZlLDn/LOgySPAG1xFDDmBtZI6efoMvODozkyL2IlTCOisfS2KrqG0RXus6fkEVBIw08khE62aQY0ogMdEswqwYouwvQ8s+4M576m4Ae/tET/u1taEAAAAAElFTkSuQmCC" }), subtitle:
|
|
145
|
+
}), title: react_1.default.createElement("i", { className: "fa fa-map-o" }), subtitle: T `Map` })),
|
|
146
|
+
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({ type: "widget", aspectRatio: 1.4, widgetType: "TableChart", design: {} }), title: react_1.default.createElement("i", { className: "fa fa-table" }), subtitle: T `Table` }),
|
|
147
|
+
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({ type: "widget", widgetType: "PivotChart", design: {} }), title: react_1.default.createElement("img", { width: 24, height: 24, src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAb0lEQVRIx91VQQrAIAwzo/7/ydllG0MQS21EzMW2ICFtoyBZlLDn/LOgySPAG1xFDDmBtZI6efoMvODozkyL2IlTCOisfS2KrqG0RXus6fkEVBIw08khE62aQY0ogMdEswqwYouwvQ8s+4M576m4Ae/tET/u1taEAAAAAElFTkSuQmCC" }), subtitle: T `Pivot` }),
|
|
148
148
|
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({
|
|
149
149
|
type: "widget",
|
|
150
150
|
aspectRatio: 1.4,
|
|
151
151
|
widgetType: "CalendarChart",
|
|
152
152
|
design: {}
|
|
153
|
-
}), title: react_1.default.createElement("i", { className: "fa fa-calendar" }), subtitle:
|
|
153
|
+
}), title: react_1.default.createElement("i", { className: "fa fa-calendar" }), subtitle: T `Calendar` }),
|
|
154
154
|
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({
|
|
155
155
|
type: "widget",
|
|
156
156
|
aspectRatio: 1.4,
|
|
157
157
|
widgetType: "ImageMosaicChart",
|
|
158
158
|
design: {}
|
|
159
|
-
}), title: react_1.default.createElement("i", { className: "fa fa-th" }), subtitle:
|
|
160
|
-
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({ type: "spacer", aspectRatio: 2 }), title: react_1.default.createElement("i", { className: "fa fa-square-o" }), subtitle:
|
|
159
|
+
}), title: react_1.default.createElement("i", { className: "fa fa-th" }), subtitle: T `Mosaic` }),
|
|
160
|
+
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({ type: "spacer", aspectRatio: 2 }), title: react_1.default.createElement("i", { className: "fa fa-square-o" }), subtitle: T `Spacer` }),
|
|
161
161
|
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({
|
|
162
162
|
type: "widget",
|
|
163
163
|
aspectRatio: 16.0 / 9.0,
|
|
164
164
|
widgetType: "IFrame",
|
|
165
165
|
design: {}
|
|
166
|
-
}), title: react_1.default.createElement("i", { className: "fa fa-youtube-play" }), subtitle:
|
|
166
|
+
}), title: react_1.default.createElement("i", { className: "fa fa-youtube-play" }), subtitle: T `Video` }),
|
|
167
167
|
react_1.default.createElement(PaletteItemComponent_1.default, { createItem: this.createBlockItem({
|
|
168
168
|
type: "widget",
|
|
169
169
|
widgetType: "TOC",
|
|
170
|
-
design: { numbering: false, borderWeight: 2, header:
|
|
171
|
-
}), title: react_1.default.createElement("i", { className: "fa fa-list-ol" }), subtitle:
|
|
170
|
+
design: { numbering: false, borderWeight: 2, header: T `Contents` }
|
|
171
|
+
}), title: react_1.default.createElement("i", { className: "fa fa-list-ol" }), subtitle: T `TOC` }),
|
|
172
172
|
this.props.onClipboardChange && (react_1.default.createElement(ClipboardPaletteItemComponent_1.default, { clipboard: this.props.clipboard, onClipboardChange: this.props.onClipboardChange, cantPasteMessage: this.props.cantPasteMessage })))));
|
|
173
173
|
}
|
|
174
174
|
render() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import LayoutManager, { RenderLayoutOptions } from "../LayoutManager";
|
|
3
3
|
import BlocksDisplayComponent from "./BlocksDisplayComponent";
|
|
4
|
+
import { LayoutBlock } from "./blockUtils";
|
|
4
5
|
export default class BlocksLayoutManager extends LayoutManager {
|
|
5
6
|
/**
|
|
6
7
|
* Renders the layout as a react element
|
|
@@ -11,7 +12,7 @@ export default class BlocksLayoutManager extends LayoutManager {
|
|
|
11
12
|
type: string;
|
|
12
13
|
design: any;
|
|
13
14
|
} | null;
|
|
14
|
-
getAllWidgets(items:
|
|
15
|
+
getAllWidgets(items: LayoutBlock): {
|
|
15
16
|
id: string;
|
|
16
17
|
type: string;
|
|
17
18
|
design: any;
|
|
@@ -16,7 +16,7 @@ class ClipboardPaletteItemComponent extends react_1.default.Component {
|
|
|
16
16
|
return { block: lodash_1.default.extend({}, this.props.clipboard, { id: (0, uuid_1.default)() }) };
|
|
17
17
|
};
|
|
18
18
|
handleClear = () => {
|
|
19
|
-
if (confirm(
|
|
19
|
+
if (confirm(T `Clear clipboard?`)) {
|
|
20
20
|
return this.props.onClipboardChange(null);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
@@ -26,9 +26,9 @@ class ClipboardPaletteItemComponent extends react_1.default.Component {
|
|
|
26
26
|
? "mwater-visualization-palette-item"
|
|
27
27
|
: "mwater-visualization-palette-item disabled",
|
|
28
28
|
style: this.props.isOver ? { backgroundColor: "#2485dd" } : undefined
|
|
29
|
-
}, R("div", { className: "title", key: "title" }, this.props.isOver ? R("i", { className: "fa fa-clone" }) : R("i", { className: "fa fa-clipboard" })), R("div", { className: "subtitle", key: "subtitle" }, this.props.isOver ?
|
|
29
|
+
}, R("div", { className: "title", key: "title" }, this.props.isOver ? R("i", { className: "fa fa-clone" }) : R("i", { className: "fa fa-clipboard" })), R("div", { className: "subtitle", key: "subtitle" }, this.props.isOver ? T `Copy` : T `Clipboard`), this.props.cantPasteMessage
|
|
30
30
|
? R("div", { className: "tooltiptext" }, this.props.cantPasteMessage)
|
|
31
|
-
: R("div", { className: "tooltiptext" },
|
|
31
|
+
: R("div", { className: "tooltiptext" }, T `Clipboard allows copying widgets for pasting on this dashboard or another dashboard. Drag a widget on to this clipboard to copy it.`), this.props.clipboard
|
|
32
32
|
? R("div", { className: "clearclipboard", onClick: this.handleClear }, R("i", { className: "fa fa-trash-o" }))
|
|
33
33
|
: undefined));
|
|
34
34
|
if (this.props.clipboard && !this.props.cantPasteMessage) {
|
|
@@ -12,9 +12,9 @@ class HorizontalBlockComponent extends react_1.default.Component {
|
|
|
12
12
|
constructor(props) {
|
|
13
13
|
super(props);
|
|
14
14
|
this.state = {
|
|
15
|
-
dragIndex: null,
|
|
16
|
-
dragInitialX: null,
|
|
17
|
-
dragXOffset: null,
|
|
15
|
+
dragIndex: null, // index of splitter being dragged
|
|
16
|
+
dragInitialX: null, // Initial drag x
|
|
17
|
+
dragXOffset: null, // Offset of drag (pixels dragged from start)
|
|
18
18
|
leftSize: null,
|
|
19
19
|
rightSize: null
|
|
20
20
|
};
|
|
@@ -3,7 +3,10 @@ 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.dropBlock = dropBlock;
|
|
7
|
+
exports.updateBlock = updateBlock;
|
|
8
|
+
exports.removeBlock = removeBlock;
|
|
9
|
+
exports.cleanBlock = cleanBlock;
|
|
7
10
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
11
|
const uuid_1 = __importDefault(require("uuid"));
|
|
9
12
|
// When block is dropped on it. side is top, left, bottom, right)
|
|
@@ -79,7 +82,6 @@ function dropBlock(rootBlock, sourceBlock, targetBlock, side) {
|
|
|
79
82
|
}
|
|
80
83
|
return rootBlock;
|
|
81
84
|
}
|
|
82
|
-
exports.dropBlock = dropBlock;
|
|
83
85
|
// Updates a block
|
|
84
86
|
// returns new root block
|
|
85
87
|
function updateBlock(rootBlock, block) {
|
|
@@ -101,7 +103,6 @@ function updateBlock(rootBlock, block) {
|
|
|
101
103
|
}
|
|
102
104
|
return rootBlock;
|
|
103
105
|
}
|
|
104
|
-
exports.updateBlock = updateBlock;
|
|
105
106
|
// When block is removed
|
|
106
107
|
// returns new root block
|
|
107
108
|
function removeBlock(rootBlock, block) {
|
|
@@ -121,7 +122,6 @@ function removeBlock(rootBlock, block) {
|
|
|
121
122
|
}
|
|
122
123
|
return rootBlock;
|
|
123
124
|
}
|
|
124
|
-
exports.removeBlock = removeBlock;
|
|
125
125
|
// Clean blocks, simplifying as needed
|
|
126
126
|
function cleanBlock(rootBlock) {
|
|
127
127
|
// If vertical or horizontal
|
|
@@ -152,4 +152,3 @@ function cleanBlock(rootBlock) {
|
|
|
152
152
|
}
|
|
153
153
|
return rootBlock;
|
|
154
154
|
}
|
|
155
|
-
exports.cleanBlock = cleanBlock;
|