@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
@@ -1,5 +1,5 @@
1
1
  import _ from "lodash"
2
- import React, { ReactNode } from "react"
2
+ import React, { ReactNode, useMemo } from "react"
3
3
  import { useState } from "react"
4
4
  import { FormGroup, Toggle, Select, CollapsibleSection, Checkbox, CollapsiblePanel } from "@mwater/react-library/lib/bootstrap"
5
5
  import { DashboardDesign } from "./DashboardDesign"
@@ -20,13 +20,6 @@ interface Size {
20
20
  height: number
21
21
  }
22
22
 
23
- const sizeOptions: { value: Size; label: string }[] = [
24
- { value: { width: 360, height: 640 }, label: "Phone (360x640)" },
25
- { value: { width: 768, height: 1024 }, label: "Tablet (768x1024)" },
26
- { value: { width: 1000, height: 800 }, label: "Laptop (1000x800)" },
27
- { value: { width: 1280, height: 1024 }, label: "Desktop (1280x1024)" }
28
- ]
29
-
30
23
  export function LayoutOptionsComponent(props: {
31
24
  design: DashboardDesign
32
25
  onDesignChange: (design: DashboardDesign) => void
@@ -46,22 +39,29 @@ export function LayoutOptionsComponent(props: {
46
39
 
47
40
  const isCustomized = !_.isEqual(layoutOptions, getDefaultLayoutOptions(props.design.style))
48
41
 
42
+ const sizeOptions = useMemo(() => [
43
+ { value: { width: 360, height: 640 }, label: T`Phone (360x640)` },
44
+ { value: { width: 768, height: 1024 }, label: T`Tablet (768x1024)` },
45
+ { value: { width: 1000, height: 800 }, label: T`Laptop (1000x800)` },
46
+ { value: { width: 1280, height: 1024 }, label: T`Desktop (1280x1024)` }
47
+ ] as { value: Size; label: string }[], [])
48
+
49
49
  return (
50
50
  <div style={{ display: "grid", gridTemplateRows: "auto 1fr", gridTemplateColumns: "360px 1fr", height: "100%" }}>
51
51
  <div style={{ padding: "5px 10px 5px 0px", gridRow: "1 / 3", overflowY: "auto" }}>
52
- <h5>Theme</h5>
52
+ <h5>{T`Theme`}</h5>
53
53
  <ThemeToggle
54
54
  theme={props.design.style}
55
55
  onChange={(theme) => {
56
56
  if (isCustomized) {
57
- if (!confirm("Are you sure you want to change the theme? Your customizations will be lost.")) return
57
+ if (!confirm(T`Are you sure you want to change the theme? Your customizations will be lost.`)) return
58
58
  }
59
59
  props.onDesignChange({ ...props.design, style: theme, layoutOptions: getDefaultLayoutOptions(theme) })
60
60
  }}
61
61
  isCustomized={isCustomized}
62
62
  />
63
63
  <br />
64
- <CollapsibleSection label={<h5 style={{ display: "inline-block" }}>Customize Layout</h5>} initiallyOpen={isCustomized}>
64
+ <CollapsibleSection label={<h5 style={{ display: "inline-block" }}>{T`Customize Layout`}</h5>} initiallyOpen={isCustomized}>
65
65
  <CustomizeLayout
66
66
  layoutOptions={layoutOptions}
67
67
  onLayoutOptionsChange={setLayoutOptions}
@@ -69,7 +69,7 @@ export function LayoutOptionsComponent(props: {
69
69
  </CollapsibleSection>
70
70
  </div>
71
71
  <div style={{ textAlign: "center", padding: 3 }}>
72
- <span className="text-muted">Preview As:&nbsp;</span>
72
+ <span className="text-muted">{T`Preview As:`}&nbsp;</span>
73
73
  <Toggle
74
74
  value={previewSize}
75
75
  onChange={setPreviewSize}
@@ -121,8 +121,8 @@ function ThemeToggle(props: {
121
121
  className={isActive ? "list-group-item active" : "list-group-item"}
122
122
  onClick={props.onChange.bind(null, "default")}
123
123
  >
124
- <div>Classic Dashboard</div>
125
- <div style={{ opacity: 0.6 }}>Ideal for data display with minimal text</div>
124
+ <div>{T`Classic Dashboard`}</div>
125
+ <div style={{ opacity: 0.6 }}>{T`Ideal for data display with minimal text`}</div>
126
126
  </a>
127
127
  )
128
128
  }
@@ -133,8 +133,8 @@ function ThemeToggle(props: {
133
133
  className={isActive ? "list-group-item active" : "list-group-item"}
134
134
  onClick={props.onChange.bind(null, "greybg")}
135
135
  >
136
- <div>Framed Dashboard</div>
137
- <div style={{ opacity: 0.6 }}>Each widget is white on a grey background</div>
136
+ <div>{T`Framed Dashboard`}</div>
137
+ <div style={{ opacity: 0.6 }}>{T`Each widget is white on a grey background`}</div>
138
138
  </a>
139
139
  )
140
140
  }
@@ -145,8 +145,8 @@ function ThemeToggle(props: {
145
145
  className={isActive ? "list-group-item active" : "list-group-item"}
146
146
  onClick={props.onChange.bind(null, "story")}
147
147
  >
148
- <div>Story</div>
149
- <div style={{ opacity: 0.6 }}>Ideal for data-driven storytelling with lots of text</div>
148
+ <div>{T`Story`}</div>
149
+ <div style={{ opacity: 0.6 }}>{T`Ideal for data-driven storytelling with lots of text`}</div>
150
150
  </a>
151
151
  )
152
152
  }
@@ -156,8 +156,8 @@ function ThemeToggle(props: {
156
156
  key={theme}
157
157
  className={isActive ? "list-group-item active" : "list-group-item"}
158
158
  >
159
- <div>Custom</div>
160
- <div style={{ opacity: 0.6 }}>Customized theme</div>
159
+ <div>{T`Custom`}</div>
160
+ <div style={{ opacity: 0.6 }}>{T`Customized theme`}</div>
161
161
  </a>
162
162
  )
163
163
  }
@@ -191,7 +191,7 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
191
191
  const uploadedTheme = JSON.parse(e.target?.result as string)
192
192
  onLayoutOptionsChange(uploadedTheme)
193
193
  } catch (error) {
194
- alert("Invalid theme file")
194
+ alert(T`Invalid theme file`)
195
195
  }
196
196
  }
197
197
  reader.readAsText(file)
@@ -200,18 +200,18 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
200
200
 
201
201
  return (
202
202
  <div>
203
- <CollapsiblePanel title="Text">
204
- <FormGroup label="Title">
203
+ <CollapsiblePanel title={T`Text`}>
204
+ <FormGroup label={T`Title`}>
205
205
  <FontStyleEditor value={layoutOptions.titleWidgetFont} onChange={(titleWidgetFont) => {
206
206
  onLayoutOptionsChange({ ...layoutOptions, titleWidgetFont })
207
207
  }} />
208
208
  </FormGroup>
209
- <FormGroup label="Heading H1">
209
+ <FormGroup label={T`Heading H1`}>
210
210
  <FontStyleEditor value={layoutOptions.textWidgetH1Font} onChange={(textWidgetH1Font) => {
211
211
  onLayoutOptionsChange({ ...layoutOptions, textWidgetH1Font })
212
212
  }} />
213
213
  <div className="mt-1">
214
- <FormGroup label="Top Margin:" horizontal labelMuted>
214
+ <FormGroup label={T`Top Margin:`} horizontal labelMuted>
215
215
  <PixelsInput
216
216
  value={layoutOptions.textWidgetH1MarginTop}
217
217
  onChange={(textWidgetH1MarginTop) => {
@@ -221,12 +221,12 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
221
221
  </FormGroup>
222
222
  </div>
223
223
  </FormGroup>
224
- <FormGroup label="Heading H2">
224
+ <FormGroup label={T`Heading H2`}>
225
225
  <FontStyleEditor value={layoutOptions.textWidgetH2Font} onChange={(textWidgetH2Font) => {
226
226
  onLayoutOptionsChange({ ...layoutOptions, textWidgetH2Font })
227
227
  }} />
228
228
  <div className="mt-1">
229
- <FormGroup label="Top Margin:" horizontal labelMuted>
229
+ <FormGroup label={T`Top Margin:`} horizontal labelMuted>
230
230
  <PixelsInput
231
231
  value={layoutOptions.textWidgetH2MarginTop}
232
232
  onChange={(textWidgetH2MarginTop) => {
@@ -236,22 +236,22 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
236
236
  </FormGroup>
237
237
  </div>
238
238
  </FormGroup>
239
- <FormGroup label="Text">
239
+ <FormGroup label={T`Text`}>
240
240
  <FontStyleEditor value={layoutOptions.textWidgetFont} onChange={(textWidgetFont) => {
241
241
  onLayoutOptionsChange({ ...layoutOptions, textWidgetFont })
242
242
  }} />
243
243
  <div className="mt-1">
244
- <FormGroup label="Line Height:" horizontal labelMuted>
244
+ <FormGroup label={T`Line Height:`} horizontal labelMuted>
245
245
  <PixelsInput
246
246
  value={layoutOptions.textWidgetLineHeight}
247
247
  onChange={(textWidgetLineHeight) => {
248
248
  onLayoutOptionsChange({ ...layoutOptions, textWidgetLineHeight: textWidgetLineHeight })
249
249
  }}
250
250
  allowDefault
251
- defaultLabel="Default"
251
+ defaultLabel={T`Default`}
252
252
  />
253
253
  </FormGroup>
254
- <FormGroup label="Paragraph Spacing:" horizontal labelMuted>
254
+ <FormGroup label={T`Paragraph Spacing:`} horizontal labelMuted>
255
255
  <PixelsInput
256
256
  value={layoutOptions.textWidgetParagraphSpacing}
257
257
  onChange={(textWidgetParagraphSpacing) => {
@@ -261,44 +261,44 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
261
261
  </FormGroup>
262
262
  </div>
263
263
  </FormGroup>
264
- <FormGroup label="List Line Height:" horizontal>
264
+ <FormGroup label={T`List Line Height:`} horizontal>
265
265
  <PixelsInput
266
266
  value={layoutOptions.textWidgetListLineHeight}
267
267
  onChange={(textWidgetListLineHeight) => {
268
268
  onLayoutOptionsChange({ ...layoutOptions, textWidgetListLineHeight: textWidgetListLineHeight })
269
269
  }}
270
270
  allowDefault
271
- defaultLabel="Default"
271
+ defaultLabel={T`Default`}
272
272
  />
273
273
  </FormGroup>
274
- <FormGroup label="Chart Header Font">
274
+ <FormGroup label={T`Chart Header Font`}>
275
275
  <FontStyleEditor value={layoutOptions.widgetHeaderFont} onChange={(widgetHeaderFont) => {
276
276
  onLayoutOptionsChange({ ...layoutOptions, widgetHeaderFont })
277
277
  }} />
278
278
  </FormGroup>
279
- <FormGroup label="Chart Footer Font">
279
+ <FormGroup label={T`Chart Footer Font`}>
280
280
  <FontStyleEditor value={layoutOptions.widgetFooterFont} onChange={(widgetFooterFont) => {
281
281
  onLayoutOptionsChange({ ...layoutOptions, widgetFooterFont })
282
282
  }} />
283
283
  </FormGroup>
284
- <FormGroup label="Chart Font">
284
+ <FormGroup label={T`Chart Font`}>
285
285
  <FontStyleEditor value={layoutOptions.chartFont} onChange={(chartFont) => {
286
286
  onLayoutOptionsChange({ ...layoutOptions, chartFont })
287
287
  }} />
288
288
  </FormGroup>
289
- <FormGroup label="Table Font">
289
+ <FormGroup label={T`Table Font`}>
290
290
  <FontStyleEditor value={layoutOptions.tableFont} onChange={(tableFont) => {
291
291
  onLayoutOptionsChange({ ...layoutOptions, tableFont })
292
292
  }} />
293
293
  </FormGroup>
294
- <FormGroup label="Pivot Table Font">
294
+ <FormGroup label={T`Pivot Table Font`}>
295
295
  <FontStyleEditor value={layoutOptions.pivotTableFont} onChange={(pivotTableFont) => {
296
296
  onLayoutOptionsChange({ ...layoutOptions, pivotTableFont })
297
297
  }} />
298
298
  </FormGroup>
299
299
  </CollapsiblePanel>
300
- <CollapsiblePanel title="Spacing">
301
- <FormGroup label="Outer Padding:" horizontal>
300
+ <CollapsiblePanel title={T`Spacing`}>
301
+ <FormGroup label={T`Outer Padding:`} horizontal>
302
302
  <PixelsInput
303
303
  value={layoutOptions.outerPadding}
304
304
  onChange={(outerPadding) => {
@@ -306,17 +306,17 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
306
306
  }}
307
307
  />
308
308
  </FormGroup>
309
- <FormGroup label="Block Margins">
309
+ <FormGroup label={T`Block Margins`}>
310
310
  <SpacingInput value={layoutOptions.blockMargin} onChange={(blockMargin) => {
311
311
  onLayoutOptionsChange({ ...layoutOptions, blockMargin })
312
312
  }} />
313
313
  </FormGroup>
314
- <FormGroup label="Block Padding">
314
+ <FormGroup label={T`Block Padding`}>
315
315
  <SpacingInput value={layoutOptions.blockPadding} onChange={(blockPadding) => {
316
316
  onLayoutOptionsChange({ ...layoutOptions, blockPadding })
317
317
  }} />
318
318
  </FormGroup>
319
- <FormGroup label="Block Border Radius:" horizontal>
319
+ <FormGroup label={T`Block Border Radius:`} horizontal>
320
320
  <PixelsInput
321
321
  value={layoutOptions.blockBorderRadius}
322
322
  onChange={(blockBorderRadius) => {
@@ -325,8 +325,8 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
325
325
  />
326
326
  </FormGroup>
327
327
  </CollapsiblePanel>
328
- <CollapsiblePanel title="Colors">
329
- <FormGroup label="Background Color:" horizontal>
328
+ <CollapsiblePanel title={T`Colors`}>
329
+ <FormGroup label={T`Background Color:`} horizontal>
330
330
  <ColorComponent
331
331
  color={layoutOptions.backgroundColor}
332
332
  onChange={(backgroundColor) => {
@@ -334,7 +334,7 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
334
334
  }}
335
335
  />
336
336
  </FormGroup>
337
- <FormGroup label="Block Background Color:" horizontal>
337
+ <FormGroup label={T`Block Background Color:`} horizontal>
338
338
  <ColorComponent
339
339
  color={layoutOptions.blockBackgroundColor}
340
340
  onChange={(blockBackgroundColor) => {
@@ -342,7 +342,7 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
342
342
  }}
343
343
  />
344
344
  </FormGroup>
345
- <FormGroup label="Custom Colors">
345
+ <FormGroup label={T`Custom Colors`}>
346
346
  <div style={{ display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)', gap: '5px' }}>
347
347
  {/* 18 colors, 3 rows of 6 */}
348
348
  {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17].map((colorIndex) => (
@@ -359,8 +359,8 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
359
359
  </div>
360
360
  </FormGroup>
361
361
  </CollapsiblePanel>
362
- <CollapsiblePanel title="Responsive Layout">
363
- <FormGroup label="Collapse to Single Column">
362
+ <CollapsiblePanel title={T`Responsive Layout`}>
363
+ <FormGroup label={T`Collapse to Single Column`}>
364
364
  <WidthSelector
365
365
  value={layoutOptions.collapseColumnsWidth}
366
366
  onChange={(collapseColumnsWidth) => {
@@ -369,7 +369,7 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
369
369
  sign="< "
370
370
  />
371
371
  </FormGroup>
372
- <FormGroup label="Hide Quickfilters">
372
+ <FormGroup label={T`Hide Quickfilters`}>
373
373
  <WidthSelector
374
374
  value={layoutOptions.hideQuickfiltersWidth}
375
375
  onChange={(hideQuickfiltersWidth) => {
@@ -378,7 +378,7 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
378
378
  sign="< "
379
379
  />
380
380
  </FormGroup>
381
- <FormGroup label="Minimum Width (before scrolling or scaling)">
381
+ <FormGroup label={T`Minimum Width (before scrolling or scaling)`}>
382
382
  <WidthSelector
383
383
  value={layoutOptions.minimumWidth}
384
384
  onChange={(minimumWidth) => {
@@ -386,7 +386,7 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
386
386
  }}
387
387
  sign="< "
388
388
  />
389
- <FormGroup label="When Below Minimum Width">
389
+ <FormGroup label={T`When Below Minimum Width`}>
390
390
  <Toggle
391
391
  value={layoutOptions.belowMinimumWidth}
392
392
  onChange={(belowMinimumWidth) => {
@@ -394,13 +394,13 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
394
394
  }}
395
395
  size="sm"
396
396
  options={[
397
- { value: "scroll", label: "Scroll" },
398
- { value: "scale", label: "Scale" }
397
+ { value: "scroll", label: T`Scroll` },
398
+ { value: "scale", label: T`Scale` }
399
399
  ]}
400
400
  />
401
401
  </FormGroup>
402
402
  </FormGroup>
403
- <FormGroup label="Maximum Width (before padding)">
403
+ <FormGroup label={T`Maximum Width (before padding)`}>
404
404
  <WidthSelector
405
405
  value={layoutOptions.maximumWidth}
406
406
  onChange={(maximumWidth) => {
@@ -412,21 +412,21 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
412
412
  <Checkbox value={layoutOptions.collapseSpacers} onChange={(collapseSpacers) => {
413
413
  onLayoutOptionsChange({ ...layoutOptions, collapseSpacers })
414
414
  }}>
415
- Collapse Spacers on Mobile
415
+ {T`Collapse Spacers on Mobile`}
416
416
  </Checkbox>
417
417
  </CollapsiblePanel>
418
418
 
419
- <CollapsiblePanel title="Download/Upload Theme" initiallyClosed>
419
+ <CollapsiblePanel title={T`Download/Upload Theme`} initiallyClosed>
420
420
  <div className="mb-2 text-muted">
421
- Download or upload a custom theme to use for this dashboard.
422
- This saves the current theme as a theme file that you can then use on other dashboards by uploading it there.
421
+ {T`Download or upload a custom theme to use for this dashboard.
422
+ This saves the current theme as a theme file that you can then use on other dashboards by uploading it there.`}
423
423
  </div>
424
424
  <div style={{ display: "flex", flexDirection: "column", marginTop: "10px", gap: "10px" }}>
425
425
  <button className="btn btn-sm btn-secondary" onClick={handleDownloadTheme}>
426
- <i className="fas fa-download" /> Download Custom Theme
426
+ <i className="fas fa-download" /> {T`Download Custom Theme`}
427
427
  </button>
428
428
  <label className="btn btn-sm btn-secondary">
429
- <i className="fas fa-upload" /> Upload Custom Theme
429
+ <i className="fas fa-upload" /> {T`Upload Custom Theme`}
430
430
  <input
431
431
  type="file"
432
432
  accept=".theme"
@@ -443,10 +443,10 @@ function CustomizeLayout(props: { layoutOptions: BlocksLayoutOptions; onLayoutOp
443
443
  function SpacingInput(props: { value: Spacing; onChange: (value: Spacing) => void }) {
444
444
  return (
445
445
  <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', width: '100%' }}>
446
- <div>Top</div>
447
- <div>Bottom</div>
448
- <div>Left</div>
449
- <div>Right</div>
446
+ <div>{T`Top`}</div>
447
+ <div>{T`Bottom`}</div>
448
+ <div>{T`Left`}</div>
449
+ <div>{T`Right`}</div>
450
450
  <PixelsInput value={props.value.top} onChange={(top) => props.onChange({ ...props.value, top: top! })} />
451
451
  <PixelsInput value={props.value.bottom} onChange={(bottom) => props.onChange({ ...props.value, bottom: bottom! })} />
452
452
  <PixelsInput value={props.value.left} onChange={(left) => props.onChange({ ...props.value, left: left! })} />
@@ -474,7 +474,7 @@ function PixelsInput(props: {
474
474
  data-bs-toggle="dropdown"
475
475
  aria-expanded="false"
476
476
  >
477
- {props.value === null ? (props.defaultLabel || "Default") : `${props.value}px`}
477
+ {props.value === null ? (props.defaultLabel || T`Default`) : `${props.value}px`}
478
478
  </a>
479
479
  <ul className="dropdown-menu" aria-labelledby="pixelsInputDropdown">
480
480
  {props.allowDefault && (
@@ -487,7 +487,7 @@ function PixelsInput(props: {
487
487
  props.onChange(null)
488
488
  }}
489
489
  >
490
- {props.defaultLabel || "Default"}
490
+ {props.defaultLabel || T`Default`}
491
491
  </a>
492
492
  </li>
493
493
  )}
@@ -520,14 +520,14 @@ function WidthSelector(props: {
520
520
  <Select
521
521
  value={props.value}
522
522
  onChange={props.onChange}
523
- nullLabel="N/A"
523
+ nullLabel={T`N/A`}
524
524
  options={[
525
- { value: 400, label: `${props.sign}400px (Phone)` },
526
- { value: 600, label: `${props.sign}600px (Small tablet)` },
527
- { value: 800, label: `${props.sign}800px (Tablet)` },
528
- { value: 1000, label: `${props.sign}1000px (Laptop)` },
529
- { value: 1200, label: `${props.sign}1200px (Desktop)` },
530
- { value: 1600, label: `${props.sign}1600px (Wide Desktop)` }
525
+ { value: 400, label: `${props.sign}400px (${T`Phone`})` },
526
+ { value: 600, label: `${props.sign}600px (${T`Small tablet`})` },
527
+ { value: 800, label: `${props.sign}800px (${T`Tablet`})` },
528
+ { value: 1000, label: `${props.sign}1000px (${T`Laptop`})` },
529
+ { value: 1200, label: `${props.sign}1200px (${T`Desktop`})` },
530
+ { value: 1600, label: `${props.sign}1600px (${T`Wide Desktop`})` }
531
531
  ]}
532
532
  />
533
533
  )