@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.
Files changed (310) hide show
  1. package/lib/MWaterContextComponent.d.ts +1 -1
  2. package/lib/MWaterContextComponent.js +1 -1
  3. package/lib/MWaterGlobalFiltersComponent.d.ts +2 -2
  4. package/lib/MWaterGlobalFiltersComponent.js +11 -20
  5. package/lib/MWaterLoaderComponent.d.ts +5 -14
  6. package/lib/MWaterLoaderComponent.js +2 -11
  7. package/lib/UndoStack.d.ts +2 -1
  8. package/lib/UndoStack.js +12 -6
  9. package/lib/dashboards/DashboardComponent.js +7 -5
  10. package/lib/dashboards/DashboardDesign.d.ts +1 -1
  11. package/lib/dashboards/LayoutOptionsComponent.js +18 -11
  12. package/lib/dashboards/ServerDashboardDataSource.d.ts +10 -1
  13. package/lib/dashboards/ServerDashboardDataSource.js +29 -10
  14. package/lib/dashboards/SettingsModalComponent.js +1 -1
  15. package/lib/dashboards/layoutOptions.d.ts +5 -1
  16. package/lib/datagrids/DatagridComponent.js +23 -3
  17. package/lib/datagrids/DatagridDesignerComponent.d.ts +2 -3
  18. package/lib/datagrids/DatagridDesignerComponent.js +108 -120
  19. package/lib/datagrids/DatagridViewComponent.js +3 -2
  20. package/lib/datagrids/ExprCellComponent.d.ts +1 -0
  21. package/lib/datagrids/ExprCellComponent.js +22 -20
  22. package/lib/datagrids/OrderBysDesignerComponent.d.ts +7 -7
  23. package/lib/datagrids/OrderBysDesignerComponent.js +19 -28
  24. package/lib/index.css +45 -2
  25. package/lib/index.d.ts +5 -5
  26. package/lib/index.js +2 -3
  27. package/lib/layouts/blocks/BlocksDisplayComponent.d.ts +8 -1
  28. package/lib/layouts/blocks/BlocksDisplayComponent.js +46 -4
  29. package/lib/maps/BufferLayer.d.ts +18 -0
  30. package/lib/maps/BufferLayer.js +36 -14
  31. package/lib/maps/BufferLayerDesign.d.ts +1 -1
  32. package/lib/maps/BufferLayerDesignerComponent.js +2 -2
  33. package/lib/maps/ChoroplethLayer.d.ts +18 -0
  34. package/lib/maps/ChoroplethLayer.js +46 -25
  35. package/lib/maps/ChoroplethLayerDesign.d.ts +7 -3
  36. package/lib/maps/ChoroplethLayerDesigner.d.ts +10 -22
  37. package/lib/maps/ChoroplethLayerDesigner.js +58 -89
  38. package/lib/maps/DirectMapDataSource.js +17 -10
  39. package/lib/maps/EditHoverOver.d.ts +4 -3
  40. package/lib/maps/EditHoverOver.js +64 -35
  41. package/lib/maps/HoverContent.d.ts +10 -5
  42. package/lib/maps/HoverContent.js +7 -36
  43. package/lib/maps/Layer.d.ts +37 -0
  44. package/lib/maps/Layer.js +30 -4
  45. package/lib/maps/LeafletMapComponent.js +10 -19
  46. package/lib/maps/MWaterServerLayer.d.ts +2 -2
  47. package/lib/maps/MWaterServerLayer.js +6 -6
  48. package/lib/maps/MapComponent.js +0 -1
  49. package/lib/maps/MapLayerDataSource.d.ts +9 -0
  50. package/lib/maps/MapUtils.d.ts +19 -1
  51. package/lib/maps/MapUtils.js +80 -1
  52. package/lib/maps/MarkersLayer.d.ts +18 -0
  53. package/lib/maps/MarkersLayer.js +42 -26
  54. package/lib/maps/MarkersLayerDesign.d.ts +1 -1
  55. package/lib/maps/MarkersLayerDesignerComponent.d.ts +12 -28
  56. package/lib/maps/MarkersLayerDesignerComponent.js +81 -111
  57. package/lib/maps/RasterMapViewComponent.js +1 -1
  58. package/lib/maps/ServerMapDataSource.d.ts +9 -0
  59. package/lib/maps/ServerMapDataSource.js +29 -10
  60. package/lib/maps/VectorMapViewComponent.js +7 -15
  61. package/lib/maps/maps.d.ts +4 -2
  62. package/lib/maps/symbols/font-awesome/asterisk.png +0 -0
  63. package/lib/maps/symbols/font-awesome/ban.png +0 -0
  64. package/lib/maps/symbols/font-awesome/beer.png +0 -0
  65. package/lib/maps/symbols/font-awesome/bell.png +0 -0
  66. package/lib/maps/symbols/font-awesome/bolt.png +0 -0
  67. package/lib/maps/symbols/font-awesome/building.png +0 -0
  68. package/lib/maps/symbols/font-awesome/bullseye.png +0 -0
  69. package/lib/maps/symbols/font-awesome/bus.png +0 -0
  70. package/lib/maps/symbols/font-awesome/caret-up.png +0 -0
  71. package/lib/maps/symbols/font-awesome/certificate.png +0 -0
  72. package/lib/maps/symbols/font-awesome/check-circle.png +0 -0
  73. package/lib/maps/symbols/font-awesome/check.png +0 -0
  74. package/lib/maps/symbols/font-awesome/chevron-circle-down.png +0 -0
  75. package/lib/maps/symbols/font-awesome/chevron-circle-up.png +0 -0
  76. package/lib/maps/symbols/font-awesome/cloud-rain.png +0 -0
  77. package/lib/maps/symbols/font-awesome/cloud.png +0 -0
  78. package/lib/maps/symbols/font-awesome/comment.png +0 -0
  79. package/lib/maps/symbols/font-awesome/crosshairs.png +0 -0
  80. package/lib/maps/symbols/font-awesome/dot-circle-o.png +0 -0
  81. package/lib/maps/symbols/font-awesome/exclamation-circle.png +0 -0
  82. package/lib/maps/symbols/font-awesome/exclamation-triangle.png +0 -0
  83. package/lib/maps/symbols/font-awesome/female.png +0 -0
  84. package/lib/maps/symbols/font-awesome/file.png +0 -0
  85. package/lib/maps/symbols/font-awesome/flag.png +0 -0
  86. package/lib/maps/symbols/font-awesome/flask.png +0 -0
  87. package/lib/maps/symbols/font-awesome/h-square.png +0 -0
  88. package/lib/maps/symbols/font-awesome/home.png +0 -0
  89. package/lib/maps/symbols/font-awesome/info-circle.png +0 -0
  90. package/lib/maps/symbols/font-awesome/male.png +0 -0
  91. package/lib/maps/symbols/font-awesome/medkit.png +0 -0
  92. package/lib/maps/symbols/font-awesome/mobile.png +0 -0
  93. package/lib/maps/symbols/font-awesome/plus-circle.png +0 -0
  94. package/lib/maps/symbols/font-awesome/plus-square.png +0 -0
  95. package/lib/maps/symbols/font-awesome/plus.png +0 -0
  96. package/lib/maps/symbols/font-awesome/square.png +0 -0
  97. package/lib/maps/symbols/font-awesome/star.png +0 -0
  98. package/lib/maps/symbols/font-awesome/thumbs-down.png +0 -0
  99. package/lib/maps/symbols/font-awesome/thumbs-up.png +0 -0
  100. package/lib/maps/symbols/font-awesome/ticket.png +0 -0
  101. package/lib/maps/symbols/font-awesome/times-circle.png +0 -0
  102. package/lib/maps/symbols/font-awesome/times.png +0 -0
  103. package/lib/maps/symbols/font-awesome/tint.png +0 -0
  104. package/lib/maps/symbols/font-awesome/tree.png +0 -0
  105. package/lib/maps/symbols/font-awesome/university.png +0 -0
  106. package/lib/maps/symbols/font-awesome/usd.png +0 -0
  107. package/lib/maps/symbols/font-awesome/user.png +0 -0
  108. package/lib/maps/symbols/font-awesome/users.png +0 -0
  109. package/lib/maps/symbols/font-awesome/wheelchair.png +0 -0
  110. package/lib/maps/symbols/sdf-ize.sh +93 -0
  111. package/lib/maps/vectorMaps.d.ts +1 -0
  112. package/lib/maps/vectorMaps.js +20 -36
  113. package/lib/mwater_table_selection/FormsListComponent.d.ts +33 -0
  114. package/lib/mwater_table_selection/FormsListComponent.js +141 -0
  115. package/lib/mwater_table_selection/IndicatorsListComponent.d.ts +49 -0
  116. package/lib/mwater_table_selection/IndicatorsListComponent.js +251 -0
  117. package/lib/mwater_table_selection/IssuesListComponent.d.ts +29 -0
  118. package/lib/mwater_table_selection/IssuesListComponent.js +123 -0
  119. package/lib/mwater_table_selection/MWaterAccountingSystemListComponent.d.ts +20 -0
  120. package/lib/mwater_table_selection/MWaterAccountingSystemListComponent.js +157 -0
  121. package/lib/mwater_table_selection/MWaterAssetSystemsListComponent.d.ts +17 -0
  122. package/lib/mwater_table_selection/MWaterAssetSystemsListComponent.js +79 -0
  123. package/lib/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.d.ts +18 -0
  124. package/lib/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.js +80 -0
  125. package/lib/mwater_table_selection/MWaterCompleteTableSelectComponent.d.ts +63 -0
  126. package/lib/mwater_table_selection/MWaterCompleteTableSelectComponent.js +461 -0
  127. package/lib/mwater_table_selection/MWaterCustomTablesetListComponent.d.ts +17 -0
  128. package/lib/mwater_table_selection/MWaterCustomTablesetListComponent.js +94 -0
  129. package/lib/mwater_table_selection/MWaterMetricsTableListComponent.d.ts +17 -0
  130. package/lib/mwater_table_selection/MWaterMetricsTableListComponent.js +80 -0
  131. package/lib/mwater_table_selection/MWaterTableSelectComponent.d.ts +32 -0
  132. package/lib/mwater_table_selection/MWaterTableSelectComponent.js +163 -0
  133. package/lib/mwater_table_selection/MWaterWorkflowsSelectComponent.d.ts +19 -0
  134. package/lib/mwater_table_selection/MWaterWorkflowsSelectComponent.js +111 -0
  135. package/lib/quickfilter/QuickfiltersComponent.d.ts +3 -102
  136. package/lib/quickfilter/QuickfiltersComponent.js +53 -110
  137. package/lib/quickfilter/TextLiteralComponent.d.ts +23 -47
  138. package/lib/quickfilter/TextLiteralComponent.js +85 -82
  139. package/lib/widgets/MapWidget.js +4 -2
  140. package/lib/widgets/charts/Chart.d.ts +11 -0
  141. package/lib/widgets/charts/Chart.js +15 -0
  142. package/lib/widgets/charts/ChartWidgetComponent.d.ts +1 -0
  143. package/lib/widgets/charts/ChartWidgetComponent.js +27 -1
  144. package/lib/widgets/charts/layered/LayeredChartDesign.d.ts +1 -1
  145. package/lib/widgets/charts/layered/LayeredChartDesignerComponent.d.ts +1 -1
  146. package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +5 -12
  147. package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.d.ts +43 -57
  148. package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +113 -110
  149. package/lib/widgets/charts/layered/LayeredChartUtils.d.ts +2 -1
  150. package/lib/widgets/charts/layered/LayeredChartUtils.js +0 -2
  151. package/lib/widgets/charts/pivot/PivotChart.d.ts +2 -0
  152. package/lib/widgets/charts/pivot/PivotChart.js +156 -0
  153. package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +5 -20
  154. package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +31 -61
  155. package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.d.ts +4 -0
  156. package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.js +4 -2
  157. package/lib/widgets/charts/pivot/PivotChartLayoutComponent.d.ts +5 -44
  158. package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +38 -63
  159. package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +7 -68
  160. package/lib/widgets/charts/pivot/SegmentDesignerComponent.js +58 -106
  161. package/lib/widgets/charts/table/TableChart.d.ts +2 -0
  162. package/lib/widgets/charts/table/TableChart.js +172 -1
  163. package/lib/widgets/charts/table/TableChartDesignerComponent.d.ts +7 -17
  164. package/lib/widgets/charts/table/TableChartDesignerComponent.js +79 -95
  165. package/lib/widgets/charts/table/TableChartViewComponent.d.ts +1 -7
  166. package/lib/widgets/charts/table/TableChartViewComponent.js +19 -27
  167. package/lib/widgets/text/ExprItemEditorComponent.d.ts +3 -8
  168. package/lib/widgets/text/ExprItemEditorComponent.js +36 -33
  169. package/lib/widgets/text/ExprUpdateModalComponent.d.ts +1 -0
  170. package/package.json +4 -10
  171. package/src/MWaterContextComponent.tsx +2 -2
  172. package/src/{MWaterGlobalFiltersComponent.ts → MWaterGlobalFiltersComponent.tsx} +32 -33
  173. package/src/{MWaterLoaderComponent.ts → MWaterLoaderComponent.tsx} +18 -19
  174. package/src/UndoStack.ts +14 -6
  175. package/src/dashboards/DashboardComponent.tsx +7 -5
  176. package/src/dashboards/DashboardDesign.ts +1 -1
  177. package/src/dashboards/LayoutOptionsComponent.tsx +22 -10
  178. package/src/dashboards/ServerDashboardDataSource.ts +36 -13
  179. package/src/dashboards/SettingsModalComponent.tsx +1 -1
  180. package/src/dashboards/layoutOptions.tsx +5 -1
  181. package/src/datagrids/DatagridComponent.tsx +31 -3
  182. package/src/datagrids/DatagridDesignerComponent.tsx +241 -229
  183. package/src/datagrids/DatagridViewComponent.tsx +3 -2
  184. package/src/datagrids/ExprCellComponent.tsx +23 -20
  185. package/src/datagrids/OrderBysDesignerComponent.tsx +61 -70
  186. package/src/index.css +45 -2
  187. package/src/index.ts +5 -11
  188. package/src/layouts/blocks/BlocksDisplayComponent.tsx +60 -5
  189. package/src/maps/BufferLayer.ts +48 -20
  190. package/src/maps/BufferLayerDesign.ts +1 -1
  191. package/src/maps/BufferLayerDesignerComponent.tsx +2 -1
  192. package/src/maps/ChoroplethLayer.ts +70 -39
  193. package/src/maps/ChoroplethLayerDesign.ts +6 -2
  194. package/src/maps/ChoroplethLayerDesigner.tsx +171 -167
  195. package/src/maps/DirectMapDataSource.ts +21 -13
  196. package/src/maps/EditHoverOver.tsx +98 -54
  197. package/src/maps/HoverContent.tsx +17 -48
  198. package/src/maps/Layer.ts +42 -4
  199. package/src/maps/LeafletMapComponent.tsx +10 -19
  200. package/src/maps/MWaterServerLayer.ts +6 -6
  201. package/src/maps/MapComponent.ts +0 -1
  202. package/src/maps/MapLayerDataSource.ts +8 -0
  203. package/src/maps/MapUtils.ts +82 -3
  204. package/src/maps/MarkersLayer.ts +54 -27
  205. package/src/maps/MarkersLayerDesign.ts +1 -1
  206. package/src/maps/MarkersLayerDesignerComponent.tsx +360 -0
  207. package/src/maps/RasterMapViewComponent.ts +1 -1
  208. package/src/maps/ServerMapDataSource.ts +35 -12
  209. package/src/maps/VectorMapViewComponent.tsx +8 -19
  210. package/src/maps/maps.ts +4 -2
  211. package/src/maps/symbols/font-awesome/asterisk.png +0 -0
  212. package/src/maps/symbols/font-awesome/ban.png +0 -0
  213. package/src/maps/symbols/font-awesome/beer.png +0 -0
  214. package/src/maps/symbols/font-awesome/bell.png +0 -0
  215. package/src/maps/symbols/font-awesome/bolt.png +0 -0
  216. package/src/maps/symbols/font-awesome/building.png +0 -0
  217. package/src/maps/symbols/font-awesome/bullseye.png +0 -0
  218. package/src/maps/symbols/font-awesome/bus.png +0 -0
  219. package/src/maps/symbols/font-awesome/caret-up.png +0 -0
  220. package/src/maps/symbols/font-awesome/certificate.png +0 -0
  221. package/src/maps/symbols/font-awesome/check-circle.png +0 -0
  222. package/src/maps/symbols/font-awesome/check.png +0 -0
  223. package/src/maps/symbols/font-awesome/chevron-circle-down.png +0 -0
  224. package/src/maps/symbols/font-awesome/chevron-circle-up.png +0 -0
  225. package/src/maps/symbols/font-awesome/cloud-rain.png +0 -0
  226. package/src/maps/symbols/font-awesome/cloud.png +0 -0
  227. package/src/maps/symbols/font-awesome/comment.png +0 -0
  228. package/src/maps/symbols/font-awesome/crosshairs.png +0 -0
  229. package/src/maps/symbols/font-awesome/dot-circle-o.png +0 -0
  230. package/src/maps/symbols/font-awesome/exclamation-circle.png +0 -0
  231. package/src/maps/symbols/font-awesome/exclamation-triangle.png +0 -0
  232. package/src/maps/symbols/font-awesome/female.png +0 -0
  233. package/src/maps/symbols/font-awesome/file.png +0 -0
  234. package/src/maps/symbols/font-awesome/flag.png +0 -0
  235. package/src/maps/symbols/font-awesome/flask.png +0 -0
  236. package/src/maps/symbols/font-awesome/h-square.png +0 -0
  237. package/src/maps/symbols/font-awesome/home.png +0 -0
  238. package/src/maps/symbols/font-awesome/info-circle.png +0 -0
  239. package/src/maps/symbols/font-awesome/male.png +0 -0
  240. package/src/maps/symbols/font-awesome/medkit.png +0 -0
  241. package/src/maps/symbols/font-awesome/mobile.png +0 -0
  242. package/src/maps/symbols/font-awesome/plus-circle.png +0 -0
  243. package/src/maps/symbols/font-awesome/plus-square.png +0 -0
  244. package/src/maps/symbols/font-awesome/plus.png +0 -0
  245. package/src/maps/symbols/font-awesome/square.png +0 -0
  246. package/src/maps/symbols/font-awesome/star.png +0 -0
  247. package/src/maps/symbols/font-awesome/thumbs-down.png +0 -0
  248. package/src/maps/symbols/font-awesome/thumbs-up.png +0 -0
  249. package/src/maps/symbols/font-awesome/ticket.png +0 -0
  250. package/src/maps/symbols/font-awesome/times-circle.png +0 -0
  251. package/src/maps/symbols/font-awesome/times.png +0 -0
  252. package/src/maps/symbols/font-awesome/tint.png +0 -0
  253. package/src/maps/symbols/font-awesome/tree.png +0 -0
  254. package/src/maps/symbols/font-awesome/university.png +0 -0
  255. package/src/maps/symbols/font-awesome/usd.png +0 -0
  256. package/src/maps/symbols/font-awesome/user.png +0 -0
  257. package/src/maps/symbols/font-awesome/users.png +0 -0
  258. package/src/maps/symbols/font-awesome/wheelchair.png +0 -0
  259. package/src/maps/symbols/sdf-ize.sh +93 -0
  260. package/src/maps/vectorMaps.tsx +20 -44
  261. package/src/mwater_table_selection/FormsListComponent.tsx +188 -0
  262. package/src/mwater_table_selection/IndicatorsListComponent.tsx +411 -0
  263. package/src/mwater_table_selection/IssuesListComponent.tsx +167 -0
  264. package/src/mwater_table_selection/MWaterAccountingSystemListComponent.tsx +225 -0
  265. package/src/{MWaterAssetSystemsListComponent.tsx → mwater_table_selection/MWaterAssetSystemsListComponent.tsx} +2 -2
  266. package/src/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.tsx +111 -0
  267. package/src/mwater_table_selection/MWaterCompleteTableSelectComponent.tsx +713 -0
  268. package/src/{MWaterCustomTablesetListComponent.tsx → mwater_table_selection/MWaterCustomTablesetListComponent.tsx} +1 -1
  269. package/src/{MWaterMetricsTableListComponent.tsx → mwater_table_selection/MWaterMetricsTableListComponent.tsx} +1 -1
  270. package/src/{MWaterTableSelectComponent.tsx → mwater_table_selection/MWaterTableSelectComponent.tsx} +91 -90
  271. package/src/mwater_table_selection/MWaterWorkflowsSelectComponent.tsx +159 -0
  272. package/src/quickfilter/{QuickfiltersComponent.ts → QuickfiltersComponent.tsx} +165 -158
  273. package/src/quickfilter/TextLiteralComponent.tsx +197 -0
  274. package/src/widgets/MapWidget.tsx +9 -1
  275. package/src/widgets/charts/Chart.ts +17 -0
  276. package/src/widgets/charts/ChartWidgetComponent.tsx +36 -1
  277. package/src/widgets/charts/layered/LayeredChartDesign.ts +1 -1
  278. package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +23 -24
  279. package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +260 -211
  280. package/src/widgets/charts/layered/LayeredChartUtils.ts +7 -7
  281. package/src/widgets/charts/pivot/PivotChart.ts +191 -0
  282. package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +124 -129
  283. package/src/widgets/charts/pivot/PivotChartLayoutBuilder.ts +4 -2
  284. package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +120 -149
  285. package/src/widgets/charts/pivot/SegmentDesignerComponent.tsx +178 -198
  286. package/src/widgets/charts/table/TableChart.ts +177 -1
  287. package/src/widgets/charts/table/TableChartDesignerComponent.tsx +422 -0
  288. package/src/widgets/charts/table/{TableChartViewComponent.ts → TableChartViewComponent.tsx} +65 -60
  289. package/src/widgets/text/ExprItemEditorComponent.tsx +83 -77
  290. package/src/widgets/text/ExprUpdateModalComponent.tsx +1 -0
  291. package/test/UndoStackTests.ts +52 -1
  292. package/.storybook/config.js +0 -7
  293. package/.storybook/head.html +0 -4
  294. package/.storybook/webpack.config.js +0 -15
  295. package/src/MWaterCompleteTableSelectComponent.tsx +0 -975
  296. package/src/maps/BingLayer.ts +0 -146
  297. package/src/maps/MarkersLayerDesignerComponent.ts +0 -374
  298. package/src/quickfilter/TextLiteralComponent.ts +0 -165
  299. package/src/widgets/charts/table/TableChartDesignerComponent.ts +0 -441
  300. package/stories/UpdateableComponent.js +0 -29
  301. package/stories/consoles.js +0 -202
  302. package/stories/dashboards.js +0 -217
  303. package/stories/datagridDesign.js +0 -114
  304. package/stories/datagrids.js +0 -69
  305. package/stories/dates.js +0 -80
  306. package/stories/exprcomponent.js +0 -43
  307. package/stories/index.js +0 -18
  308. package/stories/leaflet.js +0 -59
  309. package/stories/maps.js +0 -24
  310. package/stories/pivotChart.js +0 -235
@@ -1,6 +1,5 @@
1
1
  import _ from "lodash"
2
2
  import React from "react"
3
- const R = React.createElement
4
3
 
5
4
  import * as ui from "@mwater/react-library/lib/bootstrap"
6
5
  import { IdLiteralComponent } from "@mwater/expressions-ui"
@@ -14,12 +13,14 @@ export interface MWaterGlobalFiltersComponentProps {
14
13
  dataSource: DataSource
15
14
  filterableTables: string[]
16
15
  globalFilters?: GlobalFilter[]
17
- onChange: (globalFilters: GlobalFilter[]) => void
16
+ onChange?: (globalFilters: GlobalFilter[]) => void
18
17
  }
19
18
 
20
19
  // Control to edit the global filters (_managed_by and admin_region)
21
20
  export default class MWaterGlobalFiltersComponent extends React.Component<MWaterGlobalFiltersComponentProps> {
22
21
  handleRegionsChange = (regions: any) => {
22
+ if (!this.props.onChange) { return }
23
+
23
24
  // Remove existing filter
24
25
  const globalFilters = _.filter(
25
26
  this.props.globalFilters || [],
@@ -40,6 +41,8 @@ export default class MWaterGlobalFiltersComponent extends React.Component<MWater
40
41
  }
41
42
 
42
43
  handleManagedByChange = (managedBy: any) => {
44
+ if (!this.props.onChange) { return }
45
+
43
46
  // Remove existing filter
44
47
  const globalFilters = _.filter(
45
48
  this.props.globalFilters || [],
@@ -80,38 +83,34 @@ export default class MWaterGlobalFiltersComponent extends React.Component<MWater
80
83
  adminRegions = null
81
84
  }
82
85
 
83
- return R(
84
- "div",
85
- null,
86
- R(
87
- ui.FormGroup,
88
- { label: T`Only sites managed by`, labelMuted: true },
89
- R(IdLiteralComponent, {
90
- value: managedBy,
91
- onChange: this.handleManagedByChange,
92
- idTable: "groups",
93
- schema: this.props.schema,
94
- dataSource: this.props.dataSource,
95
- placeholder: T`All Organizations`,
96
- multi: false,
97
- filter: { type: "field", tableAlias: "main", column: "canManageEntities" }
98
- })
99
- ),
86
+ return (
87
+ <div>
88
+ <ui.FormGroup label={T`Only sites managed by`} labelMuted={true}>
89
+ <IdLiteralComponent
90
+ value={managedBy}
91
+ onChange={ this.props.onChange ? this.handleManagedByChange : undefined}
92
+ idTable="groups"
93
+ schema={this.props.schema}
94
+ dataSource={this.props.dataSource}
95
+ placeholder={T`All Organizations`}
96
+ multi={false}
97
+ filter={{ type: "field", tableAlias: "main", column: "canManageEntities" }}
98
+ />
99
+ </ui.FormGroup>
100
100
 
101
- R(
102
- ui.FormGroup,
103
- { label: T`Only sites located in`, labelMuted: true },
104
- R(IdLiteralComponent, {
105
- value: adminRegions,
106
- onChange: this.handleRegionsChange,
107
- idTable: "admin_regions",
108
- schema: this.props.schema,
109
- dataSource: this.props.dataSource,
110
- placeholder: T`All Regions`,
111
- multi: true,
112
- orderBy: [{ expr: { type: "field", tableAlias: "main", column: "level" }, direction: "asc" }]
113
- })
114
- )
101
+ <ui.FormGroup label={T`Only sites located in`} labelMuted={true}>
102
+ <IdLiteralComponent
103
+ value={adminRegions}
104
+ onChange={this.props.onChange ? this.handleRegionsChange : undefined}
105
+ idTable="admin_regions"
106
+ schema={this.props.schema}
107
+ dataSource={this.props.dataSource}
108
+ placeholder={T`All Regions`}
109
+ multi={true}
110
+ orderBy={[{ expr: { type: "field", tableAlias: "main", column: "level" }, direction: "asc" }]}
111
+ />
112
+ </ui.FormGroup>
113
+ </div>
115
114
  )
116
115
  }
117
116
  }
@@ -1,6 +1,5 @@
1
1
  import _ from "lodash"
2
- import React, { ReactElement } from "react"
3
- const R = React.createElement
2
+ import React, { ReactElement, ReactNode } from "react"
4
3
 
5
4
  import { DataSource, Schema } from "@mwater/expressions"
6
5
  import AsyncLoadComponent from "@mwater/react-library/lib/AsyncLoadComponent"
@@ -24,9 +23,9 @@ export interface MWaterLoaderComponentProps {
24
23
  locales?: string[]
25
24
  /** Override default add layer component. See AddLayerComponent for details */
26
25
  addLayerElementFactory?: AddLayerElementFactory
27
- children: (error: any, config?: { schema: Schema; dataSource: DataSource }) => ReactElement<any>
26
+ children: (error: any, config?: { schema: Schema; dataSource: DataSource }) => ReactElement<any> | null
28
27
  /** Custom error formatter that returns React node or string, gets passed the error response from server */
29
- errorFormatter?: (data: any, defaultError: string) => string
28
+ errorFormatter?: (data: any, defaultError: ReactNode) => ReactNode
30
29
  /** Origin of usage. e.g. "dashboards:43445364..." */
31
30
  origin?: string
32
31
  }
@@ -110,21 +109,21 @@ export default class MWaterLoaderComponent extends AsyncLoadComponent<
110
109
  }
111
110
 
112
111
  // Inject context
113
- return R(
114
- MWaterContextComponent,
115
- {
116
- apiUrl: this.props.apiUrl,
117
- client: this.props.client,
118
- user: this.props.user,
119
- schema: this.state.schema!,
120
- extraTables: this.props.extraTables,
121
- onExtraTablesChange: this.props.onExtraTablesChange,
122
- addLayerElementFactory: this.props.addLayerElementFactory
123
- },
124
- this.props.children(this.state.error, {
125
- schema: this.state.schema!,
126
- dataSource: this.state.dataSource!
127
- })
112
+ return (
113
+ <MWaterContextComponent
114
+ apiUrl={this.props.apiUrl}
115
+ client={this.props.client}
116
+ user={this.props.user}
117
+ schema={this.state.schema!}
118
+ extraTables={this.props.extraTables}
119
+ onExtraTablesChange={this.props.onExtraTablesChange}
120
+ addLayerElementFactory={this.props.addLayerElementFactory}
121
+ >
122
+ {this.props.children(this.state.error, {
123
+ schema: this.state.schema!,
124
+ dataSource: this.state.dataSource!
125
+ })}
126
+ </MWaterContextComponent>
128
127
  )
129
128
  }
130
129
  }
package/src/UndoStack.ts CHANGED
@@ -4,24 +4,32 @@ import _ from "lodash"
4
4
  export default class UndoStack {
5
5
  undoStack: any[]
6
6
  redoStack: any[]
7
+ maxDepth?: number
7
8
 
8
- constructor(undoStack?: any, redoStack?: any) {
9
+ constructor(undoStack?: any, redoStack?: any, maxDepth?: number) {
9
10
  this.undoStack = undoStack || []
10
11
  this.redoStack = redoStack || []
12
+ this.maxDepth = maxDepth
11
13
  }
12
14
 
13
15
  // Add a value to the stack
14
16
  push(value: any) {
15
17
  // No trivial pushes
16
- if (_.isEqual(this.getValue(), value)) {
18
+ if (JSON.stringify(this.getValue()) === JSON.stringify(value)) {
17
19
  return this
18
20
  }
19
21
 
20
- const undoStack = this.undoStack.slice()
22
+ let undoStack = this.undoStack.slice()
21
23
  undoStack.push(value)
24
+
25
+ // Limit stack depth if maxDepth is set
26
+ if (this.maxDepth && undoStack.length > this.maxDepth) {
27
+ undoStack = undoStack.slice(undoStack.length - this.maxDepth)
28
+ }
29
+
22
30
  const redoStack: any = []
23
31
 
24
- return new UndoStack(undoStack, redoStack)
32
+ return new UndoStack(undoStack, redoStack, this.maxDepth)
25
33
  }
26
34
 
27
35
  canUndo() {
@@ -39,7 +47,7 @@ export default class UndoStack {
39
47
 
40
48
  const undoStack = _.initial(this.undoStack)
41
49
 
42
- return new UndoStack(undoStack, redoStack)
50
+ return new UndoStack(undoStack, redoStack, this.maxDepth)
43
51
  }
44
52
 
45
53
  redo() {
@@ -49,7 +57,7 @@ export default class UndoStack {
49
57
 
50
58
  const redoStack = _.initial(this.redoStack)
51
59
 
52
- return new UndoStack(undoStack, redoStack)
60
+ return new UndoStack(undoStack, redoStack, this.maxDepth)
53
61
  }
54
62
 
55
63
  // Get the current value
@@ -107,7 +107,8 @@ export default class DashboardComponent extends React.Component<DashboardCompone
107
107
  props.onDesignChange != null,
108
108
  layoutOptionsOpen: false,
109
109
  hideQuickfilters:
110
- layoutOptions.hideQuickfiltersWidth != null && layoutOptions.hideQuickfiltersWidth > document.body.clientWidth,
110
+ layoutOptions.hideQuickfiltersWidth === 0 ||
111
+ (layoutOptions.hideQuickfiltersWidth != null && layoutOptions.hideQuickfiltersWidth > document.body.clientWidth),
111
112
  refreshKey: 1,
112
113
  locale: initialLocale
113
114
  }
@@ -303,23 +304,23 @@ export default class DashboardComponent extends React.Component<DashboardCompone
303
304
  : undefined}
304
305
  <a key="print" className="btn btn-link btn-sm" onClick={this.handlePrint}>
305
306
  <span className="fas fa-print"/>
306
- <span className="hide-600px"> {T`Print`}</span>
307
+ <span className="hide-800px"> {T`Print`}</span>
307
308
  </a>
308
309
  <a key="refresh" className="btn btn-link btn-sm" onClick={this.handleRefreshData}>
309
310
  <span className="fas fa-sync"/>
310
- <span className="hide-600px"> {T`Refresh`}</span>
311
+ <span className="hide-800px"> {T`Refresh`}</span>
311
312
  </a>
312
313
  {this.state.hideQuickfilters && this.props.design.quickfilters && this.props.design.quickfilters.length > 0
313
314
  ? <a key="showQuickfilters" className="btn btn-link btn-sm" onClick={this.handleShowQuickfilters}>
314
315
  <span className="fa fa-filter"/>
315
- <span className="hide-600px"> {T`Show Quickfilters`}</span>
316
+ <span className="hide-800px"> {T`Show Quickfilters`}</span>
316
317
  </a>
317
318
  : undefined}
318
319
 
319
320
  {this.state.editing
320
321
  ? <a key="settings" className="btn btn-link btn-sm" onClick={this.handleSettings}>
321
322
  <span className="fas fa-cog"/>
322
- <span className="hide-600px"> {T`Settings`}</span>
323
+ <span className="hide-800px"> {T`Settings`}</span>
323
324
  </a>
324
325
  : undefined}
325
326
  {this.state.editing ? this.renderStyle() : undefined}
@@ -434,6 +435,7 @@ export default class DashboardComponent extends React.Component<DashboardCompone
434
435
  <div style={{
435
436
  display: "grid",
436
437
  gridTemplateRows: this.props.hideTitleBar ? "auto 1fr" : "auto auto 1fr",
438
+ gridTemplateColumns: "minmax(0, 1fr)",
437
439
  height: "100%"
438
440
  }}>
439
441
  {!this.props.hideTitleBar ? this.renderTitleBar() : undefined}
@@ -39,6 +39,6 @@ export interface DashboardDesign {
39
39
  /** true to enable implicit filtering (see ImplicitFilterBuilder). Defaults to true for older dashboards. */
40
40
  implicitFiltersEnabled?: boolean
41
41
 
42
- /** array of global filters. See below. */
42
+ /** Array of global filters */
43
43
  globalFilters?: GlobalFilter[]
44
44
  }
@@ -91,8 +91,9 @@ export function LayoutOptionsComponent(props: {
91
91
  <div style={{ backgroundColor: "#888" }}></div>
92
92
  <div style={{ height: "100%", display: "grid", gridTemplateRows: "auto 1fr" }}>
93
93
  <div key="quickfilters">
94
- {layoutOptions.hideQuickfiltersWidth == null ||
95
- sizeOptions[previewSize].value.width > layoutOptions.hideQuickfiltersWidth
94
+ {(layoutOptions.hideQuickfiltersWidth !== 0) &&
95
+ (layoutOptions.hideQuickfiltersWidth == null ||
96
+ sizeOptions[previewSize].value.width > layoutOptions.hideQuickfiltersWidth)
96
97
  ? props.quickfiltersView
97
98
  : null}
98
99
  </div>
@@ -376,6 +377,7 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
376
377
  onLayoutOptionsChange({ ...layoutOptions, hideQuickfiltersWidth })
377
378
  }}
378
379
  sign="< "
380
+ includeAlways
379
381
  />
380
382
  </FormGroup>
381
383
  <FormGroup label={T`Minimum Width (before scrolling or scaling)`}>
@@ -515,20 +517,30 @@ function WidthSelector(props: {
515
517
  onChange: (value: number | null) => void
516
518
  /** E.g. >=, <= */
517
519
  sign: string
520
+ /** If true, include an "Always" option with value 0 */
521
+ includeAlways?: boolean
518
522
  }) {
523
+ // Create options array with conditional "Always" option
524
+ const options = [
525
+ { value: 400, label: `${props.sign}400px (${T`Phone`})` },
526
+ { value: 600, label: `${props.sign}600px (${T`Small tablet`})` },
527
+ { value: 800, label: `${props.sign}800px (${T`Tablet`})` },
528
+ { value: 1000, label: `${props.sign}1000px (${T`Laptop`})` },
529
+ { value: 1200, label: `${props.sign}1200px (${T`Desktop`})` },
530
+ { value: 1600, label: `${props.sign}1600px (${T`Wide Desktop`})` }
531
+ ]
532
+
533
+ // Add "Always" option if requested
534
+ if (props.includeAlways) {
535
+ options.push({ value: 0, label: T`Always` })
536
+ }
537
+
519
538
  return (
520
539
  <Select
521
540
  value={props.value}
522
541
  onChange={props.onChange}
523
542
  nullLabel={T`N/A`}
524
- options={[
525
- { value: 400, label: `${props.sign}400px (${T`Phone`})` },
526
- { value: 600, label: `${props.sign}600px (${T`Small tablet`})` },
527
- { value: 800, label: `${props.sign}800px (${T`Tablet`})` },
528
- { value: 1000, label: `${props.sign}1000px (${T`Laptop`})` },
529
- { value: 1200, label: `${props.sign}1200px (${T`Desktop`})` },
530
- { value: 1600, label: `${props.sign}1600px (${T`Wide Desktop`})` }
531
- ]}
543
+ options={options}
532
544
  />
533
545
  )
534
546
  }
@@ -28,7 +28,7 @@ interface ServerDashboardDataSourceOptions {
28
28
  dataSource: DataSource
29
29
 
30
30
  /** revision to use to allow caching */
31
- rev: string
31
+ rev?: number
32
32
  }
33
33
 
34
34
  interface ServerWidgetDataSourceOptions extends ServerDashboardDataSourceOptions {
@@ -407,12 +407,6 @@ class ServerWidgetLayerDataSource implements MapLayerDataSource {
407
407
 
408
408
  let url = `${this.options.apiUrl}maps/tiles/{z}/{x}/{y}.${extension}?` + querystring.stringify(query)
409
409
 
410
- // Add subdomains: {s} will be substituted with "a", "b" or "c" in leaflet for api.mwater.co only.
411
- // Used to speed queries
412
- if (url.match(/^https:\/\/api\.mwater\.co\//)) {
413
- url = url.replace(/^https:\/\/api\.mwater\.co\//, "https://{s}-api.mwater.co/")
414
- }
415
-
416
410
  return url
417
411
  }
418
412
 
@@ -421,12 +415,6 @@ class ServerWidgetLayerDataSource implements MapLayerDataSource {
421
415
  let where
422
416
  let url = `${this.options.apiUrl}maps/tiles/{z}/{x}/{y}.${extension}?type=${design.type}&radius=1000`
423
417
 
424
- // Add subdomains: {s} will be substituted with "a", "b" or "c" in leaflet for api.mwater.co only.
425
- // Used to speed queries
426
- if (url.match(/^https:\/\/api\.mwater\.co\//)) {
427
- url = url.replace(/^https:\/\/api\.mwater\.co\//, "https://{s}-api.mwater.co/")
428
- }
429
-
430
418
  if (this.options.client) {
431
419
  url += `&client=${this.options.client}`
432
420
  }
@@ -454,6 +442,41 @@ class ServerWidgetLayerDataSource implements MapLayerDataSource {
454
442
 
455
443
  return url
456
444
  }
445
+
446
+ /** Gets hover over data for hover over items
447
+ * @param design The design of the layer
448
+ * @param data The data of the current item being hovered over. e.g. { id: 123 }
449
+ * @param filters The filters to apply to the layer does not include filters that narrow down to a specific item
450
+ * @returns A promise that resolves to the hover over data, indexed by the id of the hover over item
451
+ */
452
+ async getHoverOverData(design: any, data: any, filters: JsonQLFilter[]): Promise<{ [key: string]: any }> {
453
+ const query = {
454
+ client: this.options.client,
455
+ share: this.options.share,
456
+ filters: compressJson(filters || []),
457
+ data: compressJson(data),
458
+ rev: this.options.rev
459
+ }
460
+
461
+ const url =
462
+ `${this.options.apiUrl}dashboards/${this.options.dashboardId}/widgets/${this.options.widgetId}/layers/${this.options.layerView.id}/hoverdata?` +
463
+ querystring.stringify(query)
464
+
465
+ const response = await fetch(url, {
466
+ method: "GET",
467
+ headers: {
468
+ Accept: "application/json"
469
+ }
470
+ })
471
+
472
+ if (!response.ok) {
473
+ const errorText = await response.text()
474
+ console.error(errorText)
475
+ throw new Error(`Error fetching hover data: ${response.statusText}`)
476
+ }
477
+
478
+ return await response.json()
479
+ }
457
480
  }
458
481
 
459
482
  interface ServerWidgetLayerPopupDataSourceOptions extends ServerDashboardDataSourceOptions {
@@ -259,7 +259,7 @@ function LanguageTab({ design, onDesignChange, schema }: LanguageTabProps) {
259
259
  ).length
260
260
 
261
261
  // Round down to nearest percent
262
- percentages[locale] = Math.floor((translatedCount / totalStrings) * 100)
262
+ percentages[locale] = (totalStrings > 0) ? Math.floor((translatedCount / totalStrings) * 100) : 0
263
263
  }
264
264
 
265
265
  return percentages
@@ -21,7 +21,11 @@ export interface BlocksLayoutOptions {
21
21
  /** Width above which pads */
22
22
  maximumWidth: number | null
23
23
 
24
- /** Width at which to hide quickfilters. Null for never */
24
+ /** Width at which to hide quickfilters.
25
+ * Null for never hide
26
+ * 0 for always hide
27
+ * Positive number for responsive hiding based on width
28
+ */
25
29
  hideQuickfiltersWidth: number | null
26
30
 
27
31
  /** The padding around the entire dashboard */
@@ -380,7 +380,7 @@ export default forwardRef<DatagridComponentRef, DatagridComponentProps>(function
380
380
  return (
381
381
  <div style={{ position: "absolute", top: 0, left: 0, right: 0, height: 40, padding: 4 }}>
382
382
  <div style={{ float: "right" }}>
383
- {design.showNumRows && numRows ? <small className='text-muted text-sm'>{`${d3Format(',')(numRows)} rows`}</small> : undefined}
383
+ {design.showNumRows && numRows ? <small className='text-muted text-sm me-2'>{`${d3Format(',')(numRows)} rows`}</small> : undefined}
384
384
  {renderDeleteRows()}
385
385
  {renderFindReplace()}
386
386
  {renderCellEdit()}
@@ -529,8 +529,36 @@ export default forwardRef<DatagridComponentRef, DatagridComponentProps>(function
529
529
  )
530
530
  } else if (onDesignChange) {
531
531
  return (
532
- <div style={{ textAlign: "center", marginTop: size.height / 2 }}>
533
- <a className="btn btn-link" onClick={handleEdit}>{T`Click Here to Configure`}</a>
532
+ <div style={{
533
+ display: "flex",
534
+ flexDirection: "column",
535
+ alignItems: "center",
536
+ justifyContent: "center",
537
+ height: "100%",
538
+ padding: "40px"
539
+ }}>
540
+ <div style={{
541
+ textAlign: "center",
542
+ marginBottom: "24px"
543
+ }}>
544
+ <i className="fas fa-table text-muted" style={{
545
+ fontSize: "48px",
546
+ marginBottom: "16px"
547
+ }} />
548
+ <div style={{
549
+ fontSize: "14px"
550
+ }} className="text-muted">
551
+ {T`Configure a data source and columns to get started.`}
552
+ </div>
553
+ </div>
554
+
555
+ <button
556
+ className="btn btn-primary"
557
+ onClick={handleEdit}
558
+ >
559
+ <i className="fas fa-cog" style={{ marginRight: "8px" }} />
560
+ {T`Configure`}
561
+ </button>
534
562
  </div>
535
563
  )
536
564
  } else {