@sis-cc/dotstatsuite-visions 6.5.2 → 6.6.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 (293) hide show
  1. package/es/Alert/Alert.js +66 -135
  2. package/es/Alert/index.js +0 -1
  3. package/es/ApiQueries/ApiQueries.js +45 -79
  4. package/es/ApiQueries/Query.js +65 -105
  5. package/es/ApiQueries/index.js +0 -1
  6. package/es/AuthDialog/index.js +62 -103
  7. package/es/Breadcrumbs/Breadcrumbs.js +21 -38
  8. package/es/Breadcrumbs/index.js +0 -1
  9. package/es/Button/Button.js +11 -28
  10. package/es/Button/index.js +0 -1
  11. package/es/ChartsConfig/Axis.js +72 -76
  12. package/es/ChartsConfig/ButtonGroup.js +29 -51
  13. package/es/ChartsConfig/ChartsConfig.js +87 -187
  14. package/es/ChartsConfig/ContainerTitle.js +15 -36
  15. package/es/ChartsConfig/Focus.js +37 -48
  16. package/es/ChartsConfig/Frequency.js +24 -36
  17. package/es/ChartsConfig/Series.js +28 -43
  18. package/es/ChartsConfig/Size.js +36 -50
  19. package/es/ChartsConfig/index.js +0 -1
  20. package/es/ChartsConfig/styles.js +4 -4
  21. package/es/ChartsConfig/utils.js +1 -5
  22. package/es/Chips/Chips.js +99 -154
  23. package/es/Chips/index.js +0 -1
  24. package/es/CollapseButtons/CollapseButtons.js +61 -101
  25. package/es/CollapseButtons/Item.js +45 -70
  26. package/es/CollapseButtons/Paper.js +7 -21
  27. package/es/CollapseButtons/index.js +0 -1
  28. package/es/DataEdit/DataEdit.js +67 -124
  29. package/es/DataEdit/Input.js +27 -58
  30. package/es/DataEdit/index.js +0 -1
  31. package/es/DataFooter/DataFooter.js +68 -115
  32. package/es/DataFooter/index.js +0 -1
  33. package/es/DataHeader/DataHeader.js +75 -113
  34. package/es/DataHeader/Flags.js +8 -21
  35. package/es/DataHeader/Title.js +2 -15
  36. package/es/DataHeader/TooltipHeader.js +33 -63
  37. package/es/DataHeader/index.js +0 -1
  38. package/es/DataHeader/utils.js +8 -8
  39. package/es/Dataflow/Dataflow.js +132 -226
  40. package/es/Dataflow/index.js +0 -1
  41. package/es/ExpansionPanel/ExpansionPanel.js +42 -79
  42. package/es/ExpansionPanel/index.js +0 -1
  43. package/es/ExpansionPanel/styles.js +3 -5
  44. package/es/Icons/AccessibilityFilled.js +6 -8
  45. package/es/Icons/AccessibilityOutlined.js +6 -8
  46. package/es/Icons/AccountFilled.js +6 -8
  47. package/es/Icons/AccountOutlined.js +6 -8
  48. package/es/Icons/Api.js +6 -8
  49. package/es/Icons/Asterisk.js +6 -8
  50. package/es/Icons/Bar.js +6 -8
  51. package/es/Icons/CopyContent.js +6 -8
  52. package/es/Icons/Cross.js +6 -8
  53. package/es/Icons/HSymbol.js +6 -8
  54. package/es/Icons/Row.js +6 -8
  55. package/es/Icons/Scatter.js +6 -8
  56. package/es/Icons/StackedBar.js +6 -8
  57. package/es/Icons/StackedRow.js +6 -8
  58. package/es/Icons/Timeline.js +6 -8
  59. package/es/Icons/VSymbol.js +6 -8
  60. package/es/Icons/Warning.js +11 -14
  61. package/es/Icons/index.js +0 -1
  62. package/es/Input/Input.js +26 -56
  63. package/es/Input/index.js +0 -1
  64. package/es/Input/with-input.js +30 -25
  65. package/es/InputNumber/InputNumber.js +31 -51
  66. package/es/InputNumber/index.js +0 -1
  67. package/es/LabelDivider/LabelDivider.js +7 -18
  68. package/es/LabelDivider/index.js +0 -1
  69. package/es/Loading/Loading.js +9 -18
  70. package/es/Loading/index.js +0 -1
  71. package/es/Logo/Logo.js +11 -17
  72. package/es/Logo/index.js +0 -1
  73. package/es/NoData/NoData.js +17 -25
  74. package/es/NoData/index.js +0 -1
  75. package/es/Pagination/Pagination.js +70 -114
  76. package/es/Pagination/index.js +0 -1
  77. package/es/PeriodPicker/PeriodPicker.js +101 -124
  78. package/es/PeriodPicker/constants.js +78 -13
  79. package/es/PeriodPicker/index.js +0 -1
  80. package/es/PeriodPicker/lib.js +37 -23
  81. package/es/PeriodPicker/styles.js +0 -1
  82. package/es/ScopeList/Header.js +41 -60
  83. package/es/ScopeList/Item.js +98 -144
  84. package/es/ScopeList/ScopeList.js +132 -184
  85. package/es/ScopeList/Selection.js +51 -93
  86. package/es/ScopeList/index.js +0 -1
  87. package/es/ScopeList/styles.js +2 -3
  88. package/es/ScopeList/with-scope-list.js +151 -88
  89. package/es/Select/Select.js +44 -60
  90. package/es/Select/index.js +0 -1
  91. package/es/Share/Form.js +58 -88
  92. package/es/Share/Mode.js +30 -46
  93. package/es/Share/Share.js +41 -64
  94. package/es/Share/index.js +0 -1
  95. package/es/SisccFooter/SisccFooter.js +29 -36
  96. package/es/SisccFooter/index.js +0 -1
  97. package/es/Spotlight/Fields.js +37 -71
  98. package/es/Spotlight/Spotlight.js +51 -92
  99. package/es/Spotlight/index.js +0 -1
  100. package/es/Spotlight/useSpotlight.js +33 -13
  101. package/es/Spotlight/useStyles.js +2 -4
  102. package/es/Table/Table.js +50 -71
  103. package/es/Table/header.js +36 -50
  104. package/es/Table/index.js +0 -1
  105. package/es/Table/itemCell.js +13 -25
  106. package/es/Table/row-header.js +31 -50
  107. package/es/Table/section-header.js +30 -55
  108. package/es/Table/section-rows.js +38 -62
  109. package/es/Table/styles.js +2 -8
  110. package/es/Table/tableCell.js +7 -17
  111. package/es/Table/tooltip.js +21 -41
  112. package/es/Table/useStyles.js +2 -3
  113. package/es/Table/valueCell.js +26 -41
  114. package/es/TableFooter/TableFooter.js +42 -70
  115. package/es/TableFooter/index.js +0 -1
  116. package/es/TableHeader/TableHeader.js +18 -36
  117. package/es/TableHeader/index.js +0 -1
  118. package/es/TableHtml5/TableHtml5.js +71 -68
  119. package/es/TableHtml5/cell.js +35 -55
  120. package/es/TableHtml5/flags.js +29 -58
  121. package/es/TableHtml5/header.js +48 -66
  122. package/es/TableHtml5/index.js +0 -1
  123. package/es/TableHtml5/section.js +86 -120
  124. package/es/TableHtml5/sectionHeader.js +45 -72
  125. package/es/TableHtml5/subHeader.js +48 -58
  126. package/es/TableLayout/Box.js +33 -66
  127. package/es/TableLayout/DnDItem.js +37 -68
  128. package/es/TableLayout/TableLayout.js +105 -177
  129. package/es/TableLayout/constants.js +0 -2
  130. package/es/TableLayout/index.js +0 -1
  131. package/es/TableLayout/lib.js +1 -3
  132. package/es/TablePreview/TablePreview.js +99 -176
  133. package/es/TablePreview/index.js +0 -1
  134. package/es/TablePreview/lib.js +5 -4
  135. package/es/TablePreview/styles.js +0 -1
  136. package/es/Tag/Tag.js +5 -21
  137. package/es/Tag/index.js +0 -1
  138. package/es/ToggleButton/ToggleButton.js +17 -29
  139. package/es/ToggleButton/index.js +0 -1
  140. package/es/Tooltip/Tooltip.js +20 -32
  141. package/es/Tooltip/index.js +0 -1
  142. package/es/VerticalButton/VerticalButton.js +17 -22
  143. package/es/VerticalButton/index.js +0 -1
  144. package/es/index.js +2 -4
  145. package/es/theme.js +22 -14
  146. package/es/utils.js +16 -14
  147. package/lib/Alert/Alert.js +87 -168
  148. package/lib/Alert/index.js +7 -12
  149. package/lib/ApiQueries/ApiQueries.js +61 -105
  150. package/lib/ApiQueries/Query.js +85 -132
  151. package/lib/ApiQueries/index.js +7 -12
  152. package/lib/AuthDialog/index.js +82 -137
  153. package/lib/Breadcrumbs/Breadcrumbs.js +39 -68
  154. package/lib/Breadcrumbs/index.js +7 -12
  155. package/lib/Button/Button.js +28 -47
  156. package/lib/Button/index.js +7 -12
  157. package/lib/ChartsConfig/Axis.js +88 -100
  158. package/lib/ChartsConfig/ButtonGroup.js +43 -74
  159. package/lib/ChartsConfig/ChartsConfig.js +113 -236
  160. package/lib/ChartsConfig/ContainerTitle.js +30 -59
  161. package/lib/ChartsConfig/Focus.js +53 -71
  162. package/lib/ChartsConfig/Frequency.js +39 -59
  163. package/lib/ChartsConfig/Series.js +45 -70
  164. package/lib/ChartsConfig/Size.js +53 -77
  165. package/lib/ChartsConfig/index.js +7 -12
  166. package/lib/ChartsConfig/styles.js +16 -11
  167. package/lib/ChartsConfig/utils.js +14 -13
  168. package/lib/Chips/Chips.js +122 -192
  169. package/lib/Chips/index.js +7 -12
  170. package/lib/CollapseButtons/CollapseButtons.js +84 -134
  171. package/lib/CollapseButtons/Item.js +64 -98
  172. package/lib/CollapseButtons/Paper.js +19 -41
  173. package/lib/CollapseButtons/index.js +7 -12
  174. package/lib/DataEdit/DataEdit.js +88 -156
  175. package/lib/DataEdit/Input.js +42 -82
  176. package/lib/DataEdit/index.js +7 -12
  177. package/lib/DataFooter/DataFooter.js +88 -144
  178. package/lib/DataFooter/index.js +7 -12
  179. package/lib/DataHeader/DataHeader.js +106 -158
  180. package/lib/DataHeader/Flags.js +18 -34
  181. package/lib/DataHeader/Title.js +11 -27
  182. package/lib/DataHeader/TooltipHeader.js +48 -79
  183. package/lib/DataHeader/index.js +7 -12
  184. package/lib/DataHeader/utils.js +16 -10
  185. package/lib/Dataflow/Dataflow.js +159 -277
  186. package/lib/Dataflow/index.js +7 -12
  187. package/lib/ExpansionPanel/ExpansionPanel.js +63 -116
  188. package/lib/ExpansionPanel/index.js +7 -12
  189. package/lib/ExpansionPanel/styles.js +15 -12
  190. package/lib/Icons/AccessibilityFilled.js +15 -17
  191. package/lib/Icons/AccessibilityOutlined.js +15 -17
  192. package/lib/Icons/AccountFilled.js +15 -17
  193. package/lib/Icons/AccountOutlined.js +15 -17
  194. package/lib/Icons/Api.js +15 -17
  195. package/lib/Icons/Asterisk.js +15 -17
  196. package/lib/Icons/Bar.js +15 -17
  197. package/lib/Icons/CopyContent.js +15 -17
  198. package/lib/Icons/Cross.js +15 -17
  199. package/lib/Icons/HSymbol.js +15 -17
  200. package/lib/Icons/Row.js +15 -17
  201. package/lib/Icons/Scatter.js +15 -17
  202. package/lib/Icons/StackedBar.js +15 -17
  203. package/lib/Icons/StackedRow.js +15 -17
  204. package/lib/Icons/Timeline.js +15 -17
  205. package/lib/Icons/VSymbol.js +15 -17
  206. package/lib/Icons/Warning.js +27 -31
  207. package/lib/Icons/index.js +68 -152
  208. package/lib/Input/Input.js +47 -85
  209. package/lib/Input/index.js +7 -12
  210. package/lib/Input/with-input.js +38 -35
  211. package/lib/InputNumber/InputNumber.js +50 -80
  212. package/lib/InputNumber/index.js +7 -12
  213. package/lib/LabelDivider/LabelDivider.js +23 -37
  214. package/lib/LabelDivider/index.js +7 -12
  215. package/lib/Loading/Loading.js +20 -35
  216. package/lib/Loading/index.js +7 -12
  217. package/lib/Logo/Logo.js +20 -28
  218. package/lib/Logo/index.js +7 -12
  219. package/lib/NoData/NoData.js +28 -42
  220. package/lib/NoData/index.js +7 -12
  221. package/lib/Pagination/Pagination.js +91 -150
  222. package/lib/Pagination/index.js +7 -12
  223. package/lib/PeriodPicker/PeriodPicker.js +121 -150
  224. package/lib/PeriodPicker/constants.js +126 -37
  225. package/lib/PeriodPicker/index.js +7 -12
  226. package/lib/PeriodPicker/lib.js +99 -61
  227. package/lib/PeriodPicker/styles.js +7 -4
  228. package/lib/ScopeList/Header.js +58 -88
  229. package/lib/ScopeList/Item.js +116 -177
  230. package/lib/ScopeList/ScopeList.js +160 -234
  231. package/lib/ScopeList/Selection.js +70 -131
  232. package/lib/ScopeList/index.js +7 -12
  233. package/lib/ScopeList/styles.js +10 -9
  234. package/lib/ScopeList/with-scope-list.js +199 -108
  235. package/lib/Select/Select.js +59 -80
  236. package/lib/Select/index.js +7 -12
  237. package/lib/Share/Form.js +77 -119
  238. package/lib/Share/Mode.js +49 -78
  239. package/lib/Share/Share.js +59 -91
  240. package/lib/Share/index.js +7 -12
  241. package/lib/SisccFooter/SisccFooter.js +44 -63
  242. package/lib/SisccFooter/index.js +7 -12
  243. package/lib/Spotlight/Fields.js +54 -100
  244. package/lib/Spotlight/Spotlight.js +75 -136
  245. package/lib/Spotlight/index.js +7 -12
  246. package/lib/Spotlight/useSpotlight.js +44 -20
  247. package/lib/Spotlight/useStyles.js +15 -12
  248. package/lib/Table/Table.js +69 -102
  249. package/lib/Table/header.js +51 -70
  250. package/lib/Table/index.js +7 -12
  251. package/lib/Table/itemCell.js +25 -41
  252. package/lib/Table/row-header.js +49 -75
  253. package/lib/Table/section-header.js +50 -82
  254. package/lib/Table/section-rows.js +60 -94
  255. package/lib/Table/styles.js +23 -25
  256. package/lib/Table/tableCell.js +19 -37
  257. package/lib/Table/tooltip.js +36 -54
  258. package/lib/Table/useStyles.js +11 -8
  259. package/lib/Table/valueCell.js +39 -59
  260. package/lib/TableFooter/TableFooter.js +57 -93
  261. package/lib/TableFooter/index.js +7 -12
  262. package/lib/TableHeader/TableHeader.js +32 -56
  263. package/lib/TableHeader/index.js +7 -12
  264. package/lib/TableHtml5/TableHtml5.js +90 -97
  265. package/lib/TableHtml5/cell.js +52 -84
  266. package/lib/TableHtml5/flags.js +48 -82
  267. package/lib/TableHtml5/header.js +66 -96
  268. package/lib/TableHtml5/index.js +8 -17
  269. package/lib/TableHtml5/section.js +111 -162
  270. package/lib/TableHtml5/sectionHeader.js +64 -102
  271. package/lib/TableHtml5/subHeader.js +68 -88
  272. package/lib/TableLayout/Box.js +54 -97
  273. package/lib/TableLayout/DnDItem.js +58 -98
  274. package/lib/TableLayout/TableLayout.js +140 -232
  275. package/lib/TableLayout/constants.js +8 -6
  276. package/lib/TableLayout/index.js +7 -12
  277. package/lib/TableLayout/lib.js +14 -9
  278. package/lib/TablePreview/TablePreview.js +118 -205
  279. package/lib/TablePreview/index.js +7 -12
  280. package/lib/TablePreview/lib.js +30 -19
  281. package/lib/TablePreview/styles.js +7 -6
  282. package/lib/Tag/Tag.js +19 -38
  283. package/lib/Tag/index.js +7 -12
  284. package/lib/ToggleButton/ToggleButton.js +33 -55
  285. package/lib/ToggleButton/index.js +7 -12
  286. package/lib/Tooltip/Tooltip.js +34 -50
  287. package/lib/Tooltip/index.js +7 -12
  288. package/lib/VerticalButton/VerticalButton.js +40 -46
  289. package/lib/VerticalButton/index.js +7 -12
  290. package/lib/index.js +137 -304
  291. package/lib/theme.js +31 -17
  292. package/lib/utils.js +46 -31
  293. package/package.json +2 -10
package/es/Chips/Chips.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import React, { Fragment } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import * as R from 'ramda';
4
3
  import cx from 'classnames';
5
4
  import { makeStyles, useTheme } from '@material-ui/core/styles';
@@ -10,8 +9,8 @@ import Chip from '@material-ui/core/Chip';
10
9
  import Cross from '../Icons/Cross';
11
10
  import { getIsRtl, withBlank } from '../utils';
12
11
  import Tooltip from '../Tooltip';
13
-
14
12
  var shownTooltip = R.pipe(R.dropLast(1), R.either(R.isEmpty, R.isNil), R.not);
13
+
15
14
  var myTooltipRenderer = function myTooltipRenderer(_ref) {
16
15
  var isRtl = _ref.isRtl,
17
16
  labelRenderer = _ref.labelRenderer;
@@ -66,7 +65,7 @@ export var useStyles = makeStyles(function (theme) {
66
65
  fontSize: 10
67
66
  },
68
67
  tooltipIndicator: {
69
- borderBottom: '1px dotted ' + theme.palette.primary.main
68
+ borderBottom: "1px dotted " + theme.palette.primary.main
70
69
  }
71
70
  };
72
71
  });
@@ -77,7 +76,7 @@ var CustomChip = function CustomChip(_ref2) {
77
76
  var id = _ref2.id,
78
77
  parentId = _ref2.parentId,
79
78
  _ref2$items = _ref2.items,
80
- items = _ref2$items === undefined ? [] : _ref2$items,
79
+ items = _ref2$items === void 0 ? [] : _ref2$items,
81
80
  label = _ref2.label,
82
81
  onDelete = _ref2.onDelete,
83
82
  renderer = _ref2.renderer,
@@ -85,178 +84,124 @@ var CustomChip = function CustomChip(_ref2) {
85
84
  iconClasses = _ref2.iconClasses,
86
85
  labelClasses = _ref2.labelClasses,
87
86
  _ref2$ariaLabel = _ref2.ariaLabel,
88
- ariaLabel = _ref2$ariaLabel === undefined ? 'delete' : _ref2$ariaLabel;
89
-
87
+ ariaLabel = _ref2$ariaLabel === void 0 ? 'delete' : _ref2$ariaLabel;
90
88
  var classes = useStyles();
91
89
  var onChange = R.is(Function)(onDelete) ? function () {
92
90
  return onDelete(parentId, R.isNil(id) ? [] : [id]);
93
91
  } : null;
94
92
  var hasTooltip = shownTooltip(items);
95
-
96
- return React.createElement(
97
- Tooltip,
98
- { placement: 'top', title: hasTooltip ? renderer(items) : '' },
99
- React.createElement(Chip, {
100
- size: 'small',
101
- 'aria-label': label,
102
- label: hasTooltip ? React.createElement(
103
- Fragment,
104
- null,
105
- '...',
106
- React.createElement(
107
- 'span',
108
- { className: classes.childrenIndicator },
109
- '>'
110
- ),
111
- label
112
- ) : label,
113
- deleteIcon: React.createElement(
114
- IconButton,
115
- {
116
- disableRipple: true,
117
- className: iconClasses,
118
- 'aria-label': ariaLabel + ' ' + label,
119
- component: 'span',
120
- tabIndex: -1
121
- },
122
- React.createElement(Cross, null)
123
- ),
124
- clickable: true,
125
- onDelete: onChange,
126
- className: cx(chipClasses, (_cx = {}, _cx[classes.tooltipIndicator] = hasTooltip, _cx)),
127
- classes: { label: labelClasses }
128
- })
129
- );
93
+ return /*#__PURE__*/React.createElement(Tooltip, {
94
+ placement: "top",
95
+ title: hasTooltip ? renderer(items) : ''
96
+ }, /*#__PURE__*/React.createElement(Chip, {
97
+ size: "small",
98
+ "aria-label": label,
99
+ label: hasTooltip ? /*#__PURE__*/React.createElement(Fragment, null, "...", /*#__PURE__*/React.createElement("span", {
100
+ className: classes.childrenIndicator
101
+ }, '>'), label) : label,
102
+ deleteIcon: /*#__PURE__*/React.createElement(IconButton, {
103
+ disableRipple: true,
104
+ className: iconClasses,
105
+ "aria-label": ariaLabel + " " + label,
106
+ component: "span",
107
+ tabIndex: -1
108
+ }, /*#__PURE__*/React.createElement(Cross, null)),
109
+ clickable: true,
110
+ onDelete: onChange,
111
+ className: cx(chipClasses, (_cx = {}, _cx[classes.tooltipIndicator] = hasTooltip, _cx)),
112
+ classes: {
113
+ label: labelClasses
114
+ }
115
+ }));
130
116
  };
131
117
 
132
- CustomChip.propTypes = process.env.NODE_ENV !== "production" ? {
133
- id: PropTypes.string,
134
- parentId: PropTypes.string,
135
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
136
- onDelete: PropTypes.func,
137
- renderer: PropTypes.func,
138
- chipClasses: PropTypes.string,
139
- iconClasses: PropTypes.string,
140
- labelClasses: PropTypes.string,
141
- ariaLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
142
- items: PropTypes.array
143
- } : {};
144
-
145
118
  var Chips = function Chips(_ref3) {
146
119
  var _ref3$items = _ref3.items,
147
- items = _ref3$items === undefined ? [] : _ref3$items,
120
+ items = _ref3$items === void 0 ? [] : _ref3$items,
148
121
  onDelete = _ref3.onDelete,
149
122
  onDeleteAll = _ref3.onDeleteAll,
150
123
  clearAllLabel = _ref3.clearAllLabel,
151
124
  _ref3$labelRenderer = _ref3.labelRenderer,
152
- labelRenderer = _ref3$labelRenderer === undefined ? R.prop('label') : _ref3$labelRenderer,
125
+ labelRenderer = _ref3$labelRenderer === void 0 ? R.prop('label') : _ref3$labelRenderer,
153
126
  tooltipRenderer = _ref3.tooltipRenderer,
154
127
  ariaLabel = _ref3.ariaLabel,
155
128
  _ref3$reducingNbChips = _ref3.reducingNbChips,
156
- reducingNbChips = _ref3$reducingNbChips === undefined ? 15 : _ref3$reducingNbChips,
129
+ reducingNbChips = _ref3$reducingNbChips === void 0 ? 15 : _ref3$reducingNbChips,
157
130
  labels = _ref3.labels;
158
-
159
131
  var classes = useStyles();
160
132
  var theme = useTheme();
161
133
  var isRtl = getIsRtl(theme);
162
-
163
- return React.createElement(
164
- 'div',
165
- { 'data-testid': 'chips-test-id' },
166
- R.map(function (itemProps) {
167
- var parentId = itemProps.id,
168
- isNotRemovable = itemProps.isNotRemovable,
169
- _itemProps$values = itemProps.values,
170
- values = _itemProps$values === undefined ? [] : _itemProps$values;
171
-
172
- return React.createElement(
173
- Grid,
174
- { container: true, className: classes.root, key: parentId },
175
- React.createElement(
176
- Grid,
177
- { item: true, xs: 12 },
178
- React.createElement(CustomChip, {
179
- parentId: parentId,
180
- label: labelRenderer(itemProps) + ':',
181
- ariaLabel: ariaLabel,
182
- chipClasses: cx(classes.mainChip, classes.chip),
183
- onDelete: isNotRemovable ? null : onDelete,
184
- iconClasses: classes.icon,
185
- labelClasses: cx(classes.spaceLabel, classes.formatLabel)
186
- }),
187
- R.pipe(R.length, R.flip(R.gt)(reducingNbChips))(values) ? React.createElement(CustomChip, {
188
- parentId: parentId,
189
- label: R.length(values) + ' ' + R.prop('reducingChip')(labels),
190
- chipClasses: cx(classes.secondaryChip, classes.chip),
191
- onDelete: isNotRemovable ? null : onDelete,
192
- iconClasses: classes.icon,
193
- labelClasses: cx(classes.formatLabel)
194
- }) : R.map(function (items) {
195
- var lastItem = R.last(items);
196
- var id = lastItem.id,
197
- isNotRemovable = lastItem.isNotRemovable;
198
-
199
- return React.createElement(CustomChip, {
200
- key: id,
201
- id: id,
202
- items: R.pipe(R.length, R.gte(2)) ? items : null,
203
- renderer: R.is(Function)(tooltipRenderer) ? tooltipRenderer : myTooltipRenderer({ isRtl: isRtl, labelRenderer: labelRenderer }),
204
- label: labelRenderer(lastItem),
205
- ariaLabel: ariaLabel,
206
- parentId: parentId,
207
- onDelete: isNotRemovable ? null : onDelete,
208
- chipClasses: cx(classes.secondaryChip, classes.chip),
209
- iconClasses: classes.icon,
210
- labelClasses: cx(classes.formatLabel)
211
- });
212
- })(values),
213
- React.createElement(Divider, { className: classes.divider })
214
- )
215
- );
216
- })(items),
217
- R.is(Function)(onDeleteAll) && React.createElement(
218
- Grid,
219
- { container: true, className: classes.root },
220
- React.createElement(
221
- Grid,
222
- { item: true, xs: 12 },
223
- React.createElement(CustomChip, {
224
- label: clearAllLabel,
225
- ariaLabel: ariaLabel,
226
- chipClasses: cx(classes.mainChip, classes.chip),
227
- onDelete: onDeleteAll,
228
- iconClasses: classes.icon,
229
- labelClasses: cx(classes.spaceLabel, classes.formatLabel)
230
- })
231
- )
232
- )
233
- );
134
+ return /*#__PURE__*/React.createElement("div", {
135
+ "data-testid": "chips-test-id"
136
+ }, R.map(function (itemProps) {
137
+ var parentId = itemProps.id,
138
+ isNotRemovable = itemProps.isNotRemovable,
139
+ _itemProps$values = itemProps.values,
140
+ values = _itemProps$values === void 0 ? [] : _itemProps$values;
141
+ return /*#__PURE__*/React.createElement(Grid, {
142
+ container: true,
143
+ className: classes.root,
144
+ key: parentId
145
+ }, /*#__PURE__*/React.createElement(Grid, {
146
+ item: true,
147
+ xs: 12
148
+ }, /*#__PURE__*/React.createElement(CustomChip, {
149
+ parentId: parentId,
150
+ label: labelRenderer(itemProps) + ":",
151
+ ariaLabel: ariaLabel,
152
+ chipClasses: cx(classes.mainChip, classes.chip),
153
+ onDelete: isNotRemovable ? null : onDelete,
154
+ iconClasses: classes.icon,
155
+ labelClasses: cx(classes.spaceLabel, classes.formatLabel)
156
+ }), R.pipe(R.length, R.flip(R.gt)(reducingNbChips))(values) ? /*#__PURE__*/React.createElement(CustomChip, {
157
+ parentId: parentId,
158
+ label: R.length(values) + " " + R.prop('reducingChip')(labels),
159
+ chipClasses: cx(classes.secondaryChip, classes.chip),
160
+ onDelete: isNotRemovable ? null : onDelete,
161
+ iconClasses: classes.icon,
162
+ labelClasses: cx(classes.formatLabel)
163
+ }) : R.map(function (items) {
164
+ var lastItem = R.last(items);
165
+ var id = lastItem.id,
166
+ isNotRemovable = lastItem.isNotRemovable;
167
+ return /*#__PURE__*/React.createElement(CustomChip, {
168
+ key: id,
169
+ id: id,
170
+ items: R.pipe(R.length, R.gte(2)) ? items : null,
171
+ renderer: R.is(Function)(tooltipRenderer) ? tooltipRenderer : myTooltipRenderer({
172
+ isRtl: isRtl,
173
+ labelRenderer: labelRenderer
174
+ }),
175
+ label: labelRenderer(lastItem),
176
+ ariaLabel: ariaLabel,
177
+ parentId: parentId,
178
+ onDelete: isNotRemovable ? null : onDelete,
179
+ chipClasses: cx(classes.secondaryChip, classes.chip),
180
+ iconClasses: classes.icon,
181
+ labelClasses: cx(classes.formatLabel)
182
+ });
183
+ })(values), /*#__PURE__*/React.createElement(Divider, {
184
+ className: classes.divider
185
+ })));
186
+ })(items), R.is(Function)(onDeleteAll) && /*#__PURE__*/React.createElement(Grid, {
187
+ container: true,
188
+ className: classes.root
189
+ }, /*#__PURE__*/React.createElement(Grid, {
190
+ item: true,
191
+ xs: 12
192
+ }, /*#__PURE__*/React.createElement(CustomChip, {
193
+ label: clearAllLabel,
194
+ ariaLabel: ariaLabel,
195
+ chipClasses: cx(classes.mainChip, classes.chip),
196
+ onDelete: onDeleteAll,
197
+ iconClasses: classes.icon,
198
+ labelClasses: cx(classes.spaceLabel, classes.formatLabel)
199
+ }))));
234
200
  };
235
201
 
236
- Chips.propTypes = process.env.NODE_ENV !== "production" ? {
237
- items: PropTypes.arrayOf(PropTypes.shape({
238
- id: PropTypes.string,
239
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
240
- isNotRemovable: PropTypes.bool,
241
- values: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.shape({
242
- id: PropTypes.string,
243
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
244
- isNotRemovable: PropTypes.bool
245
- })))
246
- })),
247
- clearAllLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
248
- onDelete: PropTypes.func,
249
- onDeleteAll: PropTypes.func,
250
- labelRenderer: PropTypes.func,
251
- tooltipRenderer: PropTypes.func,
252
- ariaLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
253
- reducingNbChips: PropTypes.number,
254
- labels: PropTypes.shape({
255
- reducingChip: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
256
- })
257
- } : {};
258
-
259
202
  export default withBlank(function (_ref4) {
260
203
  var isBlank = _ref4.isBlank;
261
- return { isBlank: isBlank };
204
+ return {
205
+ isBlank: isBlank
206
+ };
262
207
  })(Chips);
package/es/Chips/index.js CHANGED
@@ -56,5 +56,4 @@
56
56
  * }
57
57
  * // *tooltip indicator is the dotted line under a chip
58
58
  */
59
-
60
59
  export { default } from './Chips';
@@ -1,7 +1,5 @@
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
-
1
+ import _extends from "/builds/sis-cc/.stat-suite/dotstatsuite-visions/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/extends";
3
2
  import React, { useState, useEffect } from 'react';
4
- import PropTypes from 'prop-types';
5
3
  import * as R from 'ramda';
6
4
  import { makeStyles } from '@material-ui/core/styles';
7
5
  import useMediaQuery from '@material-ui/core/useMediaQuery';
@@ -10,10 +8,8 @@ import Collapse from '@material-ui/core/Collapse';
10
8
  import { ToggleButton } from '../';
11
9
  import Item from './Item';
12
10
  import Paper from './Paper';
13
-
14
11
  export var MAX_COLUMNS = 12;
15
12
  export var COLUMNS = [12, 12, 6, 4, 3, 3, 2, 2, 2, 2, 2, 2, 1];
16
-
17
13
  var useStyles = makeStyles(function () {
18
14
  return {
19
15
  collapseContainer: {
@@ -24,25 +20,23 @@ var useStyles = makeStyles(function () {
24
20
 
25
21
  var CollapseButtons = function CollapseButtons(props) {
26
22
  var _props$items = props.items,
27
- items = _props$items === undefined ? [] : _props$items,
23
+ items = _props$items === void 0 ? [] : _props$items,
28
24
  _props$action = props.action,
29
- action = _props$action === undefined ? function () {} : _props$action,
25
+ action = _props$action === void 0 ? function () {} : _props$action,
30
26
  _props$nbColumns = props.nbColumns,
31
- nbColumns = _props$nbColumns === undefined ? 3 : _props$nbColumns,
27
+ nbColumns = _props$nbColumns === void 0 ? 3 : _props$nbColumns,
32
28
  _props$testId = props.testId,
33
- testId = _props$testId === undefined ? 'collapseButton' : _props$testId,
29
+ testId = _props$testId === void 0 ? 'collapseButton' : _props$testId,
34
30
  isSecondLevelClikable = props.isSecondLevelClikable,
35
31
  _props$gridButtonsPro = props.gridButtonsProps,
36
- gridButtonsProps = _props$gridButtonsPro === undefined ? {} : _props$gridButtonsPro,
32
+ gridButtonsProps = _props$gridButtonsPro === void 0 ? {} : _props$gridButtonsPro,
37
33
  _props$breakpoint = props.breakpoint,
38
- breakpoint = _props$breakpoint === undefined ? function (theme) {
34
+ breakpoint = _props$breakpoint === void 0 ? function (theme) {
39
35
  return theme.breakpoints.down('sm');
40
36
  } : _props$breakpoint,
41
37
  justify = props.justify,
42
38
  _props$textTransform = props.textTransform,
43
- textTransform = _props$textTransform === undefined ? 'none' : _props$textTransform;
44
-
45
-
39
+ textTransform = _props$textTransform === void 0 ? 'none' : _props$textTransform;
46
40
  var classes = useStyles();
47
41
  var isMobileView = useMediaQuery(breakpoint);
48
42
 
@@ -59,9 +53,9 @@ var CollapseButtons = function CollapseButtons(props) {
59
53
 
60
54
  var getValues = function getValues(parentId) {
61
55
  return R.map(function (item) {
62
- return React.createElement(Item, {
56
+ return /*#__PURE__*/React.createElement(Item, {
63
57
  key: R.prop('id')(item),
64
- testId: testId + '_' + parentId + '_value_' + R.prop('id')(item),
58
+ testId: testId + "_" + parentId + "_value_" + R.prop('id')(item),
65
59
  parentId: parentId,
66
60
  item: item,
67
61
  action: action,
@@ -70,92 +64,58 @@ var CollapseButtons = function CollapseButtons(props) {
70
64
  });
71
65
  };
72
66
 
73
- return React.createElement(
74
- Grid,
75
- { container: true, spacing: 2, 'data-testid': testId, justifyContent: justify },
76
- R.map(function (_ref) {
77
- var id = _ref.id,
78
- label = _ref.label,
79
- _ref$values = _ref.values,
80
- values = _ref$values === undefined ? [] : _ref$values;
81
- return React.createElement(
82
- Grid,
83
- _extends({ item: true, xs: 12, sm: 12, md: R.nth(nbColumns)(COLUMNS) }, gridButtonsProps, { key: id }),
84
- React.createElement(ToggleButton, {
85
- textTransform: textTransform,
86
- label: label,
87
- tabindex: R.isNil(toggleId) || R.prop(id)(toggleId) || R.compose(R.not, R.head, R.values)(toggleId) ? 0 : -1,
88
- isOpen: R.prop(id)(toggleId),
89
- toggle: function toggle() {
90
- var _setIsOpen2;
67
+ return /*#__PURE__*/React.createElement(Grid, {
68
+ container: true,
69
+ spacing: 2,
70
+ "data-testid": testId,
71
+ justifyContent: justify
72
+ }, R.map(function (_ref) {
73
+ var id = _ref.id,
74
+ label = _ref.label,
75
+ _ref$values = _ref.values,
76
+ values = _ref$values === void 0 ? [] : _ref$values;
77
+ return /*#__PURE__*/React.createElement(Grid, _extends({
78
+ item: true,
79
+ xs: 12,
80
+ sm: 12,
81
+ md: R.nth(nbColumns)(COLUMNS)
82
+ }, gridButtonsProps, {
83
+ key: id
84
+ }), /*#__PURE__*/React.createElement(ToggleButton, {
85
+ textTransform: textTransform,
86
+ label: label,
87
+ tabindex: R.isNil(toggleId) || R.prop(id)(toggleId) || R.compose(R.not, R.head, R.values)(toggleId) ? 0 : -1,
88
+ isOpen: R.prop(id)(toggleId),
89
+ toggle: function toggle() {
90
+ var _setIsOpen2;
91
91
 
92
- return setIsOpen((_setIsOpen2 = {}, _setIsOpen2[id] = !R.prop(id)(toggleId), _setIsOpen2));
93
- },
94
- testId: testId + '_' + id,
95
- id: id
96
- }),
97
- isMobileView && React.createElement(
98
- Collapse,
99
- {
100
- 'in': R.prop(id)(toggleId),
101
- timeout: 'auto',
102
- unmountOnExit: true,
103
- className: classes.collapseContainer
104
- },
105
- React.createElement(
106
- Paper,
107
- { elevation: 10, isMobileView: isMobileView },
108
- getValues(id)(values)
109
- )
110
- )
111
- );
112
- })(items),
113
- !isMobileView && R.map(function (_ref2) {
114
- var id = _ref2.id,
115
- _ref2$values = _ref2.values,
116
- values = _ref2$values === undefined ? [] : _ref2$values;
117
- return React.createElement(
118
- Collapse,
119
- {
120
- 'in': R.prop(id)(toggleId),
121
- timeout: 'auto',
122
- unmountOnExit: true,
123
- key: id,
124
- className: classes.collapseContainer
125
- },
126
- React.createElement(
127
- Paper,
128
- { elevation: 10 },
129
- getValues(id)(values)
130
- )
131
- );
132
- })(items)
133
- );
92
+ return setIsOpen((_setIsOpen2 = {}, _setIsOpen2[id] = !R.prop(id)(toggleId), _setIsOpen2));
93
+ },
94
+ testId: testId + "_" + id,
95
+ id: id
96
+ }), isMobileView && /*#__PURE__*/React.createElement(Collapse, {
97
+ in: R.prop(id)(toggleId),
98
+ timeout: "auto",
99
+ unmountOnExit: true,
100
+ className: classes.collapseContainer
101
+ }, /*#__PURE__*/React.createElement(Paper, {
102
+ elevation: 10,
103
+ isMobileView: isMobileView
104
+ }, getValues(id)(values))));
105
+ })(items), !isMobileView && R.map(function (_ref2) {
106
+ var id = _ref2.id,
107
+ _ref2$values = _ref2.values,
108
+ values = _ref2$values === void 0 ? [] : _ref2$values;
109
+ return /*#__PURE__*/React.createElement(Collapse, {
110
+ in: R.prop(id)(toggleId),
111
+ timeout: "auto",
112
+ unmountOnExit: true,
113
+ key: id,
114
+ className: classes.collapseContainer
115
+ }, /*#__PURE__*/React.createElement(Paper, {
116
+ elevation: 10
117
+ }, getValues(id)(values)));
118
+ })(items));
134
119
  };
135
120
 
136
- CollapseButtons.propTypes = process.env.NODE_ENV !== "production" ? {
137
- testId: PropTypes.string,
138
- selectedItemId: PropTypes.string,
139
- items: PropTypes.arrayOf(PropTypes.shape({
140
- id: PropTypes.string.isRequired,
141
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
142
- svgPath: PropTypes.string,
143
- values: PropTypes.arrayOf(PropTypes.shape({
144
- id: PropTypes.string.isRequired,
145
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
146
- subtopics: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
147
- id: PropTypes.string.isRequired,
148
- label: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
149
- }), PropTypes.string]))
150
- }))
151
- })),
152
- action: PropTypes.func,
153
- nbColumns: PropTypes.number,
154
- isSecondLevelClikable: PropTypes.bool,
155
- breakpoint: PropTypes.func,
156
- gridButtonsProps: PropTypes.object,
157
- justify: PropTypes.string,
158
- textTransform: PropTypes.string
159
- } : {};
160
-
161
121
  export default CollapseButtons;
@@ -1,14 +1,11 @@
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
-
1
+ import _extends from "/builds/sis-cc/.stat-suite/dotstatsuite-visions/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/extends";
3
2
  import React from 'react';
4
- import PropTypes from 'prop-types';
5
3
  import * as R from 'ramda';
6
4
  import Grid from '@material-ui/core/Grid';
7
5
  import Button from '@material-ui/core/Button';
8
6
  import Link from '@material-ui/core/Link';
9
7
  import { makeStyles } from '@material-ui/core/styles';
10
8
  import SvgIcon from '@material-ui/core/SvgIcon';
11
-
12
9
  var useStyles = makeStyles(function (theme) {
13
10
  return {
14
11
  paperItem: {
@@ -52,74 +49,52 @@ var Item = function Item(_ref) {
52
49
  action = _ref.action,
53
50
  testId = _ref.testId,
54
51
  isSecondLevelClikable = _ref.isSecondLevelClikable;
55
-
56
52
  var classes = useStyles();
57
-
58
- return React.createElement(
59
- Grid,
60
- { item: true, md: 4, xs: 12, className: classes.paperItem },
61
- React.createElement(
62
- Button,
63
- {
64
- 'aria-label': R.prop('label')(item),
65
- className: classes.button,
66
- fullWidth: true,
67
- 'data-testid': testId,
68
- role: 'link',
69
- onClick: function onClick() {
70
- if (R.not(R.is(Function)(action))) return;
71
- action(parentId, R.prop('id')(item));
72
- },
73
- tabIndex: 0
53
+ return /*#__PURE__*/React.createElement(Grid, {
54
+ item: true,
55
+ md: 4,
56
+ xs: 12,
57
+ className: classes.paperItem
58
+ }, /*#__PURE__*/React.createElement(Button, {
59
+ "aria-label": R.prop('label')(item),
60
+ className: classes.button,
61
+ fullWidth: true,
62
+ "data-testid": testId,
63
+ role: "link",
64
+ onClick: function onClick() {
65
+ if (R.not(R.is(Function)(action))) return;
66
+ action(parentId, R.prop('id')(item));
67
+ },
68
+ tabIndex: 0
69
+ }, /*#__PURE__*/React.createElement(SvgIcon, {
70
+ className: classes.svg
71
+ }, /*#__PURE__*/React.createElement("path", {
72
+ d: R.prop('svgPath')(item)
73
+ })), /*#__PURE__*/React.createElement(Grid, {
74
+ container: true,
75
+ item: true,
76
+ xs: 12,
77
+ direction: "column"
78
+ }, /*#__PURE__*/React.createElement("span", {
79
+ className: classes.itemTitle
80
+ }, R.prop('label')(item)), /*#__PURE__*/React.createElement("span", {
81
+ className: classes.itemSubtitle
82
+ }, R.map(function (subtopic) {
83
+ if (R.not(R.is(Object)(subtopic))) return subtopic;
84
+ if (R.not(isSecondLevelClikable)) return R.prop('label')(subtopic);
85
+ var id = R.prop('id')(subtopic);
86
+ return /*#__PURE__*/React.createElement(Link, {
87
+ key: id,
88
+ className: classes.itemSubtitleLink,
89
+ role: "link",
90
+ onClick: function onClick(e) {
91
+ if (R.not(R.is(Function)(action))) return;
92
+ action(parentId, id);
93
+ e.stopPropagation();
74
94
  },
75
- React.createElement(
76
- SvgIcon,
77
- { className: classes.svg },
78
- React.createElement('path', { d: R.prop('svgPath')(item) })
79
- ),
80
- React.createElement(
81
- Grid,
82
- { container: true, item: true, xs: 12, direction: 'column' },
83
- React.createElement(
84
- 'span',
85
- { className: classes.itemTitle },
86
- R.prop('label')(item)
87
- ),
88
- React.createElement(
89
- 'span',
90
- { className: classes.itemSubtitle },
91
- R.map(function (subtopic) {
92
- if (R.not(R.is(Object)(subtopic))) return subtopic;
93
- if (R.not(isSecondLevelClikable)) return R.prop('label')(subtopic);
94
- var id = R.prop('id')(subtopic);
95
- return React.createElement(
96
- Link,
97
- {
98
- key: id,
99
- className: classes.itemSubtitleLink,
100
- role: 'link',
101
- onClick: function onClick(e) {
102
- if (R.not(R.is(Function)(action))) return;
103
- action(parentId, id);
104
- e.stopPropagation();
105
- },
106
- tabIndex: 0
107
- },
108
- R.prop('label')(subtopic)
109
- );
110
- })(R.pipe(R.propOr([], 'subtopics'), R.intersperse(' • '))(item))
111
- )
112
- )
113
- )
114
- );
95
+ tabIndex: 0
96
+ }, R.prop('label')(subtopic));
97
+ })(R.pipe(R.propOr([], 'subtopics'), R.intersperse(' • '))(item))))));
115
98
  };
116
99
 
117
- Item.propTypes = process.env.NODE_ENV !== "production" ? {
118
- parentId: PropTypes.string,
119
- testId: PropTypes.string,
120
- item: PropTypes.object,
121
- action: PropTypes.func,
122
- isSecondLevelClikable: PropTypes.bool
123
- } : {};
124
-
125
100
  export default Item;