@mwater/visualization 5.0.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/.prettierrc +11 -0
- package/.storybook/config.js +7 -0
- package/.storybook/head.html +4 -0
- package/.storybook/webpack.config.js +15 -0
- package/.vscode/launch.json +40 -0
- package/LICENSE +21 -0
- package/README.md +19 -0
- package/build-demo.ts +54 -0
- package/lib/CheckboxComponent.d.ts +15 -0
- package/lib/CheckboxComponent.js +25 -0
- package/lib/ColorComponent.d.ts +24 -0
- package/lib/ColorComponent.js +77 -0
- package/lib/ColorSchemeFactory.d.ts +8 -0
- package/lib/ColorSchemeFactory.js +164 -0
- package/lib/CsvBuilder.d.ts +5 -0
- package/lib/CsvBuilder.js +63 -0
- package/lib/DateRangeComponent.d.ts +81 -0
- package/lib/DateRangeComponent.js +190 -0
- package/lib/FiltersDesignerComponent.d.ts +25 -0
- package/lib/FiltersDesignerComponent.js +38 -0
- package/lib/ImplicitFilterBuilder.d.ts +8 -0
- package/lib/ImplicitFilterBuilder.js +114 -0
- package/lib/JsonQLFilter.d.ts +7 -0
- package/lib/JsonQLFilter.js +2 -0
- package/lib/LocaleContextInjector.d.ts +14 -0
- package/lib/LocaleContextInjector.js +20 -0
- package/lib/MWaterAddRelatedFormComponent.d.ts +25 -0
- package/lib/MWaterAddRelatedFormComponent.js +155 -0
- package/lib/MWaterAddRelatedIndicatorComponent.d.ts +31 -0
- package/lib/MWaterAddRelatedIndicatorComponent.js +129 -0
- package/lib/MWaterAssetSystemsListComponent.d.ts +17 -0
- package/lib/MWaterAssetSystemsListComponent.js +78 -0
- package/lib/MWaterCompleteTableSelectComponent.d.ts +224 -0
- package/lib/MWaterCompleteTableSelectComponent.js +680 -0
- package/lib/MWaterContextComponent.d.ts +31 -0
- package/lib/MWaterContextComponent.js +111 -0
- package/lib/MWaterCustomTablesetListComponent.d.ts +17 -0
- package/lib/MWaterCustomTablesetListComponent.js +87 -0
- package/lib/MWaterGlobalFiltersComponent.d.ts +16 -0
- package/lib/MWaterGlobalFiltersComponent.js +103 -0
- package/lib/MWaterLoaderComponent.d.ts +42 -0
- package/lib/MWaterLoaderComponent.js +77 -0
- package/lib/MWaterMetricsTableListComponent.d.ts +17 -0
- package/lib/MWaterMetricsTableListComponent.js +79 -0
- package/lib/MWaterResponsesFilterComponent.d.ts +42 -0
- package/lib/MWaterResponsesFilterComponent.js +145 -0
- package/lib/MWaterTableSelectComponent.d.ts +36 -0
- package/lib/MWaterTableSelectComponent.js +206 -0
- package/lib/MenuItemComponent.d.ts +0 -0
- package/lib/MenuItemComponent.js +3 -0
- package/lib/PopoverComponent.d.ts +15 -0
- package/lib/PopoverComponent.js +49 -0
- package/lib/RadioButtonComponent.d.ts +16 -0
- package/lib/RadioButtonComponent.js +25 -0
- package/lib/TableSelectComponent.d.ts +21 -0
- package/lib/TableSelectComponent.js +68 -0
- package/lib/UIComponents.d.ts +85 -0
- package/lib/UIComponents.js +195 -0
- package/lib/UndoStack.d.ts +11 -0
- package/lib/UndoStack.js +51 -0
- package/lib/VerticalLayoutComponent.d.ts +21 -0
- package/lib/VerticalLayoutComponent.js +76 -0
- package/lib/WidgetScope.d.ts +13 -0
- package/lib/WidgetScope.js +2 -0
- package/lib/axes/Axis.d.ts +81 -0
- package/lib/axes/Axis.js +2 -0
- package/lib/axes/AxisBuilder.d.ts +66 -0
- package/lib/axes/AxisBuilder.js +1202 -0
- package/lib/axes/AxisColorEditorComponent.d.ts +39 -0
- package/lib/axes/AxisColorEditorComponent.js +133 -0
- package/lib/axes/AxisComponent.d.ts +65 -0
- package/lib/axes/AxisComponent.js +359 -0
- package/lib/axes/BinsComponent.d.ts +21 -0
- package/lib/axes/BinsComponent.js +96 -0
- package/lib/axes/CategoryMapComponent.d.ts +41 -0
- package/lib/axes/CategoryMapComponent.js +175 -0
- package/lib/axes/ColorPaletteCollectionComponent.d.ts +17 -0
- package/lib/axes/ColorPaletteCollectionComponent.js +130 -0
- package/lib/axes/RangesComponent.d.ts +35 -0
- package/lib/axes/RangesComponent.js +119 -0
- package/lib/componenttest.d.ts +1 -0
- package/lib/componenttest.js +47 -0
- package/lib/compressJson.d.ts +4 -0
- package/lib/compressJson.js +19 -0
- package/lib/dashboards/DashboardComponent.d.ts +115 -0
- package/lib/dashboards/DashboardComponent.js +297 -0
- package/lib/dashboards/DashboardDataSource.d.ts +9 -0
- package/lib/dashboards/DashboardDataSource.js +14 -0
- package/lib/dashboards/DashboardDesign.d.ts +45 -0
- package/lib/dashboards/DashboardDesign.js +2 -0
- package/lib/dashboards/DashboardUpgrader.d.ts +4 -0
- package/lib/dashboards/DashboardUpgrader.js +95 -0
- package/lib/dashboards/DashboardUtils.d.ts +7 -0
- package/lib/dashboards/DashboardUtils.js +69 -0
- package/lib/dashboards/DashboardViewComponent.d.ts +71 -0
- package/lib/dashboards/DashboardViewComponent.js +235 -0
- package/lib/dashboards/DirectDashboardDataSource.d.ts +31 -0
- package/lib/dashboards/DirectDashboardDataSource.js +62 -0
- package/lib/dashboards/LayoutOptionsComponent.d.ts +11 -0
- package/lib/dashboards/LayoutOptionsComponent.js +119 -0
- package/lib/dashboards/README.md +13 -0
- package/lib/dashboards/ServerDashboardDataSource.d.ts +96 -0
- package/lib/dashboards/ServerDashboardDataSource.js +383 -0
- package/lib/dashboards/SettingsModalComponent.d.ts +33 -0
- package/lib/dashboards/SettingsModalComponent.js +122 -0
- package/lib/dashboards/WidgetComponent.d.ts +53 -0
- package/lib/dashboards/WidgetComponent.js +66 -0
- package/lib/dashboards/layoutOptions.d.ts +19 -0
- package/lib/dashboards/layoutOptions.js +19 -0
- package/lib/datagrids/DatagridComponent.d.ts +122 -0
- package/lib/datagrids/DatagridComponent.js +285 -0
- package/lib/datagrids/DatagridDataSource.d.ts +9 -0
- package/lib/datagrids/DatagridDataSource.js +13 -0
- package/lib/datagrids/DatagridDesign.d.ts +75 -0
- package/lib/datagrids/DatagridDesign.js +2 -0
- package/lib/datagrids/DatagridDesignerComponent.d.ts +114 -0
- package/lib/datagrids/DatagridDesignerComponent.js +389 -0
- package/lib/datagrids/DatagridQueryBuilder.d.ts +68 -0
- package/lib/datagrids/DatagridQueryBuilder.js +540 -0
- package/lib/datagrids/DatagridUtils.d.ts +8 -0
- package/lib/datagrids/DatagridUtils.js +91 -0
- package/lib/datagrids/DatagridViewComponent.d.ts +86 -0
- package/lib/datagrids/DatagridViewComponent.js +321 -0
- package/lib/datagrids/DirectDatagridDataSource.d.ts +20 -0
- package/lib/datagrids/DirectDatagridDataSource.js +62 -0
- package/lib/datagrids/EditExprCellComponent.d.ts +77 -0
- package/lib/datagrids/EditExprCellComponent.js +212 -0
- package/lib/datagrids/ExprCellComponent.d.ts +34 -0
- package/lib/datagrids/ExprCellComponent.js +81 -0
- package/lib/datagrids/FindReplaceModalComponent.d.ts +52 -0
- package/lib/datagrids/FindReplaceModalComponent.js +248 -0
- package/lib/datagrids/LabeledExprGenerator.d.ts +40 -0
- package/lib/datagrids/LabeledExprGenerator.js +252 -0
- package/lib/datagrids/OrderBysDesignerComponent.d.ts +22 -0
- package/lib/datagrids/OrderBysDesignerComponent.js +67 -0
- package/lib/datagrids/README.md +3 -0
- package/lib/datagrids/ServerDatagridDataSource.d.ts +40 -0
- package/lib/datagrids/ServerDatagridDataSource.js +79 -0
- package/lib/demo.d.ts +1 -0
- package/lib/demo.js +4006 -0
- package/lib/demoBlocks.d.ts +1 -0
- package/lib/demoBlocks.js +112 -0
- package/lib/index.css +550 -0
- package/lib/index.d.ts +69 -0
- package/lib/index.js +156 -0
- package/lib/injectTableAlias.d.ts +2 -0
- package/lib/injectTableAlias.js +30 -0
- package/lib/languages.d.ts +9 -0
- package/lib/languages.js +926 -0
- package/lib/layout-styles.css +263 -0
- package/lib/layouts/DecoratedBlockComponent.d.ts +44 -0
- package/lib/layouts/DecoratedBlockComponent.js +96 -0
- package/lib/layouts/DragSourceComponent.d.ts +2 -0
- package/lib/layouts/DragSourceComponent.js +26 -0
- package/lib/layouts/LayoutManager.d.ts +50 -0
- package/lib/layouts/LayoutManager.js +41 -0
- package/lib/layouts/blocks/BlocksDisplayComponent.d.ts +75 -0
- package/lib/layouts/blocks/BlocksDisplayComponent.js +336 -0
- package/lib/layouts/blocks/BlocksLayoutManager.d.ts +36 -0
- package/lib/layouts/blocks/BlocksLayoutManager.js +74 -0
- package/lib/layouts/blocks/ClipboardPaletteItemComponent.d.ts +9 -0
- package/lib/layouts/blocks/ClipboardPaletteItemComponent.js +59 -0
- package/lib/layouts/blocks/DraggableBlockComponent.d.ts +2 -0
- package/lib/layouts/blocks/DraggableBlockComponent.js +163 -0
- package/lib/layouts/blocks/HorizontalBlockComponent.d.ts +31 -0
- package/lib/layouts/blocks/HorizontalBlockComponent.js +191 -0
- package/lib/layouts/blocks/PaletteItemComponent.d.ts +14 -0
- package/lib/layouts/blocks/PaletteItemComponent.js +15 -0
- package/lib/layouts/blocks/README.md +11 -0
- package/lib/layouts/blocks/blockUtils.d.ts +22 -0
- package/lib/layouts/blocks/blockUtils.js +155 -0
- package/lib/layouts/decorated-block.css +100 -0
- package/lib/layouts/grid/GridLayoutComponent.d.ts +23 -0
- package/lib/layouts/grid/GridLayoutComponent.js +49 -0
- package/lib/layouts/grid/GridLayoutManager.d.ts +29 -0
- package/lib/layouts/grid/GridLayoutManager.js +141 -0
- package/lib/layouts/grid/LegoLayoutEngine.d.ts +33 -0
- package/lib/layouts/grid/LegoLayoutEngine.js +129 -0
- package/lib/layouts/grid/PaletteItemComponent.d.ts +14 -0
- package/lib/layouts/grid/PaletteItemComponent.js +15 -0
- package/lib/layouts/grid/README.md +14 -0
- package/lib/layouts/grid/WidgetContainerComponent.d.ts +9 -0
- package/lib/layouts/grid/WidgetContainerComponent.js +333 -0
- package/lib/mWaterLoader.d.ts +26 -0
- package/lib/mWaterLoader.js +55 -0
- package/lib/mapdemo.d.ts +0 -0
- package/lib/mapdemo.js +115 -0
- package/lib/maps/AddLayerComponent.d.ts +22 -0
- package/lib/maps/AddLayerComponent.js +85 -0
- package/lib/maps/AdminScopeAndDetailLevelComponent.d.ts +19 -0
- package/lib/maps/AdminScopeAndDetailLevelComponent.js +59 -0
- package/lib/maps/BaseLayerDesignerComponent.d.ts +28 -0
- package/lib/maps/BaseLayerDesignerComponent.js +57 -0
- package/lib/maps/BingLayer.d.ts +1 -0
- package/lib/maps/BingLayer.js +151 -0
- package/lib/maps/BufferLayer.d.ts +51 -0
- package/lib/maps/BufferLayer.js +816 -0
- package/lib/maps/BufferLayerDesign.d.ts +37 -0
- package/lib/maps/BufferLayerDesign.js +2 -0
- package/lib/maps/BufferLayerDesignerComponent.d.ts +49 -0
- package/lib/maps/BufferLayerDesignerComponent.js +217 -0
- package/lib/maps/ChoroplethLayer.d.ts +74 -0
- package/lib/maps/ChoroplethLayer.js +1515 -0
- package/lib/maps/ChoroplethLayerDesign.d.ts +56 -0
- package/lib/maps/ChoroplethLayerDesign.js +2 -0
- package/lib/maps/ChoroplethLayerDesigner.d.ts +53 -0
- package/lib/maps/ChoroplethLayerDesigner.js +382 -0
- package/lib/maps/ClusterLayer.d.ts +38 -0
- package/lib/maps/ClusterLayer.js +746 -0
- package/lib/maps/ClusterLayerDesign.d.ts +22 -0
- package/lib/maps/ClusterLayerDesign.js +2 -0
- package/lib/maps/ClusterLayerDesignerComponent.d.ts +37 -0
- package/lib/maps/ClusterLayerDesignerComponent.js +110 -0
- package/lib/maps/DetailLevelSelectComponent.d.ts +122 -0
- package/lib/maps/DetailLevelSelectComponent.js +91 -0
- package/lib/maps/DirectMapDataSource.d.ts +68 -0
- package/lib/maps/DirectMapDataSource.js +265 -0
- package/lib/maps/EditHoverOver.d.ts +18 -0
- package/lib/maps/EditHoverOver.js +88 -0
- package/lib/maps/EditPopupComponent.d.ts +26 -0
- package/lib/maps/EditPopupComponent.js +75 -0
- package/lib/maps/Grid Functions.sql +167 -0
- package/lib/maps/GridLayer.d.ts +48 -0
- package/lib/maps/GridLayer.js +684 -0
- package/lib/maps/GridLayerDesign.d.ts +35 -0
- package/lib/maps/GridLayerDesign.js +2 -0
- package/lib/maps/GridLayerDesigner.d.ts +38 -0
- package/lib/maps/GridLayerDesigner.js +229 -0
- package/lib/maps/HoverContent.d.ts +13 -0
- package/lib/maps/HoverContent.js +92 -0
- package/lib/maps/HtmlUrlLegend.d.ts +16 -0
- package/lib/maps/HtmlUrlLegend.js +38 -0
- package/lib/maps/Layer.d.ts +164 -0
- package/lib/maps/Layer.js +193 -0
- package/lib/maps/LayerFactory.d.ts +5 -0
- package/lib/maps/LayerFactory.js +47 -0
- package/lib/maps/LayerLegendComponent.d.ts +23 -0
- package/lib/maps/LayerLegendComponent.js +68 -0
- package/lib/maps/LayerSwitcherComponent.d.ts +7 -0
- package/lib/maps/LayerSwitcherComponent.js +97 -0
- package/lib/maps/LeafletLoading.css +24 -0
- package/lib/maps/LeafletLoading.d.ts +42 -0
- package/lib/maps/LeafletLoading.js +318 -0
- package/lib/maps/LeafletMapComponent.d.ts +141 -0
- package/lib/maps/LeafletMapComponent.js +438 -0
- package/lib/maps/LegendComponent.d.ts +14 -0
- package/lib/maps/LegendComponent.js +74 -0
- package/lib/maps/LegendGroup.d.ts +24 -0
- package/lib/maps/LegendGroup.js +86 -0
- package/lib/maps/MWaterServerLayer.d.ts +40 -0
- package/lib/maps/MWaterServerLayer.js +101 -0
- package/lib/maps/MapBoundsCalculator.d.ts +16 -0
- package/lib/maps/MapBoundsCalculator.js +85 -0
- package/lib/maps/MapComponent.d.ts +98 -0
- package/lib/maps/MapComponent.js +186 -0
- package/lib/maps/MapControlComponent.d.ts +17 -0
- package/lib/maps/MapControlComponent.js +25 -0
- package/lib/maps/MapDataSource.d.ts +18 -0
- package/lib/maps/MapDataSource.js +2 -0
- package/lib/maps/MapDesign.d.ts +77 -0
- package/lib/maps/MapDesign.js +2 -0
- package/lib/maps/MapDesignerComponent.d.ts +39 -0
- package/lib/maps/MapDesignerComponent.js +215 -0
- package/lib/maps/MapFiltersDesignerComponent.d.ts +21 -0
- package/lib/maps/MapFiltersDesignerComponent.js +70 -0
- package/lib/maps/MapLayerDataSource.d.ts +22 -0
- package/lib/maps/MapLayerDataSource.js +2 -0
- package/lib/maps/MapLayerViewDesignerComponent.d.ts +87 -0
- package/lib/maps/MapLayerViewDesignerComponent.js +151 -0
- package/lib/maps/MapLayersDesignerComponent.d.ts +32 -0
- package/lib/maps/MapLayersDesignerComponent.js +98 -0
- package/lib/maps/MapUtils.d.ts +21 -0
- package/lib/maps/MapUtils.js +119 -0
- package/lib/maps/MapViewComponent.d.ts +38 -0
- package/lib/maps/MapViewComponent.js +20 -0
- package/lib/maps/Maptiler-logo.png +0 -0
- package/lib/maps/MarkerSymbolSelectComponent.d.ts +10 -0
- package/lib/maps/MarkerSymbolSelectComponent.js +28 -0
- package/lib/maps/MarkersLayer.d.ts +66 -0
- package/lib/maps/MarkersLayer.js +838 -0
- package/lib/maps/MarkersLayerDesign.d.ts +44 -0
- package/lib/maps/MarkersLayerDesign.js +2 -0
- package/lib/maps/MarkersLayerDesignerComponent.d.ts +56 -0
- package/lib/maps/MarkersLayerDesignerComponent.js +269 -0
- package/lib/maps/PopupFilterJoinsEditComponent.d.ts +30 -0
- package/lib/maps/PopupFilterJoinsEditComponent.js +75 -0
- package/lib/maps/PopupFilterJoinsUtils.d.ts +15 -0
- package/lib/maps/PopupFilterJoinsUtils.js +91 -0
- package/lib/maps/RasterMapViewComponent.d.ts +108 -0
- package/lib/maps/RasterMapViewComponent.js +283 -0
- package/lib/maps/RegionSelectComponent.d.ts +55 -0
- package/lib/maps/RegionSelectComponent.js +61 -0
- package/lib/maps/ScopeAndDetailLevelComponent.d.ts +21 -0
- package/lib/maps/ScopeAndDetailLevelComponent.js +76 -0
- package/lib/maps/ServerMapDataSource.d.ts +86 -0
- package/lib/maps/ServerMapDataSource.js +273 -0
- package/lib/maps/SwitchableTileUrlLayer.d.ts +53 -0
- package/lib/maps/SwitchableTileUrlLayer.js +69 -0
- package/lib/maps/SwitchableTileUrlLayerDesigner.d.ts +14 -0
- package/lib/maps/SwitchableTileUrlLayerDesigner.js +26 -0
- package/lib/maps/TileUrlLayer.d.ts +40 -0
- package/lib/maps/TileUrlLayer.js +96 -0
- package/lib/maps/UtfGridLayer.d.ts +1 -0
- package/lib/maps/UtfGridLayer.js +216 -0
- package/lib/maps/VectorMapViewComponent.css +21 -0
- package/lib/maps/VectorMapViewComponent.d.ts +44 -0
- package/lib/maps/VectorMapViewComponent.js +565 -0
- package/lib/maps/ZoomLevelsComponent.d.ts +15 -0
- package/lib/maps/ZoomLevelsComponent.js +37 -0
- package/lib/maps/mapSymbols.d.ts +6 -0
- package/lib/maps/mapSymbols.js +167 -0
- package/lib/maps/mapboxUtils.d.ts +6 -0
- package/lib/maps/mapboxUtils.js +60 -0
- package/lib/maps/maps.d.ts +36 -0
- package/lib/maps/maps.js +2 -0
- package/lib/maps/marker-icon-2x.png +0 -0
- package/lib/maps/marker-icon.png +0 -0
- package/lib/maps/marker-shadow.png +0 -0
- 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.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/vectorMaps.d.ts +42 -0
- package/lib/maps/vectorMaps.js +331 -0
- package/lib/memoizedDebounce.d.ts +6 -0
- package/lib/memoizedDebounce.js +21 -0
- package/lib/quickfilter/DateExprComponent.d.ts +81 -0
- package/lib/quickfilter/DateExprComponent.js +197 -0
- package/lib/quickfilter/IdArrayQuickfilterComponent.d.ts +24 -0
- package/lib/quickfilter/IdArrayQuickfilterComponent.js +30 -0
- package/lib/quickfilter/Quickfilter.d.ts +21 -0
- package/lib/quickfilter/Quickfilter.js +2 -0
- package/lib/quickfilter/QuickfilterCompiler.d.ts +16 -0
- package/lib/quickfilter/QuickfilterCompiler.js +167 -0
- package/lib/quickfilter/QuickfilterUtils.d.ts +7 -0
- package/lib/quickfilter/QuickfilterUtils.js +106 -0
- package/lib/quickfilter/QuickfiltersComponent.d.ts +293 -0
- package/lib/quickfilter/QuickfiltersComponent.js +257 -0
- package/lib/quickfilter/QuickfiltersDataSource.d.ts +7 -0
- package/lib/quickfilter/QuickfiltersDataSource.js +2 -0
- package/lib/quickfilter/QuickfiltersDesignComponent.d.ts +46 -0
- package/lib/quickfilter/QuickfiltersDesignComponent.js +176 -0
- package/lib/quickfilter/README.md +8 -0
- package/lib/quickfilter/TextLiteralComponent.d.ts +216 -0
- package/lib/quickfilter/TextLiteralComponent.js +128 -0
- package/lib/richtext/ExprItemsHtmlConverter.d.ts +39 -0
- package/lib/richtext/ExprItemsHtmlConverter.js +118 -0
- package/lib/richtext/FontColorPaletteItem.d.ts +23 -0
- package/lib/richtext/FontColorPaletteItem.js +84 -0
- package/lib/richtext/FontSizePaletteItem.d.ts +29 -0
- package/lib/richtext/FontSizePaletteItem.js +70 -0
- package/lib/richtext/ItemsHtmlConverter.d.ts +31 -0
- package/lib/richtext/ItemsHtmlConverter.js +209 -0
- package/lib/richtext/README.md +3 -0
- package/lib/richtext/RichTextComponent.d.ts +84 -0
- package/lib/richtext/RichTextComponent.js +255 -0
- package/lib/valueFormatter.d.ts +16 -0
- package/lib/valueFormatter.js +93 -0
- package/lib/widgets/DirectWidgetDataSource.d.ts +43 -0
- package/lib/widgets/DirectWidgetDataSource.js +39 -0
- package/lib/widgets/DropdownWidgetComponent.d.ts +31 -0
- package/lib/widgets/DropdownWidgetComponent.js +41 -0
- package/lib/widgets/IFrameWidget.d.ts +16 -0
- package/lib/widgets/IFrameWidget.js +38 -0
- package/lib/widgets/IFrameWidgetComponent.d.ts +33 -0
- package/lib/widgets/IFrameWidgetComponent.js +101 -0
- package/lib/widgets/ImageUploaderComponent.d.ts +29 -0
- package/lib/widgets/ImageUploaderComponent.js +91 -0
- package/lib/widgets/ImageWidget.d.ts +49 -0
- package/lib/widgets/ImageWidget.js +112 -0
- package/lib/widgets/ImageWidgetComponent.d.ts +125 -0
- package/lib/widgets/ImageWidgetComponent.js +368 -0
- package/lib/widgets/ImagelistCarouselComponent.d.ts +29 -0
- package/lib/widgets/ImagelistCarouselComponent.js +64 -0
- package/lib/widgets/MapWidget.d.ts +55 -0
- package/lib/widgets/MapWidget.js +167 -0
- package/lib/widgets/MarkdownWidget.d.ts +53 -0
- package/lib/widgets/MarkdownWidget.js +134 -0
- package/lib/widgets/TOCWidget.d.ts +39 -0
- package/lib/widgets/TOCWidget.js +254 -0
- package/lib/widgets/Widget.d.ts +61 -0
- package/lib/widgets/Widget.js +33 -0
- package/lib/widgets/WidgetDataSource.d.ts +20 -0
- package/lib/widgets/WidgetDataSource.js +2 -0
- package/lib/widgets/WidgetFactory.d.ts +4 -0
- package/lib/widgets/WidgetFactory.js +40 -0
- package/lib/widgets/WidgetScoper.d.ts +9 -0
- package/lib/widgets/WidgetScoper.js +49 -0
- package/lib/widgets/WidgetScopesViewComponent.d.ts +26 -0
- package/lib/widgets/WidgetScopesViewComponent.js +36 -0
- package/lib/widgets/charts/Chart.d.ts +57 -0
- package/lib/widgets/charts/Chart.js +83 -0
- package/lib/widgets/charts/ChartViewComponent.d.ts +72 -0
- package/lib/widgets/charts/ChartViewComponent.js +120 -0
- package/lib/widgets/charts/ChartWidget.d.ts +87 -0
- package/lib/widgets/charts/ChartWidget.js +248 -0
- package/lib/widgets/charts/calendar/CalendarChart.d.ts +39 -0
- package/lib/widgets/charts/calendar/CalendarChart.js +175 -0
- package/lib/widgets/charts/calendar/CalendarChartDesignerComponent.d.ts +35 -0
- package/lib/widgets/charts/calendar/CalendarChartDesignerComponent.js +142 -0
- package/lib/widgets/charts/calendar/CalendarChartViewComponent.d.ts +56 -0
- package/lib/widgets/charts/calendar/CalendarChartViewComponent.js +263 -0
- package/lib/widgets/charts/imagemosaic/ImageMosaicChart.d.ts +21 -0
- package/lib/widgets/charts/imagemosaic/ImageMosaicChart.js +183 -0
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.d.ts +28 -0
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.js +105 -0
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.d.ts +31 -0
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.js +87 -0
- package/lib/widgets/charts/imagemosaic/ImagePopupComponent.d.ts +20 -0
- package/lib/widgets/charts/imagemosaic/ImagePopupComponent.js +38 -0
- package/lib/widgets/charts/layered/LayeredChart.d.ts +28 -0
- package/lib/widgets/charts/layered/LayeredChart.js +324 -0
- package/lib/widgets/charts/layered/LayeredChartCompiler.d.ts +113 -0
- package/lib/widgets/charts/layered/LayeredChartCompiler.js +1092 -0
- package/lib/widgets/charts/layered/LayeredChartDesign.d.ts +76 -0
- package/lib/widgets/charts/layered/LayeredChartDesign.js +2 -0
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.d.ts +80 -0
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +317 -0
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.d.ts +72 -0
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +329 -0
- package/lib/widgets/charts/layered/LayeredChartSvgFileSaver.d.ts +5 -0
- package/lib/widgets/charts/layered/LayeredChartSvgFileSaver.js +138 -0
- package/lib/widgets/charts/layered/LayeredChartUtils.d.ts +1 -0
- package/lib/widgets/charts/layered/LayeredChartUtils.js +25 -0
- package/lib/widgets/charts/layered/LayeredChartViewComponent.d.ts +44 -0
- package/lib/widgets/charts/layered/LayeredChartViewComponent.js +406 -0
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.d.ts +115 -0
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.js +235 -0
- package/lib/widgets/charts/pivot/PivotChart.d.ts +36 -0
- package/lib/widgets/charts/pivot/PivotChart.js +343 -0
- package/lib/widgets/charts/pivot/PivotChartDesign.d.ts +88 -0
- package/lib/widgets/charts/pivot/PivotChartDesign.js +2 -0
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +37 -0
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +159 -0
- package/lib/widgets/charts/pivot/PivotChartLayout.d.ts +73 -0
- package/lib/widgets/charts/pivot/PivotChartLayout.js +2 -0
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.d.ts +37 -0
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.js +676 -0
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.d.ts +74 -0
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +333 -0
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.d.ts +31 -0
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.js +263 -0
- package/lib/widgets/charts/pivot/PivotChartUtils.d.ts +12 -0
- package/lib/widgets/charts/pivot/PivotChartUtils.js +195 -0
- package/lib/widgets/charts/pivot/PivotChartViewComponent.d.ts +84 -0
- package/lib/widgets/charts/pivot/PivotChartViewComponent.js +205 -0
- package/lib/widgets/charts/pivot/README.md +30 -0
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +96 -0
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.js +216 -0
- package/lib/widgets/charts/table/OrderingsComponent.d.ts +15 -0
- package/lib/widgets/charts/table/OrderingsComponent.js +66 -0
- package/lib/widgets/charts/table/TableChart.d.ts +57 -0
- package/lib/widgets/charts/table/TableChart.js +310 -0
- package/lib/widgets/charts/table/TableChartDesignerComponent.d.ts +48 -0
- package/lib/widgets/charts/table/TableChartDesignerComponent.js +291 -0
- package/lib/widgets/charts/table/TableChartViewComponent.d.ts +28 -0
- package/lib/widgets/charts/table/TableChartViewComponent.js +206 -0
- package/lib/widgets/text/ExprInsertModalComponent.d.ts +35 -0
- package/lib/widgets/text/ExprInsertModalComponent.js +51 -0
- package/lib/widgets/text/ExprItemEditorComponent.d.ts +34 -0
- package/lib/widgets/text/ExprItemEditorComponent.js +92 -0
- package/lib/widgets/text/ExprUpdateModalComponent.d.ts +33 -0
- package/lib/widgets/text/ExprUpdateModalComponent.js +47 -0
- package/lib/widgets/text/README.md +2 -0
- package/lib/widgets/text/TextComponent.d.ts +48 -0
- package/lib/widgets/text/TextComponent.js +109 -0
- package/lib/widgets/text/TextWidget.d.ts +29 -0
- package/lib/widgets/text/TextWidget.js +243 -0
- package/lib/widgets/text/TextWidgetComponent.d.ts +33 -0
- package/lib/widgets/text/TextWidgetComponent.js +88 -0
- package/lib/widgets/text/TextWidgetDesign.d.ts +6 -0
- package/lib/widgets/text/TextWidgetDesign.js +2 -0
- package/mocha.html +10 -0
- package/package.json +113 -0
- package/server.js +10 -0
- package/src/CheckboxComponent.ts +33 -0
- package/src/ColorComponent.ts +117 -0
- package/src/ColorSchemeFactory.ts +144 -0
- package/src/CsvBuilder.ts +65 -0
- package/src/DateRangeComponent.ts +279 -0
- package/src/FiltersDesignerComponent.ts +55 -0
- package/src/ImplicitFilterBuilder.ts +135 -0
- package/src/JsonQLFilter.ts +8 -0
- package/src/LocaleContextInjector.tsx +17 -0
- package/src/MWaterAddRelatedFormComponent.ts +213 -0
- package/src/MWaterAddRelatedIndicatorComponent.ts +205 -0
- package/src/MWaterAssetSystemsListComponent.tsx +114 -0
- package/src/MWaterCompleteTableSelectComponent.tsx +984 -0
- package/src/MWaterContextComponent.ts +144 -0
- package/src/MWaterCustomTablesetListComponent.tsx +141 -0
- package/src/MWaterGlobalFiltersComponent.ts +117 -0
- package/src/MWaterLoaderComponent.ts +118 -0
- package/src/MWaterMetricsTableListComponent.tsx +120 -0
- package/src/MWaterResponsesFilterComponent.ts +194 -0
- package/src/MWaterTableSelectComponent.ts +316 -0
- package/src/MenuItemComponent.ts +2 -0
- package/src/PopoverComponent.ts +59 -0
- package/src/RadioButtonComponent.ts +34 -0
- package/src/TableSelectComponent.ts +60 -0
- package/src/UIComponents.ts +289 -0
- package/src/UndoStack.ts +59 -0
- package/src/VerticalLayoutComponent.ts +108 -0
- package/src/WidgetScope.ts +17 -0
- package/src/axes/Axis.ts +89 -0
- package/src/axes/AxisBuilder.ts +1325 -0
- package/src/axes/AxisColorEditorComponent.ts +210 -0
- package/src/axes/AxisComponent.ts +449 -0
- package/src/axes/BinsComponent.tsx +169 -0
- package/src/axes/CategoryMapComponent.ts +278 -0
- package/src/axes/ColorPaletteCollectionComponent.ts +163 -0
- package/src/axes/RangesComponent.ts +234 -0
- package/src/color-mixer.d.ts +1 -0
- package/src/componenttest.ts +64 -0
- package/src/compressJson.ts +13 -0
- package/src/dashboards/DashboardComponent.ts +468 -0
- package/src/dashboards/DashboardDataSource.ts +15 -0
- package/src/dashboards/DashboardDesign.ts +57 -0
- package/src/dashboards/DashboardUpgrader.ts +103 -0
- package/src/dashboards/DashboardUtils.ts +82 -0
- package/src/dashboards/DashboardViewComponent.ts +304 -0
- package/src/dashboards/DirectDashboardDataSource.ts +69 -0
- package/src/dashboards/LayoutOptionsComponent.tsx +227 -0
- package/src/dashboards/README.md +13 -0
- package/src/dashboards/ServerDashboardDataSource.ts +520 -0
- package/src/dashboards/SettingsModalComponent.ts +169 -0
- package/src/dashboards/WidgetComponent.tsx +131 -0
- package/src/dashboards/layoutOptions.ts +40 -0
- package/src/datagrids/DatagridComponent.ts +430 -0
- package/src/datagrids/DatagridDataSource.ts +21 -0
- package/src/datagrids/DatagridDesign.ts +94 -0
- package/src/datagrids/DatagridDesignerComponent.tsx +585 -0
- package/src/datagrids/DatagridQueryBuilder.ts +722 -0
- package/src/datagrids/DatagridUtils.ts +74 -0
- package/src/datagrids/DatagridViewComponent.ts +460 -0
- package/src/datagrids/DirectDatagridDataSource.ts +57 -0
- package/src/datagrids/EditExprCellComponent.tsx +305 -0
- package/src/datagrids/ExprCellComponent.ts +104 -0
- package/src/datagrids/FindReplaceModalComponent.ts +354 -0
- package/src/datagrids/LabeledExprGenerator.ts +302 -0
- package/src/datagrids/OrderBysDesignerComponent.tsx +128 -0
- package/src/datagrids/README.md +3 -0
- package/src/datagrids/ServerDatagridDataSource.ts +119 -0
- package/src/datagrids/react-linkify.d.ts +1 -0
- package/src/demo.ts +4148 -0
- package/src/demoBlocks.ts +130 -0
- package/src/globals.d.ts +2 -0
- package/src/index.css +550 -0
- package/src/index.ts +112 -0
- package/src/injectTableAlias.ts +31 -0
- package/src/languages.ts +931 -0
- package/src/layout-styles.css +263 -0
- package/src/layouts/DecoratedBlockComponent.ts +167 -0
- package/src/layouts/DragSourceComponent.ts +35 -0
- package/src/layouts/LayoutManager.ts +86 -0
- package/src/layouts/blocks/BlocksDisplayComponent.ts +461 -0
- package/src/layouts/blocks/BlocksLayoutManager.ts +78 -0
- package/src/layouts/blocks/ClipboardPaletteItemComponent.ts +89 -0
- package/src/layouts/blocks/DraggableBlockComponent.ts +219 -0
- package/src/layouts/blocks/HorizontalBlockComponent.ts +288 -0
- package/src/layouts/blocks/PaletteItemComponent.ts +27 -0
- package/src/layouts/blocks/README.md +11 -0
- package/src/layouts/blocks/blockUtils.ts +207 -0
- package/src/layouts/decorated-block.css +100 -0
- package/src/layouts/grid/GridLayoutComponent.ts +67 -0
- package/src/layouts/grid/GridLayoutManager.ts +185 -0
- package/src/layouts/grid/LegoLayoutEngine.ts +142 -0
- package/src/layouts/grid/PaletteItemComponent.ts +28 -0
- package/src/layouts/grid/README.md +14 -0
- package/src/layouts/grid/WidgetContainerComponent.ts +420 -0
- package/src/mWaterLoader.ts +82 -0
- package/src/mapdemo.ts +127 -0
- package/src/maps/AddLayerComponent.ts +125 -0
- package/src/maps/AdminScopeAndDetailLevelComponent.ts +90 -0
- package/src/maps/BaseLayerDesignerComponent.ts +104 -0
- package/src/maps/BingLayer.ts +156 -0
- package/src/maps/BufferLayer.ts +927 -0
- package/src/maps/BufferLayerDesign.ts +48 -0
- package/src/maps/BufferLayerDesignerComponent.ts +311 -0
- package/src/maps/ChoroplethLayer.ts +1712 -0
- package/src/maps/ChoroplethLayerDesign.ts +73 -0
- package/src/maps/ChoroplethLayerDesigner.tsx +558 -0
- package/src/maps/ClusterLayer.ts +836 -0
- package/src/maps/ClusterLayerDesign.ts +29 -0
- package/src/maps/ClusterLayerDesignerComponent.ts +190 -0
- package/src/maps/DetailLevelSelectComponent.ts +119 -0
- package/src/maps/DirectMapDataSource.ts +386 -0
- package/src/maps/EditHoverOver.tsx +151 -0
- package/src/maps/EditPopupComponent.ts +121 -0
- package/src/maps/Grid Functions.sql +167 -0
- package/src/maps/GridLayer.ts +776 -0
- package/src/maps/GridLayerDesign.ts +53 -0
- package/src/maps/GridLayerDesigner.tsx +332 -0
- package/src/maps/HoverContent.tsx +96 -0
- package/src/maps/HtmlUrlLegend.tsx +44 -0
- package/src/maps/Layer.ts +338 -0
- package/src/maps/LayerFactory.ts +51 -0
- package/src/maps/LayerLegendComponent.ts +88 -0
- package/src/maps/LayerSwitcherComponent.tsx +91 -0
- package/src/maps/LeafletLoading.css +24 -0
- package/src/maps/LeafletLoading.ts +355 -0
- package/src/maps/LeafletMapComponent.tsx +587 -0
- package/src/maps/LegendComponent.tsx +101 -0
- package/src/maps/LegendGroup.ts +120 -0
- package/src/maps/MWaterServerLayer.ts +116 -0
- package/src/maps/MapBoundsCalculator.ts +88 -0
- package/src/maps/MapComponent.ts +312 -0
- package/src/maps/MapControlComponent.ts +46 -0
- package/src/maps/MapDataSource.ts +20 -0
- package/src/maps/MapDesign.ts +103 -0
- package/src/maps/MapDesignerComponent.ts +356 -0
- package/src/maps/MapFiltersDesignerComponent.ts +95 -0
- package/src/maps/MapLayerDataSource.ts +27 -0
- package/src/maps/MapLayerViewDesignerComponent.ts +243 -0
- package/src/maps/MapLayersDesignerComponent.ts +144 -0
- package/src/maps/MapUtils.ts +148 -0
- package/src/maps/MapViewComponent.tsx +62 -0
- package/src/maps/Maptiler-logo.png +0 -0
- package/src/maps/MarkerSymbolSelectComponent.ts +41 -0
- package/src/maps/MarkersLayer.ts +941 -0
- package/src/maps/MarkersLayerDesign.ts +56 -0
- package/src/maps/MarkersLayerDesignerComponent.ts +374 -0
- package/src/maps/PopupFilterJoinsEditComponent.ts +114 -0
- package/src/maps/PopupFilterJoinsUtils.ts +99 -0
- package/src/maps/RasterMapViewComponent.ts +382 -0
- package/src/maps/RegionSelectComponent.ts +80 -0
- package/src/maps/ScopeAndDetailLevelComponent.ts +82 -0
- package/src/maps/ServerMapDataSource.ts +399 -0
- package/src/maps/SwitchableTileUrlLayer.tsx +130 -0
- package/src/maps/SwitchableTileUrlLayerDesigner.tsx +60 -0
- package/src/maps/TileUrlLayer.tsx +142 -0
- package/src/maps/UtfGridLayer.ts +286 -0
- package/src/maps/VectorMapViewComponent.css +21 -0
- package/src/maps/VectorMapViewComponent.tsx +743 -0
- package/src/maps/ZoomLevelsComponent.ts +72 -0
- package/src/maps/mapSymbols.ts +162 -0
- package/src/maps/mapboxUtils.ts +61 -0
- package/src/maps/maps.ts +38 -0
- package/src/maps/marker-icon-2x.png +0 -0
- package/src/maps/marker-icon.png +0 -0
- package/src/maps/marker-shadow.png +0 -0
- package/src/maps/png.d.ts +1 -0
- 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.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/vectorMaps.tsx +410 -0
- package/src/memoizedDebounce.tsx +32 -0
- package/src/quickfilter/DateExprComponent.ts +284 -0
- package/src/quickfilter/IdArrayQuickfilterComponent.ts +58 -0
- package/src/quickfilter/Quickfilter.ts +29 -0
- package/src/quickfilter/QuickfilterCompiler.ts +167 -0
- package/src/quickfilter/QuickfilterUtils.ts +123 -0
- package/src/quickfilter/QuickfiltersComponent.ts +416 -0
- package/src/quickfilter/QuickfiltersDataSource.ts +15 -0
- package/src/quickfilter/QuickfiltersDesignComponent.tsx +257 -0
- package/src/quickfilter/README.md +8 -0
- package/src/quickfilter/TextLiteralComponent.ts +161 -0
- package/src/quickfilter/react-onclickout.d.ts +1 -0
- package/src/richtext/ExprItemsHtmlConverter.ts +144 -0
- package/src/richtext/FontColorPaletteItem.ts +172 -0
- package/src/richtext/FontSizePaletteItem.ts +110 -0
- package/src/richtext/ItemsHtmlConverter.ts +246 -0
- package/src/richtext/README.md +3 -0
- package/src/richtext/RichTextComponent.tsx +390 -0
- package/src/richtext/react-float-affixed.d.ts +1 -0
- package/src/update-object.d.ts +1 -0
- package/src/valueFormatter.ts +110 -0
- package/src/widgets/DirectWidgetDataSource.ts +67 -0
- package/src/widgets/DropdownWidgetComponent.ts +78 -0
- package/src/widgets/IFrameWidget.ts +36 -0
- package/src/widgets/IFrameWidgetComponent.ts +116 -0
- package/src/widgets/ImageUploaderComponent.tsx +143 -0
- package/src/widgets/ImageWidget.ts +147 -0
- package/src/widgets/ImageWidgetComponent.ts +546 -0
- package/src/widgets/ImagelistCarouselComponent.ts +109 -0
- package/src/widgets/MapWidget.ts +219 -0
- package/src/widgets/MarkdownWidget.ts +201 -0
- package/src/widgets/TOCWidget.ts +326 -0
- package/src/widgets/Widget.ts +83 -0
- package/src/widgets/WidgetDataSource.ts +23 -0
- package/src/widgets/WidgetFactory.ts +37 -0
- package/src/widgets/WidgetScoper.ts +51 -0
- package/src/widgets/WidgetScopesViewComponent.ts +54 -0
- package/src/widgets/charts/Chart.ts +140 -0
- package/src/widgets/charts/ChartViewComponent.ts +209 -0
- package/src/widgets/charts/ChartWidget.ts +345 -0
- package/src/widgets/charts/calendar/CalendarChart.ts +227 -0
- package/src/widgets/charts/calendar/CalendarChartDesignerComponent.ts +187 -0
- package/src/widgets/charts/calendar/CalendarChartViewComponent.tsx +320 -0
- package/src/widgets/charts/calendar/d3-tip.d.ts +1 -0
- package/src/widgets/charts/imagemosaic/ImageMosaicChart.ts +213 -0
- package/src/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.ts +121 -0
- package/src/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.ts +117 -0
- package/src/widgets/charts/imagemosaic/ImagePopupComponent.ts +51 -0
- package/src/widgets/charts/imagemosaic/react-lazy-load-image-component.d.ts +1 -0
- package/src/widgets/charts/layered/LayeredChart.ts +361 -0
- package/src/widgets/charts/layered/LayeredChartCompiler.ts +1299 -0
- package/src/widgets/charts/layered/LayeredChartDesign.ts +106 -0
- package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +523 -0
- package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +448 -0
- package/src/widgets/charts/layered/LayeredChartSvgFileSaver.ts +146 -0
- package/src/widgets/charts/layered/LayeredChartUtils.ts +24 -0
- package/src/widgets/charts/layered/LayeredChartViewComponent.ts +486 -0
- package/src/widgets/charts/layered/save-svg-as-png.d.ts +1 -0
- package/src/widgets/charts/pivot/IntersectionDesignerComponent.tsx +338 -0
- package/src/widgets/charts/pivot/PivotChart.ts +377 -0
- package/src/widgets/charts/pivot/PivotChartDesign.ts +115 -0
- package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +240 -0
- package/src/widgets/charts/pivot/PivotChartLayout.ts +99 -0
- package/src/widgets/charts/pivot/PivotChartLayoutBuilder.ts +779 -0
- package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +504 -0
- package/src/widgets/charts/pivot/PivotChartQueryBuilder.ts +273 -0
- package/src/widgets/charts/pivot/PivotChartUtils.ts +219 -0
- package/src/widgets/charts/pivot/PivotChartViewComponent.ts +276 -0
- package/src/widgets/charts/pivot/README.md +30 -0
- package/src/widgets/charts/pivot/SegmentDesignerComponent.tsx +353 -0
- package/src/widgets/charts/table/OrderingsComponent.tsx +119 -0
- package/src/widgets/charts/table/TableChart.ts +420 -0
- package/src/widgets/charts/table/TableChartDesignerComponent.ts +441 -0
- package/src/widgets/charts/table/TableChartViewComponent.ts +327 -0
- package/src/widgets/text/ExprInsertModalComponent.ts +77 -0
- package/src/widgets/text/ExprItemEditorComponent.tsx +164 -0
- package/src/widgets/text/ExprUpdateModalComponent.ts +70 -0
- package/src/widgets/text/README.md +2 -0
- package/src/widgets/text/TextComponent.tsx +151 -0
- package/src/widgets/text/TextWidget.ts +265 -0
- package/src/widgets/text/TextWidgetComponent.ts +120 -0
- package/src/widgets/text/TextWidgetDesign.ts +7 -0
- package/stories/UpdateableComponent.js +29 -0
- package/stories/consoles.js +202 -0
- package/stories/dashboards.js +217 -0
- package/stories/datagridDesign.js +114 -0
- package/stories/datagrids.js +69 -0
- package/stories/dates.js +80 -0
- package/stories/exprcomponent.js +43 -0
- package/stories/index.js +18 -0
- package/stories/leaflet.js +59 -0
- package/stories/maps.js +24 -0
- package/stories/pivotChart.js +235 -0
- package/test/AxisBuilderTests.ts +931 -0
- package/test/ChartWidgetTests.ts +85 -0
- package/test/ColorSchemeFactoryTests.ts +29 -0
- package/test/CsvBuilderTests.ts +22 -0
- package/test/DashboardUpgraderTests.ts +170 -0
- package/test/ImplicitFilterBuilderTests.ts +161 -0
- package/test/LayeredChartCompilerTests.ts +1067 -0
- package/test/LayeredChartTests.ts +88 -0
- package/test/LegoLayoutEngineTests.ts +69 -0
- package/test/MWaterGlobalFiltersComponentTests.ts +130 -0
- package/test/MWaterResponsesFilterComponentTests.ts +164 -0
- package/test/QuickfilterCompilerTests.ts +167 -0
- package/test/TestComponent.ts +49 -0
- package/test/UndoStackTests.ts +73 -0
- package/test/WidgetScoperTests.ts +35 -0
- package/test/blockUtilsTests.ts +290 -0
- package/test/canonical-json.d.ts +1 -0
- package/test/dashboards/DashboardUtilsTests.ts +131 -0
- package/test/datagrids/DatagridQueryBuilderTests.ts +445 -0
- package/test/datagrids/DatagridUtilsTests.ts +54 -0
- package/test/datagrids/LabeledExprGeneratorTests.ts +121 -0
- package/test/fixtures.ts +263 -0
- package/test/index.ts +2 -0
- package/test/maps/MapUtilsTests.ts +168 -0
- package/test/maps/PopupFilterJoinsUtilsTests.ts +105 -0
- package/test/richtext/ItemsHtmlConverterTests.ts +41 -0
- package/test/test_index.ts +4 -0
- package/test/widgets/TextWidgetTests.ts +42 -0
- package/test/widgets/charts/pivot/PivotChartLayoutBuilderTests.ts +817 -0
- package/test/widgets/charts/pivot/PivotChartQueryBuilderTests.ts +359 -0
- package/test/widgets/charts/pivot/PivotChartTests.ts +64 -0
- package/test/widgets/charts/pivot/PivotChartUtilsTests.ts +184 -0
- package/test/widgets/charts/table/TableChartTests.ts +253 -0
- package/tsconfig.build.json +26 -0
- package/types/utm.d.ts +10 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Schema, DataSource } from "@mwater/expressions";
|
|
3
|
+
import { JsonQLFilter } from "../JsonQLFilter";
|
|
4
|
+
import { WidgetScope } from "../WidgetScope";
|
|
5
|
+
import DashboardDataSource from "./DashboardDataSource";
|
|
6
|
+
/**
|
|
7
|
+
* Component which renders a widget and ensures that props do not change
|
|
8
|
+
* unnecessarily.
|
|
9
|
+
*/
|
|
10
|
+
export declare function WidgetComponent(props: {
|
|
11
|
+
/** Widget id */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Widget type */
|
|
14
|
+
type: string;
|
|
15
|
+
/** Widget design */
|
|
16
|
+
design: any;
|
|
17
|
+
/** Called with new widget design. null/undefined for readonly **/
|
|
18
|
+
onDesignChange?: {
|
|
19
|
+
(design: object): void;
|
|
20
|
+
} | null;
|
|
21
|
+
/** Data source for dashboard */
|
|
22
|
+
dashboardDataSource: DashboardDataSource;
|
|
23
|
+
/** schema to use **/
|
|
24
|
+
schema: Schema;
|
|
25
|
+
/** data source to use. Only used when designing, for display uses widgetDataSource **/
|
|
26
|
+
dataSource: DataSource;
|
|
27
|
+
/** scope of the widget (when the widget self-selects a particular scope) **/
|
|
28
|
+
scope?: WidgetScope | null;
|
|
29
|
+
/** array of filters to apply.**/
|
|
30
|
+
filters: JsonQLFilter[];
|
|
31
|
+
/** called with scope of widget **/
|
|
32
|
+
onScopeChange: (scope: WidgetScope | null) => void;
|
|
33
|
+
/** width in pixels on screen **/
|
|
34
|
+
width?: number;
|
|
35
|
+
/** height in pixels on screen **/
|
|
36
|
+
height?: number;
|
|
37
|
+
/** optional table name of table that will be filtered to have a single row present. Widget designer should optionally account for this **/
|
|
38
|
+
singleRowTable?: string;
|
|
39
|
+
/** Called with (tableId, rowId) when item is clicked **/
|
|
40
|
+
onRowClick?: (tableId: string, rowId: any) => void;
|
|
41
|
+
/** Optional lookup of string name to value. Used for {{branding}} and other replacement strings in text widget */
|
|
42
|
+
namedStrings?: {
|
|
43
|
+
[key: string]: string;
|
|
44
|
+
};
|
|
45
|
+
/** Entries in the table of content */
|
|
46
|
+
tocEntries?: string[];
|
|
47
|
+
/** the widget callback ref */
|
|
48
|
+
widgetRef: (widget: any) => void;
|
|
49
|
+
/** called with (widgetId, tocEntryId) to scroll to TOC entry */
|
|
50
|
+
onScrollToTOCEntry?: (widgetId: string, tocEntryId: string) => void;
|
|
51
|
+
/** Change to force a refresh */
|
|
52
|
+
refreshKey?: any;
|
|
53
|
+
}): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WidgetComponent = void 0;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const WidgetFactory_1 = __importDefault(require("../widgets/WidgetFactory"));
|
|
9
|
+
/**
|
|
10
|
+
* Component which renders a widget and ensures that props do not change
|
|
11
|
+
* unnecessarily.
|
|
12
|
+
*/
|
|
13
|
+
function WidgetComponent(props) {
|
|
14
|
+
// Get and stabilize widget data source
|
|
15
|
+
// TODO!!! There is a global problem with DashboardDataSources being re-created on each render.
|
|
16
|
+
// TODO!!! This now only uses the type of the dashboard data source. They should be more stable in the future.
|
|
17
|
+
const widgetDataSource = (0, react_1.useMemo)(() => props.dashboardDataSource.getWidgetDataSource(props.type, props.id), [props.dashboardDataSource.constructor, props.type, props.id, props.schema, props.dataSource, props.refreshKey]);
|
|
18
|
+
const widget = WidgetFactory_1.default.createWidget(props.type);
|
|
19
|
+
// Stabilize functions
|
|
20
|
+
const onDesignChange = useStabilizeFunction(props.onDesignChange);
|
|
21
|
+
const onRowClick = useStabilizeFunction(props.onRowClick) || undefined;
|
|
22
|
+
const onScopeChange = useStabilizeFunction(props.onScopeChange);
|
|
23
|
+
const widgetRef = useStabilizeFunction(props.widgetRef);
|
|
24
|
+
// Stabilize values
|
|
25
|
+
const filters = useStabilizeValue(props.filters);
|
|
26
|
+
const scope = useStabilizeValue(props.scope);
|
|
27
|
+
return widget.createViewElement({
|
|
28
|
+
schema: props.schema,
|
|
29
|
+
dataSource: props.dataSource,
|
|
30
|
+
widgetDataSource,
|
|
31
|
+
design: props.design,
|
|
32
|
+
scope,
|
|
33
|
+
filters,
|
|
34
|
+
onScopeChange,
|
|
35
|
+
onDesignChange,
|
|
36
|
+
width: props.width,
|
|
37
|
+
height: props.height,
|
|
38
|
+
singleRowTable: props.singleRowTable,
|
|
39
|
+
onRowClick,
|
|
40
|
+
namedStrings: props.namedStrings,
|
|
41
|
+
tocEntries: props.tocEntries,
|
|
42
|
+
onScrollToTOCEntry: props.onScrollToTOCEntry,
|
|
43
|
+
widgetRef
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
exports.WidgetComponent = WidgetComponent;
|
|
47
|
+
/** Always returns the same function to prevent unnecessary re-rendering. Forwards to the real function */
|
|
48
|
+
function useStabilizeFunction(func) {
|
|
49
|
+
// Create ref for changing func
|
|
50
|
+
const variableRef = (0, react_1.useRef)();
|
|
51
|
+
variableRef.current = func;
|
|
52
|
+
// Create stable function to always use as callback
|
|
53
|
+
function stableCallback(...args) {
|
|
54
|
+
return variableRef.current.apply(null, args);
|
|
55
|
+
}
|
|
56
|
+
const stableRef = (0, react_1.useRef)(stableCallback);
|
|
57
|
+
return func ? stableRef.current : undefined;
|
|
58
|
+
}
|
|
59
|
+
/** Always returns the same value of stringifies the same to prevent unnecessary re-rendering */
|
|
60
|
+
function useStabilizeValue(value) {
|
|
61
|
+
const stableRef = (0, react_1.useRef)(value);
|
|
62
|
+
if (JSON.stringify(value) != JSON.stringify(stableRef.current)) {
|
|
63
|
+
stableRef.current = value;
|
|
64
|
+
}
|
|
65
|
+
return stableRef.current;
|
|
66
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DashboardDesign } from "./DashboardDesign";
|
|
2
|
+
export type DashboardTheme = "default" | "greybg" | "story";
|
|
3
|
+
/** Width buckets for dashboards */
|
|
4
|
+
export type WidthBucket = "sm" | "md" | "lg" | "xl";
|
|
5
|
+
export interface BlocksLayoutOptions {
|
|
6
|
+
/** Width at which to collapse columns. Null to not collapse */
|
|
7
|
+
collapseColumnsWidth: number | null;
|
|
8
|
+
/** Width below which scales or scrolls */
|
|
9
|
+
minimumWidth: number | null;
|
|
10
|
+
/** What to do when below minimum width */
|
|
11
|
+
belowMinimumWidth: "scale" | "scroll";
|
|
12
|
+
/** Width above which pads */
|
|
13
|
+
maximumWidth: number | null;
|
|
14
|
+
/** Width at which to hide quickfilters. Null for never */
|
|
15
|
+
hideQuickfiltersWidth: number | null;
|
|
16
|
+
}
|
|
17
|
+
/** Get default layout options for a theme */
|
|
18
|
+
export declare function getDefaultLayoutOptions(theme?: DashboardTheme | undefined): BlocksLayoutOptions;
|
|
19
|
+
export declare function getLayoutOptions(design: DashboardDesign): BlocksLayoutOptions;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLayoutOptions = exports.getDefaultLayoutOptions = void 0;
|
|
4
|
+
/** Get default layout options for a theme */
|
|
5
|
+
function getDefaultLayoutOptions(theme) {
|
|
6
|
+
theme = theme || "default";
|
|
7
|
+
return {
|
|
8
|
+
collapseColumnsWidth: 600,
|
|
9
|
+
minimumWidth: theme == "story" ? 400 : 600,
|
|
10
|
+
belowMinimumWidth: "scale",
|
|
11
|
+
maximumWidth: theme == "story" ? 1000 : 1600,
|
|
12
|
+
hideQuickfiltersWidth: 600
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
exports.getDefaultLayoutOptions = getDefaultLayoutOptions;
|
|
16
|
+
function getLayoutOptions(design) {
|
|
17
|
+
return design.layoutOptions || getDefaultLayoutOptions(design.style);
|
|
18
|
+
}
|
|
19
|
+
exports.getLayoutOptions = getLayoutOptions;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { DataSource, Expr, Schema } from "@mwater/expressions";
|
|
3
|
+
import DatagridViewComponent, { RowUpdate } from "./DatagridViewComponent";
|
|
4
|
+
import FindReplaceModalComponent from "./FindReplaceModalComponent";
|
|
5
|
+
import DatagridDataSource from "./DatagridDataSource";
|
|
6
|
+
import { DatagridDesign, JsonQLFilter } from "..";
|
|
7
|
+
export interface DatagridComponentProps {
|
|
8
|
+
/** schema to use */
|
|
9
|
+
schema: Schema;
|
|
10
|
+
/** dataSource to use */
|
|
11
|
+
dataSource: DataSource;
|
|
12
|
+
/** datagrid dataSource to use */
|
|
13
|
+
datagridDataSource: DatagridDataSource;
|
|
14
|
+
design: DatagridDesign;
|
|
15
|
+
/** Called when design changes */
|
|
16
|
+
onDesignChange?: (design: DatagridDesign) => void;
|
|
17
|
+
/** Extra element to include in title at left */
|
|
18
|
+
titleElem?: ReactNode;
|
|
19
|
+
/** Extra elements to add to right */
|
|
20
|
+
extraTitleButtonsElem?: ReactNode;
|
|
21
|
+
/** Check if a value is editable by testing if underlying expression is editable */
|
|
22
|
+
canEditExpr?: (tableId: string, rowId: any, expr: Expr) => Promise<boolean>;
|
|
23
|
+
/** Update cell values by updating set of expressions and values */
|
|
24
|
+
updateExprValues?: (tableId: string, rowUpdates: RowUpdate[]) => Promise<void>;
|
|
25
|
+
/** Called when row is clicked with (tableId, rowId) */
|
|
26
|
+
onRowClick?: (tableId: string, rowId: any) => void;
|
|
27
|
+
/** Called when row is double-clicked with (tableId, rowId) */
|
|
28
|
+
onRowDoubleClick?: (tableId: string, rowId: any) => void;
|
|
29
|
+
/** Locked quickfilter values. See README in quickfilters */
|
|
30
|
+
quickfilterLocks?: any[];
|
|
31
|
+
filters?: JsonQLFilter[];
|
|
32
|
+
}
|
|
33
|
+
export default class DatagridComponent extends React.Component<DatagridComponentProps, {
|
|
34
|
+
/** is design being edited */
|
|
35
|
+
editingDesign: boolean;
|
|
36
|
+
/** True if cells can be edited directly */
|
|
37
|
+
cellEditingEnabled: boolean;
|
|
38
|
+
/** Height of quickfilters */
|
|
39
|
+
quickfiltersHeight: number | null;
|
|
40
|
+
quickfiltersValues: null | any[];
|
|
41
|
+
}> {
|
|
42
|
+
datagridView?: DatagridViewComponent | null;
|
|
43
|
+
quickfilters?: HTMLElement | null;
|
|
44
|
+
findReplaceModal: FindReplaceModalComponent | null;
|
|
45
|
+
constructor(props: DatagridComponentProps);
|
|
46
|
+
reload(): void | undefined;
|
|
47
|
+
componentDidMount(): void;
|
|
48
|
+
componentDidUpdate(): void;
|
|
49
|
+
updateHeight(): void;
|
|
50
|
+
getQuickfilterValues: () => any[];
|
|
51
|
+
getQuickfilterFilters: () => JsonQLFilter[];
|
|
52
|
+
handleCellEditingToggle: () => void;
|
|
53
|
+
handleEdit: () => void;
|
|
54
|
+
getCompiledFilters(): JsonQLFilter[];
|
|
55
|
+
renderCellEdit(): React.DetailedReactHTMLElement<{
|
|
56
|
+
key: string;
|
|
57
|
+
className: string;
|
|
58
|
+
onClick: () => void;
|
|
59
|
+
}, HTMLElement> | null;
|
|
60
|
+
renderEditButton(): React.DetailedReactHTMLElement<{
|
|
61
|
+
type: string;
|
|
62
|
+
className: string;
|
|
63
|
+
onClick: () => void;
|
|
64
|
+
}, HTMLElement> | null;
|
|
65
|
+
renderFindReplace(): React.DetailedReactHTMLElement<{
|
|
66
|
+
key: string;
|
|
67
|
+
className: string;
|
|
68
|
+
onClick: () => void;
|
|
69
|
+
}, HTMLElement> | null;
|
|
70
|
+
renderTitleBar(): React.DetailedReactHTMLElement<{
|
|
71
|
+
style: {
|
|
72
|
+
position: "absolute";
|
|
73
|
+
top: number;
|
|
74
|
+
left: number;
|
|
75
|
+
right: number;
|
|
76
|
+
height: number;
|
|
77
|
+
padding: number;
|
|
78
|
+
};
|
|
79
|
+
}, HTMLElement>;
|
|
80
|
+
renderQuickfilter(): React.DetailedReactHTMLElement<{
|
|
81
|
+
style: {
|
|
82
|
+
position: "absolute";
|
|
83
|
+
top: number;
|
|
84
|
+
left: number;
|
|
85
|
+
right: number;
|
|
86
|
+
};
|
|
87
|
+
ref: (c: HTMLElement | null) => void;
|
|
88
|
+
}, HTMLElement>;
|
|
89
|
+
renderEditor(): React.CElement<DatagridEditorComponentProps, DatagridEditorComponent> | undefined;
|
|
90
|
+
renderFindReplaceModal(filters: any): React.CElement<any, FindReplaceModalComponent>;
|
|
91
|
+
render(): React.DetailedReactHTMLElement<{
|
|
92
|
+
style: {
|
|
93
|
+
width: string;
|
|
94
|
+
height: string;
|
|
95
|
+
position: "relative";
|
|
96
|
+
paddingTop: number;
|
|
97
|
+
};
|
|
98
|
+
}, HTMLElement>;
|
|
99
|
+
}
|
|
100
|
+
interface DatagridEditorComponentProps {
|
|
101
|
+
schema: Schema;
|
|
102
|
+
dataSource: DataSource;
|
|
103
|
+
design: DatagridDesign;
|
|
104
|
+
onDesignChange: (design: DatagridDesign) => void;
|
|
105
|
+
onCancel: () => void;
|
|
106
|
+
}
|
|
107
|
+
/** Popup editor */
|
|
108
|
+
declare class DatagridEditorComponent extends React.Component<DatagridEditorComponentProps, {
|
|
109
|
+
design: DatagridDesign;
|
|
110
|
+
}> {
|
|
111
|
+
constructor(props: DatagridEditorComponentProps);
|
|
112
|
+
render(): React.CElement<{
|
|
113
|
+
onAction: () => void;
|
|
114
|
+
onCancel: () => void;
|
|
115
|
+
size: string;
|
|
116
|
+
}, React.Component<{
|
|
117
|
+
onAction: () => void;
|
|
118
|
+
onCancel: () => void;
|
|
119
|
+
size: string;
|
|
120
|
+
}, any, any>>;
|
|
121
|
+
}
|
|
122
|
+
export {};
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const R = react_1.default.createElement;
|
|
9
|
+
const AutoSizeComponent_1 = __importDefault(require("@mwater/react-library/lib/AutoSizeComponent"));
|
|
10
|
+
const ActionCancelModalComponent_1 = __importDefault(require("@mwater/react-library/lib/ActionCancelModalComponent"));
|
|
11
|
+
const expressions_1 = require("@mwater/expressions");
|
|
12
|
+
const expressions_2 = require("@mwater/expressions");
|
|
13
|
+
const expressions_3 = require("@mwater/expressions");
|
|
14
|
+
const DatagridViewComponent_1 = __importDefault(require("./DatagridViewComponent"));
|
|
15
|
+
const DatagridDesignerComponent_1 = __importDefault(require("./DatagridDesignerComponent"));
|
|
16
|
+
const DatagridUtils_1 = __importDefault(require("./DatagridUtils"));
|
|
17
|
+
const QuickfiltersComponent_1 = __importDefault(require("../quickfilter/QuickfiltersComponent"));
|
|
18
|
+
const QuickfilterCompiler_1 = __importDefault(require("../quickfilter/QuickfilterCompiler"));
|
|
19
|
+
const FindReplaceModalComponent_1 = __importDefault(require("./FindReplaceModalComponent"));
|
|
20
|
+
// Datagrid with decorations
|
|
21
|
+
// See README.md for description of datagrid format
|
|
22
|
+
// Design should be cleaned already before being passed in (see DatagridUtils)
|
|
23
|
+
class DatagridComponent extends react_1.default.Component {
|
|
24
|
+
datagridView;
|
|
25
|
+
quickfilters;
|
|
26
|
+
findReplaceModal;
|
|
27
|
+
constructor(props) {
|
|
28
|
+
super(props);
|
|
29
|
+
this.state = {
|
|
30
|
+
editingDesign: false,
|
|
31
|
+
cellEditingEnabled: false,
|
|
32
|
+
quickfiltersHeight: null,
|
|
33
|
+
quickfiltersValues: null
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
reload() {
|
|
37
|
+
return this.datagridView?.reload();
|
|
38
|
+
}
|
|
39
|
+
componentDidMount() {
|
|
40
|
+
return this.updateHeight();
|
|
41
|
+
}
|
|
42
|
+
componentDidUpdate() {
|
|
43
|
+
return this.updateHeight();
|
|
44
|
+
}
|
|
45
|
+
updateHeight() {
|
|
46
|
+
// Calculate quickfilters height
|
|
47
|
+
if (this.quickfilters) {
|
|
48
|
+
if (this.state.quickfiltersHeight !== this.quickfilters.offsetHeight) {
|
|
49
|
+
return this.setState({ quickfiltersHeight: this.quickfilters.offsetHeight });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
return this.setState({ quickfiltersHeight: 0 });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// Get the values of the quick filters
|
|
57
|
+
getQuickfilterValues = () => {
|
|
58
|
+
return this.state.quickfiltersValues || [];
|
|
59
|
+
};
|
|
60
|
+
// Get filters that are applied by the quickfilters
|
|
61
|
+
getQuickfilterFilters = () => {
|
|
62
|
+
return new QuickfilterCompiler_1.default(this.props.schema).compile(this.props.design.quickfilters, this.state.quickfiltersValues, this.props.quickfilterLocks);
|
|
63
|
+
};
|
|
64
|
+
handleCellEditingToggle = () => {
|
|
65
|
+
if (this.state.cellEditingEnabled) {
|
|
66
|
+
return this.setState({ cellEditingEnabled: false });
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
if (confirm(T("Turn on cell editing? This will allow you to edit the live data and is an advanced feature."))) {
|
|
70
|
+
return this.setState({ cellEditingEnabled: true });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
handleEdit = () => {
|
|
75
|
+
return this.setState({ editingDesign: true });
|
|
76
|
+
};
|
|
77
|
+
// Get datagrid filter compiled for quickfilter filtering
|
|
78
|
+
getCompiledFilters() {
|
|
79
|
+
let jsonql;
|
|
80
|
+
const exprCompiler = new expressions_2.ExprCompiler(this.props.schema);
|
|
81
|
+
const exprUtils = new expressions_1.ExprUtils(this.props.schema);
|
|
82
|
+
const exprCleaner = new expressions_3.ExprCleaner(this.props.schema);
|
|
83
|
+
const compiledFilters = [];
|
|
84
|
+
if (this.props.design.filter) {
|
|
85
|
+
// First clean the filter
|
|
86
|
+
const cleanExpr = exprCleaner.cleanExpr(this.props.design.filter, { table: this.props.design.table });
|
|
87
|
+
jsonql = exprCompiler.compileExpr({ expr: cleanExpr, tableAlias: "{alias}" });
|
|
88
|
+
if (jsonql) {
|
|
89
|
+
compiledFilters.push({
|
|
90
|
+
table: this.props.design.table,
|
|
91
|
+
jsonql
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// Add global filters
|
|
96
|
+
for (let filter of this.props.design.globalFilters || []) {
|
|
97
|
+
// Check if exists and is correct type
|
|
98
|
+
const column = this.props.schema.getColumn(this.props.design.table, filter.columnId);
|
|
99
|
+
if (!column) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const columnExpr = { type: "field", table: this.props.design.table, column: column.id };
|
|
103
|
+
if (exprUtils.getExprType(columnExpr) !== filter.columnType) {
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
// Create expr
|
|
107
|
+
let expr = {
|
|
108
|
+
type: "op",
|
|
109
|
+
op: filter.op,
|
|
110
|
+
table: this.props.design.table,
|
|
111
|
+
exprs: [columnExpr].concat(filter.exprs)
|
|
112
|
+
};
|
|
113
|
+
// Clean expr
|
|
114
|
+
expr = exprCleaner.cleanExpr(expr, { table: this.props.design.table });
|
|
115
|
+
jsonql = exprCompiler.compileExpr({ expr, tableAlias: "{alias}" });
|
|
116
|
+
if (jsonql) {
|
|
117
|
+
compiledFilters.push({
|
|
118
|
+
table: this.props.design.table,
|
|
119
|
+
jsonql
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return compiledFilters;
|
|
124
|
+
}
|
|
125
|
+
// Toggle to allow cell editing
|
|
126
|
+
renderCellEdit() {
|
|
127
|
+
if (!this.props.canEditExpr) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
const label = [
|
|
131
|
+
R("i", { className: this.state.cellEditingEnabled ? "fa fa-fw fa-check-square" : "fa fa-fw fa-square-o" }),
|
|
132
|
+
" ",
|
|
133
|
+
T("Cell Editing")
|
|
134
|
+
];
|
|
135
|
+
return R("a", {
|
|
136
|
+
key: "cell-edit",
|
|
137
|
+
className: "btn btn-link btn-sm",
|
|
138
|
+
onClick: this.handleCellEditingToggle
|
|
139
|
+
}, label);
|
|
140
|
+
}
|
|
141
|
+
renderEditButton() {
|
|
142
|
+
if (!this.props.onDesignChange) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
return R("button", {
|
|
146
|
+
type: "button",
|
|
147
|
+
className: "btn btn-primary",
|
|
148
|
+
onClick: this.handleEdit
|
|
149
|
+
}, R("span", { className: "fas fa-cog" }), " ", T("Settings"));
|
|
150
|
+
}
|
|
151
|
+
renderFindReplace() {
|
|
152
|
+
if (!this.state.cellEditingEnabled) {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
return R("a", {
|
|
156
|
+
key: "findreplace",
|
|
157
|
+
className: "btn btn-link btn-sm",
|
|
158
|
+
onClick: () => this.findReplaceModal.show()
|
|
159
|
+
}, T("Find/Replace"));
|
|
160
|
+
}
|
|
161
|
+
renderTitleBar() {
|
|
162
|
+
return R("div", { style: { position: "absolute", top: 0, left: 0, right: 0, height: 40, padding: 4 } }, R("div", { style: { float: "right" } }, this.renderFindReplace(), this.renderCellEdit(), this.renderEditButton(), this.props.extraTitleButtonsElem), this.props.titleElem);
|
|
163
|
+
}
|
|
164
|
+
renderQuickfilter() {
|
|
165
|
+
return R("div", {
|
|
166
|
+
style: { position: "absolute", top: 40, left: 0, right: 0 },
|
|
167
|
+
ref: (c) => {
|
|
168
|
+
this.quickfilters = c;
|
|
169
|
+
}
|
|
170
|
+
}, R(QuickfiltersComponent_1.default, {
|
|
171
|
+
design: this.props.design.quickfilters,
|
|
172
|
+
schema: this.props.schema,
|
|
173
|
+
dataSource: this.props.dataSource,
|
|
174
|
+
quickfiltersDataSource: this.props.datagridDataSource.getQuickfiltersDataSource(),
|
|
175
|
+
values: this.state.quickfiltersValues || [],
|
|
176
|
+
onValuesChange: (values) => this.setState({ quickfiltersValues: values }),
|
|
177
|
+
locks: this.props.quickfilterLocks,
|
|
178
|
+
filters: this.getCompiledFilters()
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
// Renders the editor modal
|
|
182
|
+
renderEditor() {
|
|
183
|
+
if (!this.state.editingDesign) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
return R(DatagridEditorComponent, {
|
|
187
|
+
schema: this.props.schema,
|
|
188
|
+
dataSource: this.props.dataSource,
|
|
189
|
+
design: this.props.design,
|
|
190
|
+
onDesignChange: (design) => {
|
|
191
|
+
// If quickfilters have changed, reset values
|
|
192
|
+
if (!lodash_1.default.isEqual(this.props.design.quickfilters, design.quickfilters)) {
|
|
193
|
+
this.setState({ quickfiltersValues: null });
|
|
194
|
+
}
|
|
195
|
+
this.props.onDesignChange(design);
|
|
196
|
+
return this.setState({ editingDesign: false });
|
|
197
|
+
},
|
|
198
|
+
onCancel: () => this.setState({ editingDesign: false })
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
renderFindReplaceModal(filters) {
|
|
202
|
+
return R(FindReplaceModalComponent_1.default, {
|
|
203
|
+
ref: (c) => {
|
|
204
|
+
this.findReplaceModal = c;
|
|
205
|
+
},
|
|
206
|
+
schema: this.props.schema,
|
|
207
|
+
dataSource: this.props.dataSource,
|
|
208
|
+
datagridDataSource: this.props.datagridDataSource,
|
|
209
|
+
design: this.props.design,
|
|
210
|
+
filters,
|
|
211
|
+
updateExprValues: this.props.updateExprValues,
|
|
212
|
+
onUpdate: () => {
|
|
213
|
+
// Reload
|
|
214
|
+
return this.datagridView?.reload();
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
render() {
|
|
219
|
+
let filters = this.props.filters || [];
|
|
220
|
+
// Compile quickfilters
|
|
221
|
+
filters = filters.concat(this.getQuickfilterFilters());
|
|
222
|
+
return R("div", {
|
|
223
|
+
style: {
|
|
224
|
+
width: "100%",
|
|
225
|
+
height: "100%",
|
|
226
|
+
position: "relative",
|
|
227
|
+
paddingTop: 40 + (this.state.quickfiltersHeight || 0)
|
|
228
|
+
}
|
|
229
|
+
}, this.renderTitleBar(), this.renderQuickfilter(), this.renderEditor(), this.renderFindReplaceModal(filters), R(AutoSizeComponent_1.default, { injectWidth: true, injectHeight: true }, (size) => {
|
|
230
|
+
// Clean before displaying
|
|
231
|
+
const design = new DatagridUtils_1.default(this.props.schema).cleanDesign(this.props.design);
|
|
232
|
+
if (!new DatagridUtils_1.default(this.props.schema).validateDesign(design)) {
|
|
233
|
+
return R(DatagridViewComponent_1.default, {
|
|
234
|
+
ref: (view) => {
|
|
235
|
+
this.datagridView = view;
|
|
236
|
+
},
|
|
237
|
+
width: size.width - 1,
|
|
238
|
+
height: size.height - 1,
|
|
239
|
+
pageSize: 100,
|
|
240
|
+
schema: this.props.schema,
|
|
241
|
+
dataSource: this.props.dataSource,
|
|
242
|
+
datagridDataSource: this.props.datagridDataSource,
|
|
243
|
+
design,
|
|
244
|
+
filters,
|
|
245
|
+
onDesignChange: this.props.onDesignChange,
|
|
246
|
+
onRowClick: this.props.onRowClick,
|
|
247
|
+
onRowDoubleClick: this.props.onRowDoubleClick,
|
|
248
|
+
canEditExpr: this.state.cellEditingEnabled ? this.props.canEditExpr : undefined,
|
|
249
|
+
updateExprValues: this.state.cellEditingEnabled ? this.props.updateExprValues : undefined,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
else if (this.props.onDesignChange) {
|
|
253
|
+
return R("div", { style: { textAlign: "center", marginTop: size.height / 2 } }, R("a", { className: "btn btn-link", onClick: this.handleEdit }, T("Click Here to Configure")));
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
258
|
+
}));
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
exports.default = DatagridComponent;
|
|
262
|
+
/** Popup editor */
|
|
263
|
+
class DatagridEditorComponent extends react_1.default.Component {
|
|
264
|
+
constructor(props) {
|
|
265
|
+
super(props);
|
|
266
|
+
this.state = {
|
|
267
|
+
design: props.design
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
render() {
|
|
271
|
+
return R(ActionCancelModalComponent_1.default, {
|
|
272
|
+
onAction: () => {
|
|
273
|
+
this.props.onDesignChange(this.state.design);
|
|
274
|
+
return this.setState({ design: this.props.design });
|
|
275
|
+
},
|
|
276
|
+
onCancel: this.props.onCancel,
|
|
277
|
+
size: "large"
|
|
278
|
+
}, R(DatagridDesignerComponent_1.default, {
|
|
279
|
+
schema: this.props.schema,
|
|
280
|
+
dataSource: this.props.dataSource,
|
|
281
|
+
design: this.state.design,
|
|
282
|
+
onDesignChange: (design) => this.setState({ design })
|
|
283
|
+
}));
|
|
284
|
+
}
|
|
285
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Row } from "@mwater/expressions";
|
|
2
|
+
import { DatagridDesign, JsonQLFilter } from "..";
|
|
3
|
+
import { QuickfiltersDataSource } from "../quickfilter/QuickfiltersDataSource";
|
|
4
|
+
export default class DatagridDataSource {
|
|
5
|
+
/** Gets the rows specified */
|
|
6
|
+
getRows(design: DatagridDesign, offset: number, limit: number, filters: JsonQLFilter[] | undefined, callback: (error: any, rows: Row[]) => void): void;
|
|
7
|
+
/** Gets the quickfilters data source */
|
|
8
|
+
getQuickfiltersDataSource(): QuickfiltersDataSource;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class DatagridDataSource {
|
|
4
|
+
/** Gets the rows specified */
|
|
5
|
+
getRows(design, offset, limit, filters, callback) {
|
|
6
|
+
throw new Error("Not implemented");
|
|
7
|
+
}
|
|
8
|
+
/** Gets the quickfilters data source */
|
|
9
|
+
getQuickfiltersDataSource() {
|
|
10
|
+
throw new Error("Not implemented");
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.default = DatagridDataSource;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Expr, LiteralType } from "@mwater/expressions";
|
|
2
|
+
import { Quickfilter } from "../quickfilter/Quickfilter";
|
|
3
|
+
/** Design of data grid */
|
|
4
|
+
export interface DatagridDesign {
|
|
5
|
+
/** table id of main table */
|
|
6
|
+
table: string | null;
|
|
7
|
+
/** array of columns */
|
|
8
|
+
columns: DatagridDesignColumn[];
|
|
9
|
+
/** mwater-expression */
|
|
10
|
+
filter?: Expr;
|
|
11
|
+
/** locale to display localizable strings in. optional */
|
|
12
|
+
locale?: string;
|
|
13
|
+
/** array of subtables (1-n joins) */
|
|
14
|
+
subtables?: DatagridDesignSubtable[];
|
|
15
|
+
/** array of { expr: expression to order on, direction: "asc"/"desc" } */
|
|
16
|
+
orderBys?: {
|
|
17
|
+
expr: Expr;
|
|
18
|
+
direction: "asc" | "desc";
|
|
19
|
+
}[];
|
|
20
|
+
/** array of quick filters (user-selectable filters). See quickfilter/README.md */
|
|
21
|
+
quickfilters?: Quickfilter[];
|
|
22
|
+
/** true to show row numbers */
|
|
23
|
+
showRowNumbers?: boolean;
|
|
24
|
+
/** array of global filters. See below. */
|
|
25
|
+
globalFilters?: DatagridDesignGlobalFilter[];
|
|
26
|
+
}
|
|
27
|
+
export interface DatagridDesignColumn {
|
|
28
|
+
/** unique id of the column */
|
|
29
|
+
id: string;
|
|
30
|
+
/** optional label for the column */
|
|
31
|
+
label?: string;
|
|
32
|
+
/** subtable from which column is from. Null/undefined for main table */
|
|
33
|
+
subtable?: string | null;
|
|
34
|
+
/** width of column in pixels */
|
|
35
|
+
width: number;
|
|
36
|
+
/** type of the column */
|
|
37
|
+
type: "expr";
|
|
38
|
+
/** Expression */
|
|
39
|
+
expr: Expr;
|
|
40
|
+
/** Format for formattable types (number and geometry) */
|
|
41
|
+
format?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface DatagridDesignSubtable {
|
|
44
|
+
/** unique id of the subtable (not the id of the table, just a unique id) */
|
|
45
|
+
id: string;
|
|
46
|
+
/** name of subtable (optional) */
|
|
47
|
+
name?: string;
|
|
48
|
+
/** array of join columns to get to subtable from the table */
|
|
49
|
+
joins: string[];
|
|
50
|
+
/** mwater-expression */
|
|
51
|
+
filter?: Expr;
|
|
52
|
+
/** array of { expr: expression to order on, direction: "asc"/"desc" } */
|
|
53
|
+
orderBys: {
|
|
54
|
+
expr: Expr;
|
|
55
|
+
direction: "asc" | "desc";
|
|
56
|
+
}[];
|
|
57
|
+
}
|
|
58
|
+
/** Global Filters
|
|
59
|
+
|
|
60
|
+
Global filters apply to multiple tables at once if a certain column is present. User-interface to set them is application-specific
|
|
61
|
+
and the default (non-mWater) dashboard applies them but does not allow editing.
|
|
62
|
+
|
|
63
|
+
Note: This is less applicable in the case of datagrids since there is a single table, but is included for consistency and ease
|
|
64
|
+
of setting complex but common filters.
|
|
65
|
+
*/
|
|
66
|
+
export interface DatagridDesignGlobalFilter {
|
|
67
|
+
/** id of column to filter */
|
|
68
|
+
columnId: string;
|
|
69
|
+
/** type of column to filter (to ensure that consistent) */
|
|
70
|
+
columnType: LiteralType;
|
|
71
|
+
/** op of expression for filtering */
|
|
72
|
+
op: string;
|
|
73
|
+
/** array of expressions to use for filtering. field expression for column will be injected as expression 0 in the resulting filter expression */
|
|
74
|
+
exprs: Expr[];
|
|
75
|
+
}
|