cx 26.2.1 → 26.2.3

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 (324) hide show
  1. package/build/charts/Chart.d.ts.map +1 -1
  2. package/build/charts/Chart.js +5 -4
  3. package/build/charts/ColumnBarBase.d.ts +3 -3
  4. package/build/charts/ColumnBarBase.d.ts.map +1 -1
  5. package/build/charts/ColumnBarBase.js +1 -1
  6. package/build/charts/Legend.d.ts.map +1 -1
  7. package/build/charts/Legend.js +11 -4
  8. package/build/charts/Marker.d.ts +3 -3
  9. package/build/charts/Marker.d.ts.map +1 -1
  10. package/build/charts/MarkerLine.d.ts +7 -7
  11. package/build/charts/MarkerLine.d.ts.map +1 -1
  12. package/build/charts/MarkerLine.js +14 -10
  13. package/build/charts/PieChart.d.ts +4 -4
  14. package/build/charts/PieChart.d.ts.map +1 -1
  15. package/build/charts/PieChart.js +36 -14
  16. package/build/charts/PieLabel.d.ts.map +1 -1
  17. package/build/charts/PieLabel.js +2 -1
  18. package/build/charts/RangeMarker.d.ts +3 -3
  19. package/build/charts/RangeMarker.d.ts.map +1 -1
  20. package/build/charts/RangeMarker.js +1 -1
  21. package/build/charts/axis/TimeAxis.d.ts +3 -3
  22. package/build/charts/axis/TimeAxis.d.ts.map +1 -1
  23. package/build/charts/axis/TimeAxis.js +70 -21
  24. package/build/charts/helpers/ValueAtFinder.d.ts +1 -1
  25. package/build/charts/helpers/ValueAtFinder.d.ts.map +1 -1
  26. package/build/charts/helpers/ValueAtFinder.js +5 -2
  27. package/build/data/StructuredSelector.js +3 -4
  28. package/build/data/createAccessorModelProxy.d.ts +6 -11
  29. package/build/data/createAccessorModelProxy.d.ts.map +1 -1
  30. package/build/data/createAccessorModelProxy.js +1 -3
  31. package/build/svg/Ellipse.d.ts +5 -4
  32. package/build/svg/Ellipse.d.ts.map +1 -1
  33. package/build/svg/Ellipse.js +9 -6
  34. package/build/svg/Line.d.ts +1 -0
  35. package/build/svg/Line.d.ts.map +1 -1
  36. package/build/svg/Line.js +4 -1
  37. package/build/svg/Text.d.ts +12 -6
  38. package/build/svg/Text.d.ts.map +1 -1
  39. package/build/svg/Text.js +12 -4
  40. package/build/ui/Controller.d.ts +2 -0
  41. package/build/ui/Controller.d.ts.map +1 -1
  42. package/build/ui/Controller.js +3 -0
  43. package/build/ui/HoverSync.d.ts.map +1 -1
  44. package/build/ui/HoverSync.js +7 -2
  45. package/build/ui/Prop.d.ts +1 -1
  46. package/build/ui/Prop.d.ts.map +1 -1
  47. package/build/ui/Text.d.ts +3 -3
  48. package/build/ui/Text.d.ts.map +1 -1
  49. package/build/ui/Text.js +5 -5
  50. package/build/ui/adapter/GroupAdapter.d.ts.map +1 -1
  51. package/build/ui/adapter/GroupAdapter.js +20 -10
  52. package/build/ui/app/History.js +1 -1
  53. package/build/widgets/List.d.ts.map +1 -1
  54. package/build/widgets/List.js +6 -7
  55. package/build/widgets/drag-drop/DropZone.d.ts +3 -3
  56. package/build/widgets/drag-drop/DropZone.d.ts.map +1 -1
  57. package/build/widgets/form/Calendar.d.ts.map +1 -1
  58. package/build/widgets/form/Calendar.js +30 -11
  59. package/build/widgets/form/ColorField.d.ts.map +1 -1
  60. package/build/widgets/form/ColorField.js +16 -7
  61. package/build/widgets/form/DateTimeField.d.ts.map +1 -1
  62. package/build/widgets/form/DateTimeField.js +23 -10
  63. package/build/widgets/form/Field.d.ts +2 -0
  64. package/build/widgets/form/Field.d.ts.map +1 -1
  65. package/build/widgets/form/Field.js +11 -5
  66. package/build/widgets/form/LookupField.d.ts +1 -1
  67. package/build/widgets/form/LookupField.d.ts.map +1 -1
  68. package/build/widgets/form/LookupField.js +6 -6
  69. package/build/widgets/form/MonthField.d.ts.map +1 -1
  70. package/build/widgets/form/MonthField.js +15 -7
  71. package/build/widgets/form/MonthPicker.d.ts +1 -2
  72. package/build/widgets/form/MonthPicker.d.ts.map +1 -1
  73. package/build/widgets/form/MonthPicker.js +84 -41
  74. package/build/widgets/form/NumberField.d.ts +2 -0
  75. package/build/widgets/form/NumberField.d.ts.map +1 -1
  76. package/build/widgets/form/NumberField.js +45 -15
  77. package/build/widgets/form/TextField.d.ts +1 -9
  78. package/build/widgets/form/TextField.d.ts.map +1 -1
  79. package/build/widgets/form/TextField.js +1 -1
  80. package/build/widgets/grid/Grid.d.ts +2 -2
  81. package/build/widgets/grid/Grid.d.ts.map +1 -1
  82. package/build/widgets/grid/Grid.js +9 -4
  83. package/build/widgets/grid/Pagination.d.ts.map +1 -1
  84. package/build/widgets/grid/Pagination.js +4 -4
  85. package/build/widgets/grid/TreeNode.d.ts.map +1 -1
  86. package/build/widgets/grid/TreeNode.js +10 -2
  87. package/build/widgets/icons/folder.d.ts.map +1 -1
  88. package/build/widgets/icons/folder.js +1 -0
  89. package/build/widgets/icons/forward.d.ts.map +1 -1
  90. package/build/widgets/icons/forward.js +4 -3
  91. package/build/widgets/icons/loading.d.ts.map +1 -1
  92. package/build/widgets/icons/loading.js +6 -5
  93. package/build/widgets/icons/square.d.ts.map +1 -1
  94. package/build/widgets/icons/square.js +3 -3
  95. package/build/widgets/index.d.ts +3 -1
  96. package/build/widgets/index.d.ts.map +1 -1
  97. package/build/widgets/index.js +3 -1
  98. package/build/widgets/overlay/ContextMenu.d.ts.map +1 -1
  99. package/build/widgets/overlay/ContextMenu.js +2 -0
  100. package/build/widgets/overlay/Dropdown.d.ts +2 -1
  101. package/build/widgets/overlay/Dropdown.d.ts.map +1 -1
  102. package/build/widgets/overlay/Dropdown.js +75 -20
  103. package/build/widgets/overlay/MsgBox.d.ts +1 -0
  104. package/build/widgets/overlay/MsgBox.d.ts.map +1 -1
  105. package/build/widgets/overlay/MsgBox.js +2 -2
  106. package/build/widgets/overlay/Overlay.d.ts +32 -2
  107. package/build/widgets/overlay/Overlay.d.ts.map +1 -1
  108. package/build/widgets/overlay/Overlay.js +47 -16
  109. package/build/widgets/overlay/Toast.d.ts +1 -1
  110. package/build/widgets/overlay/Toast.d.ts.map +1 -1
  111. package/build/widgets/overlay/Toast.js +4 -1
  112. package/build/widgets/overlay/Tooltip.d.ts +6 -0
  113. package/build/widgets/overlay/Tooltip.d.ts.map +1 -1
  114. package/build/widgets/overlay/Tooltip.js +24 -9
  115. package/build/widgets/overlay/Window.d.ts.map +1 -1
  116. package/build/widgets/overlay/Window.js +24 -9
  117. package/dist/charts.css +325 -272
  118. package/dist/charts.js +11 -5
  119. package/dist/data.js +2 -2
  120. package/dist/manifest.js +892 -880
  121. package/dist/svg.css +14 -8
  122. package/dist/svg.js +9 -1
  123. package/dist/ui.js +29 -16
  124. package/dist/widgets.css +997 -294
  125. package/dist/widgets.js +317 -121
  126. package/package.json +1 -1
  127. package/src/charts/Bar.scss +13 -10
  128. package/src/charts/BarGraph.scss +31 -29
  129. package/src/charts/BubbleGraph.scss +11 -8
  130. package/src/charts/Chart.ts +5 -3
  131. package/src/charts/Column.scss +13 -10
  132. package/src/charts/ColumnBarBase.tsx +255 -230
  133. package/src/charts/ColumnGraph.scss +13 -11
  134. package/src/charts/Gridlines.scss +10 -8
  135. package/src/charts/Legend.scss +57 -50
  136. package/src/charts/Legend.tsx +257 -213
  137. package/src/charts/LegendEntry.scss +35 -29
  138. package/src/charts/LineGraph.scss +28 -25
  139. package/src/charts/Marker.scss +12 -10
  140. package/src/charts/Marker.tsx +3 -2
  141. package/src/charts/MarkerLine.scss +11 -8
  142. package/src/charts/MarkerLine.tsx +196 -177
  143. package/src/charts/PieChart.scss +12 -9
  144. package/src/charts/PieChart.tsx +717 -591
  145. package/src/charts/PieLabel.tsx +99 -81
  146. package/src/charts/Range.scss +11 -8
  147. package/src/charts/RangeMarker.tsx +204 -187
  148. package/src/charts/ScatterGraph.scss +12 -9
  149. package/src/charts/axis/Axis.scss +6 -5
  150. package/src/charts/axis/CategoryAxis.scss +10 -8
  151. package/src/charts/axis/NumericAxis.scss +9 -6
  152. package/src/charts/axis/TimeAxis.scss +9 -6
  153. package/src/charts/axis/TimeAxis.tsx +753 -637
  154. package/src/charts/axis/index.scss +4 -5
  155. package/src/charts/axis/variables.scss +4 -2
  156. package/src/charts/helpers/ValueAtFinder.ts +19 -5
  157. package/src/charts/index.scss +16 -19
  158. package/src/charts/maps.scss +0 -0
  159. package/src/charts/palette.scss +11 -31
  160. package/src/charts/palette.variables.scss +23 -0
  161. package/src/charts/variables.scss +35 -3
  162. package/src/data/StructuredSelector.ts +2 -2
  163. package/src/data/createAccessorModelProxy.ts +66 -74
  164. package/src/index.scss +5 -6
  165. package/src/maps.scss +5 -0
  166. package/src/svg/Ellipse.tsx +62 -55
  167. package/src/svg/Line.tsx +57 -42
  168. package/src/svg/Svg.scss +6 -6
  169. package/src/svg/Text.scss +19 -0
  170. package/src/svg/Text.tsx +172 -116
  171. package/src/svg/index.scss +3 -2
  172. package/src/svg/maps.scss +0 -0
  173. package/src/svg/variables.scss +0 -0
  174. package/src/ui/Container.spec.ts +59 -0
  175. package/src/ui/Controller.spec.tsx +30 -0
  176. package/src/ui/Controller.ts +5 -0
  177. package/src/ui/HoverSync.tsx +179 -147
  178. package/src/ui/Prop.ts +1 -1
  179. package/src/ui/Text.ts +12 -9
  180. package/src/ui/adapter/GroupAdapter.spec.ts +42 -0
  181. package/src/ui/adapter/GroupAdapter.ts +25 -14
  182. package/src/ui/app/History.ts +1 -1
  183. package/src/ui/index.scss +1 -1
  184. package/src/ui/layout/LabelsLeftLayout.scss +5 -7
  185. package/src/ui/layout/LabelsTopLayout.scss +4 -6
  186. package/src/ui/layout/index.scss +2 -3
  187. package/src/ui/maps.scss +0 -0
  188. package/src/ui/variables.scss +1 -2
  189. package/src/util/index.scss +4 -2
  190. package/src/util/maps.scss +1 -0
  191. package/src/util/scss/besm.scss +15 -0
  192. package/src/util/scss/calc.scss +103 -11
  193. package/src/util/scss/defaults.scss +24 -0
  194. package/src/util/scss/elements.scss +78 -0
  195. package/src/util/scss/global.scss +15 -0
  196. package/src/util/scss/include.scss +17 -9
  197. package/src/util/scss/index.scss +1 -9
  198. package/src/util/scss/maps.scss +2 -0
  199. package/src/util/scss/pad-size.scss +9 -0
  200. package/src/util/scss/padding.scss +6 -0
  201. package/src/util/scss/screen-size.scss +5 -0
  202. package/src/util/scss/variables.scss +6 -0
  203. package/src/util/variables.scss +1 -0
  204. package/src/variables.scss +5 -217
  205. package/src/widgets/Button.maps.scss +103 -0
  206. package/src/widgets/Button.scss +33 -9
  207. package/src/widgets/Button.variables.scss +8 -104
  208. package/src/widgets/CxCredit.scss +2 -0
  209. package/src/widgets/FlexBox.scss +16 -11
  210. package/src/widgets/Heading.scss +6 -0
  211. package/src/widgets/HighlightedSearchText.scss +8 -1
  212. package/src/widgets/Icon.scss +6 -0
  213. package/src/widgets/List.scss +7 -0
  214. package/src/widgets/List.tsx +6 -7
  215. package/src/widgets/ProgressBar.scss +9 -0
  216. package/src/widgets/Resizer.scss +9 -7
  217. package/src/widgets/Section.scss +53 -56
  218. package/src/widgets/animations.scss +4 -2
  219. package/src/widgets/box.scss +47 -0
  220. package/src/widgets/drag-drop/DragClone.scss +12 -4
  221. package/src/widgets/drag-drop/DragHandle.scss +12 -6
  222. package/src/widgets/drag-drop/DragSource.scss +12 -6
  223. package/src/widgets/drag-drop/DropZone.scss +9 -0
  224. package/src/widgets/drag-drop/DropZone.tsx +3 -3
  225. package/src/widgets/drag-drop/index.scss +4 -4
  226. package/src/widgets/drag-drop/maps.scss +7 -0
  227. package/src/widgets/drag-drop/variables.scss +8 -5
  228. package/src/widgets/form/Calendar.maps.scss +54 -0
  229. package/src/widgets/form/Calendar.scss +49 -11
  230. package/src/widgets/form/Calendar.tsx +755 -653
  231. package/src/widgets/form/Calendar.variables.scss +3 -46
  232. package/src/widgets/form/Checkbox.maps.scss +34 -0
  233. package/src/widgets/form/Checkbox.scss +14 -3
  234. package/src/widgets/form/Checkbox.variables.scss +4 -36
  235. package/src/widgets/form/ColorField.scss +21 -2
  236. package/src/widgets/form/ColorField.tsx +485 -431
  237. package/src/widgets/form/ColorPicker.maps.scss +21 -0
  238. package/src/widgets/form/ColorPicker.scss +26 -9
  239. package/src/widgets/form/ColorPicker.variables.scss +3 -16
  240. package/src/widgets/form/DateTimeField.scss +54 -21
  241. package/src/widgets/form/DateTimeField.tsx +697 -615
  242. package/src/widgets/form/DateTimePicker.scss +14 -4
  243. package/src/widgets/form/Field.maps.scss +122 -0
  244. package/src/widgets/form/Field.scss +54 -18
  245. package/src/widgets/form/Field.tsx +611 -504
  246. package/src/widgets/form/Field.variables.scss +46 -0
  247. package/src/widgets/form/HelpText.scss +8 -5
  248. package/src/widgets/form/Label.scss +10 -3
  249. package/src/widgets/form/LookupField.maps.scss +26 -0
  250. package/src/widgets/form/LookupField.scss +54 -24
  251. package/src/widgets/form/LookupField.tsx +25 -21
  252. package/src/widgets/form/MonthField.scss +48 -26
  253. package/src/widgets/form/MonthField.tsx +645 -567
  254. package/src/widgets/form/MonthPicker.maps.scss +50 -0
  255. package/src/widgets/form/MonthPicker.scss +44 -35
  256. package/src/widgets/form/MonthPicker.tsx +954 -724
  257. package/src/widgets/form/MonthPicker.variables.scss +24 -0
  258. package/src/widgets/form/NumberField.scss +19 -2
  259. package/src/widgets/form/NumberField.tsx +576 -466
  260. package/src/widgets/form/Radio.maps.scss +36 -0
  261. package/src/widgets/form/Radio.scss +12 -2
  262. package/src/widgets/form/Radio.variables.scss +3 -42
  263. package/src/widgets/form/Select.scss +25 -9
  264. package/src/widgets/form/Slider.scss +23 -14
  265. package/src/widgets/form/Switch.scss +18 -8
  266. package/src/widgets/form/TextArea.scss +14 -1
  267. package/src/widgets/form/TextField.scss +24 -3
  268. package/src/widgets/form/TextField.tsx +9 -21
  269. package/src/widgets/form/UploadButton.scss +14 -6
  270. package/src/widgets/form/ValidationError.scss +10 -6
  271. package/src/widgets/form/Wheel.scss +14 -4
  272. package/src/widgets/form/index.scss +22 -24
  273. package/src/widgets/form/maps.scss +81 -0
  274. package/src/widgets/form/variables.scss +111 -355
  275. package/src/widgets/grid/Grid.scss +19 -2
  276. package/src/widgets/grid/Grid.spec.ts +42 -0
  277. package/src/widgets/grid/Grid.tsx +15 -7
  278. package/src/widgets/grid/Pagination.scss +11 -2
  279. package/src/widgets/grid/Pagination.tsx +110 -102
  280. package/src/widgets/grid/TreeNode.scss +25 -8
  281. package/src/widgets/grid/TreeNode.tsx +127 -116
  282. package/src/widgets/grid/index.scss +3 -4
  283. package/src/widgets/grid/maps.scss +110 -0
  284. package/src/widgets/grid/variables.scss +48 -137
  285. package/src/widgets/icons/folder.tsx +1 -2
  286. package/src/widgets/icons/forward.tsx +23 -20
  287. package/src/widgets/icons/loading.tsx +22 -19
  288. package/src/widgets/icons/square.tsx +20 -17
  289. package/src/widgets/index.scss +16 -16
  290. package/src/widgets/index.ts +63 -58
  291. package/src/widgets/lists.scss +42 -0
  292. package/src/widgets/maps.scss +139 -0
  293. package/src/widgets/nav/Link.scss +14 -1
  294. package/src/widgets/nav/Menu.scss +13 -7
  295. package/src/widgets/nav/Menu.variables.scss +1 -12
  296. package/src/widgets/nav/MenuItem.scss +21 -6
  297. package/src/widgets/nav/Scroller.scss +11 -2
  298. package/src/widgets/nav/Tab.maps.scss +78 -0
  299. package/src/widgets/nav/Tab.scss +12 -6
  300. package/src/widgets/nav/Tab.variables.scss +7 -76
  301. package/src/widgets/nav/cover.scss +6 -4
  302. package/src/widgets/nav/index.scss +6 -6
  303. package/src/widgets/nav/maps.scss +32 -0
  304. package/src/widgets/nav/variables.scss +4 -11
  305. package/src/widgets/overlay/ContextMenu.ts +3 -0
  306. package/src/widgets/overlay/Dropdown.scss +47 -16
  307. package/src/widgets/overlay/Dropdown.tsx +851 -676
  308. package/src/widgets/overlay/MsgBox.tsx +125 -111
  309. package/src/widgets/overlay/Overlay.scss +60 -40
  310. package/src/widgets/overlay/Overlay.tsx +948 -800
  311. package/src/widgets/overlay/Toast.scss +42 -34
  312. package/src/widgets/overlay/Toast.ts +11 -1
  313. package/src/widgets/overlay/Tooltip.scss +27 -96
  314. package/src/widgets/overlay/Tooltip.tsx +376 -309
  315. package/src/widgets/overlay/Window.maps.scss +51 -0
  316. package/src/widgets/overlay/Window.scss +17 -17
  317. package/src/widgets/overlay/Window.tsx +291 -236
  318. package/src/widgets/overlay/Window.variables.scss +2 -43
  319. package/src/widgets/overlay/index.d.ts +11 -11
  320. package/src/widgets/overlay/index.scss +6 -15
  321. package/src/widgets/overlay/maps.scss +44 -0
  322. package/src/widgets/overlay/variables.scss +11 -42
  323. package/src/widgets/variables.scss +33 -117
  324. package/src/global.scss +0 -14
@@ -2,7 +2,11 @@
2
2
 
3
3
  import { VDOM } from "../ui/Widget";
4
4
  import { StyledContainerBase, StyledContainerConfig } from "../ui/Container";
5
- import { tooltipMouseMove, tooltipMouseLeave, TooltipParentInstance } from "../widgets/overlay/tooltip-ops";
5
+ import {
6
+ tooltipMouseMove,
7
+ tooltipMouseLeave,
8
+ TooltipParentInstance,
9
+ } from "../widgets/overlay/tooltip-ops";
6
10
  import { Selection } from "../ui/selection/Selection";
7
11
  import { withHoverSync } from "../ui/HoverSync";
8
12
  import { Prop, BooleanProp, NumberProp, StringProp } from "../ui/Prop";
@@ -12,261 +16,282 @@ import { Rect } from "../svg/util/Rect";
12
16
  import type { ChartRenderingContext } from "./Chart";
13
17
 
14
18
  export interface ColumnBarBaseConfig extends StyledContainerConfig {
15
- /** The `x` value binding or expression. */
16
- x?: Prop<string | number>;
19
+ /** The `x` value binding or expression. */
20
+ x?: Prop<string | number | null>;
17
21
 
18
- /** The `y` value binding or expression. */
19
- y?: Prop<string | number>;
22
+ /** The `y` value binding or expression. */
23
+ y?: Prop<string | number | null>;
20
24
 
21
- disabled?: BooleanProp;
25
+ disabled?: BooleanProp;
22
26
 
23
- /** Index of a color from the standard palette of colors. 0-15. */
24
- colorIndex?: NumberProp;
27
+ /** Index of a color from the standard palette of colors. 0-15. */
28
+ colorIndex?: NumberProp;
25
29
 
26
- /** Used to automatically assign a color based on the `name` and the contextual `ColorMap` widget. */
27
- colorMap?: StringProp;
30
+ /** Used to automatically assign a color based on the `name` and the contextual `ColorMap` widget. */
31
+ colorMap?: StringProp;
28
32
 
29
- /** Name used to resolve the color. If not provided, `name` is used instead. */
30
- colorName?: StringProp;
33
+ /** Name used to resolve the color. If not provided, `name` is used instead. */
34
+ colorName?: StringProp;
31
35
 
32
- /** Name of the item as it will appear in the legend. */
33
- name?: StringProp;
36
+ /** Name of the item as it will appear in the legend. */
37
+ name?: StringProp;
34
38
 
35
- /** Used to indicate if an item is active or not. Inactive items are shown only in the legend. */
36
- active?: BooleanProp;
39
+ /** Used to indicate if an item is active or not. Inactive items are shown only in the legend. */
40
+ active?: BooleanProp;
37
41
 
38
- /** Indicate that columns should be stacked on top of the other columns. Default value is `false`. */
39
- stacked?: BooleanProp;
42
+ /** Indicate that columns should be stacked on top of the other columns. Default value is `false`. */
43
+ stacked?: BooleanProp;
40
44
 
41
- /** Name of the stack. If multiple stacks are used, each should have a unique name. Default value is `stack`. */
42
- stack?: StringProp;
45
+ /** Name of the stack. If multiple stacks are used, each should have a unique name. Default value is `stack`. */
46
+ stack?: StringProp;
43
47
 
44
- /** Of center offset of the column. Use this in combination with `size` to align multiple series on the same chart. */
45
- offset?: NumberProp;
48
+ /** Of center offset of the column. Use this in combination with `size` to align multiple series on the same chart. */
49
+ offset?: NumberProp;
46
50
 
47
- /** Border radius of the column/bar. */
48
- borderRadius?: NumberProp;
51
+ /** Border radius of the column/bar. */
52
+ borderRadius?: NumberProp;
49
53
 
50
- /**
51
- * Name of the horizontal axis. The value should match one of the horizontal axes set
52
- * in the `axes` configuration of the parent `Chart` component. Default value is `x`.
53
- */
54
- xAxis?: string;
54
+ /**
55
+ * Name of the horizontal axis. The value should match one of the horizontal axes set
56
+ * in the `axes` configuration of the parent `Chart` component. Default value is `x`.
57
+ */
58
+ xAxis?: string;
55
59
 
56
- /**
57
- * Name of the vertical axis. The value should match one of the vertical axes set
58
- * in the `axes` configuration if the parent `Chart` component. Default value is `y`.
59
- */
60
- yAxis?: string;
60
+ /**
61
+ * Name of the vertical axis. The value should match one of the vertical axes set
62
+ * in the `axes` configuration if the parent `Chart` component. Default value is `y`.
63
+ */
64
+ yAxis?: string;
61
65
 
62
- /** Name of the legend to be used. Default is `legend`. Set to `false` to hide the legend entry. */
63
- legend?: string | false;
66
+ /** Name of the legend to be used. Default is `legend`. Set to `false` to hide the legend entry. */
67
+ legend?: string | false;
64
68
 
65
- legendAction?: string;
66
- legendShape?: string;
69
+ legendAction?: string;
70
+ legendShape?: string;
67
71
 
68
- /** A value used to identify the group of components participating in hover effect synchronization. */
69
- hoverChannel?: string;
72
+ /** A value used to identify the group of components participating in hover effect synchronization. */
73
+ hoverChannel?: string;
70
74
 
71
- /** A value used to uniquely identify the record within the hover sync group. */
72
- hoverId?: StringProp;
75
+ /** A value used to uniquely identify the record within the hover sync group. */
76
+ hoverId?: StringProp | NumberProp;
73
77
 
74
- /** Hide the bar/column rect. Used for stacked series where only top bar should be visible. */
75
- hidden?: BooleanProp;
78
+ /** Hide the bar/column rect. Used for stacked series where only top bar should be visible. */
79
+ hidden?: BooleanProp;
76
80
 
77
- selection?: any;
81
+ selection?: any;
78
82
 
79
- tooltip?: any;
83
+ tooltip?: any;
80
84
  }
81
85
 
82
86
  export interface ColumnBarBaseInstance extends Instance, TooltipParentInstance {
83
- axes: Record<string, any>;
84
- xAxis: any;
85
- yAxis: any;
86
- hoverSync: any;
87
- colorMap: any;
88
- bounds: Rect;
87
+ axes: Record<string, any>;
88
+ xAxis: any;
89
+ yAxis: any;
90
+ hoverSync: any;
91
+ colorMap: any;
92
+ bounds: Rect;
89
93
  }
90
94
 
91
95
  export class ColumnBarBase extends StyledContainerBase<ColumnBarBaseConfig> {
92
- declare baseClass: string;
93
- declare xAxis: string;
94
- declare yAxis: string;
95
- declare offset: number;
96
- declare legend: string | false;
97
- declare legendAction: string;
98
- declare active: boolean;
99
- declare stacked: boolean;
100
- declare stack: string;
101
- declare legendShape: string;
102
- declare hoverChannel: string;
103
- declare borderRadius: number;
104
- declare hidden: boolean;
105
- declare selection: Selection;
106
- declare tooltip: any;
107
-
108
- constructor(config: ColumnBarBaseConfig) {
109
- super(config);
110
- }
111
-
112
- init(): void {
113
- this.selection = Selection.create(this.selection);
114
- super.init();
115
- }
116
-
117
- declareData(...args: any[]): any {
118
- var selection = this.selection.configureWidget(this);
119
-
120
- return super.declareData(
121
- selection,
122
- {
123
- x: undefined,
124
- y: undefined,
125
- style: { structured: true },
126
- class: { structured: true },
127
- className: { structured: true },
128
- disabled: undefined,
129
- colorIndex: undefined,
130
- colorMap: undefined,
131
- colorName: undefined,
132
- name: undefined,
133
- active: true,
134
- stacked: undefined,
135
- stack: undefined,
136
- offset: undefined,
137
- hoverId: undefined,
138
- borderRadius: undefined,
139
- hidden: undefined,
140
- },
141
- ...args,
142
- );
143
- }
144
-
145
- prepareData(context: ChartRenderingContext, instance: ColumnBarBaseInstance): void {
146
- instance.axes = context.axes!;
147
- instance.xAxis = context.axes![this.xAxis];
148
- instance.yAxis = context.axes![this.yAxis];
149
- instance.hoverSync = context.hoverSync;
150
- var { data } = instance;
151
- data.valid = this.checkValid(data);
152
- if (!data.colorName && data.name) data.colorName = data.name;
153
- super.prepareData(context, instance);
154
- }
155
-
156
- checkValid(data: any): boolean {
157
- return true;
158
- }
159
-
160
- prepare(context: ChartRenderingContext, instance: ColumnBarBaseInstance): void {
161
- let { data, colorMap } = instance;
162
-
163
- if (colorMap && data.colorName) {
164
- data.colorIndex = colorMap.map(data.colorName);
165
- if (instance.cache("colorIndex", data.colorIndex)) instance.markShouldUpdate(context);
166
- }
167
-
168
- if (!data.valid) return;
169
-
170
- if (data.active) {
171
- instance.bounds = this.calculateRect(instance);
172
- instance.cache("bounds", instance.bounds);
173
- if (!instance.bounds.isEqual(instance.cached.bounds)) instance.markShouldUpdate(context);
174
-
175
- context.push("parentRect", instance.bounds);
176
- if (instance.xAxis.shouldUpdate || instance.yAxis.shouldUpdate) instance.markShouldUpdate(context);
177
- }
178
-
179
- if (data.name && context.addLegendEntry)
180
- context.addLegendEntry(this.legend, {
181
- name: data.name,
182
- active: data.active,
183
- colorIndex: data.colorIndex,
184
- disabled: data.disabled,
185
- selected: this.selection.isInstanceSelected(instance),
186
- style: data.style,
187
- shape: this.legendShape,
188
- onClick: (e: MouseEvent) => {
189
- this.onLegendClick(e, instance);
190
- },
191
- });
192
- }
193
-
194
- prepareCleanup(context: ChartRenderingContext, instance: ColumnBarBaseInstance): void {
195
- let { data } = instance;
196
- if (data.valid && data.active) context.pop("parentRect");
197
- }
198
-
199
- onLegendClick(e: MouseEvent, instance: ColumnBarBaseInstance): void {
200
- var allActions = this.legendAction == "auto";
201
- var { data } = instance;
202
- if (allActions || this.legendAction == "toggle") if (instance.set("active", !data.active)) return;
203
-
204
- if (allActions || this.legendAction == "select") this.handleClick(e, instance);
205
- }
206
-
207
- calculateRect(instance: ColumnBarBaseInstance): Rect {
208
- throw new Error("Abstract method.");
209
- }
210
-
211
- render(context: RenderingContext, instance: ColumnBarBaseInstance, key: string): React.ReactNode {
212
- let { data, bounds } = instance;
213
-
214
- if (!data.active || !data.valid) return null;
215
-
216
- return withHoverSync(
217
- key,
218
- instance.hoverSync,
219
- this.hoverChannel,
220
- data.hoverId,
221
- ({ hover, onMouseMove, onMouseLeave, key }: any) => {
222
- var stateMods: Record<string, any> = {
223
- selected: this.selection.isInstanceSelected(instance),
224
- disabled: data.disabled,
225
- selectable: !this.selection.isDummy,
226
- ["color-" + data.colorIndex]: data.colorIndex != null,
227
- hover,
228
- };
229
-
230
- return (
231
- <g className={data.classNames} key={key}>
232
- {!data.hidden && (
233
- <rect
234
- className={this.CSS.element(this.baseClass, "rect", stateMods)}
235
- style={data.style}
236
- x={bounds.l}
237
- y={bounds.t}
238
- width={bounds.width()}
239
- height={bounds.height()}
240
- rx={data.borderRadius}
241
- onMouseMove={(e) => {
242
- onMouseMove(e, instance);
243
- tooltipMouseMove(e, instance, this.tooltip);
244
- }}
245
- onMouseLeave={(e) => {
246
- onMouseLeave(e, instance);
247
- tooltipMouseLeave(e, instance, this.tooltip);
248
- }}
249
- onClick={(e) => {
250
- this.handleClick(e, instance);
251
- }}
252
- />
253
- )}
254
- {this.renderChildren(context, instance)}
255
- </g>
256
- );
257
- },
258
- );
259
- }
260
-
261
- handleClick(e: MouseEvent | React.MouseEvent, instance: ColumnBarBaseInstance): void {
262
- if (!this.selection.isDummy) {
263
- this.selection.selectInstance(instance, {
264
- toggle: e.ctrlKey,
265
- });
266
- e.stopPropagation();
267
- e.preventDefault();
268
- }
269
- }
96
+ declare baseClass: string;
97
+ declare xAxis: string;
98
+ declare yAxis: string;
99
+ declare offset: number;
100
+ declare legend: string | false;
101
+ declare legendAction: string;
102
+ declare active: boolean;
103
+ declare stacked: boolean;
104
+ declare stack: string;
105
+ declare legendShape: string;
106
+ declare hoverChannel: string;
107
+ declare borderRadius: number;
108
+ declare hidden: boolean;
109
+ declare selection: Selection;
110
+ declare tooltip: any;
111
+
112
+ constructor(config: ColumnBarBaseConfig) {
113
+ super(config);
114
+ }
115
+
116
+ init(): void {
117
+ this.selection = Selection.create(this.selection);
118
+ super.init();
119
+ }
120
+
121
+ declareData(...args: any[]): any {
122
+ var selection = this.selection.configureWidget(this);
123
+
124
+ return super.declareData(
125
+ selection,
126
+ {
127
+ x: undefined,
128
+ y: undefined,
129
+ style: { structured: true },
130
+ class: { structured: true },
131
+ className: { structured: true },
132
+ disabled: undefined,
133
+ colorIndex: undefined,
134
+ colorMap: undefined,
135
+ colorName: undefined,
136
+ name: undefined,
137
+ active: true,
138
+ stacked: undefined,
139
+ stack: undefined,
140
+ offset: undefined,
141
+ hoverId: undefined,
142
+ borderRadius: undefined,
143
+ hidden: undefined,
144
+ },
145
+ ...args,
146
+ );
147
+ }
148
+
149
+ prepareData(
150
+ context: ChartRenderingContext,
151
+ instance: ColumnBarBaseInstance,
152
+ ): void {
153
+ instance.axes = context.axes!;
154
+ instance.xAxis = context.axes![this.xAxis];
155
+ instance.yAxis = context.axes![this.yAxis];
156
+ instance.hoverSync = context.hoverSync;
157
+ var { data } = instance;
158
+ data.valid = this.checkValid(data);
159
+ if (!data.colorName && data.name) data.colorName = data.name;
160
+ super.prepareData(context, instance);
161
+ }
162
+
163
+ checkValid(data: any): boolean {
164
+ return true;
165
+ }
166
+
167
+ prepare(
168
+ context: ChartRenderingContext,
169
+ instance: ColumnBarBaseInstance,
170
+ ): void {
171
+ let { data, colorMap } = instance;
172
+
173
+ if (colorMap && data.colorName) {
174
+ data.colorIndex = colorMap.map(data.colorName);
175
+ if (instance.cache("colorIndex", data.colorIndex))
176
+ instance.markShouldUpdate(context);
177
+ }
178
+
179
+ if (!data.valid) return;
180
+
181
+ if (data.active) {
182
+ instance.bounds = this.calculateRect(instance);
183
+ instance.cache("bounds", instance.bounds);
184
+ if (!instance.bounds.isEqual(instance.cached.bounds))
185
+ instance.markShouldUpdate(context);
186
+
187
+ context.push("parentRect", instance.bounds);
188
+ if (instance.xAxis.shouldUpdate || instance.yAxis.shouldUpdate)
189
+ instance.markShouldUpdate(context);
190
+ }
191
+
192
+ if (data.name && context.addLegendEntry)
193
+ context.addLegendEntry(this.legend, {
194
+ name: data.name,
195
+ active: data.active,
196
+ colorIndex: data.colorIndex,
197
+ disabled: data.disabled,
198
+ selected: this.selection.isInstanceSelected(instance),
199
+ style: data.style,
200
+ shape: this.legendShape,
201
+ onClick: (e: MouseEvent) => {
202
+ this.onLegendClick(e, instance);
203
+ },
204
+ });
205
+ }
206
+
207
+ prepareCleanup(
208
+ context: ChartRenderingContext,
209
+ instance: ColumnBarBaseInstance,
210
+ ): void {
211
+ let { data } = instance;
212
+ if (data.valid && data.active) context.pop("parentRect");
213
+ }
214
+
215
+ onLegendClick(e: MouseEvent, instance: ColumnBarBaseInstance): void {
216
+ var allActions = this.legendAction == "auto";
217
+ var { data } = instance;
218
+ if (allActions || this.legendAction == "toggle")
219
+ if (instance.set("active", !data.active)) return;
220
+
221
+ if (allActions || this.legendAction == "select")
222
+ this.handleClick(e, instance);
223
+ }
224
+
225
+ calculateRect(instance: ColumnBarBaseInstance): Rect {
226
+ throw new Error("Abstract method.");
227
+ }
228
+
229
+ render(
230
+ context: RenderingContext,
231
+ instance: ColumnBarBaseInstance,
232
+ key: string,
233
+ ): React.ReactNode {
234
+ let { data, bounds } = instance;
235
+
236
+ if (!data.active || !data.valid) return null;
237
+
238
+ return withHoverSync(
239
+ key,
240
+ instance.hoverSync,
241
+ this.hoverChannel,
242
+ data.hoverId,
243
+ ({ hover, onMouseMove, onMouseLeave, key }: any) => {
244
+ var stateMods: Record<string, any> = {
245
+ selected: this.selection.isInstanceSelected(instance),
246
+ disabled: data.disabled,
247
+ selectable: !this.selection.isDummy,
248
+ ["color-" + data.colorIndex]: data.colorIndex != null,
249
+ hover,
250
+ };
251
+
252
+ return (
253
+ <g className={data.classNames} key={key}>
254
+ {!data.hidden && (
255
+ <rect
256
+ className={this.CSS.element(this.baseClass, "rect", stateMods)}
257
+ style={data.style}
258
+ x={bounds.l}
259
+ y={bounds.t}
260
+ width={bounds.width()}
261
+ height={bounds.height()}
262
+ rx={data.borderRadius}
263
+ onMouseMove={(e) => {
264
+ onMouseMove(e, instance);
265
+ tooltipMouseMove(e, instance, this.tooltip);
266
+ }}
267
+ onMouseLeave={(e) => {
268
+ onMouseLeave(e, instance);
269
+ tooltipMouseLeave(e, instance, this.tooltip);
270
+ }}
271
+ onClick={(e) => {
272
+ this.handleClick(e, instance);
273
+ }}
274
+ />
275
+ )}
276
+ {this.renderChildren(context, instance)}
277
+ </g>
278
+ );
279
+ },
280
+ );
281
+ }
282
+
283
+ handleClick(
284
+ e: MouseEvent | React.MouseEvent,
285
+ instance: ColumnBarBaseInstance,
286
+ ): void {
287
+ if (!this.selection.isDummy) {
288
+ this.selection.selectInstance(instance, {
289
+ toggle: e.ctrlKey,
290
+ });
291
+ e.stopPropagation();
292
+ e.preventDefault();
293
+ }
294
+ }
270
295
  }
271
296
 
272
297
  ColumnBarBase.prototype.xAxis = "x";
@@ -1,30 +1,32 @@
1
+ @use "sass:math";
2
+ @use "../util/scss/besm.scss" as *;
3
+ @use "../util/scss/include.scss" as *;
4
+ @use "../util/scss/add-rules.scss" as *;
5
+ @use "../util/scss/clockwise.scss" as *;
6
+ @use "./variables" as *;
1
7
 
2
8
  @use "sass:map";
3
9
 
4
- @mixin cx-columngraph(
5
- $name: 'columngraph',
6
- $besm: $cx-besm
7
- ) {
10
+ @mixin cx-columngraph($name: "columngraph", $besm: $cx-besm) {
8
11
  $block: map.get($besm, block);
9
12
  $element: map.get($besm, element);
10
13
  $state: map.get($besm, state);
11
14
 
12
15
  .#{$element}#{$name}-column {
13
- stroke-width: 1px;
14
- fill: #eee;
15
- stroke: #ccc;
16
+ stroke-width: $cx-default-chart-shape-stroke-width;
17
+ fill: $cx-default-chart-shape-fill-color;
18
+ stroke: $cx-default-chart-shape-stroke-color;
16
19
 
17
20
  &.#{$state}selectable {
18
21
  cursor: pointer;
19
22
  }
20
23
 
21
24
  &.#{$state}selected {
22
- stroke-width: 2px;
25
+ stroke-width: $cx-default-chart-selected-stroke-width;
23
26
  }
24
27
  }
25
28
  }
26
29
 
27
-
28
- @if (cx-should-include('cx/charts/ColumnGraph')) {
30
+ @if (cx-should-include("cx/charts/ColumnGraph")) {
29
31
  @include cx-columngraph();
30
- }
32
+ }
@@ -1,10 +1,12 @@
1
-
1
+ @use "sass:math";
2
2
  @use "sass:map";
3
+ @use "../util/scss/besm.scss" as *;
4
+ @use "../util/scss/include.scss" as *;
5
+ @use "../util/scss/add-rules.scss" as *;
6
+ @use "../util/scss/clockwise.scss" as *;
7
+ @use "./variables" as *;
3
8
 
4
- @mixin cx-gridlines(
5
- $name: 'gridlines',
6
- $besm: $cx-besm
7
- ) {
9
+ @mixin cx-gridlines($name: "gridlines", $besm: $cx-besm) {
8
10
  $block: map.get($besm, block);
9
11
  $element: map.get($besm, element);
10
12
  $state: map.get($besm, state);
@@ -13,13 +15,13 @@
13
15
  shape-rendering: crispEdges;
14
16
 
15
17
  path {
16
- stroke: rgba(128, 128, 128, 0.15);
18
+ stroke: $cx-default-chart-gridline-color;
17
19
  fill: none;
18
20
  stroke-width: 1;
19
21
  }
20
22
  }
21
23
  }
22
24
 
23
- @if (cx-should-include('cx/charts/Gridlines')) {
25
+ @if (cx-should-include("cx/charts/Gridlines")) {
24
26
  @include cx-gridlines();
25
- }
27
+ }