@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,217 +0,0 @@
1
- // TODO: This file was created by bulk-decaffeinate.
2
- // Sanity-check the conversion and remove this comment.
3
- import PropTypes from 'prop-types';
4
- import _ from 'lodash';
5
- import React from 'react';
6
- const H = React.DOM;
7
- const R = React.createElement;
8
-
9
- import { storiesOf } from '@kadira/storybook';
10
- import DashboardComponent from '../src/dashboards/DashboardComponent';
11
- import DirectDashboardDataSource from '../src/dashboards/DirectDashboardDataSource';
12
- import MWaterLoaderComponent from '../src/MWaterLoaderComponent';
13
- import UpdateableComponent from './UpdateableComponent';
14
-
15
- storiesOf('dashboard', module)
16
- .add('empty dashboard', () => {
17
- return R(DashboardTest);
18
- }).add('table dashboard', () => {
19
- return R(DashboardTest, {design: tableDashboardDesign});
20
- }).add('popup', () => {
21
- return R(DashboardPopupTest);
22
- });
23
-
24
-
25
- var tableDashboardDesign = {
26
- "items": {
27
- "id": "root",
28
- "type": "root",
29
- "blocks": [
30
- {
31
- "type": "widget",
32
- "aspectRatio": 1.4,
33
- "widgetType": "TableChart",
34
- "design": {
35
- "version": 1,
36
- "columns": [
37
- {
38
- "id": "f1532afb-c0ea-48de-8e4e-931b147eeb6f",
39
- "textAxis": {
40
- "expr": {
41
- "type": "field",
42
- "table": "entities.place_of_worship",
43
- "column": "name"
44
- }
45
- }
46
- }
47
- ],
48
- "orderings": [],
49
- "table": "entities.place_of_worship"
50
- },
51
- "id": "193bbc40-9177-4547-8b83-c2b5441f72c3"
52
- }
53
- ]
54
- },
55
- "layout": "blocks"
56
- };
57
-
58
-
59
- class DashboardTest extends React.Component {
60
- static initClass() {
61
- this.propTypes =
62
- {design: PropTypes.object};
63
- }
64
-
65
- render() {
66
- return R(UpdateableComponent,
67
- {design: this.props.design || { items: { id: "root", type: "root", blocks: [] }, layout: "blocks" }},
68
- (state, update) => {
69
- const apiUrl = "https://api.mwater.co/v3/";
70
- return R(MWaterLoaderComponent, {
71
- apiUrl,
72
- client: null,
73
- user: null,
74
- onExtraTablesChange: update("extraTables"),
75
- extraTables: state.extraTables
76
- }, (error, config) => {
77
- if (error) {
78
- alert("Error: " + error.message);
79
- return null;
80
- }
81
-
82
- const dashboardDataSource = new DirectDashboardDataSource({
83
- apiUrl,
84
- client: null,
85
- design: state.design,
86
- schema: config.schema,
87
- dataSource: config.dataSource
88
- });
89
-
90
- return H.div({style: { height: 800 }},
91
- React.createElement(DashboardComponent, {
92
- schema: config.schema,
93
- dataSource: config.dataSource,
94
- dashboardDataSource,
95
- design: state.design,
96
- onDesignChange: update("design"),
97
- titleElem: "Sample"
98
- // quickfilterLocks: [{ expr: { type: "field", table: "entities.water_point", column: "type" }, value: "Protected dug well" }]
99
- })
100
- );
101
- });
102
- });
103
- }
104
- }
105
- DashboardTest.initClass();
106
-
107
-
108
- class DashboardPopupTest extends React.Component {
109
- render() {
110
- return R(UpdateableComponent,
111
- {popup: { name: "Untitled", design: { items: { id: "root", type: "root", blocks: [] }, layout: "blocks" } }},
112
- (state, update) => {
113
- const apiUrl = "https://api.mwater.co/v3/";
114
- return R(MWaterLoaderComponent, {
115
- apiUrl,
116
- client: null,
117
- user: null
118
- // onExtraTablesChange: (extraTables) => @setState(extraTables: extraTables)
119
- // extraTables: @state.extraTables
120
- }, (error, config) => {
121
- if (error) {
122
- alert("Error: " + error.message);
123
- return null;
124
- }
125
-
126
- const dashboardDataSource = new DirectDashboardDataSource({
127
- apiUrl,
128
- client: null,
129
- design: state.popup.design,
130
- schema: config.schema,
131
- dataSource: config.dataSource
132
- });
133
-
134
- return H.div(null,
135
- R(DashboardPopupComponent, {
136
- ref: comp => { return this.popupComponent = comp; },
137
- schema: config.schema,
138
- dataSource: config.dataSource,
139
- dashboardDataSource,
140
- popup: state.popup,
141
- onPopupChange: update("popup")
142
- }
143
- ),
144
-
145
- H.button({
146
- type: "button",
147
- onClick: () => this.popupComponent.show(),
148
- className: "btn btn-default"
149
- },
150
- "Show")
151
- );
152
- });
153
- });
154
- }
155
- }
156
-
157
-
158
- const ModalWindowComponent = require("@mwater/react-library/lib/ModalWindowComponent");
159
- const ui = require("@mwater/react-library/lib/bootstrap");
160
- const update = require("@mwater/react-library/lib/update");
161
-
162
- class DashboardPopupComponent extends React.Component {
163
- static initClass() {
164
- this.propTypes = {
165
- popup: PropTypes.object.isRequired,
166
- onPopupChange: PropTypes.func, // If not set, readonly
167
- schema: PropTypes.object.isRequired,
168
- dataSource: PropTypes.object.isRequired,
169
- dashboardDataSource: PropTypes.object.isRequired, // dashboard data source
170
-
171
- onRowClick: PropTypes.func, // Called with (tableId, rowId) when item is clicked
172
- namedStrings: PropTypes.object, // Optional lookup of string name to value. Used for {{branding}} and other replacement strings in text widget
173
-
174
- // Filters to add to the dashboard
175
- filters: PropTypes.arrayOf(PropTypes.shape({
176
- table: PropTypes.string.isRequired, // id table to filter
177
- jsonql: PropTypes.object.isRequired // jsonql filter with {alias} for tableAlias
178
- }))
179
- };
180
- }
181
-
182
- constructor(props) {
183
- this.update = this.update.bind(this);
184
- super(props);
185
-
186
- this.state = {
187
- open: false
188
- };
189
- }
190
-
191
- // Updates with the specified changes
192
- update() { return update(this.props.popup, this.props.onPopupChange, arguments); }
193
-
194
- show() {
195
- return this.setState({open: true});
196
- }
197
-
198
- render() {
199
- return R(ModalWindowComponent, {
200
- onRequestClose: () => this.setState({open: false}),
201
- isOpen: this.state.open
202
- },
203
- R(DashboardComponent, {
204
- schema: this.props.schema,
205
- dataSource: this.props.dataSource,
206
- dashboardDataSource: this.props.dashboardDataSource,
207
- design: this.props.popup.design,
208
- onDesignChange: this.update("design")
209
- // titleElem: H.span style: { fontSize: 20, cursor: "pointer" },
210
- // H.span className: "text-muted", onClick: (=> @setState(open: false)),
211
- // R ui.Icon, id: "fa-arrow-left"
212
- }));
213
- }
214
- }
215
- DashboardPopupComponent.initClass();
216
-
217
-
@@ -1,114 +0,0 @@
1
- // TODO: This file was created by bulk-decaffeinate.
2
- // Sanity-check the conversion and remove this comment.
3
- export default {
4
- "table": "entities.water_point",
5
- "showRowNumbers": true,
6
- "columns": [
7
- {
8
- "id": "31e3afda-35bd-488a-902d-34a301873d52",
9
- "expr": {
10
- "type": "field",
11
- "table": "entities.water_point",
12
- "column": "type"
13
- },
14
- "type": "expr",
15
- "label": null,
16
- "width": 150
17
- },
18
- {
19
- "id": "bc3ad4cc-65d6-4a44-a4e5-2d6cf7b37711",
20
- "expr": {
21
- "expr": {
22
- "type": "field",
23
- "table": "admin_regions",
24
- "column": "full_name"
25
- },
26
- "type": "scalar",
27
- "joins": [
28
- "admin_region"
29
- ],
30
- "table": "entities.water_point"
31
- },
32
- "type": "expr",
33
- "label": null,
34
- "width": 150
35
- },
36
- {
37
- "id": "3fb0f1c0-ca4c-4704-90d8-a7044daf6d1c",
38
- "expr": {
39
- "type": "field",
40
- "table": "entities.water_point",
41
- "column": "code"
42
- },
43
- "type": "expr",
44
- "label": null,
45
- "width": 150
46
- },
47
- {
48
- "id": "7b5d157a-c44a-4031-abe8-2b43acae000a",
49
- "expr": {
50
- "type": "field",
51
- "table": "entities.water_point",
52
- "column": "about"
53
- },
54
- "type": "expr",
55
- "label": null,
56
- "width": 150
57
- },
58
- {
59
- "id": "8a4a3d23-65fa-4e7e-9c8a-077954ce26c9",
60
- "expr": {
61
- "type": "field",
62
- "table": "entities.water_point",
63
- "column": "alt_id"
64
- },
65
- "type": "expr",
66
- "label": null,
67
- "width": 150
68
- },
69
- {
70
- "id": "31ac2483-a903-4c81-ace4-7b72353d6338",
71
- "expr": {
72
- "type": "field",
73
- "table": "entities.water_point",
74
- "column": "drilling_method"
75
- },
76
- "type": "expr",
77
- "label": null,
78
- "width": 150
79
- },
80
- {
81
- "id": "ed46bac2-2afc-42c3-8cdc-9a392bd70fda",
82
- "expr": {
83
- "type": "field",
84
- "table": "entities.water_point",
85
- "column": "drilling_method_other"
86
- },
87
- "type": "expr",
88
- "label": null,
89
- "width": 150
90
- },
91
- {
92
- "id": "da0d823a-6efb-4513-b8a3-a3cf1f9f4b0f",
93
- "expr": {
94
- "type": "field",
95
- "table": "entities.water_point",
96
- "column": "installation_date"
97
- },
98
- "type": "expr",
99
- "label": null,
100
- "width": 150
101
- },
102
- {
103
- "id": "8368be53-48d8-4e85-a507-beea2a68bf35",
104
- "expr": {
105
- "type": "field",
106
- "table": "entities.water_point",
107
- "column": "tz_wpms_id"
108
- },
109
- "type": "expr",
110
- "label": null,
111
- "width": 150
112
- }
113
- ]
114
- };
@@ -1,69 +0,0 @@
1
- // TODO: This file was created by bulk-decaffeinate.
2
- // Sanity-check the conversion and remove this comment.
3
- import PropTypes from 'prop-types';
4
- import _ from 'lodash';
5
- import React from 'react';
6
- const H = React.DOM;
7
- const R = React.createElement;
8
-
9
- import datagridDesign from './datagridDesign';
10
- import { storiesOf } from '@kadira/storybook';
11
- import DatagridComponent from '../src/datagrids/DatagridComponent';
12
- import DirectDatagridDataSource from '../src/datagrids/DirectDatagridDataSource';
13
- import MWaterLoaderComponent from '../src/MWaterLoaderComponent';
14
- import UpdateableComponent from './UpdateableComponent';
15
-
16
- storiesOf('Datagrid', module)
17
- .add('datagrid with serial number', () => {
18
- return R(SerialNumberDatagrid, {design: datagridDesign});
19
- });
20
-
21
-
22
- class SerialNumberDatagrid extends React.Component {
23
- static initClass() {
24
- this.propTypes =
25
- {design: PropTypes.object.isRequired};
26
- }
27
-
28
- render() {
29
- return R(UpdateableComponent,
30
- {design: this.props.design},
31
- (state, update) => {
32
- const apiUrl = "https://api.mwater.co/v3/";
33
- return R(MWaterLoaderComponent, {
34
- apiUrl,
35
- client: null,
36
- user: null
37
- // onExtraTablesChange: (extraTables) => @setState(extraTables: extraTables)
38
- // extraTables: @state.extraTables
39
- }, (error, config) => {
40
- if (error) {
41
- alert("Error: " + error.message);
42
- return null;
43
- }
44
-
45
- const datagridDataSource = new DirectDatagridDataSource({
46
- // apiUrl: apiUrl
47
- // client: null
48
- // design: state.design
49
- schema: config.schema,
50
- dataSource: config.dataSource
51
- });
52
-
53
- return H.div({style: { height: 800 }},
54
- React.createElement(DatagridComponent, {
55
- schema: config.schema,
56
- dataSource: config.dataSource,
57
- datagridDataSource,
58
- design: state.design,
59
- onDesignChange: update("design"),
60
- titleElem: "Sample",
61
- height: 400
62
- // quickfilterLocks: [{ expr: { type: "field", table: "entities.water_point", column: "type" }, value: "Protected dug well" }]
63
- })
64
- );
65
- });
66
- });
67
- }
68
- }
69
- SerialNumberDatagrid.initClass();
package/stories/dates.js DELETED
@@ -1,80 +0,0 @@
1
- // TODO: This file was created by bulk-decaffeinate.
2
- // Sanity-check the conversion and remove this comment.
3
- import PropTypes from 'prop-types';
4
- import _ from 'lodash';
5
- import React from 'react';
6
- const H = React.DOM;
7
- const R = React.createElement;
8
-
9
- import DateExprComponent from '../src/quickfilter/DateExprComponent';
10
- import DateRangeComponent from '../src/DateRangeComponent';
11
- import { storiesOf } from '@kadira/storybook';
12
- import UpdateableComponent from './UpdateableComponent';
13
-
14
- storiesOf('DateExprComponent', module)
15
- .add('date (blank)', () => {
16
- return R(UpdateableComponent,
17
- {value: null},
18
- (state, update) => {
19
- return R(DateExprComponent, {
20
- value: state.value,
21
- onChange: update("value")
22
- }
23
- );
24
- });
25
- }).add('date (today)', () => {
26
- return R(UpdateableComponent,
27
- {value: { type: "op", op: "today", exprs: [] }},
28
- (state, update) => {
29
- return R(DateExprComponent, {
30
- value: state.value,
31
- onChange: update("value")
32
- }
33
- );
34
- });
35
- }).add('datetime (blank)', () => {
36
- return R(UpdateableComponent,
37
- {value: null},
38
- (state, update) => {
39
- return R(DateExprComponent, {
40
- datetime: true,
41
- value: state.value,
42
- onChange: update("value")
43
- }
44
- );
45
- });
46
- });
47
-
48
- storiesOf('DateRangeComponent', module)
49
- .add('date (blank)', () => {
50
- return R(UpdateableComponent,
51
- {value: null},
52
- (state, update) => {
53
- return R(DateRangeComponent, {
54
- value: state.value,
55
- onChange: update("value")
56
- }
57
- );
58
- });
59
- }).add('date (today)', () => {
60
- return R(UpdateableComponent,
61
- {value: [moment().format("YYYY-MM-DD"), moment().format("YYYY-MM-DD")]},
62
- (state, update) => {
63
- return R(DateRangeComponent, {
64
- value: state.value,
65
- onChange: update("value")
66
- }
67
- );
68
- });
69
- }).add('datetime (blank)', () => {
70
- return R(UpdateableComponent,
71
- {value: null},
72
- (state, update) => {
73
- return R(DateRangeComponent, {
74
- datetime: true,
75
- value: state.value,
76
- onChange: update("value")
77
- }
78
- );
79
- });
80
- });
@@ -1,43 +0,0 @@
1
- // TODO: This file was created by bulk-decaffeinate.
2
- // Sanity-check the conversion and remove this comment.
3
- import PropTypes from 'prop-types';
4
- import _ from 'lodash';
5
- import React from 'react';
6
- const H = React.DOM;
7
- const R = React.createElement;
8
-
9
- import datagridDesign from './datagridDesign';
10
- import { storiesOf } from '@kadira/storybook';
11
- import { ExprComponent } from "mwater-expressions-ui";
12
- import MWaterLoaderComponent from '../src/MWaterLoaderComponent';
13
- import UpdateableComponent from './UpdateableComponent';
14
-
15
- storiesOf('ExprComponent', module)
16
- .add('blank', () => {
17
- return R(UpdateableComponent,
18
- {value: null},
19
- (state, update) => {
20
- // apiUrl = "https://api.mwater.co/v3/"
21
- const apiUrl = "http://localhost:1234/v3/";
22
- return R(MWaterLoaderComponent, {
23
- apiUrl,
24
- client: null,
25
- user: null,
26
- onExtraTablesChange: update("extraTables"),
27
- extraTables: state.extraTables
28
- }, (error, config) => {
29
- if (error) {
30
- alert("Error: " + error.message);
31
- return null;
32
- }
33
-
34
- return React.createElement(ExprComponent, {
35
- schema: config.schema,
36
- dataSource: config.dataSource,
37
- table: "entities.water_point",
38
- value: state.value,
39
- onChange: update("value")
40
- });
41
- });
42
- });
43
- });
package/stories/index.js DELETED
@@ -1,18 +0,0 @@
1
- // TODO: This file was created by bulk-decaffeinate.
2
- // Sanity-check the conversion and remove this comment.
3
- import _ from 'lodash';
4
- import React from 'react';
5
- const H = React.DOM;
6
- const R = React.createElement;
7
- import { storiesOf } from '@kadira/storybook';
8
- import { action } from '@kadira/storybook';
9
- import './dashboards';
10
- import './pivotChart';
11
-
12
- // require './consoles'
13
- import './maps';
14
-
15
- import './leaflet';
16
- import './datagrids';
17
- import './dates';
18
- import './exprcomponent';
@@ -1,59 +0,0 @@
1
- // TODO: This file was created by bulk-decaffeinate.
2
- // Sanity-check the conversion and remove this comment.
3
- import _ from 'lodash';
4
- import React from 'react';
5
- const H = React.DOM;
6
- const R = React.createElement;
7
-
8
- import { storiesOf } from '@kadira/storybook';
9
- import { action } from '@kadira/storybook';
10
- import LeafletMapComponent from '../src/maps/LeafletMapComponent';
11
-
12
- storiesOf('Leaflet', module)
13
- .add('normal', () => {
14
- return R(LeafletMapComponent, {
15
- baseLayerId: "bing_road",
16
- width: "100%",
17
- height: 600,
18
- layers: []
19
- });
20
- })
21
-
22
- .add('popup', () => {
23
- return R(LeafletMapComponent, {
24
- baseLayerId: "bing_road",
25
- width: "100%",
26
- height: 600,
27
- layers: [],
28
- popup: {
29
- lat: 30,
30
- lng: -20,
31
- contents: H.div(null, "Hello!!!")
32
- }
33
- });
34
- })
35
-
36
- .add('popup2', () => {
37
- return R(LeafletMapComponent, {
38
- baseLayerId: "bing_road",
39
- width: "100%",
40
- height: 600,
41
- layers: [],
42
- popup: {
43
- lat: 35,
44
- lng: -20,
45
- contents: H.div(null, "Hello2!!!")
46
- }
47
- });
48
- });
49
- // R LeafletMapComponent,
50
- // baseLayerId: "bing_road"
51
- // width: "100%"
52
- // height: 600
53
- // layers: [
54
- // {
55
- // tileUrl: "http://localhost:1234/v3/maps/tiles/{z}/{x}/{y}.png?type=cluster"
56
- // visible: true
57
- // }
58
- // ]
59
-
package/stories/maps.js DELETED
@@ -1,24 +0,0 @@
1
- // TODO: This file was created by bulk-decaffeinate.
2
- // Sanity-check the conversion and remove this comment.
3
- import _ from 'lodash';
4
- import React from 'react';
5
- const H = React.DOM;
6
- const R = React.createElement;
7
-
8
- import { storiesOf } from '@kadira/storybook';
9
- import { action } from '@kadira/storybook';
10
- import LeafletMapComponent from '../src/maps/LeafletMapComponent';
11
-
12
- storiesOf('Maps', module);
13
- // .add 'local test', =>
14
- // R LeafletMapComponent,
15
- // baseLayerId: "bing_road"
16
- // width: "100%"
17
- // height: 600
18
- // layers: [
19
- // {
20
- // tileUrl: "http://localhost:1234/v3/maps/tiles/{z}/{x}/{y}.png?type=cluster"
21
- // visible: true
22
- // }
23
- // ]
24
-