@mwater/visualization 5.4.5 → 5.6.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/MWaterContextComponent.d.ts +1 -1
- package/lib/MWaterContextComponent.js +1 -1
- package/lib/MWaterGlobalFiltersComponent.d.ts +2 -2
- package/lib/MWaterGlobalFiltersComponent.js +11 -20
- package/lib/MWaterLoaderComponent.d.ts +5 -14
- package/lib/MWaterLoaderComponent.js +2 -11
- package/lib/UndoStack.d.ts +2 -1
- package/lib/UndoStack.js +12 -6
- package/lib/dashboards/DashboardComponent.js +7 -5
- package/lib/dashboards/DashboardDesign.d.ts +1 -1
- package/lib/dashboards/LayoutOptionsComponent.js +18 -11
- package/lib/dashboards/ServerDashboardDataSource.d.ts +10 -1
- package/lib/dashboards/ServerDashboardDataSource.js +29 -10
- package/lib/dashboards/SettingsModalComponent.js +1 -1
- package/lib/dashboards/layoutOptions.d.ts +5 -1
- package/lib/datagrids/DatagridComponent.js +23 -3
- package/lib/datagrids/DatagridDesignerComponent.d.ts +2 -3
- package/lib/datagrids/DatagridDesignerComponent.js +108 -120
- package/lib/datagrids/DatagridViewComponent.js +3 -2
- package/lib/datagrids/ExprCellComponent.d.ts +1 -0
- package/lib/datagrids/ExprCellComponent.js +22 -20
- package/lib/datagrids/OrderBysDesignerComponent.d.ts +7 -7
- package/lib/datagrids/OrderBysDesignerComponent.js +19 -28
- package/lib/index.css +45 -2
- package/lib/index.d.ts +5 -5
- package/lib/index.js +2 -3
- package/lib/layouts/blocks/BlocksDisplayComponent.d.ts +8 -1
- package/lib/layouts/blocks/BlocksDisplayComponent.js +46 -4
- package/lib/maps/BufferLayer.d.ts +18 -0
- package/lib/maps/BufferLayer.js +36 -14
- package/lib/maps/BufferLayerDesign.d.ts +1 -1
- package/lib/maps/BufferLayerDesignerComponent.js +2 -2
- package/lib/maps/ChoroplethLayer.d.ts +18 -0
- package/lib/maps/ChoroplethLayer.js +46 -25
- package/lib/maps/ChoroplethLayerDesign.d.ts +7 -3
- package/lib/maps/ChoroplethLayerDesigner.d.ts +10 -22
- package/lib/maps/ChoroplethLayerDesigner.js +58 -89
- package/lib/maps/DirectMapDataSource.js +17 -10
- package/lib/maps/EditHoverOver.d.ts +4 -3
- package/lib/maps/EditHoverOver.js +64 -35
- package/lib/maps/HoverContent.d.ts +10 -5
- package/lib/maps/HoverContent.js +7 -36
- package/lib/maps/Layer.d.ts +37 -0
- package/lib/maps/Layer.js +30 -4
- package/lib/maps/LeafletMapComponent.js +10 -19
- package/lib/maps/MWaterServerLayer.d.ts +2 -2
- package/lib/maps/MWaterServerLayer.js +6 -6
- package/lib/maps/MapComponent.js +0 -1
- package/lib/maps/MapLayerDataSource.d.ts +9 -0
- package/lib/maps/MapUtils.d.ts +19 -1
- package/lib/maps/MapUtils.js +80 -1
- package/lib/maps/MarkersLayer.d.ts +18 -0
- package/lib/maps/MarkersLayer.js +42 -26
- package/lib/maps/MarkersLayerDesign.d.ts +1 -1
- package/lib/maps/MarkersLayerDesignerComponent.d.ts +12 -28
- package/lib/maps/MarkersLayerDesignerComponent.js +81 -111
- package/lib/maps/RasterMapViewComponent.js +1 -1
- package/lib/maps/ServerMapDataSource.d.ts +9 -0
- package/lib/maps/ServerMapDataSource.js +29 -10
- package/lib/maps/VectorMapViewComponent.js +7 -15
- package/lib/maps/maps.d.ts +4 -2
- package/lib/maps/symbols/font-awesome/asterisk.png +0 -0
- package/lib/maps/symbols/font-awesome/ban.png +0 -0
- package/lib/maps/symbols/font-awesome/beer.png +0 -0
- package/lib/maps/symbols/font-awesome/bell.png +0 -0
- package/lib/maps/symbols/font-awesome/bolt.png +0 -0
- package/lib/maps/symbols/font-awesome/building.png +0 -0
- package/lib/maps/symbols/font-awesome/bullseye.png +0 -0
- package/lib/maps/symbols/font-awesome/bus.png +0 -0
- package/lib/maps/symbols/font-awesome/caret-up.png +0 -0
- package/lib/maps/symbols/font-awesome/certificate.png +0 -0
- package/lib/maps/symbols/font-awesome/check-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/check.png +0 -0
- package/lib/maps/symbols/font-awesome/chevron-circle-down.png +0 -0
- package/lib/maps/symbols/font-awesome/chevron-circle-up.png +0 -0
- package/lib/maps/symbols/font-awesome/cloud-rain.png +0 -0
- package/lib/maps/symbols/font-awesome/cloud.png +0 -0
- package/lib/maps/symbols/font-awesome/comment.png +0 -0
- package/lib/maps/symbols/font-awesome/crosshairs.png +0 -0
- package/lib/maps/symbols/font-awesome/dot-circle-o.png +0 -0
- package/lib/maps/symbols/font-awesome/exclamation-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/exclamation-triangle.png +0 -0
- package/lib/maps/symbols/font-awesome/female.png +0 -0
- package/lib/maps/symbols/font-awesome/file.png +0 -0
- package/lib/maps/symbols/font-awesome/flag.png +0 -0
- package/lib/maps/symbols/font-awesome/flask.png +0 -0
- package/lib/maps/symbols/font-awesome/h-square.png +0 -0
- package/lib/maps/symbols/font-awesome/home.png +0 -0
- package/lib/maps/symbols/font-awesome/info-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/male.png +0 -0
- package/lib/maps/symbols/font-awesome/medkit.png +0 -0
- package/lib/maps/symbols/font-awesome/mobile.png +0 -0
- package/lib/maps/symbols/font-awesome/plus-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/plus-square.png +0 -0
- package/lib/maps/symbols/font-awesome/plus.png +0 -0
- package/lib/maps/symbols/font-awesome/square.png +0 -0
- package/lib/maps/symbols/font-awesome/star.png +0 -0
- package/lib/maps/symbols/font-awesome/thumbs-down.png +0 -0
- package/lib/maps/symbols/font-awesome/thumbs-up.png +0 -0
- package/lib/maps/symbols/font-awesome/ticket.png +0 -0
- package/lib/maps/symbols/font-awesome/times-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/times.png +0 -0
- package/lib/maps/symbols/font-awesome/tint.png +0 -0
- package/lib/maps/symbols/font-awesome/tree.png +0 -0
- package/lib/maps/symbols/font-awesome/university.png +0 -0
- package/lib/maps/symbols/font-awesome/usd.png +0 -0
- package/lib/maps/symbols/font-awesome/user.png +0 -0
- package/lib/maps/symbols/font-awesome/users.png +0 -0
- package/lib/maps/symbols/font-awesome/wheelchair.png +0 -0
- package/lib/maps/symbols/sdf-ize.sh +93 -0
- package/lib/maps/vectorMaps.d.ts +1 -0
- package/lib/maps/vectorMaps.js +20 -36
- package/lib/mwater_table_selection/FormsListComponent.d.ts +33 -0
- package/lib/mwater_table_selection/FormsListComponent.js +141 -0
- package/lib/mwater_table_selection/IndicatorsListComponent.d.ts +49 -0
- package/lib/mwater_table_selection/IndicatorsListComponent.js +251 -0
- package/lib/mwater_table_selection/IssuesListComponent.d.ts +29 -0
- package/lib/mwater_table_selection/IssuesListComponent.js +123 -0
- package/lib/mwater_table_selection/MWaterAccountingSystemListComponent.d.ts +20 -0
- package/lib/mwater_table_selection/MWaterAccountingSystemListComponent.js +157 -0
- package/lib/mwater_table_selection/MWaterAssetSystemsListComponent.d.ts +17 -0
- package/lib/mwater_table_selection/MWaterAssetSystemsListComponent.js +79 -0
- package/lib/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.d.ts +18 -0
- package/lib/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.js +80 -0
- package/lib/mwater_table_selection/MWaterCompleteTableSelectComponent.d.ts +63 -0
- package/lib/mwater_table_selection/MWaterCompleteTableSelectComponent.js +461 -0
- package/lib/mwater_table_selection/MWaterCustomTablesetListComponent.d.ts +17 -0
- package/lib/mwater_table_selection/MWaterCustomTablesetListComponent.js +94 -0
- package/lib/mwater_table_selection/MWaterMetricsTableListComponent.d.ts +17 -0
- package/lib/mwater_table_selection/MWaterMetricsTableListComponent.js +80 -0
- package/lib/mwater_table_selection/MWaterTableSelectComponent.d.ts +32 -0
- package/lib/mwater_table_selection/MWaterTableSelectComponent.js +163 -0
- package/lib/mwater_table_selection/MWaterWorkflowsSelectComponent.d.ts +19 -0
- package/lib/mwater_table_selection/MWaterWorkflowsSelectComponent.js +111 -0
- package/lib/quickfilter/QuickfiltersComponent.d.ts +3 -102
- package/lib/quickfilter/QuickfiltersComponent.js +53 -110
- package/lib/quickfilter/TextLiteralComponent.d.ts +23 -47
- package/lib/quickfilter/TextLiteralComponent.js +85 -82
- package/lib/widgets/MapWidget.js +4 -2
- package/lib/widgets/charts/Chart.d.ts +11 -0
- package/lib/widgets/charts/Chart.js +15 -0
- package/lib/widgets/charts/ChartWidgetComponent.d.ts +1 -0
- package/lib/widgets/charts/ChartWidgetComponent.js +27 -1
- package/lib/widgets/charts/layered/LayeredChartDesign.d.ts +1 -1
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.d.ts +1 -1
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +5 -12
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.d.ts +43 -57
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +113 -110
- package/lib/widgets/charts/layered/LayeredChartUtils.d.ts +2 -1
- package/lib/widgets/charts/layered/LayeredChartUtils.js +0 -2
- package/lib/widgets/charts/pivot/PivotChart.d.ts +2 -0
- package/lib/widgets/charts/pivot/PivotChart.js +156 -0
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +5 -20
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +31 -61
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.d.ts +4 -0
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.js +4 -2
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.d.ts +5 -44
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +38 -63
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +7 -68
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.js +58 -106
- package/lib/widgets/charts/table/TableChart.d.ts +2 -0
- package/lib/widgets/charts/table/TableChart.js +172 -1
- package/lib/widgets/charts/table/TableChartDesignerComponent.d.ts +7 -17
- package/lib/widgets/charts/table/TableChartDesignerComponent.js +79 -95
- package/lib/widgets/charts/table/TableChartViewComponent.d.ts +1 -7
- package/lib/widgets/charts/table/TableChartViewComponent.js +19 -27
- package/lib/widgets/text/ExprItemEditorComponent.d.ts +3 -8
- package/lib/widgets/text/ExprItemEditorComponent.js +36 -33
- package/lib/widgets/text/ExprUpdateModalComponent.d.ts +1 -0
- package/package.json +4 -10
- package/src/MWaterContextComponent.tsx +2 -2
- package/src/{MWaterGlobalFiltersComponent.ts → MWaterGlobalFiltersComponent.tsx} +32 -33
- package/src/{MWaterLoaderComponent.ts → MWaterLoaderComponent.tsx} +18 -19
- package/src/UndoStack.ts +14 -6
- package/src/dashboards/DashboardComponent.tsx +7 -5
- package/src/dashboards/DashboardDesign.ts +1 -1
- package/src/dashboards/LayoutOptionsComponent.tsx +22 -10
- package/src/dashboards/ServerDashboardDataSource.ts +36 -13
- package/src/dashboards/SettingsModalComponent.tsx +1 -1
- package/src/dashboards/layoutOptions.tsx +5 -1
- package/src/datagrids/DatagridComponent.tsx +31 -3
- package/src/datagrids/DatagridDesignerComponent.tsx +241 -229
- package/src/datagrids/DatagridViewComponent.tsx +3 -2
- package/src/datagrids/ExprCellComponent.tsx +23 -20
- package/src/datagrids/OrderBysDesignerComponent.tsx +61 -70
- package/src/index.css +45 -2
- package/src/index.ts +5 -11
- package/src/layouts/blocks/BlocksDisplayComponent.tsx +60 -5
- package/src/maps/BufferLayer.ts +48 -20
- package/src/maps/BufferLayerDesign.ts +1 -1
- package/src/maps/BufferLayerDesignerComponent.tsx +2 -1
- package/src/maps/ChoroplethLayer.ts +70 -39
- package/src/maps/ChoroplethLayerDesign.ts +6 -2
- package/src/maps/ChoroplethLayerDesigner.tsx +171 -167
- package/src/maps/DirectMapDataSource.ts +21 -13
- package/src/maps/EditHoverOver.tsx +98 -54
- package/src/maps/HoverContent.tsx +17 -48
- package/src/maps/Layer.ts +42 -4
- package/src/maps/LeafletMapComponent.tsx +10 -19
- package/src/maps/MWaterServerLayer.ts +6 -6
- package/src/maps/MapComponent.ts +0 -1
- package/src/maps/MapLayerDataSource.ts +8 -0
- package/src/maps/MapUtils.ts +82 -3
- package/src/maps/MarkersLayer.ts +54 -27
- package/src/maps/MarkersLayerDesign.ts +1 -1
- package/src/maps/MarkersLayerDesignerComponent.tsx +360 -0
- package/src/maps/RasterMapViewComponent.ts +1 -1
- package/src/maps/ServerMapDataSource.ts +35 -12
- package/src/maps/VectorMapViewComponent.tsx +8 -19
- package/src/maps/maps.ts +4 -2
- package/src/maps/symbols/font-awesome/asterisk.png +0 -0
- package/src/maps/symbols/font-awesome/ban.png +0 -0
- package/src/maps/symbols/font-awesome/beer.png +0 -0
- package/src/maps/symbols/font-awesome/bell.png +0 -0
- package/src/maps/symbols/font-awesome/bolt.png +0 -0
- package/src/maps/symbols/font-awesome/building.png +0 -0
- package/src/maps/symbols/font-awesome/bullseye.png +0 -0
- package/src/maps/symbols/font-awesome/bus.png +0 -0
- package/src/maps/symbols/font-awesome/caret-up.png +0 -0
- package/src/maps/symbols/font-awesome/certificate.png +0 -0
- package/src/maps/symbols/font-awesome/check-circle.png +0 -0
- package/src/maps/symbols/font-awesome/check.png +0 -0
- package/src/maps/symbols/font-awesome/chevron-circle-down.png +0 -0
- package/src/maps/symbols/font-awesome/chevron-circle-up.png +0 -0
- package/src/maps/symbols/font-awesome/cloud-rain.png +0 -0
- package/src/maps/symbols/font-awesome/cloud.png +0 -0
- package/src/maps/symbols/font-awesome/comment.png +0 -0
- package/src/maps/symbols/font-awesome/crosshairs.png +0 -0
- package/src/maps/symbols/font-awesome/dot-circle-o.png +0 -0
- package/src/maps/symbols/font-awesome/exclamation-circle.png +0 -0
- package/src/maps/symbols/font-awesome/exclamation-triangle.png +0 -0
- package/src/maps/symbols/font-awesome/female.png +0 -0
- package/src/maps/symbols/font-awesome/file.png +0 -0
- package/src/maps/symbols/font-awesome/flag.png +0 -0
- package/src/maps/symbols/font-awesome/flask.png +0 -0
- package/src/maps/symbols/font-awesome/h-square.png +0 -0
- package/src/maps/symbols/font-awesome/home.png +0 -0
- package/src/maps/symbols/font-awesome/info-circle.png +0 -0
- package/src/maps/symbols/font-awesome/male.png +0 -0
- package/src/maps/symbols/font-awesome/medkit.png +0 -0
- package/src/maps/symbols/font-awesome/mobile.png +0 -0
- package/src/maps/symbols/font-awesome/plus-circle.png +0 -0
- package/src/maps/symbols/font-awesome/plus-square.png +0 -0
- package/src/maps/symbols/font-awesome/plus.png +0 -0
- package/src/maps/symbols/font-awesome/square.png +0 -0
- package/src/maps/symbols/font-awesome/star.png +0 -0
- package/src/maps/symbols/font-awesome/thumbs-down.png +0 -0
- package/src/maps/symbols/font-awesome/thumbs-up.png +0 -0
- package/src/maps/symbols/font-awesome/ticket.png +0 -0
- package/src/maps/symbols/font-awesome/times-circle.png +0 -0
- package/src/maps/symbols/font-awesome/times.png +0 -0
- package/src/maps/symbols/font-awesome/tint.png +0 -0
- package/src/maps/symbols/font-awesome/tree.png +0 -0
- package/src/maps/symbols/font-awesome/university.png +0 -0
- package/src/maps/symbols/font-awesome/usd.png +0 -0
- package/src/maps/symbols/font-awesome/user.png +0 -0
- package/src/maps/symbols/font-awesome/users.png +0 -0
- package/src/maps/symbols/font-awesome/wheelchair.png +0 -0
- package/src/maps/symbols/sdf-ize.sh +93 -0
- package/src/maps/vectorMaps.tsx +20 -44
- package/src/mwater_table_selection/FormsListComponent.tsx +188 -0
- package/src/mwater_table_selection/IndicatorsListComponent.tsx +411 -0
- package/src/mwater_table_selection/IssuesListComponent.tsx +167 -0
- package/src/mwater_table_selection/MWaterAccountingSystemListComponent.tsx +225 -0
- package/src/{MWaterAssetSystemsListComponent.tsx → mwater_table_selection/MWaterAssetSystemsListComponent.tsx} +2 -2
- package/src/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.tsx +111 -0
- package/src/mwater_table_selection/MWaterCompleteTableSelectComponent.tsx +713 -0
- package/src/{MWaterCustomTablesetListComponent.tsx → mwater_table_selection/MWaterCustomTablesetListComponent.tsx} +1 -1
- package/src/{MWaterMetricsTableListComponent.tsx → mwater_table_selection/MWaterMetricsTableListComponent.tsx} +1 -1
- package/src/{MWaterTableSelectComponent.tsx → mwater_table_selection/MWaterTableSelectComponent.tsx} +91 -90
- package/src/mwater_table_selection/MWaterWorkflowsSelectComponent.tsx +159 -0
- package/src/quickfilter/{QuickfiltersComponent.ts → QuickfiltersComponent.tsx} +165 -158
- package/src/quickfilter/TextLiteralComponent.tsx +197 -0
- package/src/widgets/MapWidget.tsx +9 -1
- package/src/widgets/charts/Chart.ts +17 -0
- package/src/widgets/charts/ChartWidgetComponent.tsx +36 -1
- package/src/widgets/charts/layered/LayeredChartDesign.ts +1 -1
- package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +23 -24
- package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +260 -211
- package/src/widgets/charts/layered/LayeredChartUtils.ts +7 -7
- package/src/widgets/charts/pivot/PivotChart.ts +191 -0
- package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +124 -129
- package/src/widgets/charts/pivot/PivotChartLayoutBuilder.ts +4 -2
- package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +120 -149
- package/src/widgets/charts/pivot/SegmentDesignerComponent.tsx +178 -198
- package/src/widgets/charts/table/TableChart.ts +177 -1
- package/src/widgets/charts/table/TableChartDesignerComponent.tsx +422 -0
- package/src/widgets/charts/table/{TableChartViewComponent.ts → TableChartViewComponent.tsx} +65 -60
- package/src/widgets/text/ExprItemEditorComponent.tsx +83 -77
- package/src/widgets/text/ExprUpdateModalComponent.tsx +1 -0
- package/test/UndoStackTests.ts +52 -1
- package/.storybook/config.js +0 -7
- package/.storybook/head.html +0 -4
- package/.storybook/webpack.config.js +0 -15
- package/src/MWaterCompleteTableSelectComponent.tsx +0 -975
- package/src/maps/BingLayer.ts +0 -146
- package/src/maps/MarkersLayerDesignerComponent.ts +0 -374
- package/src/quickfilter/TextLiteralComponent.ts +0 -165
- package/src/widgets/charts/table/TableChartDesignerComponent.ts +0 -441
- package/stories/UpdateableComponent.js +0 -29
- package/stories/consoles.js +0 -202
- package/stories/dashboards.js +0 -217
- package/stories/datagridDesign.js +0 -114
- package/stories/datagrids.js +0 -69
- package/stories/dates.js +0 -80
- package/stories/exprcomponent.js +0 -43
- package/stories/index.js +0 -18
- package/stories/leaflet.js +0 -59
- package/stories/maps.js +0 -24
- package/stories/pivotChart.js +0 -235
|
@@ -28,7 +28,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const lodash_1 = __importDefault(require("lodash"));
|
|
30
30
|
const react_1 = __importDefault(require("react"));
|
|
31
|
-
const R = react_1.default.createElement;
|
|
32
31
|
const uuid_1 = __importDefault(require("uuid"));
|
|
33
32
|
const expressions_1 = require("@mwater/expressions");
|
|
34
33
|
const AxisBuilder_1 = __importDefault(require("../../../axes/AxisBuilder"));
|
|
@@ -79,22 +78,18 @@ class TableChartDesignerComponent extends react_1.default.Component {
|
|
|
79
78
|
this.updateDesign({ columns });
|
|
80
79
|
};
|
|
81
80
|
renderTable() {
|
|
82
|
-
return
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
return (react_1.default.createElement("div", { className: "mb-3" },
|
|
82
|
+
react_1.default.createElement("label", { className: "text-muted" },
|
|
83
|
+
react_1.default.createElement("i", { className: "fa fa-database" }),
|
|
84
|
+
" ",
|
|
85
|
+
T `Data Source`),
|
|
86
|
+
": ",
|
|
87
|
+
react_1.default.createElement(expressions_ui_3.TableSelectComponent, { schema: this.props.schema, value: this.props.design.table, onChange: this.handleTableChange, filter: this.props.design.filter, onFilterChange: this.handleFilterChange })));
|
|
89
88
|
}
|
|
90
89
|
renderTitle() {
|
|
91
|
-
return
|
|
92
|
-
|
|
93
|
-
className: "form-control form-control-sm",
|
|
94
|
-
value: this.props.design.titleText,
|
|
95
|
-
onChange: this.handleTitleTextChange,
|
|
96
|
-
placeholder: T `Untitled`
|
|
97
|
-
}));
|
|
90
|
+
return (react_1.default.createElement("div", { className: "mb-3" },
|
|
91
|
+
react_1.default.createElement("label", { className: "text-muted" }, T `Title`),
|
|
92
|
+
react_1.default.createElement("input", { type: "text", className: "form-control form-control-sm", value: this.props.design.titleText, onChange: this.handleTitleTextChange, placeholder: T `Untitled` })));
|
|
98
93
|
}
|
|
99
94
|
renderColumn = (column, index, connectDragSource, connectDragPreview, connectDropTarget) => {
|
|
100
95
|
const style = {
|
|
@@ -102,15 +97,8 @@ class TableChartDesignerComponent extends react_1.default.Component {
|
|
|
102
97
|
paddingTop: 10,
|
|
103
98
|
paddingBottom: 10
|
|
104
99
|
};
|
|
105
|
-
return connectDragPreview(connectDropTarget(
|
|
106
|
-
design: this.props.design,
|
|
107
|
-
schema: this.props.schema,
|
|
108
|
-
dataSource: this.props.dataSource,
|
|
109
|
-
index,
|
|
110
|
-
onChange: this.handleColumnChange.bind(null, index),
|
|
111
|
-
onRemove: this.handleRemoveColumn.bind(null, index),
|
|
112
|
-
connectDragSource
|
|
113
|
-
}))));
|
|
100
|
+
return connectDragPreview(connectDropTarget(react_1.default.createElement("div", { key: index, style: style },
|
|
101
|
+
react_1.default.createElement(TableChartColumnDesignerComponent, { design: this.props.design, schema: this.props.schema, dataSource: this.props.dataSource, index: index, onChange: this.handleColumnChange.bind(null, index), onRemove: this.handleRemoveColumn.bind(null, index), connectDragSource: connectDragSource }))));
|
|
114
102
|
};
|
|
115
103
|
handleReorder = (map) => {
|
|
116
104
|
return this.updateDesign({ columns: map });
|
|
@@ -119,12 +107,12 @@ class TableChartDesignerComponent extends react_1.default.Component {
|
|
|
119
107
|
if (!this.props.design.table) {
|
|
120
108
|
return;
|
|
121
109
|
}
|
|
122
|
-
return
|
|
123
|
-
items: this.props.design.columns,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
110
|
+
return (react_1.default.createElement("div", null,
|
|
111
|
+
react_1.default.createElement(ReorderableListComponent_1.default, { items: this.props.design.columns, onReorder: this.handleReorder, renderItem: this.renderColumn, getItemId: (item) => item.id }),
|
|
112
|
+
react_1.default.createElement("button", { className: "btn btn-secondary btn-sm", type: "button", onClick: this.handleAddColumn },
|
|
113
|
+
react_1.default.createElement("span", { className: "fas fa-plus" }),
|
|
114
|
+
" ",
|
|
115
|
+
T `Add Column`)));
|
|
128
116
|
}
|
|
129
117
|
// return R 'div', className: "form-group",
|
|
130
118
|
// _.map(@props.design.columns, (column, i) => @renderColumn(i))
|
|
@@ -134,41 +122,47 @@ class TableChartDesignerComponent extends react_1.default.Component {
|
|
|
134
122
|
if (!this.props.design.table) {
|
|
135
123
|
return null;
|
|
136
124
|
}
|
|
137
|
-
return
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
125
|
+
return (react_1.default.createElement("div", { className: "mb-3" },
|
|
126
|
+
react_1.default.createElement("label", { className: "text-muted" },
|
|
127
|
+
react_1.default.createElement("span", { className: "fas fa-sort-amount-down" }),
|
|
128
|
+
" ",
|
|
129
|
+
T `Ordering`),
|
|
130
|
+
react_1.default.createElement("div", { style: { marginLeft: 8 } },
|
|
131
|
+
react_1.default.createElement(OrderingsComponent_1.default, { schema: this.props.schema, dataSource: this.props.dataSource, orderings: this.props.design.orderings, onOrderingsChange: this.handleOrderingsChange, table: this.props.design.table }))));
|
|
144
132
|
}
|
|
145
133
|
renderFilter() {
|
|
146
134
|
// If no table, hide
|
|
147
135
|
if (!this.props.design.table) {
|
|
148
136
|
return null;
|
|
149
137
|
}
|
|
150
|
-
return
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
138
|
+
return (react_1.default.createElement("div", { className: "mb-3" },
|
|
139
|
+
react_1.default.createElement("label", { className: "text-muted" },
|
|
140
|
+
react_1.default.createElement("span", { className: "fas fa-filter" }),
|
|
141
|
+
" ",
|
|
142
|
+
T `Filters`),
|
|
143
|
+
react_1.default.createElement("div", { style: { marginLeft: 8 } },
|
|
144
|
+
react_1.default.createElement(expressions_ui_2.FilterExprComponent, { schema: this.props.schema, dataSource: this.props.dataSource, onChange: this.handleFilterChange, table: this.props.design.table, value: this.props.design.filter }))));
|
|
157
145
|
}
|
|
158
146
|
renderLimit() {
|
|
159
147
|
// If no table, hide
|
|
160
148
|
if (!this.props.design.table) {
|
|
161
149
|
return null;
|
|
162
150
|
}
|
|
163
|
-
return
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
placeholder: "1000"
|
|
168
|
-
})));
|
|
151
|
+
return (react_1.default.createElement("div", { className: "mb-3" },
|
|
152
|
+
react_1.default.createElement("label", { className: "text-muted" }, T `Maximum Number of Rows (up to 1000)`),
|
|
153
|
+
react_1.default.createElement("div", { style: { marginLeft: 8 } },
|
|
154
|
+
react_1.default.createElement(ui.NumberInput, { value: this.props.design.limit, onChange: this.handleLimitChange, decimal: false, placeholder: "1000" }))));
|
|
169
155
|
}
|
|
170
156
|
render() {
|
|
171
|
-
return
|
|
157
|
+
return (react_1.default.createElement("div", null,
|
|
158
|
+
this.renderTable(),
|
|
159
|
+
this.renderColumns(),
|
|
160
|
+
this.props.design.table ? react_1.default.createElement("hr", null) : undefined,
|
|
161
|
+
this.renderOrderings(),
|
|
162
|
+
this.renderFilter(),
|
|
163
|
+
this.renderLimit(),
|
|
164
|
+
react_1.default.createElement("hr", null),
|
|
165
|
+
this.renderTitle()));
|
|
172
166
|
}
|
|
173
167
|
}
|
|
174
168
|
exports.default = TableChartDesignerComponent;
|
|
@@ -197,21 +191,18 @@ class TableChartColumnDesignerComponent extends react_1.default.Component {
|
|
|
197
191
|
};
|
|
198
192
|
renderRemove() {
|
|
199
193
|
if (this.props.design.columns.length > 1) {
|
|
200
|
-
return
|
|
194
|
+
return (react_1.default.createElement("button", { className: "btn btn-sm btn-link float-end", type: "button", onClick: this.props.onRemove },
|
|
195
|
+
react_1.default.createElement("span", { className: "fas fa-times" })));
|
|
201
196
|
}
|
|
202
197
|
return null;
|
|
203
198
|
}
|
|
204
199
|
renderExpr() {
|
|
205
200
|
const column = this.props.design.columns[this.props.index];
|
|
206
201
|
const title = T `Value`;
|
|
207
|
-
return
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
table: this.props.design.table,
|
|
211
|
-
value: column.textAxis ? column.textAxis.expr : null,
|
|
212
|
-
onChange: this.handleExprChange,
|
|
213
|
-
aggrStatuses: ["literal", "individual", "aggregate"]
|
|
214
|
-
}));
|
|
202
|
+
return (react_1.default.createElement("div", null,
|
|
203
|
+
react_1.default.createElement("label", { className: "text-muted" }, title),
|
|
204
|
+
": ",
|
|
205
|
+
react_1.default.createElement(expressions_ui_1.ExprComponent, { schema: this.props.schema, dataSource: this.props.dataSource, table: this.props.design.table, value: column.textAxis ? column.textAxis.expr : null, onChange: this.handleExprChange, aggrStatuses: ["literal", "individual", "aggregate"] })));
|
|
215
206
|
}
|
|
216
207
|
renderFormat() {
|
|
217
208
|
const column = this.props.design.columns[this.props.index];
|
|
@@ -225,25 +216,19 @@ class TableChartColumnDesignerComponent extends react_1.default.Component {
|
|
|
225
216
|
if (!formats) {
|
|
226
217
|
return null;
|
|
227
218
|
}
|
|
228
|
-
return
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
style: { width: "auto", display: "inline-block" },
|
|
232
|
-
onChange: this.handleFormatChange
|
|
233
|
-
}, lodash_1.default.map(formats, (format) => R("option", { key: format.value, value: format.value }, format.label))));
|
|
219
|
+
return (react_1.default.createElement("div", { className: "mb-3" },
|
|
220
|
+
react_1.default.createElement("label", { className: "text-muted" }, T `Format`),
|
|
221
|
+
": ",
|
|
222
|
+
react_1.default.createElement("select", { value: column.format != null ? column.format : (0, valueFormatter_2.getDefaultFormat)(exprType), className: "form-select", style: { width: "auto", display: "inline-block" }, onChange: this.handleFormatChange }, lodash_1.default.map(formats, (format) => react_1.default.createElement("option", { key: format.value, value: format.value }, format.label)))));
|
|
234
223
|
}
|
|
235
224
|
renderHeader() {
|
|
236
225
|
const column = this.props.design.columns[this.props.index];
|
|
237
226
|
const axisBuilder = new AxisBuilder_1.default({ schema: this.props.schema });
|
|
238
227
|
const placeholder = column.textAxis ? axisBuilder.summarizeAxis(column.textAxis ?? null, this.context) : "";
|
|
239
|
-
return
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
style: { display: "inline-block", width: "15em" },
|
|
243
|
-
value: column.headerText,
|
|
244
|
-
onChange: this.handleHeaderTextChange,
|
|
245
|
-
placeholder
|
|
246
|
-
}));
|
|
228
|
+
return (react_1.default.createElement("div", null,
|
|
229
|
+
react_1.default.createElement("label", { className: "text-muted" }, T `Header`),
|
|
230
|
+
": ",
|
|
231
|
+
react_1.default.createElement("input", { type: "text", className: "form-control form-control-sm", style: { display: "inline-block", width: "15em" }, value: column.headerText, onChange: this.handleHeaderTextChange, placeholder: placeholder })));
|
|
247
232
|
}
|
|
248
233
|
renderSummarize() {
|
|
249
234
|
const column = this.props.design.columns[this.props.index];
|
|
@@ -252,31 +237,21 @@ class TableChartColumnDesignerComponent extends react_1.default.Component {
|
|
|
252
237
|
if (!exprType || exprType !== 'number') {
|
|
253
238
|
return null;
|
|
254
239
|
}
|
|
255
|
-
return
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
240
|
+
return (react_1.default.createElement("div", null,
|
|
241
|
+
react_1.default.createElement(ui.Checkbox, { value: column.summarize, inline: true, onChange: (summarize) => this.updateColumn({ summarize, summaryType: column.summaryType ?? 'sum' }) }, T `Summarize`),
|
|
242
|
+
column.summarize ?
|
|
243
|
+
react_1.default.createElement("div", null,
|
|
244
|
+
react_1.default.createElement("label", { className: "text-muted" }, T `Summary Type`),
|
|
245
|
+
": ",
|
|
246
|
+
react_1.default.createElement(ui.Select, { inline: true, value: column.summaryType, onChange: (summaryType) => this.updateColumn({ summaryType }), options: [{ value: 'avg', label: T `Average` }, { value: 'sum', label: T `Sum` }, { value: 'min', label: T `Minimum` }, { value: 'max', label: T `Maximum` }] }))
|
|
247
|
+
: undefined));
|
|
262
248
|
}
|
|
263
249
|
renderBackgroundColorAxis() {
|
|
264
250
|
const column = this.props.design.columns[this.props.index];
|
|
265
251
|
if (!column.textAxis)
|
|
266
252
|
return null;
|
|
267
|
-
return
|
|
268
|
-
|
|
269
|
-
labelMuted: true
|
|
270
|
-
}, R(AxisComponent_1.default, {
|
|
271
|
-
schema: this.props.schema,
|
|
272
|
-
dataSource: this.props.dataSource,
|
|
273
|
-
table: this.props.design.table,
|
|
274
|
-
types: ["enum", "text", "boolean", "date"],
|
|
275
|
-
value: column.backgroundColorAxis,
|
|
276
|
-
onChange: (backgroundColorAxis) => this.updateColumn({ backgroundColorAxis }),
|
|
277
|
-
showColorMap: true,
|
|
278
|
-
aggrNeed: "optional"
|
|
279
|
-
}));
|
|
253
|
+
return (react_1.default.createElement(ui.CollapsibleSection, { label: T `Background color by data`, labelMuted: true },
|
|
254
|
+
react_1.default.createElement(AxisComponent_1.default, { schema: this.props.schema, dataSource: this.props.dataSource, table: this.props.design.table, types: ["enum", "text", "boolean", "date"], value: column.backgroundColorAxis, onChange: (backgroundColorAxis) => this.updateColumn({ backgroundColorAxis }), showColorMap: true, aggrNeed: "optional" })));
|
|
280
255
|
}
|
|
281
256
|
render() {
|
|
282
257
|
const iconStyle = {
|
|
@@ -286,6 +261,15 @@ class TableChartColumnDesignerComponent extends react_1.default.Component {
|
|
|
286
261
|
fontSize: 12,
|
|
287
262
|
height: 20
|
|
288
263
|
};
|
|
289
|
-
return
|
|
264
|
+
return (react_1.default.createElement("div", null,
|
|
265
|
+
this.props.connectDragSource(react_1.default.createElement("i", { className: "fa fa-bars", style: iconStyle })),
|
|
266
|
+
this.renderRemove(),
|
|
267
|
+
react_1.default.createElement("label", null, T `Column ${this.props.index + 1}`),
|
|
268
|
+
react_1.default.createElement("div", { style: { marginLeft: 5 } },
|
|
269
|
+
this.renderExpr(),
|
|
270
|
+
this.renderFormat(),
|
|
271
|
+
this.renderHeader(),
|
|
272
|
+
this.renderSummarize(),
|
|
273
|
+
this.renderBackgroundColorAxis())));
|
|
290
274
|
}
|
|
291
275
|
}
|
|
@@ -19,11 +19,5 @@ export interface TableChartViewComponentProps {
|
|
|
19
19
|
}
|
|
20
20
|
export default class TableChartViewComponent extends React.Component<TableChartViewComponentProps> {
|
|
21
21
|
shouldComponentUpdate(prevProps: TableChartViewComponentProps): boolean;
|
|
22
|
-
render(): React.
|
|
23
|
-
style: {
|
|
24
|
-
width: number | undefined;
|
|
25
|
-
height: number | undefined;
|
|
26
|
-
};
|
|
27
|
-
className: string;
|
|
28
|
-
}, HTMLElement>;
|
|
22
|
+
render(): React.JSX.Element;
|
|
29
23
|
}
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const lodash_1 = __importDefault(require("lodash"));
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const R = react_1.default.createElement;
|
|
9
8
|
const react_linkify_1 = __importDefault(require("react-linkify"));
|
|
10
9
|
const AxisBuilder_1 = __importDefault(require("../../../axes/AxisBuilder"));
|
|
11
10
|
const expressions_1 = require("@mwater/expressions");
|
|
@@ -21,14 +20,9 @@ class TableChartViewComponent extends react_1.default.Component {
|
|
|
21
20
|
width: this.props.width,
|
|
22
21
|
height: this.props.height
|
|
23
22
|
};
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
table: this.props.design.table,
|
|
27
|
-
data: this.props.data,
|
|
28
|
-
schema: this.props.schema,
|
|
29
|
-
dataSource: this.props.dataSource,
|
|
30
|
-
onRowClick: this.props.onRowClick
|
|
31
|
-
}));
|
|
23
|
+
return (react_1.default.createElement("div", { style: style, className: "overflow-auto-except-print" },
|
|
24
|
+
react_1.default.createElement("div", { style: { fontWeight: "bold", textAlign: "center" } }, this.props.design.titleText),
|
|
25
|
+
react_1.default.createElement(TableContentsComponent, { columns: this.props.design.columns, table: this.props.design.table, data: this.props.data, schema: this.props.schema, dataSource: this.props.dataSource, onRowClick: this.props.onRowClick })));
|
|
32
26
|
}
|
|
33
27
|
}
|
|
34
28
|
exports.default = TableChartViewComponent;
|
|
@@ -90,19 +84,13 @@ class TableContentsComponent extends react_1.default.Component {
|
|
|
90
84
|
const column = this.props.columns[index];
|
|
91
85
|
//(this.state.sort?.direction === 'asc' ? "":"")
|
|
92
86
|
const text = column.headerText ?? (column.textAxis ? axisBuilder.summarizeAxis(column.textAxis, this.context) : "");
|
|
93
|
-
return
|
|
94
|
-
|
|
95
|
-
style: {
|
|
96
|
-
onClick: () => this.handleSort(index)
|
|
97
|
-
}, text, this.state.sort?.column === index
|
|
98
|
-
? R("span", {
|
|
99
|
-
style: { marginLeft: 10 },
|
|
100
|
-
className: `fa ${this.state.sort?.direction === "asc" ? "fa-sort-asc" : "fa-sort-desc"}`
|
|
101
|
-
})
|
|
102
|
-
: undefined);
|
|
87
|
+
return (react_1.default.createElement("th", { key: index, style: { cursor: "pointer" }, onClick: () => this.handleSort(index) },
|
|
88
|
+
text,
|
|
89
|
+
this.state.sort?.column === index ? (react_1.default.createElement("span", { style: { marginLeft: 10 }, className: `fa ${this.state.sort?.direction === "asc" ? "fa-sort-asc" : "fa-sort-desc"}` })) : undefined));
|
|
103
90
|
}
|
|
104
91
|
renderHeader() {
|
|
105
|
-
return
|
|
92
|
+
return (react_1.default.createElement("thead", { key: "head" },
|
|
93
|
+
react_1.default.createElement("tr", { key: "head" }, lodash_1.default.map(this.props.columns, (column, i) => this.renderHeaderCell(i)))));
|
|
106
94
|
}
|
|
107
95
|
renderFooterCell(index) {
|
|
108
96
|
const exprUtils = new expressions_1.ExprUtils(this.props.schema);
|
|
@@ -120,11 +108,12 @@ class TableContentsComponent extends react_1.default.Component {
|
|
|
120
108
|
if (!this.props.data.summary) {
|
|
121
109
|
return null;
|
|
122
110
|
}
|
|
123
|
-
return
|
|
111
|
+
return (react_1.default.createElement("tfoot", { key: "foot" },
|
|
112
|
+
react_1.default.createElement("tr", { key: "foot" }, lodash_1.default.map(this.props.columns, (column, i) => react_1.default.createElement("th", { key: i }, this.renderFooterCell(i))))));
|
|
124
113
|
}
|
|
125
114
|
renderImage(id) {
|
|
126
115
|
const url = this.props.dataSource.getImageUrl(id);
|
|
127
|
-
return
|
|
116
|
+
return (react_1.default.createElement("a", { href: url, onClick: (e) => { e.stopPropagation(); }, key: id, target: "_blank", style: { paddingLeft: 5, paddingRight: 5 } }, T `Image`));
|
|
128
117
|
}
|
|
129
118
|
renderCell(rowIndex, columnIndex) {
|
|
130
119
|
const axisBuilder = new AxisBuilder_1.default({ schema: this.props.schema });
|
|
@@ -163,7 +152,7 @@ class TableContentsComponent extends react_1.default.Component {
|
|
|
163
152
|
switch (exprType) {
|
|
164
153
|
case "text":
|
|
165
154
|
if (lodash_1.default.isString(value)) {
|
|
166
|
-
node =
|
|
155
|
+
node = react_1.default.createElement(react_linkify_1.default, { properties: { target: "_blank" } }, value);
|
|
167
156
|
}
|
|
168
157
|
break;
|
|
169
158
|
case "number":
|
|
@@ -211,15 +200,18 @@ class TableContentsComponent extends react_1.default.Component {
|
|
|
211
200
|
const lightness = 1 - (1 - c.luminosity()) * c.alpha();
|
|
212
201
|
textColor = lightness < 0.3 ? "rgb(204,204,204)" : "inherit";
|
|
213
202
|
}
|
|
214
|
-
return
|
|
203
|
+
return react_1.default.createElement("td", { key: columnIndex, style: { backgroundColor, color: textColor } }, node);
|
|
215
204
|
}
|
|
216
205
|
renderRow(index) {
|
|
217
|
-
return
|
|
206
|
+
return (react_1.default.createElement("tr", { key: index, onClick: this.handleRowClick.bind(null, index) }, lodash_1.default.map(this.props.columns, (column, i) => this.renderCell(index, i))));
|
|
218
207
|
}
|
|
219
208
|
renderBody() {
|
|
220
|
-
return
|
|
209
|
+
return (react_1.default.createElement("tbody", { key: "body" }, lodash_1.default.map(this.state.data, (row, i) => this.renderRow(i))));
|
|
221
210
|
}
|
|
222
211
|
render() {
|
|
223
|
-
return
|
|
212
|
+
return (react_1.default.createElement("table", { className: "mwater-visualization-table", style: { marginBottom: 0 } },
|
|
213
|
+
this.renderHeader(),
|
|
214
|
+
this.renderBody(),
|
|
215
|
+
this.renderFooter()));
|
|
224
216
|
}
|
|
225
217
|
}
|
|
@@ -10,6 +10,7 @@ export interface ExprItemEditorComponentProps {
|
|
|
10
10
|
exprItem: HtmlItemExpr;
|
|
11
11
|
/** Called with expr item */
|
|
12
12
|
onChange: (exprItem: HtmlItemExpr) => void;
|
|
13
|
+
/** Optional table that will be filtered to have a single row present. Widget designer should optionally account for this */
|
|
13
14
|
singleRowTable?: string;
|
|
14
15
|
}
|
|
15
16
|
interface ExprItemEditorComponentState {
|
|
@@ -22,13 +23,7 @@ export default class ExprItemEditorComponent extends React.Component<ExprItemEdi
|
|
|
22
23
|
handleIncludeLabelChange: (value: any) => void;
|
|
23
24
|
handleLabelTextChange: (ev: any) => void;
|
|
24
25
|
handleFormatChange: (ev: any) => void;
|
|
25
|
-
renderFormat(): React.
|
|
26
|
-
|
|
27
|
-
}, HTMLElement> | null;
|
|
28
|
-
render(): React.DetailedReactHTMLElement<{
|
|
29
|
-
style: {
|
|
30
|
-
paddingBottom: number;
|
|
31
|
-
};
|
|
32
|
-
}, HTMLElement>;
|
|
26
|
+
renderFormat(): React.JSX.Element | null;
|
|
27
|
+
render(): React.JSX.Element;
|
|
33
28
|
}
|
|
34
29
|
export {};
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const lodash_1 = __importDefault(require("lodash"));
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const R = react_1.default.createElement;
|
|
9
8
|
const expressions_1 = require("@mwater/expressions");
|
|
10
9
|
const expressions_ui_1 = require("@mwater/expressions-ui");
|
|
11
10
|
const expressions_ui_2 = require("@mwater/expressions-ui");
|
|
@@ -53,40 +52,44 @@ class ExprItemEditorComponent extends react_1.default.Component {
|
|
|
53
52
|
if (!formats) {
|
|
54
53
|
return null;
|
|
55
54
|
}
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
style: { width: "auto", display: "inline-block" },
|
|
60
|
-
onChange: this.handleFormatChange
|
|
61
|
-
}, lodash_1.default.map(formats, (format) => R("option", { key: format.value, value: format.value }, format.label))));
|
|
55
|
+
return (react_1.default.createElement("div", { className: "mb-3" },
|
|
56
|
+
react_1.default.createElement("label", { className: "text-muted" }, T `Format`),
|
|
57
|
+
": ",
|
|
58
|
+
react_1.default.createElement("select", { value: this.props.exprItem.format != null ? this.props.exprItem.format : (0, valueFormatter_2.getDefaultFormat)(exprType), className: "form-select", style: { width: "auto", display: "inline-block" }, onChange: this.handleFormatChange }, lodash_1.default.map(formats, (format) => react_1.default.createElement("option", { key: format.value, value: format.value }, format.label)))));
|
|
62
59
|
}
|
|
63
60
|
render() {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
onChange: this.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
61
|
+
const exprValidator = new expressions_1.ExprValidator(this.props.schema);
|
|
62
|
+
const error = exprValidator.validateExpr(this.props.exprItem.expr, {
|
|
63
|
+
table: this.state.table,
|
|
64
|
+
aggrStatuses: ["individual", "literal", "aggregate"]
|
|
65
|
+
});
|
|
66
|
+
return (react_1.default.createElement("div", { style: { paddingBottom: 200 } },
|
|
67
|
+
react_1.default.createElement("div", { className: "mb-3" },
|
|
68
|
+
react_1.default.createElement("label", { className: "text-muted" },
|
|
69
|
+
react_1.default.createElement("i", { className: "fa fa-database" }),
|
|
70
|
+
" ",
|
|
71
|
+
T `Data Source`),
|
|
72
|
+
": ",
|
|
73
|
+
react_1.default.createElement(expressions_ui_2.TableSelectComponent, { schema: this.props.schema, value: this.state.table, onChange: this.handleTableChange }),
|
|
74
|
+
react_1.default.createElement("br", null)),
|
|
75
|
+
this.state.table
|
|
76
|
+
? (react_1.default.createElement("div", { className: "mb-3" },
|
|
77
|
+
react_1.default.createElement("label", { className: "text-muted" }, T `Field`),
|
|
78
|
+
": ",
|
|
79
|
+
react_1.default.createElement(expressions_ui_1.ExprComponent, { schema: this.props.schema, dataSource: this.props.dataSource, table: this.state.table, types: ["text", "number", "enum", "date", "datetime", "boolean", "enumset", "geometry"], value: this.props.exprItem.expr, aggrStatuses: ["individual", "literal", "aggregate"], onChange: this.handleExprChange })))
|
|
80
|
+
: undefined,
|
|
81
|
+
error ? react_1.default.createElement("div", { className: "alert alert-danger" },
|
|
82
|
+
react_1.default.createElement("i", { className: "fa fa-exclamation-circle" }),
|
|
83
|
+
" ",
|
|
84
|
+
error) : undefined,
|
|
85
|
+
this.state.table && this.props.exprItem.expr
|
|
86
|
+
? (react_1.default.createElement("div", { className: "mb-3" },
|
|
87
|
+
react_1.default.createElement(bootstrap_1.Checkbox, { key: "includeLabel", value: this.props.exprItem.includeLabel, onChange: this.handleIncludeLabelChange }, T `Include Label`),
|
|
88
|
+
this.props.exprItem.includeLabel
|
|
89
|
+
? react_1.default.createElement("input", { key: "labelText", className: "form-control", type: "text", value: this.props.exprItem.labelText || "", onChange: this.handleLabelTextChange, placeholder: new expressions_1.ExprUtils(this.props.schema).summarizeExpr(this.props.exprItem.expr) + ": " })
|
|
90
|
+
: undefined))
|
|
91
|
+
: undefined,
|
|
92
|
+
this.renderFormat()));
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
95
|
exports.default = ExprItemEditorComponent;
|
|
@@ -6,6 +6,7 @@ export interface ExprUpdateModalComponentProps {
|
|
|
6
6
|
schema: Schema;
|
|
7
7
|
/** Data source to use to get values */
|
|
8
8
|
dataSource: DataSource;
|
|
9
|
+
/** Optional table that will be filtered to have a single row present. Widget designer should optionally account for this */
|
|
9
10
|
singleRowTable?: string;
|
|
10
11
|
}
|
|
11
12
|
interface ExprUpdateModalComponentState {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mwater/visualization",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
4
4
|
"description": "Visualization library",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,11 +10,6 @@
|
|
|
10
10
|
"build": "rsync -av --exclude '*.ts' --exclude '*.tsx' src/ lib/ ; tsc -p tsconfig.build.json",
|
|
11
11
|
"prepublish": "npm run build"
|
|
12
12
|
},
|
|
13
|
-
"husky": {
|
|
14
|
-
"hooks": {
|
|
15
|
-
"pre-commit": "npm test"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
13
|
"style": "lib/index.css",
|
|
19
14
|
"author": "mWater",
|
|
20
15
|
"license": "MIT",
|
|
@@ -41,7 +36,7 @@
|
|
|
41
36
|
"d3-tip": "^0.9.0",
|
|
42
37
|
"dayjs": "^1.11.10",
|
|
43
38
|
"dompurify": "^1.0.11",
|
|
44
|
-
"ez-localize": "^2.
|
|
39
|
+
"ez-localize": "^2.15.0",
|
|
45
40
|
"file-saver": "^2.0.5",
|
|
46
41
|
"immer": "^8.0.0",
|
|
47
42
|
"immutable-setter": "^1.1.1",
|
|
@@ -75,10 +70,10 @@
|
|
|
75
70
|
"shallowequal": "^0.2.2",
|
|
76
71
|
"update-object": "^1.0.0",
|
|
77
72
|
"utm": "^1.1.1",
|
|
78
|
-
"uuid": "^3.4.0"
|
|
73
|
+
"uuid": "^3.4.0",
|
|
74
|
+
"xlsx-js-style": "^1.2.0"
|
|
79
75
|
},
|
|
80
76
|
"devDependencies": {
|
|
81
|
-
"@kadira/storybook": "^2.21.0",
|
|
82
77
|
"@types/chai": "^4.3.0",
|
|
83
78
|
"@types/color": "^3.0.2",
|
|
84
79
|
"@types/d3": "^5.16.4",
|
|
@@ -101,7 +96,6 @@
|
|
|
101
96
|
"enzyme": "^3.11.0",
|
|
102
97
|
"enzyme-adapter-react-16": "^1.15.5",
|
|
103
98
|
"esbuild": "^0.8.34",
|
|
104
|
-
"husky": "^1.0.0-rc.13",
|
|
105
99
|
"ignore-styles": "^5.0.1",
|
|
106
100
|
"jsdom": "^15.2.1",
|
|
107
101
|
"react-addons-test-utils": "^0.14.0",
|
|
@@ -2,7 +2,7 @@ import _ from "lodash"
|
|
|
2
2
|
import React, { createContext } from "react"
|
|
3
3
|
const R = React.createElement
|
|
4
4
|
|
|
5
|
-
import MWaterTableSelectComponent from "./MWaterTableSelectComponent"
|
|
5
|
+
import MWaterTableSelectComponent from "./mwater_table_selection/MWaterTableSelectComponent"
|
|
6
6
|
import MWaterAddRelatedFormComponent from "./MWaterAddRelatedFormComponent"
|
|
7
7
|
import MWaterAddRelatedIndicatorComponent from "./MWaterAddRelatedIndicatorComponent"
|
|
8
8
|
import MWaterGlobalFiltersComponent from "./MWaterGlobalFiltersComponent"
|
|
@@ -18,7 +18,7 @@ export interface GlobalFiltersElementFactoryProps {
|
|
|
18
18
|
dataSource: DataSource
|
|
19
19
|
filterableTables: string[]
|
|
20
20
|
globalFilters?: GlobalFilter[]
|
|
21
|
-
onChange
|
|
21
|
+
onChange?: (globalFilters: GlobalFilter[]) => void
|
|
22
22
|
|
|
23
23
|
/** If true, return null element if not applicable to filterableTables */
|
|
24
24
|
nullIfIrrelevant?: boolean
|