@mwater/visualization 5.3.1 → 5.4.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 (309) hide show
  1. package/lib/ColorComponent.d.ts +1 -1
  2. package/lib/ColorComponent.js +2 -2
  3. package/lib/CustomColorsContext.d.ts +1 -1
  4. package/lib/DateRangeComponent.js +10 -10
  5. package/lib/LocaleContextInjector.js +2 -2
  6. package/lib/MWaterAddRelatedFormComponent.js +8 -8
  7. package/lib/MWaterAddRelatedIndicatorComponent.d.ts +0 -1
  8. package/lib/MWaterAddRelatedIndicatorComponent.js +6 -6
  9. package/lib/MWaterAssetSystemsListComponent.d.ts +3 -3
  10. package/lib/MWaterAssetSystemsListComponent.js +4 -3
  11. package/lib/MWaterCompleteTableSelectComponent.d.ts +33 -34
  12. package/lib/MWaterCompleteTableSelectComponent.js +39 -38
  13. package/lib/MWaterCustomTablesetListComponent.d.ts +3 -3
  14. package/lib/MWaterCustomTablesetListComponent.js +5 -4
  15. package/lib/MWaterGlobalFiltersComponent.js +4 -4
  16. package/lib/MWaterLoaderComponent.d.ts +5 -5
  17. package/lib/MWaterLoaderComponent.js +1 -1
  18. package/lib/MWaterMetricsTableListComponent.d.ts +3 -3
  19. package/lib/MWaterMetricsTableListComponent.js +4 -3
  20. package/lib/MWaterResponsesFilterComponent.js +4 -4
  21. package/lib/MWaterTableSelectComponent.d.ts +1 -1
  22. package/lib/MWaterTableSelectComponent.js +5 -5
  23. package/lib/PopoverComponent.d.ts +4 -4
  24. package/lib/UIComponents.d.ts +5 -2
  25. package/lib/axes/AxisBuilder.js +42 -43
  26. package/lib/axes/AxisColorEditorComponent.d.ts +4 -4
  27. package/lib/axes/AxisColorEditorComponent.js +25 -60
  28. package/lib/axes/AxisComponent.d.ts +2 -3
  29. package/lib/axes/AxisComponent.js +20 -20
  30. package/lib/axes/BinsComponent.js +6 -6
  31. package/lib/axes/CategoryMapComponent.d.ts +2 -1
  32. package/lib/axes/CategoryMapComponent.js +7 -5
  33. package/lib/axes/ColorPaletteCollectionComponent.js +9 -9
  34. package/lib/axes/RangesComponent.js +12 -12
  35. package/lib/compressJson.js +1 -1
  36. package/lib/dashboards/DashboardComponent.d.ts +2 -0
  37. package/lib/dashboards/DashboardComponent.js +15 -8
  38. package/lib/dashboards/DashboardUtils.js +2 -3
  39. package/lib/dashboards/DashboardViewComponent.js +4 -4
  40. package/lib/dashboards/FontStyleEditor.js +8 -8
  41. package/lib/dashboards/LayoutOptionsComponent.js +102 -75
  42. package/lib/dashboards/SettingsModalComponent.d.ts +3 -4
  43. package/lib/dashboards/SettingsModalComponent.js +54 -40
  44. package/lib/dashboards/WidgetComponent.d.ts +0 -1
  45. package/lib/dashboards/WidgetComponent.js +1 -2
  46. package/lib/dashboards/layoutOptions.js +11 -7
  47. package/lib/datagrids/DatagridComponent.d.ts +1 -8
  48. package/lib/datagrids/DatagridComponent.js +14 -13
  49. package/lib/datagrids/DatagridDesignerComponent.js +18 -18
  50. package/lib/datagrids/DatagridQueryBuilder.d.ts +4 -4
  51. package/lib/datagrids/DatagridUtils.js +2 -2
  52. package/lib/datagrids/DatagridViewComponent.js +4 -4
  53. package/lib/datagrids/ExprCellComponent.js +1 -1
  54. package/lib/datagrids/FindReplaceModalComponent.js +17 -17
  55. package/lib/datagrids/OrderBysDesignerComponent.js +2 -2
  56. package/lib/languages.js +2 -2
  57. package/lib/layouts/DecoratedBlockComponent.js +2 -2
  58. package/lib/layouts/blocks/BlocksDisplayComponent.js +13 -13
  59. package/lib/layouts/blocks/BlocksLayoutManager.d.ts +2 -1
  60. package/lib/layouts/blocks/ClipboardPaletteItemComponent.js +3 -3
  61. package/lib/layouts/blocks/HorizontalBlockComponent.js +3 -3
  62. package/lib/layouts/blocks/blockUtils.js +4 -5
  63. package/lib/mWaterLoader.js +1 -1
  64. package/lib/maps/AddLayerComponent.js +13 -13
  65. package/lib/maps/AdminScopeAndDetailLevelComponent.js +5 -5
  66. package/lib/maps/BaseLayerDesignerComponent.js +2 -2
  67. package/lib/maps/BufferLayer.js +7 -7
  68. package/lib/maps/BufferLayerDesignerComponent.js +8 -8
  69. package/lib/maps/ChoroplethLayer.js +6 -6
  70. package/lib/maps/ChoroplethLayerDesigner.js +16 -16
  71. package/lib/maps/ClusterLayer.js +3 -3
  72. package/lib/maps/ClusterLayerDesignerComponent.js +5 -5
  73. package/lib/maps/DetailLevelSelectComponent.d.ts +11 -1
  74. package/lib/maps/DetailLevelSelectComponent.js +3 -3
  75. package/lib/maps/DirectMapDataSource.js +1 -2
  76. package/lib/maps/EditHoverOver.js +7 -5
  77. package/lib/maps/EditPopupComponent.js +2 -2
  78. package/lib/maps/GridLayer.js +5 -5
  79. package/lib/maps/GridLayerDesigner.js +15 -15
  80. package/lib/maps/LayerSwitcherComponent.js +1 -2
  81. package/lib/maps/LeafletMapComponent.d.ts +1 -1
  82. package/lib/maps/LeafletMapComponent.js +1 -1
  83. package/lib/maps/LegendComponent.js +1 -1
  84. package/lib/maps/MWaterServerLayer.d.ts +0 -1
  85. package/lib/maps/MWaterServerLayer.js +1 -1
  86. package/lib/maps/MapComponent.js +8 -8
  87. package/lib/maps/MapControlComponent.js +1 -1
  88. package/lib/maps/MapDesignerComponent.js +16 -16
  89. package/lib/maps/MapFiltersDesignerComponent.js +2 -2
  90. package/lib/maps/MapLayerViewDesignerComponent.js +8 -8
  91. package/lib/maps/MapUtils.js +6 -7
  92. package/lib/maps/MapViewComponent.js +1 -2
  93. package/lib/maps/MarkerSymbolSelectComponent.js +3 -3
  94. package/lib/maps/MarkersLayer.js +6 -7
  95. package/lib/maps/MarkersLayerDesignerComponent.js +22 -22
  96. package/lib/maps/PopupFilterJoinsEditComponent.js +4 -4
  97. package/lib/maps/PopupFilterJoinsUtils.js +2 -3
  98. package/lib/maps/RasterMapViewComponent.d.ts +3 -3
  99. package/lib/maps/RasterMapViewComponent.js +4 -4
  100. package/lib/maps/RegionSelectComponent.d.ts +1 -3
  101. package/lib/maps/RegionSelectComponent.js +1 -2
  102. package/lib/maps/ScopeAndDetailLevelComponent.js +3 -3
  103. package/lib/maps/TileUrlLayer.d.ts +1 -1
  104. package/lib/maps/TileUrlLayer.js +3 -3
  105. package/lib/maps/VectorMapViewComponent.js +6 -7
  106. package/lib/maps/ZoomLevelsComponent.js +5 -5
  107. package/lib/maps/mapSymbols.d.ts +1 -1
  108. package/lib/maps/mapSymbols.js +51 -50
  109. package/lib/maps/mapboxUtils.js +2 -3
  110. package/lib/maps/maps.d.ts +0 -1
  111. package/lib/maps/vectorMaps.js +14 -15
  112. package/lib/memoizedDebounce.js +1 -2
  113. package/lib/quickfilter/DateExprComponent.d.ts +4 -0
  114. package/lib/quickfilter/DateExprComponent.js +17 -16
  115. package/lib/quickfilter/IdArrayQuickfilterComponent.js +1 -1
  116. package/lib/quickfilter/QuickfilterUtils.js +1 -2
  117. package/lib/quickfilter/QuickfiltersComponent.d.ts +23 -2
  118. package/lib/quickfilter/QuickfiltersComponent.js +2 -2
  119. package/lib/quickfilter/QuickfiltersDesignComponent.js +8 -8
  120. package/lib/quickfilter/TextLiteralComponent.d.ts +35 -2
  121. package/lib/quickfilter/TextLiteralComponent.js +6 -6
  122. package/lib/richtext/DropdownPaletteItem.js +1 -1
  123. package/lib/richtext/ExprItemsHtmlConverter.js +8 -10
  124. package/lib/richtext/FontColorPaletteItem.js +7 -7
  125. package/lib/richtext/ItemsHtmlConverter.js +0 -1
  126. package/lib/richtext/RichTextComponent.d.ts +1 -0
  127. package/lib/richtext/RichTextComponent.js +33 -29
  128. package/lib/valueFormatter.js +18 -19
  129. package/lib/wellknown.js +2 -3
  130. package/lib/widgets/IFrameWidgetComponent.d.ts +9 -1
  131. package/lib/widgets/IFrameWidgetComponent.js +3 -3
  132. package/lib/widgets/ImageUploaderComponent.js +5 -5
  133. package/lib/widgets/ImageWidget.js +2 -2
  134. package/lib/widgets/ImageWidgetComponent.d.ts +9 -1
  135. package/lib/widgets/ImageWidgetComponent.js +20 -20
  136. package/lib/widgets/ImagelistCarouselComponent.js +1 -1
  137. package/lib/widgets/MapWidget.js +2 -2
  138. package/lib/widgets/MarkdownWidget.d.ts +1 -1
  139. package/lib/widgets/MarkdownWidget.js +1 -1
  140. package/lib/widgets/TOCWidget.js +11 -12
  141. package/lib/widgets/WidgetScopesViewComponent.js +1 -1
  142. package/lib/widgets/charts/Chart.js +1 -1
  143. package/lib/widgets/charts/ChartViewComponent.js +9 -9
  144. package/lib/widgets/charts/ChartWidgetComponent.js +4 -4
  145. package/lib/widgets/charts/calendar/CalendarChart.js +4 -4
  146. package/lib/widgets/charts/calendar/CalendarChartDesignerComponent.js +7 -7
  147. package/lib/widgets/charts/calendar/CalendarChartViewComponent.js +3 -3
  148. package/lib/widgets/charts/imagemosaic/ImageMosaicChart.d.ts +18 -5
  149. package/lib/widgets/charts/imagemosaic/ImageMosaicChart.js +3 -4
  150. package/lib/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.js +5 -5
  151. package/lib/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.d.ts +5 -19
  152. package/lib/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.js +66 -70
  153. package/lib/widgets/charts/imagemosaic/ImagePopupComponent.js +1 -1
  154. package/lib/widgets/charts/layered/LayeredChart.d.ts +1 -1
  155. package/lib/widgets/charts/layered/LayeredChart.js +9 -9
  156. package/lib/widgets/charts/layered/LayeredChartCompiler.d.ts +8 -8
  157. package/lib/widgets/charts/layered/LayeredChartCompiler.js +15 -15
  158. package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +33 -33
  159. package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +16 -16
  160. package/lib/widgets/charts/layered/LayeredChartUtils.js +1 -2
  161. package/lib/widgets/charts/layered/LayeredChartViewComponent.js +4 -4
  162. package/lib/widgets/charts/pivot/IntersectionDesignerComponent.js +18 -17
  163. package/lib/widgets/charts/pivot/PivotChart.d.ts +1 -1
  164. package/lib/widgets/charts/pivot/PivotChart.js +12 -4
  165. package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +5 -5
  166. package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +10 -10
  167. package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +5 -5
  168. package/lib/widgets/charts/pivot/PivotChartQueryBuilder.d.ts +1 -1
  169. package/lib/widgets/charts/pivot/PivotChartQueryBuilder.js +5 -6
  170. package/lib/widgets/charts/pivot/PivotChartUtils.js +11 -12
  171. package/lib/widgets/charts/pivot/PivotChartViewComponent.js +9 -9
  172. package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +30 -30
  173. package/lib/widgets/charts/pivot/SegmentDesignerComponent.js +28 -26
  174. package/lib/widgets/charts/table/OrderingsComponent.js +2 -2
  175. package/lib/widgets/charts/table/TableChart.js +3 -3
  176. package/lib/widgets/charts/table/TableChartDesignerComponent.js +17 -17
  177. package/lib/widgets/charts/table/TableChartViewComponent.js +3 -3
  178. package/lib/widgets/text/ExprInsertModalComponent.d.ts +2 -3
  179. package/lib/widgets/text/ExprInsertModalComponent.js +2 -14
  180. package/lib/widgets/text/ExprItemEditorComponent.js +4 -4
  181. package/lib/widgets/text/ExprUpdateModalComponent.d.ts +2 -3
  182. package/lib/widgets/text/ExprUpdateModalComponent.js +3 -15
  183. package/lib/widgets/text/TextComponent.js +3 -3
  184. package/lib/widgets/text/TextWidget.d.ts +1 -1
  185. package/lib/widgets/text/TextWidgetComponent.js +11 -11
  186. package/lib/widgets/text/TextWidgetDesign.d.ts +2 -1
  187. package/lib/widgets/text/TextWidgetDesign.js +1 -2
  188. package/package.json +3 -3
  189. package/src/ColorComponent.tsx +2 -2
  190. package/src/DateRangeComponent.ts +10 -10
  191. package/src/LocaleContextInjector.tsx +1 -1
  192. package/src/MWaterAddRelatedFormComponent.ts +7 -7
  193. package/src/MWaterAddRelatedIndicatorComponent.ts +5 -5
  194. package/src/MWaterAssetSystemsListComponent.tsx +3 -3
  195. package/src/MWaterCompleteTableSelectComponent.tsx +36 -35
  196. package/src/MWaterCustomTablesetListComponent.tsx +4 -4
  197. package/src/MWaterGlobalFiltersComponent.ts +4 -4
  198. package/src/MWaterLoaderComponent.ts +1 -1
  199. package/src/MWaterMetricsTableListComponent.tsx +3 -3
  200. package/src/MWaterResponsesFilterComponent.ts +6 -6
  201. package/src/MWaterTableSelectComponent.tsx +6 -7
  202. package/src/axes/AxisBuilder.ts +42 -44
  203. package/src/axes/AxisColorEditorComponent.tsx +178 -0
  204. package/src/axes/AxisComponent.ts +20 -20
  205. package/src/axes/BinsComponent.tsx +6 -6
  206. package/src/axes/CategoryMapComponent.ts +10 -10
  207. package/src/axes/ColorPaletteCollectionComponent.tsx +3 -3
  208. package/src/axes/RangesComponent.ts +14 -14
  209. package/src/dashboards/DashboardComponent.tsx +21 -9
  210. package/src/dashboards/DashboardViewComponent.tsx +3 -3
  211. package/src/dashboards/FontStyleEditor.tsx +8 -8
  212. package/src/dashboards/LayoutOptionsComponent.tsx +74 -74
  213. package/src/dashboards/SettingsModalComponent.tsx +134 -107
  214. package/src/dashboards/layoutOptions.tsx +5 -1
  215. package/src/datagrids/DatagridComponent.ts +65 -62
  216. package/src/datagrids/DatagridDesignerComponent.tsx +17 -17
  217. package/src/datagrids/DatagridUtils.ts +2 -2
  218. package/src/datagrids/DatagridViewComponent.ts +3 -3
  219. package/src/datagrids/ExprCellComponent.ts +1 -1
  220. package/src/datagrids/FindReplaceModalComponent.ts +13 -13
  221. package/src/datagrids/OrderBysDesignerComponent.tsx +2 -2
  222. package/src/globals.d.ts +7 -1
  223. package/src/languages.ts +2 -2
  224. package/src/layouts/blocks/BlocksDisplayComponent.tsx +13 -13
  225. package/src/layouts/blocks/BlocksLayoutManager.ts +3 -2
  226. package/src/layouts/blocks/ClipboardPaletteItemComponent.ts +3 -3
  227. package/src/maps/AddLayerComponent.ts +13 -13
  228. package/src/maps/AdminScopeAndDetailLevelComponent.ts +5 -5
  229. package/src/maps/BaseLayerDesignerComponent.ts +8 -8
  230. package/src/maps/BufferLayer.ts +5 -5
  231. package/src/maps/BufferLayerDesignerComponent.ts +8 -8
  232. package/src/maps/ChoroplethLayer.ts +3 -3
  233. package/src/maps/ChoroplethLayerDesigner.tsx +16 -16
  234. package/src/maps/ClusterLayer.ts +3 -3
  235. package/src/maps/ClusterLayerDesignerComponent.ts +5 -5
  236. package/src/maps/DetailLevelSelectComponent.ts +3 -3
  237. package/src/maps/EditHoverOver.tsx +5 -5
  238. package/src/maps/EditPopupComponent.ts +2 -2
  239. package/src/maps/GridLayer.ts +5 -5
  240. package/src/maps/GridLayerDesigner.tsx +15 -16
  241. package/src/maps/MWaterServerLayer.ts +1 -1
  242. package/src/maps/MapComponent.ts +6 -6
  243. package/src/maps/MapControlComponent.ts +1 -1
  244. package/src/maps/MapDesignerComponent.tsx +20 -20
  245. package/src/maps/MapFiltersDesignerComponent.tsx +3 -3
  246. package/src/maps/MapLayerViewDesignerComponent.ts +9 -9
  247. package/src/maps/MarkerSymbolSelectComponent.ts +4 -5
  248. package/src/maps/MarkersLayerDesignerComponent.ts +22 -22
  249. package/src/maps/PopupFilterJoinsEditComponent.ts +4 -4
  250. package/src/maps/RasterMapViewComponent.ts +2 -2
  251. package/src/maps/RegionSelectComponent.ts +1 -2
  252. package/src/maps/ScopeAndDetailLevelComponent.ts +3 -3
  253. package/src/maps/TileUrlLayer.tsx +3 -3
  254. package/src/maps/VectorMapViewComponent.tsx +5 -5
  255. package/src/maps/ZoomLevelsComponent.ts +6 -6
  256. package/src/maps/mapSymbols.ts +49 -49
  257. package/src/maps/vectorMaps.tsx +2 -2
  258. package/src/quickfilter/DateExprComponent.ts +19 -18
  259. package/src/quickfilter/IdArrayQuickfilterComponent.ts +1 -1
  260. package/src/quickfilter/QuickfiltersComponent.ts +1 -1
  261. package/src/quickfilter/QuickfiltersDesignComponent.tsx +9 -9
  262. package/src/quickfilter/TextLiteralComponent.ts +4 -4
  263. package/src/richtext/DropdownPaletteItem.tsx +1 -1
  264. package/src/richtext/ExprItemsHtmlConverter.ts +8 -10
  265. package/src/richtext/ItemsHtmlConverter.ts +0 -1
  266. package/src/richtext/RichTextComponent.tsx +31 -31
  267. package/src/valueFormatter.ts +14 -14
  268. package/src/widgets/IFrameWidgetComponent.ts +3 -3
  269. package/src/widgets/ImageUploaderComponent.tsx +5 -5
  270. package/src/widgets/ImageWidget.ts +2 -2
  271. package/src/widgets/ImageWidgetComponent.ts +26 -26
  272. package/src/widgets/ImagelistCarouselComponent.ts +2 -2
  273. package/src/widgets/MapWidget.ts +1 -1
  274. package/src/widgets/MarkdownWidget.ts +1 -1
  275. package/src/widgets/TOCWidget.ts +13 -14
  276. package/src/widgets/WidgetScopesViewComponent.ts +1 -1
  277. package/src/widgets/charts/Chart.ts +1 -1
  278. package/src/widgets/charts/ChartViewComponent.ts +4 -4
  279. package/src/widgets/charts/ChartWidgetComponent.tsx +3 -3
  280. package/src/widgets/charts/calendar/CalendarChart.ts +4 -4
  281. package/src/widgets/charts/calendar/CalendarChartDesignerComponent.ts +7 -7
  282. package/src/widgets/charts/calendar/CalendarChartViewComponent.tsx +2 -2
  283. package/src/widgets/charts/imagemosaic/ImageMosaicChart.ts +25 -8
  284. package/src/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.ts +5 -5
  285. package/src/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.tsx +128 -0
  286. package/src/widgets/charts/layered/LayeredChart.ts +9 -9
  287. package/src/widgets/charts/layered/LayeredChartCompiler.ts +45 -45
  288. package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +39 -39
  289. package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +18 -19
  290. package/src/widgets/charts/layered/LayeredChartViewComponent.ts +1 -1
  291. package/src/widgets/charts/pivot/IntersectionDesignerComponent.tsx +22 -23
  292. package/src/widgets/charts/pivot/PivotChart.ts +15 -5
  293. package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +12 -12
  294. package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +5 -5
  295. package/src/widgets/charts/pivot/PivotChartQueryBuilder.ts +7 -8
  296. package/src/widgets/charts/pivot/PivotChartViewComponent.tsx +6 -6
  297. package/src/widgets/charts/pivot/SegmentDesignerComponent.tsx +30 -30
  298. package/src/widgets/charts/table/OrderingsComponent.tsx +2 -2
  299. package/src/widgets/charts/table/TableChart.ts +3 -3
  300. package/src/widgets/charts/table/TableChartDesignerComponent.ts +16 -16
  301. package/src/widgets/charts/table/TableChartViewComponent.ts +2 -2
  302. package/src/widgets/text/{ExprInsertModalComponent.ts → ExprInsertModalComponent.tsx} +18 -20
  303. package/src/widgets/text/ExprItemEditorComponent.tsx +4 -4
  304. package/src/widgets/text/{ExprUpdateModalComponent.ts → ExprUpdateModalComponent.tsx} +18 -20
  305. package/src/widgets/text/TextComponent.tsx +2 -2
  306. package/src/widgets/text/TextWidgetComponent.tsx +10 -10
  307. package/src/widgets/text/TextWidgetDesign.ts +3 -1
  308. package/src/axes/AxisColorEditorComponent.ts +0 -210
  309. package/src/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.ts +0 -117
@@ -12,7 +12,7 @@ import { MWaterCustomTablesetListComponent } from "./MWaterCustomTablesetListCom
12
12
  import { MWaterMetricsTableListComponent } from "./MWaterMetricsTableListComponent"
13
13
  import { Form } from "@mwater/forms"
14
14
  import { MWaterAssetSystemsListComponent } from "./MWaterAssetSystemsListComponent"
15
- import { LocaleContext } from "@mwater/expressions-ui/lib/contexts"
15
+ import { LocaleContext } from "@mwater/expressions-ui"
16
16
 
17
17
  const sitesOrder: { [table: string]: number } = {
18
18
  "entities.water_point": 1,
@@ -218,7 +218,7 @@ export default class MWaterCompleteTableSelectComponent extends React.Component<
218
218
  <uiComponents.OptionListComponent items={items} />
219
219
  <div className="text-center mt-2 mb-2">
220
220
  <button className="btn btn-link" onClick={() => this.setState({ showLegacyAssets: !this.state.showLegacyAssets })}>
221
- {this.state.showLegacyAssets ? "Hide" : "Show"} Legacy Assets
221
+ {this.state.showLegacyAssets ? T`Hide` : T`Show`} {T`Legacy Assets`}
222
222
  </button>
223
223
  </div>
224
224
  {this.state.showLegacyAssets && this.renderLegacyAssets()}
@@ -320,28 +320,28 @@ export default class MWaterCompleteTableSelectComponent extends React.Component<
320
320
  const sweetSenseTables = this.getSweetSenseTables()
321
321
 
322
322
  const tabs: TabbedComponentTab[] = [
323
- { id: "sites", label: [R("i", { className: "fa fa-map-marker" }), " Sites"], elem: this.renderSites() },
324
- { id: "forms", label: [R("i", { className: "fa fa-th-list" }), " Surveys"], elem: this.renderForms() },
323
+ { id: "sites", label: [R("i", { className: "fa fa-map-marker" }), T` Sites`], elem: this.renderSites() },
324
+ { id: "forms", label: [R("i", { className: "fa fa-th-list" }), T` Surveys`], elem: this.renderForms() },
325
325
  {
326
326
  id: "indicators",
327
- label: [R("i", { className: "fa fa-check-circle" }), " Indicators"],
327
+ label: [R("i", { className: "fa fa-check-circle" }), T` Indicators`],
328
328
  elem: this.renderIndicators()
329
329
  },
330
330
  {
331
331
  id: "issues",
332
- label: [R("i", { className: "fa fa-exclamation-circle" }), " Issues"],
332
+ label: [R("i", { className: "fa fa-exclamation-circle" }), T` Issues`],
333
333
  elem: this.renderIssues()
334
334
  },
335
- { id: "tablesets", label: [R("i", { className: "fa fa-table" }), " Tables"], elem: this.renderTablesets() },
336
- { id: "metrics", label: [R("i", { className: "fa fa-line-chart" }), " Metrics"], elem: this.renderMetrics() },
337
- { id: "assets", label: [R("i", { className: "fas fa-map-pin" }), " Assets"], elem: this.renderAssets() }
335
+ { id: "tablesets", label: [R("i", { className: "fa fa-table" }), T` Tables`], elem: this.renderTablesets() },
336
+ { id: "metrics", label: [R("i", { className: "fa fa-line-chart" }), T` Metrics`], elem: this.renderMetrics() },
337
+ { id: "assets", label: [R("i", { className: "fas fa-map-pin" }), T` Assets`], elem: this.renderAssets() }
338
338
  ]
339
339
 
340
340
  if (sweetSenseTables.length > 0) {
341
- tabs.push({ id: "sensors", label: " Sensors", elem: this.renderSweetSense() })
341
+ tabs.push({ id: "sensors", label: T` Sensors`, elem: this.renderSweetSense() })
342
342
  }
343
343
 
344
- tabs.push({ id: "other", label: "Advanced", elem: this.renderOther() })
344
+ tabs.push({ id: "other", label: T`Advanced`, elem: this.renderOther() })
345
345
 
346
346
  return R(
347
347
  "div",
@@ -349,7 +349,7 @@ export default class MWaterCompleteTableSelectComponent extends React.Component<
349
349
  R(
350
350
  "div",
351
351
  { className: "text-muted" },
352
- "Select data from sites, surveys or an advanced category below. Indicators can be found within their associated site types."
352
+ T`Select data from sites, surveys or an advanced category below. Indicators can be found within their associated site types.`
353
353
  ),
354
354
 
355
355
  R(TabbedComponent, {
@@ -428,7 +428,7 @@ class FormsListComponent extends React.Component<FormsListComponentProps, FormsL
428
428
  if (desc) {
429
429
  desc += " - "
430
430
  }
431
- desc += `Modified ${moment(form.modified?.on, moment.ISO_8601).format("ll")}`
431
+ desc += T`Modified ${moment(form.modified?.on, moment.ISO_8601).format("ll")}`
432
432
 
433
433
  return {
434
434
  id: form._id,
@@ -445,7 +445,7 @@ class FormsListComponent extends React.Component<FormsListComponentProps, FormsL
445
445
  handleTableRemove = (table: any) => {
446
446
  if (
447
447
  confirm(
448
- `Remove ${ExprUtils.localizeString(
448
+ T`Remove ${ExprUtils.localizeString(
449
449
  table.name,
450
450
  this.context
451
451
  )}? Any widgets that depend on it will no longer work properly.`
@@ -491,7 +491,7 @@ class FormsListComponent extends React.Component<FormsListComponentProps, FormsL
491
491
  return R(
492
492
  "div",
493
493
  null,
494
- R("label", null, "Included Surveys:"),
494
+ R("label", null, T`Included Surveys:`),
495
495
  tables.length > 0
496
496
  ? R(uiComponents.OptionListComponent, {
497
497
  items: _.map(tables, (table) => {
@@ -503,23 +503,23 @@ class FormsListComponent extends React.Component<FormsListComponentProps, FormsL
503
503
  }
504
504
  })
505
505
  })
506
- : R("div", null, "None"),
506
+ : R("div", null, T`None`),
507
507
 
508
508
  R("br"),
509
509
 
510
- R("label", null, "All Surveys:"),
510
+ R("label", null, T`All Surveys:`),
511
511
  !this.state.forms || this.state.forms.length === 0
512
512
  ? R(
513
513
  "div",
514
514
  { className: "alert alert-info" },
515
515
  R("i", { className: "fa fa-spinner fa-spin" }),
516
- "\u00A0Loading..."
516
+ "\u00A0" + T`Loading...`
517
517
  )
518
518
  : [
519
519
  R("input", {
520
520
  type: "text",
521
521
  className: "form-control form-control-sm",
522
- placeholder: "Search...",
522
+ placeholder: T`Search...`,
523
523
  key: "search",
524
524
  ref: this.searchRef,
525
525
  style: { maxWidth: "20em", marginBottom: 10 },
@@ -610,7 +610,7 @@ class IndicatorsListComponent extends React.Component<IndicatorsListComponentPro
610
610
  handleTableRemove = (table: any) => {
611
611
  if (
612
612
  confirm(
613
- `Remove ${ExprUtils.localizeString(
613
+ T`Remove ${ExprUtils.localizeString(
614
614
  table.name,
615
615
  this.context
616
616
  )}? Any widgets that depend on it will no longer work properly.`
@@ -674,7 +674,7 @@ class IndicatorsListComponent extends React.Component<IndicatorsListComponentPro
674
674
  }
675
675
  }),
676
676
 
677
- R("label", null, "Included Indicators:"),
677
+ R("label", null, T`Included Indicators:`),
678
678
  tables.length > 0
679
679
  ? R(uiComponents.OptionListComponent, {
680
680
  items: _.map(tables, (table) => {
@@ -686,23 +686,23 @@ class IndicatorsListComponent extends React.Component<IndicatorsListComponentPro
686
686
  }
687
687
  })
688
688
  })
689
- : R("div", null, "None"),
689
+ : R("div", null, T`None`),
690
690
 
691
691
  R("br"),
692
692
 
693
- R("label", null, "All Indicators:"),
693
+ R("label", null, T`All Indicators:`),
694
694
  !this.state.indicators || this.state.indicators.length === 0
695
695
  ? R(
696
696
  "div",
697
697
  { className: "alert alert-info" },
698
698
  R("i", { className: "fa fa-spinner fa-spin" }),
699
- "\u00A0Loading..."
699
+ "\u00A0" + T`Loading...`
700
700
  )
701
701
  : [
702
702
  R("input", {
703
703
  type: "text",
704
704
  className: "form-control form-control-sm",
705
- placeholder: "Search...",
705
+ placeholder: T`Search...`,
706
706
  key: "search",
707
707
  ref: this.searchRef,
708
708
  style: { maxWidth: "20em", marginBottom: 10 },
@@ -759,7 +759,7 @@ class AddIndicatorConfirmPopupComponent extends React.Component<
759
759
  "div",
760
760
  { className: "alert alert-info" },
761
761
  R("i", { className: "fa fa-spinner fa-spin" }),
762
- "\u00A0Loading..."
762
+ "\u00A0" + T`Loading...`
763
763
  )
764
764
  }
765
765
 
@@ -774,7 +774,7 @@ class AddIndicatorConfirmPopupComponent extends React.Component<
774
774
  R(
775
775
  "p",
776
776
  null,
777
- `In general, it is better to get indicator values from the related site. Please select the site
777
+ T`In general, it is better to get indicator values from the related site. Please select the site
778
778
  below, then find the indicator values in the 'Related Indicators' section. Or click on 'Use Raw Indicator' if you
779
779
  are certain that you want to use the raw indicator table`
780
780
  ),
@@ -799,7 +799,7 @@ are certain that you want to use the raw indicator table`
799
799
  R(
800
800
  "a",
801
801
  { className: "link-plain", onClick: this.props.onChange.bind(null, this.state.indicatorTable) },
802
- "Use Raw Indicator"
802
+ T`Use Raw Indicator`
803
803
  )
804
804
  )
805
805
  )
@@ -815,7 +815,7 @@ are certain that you want to use the raw indicator table`
815
815
  {
816
816
  showCloseX: true,
817
817
  onClose: () => this.setState({ visible: false }),
818
- header: "Add Indicator"
818
+ header: T`Add Indicator`
819
819
  },
820
820
  this.renderContents()
821
821
  )
@@ -889,7 +889,7 @@ class IssuesListComponent extends React.Component<IssuesListComponentProps, Issu
889
889
  handleTableRemove = (table: any) => {
890
890
  if (
891
891
  confirm(
892
- `Remove ${ExprUtils.localizeString(
892
+ T`Remove ${ExprUtils.localizeString(
893
893
  table.name,
894
894
  this.context
895
895
  )}? Any widgets that depend on it will no longer work properly.`
@@ -935,7 +935,7 @@ class IssuesListComponent extends React.Component<IssuesListComponentProps, Issu
935
935
  return R(
936
936
  "div",
937
937
  null,
938
- R("label", null, "Included Issues:"),
938
+ R("label", null, T`Included Issues:`),
939
939
  tables.length > 0
940
940
  ? R(uiComponents.OptionListComponent, {
941
941
  items: _.map(tables, (table) => {
@@ -947,23 +947,24 @@ class IssuesListComponent extends React.Component<IssuesListComponentProps, Issu
947
947
  }
948
948
  })
949
949
  })
950
- : R("div", null, "None"),
950
+ : R("div", null, T`None`),
951
951
 
952
952
  R("br"),
953
953
 
954
- R("label", null, "All Issues:"),
954
+ R("label", null, T`All Issues:`),
955
955
  !this.state.issueTypes || this.state.issueTypes.length === 0
956
956
  ? R(
957
957
  "div",
958
958
  { className: "alert alert-info" },
959
959
  R("i", { className: "fa fa-spinner fa-spin" }),
960
- "\u00A0Loading..."
960
+ "\u00A0",
961
+ T`Loading...`
961
962
  )
962
963
  : [
963
964
  R("input", {
964
965
  type: "text",
965
966
  className: "form-control form-control-sm",
966
- placeholder: "Search...",
967
+ placeholder: T`Search...`,
967
968
  key: "search",
968
969
  ref: this.searchRef,
969
970
  style: { maxWidth: "20em", marginBottom: 10 },
@@ -71,7 +71,7 @@ export const MWaterCustomTablesetListComponent = (props: {
71
71
  // Remove from extra tables
72
72
  const match = props.extraTables.find((t) => (t || "").startsWith(`custom.${ts.code}.`))
73
73
  if (match) {
74
- if (confirm("Remove this set of tables? Some widgets may not work correctly.")) {
74
+ if (confirm(T`Remove this set of tables? Some widgets may not work correctly.`)) {
75
75
  props.onChange(null)
76
76
  props.onExtraTableRemove(match)
77
77
  }
@@ -81,7 +81,7 @@ export const MWaterCustomTablesetListComponent = (props: {
81
81
  if (!tablesets || extraTableNeeded) {
82
82
  return (
83
83
  <div>
84
- <i className="fa fa-spin fa-spinner" /> Loading...
84
+ <i className="fa fa-spin fa-spinner" /> {T`Loading...`}
85
85
  </div>
86
86
  )
87
87
  }
@@ -126,11 +126,11 @@ export const MWaterCustomTablesetListComponent = (props: {
126
126
 
127
127
  return (
128
128
  <div>
129
- <TextInput value={search} onChange={setSearch} placeholder="Search..." />
129
+ <TextInput value={search} onChange={setSearch} placeholder={T`Search...`} />
130
130
  {visibleTablesets.map((ts) => renderTableset(ts))}
131
131
  <div>
132
132
  <button className="btn btn-link btn-sm" onClick={() => setShowSystem(!showSystem)}>
133
- {showSystem ? "Hide system tables" : "Show system tables"}
133
+ {showSystem ? T`Hide system tables` : T`Show system tables`}
134
134
  </button>
135
135
  </div>
136
136
  </div>
@@ -85,14 +85,14 @@ export default class MWaterGlobalFiltersComponent extends React.Component<MWater
85
85
  null,
86
86
  R(
87
87
  ui.FormGroup,
88
- { label: "Only sites managed by", labelMuted: true },
88
+ { label: T`Only sites managed by`, labelMuted: true },
89
89
  R(IdLiteralComponent, {
90
90
  value: managedBy,
91
91
  onChange: this.handleManagedByChange,
92
92
  idTable: "groups",
93
93
  schema: this.props.schema,
94
94
  dataSource: this.props.dataSource,
95
- placeholder: "All Organizations",
95
+ placeholder: T`All Organizations`,
96
96
  multi: false,
97
97
  filter: { type: "field", tableAlias: "main", column: "canManageEntities" }
98
98
  })
@@ -100,14 +100,14 @@ export default class MWaterGlobalFiltersComponent extends React.Component<MWater
100
100
 
101
101
  R(
102
102
  ui.FormGroup,
103
- { label: "Only sites located in", labelMuted: true },
103
+ { label: T`Only sites located in`, labelMuted: true },
104
104
  R(IdLiteralComponent, {
105
105
  value: adminRegions,
106
106
  onChange: this.handleRegionsChange,
107
107
  idTable: "admin_regions",
108
108
  schema: this.props.schema,
109
109
  dataSource: this.props.dataSource,
110
- placeholder: "All Regions",
110
+ placeholder: T`All Regions`,
111
111
  multi: true,
112
112
  orderBy: [{ expr: { type: "field", tableAlias: "main", column: "level" }, direction: "asc" }]
113
113
  })
@@ -80,7 +80,7 @@ export default class MWaterLoaderComponent extends AsyncLoadComponent<
80
80
  },
81
81
  (error: any, config: any) => {
82
82
  if (error) {
83
- const defaultError = `Cannot load one of the forms that this depends on. Perhaps the administrator has not shared the form with you? Details: ${error.message}`
83
+ const defaultError = T`Cannot load one of the forms that this depends on. Perhaps the administrator has not shared the form with you? Details: ${error.message}`
84
84
  if (this.props.errorFormatter) {
85
85
  try {
86
86
  const parsedError = JSON.parse(error.message)
@@ -66,7 +66,7 @@ export const MWaterMetricsTableListComponent = (props: {
66
66
  // Remove from extra tables
67
67
  const match = props.extraTables.find((t) => t == `metrics:${metric._id}`)
68
68
  if (match) {
69
- if (confirm("Remove this table? Some widgets may not work correctly.")) {
69
+ if (confirm(T`Remove this table? Some widgets may not work correctly.`)) {
70
70
  props.onChange(null)
71
71
  props.onExtraTableRemove(match)
72
72
  }
@@ -76,7 +76,7 @@ export const MWaterMetricsTableListComponent = (props: {
76
76
  if (!metrics || extraTableNeeded) {
77
77
  return (
78
78
  <div>
79
- <i className="fa fa-spin fa-spinner" /> Loading...
79
+ <i className="fa fa-spin fa-spinner" /> {T`Loading...`}
80
80
  </div>
81
81
  )
82
82
  }
@@ -99,7 +99,7 @@ export const MWaterMetricsTableListComponent = (props: {
99
99
 
100
100
  return (
101
101
  <div>
102
- <TextInput value={search} onChange={setSearch} placeholder="Search..." />
102
+ <TextInput value={search} onChange={setSearch} placeholder={T`Search...`} />
103
103
  {renderMetrics()}
104
104
  </div>
105
105
  )
@@ -151,7 +151,7 @@ export default class MWaterResponsesFilterComponent extends React.Component<MWat
151
151
  return R(
152
152
  "div",
153
153
  { style: { paddingLeft: 5, paddingTop: 5 } },
154
- R("div", { style: { paddingBottom: 5 } }, "Data Source Options:"),
154
+ R("div", { style: { paddingBottom: 5 } }, T`Data Source Options:`),
155
155
 
156
156
  R(
157
157
  "div",
@@ -160,22 +160,22 @@ export default class MWaterResponsesFilterComponent extends React.Component<MWat
160
160
  ? R(
161
161
  "div",
162
162
  null,
163
- R("i", null, "This data source contains links to monitoring sites. Would you like to:"),
163
+ R("i", null, T`This data source contains links to monitoring sites. Would you like to:`),
164
164
  R(
165
165
  "div",
166
166
  { style: { paddingLeft: 8 } },
167
167
  R(
168
168
  ui.Radio,
169
169
  { key: "all", value: siteColumnId, radioValue: null, onChange: this.handleSiteChange },
170
- "Show all survey responses (even if there are more than one per site)"
170
+ T`Show all survey responses (even if there are more than one per site)`
171
171
  ),
172
172
  _.map(siteColumns, (column) => {
173
173
  return R(
174
174
  ui.Radio,
175
175
  { key: column.id, value: siteColumnId, radioValue: column.id, onChange: this.handleSiteChange },
176
- "Show only the latest response for each ",
176
+ T`Show only the latest response for each `,
177
177
  R("i", null, `${ExprUtils.localizeString(this.props.schema.getTable(column.join.toTable)?.name)}`),
178
- " in the question ",
178
+ T` in the question `,
179
179
  R("i", null, `'${ExprUtils.localizeString(column.name)}'`)
180
180
  )
181
181
  })
@@ -186,7 +186,7 @@ export default class MWaterResponsesFilterComponent extends React.Component<MWat
186
186
  R(
187
187
  ui.Checkbox,
188
188
  { value: this.isFinal(), onChange: this.handleFinalChange },
189
- "Only include final responses (recommended)"
189
+ T`Only include final responses (recommended)`
190
190
  )
191
191
  )
192
192
  )
@@ -1,5 +1,4 @@
1
1
  import _ from "lodash"
2
- import PropTypes from "prop-types"
3
2
  import React from "react"
4
3
  const R = React.createElement
5
4
  import { ToggleEditComponent, OptionListComponent } from "./UIComponents"
@@ -40,7 +39,7 @@ export default class MWaterTableSelectComponent extends React.Component<
40
39
 
41
40
  toggleEdit: any
42
41
 
43
- constructor(props: any) {
42
+ constructor(props: MWaterTableSelectComponentProps) {
44
43
  super(props)
45
44
 
46
45
  this.state = {
@@ -127,7 +126,7 @@ export default class MWaterTableSelectComponent extends React.Component<
127
126
  "div",
128
127
  { className: "alert alert-info", key: "pendingExtraTable" },
129
128
  R("i", { className: "fa fa-spinner fa-spin" }),
130
- "\u00a0Please wait..."
129
+ `\u00a0${T`Please wait...`}`
131
130
  )
132
131
  : undefined,
133
132
 
@@ -254,7 +253,7 @@ class EditModeTableSelectComponent extends React.Component<
254
253
  <div>
255
254
  {this.state.completeMode ? (
256
255
  <ModalPopupComponent
257
- header="Select Data Source"
256
+ header={T`Select Data Source`}
258
257
  onClose={() => this.setState({ completeMode: false })}
259
258
  showCloseX={true}
260
259
  size="x-large"
@@ -274,7 +273,7 @@ class EditModeTableSelectComponent extends React.Component<
274
273
 
275
274
  {this.getTableShortlist(activeTables).length > 0 ? (
276
275
  <>
277
- <div className="text-muted">Select Data Source:</div>
276
+ <div className="text-muted">{T`Select Data Source:`}</div>
278
277
  <OptionListComponent items={this.getTableShortlist(activeTables).map((tableId) => {
279
278
  const table = this.props.schema.getTable(tableId)!
280
279
  return {
@@ -289,7 +288,7 @@ class EditModeTableSelectComponent extends React.Component<
289
288
  className="btn btn-link btn-sm"
290
289
  onClick={this.handleShowMore}
291
290
  >
292
- Show All Available Data Sources...
291
+ {T`Show All Available Data Sources...`}
293
292
  </button>
294
293
  </div>
295
294
  </>
@@ -299,7 +298,7 @@ class EditModeTableSelectComponent extends React.Component<
299
298
  className="btn btn-link"
300
299
  onClick={this.handleShowMore}
301
300
  >
302
- Select Data Source...
301
+ {T`Select Data Source...`}
303
302
  </button>
304
303
  )}
305
304
  </div>