@sis-cc/dotstatsuite-visions 6.6.0 → 6.6.4

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 (293) hide show
  1. package/es/Alert/Alert.js +135 -66
  2. package/es/Alert/index.js +1 -0
  3. package/es/ApiQueries/ApiQueries.js +79 -45
  4. package/es/ApiQueries/Query.js +105 -65
  5. package/es/ApiQueries/index.js +1 -0
  6. package/es/AuthDialog/index.js +103 -62
  7. package/es/Breadcrumbs/Breadcrumbs.js +38 -21
  8. package/es/Breadcrumbs/index.js +1 -0
  9. package/es/Button/Button.js +28 -11
  10. package/es/Button/index.js +1 -0
  11. package/es/ChartsConfig/Axis.js +76 -72
  12. package/es/ChartsConfig/ButtonGroup.js +51 -29
  13. package/es/ChartsConfig/ChartsConfig.js +187 -87
  14. package/es/ChartsConfig/ContainerTitle.js +36 -15
  15. package/es/ChartsConfig/Focus.js +48 -37
  16. package/es/ChartsConfig/Frequency.js +36 -24
  17. package/es/ChartsConfig/Series.js +43 -28
  18. package/es/ChartsConfig/Size.js +50 -36
  19. package/es/ChartsConfig/index.js +1 -0
  20. package/es/ChartsConfig/styles.js +4 -4
  21. package/es/ChartsConfig/utils.js +5 -1
  22. package/es/Chips/Chips.js +154 -99
  23. package/es/Chips/index.js +1 -0
  24. package/es/CollapseButtons/CollapseButtons.js +101 -61
  25. package/es/CollapseButtons/Item.js +70 -45
  26. package/es/CollapseButtons/Paper.js +21 -7
  27. package/es/CollapseButtons/index.js +1 -0
  28. package/es/DataEdit/DataEdit.js +124 -67
  29. package/es/DataEdit/Input.js +58 -27
  30. package/es/DataEdit/index.js +1 -0
  31. package/es/DataFooter/DataFooter.js +115 -68
  32. package/es/DataFooter/index.js +1 -0
  33. package/es/DataHeader/DataHeader.js +113 -75
  34. package/es/DataHeader/Flags.js +21 -8
  35. package/es/DataHeader/Title.js +15 -2
  36. package/es/DataHeader/TooltipHeader.js +63 -33
  37. package/es/DataHeader/index.js +1 -0
  38. package/es/DataHeader/utils.js +8 -8
  39. package/es/Dataflow/Dataflow.js +226 -132
  40. package/es/Dataflow/index.js +1 -0
  41. package/es/ExpansionPanel/ExpansionPanel.js +79 -42
  42. package/es/ExpansionPanel/index.js +1 -0
  43. package/es/ExpansionPanel/styles.js +5 -3
  44. package/es/Icons/AccessibilityFilled.js +8 -6
  45. package/es/Icons/AccessibilityOutlined.js +8 -6
  46. package/es/Icons/AccountFilled.js +8 -6
  47. package/es/Icons/AccountOutlined.js +8 -6
  48. package/es/Icons/Api.js +8 -6
  49. package/es/Icons/Asterisk.js +8 -6
  50. package/es/Icons/Bar.js +8 -6
  51. package/es/Icons/CopyContent.js +8 -6
  52. package/es/Icons/Cross.js +8 -6
  53. package/es/Icons/HSymbol.js +8 -6
  54. package/es/Icons/Row.js +8 -6
  55. package/es/Icons/Scatter.js +8 -6
  56. package/es/Icons/StackedBar.js +8 -6
  57. package/es/Icons/StackedRow.js +8 -6
  58. package/es/Icons/Timeline.js +8 -6
  59. package/es/Icons/VSymbol.js +8 -6
  60. package/es/Icons/Warning.js +14 -11
  61. package/es/Icons/index.js +1 -0
  62. package/es/Input/Input.js +56 -26
  63. package/es/Input/index.js +1 -0
  64. package/es/Input/with-input.js +25 -30
  65. package/es/InputNumber/InputNumber.js +51 -31
  66. package/es/InputNumber/index.js +1 -0
  67. package/es/LabelDivider/LabelDivider.js +18 -7
  68. package/es/LabelDivider/index.js +1 -0
  69. package/es/Loading/Loading.js +18 -9
  70. package/es/Loading/index.js +1 -0
  71. package/es/Logo/Logo.js +17 -11
  72. package/es/Logo/index.js +1 -0
  73. package/es/NoData/NoData.js +25 -17
  74. package/es/NoData/index.js +1 -0
  75. package/es/Pagination/Pagination.js +114 -70
  76. package/es/Pagination/index.js +1 -0
  77. package/es/PeriodPicker/PeriodPicker.js +124 -101
  78. package/es/PeriodPicker/constants.js +13 -78
  79. package/es/PeriodPicker/index.js +1 -0
  80. package/es/PeriodPicker/lib.js +23 -37
  81. package/es/PeriodPicker/styles.js +1 -0
  82. package/es/ScopeList/Header.js +60 -41
  83. package/es/ScopeList/Item.js +144 -98
  84. package/es/ScopeList/ScopeList.js +184 -132
  85. package/es/ScopeList/Selection.js +93 -51
  86. package/es/ScopeList/index.js +1 -0
  87. package/es/ScopeList/styles.js +3 -2
  88. package/es/ScopeList/with-scope-list.js +88 -151
  89. package/es/Select/Select.js +60 -44
  90. package/es/Select/index.js +1 -0
  91. package/es/Share/Form.js +88 -58
  92. package/es/Share/Mode.js +98 -36
  93. package/es/Share/Share.js +64 -41
  94. package/es/Share/index.js +10 -1
  95. package/es/SisccFooter/SisccFooter.js +36 -29
  96. package/es/SisccFooter/index.js +1 -0
  97. package/es/Spotlight/Fields.js +71 -37
  98. package/es/Spotlight/Spotlight.js +92 -51
  99. package/es/Spotlight/index.js +1 -0
  100. package/es/Spotlight/useSpotlight.js +13 -33
  101. package/es/Spotlight/useStyles.js +4 -2
  102. package/es/Table/Table.js +71 -50
  103. package/es/Table/header.js +50 -36
  104. package/es/Table/index.js +1 -0
  105. package/es/Table/itemCell.js +25 -13
  106. package/es/Table/row-header.js +50 -31
  107. package/es/Table/section-header.js +55 -30
  108. package/es/Table/section-rows.js +62 -38
  109. package/es/Table/styles.js +8 -2
  110. package/es/Table/tableCell.js +17 -7
  111. package/es/Table/tooltip.js +41 -21
  112. package/es/Table/useStyles.js +3 -2
  113. package/es/Table/valueCell.js +41 -26
  114. package/es/TableFooter/TableFooter.js +70 -42
  115. package/es/TableFooter/index.js +1 -0
  116. package/es/TableHeader/TableHeader.js +36 -18
  117. package/es/TableHeader/index.js +1 -0
  118. package/es/TableHtml5/TableHtml5.js +72 -60
  119. package/es/TableHtml5/cell.js +55 -35
  120. package/es/TableHtml5/flags.js +58 -29
  121. package/es/TableHtml5/header.js +85 -53
  122. package/es/TableHtml5/index.js +1 -0
  123. package/es/TableHtml5/section.js +131 -86
  124. package/es/TableHtml5/sectionHeader.js +72 -45
  125. package/es/TableHtml5/subHeader.js +70 -47
  126. package/es/TableLayout/Box.js +66 -33
  127. package/es/TableLayout/DnDItem.js +68 -37
  128. package/es/TableLayout/TableLayout.js +177 -105
  129. package/es/TableLayout/constants.js +2 -0
  130. package/es/TableLayout/index.js +1 -0
  131. package/es/TableLayout/lib.js +3 -1
  132. package/es/TablePreview/TablePreview.js +176 -99
  133. package/es/TablePreview/index.js +1 -0
  134. package/es/TablePreview/lib.js +4 -5
  135. package/es/TablePreview/styles.js +1 -0
  136. package/es/Tag/Tag.js +21 -5
  137. package/es/Tag/index.js +1 -0
  138. package/es/ToggleButton/ToggleButton.js +29 -17
  139. package/es/ToggleButton/index.js +1 -0
  140. package/es/Tooltip/Tooltip.js +32 -20
  141. package/es/Tooltip/index.js +1 -0
  142. package/es/VerticalButton/VerticalButton.js +22 -17
  143. package/es/VerticalButton/index.js +1 -0
  144. package/es/index.js +4 -2
  145. package/es/theme.js +14 -22
  146. package/es/utils.js +14 -16
  147. package/lib/Alert/Alert.js +168 -87
  148. package/lib/Alert/index.js +12 -7
  149. package/lib/ApiQueries/ApiQueries.js +105 -61
  150. package/lib/ApiQueries/Query.js +132 -85
  151. package/lib/ApiQueries/index.js +12 -7
  152. package/lib/AuthDialog/index.js +137 -82
  153. package/lib/Breadcrumbs/Breadcrumbs.js +68 -39
  154. package/lib/Breadcrumbs/index.js +12 -7
  155. package/lib/Button/Button.js +47 -28
  156. package/lib/Button/index.js +12 -7
  157. package/lib/ChartsConfig/Axis.js +100 -88
  158. package/lib/ChartsConfig/ButtonGroup.js +74 -43
  159. package/lib/ChartsConfig/ChartsConfig.js +236 -113
  160. package/lib/ChartsConfig/ContainerTitle.js +59 -30
  161. package/lib/ChartsConfig/Focus.js +71 -53
  162. package/lib/ChartsConfig/Frequency.js +59 -39
  163. package/lib/ChartsConfig/Series.js +70 -45
  164. package/lib/ChartsConfig/Size.js +77 -53
  165. package/lib/ChartsConfig/index.js +12 -7
  166. package/lib/ChartsConfig/styles.js +11 -16
  167. package/lib/ChartsConfig/utils.js +13 -14
  168. package/lib/Chips/Chips.js +192 -122
  169. package/lib/Chips/index.js +12 -7
  170. package/lib/CollapseButtons/CollapseButtons.js +134 -84
  171. package/lib/CollapseButtons/Item.js +98 -64
  172. package/lib/CollapseButtons/Paper.js +41 -19
  173. package/lib/CollapseButtons/index.js +12 -7
  174. package/lib/DataEdit/DataEdit.js +156 -88
  175. package/lib/DataEdit/Input.js +82 -42
  176. package/lib/DataEdit/index.js +12 -7
  177. package/lib/DataFooter/DataFooter.js +144 -88
  178. package/lib/DataFooter/index.js +12 -7
  179. package/lib/DataHeader/DataHeader.js +158 -106
  180. package/lib/DataHeader/Flags.js +34 -18
  181. package/lib/DataHeader/Title.js +27 -11
  182. package/lib/DataHeader/TooltipHeader.js +79 -48
  183. package/lib/DataHeader/index.js +12 -7
  184. package/lib/DataHeader/utils.js +10 -16
  185. package/lib/Dataflow/Dataflow.js +277 -159
  186. package/lib/Dataflow/index.js +12 -7
  187. package/lib/ExpansionPanel/ExpansionPanel.js +116 -63
  188. package/lib/ExpansionPanel/index.js +12 -7
  189. package/lib/ExpansionPanel/styles.js +12 -15
  190. package/lib/Icons/AccessibilityFilled.js +17 -15
  191. package/lib/Icons/AccessibilityOutlined.js +17 -15
  192. package/lib/Icons/AccountFilled.js +17 -15
  193. package/lib/Icons/AccountOutlined.js +17 -15
  194. package/lib/Icons/Api.js +17 -15
  195. package/lib/Icons/Asterisk.js +17 -15
  196. package/lib/Icons/Bar.js +17 -15
  197. package/lib/Icons/CopyContent.js +17 -15
  198. package/lib/Icons/Cross.js +17 -15
  199. package/lib/Icons/HSymbol.js +17 -15
  200. package/lib/Icons/Row.js +17 -15
  201. package/lib/Icons/Scatter.js +17 -15
  202. package/lib/Icons/StackedBar.js +17 -15
  203. package/lib/Icons/StackedRow.js +17 -15
  204. package/lib/Icons/Timeline.js +17 -15
  205. package/lib/Icons/VSymbol.js +17 -15
  206. package/lib/Icons/Warning.js +31 -27
  207. package/lib/Icons/index.js +152 -68
  208. package/lib/Input/Input.js +85 -47
  209. package/lib/Input/index.js +12 -7
  210. package/lib/Input/with-input.js +35 -38
  211. package/lib/InputNumber/InputNumber.js +80 -50
  212. package/lib/InputNumber/index.js +12 -7
  213. package/lib/LabelDivider/LabelDivider.js +37 -23
  214. package/lib/LabelDivider/index.js +12 -7
  215. package/lib/Loading/Loading.js +35 -20
  216. package/lib/Loading/index.js +12 -7
  217. package/lib/Logo/Logo.js +28 -20
  218. package/lib/Logo/index.js +12 -7
  219. package/lib/NoData/NoData.js +42 -28
  220. package/lib/NoData/index.js +12 -7
  221. package/lib/Pagination/Pagination.js +150 -91
  222. package/lib/Pagination/index.js +12 -7
  223. package/lib/PeriodPicker/PeriodPicker.js +150 -121
  224. package/lib/PeriodPicker/constants.js +37 -126
  225. package/lib/PeriodPicker/index.js +12 -7
  226. package/lib/PeriodPicker/lib.js +61 -99
  227. package/lib/PeriodPicker/styles.js +4 -7
  228. package/lib/ScopeList/Header.js +88 -58
  229. package/lib/ScopeList/Item.js +177 -116
  230. package/lib/ScopeList/ScopeList.js +234 -160
  231. package/lib/ScopeList/Selection.js +131 -70
  232. package/lib/ScopeList/index.js +12 -7
  233. package/lib/ScopeList/styles.js +9 -10
  234. package/lib/ScopeList/with-scope-list.js +108 -199
  235. package/lib/Select/Select.js +80 -59
  236. package/lib/Select/index.js +12 -7
  237. package/lib/Share/Form.js +119 -77
  238. package/lib/Share/Mode.js +130 -54
  239. package/lib/Share/Share.js +91 -59
  240. package/lib/Share/index.js +12 -7
  241. package/lib/SisccFooter/SisccFooter.js +63 -44
  242. package/lib/SisccFooter/index.js +12 -7
  243. package/lib/Spotlight/Fields.js +100 -54
  244. package/lib/Spotlight/Spotlight.js +136 -75
  245. package/lib/Spotlight/index.js +12 -7
  246. package/lib/Spotlight/useSpotlight.js +20 -44
  247. package/lib/Spotlight/useStyles.js +12 -15
  248. package/lib/Table/Table.js +102 -69
  249. package/lib/Table/header.js +70 -51
  250. package/lib/Table/index.js +12 -7
  251. package/lib/Table/itemCell.js +41 -25
  252. package/lib/Table/row-header.js +75 -49
  253. package/lib/Table/section-header.js +82 -50
  254. package/lib/Table/section-rows.js +94 -60
  255. package/lib/Table/styles.js +25 -23
  256. package/lib/Table/tableCell.js +37 -19
  257. package/lib/Table/tooltip.js +54 -36
  258. package/lib/Table/useStyles.js +8 -11
  259. package/lib/Table/valueCell.js +59 -39
  260. package/lib/TableFooter/TableFooter.js +93 -57
  261. package/lib/TableFooter/index.js +12 -7
  262. package/lib/TableHeader/TableHeader.js +56 -32
  263. package/lib/TableHeader/index.js +12 -7
  264. package/lib/TableHtml5/TableHtml5.js +100 -78
  265. package/lib/TableHtml5/cell.js +84 -52
  266. package/lib/TableHtml5/flags.js +82 -48
  267. package/lib/TableHtml5/header.js +115 -70
  268. package/lib/TableHtml5/index.js +17 -8
  269. package/lib/TableHtml5/section.js +171 -109
  270. package/lib/TableHtml5/sectionHeader.js +102 -64
  271. package/lib/TableHtml5/subHeader.js +98 -65
  272. package/lib/TableLayout/Box.js +97 -54
  273. package/lib/TableLayout/DnDItem.js +98 -58
  274. package/lib/TableLayout/TableLayout.js +232 -140
  275. package/lib/TableLayout/constants.js +6 -8
  276. package/lib/TableLayout/index.js +12 -7
  277. package/lib/TableLayout/lib.js +9 -14
  278. package/lib/TablePreview/TablePreview.js +205 -118
  279. package/lib/TablePreview/index.js +12 -7
  280. package/lib/TablePreview/lib.js +19 -30
  281. package/lib/TablePreview/styles.js +6 -7
  282. package/lib/Tag/Tag.js +38 -19
  283. package/lib/Tag/index.js +12 -7
  284. package/lib/ToggleButton/ToggleButton.js +55 -33
  285. package/lib/ToggleButton/index.js +12 -7
  286. package/lib/Tooltip/Tooltip.js +50 -34
  287. package/lib/Tooltip/index.js +12 -7
  288. package/lib/VerticalButton/VerticalButton.js +46 -40
  289. package/lib/VerticalButton/index.js +12 -7
  290. package/lib/index.js +304 -137
  291. package/lib/theme.js +17 -31
  292. package/lib/utils.js +31 -46
  293. package/package.json +10 -2
@@ -1,24 +1,27 @@
1
- import _extends from "/builds/sis-cc/.stat-suite/dotstatsuite-visions/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/extends";
1
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
2
+
2
3
  import React from 'react';
3
4
  import * as R from 'ramda';
5
+ import PropTypes from 'prop-types';
4
6
  import cx from 'classnames';
5
7
  import Typography from '@material-ui/core/Typography';
6
- import { makeStyles } from '@material-ui/core/styles';
8
+ import { makeStyles, useTheme } from '@material-ui/core/styles';
7
9
  import TableBody from '@material-ui/core/TableBody';
8
10
  import TableCell from '@material-ui/core/TableCell';
9
11
  import TableRow from '@material-ui/core/TableRow';
10
12
  import SectionHeader from './sectionHeader';
11
13
  import Cell from './cell';
12
- import { getLight } from '../utils';
14
+ import { getLight, getIsRtl } from '../utils';
13
15
  import Flags from './flags';
16
+
14
17
  var useStyles = makeStyles(function (theme) {
15
18
  return {
16
19
  rowTitle: {
17
20
  backgroundColor: getLight(theme) || theme.palette.secondary.light,
18
21
  border: 'inherit',
19
- borderBottom: "1px solid " + theme.palette.grey[500],
20
- borderRight: "1px solid " + theme.palette.grey[500],
21
- padding: theme.spacing(0.5) + "px " + theme.spacing(1) + "px",
22
+ borderBottom: '1px solid ' + theme.palette.grey[500],
23
+ borderRight: '1px solid ' + theme.palette.grey[500],
24
+ padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px',
22
25
  color: theme.palette.grey['A700'],
23
26
  verticalAlign: 'middle'
24
27
  },
@@ -27,9 +30,10 @@ var useStyles = makeStyles(function (theme) {
27
30
  backgroundColor: theme.palette.grey[200],
28
31
  verticalAlign: 'top',
29
32
  border: 'inherit',
30
- borderBottom: "1px solid " + theme.palette.grey[500],
31
- borderRight: "1px solid " + theme.palette.grey[500],
32
- padding: theme.spacing(0.5) + "px " + theme.spacing(1) + "px"
33
+ borderBottom: '1px solid ' + theme.palette.grey[500],
34
+ borderRight: '1px solid ' + theme.palette.grey[500],
35
+ padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px',
36
+ position: 'sticky'
33
37
  },
34
38
  cellContent: {
35
39
  display: 'flex',
@@ -46,7 +50,11 @@ var useStyles = makeStyles(function (theme) {
46
50
  hierarchySpace: {
47
51
  marginBottom: 'auto'
48
52
  },
49
- highlight: theme.mixins.table.cellHighlight
53
+ highlight: theme.mixins.table.cellHighlight,
54
+ stickyHeader: {
55
+ position: 'sticky',
56
+ zIndex: 1
57
+ }
50
58
  };
51
59
  });
52
60
  var mapIndexed = R.addIndex(R.map);
@@ -63,90 +71,127 @@ var Section = function Section(_ref) {
63
71
  sectionIndex = _ref.sectionIndex,
64
72
  nbColumnsByRows = _ref.nbColumnsByRows,
65
73
  subHeadCellsWidth = _ref.subHeadCellsWidth;
74
+
66
75
  var classes = useStyles();
67
76
  var currentSection = R.path([0, 'key'], section);
68
77
  var headerNumberRows = R.length(nbColumnsByRows);
69
78
  var maxColumns = R.last(nbColumnsByRows);
70
- return /*#__PURE__*/React.createElement(TableBody, null, /*#__PURE__*/React.createElement(SectionHeader, {
71
- headerData: headerData,
72
- section: section,
73
- currentSection: currentSection,
74
- xLayoutDataLength: xLayoutDataLength,
75
- headerHeight: headerHeight
76
- }), R.map(function (sectionbody) {
77
- var _cx2;
79
+ var theme = useTheme();
80
+ var isRtl = getIsRtl(theme);
81
+
82
+ return React.createElement(
83
+ TableBody,
84
+ null,
85
+ React.createElement(SectionHeader, {
86
+ headerData: headerData,
87
+ section: section,
88
+ currentSection: currentSection,
89
+ xLayoutDataLength: xLayoutDataLength,
90
+ headerHeight: headerHeight
91
+ }),
92
+ R.map(function (sectionbody) {
93
+ var _cx2;
78
94
 
79
- var rowId = sectionbody.key + "_" + sectionIndex;
80
- var rowIds = R.pipe(R.map(function (index) {
81
- return sectionbody.key + "_" + sectionIndex + "_" + index;
82
- }), R.join(' '))(R.times(R.identity, R.length(R.prop('data', sectionbody))));
83
- return /*#__PURE__*/React.createElement(TableRow, {
84
- key: sectionbody.key
85
- }, mapIndexed(function (cell, index) {
86
- var _cx;
95
+ var rowId = sectionbody.key + '_' + sectionIndex;
96
+ var rowIds = R.pipe(R.map(function (index) {
97
+ return sectionbody.key + '_' + sectionIndex + '_' + index;
98
+ }), R.join(' '))(R.times(R.identity, R.length(R.prop('data', sectionbody))));
99
+ return React.createElement(
100
+ TableRow,
101
+ { key: sectionbody.key },
102
+ mapIndexed(function (cell, index) {
103
+ var _cx;
87
104
 
88
- var flags = R.path(['value', 'flags'], cell);
89
- var id = rowId + "_" + index; // special space is used for hierarchy U+2007 &#8199; &numsp;
105
+ var flags = R.path(['value', 'flags'], cell);
106
+ var id = rowId + '_' + index;
90
107
 
91
- var hierarchySpace = R.pipe(R.pathOr([], ['value', 'parents']), R.when(R.isNil, R.always([])), R.length, // eslint-disable-next-line no-irregular-whitespace
92
- R.times(function () {
93
- return '·  ';
94
- }))(cell);
95
- return /*#__PURE__*/React.createElement(TableCell, {
96
- key: id,
97
- className: cx(classes.rowTitle, (_cx = {}, _cx[classes.topCell] = R.not(R.isEmpty(flags)), _cx[classes.highlight] = R.prop(rowId)(activeCellIds), _cx)),
98
- id: id,
99
- headers: "subHeader_" + index + " " + currentSection,
100
- component: "th",
101
- style: {
102
- position: 'sticky',
103
- left: subHeadCellsWidth[index],
104
- zIndex: 1
105
- }
106
- }, /*#__PURE__*/React.createElement("div", {
107
- className: classes.cellContent
108
- }, !R.isEmpty(hierarchySpace) && /*#__PURE__*/React.createElement("div", {
109
- className: classes.hierarchySpace
110
- }, hierarchySpace), /*#__PURE__*/React.createElement(Typography, {
111
- variant: "body1",
112
- tabIndex: 0
113
- }, R.path(['value', 'label'], cell), /*#__PURE__*/React.createElement(Flags, {
114
- flags: flags
115
- }))));
116
- }, R.prop('data', sectionbody)), /*#__PURE__*/React.createElement(TableCell, {
117
- className: cx(classes.fillerCell, (_cx2 = {}, _cx2[classes.highlight] = R.prop(rowId)(activeCellIds), _cx2)),
118
- style: {
119
- position: 'sticky',
120
- left: R.last(subHeadCellsWidth)
121
- }
122
- }, /*#__PURE__*/React.createElement("div", {
123
- className: classes.flagContainer
124
- }, /*#__PURE__*/React.createElement(Flags, {
125
- flags: R.prop('flags', sectionbody)
126
- }))), mapIndexed(function (item, columnIndex) {
127
- var columnIds = R.pipe(R.times(R.identity), R.map(function (rowIndex) {
128
- var columnId = R.divide(columnIndex, R.divide(maxColumns, R.nth(rowIndex, nbColumnsByRows)));
129
- return Math.floor(columnId || 0) + "_" + rowIndex;
130
- }), R.join(' '))(headerNumberRows);
131
- var intersectionCellId = rowId + "/" + columnIndex;
132
- var isActive = R.pipe(R.propOr({}, 'intersectionCellId'), R.equals(intersectionCellId))(activeCellIds);
133
- return /*#__PURE__*/React.createElement(Cell, _extends({
134
- key: intersectionCellId
135
- }, R.pathOr({
136
- value: '..'
137
- }, [item.key, currentSection, sectionbody.key, 0], cells), {
138
- headers: rowIds + " " + columnIds + " " + currentSection,
139
- cellHandler: cellHandler,
140
- isActive: isActive,
141
- isHighlight: R.any(R.identity)([R.prop(rowId)(activeCellIds), R.prop(columnIndex)(activeCellIds)]),
142
- activeCellHandler: R.is(Function)(activeCellHandler) ? function () {
143
- var _activeCellHandler;
108
+ // special space is used for hierarchy U+2007 &#8199; &numsp;
109
+ var hierarchySpace = R.pipe(R.pathOr([], ['value', 'parents']), R.when(R.isNil, R.always([])), R.length,
110
+ // eslint-disable-next-line no-irregular-whitespace
111
+ R.times(function () {
112
+ return '·  ';
113
+ }))(cell);
144
114
 
145
- return activeCellHandler((_activeCellHandler = {}, _activeCellHandler[rowId] = R.not(isActive), _activeCellHandler[columnIndex] = R.not(isActive), _activeCellHandler.intersectionCellId = isActive ? null : intersectionCellId, _activeCellHandler));
146
- } : null
147
- }));
148
- }, headerData));
149
- }, R.nth(1, section)));
115
+ return React.createElement(
116
+ TableCell,
117
+ {
118
+ key: id,
119
+ className: cx(classes.rowTitle, classes.stickyHeader, (_cx = {}, _cx[classes.topCell] = R.not(R.isEmpty(flags)), _cx[classes.highlight] = R.prop(rowId)(activeCellIds), _cx)),
120
+ id: id,
121
+ headers: 'subHeader_' + index + ' ' + currentSection,
122
+ component: 'th',
123
+ style: isRtl ? { right: subHeadCellsWidth[index] } : { left: subHeadCellsWidth[index] }
124
+ },
125
+ React.createElement(
126
+ 'div',
127
+ { className: classes.cellContent },
128
+ !R.isEmpty(hierarchySpace) && React.createElement(
129
+ 'div',
130
+ { className: classes.hierarchySpace },
131
+ hierarchySpace
132
+ ),
133
+ React.createElement(
134
+ Typography,
135
+ { variant: 'body1', tabIndex: 0 },
136
+ R.path(['value', 'label'], cell),
137
+ React.createElement(Flags, { flags: flags })
138
+ )
139
+ )
140
+ );
141
+ }, R.prop('data', sectionbody)),
142
+ React.createElement(
143
+ TableCell,
144
+ {
145
+ className: cx(classes.fillerCell, (_cx2 = {}, _cx2[classes.highlight] = R.prop(rowId)(activeCellIds), _cx2)),
146
+ style: isRtl ? { right: R.last(subHeadCellsWidth) } : { left: R.last(subHeadCellsWidth) }
147
+ },
148
+ React.createElement(
149
+ 'div',
150
+ { className: classes.flagContainer },
151
+ React.createElement(Flags, { flags: R.prop('flags', sectionbody) })
152
+ )
153
+ ),
154
+ mapIndexed(function (item, columnIndex) {
155
+ var columnIds = R.pipe(R.times(R.identity), R.map(function (rowIndex) {
156
+ var columnId = R.divide(columnIndex, R.divide(maxColumns, R.nth(rowIndex, nbColumnsByRows)));
157
+ return Math.floor(columnId || 0) + '_' + rowIndex;
158
+ }), R.join(' '))(headerNumberRows);
159
+
160
+ var intersectionCellId = rowId + '/' + columnIndex;
161
+ var isActive = R.pipe(R.propOr({}, 'intersectionCellId'), R.equals(intersectionCellId))(activeCellIds);
162
+ return React.createElement(Cell, _extends({
163
+ key: intersectionCellId
164
+ }, R.pathOr({ value: '..' }, [item.key, currentSection, sectionbody.key, 0], cells), {
165
+ headers: rowIds + ' ' + columnIds + ' ' + currentSection,
166
+ cellHandler: cellHandler,
167
+ isActive: isActive,
168
+ isHighlight: R.any(R.identity)([R.prop(rowId)(activeCellIds), R.prop(columnIndex)(activeCellIds)]),
169
+ activeCellHandler: R.is(Function)(activeCellHandler) ? function () {
170
+ var _activeCellHandler;
171
+
172
+ return activeCellHandler((_activeCellHandler = {}, _activeCellHandler[rowId] = R.not(isActive), _activeCellHandler[columnIndex] = R.not(isActive), _activeCellHandler.intersectionCellId = isActive ? null : intersectionCellId, _activeCellHandler));
173
+ } : null
174
+ }));
175
+ }, headerData)
176
+ );
177
+ }, R.nth(1, section))
178
+ );
150
179
  };
151
180
 
181
+ Section.propTypes = process.env.NODE_ENV !== "production" ? {
182
+ cells: PropTypes.object,
183
+ headerData: PropTypes.array,
184
+ section: PropTypes.array,
185
+ xLayoutDataLength: PropTypes.number,
186
+ cellHandler: PropTypes.func,
187
+ activeCellHandler: PropTypes.func,
188
+ activeCellIds: PropTypes.object,
189
+ headerHeight: PropTypes.number,
190
+ sectionIndex: PropTypes.number,
191
+ headerNumberRows: PropTypes.number,
192
+ nbColumnsByRows: PropTypes.array,
193
+ maxColumns: PropTypes.number,
194
+ subHeadCellsWidth: PropTypes.arrayOf(PropTypes.number)
195
+ } : {};
196
+
152
197
  export default Section;
@@ -1,6 +1,8 @@
1
- import _extends from "/builds/sis-cc/.stat-suite/dotstatsuite-visions/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/extends";
1
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
2
+
2
3
  import React, { Fragment } from 'react';
3
4
  import * as R from 'ramda';
5
+ import PropTypes from 'prop-types';
4
6
  import Typography from '@material-ui/core/Typography';
5
7
  import { makeStyles } from '@material-ui/core/styles';
6
8
  import Lens from '@material-ui/icons/Lens';
@@ -8,14 +10,15 @@ import TableCell from '@material-ui/core/TableCell';
8
10
  import TableRow from '@material-ui/core/TableRow';
9
11
  import Flags from './flags';
10
12
  import { getDark } from '../utils';
13
+
11
14
  var useStyles = makeStyles(function (theme) {
12
15
  return {
13
16
  section: {
14
17
  backgroundColor: getDark(theme) || theme.palette.secondary.dark,
15
18
  border: 'inherit',
16
- borderBottom: "1px solid " + theme.palette.grey[500],
17
- borderRight: "1px solid " + theme.palette.grey[500],
18
- padding: theme.spacing(0.5) + "px " + theme.spacing(1) + "px",
19
+ borderBottom: '1px solid ' + theme.palette.grey[500],
20
+ borderRight: '1px solid ' + theme.palette.grey[500],
21
+ padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px',
19
22
  color: theme.palette.grey['A700'],
20
23
  verticalAlign: 'middle'
21
24
  },
@@ -52,49 +55,73 @@ var SectionHeader = function SectionHeader(_ref) {
52
55
  currentSection = _ref.currentSection,
53
56
  xLayoutDataLength = _ref.xLayoutDataLength,
54
57
  headerHeight = _ref.headerHeight;
58
+
55
59
  var classes = useStyles();
56
60
  if (R.compose(R.anyPass([R.isNil, R.isEmpty]), R.path([0, 'data']))(section)) return null;
57
- return /*#__PURE__*/React.createElement(TableRow, {
58
- key: section.key,
59
- className: classes.stickyHeaderSection,
60
- style: {
61
- top: headerHeight,
62
- zIndex: 2
63
- }
64
- }, /*#__PURE__*/React.createElement(TableCell, {
65
- component: "th",
66
- className: classes.section,
67
- colSpan: R.pipe(R.length, R.inc, R.add(xLayoutDataLength))(headerData),
68
- id: currentSection
69
- }, /*#__PURE__*/React.createElement(Typography, {
70
- noWrap: true,
71
- variant: "body1",
72
- component: "div",
73
- className: classes.containerSection
74
- }, /*#__PURE__*/React.createElement("div", null, mapIndexed(function (sectionHeader, index) {
75
- return /*#__PURE__*/React.createElement(Fragment, {
76
- key: index
77
- }, index !== 0 && /*#__PURE__*/React.createElement(Lens, {
78
- className: classes.lens
79
- }), /*#__PURE__*/React.createElement(Typography, {
80
- noWrap: true,
81
- variant: "body1",
82
- component: "span",
83
- tabIndex: 0,
84
- className: classes.label
85
- }, R.path(['dimension', 'label'], sectionHeader), ':'), /*#__PURE__*/React.createElement(Typography, {
86
- noWrap: true,
87
- variant: "body1",
88
- component: "span",
89
- tabIndex: 0
90
- }, R.path(['value', 'label'], sectionHeader), /*#__PURE__*/React.createElement(Flags, {
91
- flags: R.path(['value', 'flags'], sectionHeader)
92
- })));
93
- }, R.path([0, 'data'], section))), /*#__PURE__*/React.createElement("div", {
94
- className: classes.flag
95
- }, /*#__PURE__*/React.createElement(Flags, {
96
- flags: R.path([0, 'flags'], section)
97
- })))));
61
+
62
+ return React.createElement(
63
+ TableRow,
64
+ {
65
+ key: section.key,
66
+ className: classes.stickyHeaderSection,
67
+ style: { top: headerHeight, zIndex: 2 }
68
+ },
69
+ React.createElement(
70
+ TableCell,
71
+ {
72
+ component: 'th',
73
+ className: classes.section,
74
+ colSpan: R.pipe(R.length, R.inc, R.add(xLayoutDataLength))(headerData),
75
+ id: currentSection
76
+ },
77
+ React.createElement(
78
+ Typography,
79
+ { noWrap: true, variant: 'body1', component: 'div', className: classes.containerSection },
80
+ React.createElement(
81
+ 'div',
82
+ null,
83
+ mapIndexed(function (sectionHeader, index) {
84
+ return React.createElement(
85
+ Fragment,
86
+ { key: index },
87
+ index !== 0 && React.createElement(Lens, { className: classes.lens }),
88
+ React.createElement(
89
+ Typography,
90
+ {
91
+ noWrap: true,
92
+ variant: 'body1',
93
+ component: 'span',
94
+ tabIndex: 0,
95
+ className: classes.label
96
+ },
97
+ R.path(['dimension', 'label'], sectionHeader),
98
+ ':'
99
+ ),
100
+ React.createElement(
101
+ Typography,
102
+ { noWrap: true, variant: 'body1', component: 'span', tabIndex: 0 },
103
+ R.path(['value', 'label'], sectionHeader),
104
+ React.createElement(Flags, { flags: R.path(['value', 'flags'], sectionHeader) })
105
+ )
106
+ );
107
+ }, R.path([0, 'data'], section))
108
+ ),
109
+ React.createElement(
110
+ 'div',
111
+ { className: classes.flag },
112
+ React.createElement(Flags, { flags: R.path([0, 'flags'], section) })
113
+ )
114
+ )
115
+ )
116
+ );
98
117
  };
99
118
 
119
+ SectionHeader.propTypes = process.env.NODE_ENV !== "production" ? {
120
+ headerData: PropTypes.array,
121
+ section: PropTypes.array,
122
+ currentSection: PropTypes.string,
123
+ xLayoutDataLength: PropTypes.number,
124
+ headerHeight: PropTypes.number
125
+ } : {};
126
+
100
127
  export default SectionHeader;
@@ -1,29 +1,33 @@
1
1
  import React from 'react';
2
2
  import * as R from 'ramda';
3
+ import PropTypes from 'prop-types';
3
4
  import cx from 'classnames';
4
5
  import Typography from '@material-ui/core/Typography';
5
- import { makeStyles } from '@material-ui/core/styles';
6
+ import { makeStyles, useTheme } from '@material-ui/core/styles';
6
7
  import TableCell from '@material-ui/core/TableCell';
7
8
  import TableRow from '@material-ui/core/TableRow';
8
- import { getLight } from '../utils';
9
+ import { getLight, getIsRtl } from '../utils';
9
10
  import Flags from './flags';
11
+
10
12
  var useStyles = makeStyles(function (theme) {
11
13
  return {
12
14
  columnsTitle: {
13
15
  backgroundColor: getLight(theme) || theme.palette.secondary.light,
14
16
  border: 'inherit',
15
- borderBottom: "1px solid " + theme.palette.grey[500],
16
- borderRight: "1px solid " + theme.palette.grey[500],
17
- padding: theme.spacing(0.5) + "px " + theme.spacing(1) + "px",
17
+ borderBottom: '1px solid ' + theme.palette.grey[500],
18
+ borderRight: '1px solid ' + theme.palette.grey[500],
19
+ padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px',
18
20
  color: theme.palette.grey['A700'],
19
- verticalAlign: 'middle'
21
+ verticalAlign: 'middle',
22
+ position: 'sticky',
23
+ zIndex: 1
20
24
  },
21
25
  fillerCell: {
22
26
  backgroundColor: theme.palette.grey[200],
23
27
  border: 'inherit',
24
- borderBottom: "1px solid " + theme.palette.grey[500],
25
- borderRight: "1px solid " + theme.palette.grey[500],
26
- padding: theme.spacing(0.5) + "px " + theme.spacing(1) + "px",
28
+ borderBottom: '1px solid ' + theme.palette.grey[500],
29
+ borderRight: '1px solid ' + theme.palette.grey[500],
30
+ padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px',
27
31
  verticalAlign: 'middle',
28
32
  textAlign: 'center',
29
33
  color: theme.palette.grey['A700']
@@ -39,51 +43,70 @@ var useStyles = makeStyles(function (theme) {
39
43
  highlight: theme.mixins.table.cellHighlight
40
44
  };
41
45
  });
46
+
42
47
  var mapIndexed = R.addIndex(R.map);
48
+
43
49
  var SubHeader = React.forwardRef(function (_ref, refs) {
44
50
  var headerData = _ref.headerData,
45
51
  xLayoutData = _ref.xLayoutData,
46
52
  activeCellIds = _ref.activeCellIds,
47
53
  subHeadCellsWidth = _ref.subHeadCellsWidth;
54
+
48
55
  var classes = useStyles();
49
- return /*#__PURE__*/React.createElement(TableRow, null, mapIndexed(function (rowItem, index) {
50
- return /*#__PURE__*/React.createElement(TableCell, {
51
- component: "th",
52
- className: classes.columnsTitle,
53
- key: index,
54
- id: "subHeader_" + index,
55
- style: {
56
- position: 'sticky',
57
- left: subHeadCellsWidth[index],
58
- zIndex: 1
59
- },
60
- ref: function ref(element) {
61
- return refs.current[index] = element;
62
- }
63
- }, /*#__PURE__*/React.createElement("div", {
64
- className: classes.cellContent
65
- }, /*#__PURE__*/React.createElement(Typography, {
66
- variant: "body1",
67
- tabIndex: 0,
68
- className: classes.label
69
- }, R.path(['dimension', 'label'], rowItem), /*#__PURE__*/React.createElement(Flags, {
70
- flags: R.path(['dimension', 'flags'], rowItem)
71
- }))));
72
- }, xLayoutData), /*#__PURE__*/React.createElement(TableCell, {
73
- className: classes.fillerCell,
74
- style: {
75
- position: 'sticky',
76
- left: R.last(subHeadCellsWidth)
77
- }
78
- }), mapIndexed(function (item, index) {
79
- var _cx;
56
+ var theme = useTheme();
57
+ var isRtl = getIsRtl(theme);
58
+ return React.createElement(
59
+ TableRow,
60
+ null,
61
+ mapIndexed(function (rowItem, index) {
62
+ return React.createElement(
63
+ TableCell,
64
+ {
65
+ component: 'th',
66
+ className: classes.columnsTitle,
67
+ key: index,
68
+ id: 'subHeader_' + index,
69
+ style: isRtl ? { right: subHeadCellsWidth[index] } : { left: subHeadCellsWidth[index] },
70
+ ref: function ref(element) {
71
+ return refs.current[index] = element;
72
+ }
73
+ },
74
+ React.createElement(
75
+ 'div',
76
+ { className: classes.cellContent },
77
+ React.createElement(
78
+ Typography,
79
+ { variant: 'body1', tabIndex: 0, className: classes.label },
80
+ R.path(['dimension', 'label'], rowItem),
81
+ React.createElement(Flags, { flags: R.path(['dimension', 'flags'], rowItem) })
82
+ )
83
+ )
84
+ );
85
+ }, xLayoutData),
86
+ React.createElement(TableCell, {
87
+ className: classes.fillerCell,
88
+ style: isRtl ? { position: 'sticky', right: R.last(subHeadCellsWidth) } : { position: 'sticky', left: R.last(subHeadCellsWidth) }
89
+ }),
90
+ mapIndexed(function (item, index) {
91
+ var _cx;
80
92
 
81
- return /*#__PURE__*/React.createElement(TableCell, {
82
- key: index,
83
- className: cx(classes.fillerCell, (_cx = {}, _cx[classes.highlight] = R.prop(index)(activeCellIds), _cx))
84
- }, /*#__PURE__*/React.createElement(Flags, {
85
- flags: R.prop('flags', item)
86
- }));
87
- }, headerData));
93
+ return React.createElement(
94
+ TableCell,
95
+ {
96
+ key: index,
97
+ className: cx(classes.fillerCell, (_cx = {}, _cx[classes.highlight] = R.prop(index)(activeCellIds), _cx))
98
+ },
99
+ React.createElement(Flags, { flags: R.prop('flags', item) })
100
+ );
101
+ }, headerData)
102
+ );
88
103
  });
104
+
105
+ SubHeader.propTypes = process.env.NODE_ENV !== "production" ? {
106
+ activeCellIds: PropTypes.object,
107
+ headerData: PropTypes.array,
108
+ xLayoutData: PropTypes.array,
109
+ subHeadCellsWidth: PropTypes.arrayOf(PropTypes.number)
110
+ } : {};
111
+
89
112
  export default SubHeader;