@mwater/visualization 5.3.2 → 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 +0 -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 +3 -3
  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 +101 -74
  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
@@ -83,7 +83,7 @@ export default class ExprItemEditorComponent extends React.Component<
83
83
  return R(
84
84
  "div",
85
85
  { className: "mb-3" },
86
- R("label", { className: "text-muted" }, "Format"),
86
+ R("label", { className: "text-muted" }, T`Format`),
87
87
  ": ",
88
88
  R(
89
89
  "select",
@@ -105,7 +105,7 @@ export default class ExprItemEditorComponent extends React.Component<
105
105
  R(
106
106
  "div",
107
107
  { className: "mb-3" },
108
- R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", "Data Source"),
108
+ R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", T`Data Source`),
109
109
  ": ",
110
110
  R(TableSelectComponent, {
111
111
  schema: this.props.schema,
@@ -119,7 +119,7 @@ export default class ExprItemEditorComponent extends React.Component<
119
119
  ? R(
120
120
  "div",
121
121
  { className: "mb-3" },
122
- R("label", { className: "text-muted" }, "Field"),
122
+ R("label", { className: "text-muted" }, T`Field`),
123
123
  ": ",
124
124
  R(ExprComponent, {
125
125
  schema: this.props.schema,
@@ -142,7 +142,7 @@ export default class ExprItemEditorComponent extends React.Component<
142
142
  value={this.props.exprItem.includeLabel}
143
143
  onChange={this.handleIncludeLabelChange}
144
144
  >
145
- Include Label
145
+ {T`Include Label`}
146
146
  </Checkbox>,
147
147
 
148
148
  this.props.exprItem.includeLabel
@@ -1,6 +1,4 @@
1
1
  import React from "react"
2
- const R = React.createElement
3
-
4
2
  import { DataSource, Schema } from "@mwater/expressions"
5
3
  import ActionCancelModalComponent from "@mwater/react-library/lib/ActionCancelModalComponent"
6
4
  import ExprItemEditorComponent from "./ExprItemEditorComponent"
@@ -35,7 +33,7 @@ export default class ExprUpdateModalComponent extends React.Component<
35
33
  }
36
34
  }
37
35
 
38
- open(item: any, onUpdate: any) {
36
+ open(item: HtmlItemExpr, onUpdate: (item: HtmlItemExpr) => void) {
39
37
  return this.setState({ open: true, exprItem: item, onUpdate })
40
38
  }
41
39
 
@@ -44,27 +42,27 @@ export default class ExprUpdateModalComponent extends React.Component<
44
42
  return null
45
43
  }
46
44
 
47
- return R(
48
- ActionCancelModalComponent,
49
- {
50
- actionLabel: "Update",
51
- onAction: () => {
45
+ return (
46
+ <ActionCancelModalComponent
47
+ actionLabel={T`Update`}
48
+ onAction={() => {
52
49
  // Close first to avoid strange effects when mixed with pojoviews
53
50
  this.setState({ open: false }, () => {
54
51
  return this.state.onUpdate!(this.state.exprItem!)
55
52
  })
56
- },
57
- onCancel: () => this.setState({ open: false }),
58
- title: "Update Field",
59
- size: "x-large"
60
- },
61
- R(ExprItemEditorComponent, {
62
- schema: this.props.schema,
63
- dataSource: this.props.dataSource,
64
- exprItem: this.state.exprItem,
65
- onChange: (exprItem: any) => this.setState({ exprItem }),
66
- singleRowTable: this.props.singleRowTable
67
- })
53
+ }}
54
+ onCancel={() => this.setState({ open: false })}
55
+ title={T`Update Field`}
56
+ size="x-large"
57
+ >
58
+ <ExprItemEditorComponent
59
+ schema={this.props.schema}
60
+ dataSource={this.props.dataSource}
61
+ exprItem={this.state.exprItem!}
62
+ onChange={(exprItem: HtmlItemExpr) => this.setState({ exprItem })}
63
+ singleRowTable={this.props.singleRowTable}
64
+ />
65
+ </ActionCancelModalComponent>
68
66
  )
69
67
  }
70
68
  }
@@ -6,7 +6,7 @@ import ExprUpdateModalComponent from "./ExprUpdateModalComponent"
6
6
  import ExprItemsHtmlConverter from "../../richtext/ExprItemsHtmlConverter"
7
7
  import { TextWidgetDesign } from "./TextWidgetDesign"
8
8
  import { DataSource, Schema } from "@mwater/expressions"
9
- import { LocaleContext } from "@mwater/expressions-ui/lib/contexts"
9
+ import { LocaleContext } from "@mwater/expressions-ui"
10
10
 
11
11
  export interface TextComponentProps {
12
12
  design: TextWidgetDesign
@@ -89,7 +89,7 @@ export default class TextComponent extends React.Component<TextComponentProps> {
89
89
  return (
90
90
  <div key="expr" className="mwater-visualization-text-palette-item" onMouseDown={this.handleAddExpr}>
91
91
  <i className="fa fa-plus" />
92
- {" Expression"}
92
+ {T` Expression`}
93
93
  </div>
94
94
  )
95
95
  }
@@ -139,34 +139,34 @@ export default class TextWidgetComponent extends AsyncLoadComponent<TextWidgetCo
139
139
  }
140
140
 
141
141
  const spacingOptions = [0, 5, 10, 15, 20, 25, 30, 35, 40].map(value => ({ value, label: `${value}px` }))
142
- const borderThicknessOptions = [0, 1, 2, 3, 4, 5].map(value => ({ value, label: value === 0 ? "None" : `${value}px` }))
142
+ const borderThicknessOptions = [0, 1, 2, 3, 4, 5].map(value => ({ value, label: value === 0 ? T`None` : `${value}px` }))
143
143
 
144
144
  return (
145
145
  <ActionCancelModalComponent
146
- title="Edit Text Widget"
146
+ title={T`Edit Text Widget`}
147
147
  onCancel={this.handleEditModalClose}
148
148
  onAction={this.handleEditModalClose}
149
149
  >
150
- <FormGroup label="Background Color">
150
+ <FormGroup label={T`Background Color`}>
151
151
  <ColorComponent
152
152
  color={this.props.design.backgroundColor || null}
153
153
  onChange={this.handleBackgroundColorChange}
154
154
  />
155
155
  <div className="text-muted">
156
- Choose a background color for the text widget
156
+ {T`Choose a background color for the text widget`}
157
157
  </div>
158
158
  </FormGroup>
159
- <FormGroup label="Padding">
159
+ <FormGroup label={T`Padding`}>
160
160
  <Select
161
161
  value={this.props.design.padding ?? 0}
162
162
  onChange={this.handleSpacingChange}
163
163
  options={spacingOptions}
164
164
  />
165
165
  <div className="text-muted">
166
- Choose extra padding for the text widget
166
+ {T`Choose extra padding for the text widget`}
167
167
  </div>
168
168
  </FormGroup>
169
- <FormGroup label="Border Thickness" help="Choose the border thickness for the text widget">
169
+ <FormGroup label={T`Border Thickness`} help={T`Choose the border thickness for the text widget`}>
170
170
  <Select
171
171
  value={this.props.design.borderThickness ?? 0}
172
172
  onChange={this.handleBorderThicknessChange}
@@ -174,7 +174,7 @@ export default class TextWidgetComponent extends AsyncLoadComponent<TextWidgetCo
174
174
  />
175
175
  </FormGroup>
176
176
  {this.props.design.borderThickness &&
177
- <FormGroup label="Border Color" help="Choose the border color for the text widget">
177
+ <FormGroup label={T`Border Color`} help={T`Choose the border color for the text widget`}>
178
178
  <ColorComponent
179
179
  color={this.props.design.borderColor || null}
180
180
  onChange={this.handleBorderColorChange}
@@ -182,7 +182,7 @@ export default class TextWidgetComponent extends AsyncLoadComponent<TextWidgetCo
182
182
  </FormGroup>
183
183
  }
184
184
  {this.props.design.borderThickness &&
185
- <FormGroup label="Border Radius" help="Choose the border radius for the text widget">
185
+ <FormGroup label={T`Border Radius`} help={T`Choose the border radius for the text widget`}>
186
186
  <Select
187
187
  value={this.props.design.borderRadius ?? 0}
188
188
  onChange={this.handleBorderRadiusChange}
@@ -233,7 +233,7 @@ export default class TextWidgetComponent extends AsyncLoadComponent<TextWidgetCo
233
233
  {this.props.onDesignChange ? (
234
234
  <DropdownWidgetComponent
235
235
  dropdownItems={[{
236
- label: "Edit",
236
+ label: T`Edit`,
237
237
  onClick: this.handleEditClick
238
238
  }]}
239
239
  >
@@ -1,9 +1,11 @@
1
1
  import { HtmlItemExpr } from "../../richtext/ExprItemsHtmlConverter"
2
2
  import { HtmlItem } from "../../richtext/ItemsHtmlConverter"
3
3
 
4
+ export type TextWidgetItem = HtmlItem | HtmlItemExpr
5
+
4
6
  export interface TextWidgetDesign {
5
7
  /** Text widget stores its content as array of items. See ItemsHtmlConverter TODO */
6
- items: (HtmlItem | HtmlItemExpr)[]
8
+ items: TextWidgetItem[]
7
9
 
8
10
  /** "title" for title block. default is "default" */
9
11
  style?: "title" | "default" | "header" | "footer"
@@ -1,210 +0,0 @@
1
- import _ from "lodash"
2
- import React from "react"
3
- const R = React.createElement
4
- import CategoryMapComponent from "./CategoryMapComponent"
5
- import ColorSchemeFactory from "../ColorSchemeFactory"
6
- import ColorPaletteCollectionComponent from "./ColorPaletteCollectionComponent"
7
- import AxisBuilder from "./AxisBuilder"
8
- import produce from "immer"
9
- import { Axis, AxisCategory, ColorMap } from "./Axis"
10
- import { Schema } from "@mwater/expressions"
11
-
12
- export interface AxisColorEditorComponentProps {
13
- schema: Schema
14
- axis: Axis
15
- /** Called with new axis */
16
- onChange: (axis: Axis) => void
17
-
18
- /** Categories of the axis */
19
- categories?: AxisCategory[]
20
-
21
- /** is the color map reorderable */
22
- reorderable?: boolean
23
-
24
- defaultColor?: string
25
- /** True to allow excluding of values via checkboxes */
26
- allowExcludedValues?: boolean
27
- /** True to start values expanded */
28
- initiallyExpanded?: boolean
29
- /** True to automatically set the colors if blank */
30
- autosetColors?: boolean
31
- }
32
-
33
- interface AxisColorEditorComponentState {
34
- mode: any
35
- }
36
-
37
- // Color editor for axis. Allows switching between editing individial colors (using CategoryMapComponent)
38
- // and setting the colors from a palette (using ColorPaletteCollectionComponent)
39
- export default class AxisColorEditorComponent extends React.Component<
40
- AxisColorEditorComponentProps,
41
- AxisColorEditorComponentState
42
- > {
43
- static defaultProps = {
44
- reorderable: false,
45
- autosetColors: true
46
- }
47
-
48
- constructor(props: any) {
49
- super(props)
50
-
51
- this.state = {
52
- mode: "normal"
53
- }
54
- }
55
-
56
- componentWillMount() {
57
- return this.updateColorMap()
58
- }
59
-
60
- componentDidUpdate() {
61
- return this.updateColorMap()
62
- }
63
-
64
- // Update color map if categories no longer match
65
- updateColorMap() {
66
- const axisBuilder = new AxisBuilder({ schema: this.props.schema })
67
-
68
- // If no categories, can't do anything
69
- if (!this.props.categories) {
70
- return
71
- }
72
-
73
- // If no color map or color map values have changed
74
- if (
75
- !this.props.axis.colorMap ||
76
- !_.isEqual(_.pluck(this.props.axis.colorMap, "value").sort(), _.pluck(this.props.categories, "value").sort())
77
- ) {
78
- let colorMap
79
- if (this.props.autosetColors) {
80
- colorMap = ColorSchemeFactory.createColorMapForCategories(
81
- this.props.categories,
82
- axisBuilder.isCategorical(this.props.axis)
83
- )
84
- } else {
85
- // Keep existing
86
- const existing = _.indexBy(this.props.axis.colorMap || [], "value")
87
- colorMap = _.map(this.props.categories, (category, i) => ({
88
- value: category.value,
89
- color: existing[category.value] ? existing[category.value].color : null
90
- }))
91
- }
92
-
93
- this.handlePaletteChange(colorMap)
94
- return this.setState({ mode: "normal" })
95
- }
96
- }
97
-
98
- handleSelectPalette = () => {
99
- return this.setState({ mode: "palette" })
100
- }
101
-
102
- handleResetPalette = () => {
103
- // Completely reset
104
- const colorMap = _.map(this.props.categories || [], (category, i) => ({
105
- value: category.value,
106
- color: null
107
- }))
108
-
109
- this.handlePaletteChange(colorMap)
110
- return this.setState({ mode: "normal" })
111
- }
112
-
113
- handlePaletteChange = (palette: ColorMap) => {
114
- this.props.onChange(
115
- produce(this.props.axis, (draft) => {
116
- draft.colorMap = palette
117
- draft.drawOrder = _.pluck(palette, "value")
118
- })
119
- )
120
- this.setState({ mode: "normal" })
121
- }
122
-
123
- handleCancelCustomize = () => {
124
- return this.setState({ mode: "normal" })
125
- }
126
-
127
- // renderPreview() {
128
- // return R(
129
- // "div",
130
- // { className: "axis-palette" },
131
- // _.map(this.props.categories.slice(0, 6), (category, i) => {
132
- // const color = _.find(this.props.axis.colorMap, { value: category.value })
133
- // const cellStyle = {
134
- // display: "inline-block",
135
- // height: 20,
136
- // width: 20,
137
- // backgroundColor: color ? color.color : this.props.defaultColor
138
- // }
139
- // return R("div", { style: cellStyle, key: i }, " ")
140
- // })
141
- // )
142
- // }
143
-
144
- render() {
145
- return R(
146
- "div",
147
- null,
148
- (() => {
149
- if (this.state.mode === "palette") {
150
- if (this.props.categories) {
151
- return R(ColorPaletteCollectionComponent, {
152
- onPaletteSelected: this.handlePaletteChange,
153
- axis: this.props.axis,
154
- categories: this.props.categories,
155
- onCancel: this.handleCancelCustomize
156
- })
157
- }
158
- }
159
- return null
160
- })(),
161
- this.state.mode === "normal"
162
- ? R(
163
- "div",
164
- null,
165
- R(
166
- "p",
167
- null,
168
- R(
169
- "a",
170
- { className: "link-plain", onClick: this.handleSelectPalette, key: "select-palette" },
171
- "Change color scheme"
172
- ),
173
- !this.props.autosetColors
174
- ? R(
175
- "a",
176
- {
177
- className: "btn btn-sm btn-link",
178
- onClick: this.handleResetPalette,
179
- key: "reset-palette"
180
- },
181
- "Reset colors"
182
- )
183
- : undefined
184
- ),
185
- this.props.axis.colorMap
186
- ? R(
187
- "div",
188
- { key: "selected-palette" },
189
- R(
190
- "div",
191
- null,
192
- R(CategoryMapComponent, {
193
- schema: this.props.schema,
194
- axis: this.props.axis,
195
- onChange: this.props.onChange,
196
- categories: this.props.categories,
197
- key: "colorMap",
198
- reorderable: this.props.reorderable,
199
- allowExcludedValues: this.props.allowExcludedValues,
200
- showColorMap: true,
201
- initiallyExpanded: this.props.initiallyExpanded
202
- })
203
- )
204
- )
205
- : undefined
206
- )
207
- : undefined
208
- )
209
- }
210
- }
@@ -1,117 +0,0 @@
1
- import _ from "lodash"
2
- import React from "react"
3
- const R = React.createElement
4
-
5
- import { LazyLoadComponent as LazyLoad } from "react-lazy-load-image-component"
6
- import RotationAwareImageComponent from "@mwater/forms/lib/RotationAwareImageComponent"
7
- import ImagePopupComponent from "./ImagePopupComponent"
8
- import { DataSource } from "@mwater/expressions"
9
-
10
- export interface ImageMosaicChartViewComponentProps {
11
- /** Design of chart */
12
- design: any
13
- /** Data that the chart has requested. In format [image: {image data or imagelist data}] */
14
- data: any
15
- /** Data source to use */
16
- dataSource: DataSource
17
- width?: number
18
- height?: number
19
- onRowClick?: any
20
- }
21
-
22
- /** creates a d3 calendar visualization */
23
- export default class ImageMosaicChartViewComponent extends React.Component<ImageMosaicChartViewComponentProps> {
24
- imagePopup: ImagePopupComponent | null
25
- shouldComponentUpdate(prevProps: any) {
26
- return !_.isEqual(prevProps, this.props)
27
- }
28
-
29
- handleClick = (primaryKey: any, image: any) => {
30
- if (this.props.onRowClick) {
31
- return this.props.onRowClick(this.props.design.table, primaryKey)
32
- } else {
33
- return this.imagePopup?.show(image)
34
- }
35
- }
36
-
37
- // Render a single image
38
- renderImage = (primaryKey: any, image: any, imageManager: any) => {
39
- return R(
40
- LazyLoad,
41
- { key: image.id },
42
- R(RotationAwareImageComponent, {
43
- imageManager,
44
- image,
45
- thumbnail: true,
46
- height: 120,
47
- width: 80,
48
- onClick: () => this.handleClick(primaryKey, image)
49
- })
50
- )
51
- }
52
-
53
- // Render images
54
- renderImages(imageManager: any) {
55
- const imageElems = []
56
-
57
- // For each image
58
- return (() => {
59
- const result = []
60
- for (var row of this.props.data) {
61
- let imageObj = row.image
62
-
63
- // Ignore nulls (https://github.com/mWater/mwater-server/issues/202)
64
- if (!imageObj) {
65
- continue
66
- }
67
-
68
- if (_.isString(imageObj)) {
69
- imageObj = JSON.parse(imageObj)
70
- }
71
-
72
- if (_.isArray(imageObj)) {
73
- result.push(imageObj.map((image) => this.renderImage(row.id, image, imageManager)))
74
- } else {
75
- result.push(this.renderImage(row.id, imageObj, imageManager))
76
- }
77
- }
78
- return result
79
- })()
80
- }
81
-
82
- render() {
83
- const titleStyle = {
84
- textAlign: "center",
85
- fontSize: "14px",
86
- fontWeight: "bold"
87
- }
88
-
89
- const style = {
90
- width: this.props.width,
91
- height: this.props.height,
92
- position: "relative",
93
- overflowY: "auto"
94
- }
95
-
96
- const title = this.props.design.titleText
97
-
98
- const imageManager = {
99
- getImageThumbnailUrl: (id: any, success: any, error: any) => success(this.props.dataSource.getImageUrl(id, 100)),
100
- getImageUrl: (id: any, success: any, error: any) => success(this.props.dataSource.getImageUrl(id))
101
- }
102
-
103
- return R(
104
- "div",
105
- { style, className: "image-mosaic" },
106
- title ? R("p", { style: titleStyle }, title) : undefined,
107
-
108
- R(ImagePopupComponent, {
109
- ref: (c: ImagePopupComponent | null) => {
110
- this.imagePopup = c
111
- },
112
- imageManager
113
- }),
114
- R("div", null, this.renderImages(imageManager))
115
- )
116
- }
117
- }