@mwater/visualization 5.1.0 → 5.3.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 (305) hide show
  1. package/lib/ColorComponent.d.ts +10 -11
  2. package/lib/ColorComponent.js +78 -29
  3. package/lib/ColorSchemeFactory.d.ts +13 -2
  4. package/lib/ColorSchemeFactory.js +7 -5
  5. package/lib/CustomColorsContext.d.ts +6 -0
  6. package/lib/CustomColorsContext.js +6 -0
  7. package/lib/FiltersDesignerComponent.d.ts +1 -4
  8. package/lib/FiltersDesignerComponent.js +2 -3
  9. package/lib/GlobalFilter.d.ts +13 -0
  10. package/lib/GlobalFilter.js +2 -0
  11. package/lib/LocaleContextInjector.d.ts +5 -11
  12. package/lib/LocaleContextInjector.js +4 -12
  13. package/lib/MWaterAddRelatedFormComponent.js +3 -3
  14. package/lib/MWaterAddRelatedIndicatorComponent.d.ts +1 -4
  15. package/lib/MWaterAddRelatedIndicatorComponent.js +6 -6
  16. package/lib/MWaterCompleteTableSelectComponent.d.ts +7 -25
  17. package/lib/MWaterCompleteTableSelectComponent.js +36 -36
  18. package/lib/MWaterContextComponent.d.ts +19 -9
  19. package/lib/MWaterContextComponent.js +38 -22
  20. package/lib/MWaterCustomTablesetListComponent.js +9 -3
  21. package/lib/MWaterGlobalFiltersComponent.d.ts +6 -5
  22. package/lib/MWaterGlobalFiltersComponent.js +4 -4
  23. package/lib/MWaterLoaderComponent.d.ts +15 -3
  24. package/lib/MWaterLoaderComponent.js +11 -2
  25. package/lib/MWaterTableSelectComponent.d.ts +1 -4
  26. package/lib/MWaterTableSelectComponent.js +10 -12
  27. package/lib/UIComponents.d.ts +2 -2
  28. package/lib/UIComponents.js +4 -12
  29. package/lib/axes/Axis.d.ts +20 -25
  30. package/lib/axes/AxisBuilder.d.ts +7 -4
  31. package/lib/axes/AxisBuilder.js +12 -8
  32. package/lib/axes/AxisComponent.d.ts +6 -9
  33. package/lib/axes/AxisComponent.js +1 -2
  34. package/lib/axes/ColorPaletteCollectionComponent.d.ts +5 -12
  35. package/lib/axes/ColorPaletteCollectionComponent.js +67 -36
  36. package/lib/dashboards/DashboardComponent.d.ts +4 -17
  37. package/lib/dashboards/DashboardComponent.js +20 -67
  38. package/lib/dashboards/DashboardDesign.d.ts +5 -20
  39. package/lib/dashboards/DashboardUpgrader.js +36 -1
  40. package/lib/dashboards/DashboardViewComponent.d.ts +5 -34
  41. package/lib/dashboards/DashboardViewComponent.js +112 -136
  42. package/lib/dashboards/FontStyleEditor.d.ts +8 -0
  43. package/lib/dashboards/FontStyleEditor.js +130 -0
  44. package/lib/dashboards/LayoutOptionsComponent.d.ts +0 -1
  45. package/lib/dashboards/LayoutOptionsComponent.js +209 -39
  46. package/lib/dashboards/ServerDashboardDataSource.d.ts +1 -2
  47. package/lib/dashboards/ServerDashboardDataSource.js +52 -33
  48. package/lib/dashboards/SettingsModalComponent.d.ts +4 -15
  49. package/lib/dashboards/SettingsModalComponent.js +24 -38
  50. package/lib/dashboards/WidgetComponent.d.ts +3 -3
  51. package/lib/dashboards/WidgetComponent.js +3 -6
  52. package/lib/dashboards/WidgetDataSourcePrioritizer.d.ts +20 -0
  53. package/lib/dashboards/WidgetDataSourcePrioritizer.js +72 -0
  54. package/lib/dashboards/layoutOptions.d.ts +83 -0
  55. package/lib/dashboards/layoutOptions.js +436 -10
  56. package/lib/datagrids/DatagridComponent.d.ts +2 -9
  57. package/lib/datagrids/DatagridDataSource.d.ts +3 -3
  58. package/lib/datagrids/DatagridDataSource.js +0 -14
  59. package/lib/datagrids/DatagridDesign.d.ts +7 -6
  60. package/lib/datagrids/DatagridDesignerComponent.d.ts +2 -93
  61. package/lib/datagrids/DatagridDesignerComponent.js +8 -6
  62. package/lib/datagrids/DatagridViewComponent.js +1 -1
  63. package/lib/datagrids/FindReplaceModalComponent.d.ts +4 -20
  64. package/lib/datagrids/FindReplaceModalComponent.js +27 -13
  65. package/lib/datagrids/ServerDatagridDataSource.d.ts +8 -7
  66. package/lib/datagrids/ServerDatagridDataSource.js +88 -36
  67. package/lib/demo.js +4 -4
  68. package/lib/index.css +5 -0
  69. package/lib/index.d.ts +2 -1
  70. package/lib/index.js +0 -1
  71. package/lib/layouts/LayoutManager.d.ts +33 -29
  72. package/lib/layouts/LayoutManager.js +2 -8
  73. package/lib/layouts/blocks/BlocksDisplayComponent.d.ts +26 -56
  74. package/lib/layouts/blocks/BlocksDisplayComponent.js +122 -205
  75. package/lib/layouts/blocks/BlocksLayoutManager.d.ts +6 -22
  76. package/lib/layouts/blocks/BlocksLayoutManager.js +5 -14
  77. package/lib/layouts/blocks/HorizontalBlockComponent.d.ts +5 -4
  78. package/lib/layouts/blocks/HorizontalBlockComponent.js +5 -5
  79. package/lib/layouts/grid/GridLayoutManager.d.ts +2 -1
  80. package/lib/mWaterLoader.d.ts +2 -0
  81. package/lib/mWaterLoader.js +2 -1
  82. package/lib/maps/AddLayerComponent.d.ts +6 -8
  83. package/lib/maps/AddLayerComponent.js +6 -6
  84. package/lib/maps/BingLayer.js +10 -20
  85. package/lib/maps/BufferLayer.js +5 -2
  86. package/lib/maps/ChoroplethLayer.js +2 -1
  87. package/lib/maps/ClusterLayer.js +3 -1
  88. package/lib/maps/DirectMapDataSource.d.ts +5 -2
  89. package/lib/maps/DirectMapDataSource.js +2 -1
  90. package/lib/maps/EditPopupComponent.js +2 -1
  91. package/lib/maps/GridLayer.js +5 -3
  92. package/lib/maps/GridLayerDesigner.js +0 -1
  93. package/lib/maps/LayerSwitcherComponent.js +1 -1
  94. package/lib/maps/MapComponent.d.ts +3 -11
  95. package/lib/maps/MapComponent.js +3 -3
  96. package/lib/maps/MapDesign.d.ts +2 -13
  97. package/lib/maps/MapFiltersDesignerComponent.d.ts +0 -4
  98. package/lib/maps/MapFiltersDesignerComponent.js +4 -5
  99. package/lib/maps/MarkersLayer.js +30 -25
  100. package/lib/maps/RasterMapViewComponent.d.ts +3 -13
  101. package/lib/maps/RasterMapViewComponent.js +3 -3
  102. package/lib/maps/RegionSelectComponent.d.ts +2 -1
  103. package/lib/maps/ServerMapDataSource.d.ts +3 -4
  104. package/lib/maps/ServerMapDataSource.js +5 -5
  105. package/lib/maps/VectorMapViewComponent.js +2 -1
  106. package/lib/maps/mapSymbols.js +2 -0
  107. package/lib/maps/symbols/font-awesome/cloud-rain.png +0 -0
  108. package/lib/maps/vectorMaps.d.ts +1 -0
  109. package/lib/maps/vectorMaps.js +70 -56
  110. package/lib/quickfilter/QuickfilterCompiler.d.ts +1 -1
  111. package/lib/quickfilter/QuickfiltersComponent.d.ts +1 -4
  112. package/lib/quickfilter/QuickfiltersComponent.js +3 -3
  113. package/lib/richtext/DropdownPaletteItem.d.ts +32 -0
  114. package/lib/richtext/DropdownPaletteItem.js +82 -0
  115. package/lib/richtext/FontColorPaletteItem.d.ts +1 -5
  116. package/lib/richtext/FontColorPaletteItem.js +32 -27
  117. package/lib/richtext/ItemsHtmlConverter.js +12 -3
  118. package/lib/richtext/RichTextComponent.d.ts +26 -52
  119. package/lib/richtext/RichTextComponent.js +166 -128
  120. package/lib/valueFormatter.js +6 -1
  121. package/lib/wellknown.d.ts +5 -0
  122. package/lib/wellknown.js +288 -0
  123. package/lib/widgets/DropdownWidgetComponent.d.ts +8 -25
  124. package/lib/widgets/DropdownWidgetComponent.js +48 -25
  125. package/lib/widgets/IFrameWidgetComponent.d.ts +3 -11
  126. package/lib/widgets/ImageWidgetComponent.d.ts +8 -27
  127. package/lib/widgets/MapWidget.d.ts +4 -7
  128. package/lib/widgets/MapWidget.js +2 -1
  129. package/lib/widgets/MarkdownWidget.d.ts +2 -7
  130. package/lib/widgets/TOCWidget.d.ts +2 -9
  131. package/lib/widgets/TOCWidget.js +2 -1
  132. package/lib/widgets/Widget.d.ts +2 -0
  133. package/lib/widgets/WidgetDataSource.d.ts +3 -1
  134. package/lib/widgets/charts/Chart.d.ts +0 -1
  135. package/lib/widgets/charts/ChartViewComponent.d.ts +4 -0
  136. package/lib/widgets/charts/ChartViewComponent.js +11 -3
  137. package/lib/widgets/charts/ChartWidget.d.ts +1 -74
  138. package/lib/widgets/charts/ChartWidget.js +4 -183
  139. package/lib/widgets/charts/ChartWidgetComponent.d.ts +51 -0
  140. package/lib/widgets/charts/ChartWidgetComponent.js +167 -0
  141. package/lib/widgets/charts/calendar/CalendarChartViewComponent.d.ts +1 -4
  142. package/lib/widgets/charts/calendar/CalendarChartViewComponent.js +4 -4
  143. package/lib/widgets/charts/imagemosaic/ImagePopupComponent.d.ts +2 -7
  144. package/lib/widgets/charts/layered/LayeredChart.d.ts +5 -10
  145. package/lib/widgets/charts/layered/LayeredChart.js +6 -7
  146. package/lib/widgets/charts/layered/LayeredChartCompiler.d.ts +4 -2
  147. package/lib/widgets/charts/layered/LayeredChartCompiler.js +46 -32
  148. package/lib/widgets/charts/layered/LayeredChartDesign.d.ts +4 -0
  149. package/lib/widgets/charts/layered/LayeredChartDesignerComponent.d.ts +5 -31
  150. package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +21 -3
  151. package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.d.ts +1 -7
  152. package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +2 -1
  153. package/lib/widgets/charts/layered/LayeredChartViewComponent.d.ts +1 -4
  154. package/lib/widgets/charts/layered/LayeredChartViewComponent.js +89 -38
  155. package/lib/widgets/charts/pivot/IntersectionDesignerComponent.d.ts +5 -105
  156. package/lib/widgets/charts/pivot/IntersectionDesignerComponent.js +122 -166
  157. package/lib/widgets/charts/pivot/PivotChart.d.ts +6 -0
  158. package/lib/widgets/charts/pivot/PivotChart.js +47 -17
  159. package/lib/widgets/charts/pivot/PivotChartDesign.d.ts +11 -0
  160. package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +11 -7
  161. package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +1 -1
  162. package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.d.ts +2 -2
  163. package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.js +20 -36
  164. package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +0 -1
  165. package/lib/widgets/charts/pivot/PivotChartQueryBuilder.d.ts +23 -2
  166. package/lib/widgets/charts/pivot/PivotChartQueryBuilder.js +215 -181
  167. package/lib/widgets/charts/pivot/PivotChartUtils.d.ts +2 -2
  168. package/lib/widgets/charts/pivot/PivotChartViewComponent.d.ts +9 -47
  169. package/lib/widgets/charts/pivot/PivotChartViewComponent.js +20 -60
  170. package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +55 -58
  171. package/lib/widgets/charts/table/TableChart.js +8 -4
  172. package/lib/widgets/charts/table/TableChartDesignerComponent.js +3 -3
  173. package/lib/widgets/charts/table/TableChartViewComponent.js +30 -16
  174. package/lib/widgets/text/ExprInsertModalComponent.d.ts +2 -13
  175. package/lib/widgets/text/ExprUpdateModalComponent.d.ts +2 -13
  176. package/lib/widgets/text/TextComponent.d.ts +5 -12
  177. package/lib/widgets/text/TextComponent.js +19 -39
  178. package/lib/widgets/text/TextWidget.d.ts +2 -1
  179. package/lib/widgets/text/TextWidget.js +5 -1
  180. package/lib/widgets/text/TextWidgetComponent.d.ts +15 -3
  181. package/lib/widgets/text/TextWidgetComponent.js +76 -19
  182. package/lib/widgets/text/TextWidgetDesign.d.ts +16 -2
  183. package/lib/widgets/text/TextWidgetDesign.js +6 -0
  184. package/package.json +4 -4
  185. package/src/ColorComponent.tsx +177 -0
  186. package/src/ColorSchemeFactory.ts +12 -6
  187. package/src/CustomColorsContext.tsx +8 -0
  188. package/src/FiltersDesignerComponent.ts +3 -4
  189. package/src/GlobalFilter.ts +17 -0
  190. package/src/LocaleContextInjector.tsx +14 -13
  191. package/src/MWaterAddRelatedFormComponent.ts +3 -3
  192. package/src/MWaterAddRelatedIndicatorComponent.ts +6 -6
  193. package/src/MWaterCompleteTableSelectComponent.tsx +36 -36
  194. package/src/MWaterContextComponent.tsx +42 -33
  195. package/src/MWaterCustomTablesetListComponent.tsx +21 -3
  196. package/src/MWaterGlobalFiltersComponent.ts +8 -8
  197. package/src/MWaterLoaderComponent.ts +14 -4
  198. package/src/MWaterTableSelectComponent.tsx +11 -12
  199. package/src/{UIComponents.ts → UIComponents.tsx} +7 -15
  200. package/src/axes/Axis.ts +24 -25
  201. package/src/axes/AxisBuilder.ts +16 -13
  202. package/src/axes/AxisComponent.ts +3 -4
  203. package/src/axes/{ColorPaletteCollectionComponent.ts → ColorPaletteCollectionComponent.tsx} +87 -61
  204. package/src/dashboards/DashboardComponent.tsx +73 -147
  205. package/src/dashboards/DashboardDesign.ts +5 -25
  206. package/src/dashboards/DashboardUpgrader.ts +41 -1
  207. package/src/dashboards/DashboardViewComponent.tsx +313 -0
  208. package/src/dashboards/FontStyleEditor.tsx +166 -0
  209. package/src/dashboards/LayoutOptionsComponent.tsx +377 -71
  210. package/src/dashboards/ServerDashboardDataSource.ts +52 -33
  211. package/src/dashboards/SettingsModalComponent.tsx +170 -0
  212. package/src/dashboards/WidgetComponent.tsx +6 -12
  213. package/src/dashboards/WidgetDataSourcePrioritizer.ts +82 -0
  214. package/src/dashboards/layoutOptions.tsx +581 -0
  215. package/src/datagrids/DatagridDataSource.ts +6 -12
  216. package/src/datagrids/DatagridDesign.ts +8 -3
  217. package/src/datagrids/DatagridDesignerComponent.tsx +22 -18
  218. package/src/datagrids/DatagridViewComponent.ts +3 -3
  219. package/src/datagrids/ExprCellComponent.ts +0 -1
  220. package/src/datagrids/FindReplaceModalComponent.ts +39 -22
  221. package/src/datagrids/ServerDatagridDataSource.ts +107 -45
  222. package/src/demo.ts +4 -4
  223. package/src/index.css +5 -0
  224. package/src/index.ts +2 -1
  225. package/src/layouts/LayoutManager.ts +44 -42
  226. package/src/layouts/blocks/BlocksDisplayComponent.tsx +498 -0
  227. package/src/layouts/blocks/BlocksLayoutManager.ts +6 -15
  228. package/src/layouts/blocks/HorizontalBlockComponent.ts +9 -8
  229. package/src/mWaterLoader.ts +4 -1
  230. package/src/maps/AddLayerComponent.ts +9 -9
  231. package/src/maps/BingLayer.ts +16 -26
  232. package/src/maps/BufferLayer.ts +5 -2
  233. package/src/maps/ChoroplethLayer.ts +2 -1
  234. package/src/maps/ClusterLayer.ts +3 -1
  235. package/src/maps/DirectMapDataSource.ts +12 -3
  236. package/src/maps/EditPopupComponent.ts +2 -1
  237. package/src/maps/GridLayer.ts +5 -3
  238. package/src/maps/GridLayerDesigner.tsx +0 -1
  239. package/src/maps/LayerSwitcherComponent.tsx +1 -1
  240. package/src/maps/MapComponent.ts +3 -3
  241. package/src/maps/MapDesign.ts +2 -17
  242. package/src/maps/{MapFiltersDesignerComponent.ts → MapFiltersDesignerComponent.tsx} +25 -25
  243. package/src/maps/MarkersLayer.ts +38 -41
  244. package/src/maps/RasterMapViewComponent.ts +3 -3
  245. package/src/maps/ServerMapDataSource.ts +8 -8
  246. package/src/maps/VectorMapViewComponent.tsx +2 -2
  247. package/src/maps/mapSymbols.ts +2 -0
  248. package/src/maps/symbols/font-awesome/cloud-rain.png +0 -0
  249. package/src/maps/vectorMaps.tsx +88 -74
  250. package/src/quickfilter/QuickfilterCompiler.ts +1 -1
  251. package/src/quickfilter/QuickfiltersComponent.ts +3 -3
  252. package/src/richtext/DropdownPaletteItem.tsx +144 -0
  253. package/src/richtext/FontColorPaletteItem.tsx +160 -0
  254. package/src/richtext/ItemsHtmlConverter.ts +15 -5
  255. package/src/richtext/RichTextComponent.tsx +274 -232
  256. package/src/valueFormatter.ts +5 -1
  257. package/src/wellknown.ts +286 -0
  258. package/src/widgets/DropdownWidgetComponent.tsx +75 -0
  259. package/src/widgets/MapWidget.ts +5 -2
  260. package/src/widgets/TOCWidget.ts +2 -1
  261. package/src/widgets/Widget.ts +3 -0
  262. package/src/widgets/WidgetDataSource.ts +3 -1
  263. package/src/widgets/charts/Chart.ts +1 -1
  264. package/src/widgets/charts/ChartViewComponent.ts +16 -3
  265. package/src/widgets/charts/ChartWidget.ts +3 -275
  266. package/src/widgets/charts/ChartWidgetComponent.tsx +281 -0
  267. package/src/widgets/charts/calendar/CalendarChartViewComponent.tsx +4 -4
  268. package/src/widgets/charts/layered/LayeredChart.ts +4 -6
  269. package/src/widgets/charts/layered/LayeredChartCompiler.ts +80 -63
  270. package/src/widgets/charts/layered/LayeredChartDesign.ts +7 -1
  271. package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +43 -10
  272. package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +6 -6
  273. package/src/widgets/charts/layered/LayeredChartViewComponent.ts +140 -88
  274. package/src/widgets/charts/pivot/IntersectionDesignerComponent.tsx +305 -221
  275. package/src/widgets/charts/pivot/PivotChart.ts +56 -18
  276. package/src/widgets/charts/pivot/PivotChartDesign.ts +12 -0
  277. package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +4 -3
  278. package/src/widgets/charts/pivot/PivotChartLayoutBuilder.ts +39 -76
  279. package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +0 -1
  280. package/src/widgets/charts/pivot/PivotChartQueryBuilder.ts +230 -189
  281. package/src/widgets/charts/pivot/PivotChartUtils.ts +4 -4
  282. package/src/widgets/charts/pivot/{PivotChartViewComponent.ts → PivotChartViewComponent.tsx} +86 -89
  283. package/src/widgets/charts/table/TableChart.ts +8 -4
  284. package/src/widgets/charts/table/TableChartDesignerComponent.ts +4 -4
  285. package/src/widgets/charts/table/TableChartViewComponent.ts +32 -19
  286. package/src/widgets/text/TextComponent.tsx +47 -49
  287. package/src/widgets/text/TextWidget.ts +8 -3
  288. package/src/widgets/text/TextWidgetComponent.tsx +249 -0
  289. package/src/widgets/text/TextWidgetDesign.ts +26 -2
  290. package/src/ColorComponent.ts +0 -117
  291. package/src/dashboards/DashboardViewComponent.ts +0 -304
  292. package/src/dashboards/SettingsModalComponent.ts +0 -169
  293. package/src/dashboards/layoutOptions.ts +0 -40
  294. package/src/layout-styles.css +0 -263
  295. package/src/layouts/blocks/BlocksDisplayComponent.ts +0 -461
  296. package/src/layouts/grid/GridLayoutComponent.ts +0 -67
  297. package/src/layouts/grid/GridLayoutManager.ts +0 -185
  298. package/src/layouts/grid/LegoLayoutEngine.ts +0 -142
  299. package/src/layouts/grid/PaletteItemComponent.ts +0 -28
  300. package/src/layouts/grid/README.md +0 -14
  301. package/src/layouts/grid/WidgetContainerComponent.ts +0 -420
  302. package/src/richtext/FontColorPaletteItem.ts +0 -172
  303. package/src/richtext/FontSizePaletteItem.ts +0 -110
  304. package/src/widgets/DropdownWidgetComponent.ts +0 -78
  305. package/src/widgets/text/TextWidgetComponent.ts +0 -120
@@ -1,169 +0,0 @@
1
- import PropTypes from "prop-types"
2
- import _ from "lodash"
3
- import React from "react"
4
- const R = React.createElement
5
- import update from "update-object"
6
- import { languages } from "../languages"
7
- import * as ui from "@mwater/react-library/lib/bootstrap"
8
- import { default as ReactSelect } from "react-select"
9
- import * as DashboardUtils from "./DashboardUtils"
10
- import ActionCancelModalComponent from "@mwater/react-library/lib/ActionCancelModalComponent"
11
- import QuickfiltersDesignComponent from "../quickfilter/QuickfiltersDesignComponent"
12
- import FiltersDesignerComponent from "../FiltersDesignerComponent"
13
- import { DataSource, Schema } from "@mwater/expressions"
14
-
15
- export interface SettingsModalComponentProps {
16
- onDesignChange: any
17
- schema: Schema
18
- dataSource: DataSource
19
- }
20
-
21
- interface SettingsModalComponentState {
22
- design: any
23
- }
24
-
25
- // Popup with settings for dashboard
26
- export default class SettingsModalComponent extends React.Component<
27
- SettingsModalComponentProps,
28
- SettingsModalComponentState
29
- > {
30
- static contextTypes = { globalFiltersElementFactory: PropTypes.func }
31
-
32
- constructor(props: any) {
33
- super(props)
34
- this.state = {
35
- design: null // Set when being edited
36
- }
37
- }
38
-
39
- show(design: any) {
40
- return this.setState({ design })
41
- }
42
-
43
- handleSave = () => {
44
- this.props.onDesignChange(this.state.design)
45
- return this.setState({ design: null })
46
- }
47
-
48
- handleCancel = () => {
49
- return this.setState({ design: null })
50
- }
51
- handleDesignChange = (design: any) => {
52
- return this.setState({ design })
53
- }
54
-
55
- handleFiltersChange = (filters: any) => {
56
- const design = _.extend({}, this.state.design, { filters })
57
- return this.handleDesignChange(design)
58
- }
59
-
60
- handleGlobalFiltersChange = (globalFilters: any) => {
61
- const design = _.extend({}, this.state.design, { globalFilters })
62
- return this.handleDesignChange(design)
63
- }
64
-
65
- render() {
66
- // Don't show if not editing
67
- if (!this.state.design) {
68
- return null
69
- }
70
-
71
- // Get filterable tables
72
- const filterableTables = DashboardUtils.getFilterableTables(this.state.design, this.props.schema)
73
-
74
- const localeOptions = _.map(languages, (language) => {
75
- return {
76
- value: language.code,
77
- label: language.en + " (" + language.name + ")"
78
- }
79
- })
80
-
81
- return R(
82
- ActionCancelModalComponent,
83
- {
84
- size: "large",
85
- onCancel: this.handleCancel,
86
- onAction: this.handleSave
87
- },
88
- R(
89
- "div",
90
- { style: { paddingBottom: 200 } },
91
- R("h4", null, "Quick Filters"),
92
- R(
93
- "div",
94
- { className: "text-muted" },
95
- "Quick filters are shown to the user as a dropdown at the top of the dashboard and can be used to filter data of widgets."
96
- ),
97
-
98
- filterableTables.length > 0
99
- ? R(QuickfiltersDesignComponent, {
100
- design: this.state.design.quickfilters || [],
101
- onDesignChange: (design: any) =>
102
- this.handleDesignChange(update(this.state.design, { quickfilters: { $set: design } })),
103
- schema: this.props.schema,
104
- dataSource: this.props.dataSource,
105
- tables: filterableTables
106
- })
107
- : "Nothing to quickfilter. Add widgets to the dashboard",
108
-
109
- R("h4", { style: { paddingTop: 10 } }, "Filters"),
110
- R(
111
- "div",
112
- { className: "text-muted" },
113
- "Filters are built in to the dashboard and cannot be changed by viewers of the dashboard."
114
- ),
115
-
116
- filterableTables.length > 0
117
- ? R(FiltersDesignerComponent, {
118
- schema: this.props.schema,
119
- dataSource: this.props.dataSource,
120
- filters: this.state.design.filters,
121
- onFiltersChange: this.handleFiltersChange,
122
- filterableTables
123
- })
124
- : "Nothing to filter. Add widgets to the dashboard",
125
-
126
- this.context.globalFiltersElementFactory
127
- ? R(
128
- "div",
129
- null,
130
- R("h4", { style: { paddingTop: 10 } }, "Global Filters"),
131
-
132
- this.context.globalFiltersElementFactory({
133
- schema: this.props.schema,
134
- dataSource: this.props.dataSource,
135
- filterableTables,
136
- globalFilters: this.state.design.globalFilters || [],
137
- onChange: this.handleGlobalFiltersChange
138
- })
139
- )
140
- : undefined,
141
-
142
- R("h4", { style: { paddingTop: 10 } }, "Language"),
143
- R(
144
- "div",
145
- { className: "text-muted" },
146
- "Controls the preferred language of widgets and uses specified language when available"
147
- ),
148
-
149
- R(ReactSelect, {
150
- value: _.findWhere(localeOptions, { value: this.state.design.locale || "en" }) || null,
151
- options: localeOptions,
152
- onChange: (locale: any) =>
153
- this.handleDesignChange(update(this.state.design, { locale: { $set: locale.value } }))
154
- }),
155
-
156
- R("h4", { style: { paddingTop: 10 } }, "Advanced"),
157
- R(
158
- ui.Checkbox,
159
- {
160
- value: this.state.design.implicitFiltersEnabled != null ? this.state.design.implicitFiltersEnabled : true,
161
- onChange: (value) =>
162
- this.handleDesignChange(update(this.state.design, { implicitFiltersEnabled: { $set: value } }))
163
- },
164
- "Enable Implicit Filtering (leave unchecked for new dashboards)"
165
- )
166
- )
167
- )
168
- }
169
- }
@@ -1,40 +0,0 @@
1
- import { DashboardDesign } from "./DashboardDesign"
2
-
3
- export type DashboardTheme = "default" | "greybg" | "story"
4
-
5
- /** Width buckets for dashboards */
6
- export type WidthBucket = "sm" | "md" | "lg" | "xl"
7
-
8
- export interface BlocksLayoutOptions {
9
- /** Width at which to collapse columns. Null to not collapse */
10
- collapseColumnsWidth: number | null
11
-
12
- /** Width below which scales or scrolls */
13
- minimumWidth: number | null
14
-
15
- /** What to do when below minimum width */
16
- belowMinimumWidth: "scale" | "scroll"
17
-
18
- /** Width above which pads */
19
- maximumWidth: number | null
20
-
21
- /** Width at which to hide quickfilters. Null for never */
22
- hideQuickfiltersWidth: number | null
23
- }
24
-
25
- /** Get default layout options for a theme */
26
- export function getDefaultLayoutOptions(theme?: DashboardTheme | undefined): BlocksLayoutOptions {
27
- theme = theme || "default"
28
-
29
- return {
30
- collapseColumnsWidth: 600,
31
- minimumWidth: theme == "story" ? 400 : 600,
32
- belowMinimumWidth: "scale",
33
- maximumWidth: theme == "story" ? 1000 : 1600,
34
- hideQuickfiltersWidth: 600
35
- }
36
- }
37
-
38
- export function getLayoutOptions(design: DashboardDesign): BlocksLayoutOptions {
39
- return design.layoutOptions || getDefaultLayoutOptions(design.style)
40
- }
@@ -1,263 +0,0 @@
1
- /* TEXT WIDGET STYLES */
2
- .mwater-visualization-text-widget-style-default {
3
- font-size: 15px;
4
- }
5
-
6
- .mwater-visualization-text-widget-style-default div:not(:first-child) {
7
- margin-top: 5px;
8
- }
9
-
10
- .mwater-visualization-text-widget-style-default h1:not(:first-child) {
11
- margin-top: 10px;
12
- }
13
-
14
- .mwater-visualization-text-widget-style-default h2:not(:first-child) {
15
- margin-top: 8px;
16
- }
17
-
18
- .mwater-visualization-text-widget-style-default h3:not(:first-child) {
19
- margin-top: 5px;
20
- }
21
-
22
- .mwater-visualization-text-widget-style-default h1 {
23
- font-size: 19px;
24
- margin: 0px;
25
- font-family: inherit;
26
- font-weight: normal;
27
- line-height: 1.2;
28
- color: inherit;
29
- }
30
-
31
- .mwater-visualization-text-widget-style-default h2 {
32
- font-size: 17px;
33
- margin: 0px;
34
- font-family: inherit;
35
- font-weight: normal;
36
- line-height: 1.2;
37
- color: inherit;
38
- }
39
-
40
- /* h3 is deprecated */
41
- .mwater-visualization-text-widget-style-default h3 {
42
- font-size: 15px;
43
- margin: 0px;
44
- font-weight: bold;
45
- font-family: inherit;
46
- line-height: 1.2;
47
- color: inherit;
48
- }
49
-
50
- .mwater-visualization-text-widget-style-title {
51
- font-size: 25px;
52
- }
53
-
54
- /* For InlineExprEditorComponent */
55
- .mwater-visualization-text-widget-expr {
56
- cursor: pointer;
57
- border-radius: 2px;
58
- padding-left: 2px;
59
- padding-right: 2px;
60
- background-color: rgba(212, 235, 255, 0.8);
61
- }
62
-
63
- .mwater-visualization-block-parent-inner {
64
- height: 100%;
65
- }
66
-
67
- /*
68
- There are several styles of block layouts:
69
- default: dashboard look
70
- popup: allows narrow for popups
71
- greybg: dashboard look with grey background
72
- story: story-style (large text, fixed width)
73
- */
74
-
75
- /* DEFAULT */
76
- .mwater-visualization-block-parent-outer-default {
77
- padding: 20px;
78
- }
79
-
80
- .mwater-visualization-block-parent-inner-default {
81
- margin-left: auto;
82
- margin-right: auto;
83
- padding: 10px;
84
- /* min-width: 1000px;
85
- max-width: 1800px; */
86
- }
87
-
88
- .mwater-visualization-block-parent-outer-default .mwater-visualization-block {
89
- padding-left: 15px;
90
- padding-right: 15px;
91
- padding-bottom: 15px;
92
- }
93
-
94
- /* POPUP */
95
- .mwater-visualization-block-parent-outer-popup {
96
- }
97
-
98
- .mwater-visualization-block-parent-inner-popup {
99
- padding: 30px;
100
- }
101
-
102
- .mwater-visualization-block-parent-outer-popup .mwater-visualization-block {
103
- padding-left: 15px;
104
- padding-right: 15px;
105
- padding-bottom: 15px;
106
- }
107
-
108
- /* GREYBG */
109
- .mwater-visualization-block-parent-outer-greybg {
110
- background-color: #ddd;
111
- }
112
-
113
- .mwater-visualization-block-parent-inner-greybg {
114
- margin-left: auto;
115
- margin-right: auto;
116
- padding: 10px;
117
-
118
- /* Special workaround for CSS fill issues */
119
- min-height: 100%;
120
- height: 1px;
121
- }
122
-
123
- /* Special workaround for CSS fill issues: cancel for print */
124
- @media print {
125
- .mwater-visualization-block-parent-inner-greybg {
126
- height: auto;
127
- min-height: auto;
128
- }
129
-
130
- /* Add a border on printing */
131
- .mwater-visualization-block-parent-outer-greybg .mwater-visualization-block {
132
- border: solid 1px #aaa;
133
- }
134
- }
135
-
136
- .mwater-visualization-block-parent-outer-greybg .mwater-visualization-block {
137
- margin: 9px;
138
- padding: 8px;
139
- border-radius: 5px;
140
- background-color: white;
141
- }
142
-
143
- .mwater-visualization-block-parent-outer-greybg .mwater-visualization-block-spacer {
144
- background-color: #ddd;
145
- }
146
-
147
- /* STORY */
148
- .mwater-visualization-block-parent-outer-story {
149
- padding: 20px;
150
- }
151
-
152
- .mwater-visualization-block-parent-inner-story {
153
- padding: 10px;
154
- margin-left: auto;
155
- margin-right: auto;
156
- }
157
-
158
- .mwater-visualization-block-parent-outer-story .mwater-visualization-block {
159
- padding-left: 15px;
160
- padding-right: 15px;
161
- padding-bottom: 15px;
162
- }
163
-
164
- .mwater-visualization-block-parent-outer-story .mwater-visualization-text-widget-style-default {
165
- font-family: Georgia, Cambria, "Times New Roman", Times, serif;
166
- font-size: 20px;
167
- color: #333;
168
- font-style: normal;
169
- font-weight: normal;
170
- word-wrap: break-word;
171
- -webkit-font-smoothing: antialiased;
172
- line-height: 33px;
173
- }
174
-
175
- .mwater-visualization-block-parent-outer-story .mwater-visualization-text-widget-style-default div:not(:first-child) {
176
- margin-top: 8px;
177
- }
178
-
179
- .mwater-visualization-block-parent-outer-story .mwater-visualization-text-widget-style-default ul {
180
- line-height: 28px;
181
- }
182
-
183
- .mwater-visualization-block-parent-outer-story .mwater-visualization-text-widget-style-default h1 {
184
- font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Arial, sans-serif;
185
- font-size: 32px;
186
- font-weight: 700;
187
- margin-top: 40px;
188
- color: black;
189
- }
190
-
191
- .mwater-visualization-block-parent-outer-story .mwater-visualization-text-widget-style-default h2 {
192
- font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Arial, sans-serif;
193
- font-size: 24px;
194
- font-weight: 700;
195
- margin-top: 30px;
196
- color: black;
197
- }
198
-
199
- /* h3 is deprecated */
200
- .mwater-visualization-block-parent-outer-story .mwater-visualization-text-widget-style-default h3 {
201
- font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Arial, sans-serif;
202
- font-size: 20px;
203
- font-weight: bold;
204
- margin-top: 20px;
205
- color: black;
206
- }
207
-
208
- .mwater-visualization-block-parent-outer-story .mwater-visualization-text-widget-style-title {
209
- font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Arial, sans-serif;
210
- font-size: 38px;
211
- font-weight: bold;
212
- }
213
-
214
- @media only screen and (max-width: 1000px) {
215
- /* Fill screen when small */
216
- .mwater-visualization-block-parent-outer-story.mwater-visualization-block-viewing
217
- .mwater-visualization-horizontal-block-item {
218
- width: 100% !important;
219
- }
220
-
221
- /* Hide spacers when small */
222
- .mwater-visualization-block-parent-outer-story.mwater-visualization-block-viewing .mwater-visualization-block-spacer {
223
- display: none;
224
- }
225
- }
226
-
227
- /* Used for TextWidgets inside of other widgets */
228
- .mwater-visualization-text-widget-style-header {
229
- font-size: 14px;
230
- font-weight: 600;
231
- text-align: center;
232
- }
233
-
234
- .mwater-visualization-text-widget-style-footer {
235
- font-size: 13px;
236
- text-align: center;
237
- }
238
-
239
- .mwater-visualization-widget-placeholder {
240
- position: absolute;
241
- bottom: 0;
242
- left: 0px;
243
- right: 0px;
244
- text-align: center;
245
- top: 0;
246
- cursor: pointer;
247
- background: #f8f8f8;
248
- }
249
-
250
- .mwater-visualization-widget-placeholder .fa,
251
- .mwater-visualization-widget-placeholder .glyphicon {
252
- position: absolute;
253
- top: 50%;
254
- left: 50%;
255
- transform: translate(-50%, -50%);
256
- color: #e0e0e0;
257
- font-size: 60px;
258
- }
259
-
260
- .mwater-visualization-widget-placeholder:hover .fa,
261
- .mwater-visualization-widget-placeholder:hover .glyphicon {
262
- color: #c0c0c0;
263
- }