@mwater/visualization 5.5.0 → 5.6.1

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 (275) hide show
  1. package/lib/ColorComponent.js +2 -2
  2. package/lib/MWaterContextComponent.d.ts +1 -1
  3. package/lib/MWaterGlobalFiltersComponent.d.ts +2 -2
  4. package/lib/MWaterGlobalFiltersComponent.js +11 -20
  5. package/lib/MWaterLoaderComponent.d.ts +4 -13
  6. package/lib/MWaterLoaderComponent.js +2 -11
  7. package/lib/TranslationsTabComponent.d.ts +34 -0
  8. package/lib/TranslationsTabComponent.js +256 -0
  9. package/lib/UndoStack.d.ts +2 -1
  10. package/lib/UndoStack.js +12 -6
  11. package/lib/dashboards/DashboardComponent.js +6 -5
  12. package/lib/dashboards/DashboardDesign.d.ts +1 -1
  13. package/lib/dashboards/ServerDashboardDataSource.d.ts +0 -1
  14. package/lib/dashboards/ServerDashboardDataSource.js +0 -25
  15. package/lib/dashboards/SettingsModalComponent.js +9 -233
  16. package/lib/datagrids/DatagridComponent.js +27 -2
  17. package/lib/datagrids/DatagridDesignerComponent.d.ts +2 -3
  18. package/lib/datagrids/DatagridDesignerComponent.js +108 -120
  19. package/lib/datagrids/DatagridViewComponent.js +33 -6
  20. package/lib/datagrids/OrderBysDesignerComponent.d.ts +7 -7
  21. package/lib/datagrids/OrderBysDesignerComponent.js +19 -28
  22. package/lib/index.css +45 -2
  23. package/lib/index.d.ts +5 -5
  24. package/lib/index.js +2 -3
  25. package/lib/layouts/blocks/BlocksDisplayComponent.d.ts +8 -1
  26. package/lib/layouts/blocks/BlocksDisplayComponent.js +46 -4
  27. package/lib/maps/BufferLayer.d.ts +0 -13
  28. package/lib/maps/BufferLayer.js +24 -237
  29. package/lib/maps/BufferLayerDesign.d.ts +1 -1
  30. package/lib/maps/BufferLayerDesignerComponent.d.ts +1 -1
  31. package/lib/maps/BufferLayerDesignerComponent.js +2 -7
  32. package/lib/maps/ChoroplethLayer.d.ts +1 -16
  33. package/lib/maps/ChoroplethLayer.js +25 -358
  34. package/lib/maps/ChoroplethLayerDesign.d.ts +5 -2
  35. package/lib/maps/ChoroplethLayerDesigner.d.ts +10 -32
  36. package/lib/maps/ChoroplethLayerDesigner.js +58 -89
  37. package/lib/maps/ClusterLayer.d.ts +0 -9
  38. package/lib/maps/ClusterLayer.js +0 -250
  39. package/lib/maps/DirectMapDataSource.js +1 -48
  40. package/lib/maps/EditHoverOver.d.ts +4 -3
  41. package/lib/maps/EditHoverOver.js +3 -3
  42. package/lib/maps/GridLayer.d.ts +0 -15
  43. package/lib/maps/GridLayer.js +0 -212
  44. package/lib/maps/HoverContent.js +1 -1
  45. package/lib/maps/Layer.d.ts +1 -26
  46. package/lib/maps/Layer.js +0 -13
  47. package/lib/maps/LeafletMapComponent.js +10 -19
  48. package/lib/maps/MapComponent.d.ts +19 -35
  49. package/lib/maps/MapComponent.js +135 -77
  50. package/lib/maps/MapControlComponent.d.ts +4 -5
  51. package/lib/maps/MapControlComponent.js +5 -12
  52. package/lib/maps/MapDesign.d.ts +8 -0
  53. package/lib/maps/MapDesignerComponent.d.ts +2 -0
  54. package/lib/maps/MapDesignerComponent.js +7 -2
  55. package/lib/maps/MapLayerDataSource.d.ts +0 -4
  56. package/lib/maps/MapLayerViewDesignerComponent.d.ts +3 -1
  57. package/lib/maps/MapLayerViewDesignerComponent.js +5 -1
  58. package/lib/maps/MapLayersDesignerComponent.d.ts +2 -0
  59. package/lib/maps/MapLayersDesignerComponent.js +2 -1
  60. package/lib/maps/MapTranslationsTab.d.ts +15 -0
  61. package/lib/maps/MapTranslationsTab.js +47 -0
  62. package/lib/maps/MapUtils.d.ts +11 -0
  63. package/lib/maps/MapUtils.js +57 -1
  64. package/lib/maps/MapViewComponent.d.ts +1 -1
  65. package/lib/maps/MapViewComponent.js +1 -8
  66. package/lib/maps/MarkersLayer.d.ts +1 -14
  67. package/lib/maps/MarkersLayer.js +89 -254
  68. package/lib/maps/MarkersLayerDesign.d.ts +5 -1
  69. package/lib/maps/MarkersLayerDesignerComponent.d.ts +32 -57
  70. package/lib/maps/MarkersLayerDesignerComponent.js +158 -134
  71. package/lib/maps/ServerMapDataSource.d.ts +0 -1
  72. package/lib/maps/ServerMapDataSource.js +0 -25
  73. package/lib/maps/SwitchableTileUrlLayer.d.ts +0 -2
  74. package/lib/maps/SwitchableTileUrlLayer.js +0 -9
  75. package/lib/maps/TileUrlLayer.d.ts +0 -1
  76. package/lib/maps/TileUrlLayer.js +0 -5
  77. package/lib/maps/VectorMapViewComponent.js +13 -10
  78. package/lib/maps/symbols/font-awesome/asterisk.png +0 -0
  79. package/lib/maps/symbols/font-awesome/ban.png +0 -0
  80. package/lib/maps/symbols/font-awesome/beer.png +0 -0
  81. package/lib/maps/symbols/font-awesome/bell.png +0 -0
  82. package/lib/maps/symbols/font-awesome/bolt.png +0 -0
  83. package/lib/maps/symbols/font-awesome/building.png +0 -0
  84. package/lib/maps/symbols/font-awesome/bullseye.png +0 -0
  85. package/lib/maps/symbols/font-awesome/bus.png +0 -0
  86. package/lib/maps/symbols/font-awesome/caret-up.png +0 -0
  87. package/lib/maps/symbols/font-awesome/certificate.png +0 -0
  88. package/lib/maps/symbols/font-awesome/check-circle.png +0 -0
  89. package/lib/maps/symbols/font-awesome/check.png +0 -0
  90. package/lib/maps/symbols/font-awesome/chevron-circle-down.png +0 -0
  91. package/lib/maps/symbols/font-awesome/chevron-circle-up.png +0 -0
  92. package/lib/maps/symbols/font-awesome/cloud-rain.png +0 -0
  93. package/lib/maps/symbols/font-awesome/cloud.png +0 -0
  94. package/lib/maps/symbols/font-awesome/comment.png +0 -0
  95. package/lib/maps/symbols/font-awesome/crosshairs.png +0 -0
  96. package/lib/maps/symbols/font-awesome/dot-circle-o.png +0 -0
  97. package/lib/maps/symbols/font-awesome/exclamation-circle.png +0 -0
  98. package/lib/maps/symbols/font-awesome/exclamation-triangle.png +0 -0
  99. package/lib/maps/symbols/font-awesome/female.png +0 -0
  100. package/lib/maps/symbols/font-awesome/file.png +0 -0
  101. package/lib/maps/symbols/font-awesome/flag.png +0 -0
  102. package/lib/maps/symbols/font-awesome/flask.png +0 -0
  103. package/lib/maps/symbols/font-awesome/h-square.png +0 -0
  104. package/lib/maps/symbols/font-awesome/home.png +0 -0
  105. package/lib/maps/symbols/font-awesome/info-circle.png +0 -0
  106. package/lib/maps/symbols/font-awesome/male.png +0 -0
  107. package/lib/maps/symbols/font-awesome/medkit.png +0 -0
  108. package/lib/maps/symbols/font-awesome/mobile.png +0 -0
  109. package/lib/maps/symbols/font-awesome/plus-circle.png +0 -0
  110. package/lib/maps/symbols/font-awesome/plus-square.png +0 -0
  111. package/lib/maps/symbols/font-awesome/plus.png +0 -0
  112. package/lib/maps/symbols/font-awesome/square.png +0 -0
  113. package/lib/maps/symbols/font-awesome/star.png +0 -0
  114. package/lib/maps/symbols/font-awesome/thumbs-down.png +0 -0
  115. package/lib/maps/symbols/font-awesome/thumbs-up.png +0 -0
  116. package/lib/maps/symbols/font-awesome/ticket.png +0 -0
  117. package/lib/maps/symbols/font-awesome/times-circle.png +0 -0
  118. package/lib/maps/symbols/font-awesome/times.png +0 -0
  119. package/lib/maps/symbols/font-awesome/tint.png +0 -0
  120. package/lib/maps/symbols/font-awesome/tree.png +0 -0
  121. package/lib/maps/symbols/font-awesome/university.png +0 -0
  122. package/lib/maps/symbols/font-awesome/usd.png +0 -0
  123. package/lib/maps/symbols/font-awesome/user.png +0 -0
  124. package/lib/maps/symbols/font-awesome/users.png +0 -0
  125. package/lib/maps/symbols/font-awesome/wheelchair.png +0 -0
  126. package/lib/maps/symbols/sdf-ize.sh +93 -0
  127. package/lib/maps/vectorMaps.d.ts +6 -6
  128. package/lib/maps/vectorMaps.js +33 -45
  129. package/lib/mwater_table_selection/IndicatorsListComponent.d.ts +4 -2
  130. package/lib/mwater_table_selection/IndicatorsListComponent.js +103 -34
  131. package/lib/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.d.ts +18 -0
  132. package/lib/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.js +80 -0
  133. package/lib/mwater_table_selection/MWaterCompleteTableSelectComponent.d.ts +26 -0
  134. package/lib/mwater_table_selection/MWaterCompleteTableSelectComponent.js +237 -51
  135. package/lib/mwater_table_selection/MWaterTableSelectComponent.d.ts +2 -2
  136. package/lib/mwater_table_selection/MWaterTableSelectComponent.js +9 -4
  137. package/lib/mwater_table_selection/MWaterWorkflowsSelectComponent.d.ts +19 -0
  138. package/lib/mwater_table_selection/MWaterWorkflowsSelectComponent.js +111 -0
  139. package/lib/quickfilter/QuickfiltersComponent.d.ts +3 -102
  140. package/lib/quickfilter/QuickfiltersComponent.js +53 -110
  141. package/lib/quickfilter/TextLiteralComponent.d.ts +23 -47
  142. package/lib/quickfilter/TextLiteralComponent.js +85 -82
  143. package/lib/widgets/MapWidget.js +6 -3
  144. package/lib/widgets/text/ExprItemEditorComponent.d.ts +3 -8
  145. package/lib/widgets/text/ExprItemEditorComponent.js +36 -33
  146. package/lib/widgets/text/ExprUpdateModalComponent.d.ts +1 -0
  147. package/package.json +3 -4
  148. package/src/ColorComponent.tsx +2 -2
  149. package/src/MWaterContextComponent.tsx +1 -1
  150. package/src/{MWaterGlobalFiltersComponent.ts → MWaterGlobalFiltersComponent.tsx} +32 -33
  151. package/src/{MWaterLoaderComponent.ts → MWaterLoaderComponent.tsx} +17 -18
  152. package/src/TranslationsTabComponent.tsx +429 -0
  153. package/src/UndoStack.ts +14 -6
  154. package/src/dashboards/DashboardComponent.tsx +6 -5
  155. package/src/dashboards/DashboardDesign.ts +1 -1
  156. package/src/dashboards/ServerDashboardDataSource.ts +0 -31
  157. package/src/dashboards/SettingsModalComponent.tsx +27 -383
  158. package/src/datagrids/DatagridComponent.tsx +36 -2
  159. package/src/datagrids/DatagridDesignerComponent.tsx +241 -229
  160. package/src/datagrids/DatagridViewComponent.tsx +44 -7
  161. package/src/datagrids/OrderBysDesignerComponent.tsx +61 -70
  162. package/src/index.css +45 -2
  163. package/src/index.ts +5 -11
  164. package/src/layouts/blocks/BlocksDisplayComponent.tsx +60 -5
  165. package/src/maps/BufferLayer.ts +30 -263
  166. package/src/maps/BufferLayerDesign.ts +1 -1
  167. package/src/maps/BufferLayerDesignerComponent.tsx +2 -7
  168. package/src/maps/ChoroplethLayer.ts +30 -394
  169. package/src/maps/ChoroplethLayerDesign.ts +5 -2
  170. package/src/maps/ChoroplethLayerDesigner.tsx +169 -165
  171. package/src/maps/ClusterLayer.ts +0 -274
  172. package/src/maps/DirectMapDataSource.ts +2 -61
  173. package/src/maps/EditHoverOver.tsx +9 -5
  174. package/src/maps/GridLayer.ts +0 -224
  175. package/src/maps/HoverContent.tsx +1 -1
  176. package/src/maps/Layer.ts +1 -35
  177. package/src/maps/LeafletMapComponent.tsx +10 -19
  178. package/src/maps/MapComponent.tsx +448 -0
  179. package/src/maps/MapControlComponent.tsx +41 -0
  180. package/src/maps/MapDesign.ts +6 -0
  181. package/src/maps/MapDesignerComponent.tsx +18 -1
  182. package/src/maps/MapLayerDataSource.ts +0 -5
  183. package/src/maps/MapLayerViewDesignerComponent.ts +9 -2
  184. package/src/maps/MapLayersDesignerComponent.ts +4 -1
  185. package/src/maps/MapTranslationsTab.tsx +53 -0
  186. package/src/maps/MapUtils.ts +61 -1
  187. package/src/maps/MapViewComponent.tsx +2 -8
  188. package/src/maps/MarkersLayer.ts +101 -275
  189. package/src/maps/MarkersLayerDesign.ts +7 -1
  190. package/src/maps/MarkersLayerDesignerComponent.tsx +436 -0
  191. package/src/maps/ServerMapDataSource.ts +0 -31
  192. package/src/maps/SwitchableTileUrlLayer.tsx +0 -11
  193. package/src/maps/TileUrlLayer.tsx +0 -6
  194. package/src/maps/VectorMapViewComponent.tsx +15 -15
  195. package/src/maps/symbols/font-awesome/asterisk.png +0 -0
  196. package/src/maps/symbols/font-awesome/ban.png +0 -0
  197. package/src/maps/symbols/font-awesome/beer.png +0 -0
  198. package/src/maps/symbols/font-awesome/bell.png +0 -0
  199. package/src/maps/symbols/font-awesome/bolt.png +0 -0
  200. package/src/maps/symbols/font-awesome/building.png +0 -0
  201. package/src/maps/symbols/font-awesome/bullseye.png +0 -0
  202. package/src/maps/symbols/font-awesome/bus.png +0 -0
  203. package/src/maps/symbols/font-awesome/caret-up.png +0 -0
  204. package/src/maps/symbols/font-awesome/certificate.png +0 -0
  205. package/src/maps/symbols/font-awesome/check-circle.png +0 -0
  206. package/src/maps/symbols/font-awesome/check.png +0 -0
  207. package/src/maps/symbols/font-awesome/chevron-circle-down.png +0 -0
  208. package/src/maps/symbols/font-awesome/chevron-circle-up.png +0 -0
  209. package/src/maps/symbols/font-awesome/cloud-rain.png +0 -0
  210. package/src/maps/symbols/font-awesome/cloud.png +0 -0
  211. package/src/maps/symbols/font-awesome/comment.png +0 -0
  212. package/src/maps/symbols/font-awesome/crosshairs.png +0 -0
  213. package/src/maps/symbols/font-awesome/dot-circle-o.png +0 -0
  214. package/src/maps/symbols/font-awesome/exclamation-circle.png +0 -0
  215. package/src/maps/symbols/font-awesome/exclamation-triangle.png +0 -0
  216. package/src/maps/symbols/font-awesome/female.png +0 -0
  217. package/src/maps/symbols/font-awesome/file.png +0 -0
  218. package/src/maps/symbols/font-awesome/flag.png +0 -0
  219. package/src/maps/symbols/font-awesome/flask.png +0 -0
  220. package/src/maps/symbols/font-awesome/h-square.png +0 -0
  221. package/src/maps/symbols/font-awesome/home.png +0 -0
  222. package/src/maps/symbols/font-awesome/info-circle.png +0 -0
  223. package/src/maps/symbols/font-awesome/male.png +0 -0
  224. package/src/maps/symbols/font-awesome/medkit.png +0 -0
  225. package/src/maps/symbols/font-awesome/mobile.png +0 -0
  226. package/src/maps/symbols/font-awesome/plus-circle.png +0 -0
  227. package/src/maps/symbols/font-awesome/plus-square.png +0 -0
  228. package/src/maps/symbols/font-awesome/plus.png +0 -0
  229. package/src/maps/symbols/font-awesome/square.png +0 -0
  230. package/src/maps/symbols/font-awesome/star.png +0 -0
  231. package/src/maps/symbols/font-awesome/thumbs-down.png +0 -0
  232. package/src/maps/symbols/font-awesome/thumbs-up.png +0 -0
  233. package/src/maps/symbols/font-awesome/ticket.png +0 -0
  234. package/src/maps/symbols/font-awesome/times-circle.png +0 -0
  235. package/src/maps/symbols/font-awesome/times.png +0 -0
  236. package/src/maps/symbols/font-awesome/tint.png +0 -0
  237. package/src/maps/symbols/font-awesome/tree.png +0 -0
  238. package/src/maps/symbols/font-awesome/university.png +0 -0
  239. package/src/maps/symbols/font-awesome/usd.png +0 -0
  240. package/src/maps/symbols/font-awesome/user.png +0 -0
  241. package/src/maps/symbols/font-awesome/users.png +0 -0
  242. package/src/maps/symbols/font-awesome/wheelchair.png +0 -0
  243. package/src/maps/symbols/sdf-ize.sh +93 -0
  244. package/src/maps/vectorMaps.tsx +32 -53
  245. package/src/mwater_table_selection/IndicatorsListComponent.tsx +165 -37
  246. package/src/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.tsx +111 -0
  247. package/src/mwater_table_selection/MWaterCompleteTableSelectComponent.tsx +373 -37
  248. package/src/mwater_table_selection/MWaterTableSelectComponent.tsx +12 -8
  249. package/src/mwater_table_selection/MWaterWorkflowsSelectComponent.tsx +159 -0
  250. package/src/quickfilter/{QuickfiltersComponent.ts → QuickfiltersComponent.tsx} +165 -158
  251. package/src/quickfilter/TextLiteralComponent.tsx +197 -0
  252. package/src/widgets/MapWidget.tsx +11 -1
  253. package/src/widgets/text/ExprItemEditorComponent.tsx +83 -77
  254. package/src/widgets/text/ExprUpdateModalComponent.tsx +1 -0
  255. package/test/UndoStackTests.ts +52 -1
  256. package/.storybook/config.js +0 -7
  257. package/.storybook/head.html +0 -3
  258. package/.storybook/webpack.config.js +0 -15
  259. package/src/maps/BingLayer.ts +0 -146
  260. package/src/maps/MapComponent.ts +0 -312
  261. package/src/maps/MapControlComponent.ts +0 -46
  262. package/src/maps/MarkersLayerDesignerComponent.ts +0 -374
  263. package/src/maps/RasterMapViewComponent.ts +0 -345
  264. package/src/quickfilter/TextLiteralComponent.ts +0 -165
  265. package/stories/UpdateableComponent.js +0 -29
  266. package/stories/consoles.js +0 -202
  267. package/stories/dashboards.js +0 -217
  268. package/stories/datagridDesign.js +0 -114
  269. package/stories/datagrids.js +0 -69
  270. package/stories/dates.js +0 -80
  271. package/stories/exprcomponent.js +0 -43
  272. package/stories/index.js +0 -18
  273. package/stories/leaflet.js +0 -59
  274. package/stories/maps.js +0 -24
  275. package/stories/pivotChart.js +0 -235
@@ -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
-
@@ -1,235 +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 WidgetFactory from '../src/widgets/WidgetFactory';
11
- import DirectWidgetDataSource from '../src/widgets/DirectWidgetDataSource';
12
- import MWaterLoaderComponent from '../src/MWaterLoaderComponent';
13
- import UpdateableComponent from './UpdateableComponent';
14
-
15
- storiesOf('Pivot Chart', module)
16
- .add('blank', () => {
17
- return R(PivotTest, { design: {
18
- }
19
- });
20
- })
21
-
22
- .add('water point (new)', () => {
23
- return R(PivotTest, { design: {
24
- table: "entities.water_point",
25
- rows: [{ id: "row1" }],
26
- columns: [{ id: "col1" }],
27
- intersections: {}
28
- }
29
- });
30
- })
31
-
32
- .add('water types', () => {
33
- return R(PivotTest, { design: {
34
- table: "entities.water_point",
35
- rows: [
36
- {
37
- id: "row1",
38
- valueAxis: { expr: { type: "field", table: "entities.water_point", column: "type" } }
39
- }
40
- ],
41
- columns: [{ id: "col1", label: "Test" }],
42
- intersections: {
43
- "row1:col1": {
44
- valueAxis: { expr: { type: "op", op: "count", table: "entities.water_point", exprs: [] } }
45
- }
46
- }
47
- }
48
- });
49
- })
50
-
51
- .add('water types with label', () => {
52
- return R(PivotTest, { design: {
53
- table: "entities.water_point",
54
- rows: [
55
- {
56
- id: "row1",
57
- valueAxis: { expr: { type: "field", table: "entities.water_point", column: "type" } },
58
- label: "Type",
59
- italic: true
60
- }
61
- ],
62
- columns: [{ id: "col1", label: "Count" }],
63
- intersections: {
64
- "row1:col1": {
65
- valueAxis: { expr: { type: "op", op: "count", table: "entities.water_point", exprs: [] } }
66
- }
67
- }
68
- }
69
- });
70
- })
71
-
72
- .add('water types by functionality', () => {
73
- return R(PivotTest, { design: {
74
- table: "entities.water_point",
75
- rows: [
76
- {
77
- id: "row1",
78
- valueAxis: { expr: { type: "field", table: "entities.water_point", column: "type" } },
79
- label: "Type"
80
- }
81
- ],
82
- columns: [
83
- {
84
- id: "col1",
85
- valueAxis: {"expr":{"type":"scalar","table":"entities.water_point","joins":["!indicator_values:c0adc9f1c9be4271af9d722b7e50b4c9.Water point"],"expr":{"type":"op","op":"last","table":"indicator_values:c0adc9f1c9be4271af9d722b7e50b4c9","exprs":[{"type":"field","table":"indicator_values:c0adc9f1c9be4271af9d722b7e50b4c9","column":"Functionality"}]}}},
86
- label: "Functionality"
87
- }
88
- ],
89
- intersections: {
90
- "row1:col1": {
91
- valueAxis: { expr: { type: "op", op: "count", table: "entities.water_point", exprs: [] } }
92
- }
93
- }
94
- }
95
- });
96
- })
97
-
98
- .add('water types by functionality all vertical', () => {
99
- return R(PivotTest, { design: {
100
- table: "entities.water_point",
101
- rows: [
102
- {
103
- id: "row1",
104
- valueAxis: { expr: { type: "field", table: "entities.water_point", column: "type" } },
105
- label: "Type",
106
- children: [
107
- {
108
- id: "row2",
109
- valueAxis: {"expr":{"type":"scalar","table":"entities.water_point","joins":["!indicator_values:c0adc9f1c9be4271af9d722b7e50b4c9.Water point"],"expr":{"type":"op","op":"last","table":"indicator_values:c0adc9f1c9be4271af9d722b7e50b4c9","exprs":[{"type":"field","table":"indicator_values:c0adc9f1c9be4271af9d722b7e50b4c9","column":"Functionality"}]}}},
110
- label: "Functionality"
111
- }
112
- ]
113
- }
114
- ],
115
- columns: [{ id: "col1", label: "Count" }],
116
- intersections: {
117
- "row1,row2:col1": {
118
- valueAxis: { expr: { type: "op", op: "count", table: "entities.water_point", exprs: [] } }
119
- }
120
- }
121
- }
122
- });
123
- })
124
-
125
- .add('conditional color', () => {
126
- return R(PivotTest, { design: {
127
- "table": "entities.water_point",
128
- "rows": [
129
- {
130
- "id": "row1",
131
- "valueAxis": {
132
- "expr": {
133
- "type": "field",
134
- "table": "entities.water_point",
135
- "column": "type"
136
- }
137
- }
138
- }
139
- ],
140
- "columns": [
141
- {
142
- "id": "col1",
143
- "label": "Test"
144
- }
145
- ],
146
- "intersections": {
147
- "row1:col1": {
148
- "valueAxis": {
149
- "expr": {
150
- "type": "op",
151
- "op": "count",
152
- "table": "entities.water_point",
153
- "exprs": []
154
- }
155
- },
156
- "backgroundColorConditions": [
157
- {
158
- "condition": {
159
- "type": "op",
160
- "table": "entities.water_point",
161
- "op": ">",
162
- "exprs": [
163
- {
164
- "type": "op",
165
- "op": "count",
166
- "table": "entities.water_point",
167
- "exprs": []
168
- },
169
- {
170
- "type": "literal",
171
- "valueType": "number",
172
- "value": 10000
173
- }
174
- ]
175
- },
176
- "color": "#880e4f"
177
- }
178
- ],
179
- "backgroundColorOpacity": 1
180
- }
181
- },
182
- "version": 1,
183
- "header": {
184
- "style": "footer",
185
- "items": []
186
- },
187
- "footer": {
188
- "style": "footer",
189
- "items": []
190
- },
191
- "filter": null
192
- }
193
- });
194
- });
195
-
196
- class PivotTest extends React.Component {
197
- render() {
198
- return R(UpdateableComponent,
199
- {design: this.props.design},
200
- (state, update) => {
201
- return R(MWaterLoaderComponent, {
202
- apiUrl: "https://api.mwater.co/v3/",
203
- client: null,
204
- user: null
205
- // onExtraTablesChange: (extraTables) => @setState(extraTables: extraTables)
206
- // extraTables: @state.extraTables
207
- }, (error, config) => {
208
- if (error) {
209
- alert("Error: " + error.message);
210
- return null;
211
- }
212
-
213
- const widget = WidgetFactory.createWidget("PivotChart");
214
-
215
- const widgetDataSource = new DirectWidgetDataSource({
216
- widget,
217
- schema: config.schema,
218
- dataSource: config.dataSource
219
- });
220
-
221
- return widget.createViewElement({
222
- schema: config.schema,
223
- dataSource: config.dataSource,
224
- widgetDataSource,
225
- design: state.design,
226
- scope: null,
227
- filters: null,
228
- onScopeChange: null,
229
- onDesignChange: update("design"),
230
- width: 800
231
- });
232
- });
233
- });
234
- }
235
- }