@dhis2-ui/select 8.2.0 → 8.2.1

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 (71) hide show
  1. package/build/cjs/multi-select/features/menu_width_matches_input/index.js +4 -2
  2. package/build/cjs/multi-select/features/position/index.js +12 -6
  3. package/build/cjs/multi-select/filterable-menu.js +25 -22
  4. package/build/cjs/multi-select/input.js +19 -18
  5. package/build/cjs/multi-select/menu.js +29 -25
  6. package/build/cjs/multi-select/multi-select.js +31 -30
  7. package/build/cjs/multi-select/multi-select.stories.e2e.js +30 -20
  8. package/build/cjs/multi-select/multi-select.stories.js +14 -23
  9. package/build/cjs/multi-select/selection-list.js +43 -37
  10. package/build/cjs/multi-select-field/multi-select-field.stories.js +5 -15
  11. package/build/cjs/multi-select-option/multi-select-option.js +31 -28
  12. package/build/cjs/select/debounce/debounce.js +8 -2
  13. package/build/cjs/select/empty.js +14 -11
  14. package/build/cjs/select/filter-input.js +24 -21
  15. package/build/cjs/select/filterable-menu.js +8 -7
  16. package/build/cjs/select/index.js +24 -24
  17. package/build/cjs/select/input-clear-button.js +16 -13
  18. package/build/cjs/select/input-placeholder.js +8 -6
  19. package/build/cjs/select/input-prefix.js +8 -6
  20. package/build/cjs/select/input-wrapper.js +15 -14
  21. package/build/cjs/select/loading.js +18 -15
  22. package/build/cjs/select/menu-wrapper.js +11 -10
  23. package/build/cjs/select/no-match.js +12 -9
  24. package/build/cjs/select/option-helpers.js +1 -1
  25. package/build/cjs/select/select.js +6 -6
  26. package/build/cjs/single-select/features/menu_width_matches_input/index.js +4 -2
  27. package/build/cjs/single-select/features/position/index.js +8 -4
  28. package/build/cjs/single-select/filterable-menu.js +25 -22
  29. package/build/cjs/single-select/input.js +19 -18
  30. package/build/cjs/single-select/menu.js +11 -10
  31. package/build/cjs/single-select/selection.js +8 -7
  32. package/build/cjs/single-select/single-select.js +31 -30
  33. package/build/cjs/single-select/single-select.stories.e2e.js +26 -17
  34. package/build/cjs/single-select/single-select.stories.js +14 -21
  35. package/build/cjs/single-select-field/single-select-field.stories.js +5 -15
  36. package/build/cjs/single-select-option/single-select-option.js +23 -20
  37. package/build/es/multi-select/features/menu_width_matches_input/index.js +4 -2
  38. package/build/es/multi-select/features/position/index.js +12 -6
  39. package/build/es/multi-select/filterable-menu.js +25 -22
  40. package/build/es/multi-select/input.js +19 -18
  41. package/build/es/multi-select/menu.js +28 -24
  42. package/build/es/multi-select/multi-select.js +31 -30
  43. package/build/es/multi-select/multi-select.stories.e2e.js +30 -20
  44. package/build/es/multi-select/multi-select.stories.js +13 -22
  45. package/build/es/multi-select/selection-list.js +43 -37
  46. package/build/es/multi-select-field/multi-select-field.stories.js +4 -14
  47. package/build/es/multi-select-option/multi-select-option.js +31 -28
  48. package/build/es/select/debounce/debounce.js +8 -2
  49. package/build/es/select/empty.js +14 -11
  50. package/build/es/select/filter-input.js +24 -21
  51. package/build/es/select/filterable-menu.js +8 -7
  52. package/build/es/select/input-clear-button.js +16 -13
  53. package/build/es/select/input-placeholder.js +8 -6
  54. package/build/es/select/input-prefix.js +8 -6
  55. package/build/es/select/input-wrapper.js +15 -14
  56. package/build/es/select/loading.js +18 -15
  57. package/build/es/select/menu-wrapper.js +11 -10
  58. package/build/es/select/no-match.js +12 -9
  59. package/build/es/select/select.js +6 -6
  60. package/build/es/single-select/features/menu_width_matches_input/index.js +4 -2
  61. package/build/es/single-select/features/position/index.js +8 -4
  62. package/build/es/single-select/filterable-menu.js +25 -22
  63. package/build/es/single-select/input.js +19 -18
  64. package/build/es/single-select/menu.js +11 -10
  65. package/build/es/single-select/selection.js +8 -7
  66. package/build/es/single-select/single-select.js +31 -30
  67. package/build/es/single-select/single-select.stories.e2e.js +26 -17
  68. package/build/es/single-select/single-select.stories.js +13 -20
  69. package/build/es/single-select-field/single-select-field.stories.js +4 -14
  70. package/build/es/single-select-option/single-select-option.js +23 -20
  71. package/package.json +14 -14
@@ -3,17 +3,20 @@ import { colors, spacers, theme } from '@dhis2/ui-constants';
3
3
  import PropTypes from 'prop-types';
4
4
  import React from 'react';
5
5
 
6
- const Empty = ({
7
- message,
8
- className,
9
- dataTest
10
- }) => /*#__PURE__*/React.createElement("div", {
11
- "data-test": dataTest,
12
- className: _JSXStyle.dynamic([["849993029", [colors.grey700, theme.fonts, spacers.dp8, spacers.dp24]]]) + " " + (className || "")
13
- }, message, /*#__PURE__*/React.createElement(_JSXStyle, {
14
- id: "849993029",
15
- dynamic: [colors.grey700, theme.fonts, spacers.dp8, spacers.dp24]
16
- }, [`div.__jsx-style-dynamic-selector{color:${colors.grey700};font-family:${theme.fonts};font-size:13px;line-height:16px;padding:${spacers.dp8} ${spacers.dp24};text-align:center;}`]));
6
+ const Empty = _ref => {
7
+ let {
8
+ message,
9
+ className,
10
+ dataTest
11
+ } = _ref;
12
+ return /*#__PURE__*/React.createElement("div", {
13
+ "data-test": dataTest,
14
+ className: _JSXStyle.dynamic([["849993029", [colors.grey700, theme.fonts, spacers.dp8, spacers.dp24]]]) + " " + (className || "")
15
+ }, message, /*#__PURE__*/React.createElement(_JSXStyle, {
16
+ id: "849993029",
17
+ dynamic: [colors.grey700, theme.fonts, spacers.dp8, spacers.dp24]
18
+ }, ["div.__jsx-style-dynamic-selector{color:".concat(colors.grey700, ";font-family:").concat(theme.fonts, ";font-size:13px;line-height:16px;padding:").concat(spacers.dp8, " ").concat(spacers.dp24, ";text-align:center;}")]));
19
+ };
17
20
 
18
21
  Empty.propTypes = {
19
22
  dataTest: PropTypes.string.isRequired,
@@ -4,27 +4,30 @@ import { spacers, colors } from '@dhis2/ui-constants';
4
4
  import PropTypes from 'prop-types';
5
5
  import React from 'react';
6
6
 
7
- const FilterInput = ({
8
- value,
9
- onChange,
10
- placeholder,
11
- className,
12
- dataTest
13
- }) => /*#__PURE__*/React.createElement("div", {
14
- className: _JSXStyle.dynamic([["1544004171", [colors.white, spacers.dp8, spacers.dp8, spacers.dp4, spacers.dp8]]]) + " " + (className || "")
15
- }, /*#__PURE__*/React.createElement(Input, {
16
- dense: true,
17
- dataTest: dataTest,
18
- value: value,
19
- onChange: onChange,
20
- type: "text",
21
- name: "filter",
22
- placeholder: placeholder,
23
- initialFocus: true
24
- }), /*#__PURE__*/React.createElement(_JSXStyle, {
25
- id: "1544004171",
26
- dynamic: [colors.white, spacers.dp8, spacers.dp8, spacers.dp4, spacers.dp8]
27
- }, [`div.__jsx-style-dynamic-selector{position:-webkit-sticky;position:sticky;top:0;background:${colors.white};padding:${spacers.dp8} ${spacers.dp8} ${spacers.dp4} ${spacers.dp8};z-index:1;}`]));
7
+ const FilterInput = _ref => {
8
+ let {
9
+ value,
10
+ onChange,
11
+ placeholder,
12
+ className,
13
+ dataTest
14
+ } = _ref;
15
+ return /*#__PURE__*/React.createElement("div", {
16
+ className: _JSXStyle.dynamic([["1544004171", [colors.white, spacers.dp8, spacers.dp8, spacers.dp4, spacers.dp8]]]) + " " + (className || "")
17
+ }, /*#__PURE__*/React.createElement(Input, {
18
+ dense: true,
19
+ dataTest: dataTest,
20
+ value: value,
21
+ onChange: onChange,
22
+ type: "text",
23
+ name: "filter",
24
+ placeholder: placeholder,
25
+ initialFocus: true
26
+ }), /*#__PURE__*/React.createElement(_JSXStyle, {
27
+ id: "1544004171",
28
+ dynamic: [colors.white, spacers.dp8, spacers.dp8, spacers.dp4, spacers.dp8]
29
+ }, ["div.__jsx-style-dynamic-selector{position:-webkit-sticky;position:sticky;top:0;background:".concat(colors.white, ";padding:").concat(spacers.dp8, " ").concat(spacers.dp8, " ").concat(spacers.dp4, " ").concat(spacers.dp8, ";z-index:1;}")]));
30
+ };
28
31
 
29
32
  FilterInput.propTypes = {
30
33
  dataTest: PropTypes.string.isRequired,
@@ -8,16 +8,17 @@ import { FilterInput } from './filter-input.js';
8
8
  import { NoMatch } from './no-match.js';
9
9
  import { filterIgnored, checkIfValidOption } from './option-helpers.js';
10
10
  export class FilterableMenu extends Component {
11
- constructor(...args) {
12
- super(...args);
11
+ constructor() {
12
+ super(...arguments);
13
13
 
14
14
  _defineProperty(this, "state", {
15
15
  filter: ''
16
16
  });
17
17
 
18
- _defineProperty(this, "onFilterChange", ({
19
- value
20
- }) => {
18
+ _defineProperty(this, "onFilterChange", _ref => {
19
+ let {
20
+ value
21
+ } = _ref;
21
22
  this.setState({
22
23
  filter: value
23
24
  });
@@ -52,7 +53,7 @@ export class FilterableMenu extends Component {
52
53
 
53
54
  if (React.Children.count(renderedOptions) === 0 || !filter) {
54
55
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FilterInput, {
55
- dataTest: `${dataTest}-filterinput`,
56
+ dataTest: "".concat(dataTest, "-filterinput"),
56
57
  placeholder: placeholder,
57
58
  value: filter,
58
59
  onChange: this.onFilterChange
@@ -77,7 +78,7 @@ export class FilterableMenu extends Component {
77
78
  });
78
79
  const hasMatch = React.Children.count(filtered) > 0;
79
80
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FilterInput, {
80
- dataTest: `${dataTest}-filterinput`,
81
+ dataTest: "".concat(dataTest, "-filterinput"),
81
82
  placeholder: placeholder,
82
83
  value: filter,
83
84
  onChange: this.onFilterChange
@@ -2,19 +2,22 @@ import { Button } from '@dhis2-ui/button';
2
2
  import PropTypes from 'prop-types';
3
3
  import React from 'react';
4
4
 
5
- const InputClearButton = ({
6
- onClear,
7
- clearText,
8
- className,
9
- dataTest
10
- }) => /*#__PURE__*/React.createElement(Button, {
11
- small: true,
12
- secondary: true,
13
- dataTest: dataTest,
14
- onClick: onClear,
15
- type: "button",
16
- className: className
17
- }, clearText);
5
+ const InputClearButton = _ref => {
6
+ let {
7
+ onClear,
8
+ clearText,
9
+ className,
10
+ dataTest
11
+ } = _ref;
12
+ return /*#__PURE__*/React.createElement(Button, {
13
+ small: true,
14
+ secondary: true,
15
+ dataTest: dataTest,
16
+ onClick: onClear,
17
+ type: "button",
18
+ className: className
19
+ }, clearText);
20
+ };
18
21
 
19
22
  InputClearButton.propTypes = {
20
23
  clearText: PropTypes.string.isRequired,
@@ -3,11 +3,13 @@ import { colors } from '@dhis2/ui-constants';
3
3
  import PropTypes from 'prop-types';
4
4
  import React from 'react';
5
5
 
6
- const InputPlaceholder = ({
7
- placeholder,
8
- className,
9
- dataTest
10
- }) => {
6
+ const InputPlaceholder = _ref => {
7
+ let {
8
+ placeholder,
9
+ className,
10
+ dataTest
11
+ } = _ref;
12
+
11
13
  if (!placeholder) {
12
14
  return null;
13
15
  }
@@ -18,7 +20,7 @@ const InputPlaceholder = ({
18
20
  }, placeholder, /*#__PURE__*/React.createElement(_JSXStyle, {
19
21
  id: "1027033961",
20
22
  dynamic: [colors.grey600]
21
- }, [`div.__jsx-style-dynamic-selector{color:${colors.grey600};-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}`]));
23
+ }, ["div.__jsx-style-dynamic-selector{color:".concat(colors.grey600, ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}")]));
22
24
  };
23
25
 
24
26
  InputPlaceholder.propTypes = {
@@ -3,11 +3,13 @@ import { colors, spacers } from '@dhis2/ui-constants';
3
3
  import PropTypes from 'prop-types';
4
4
  import React from 'react';
5
5
 
6
- const InputPrefix = ({
7
- prefix,
8
- className,
9
- dataTest
10
- }) => {
6
+ const InputPrefix = _ref => {
7
+ let {
8
+ prefix,
9
+ className,
10
+ dataTest
11
+ } = _ref;
12
+
11
13
  if (!prefix) {
12
14
  return null;
13
15
  }
@@ -18,7 +20,7 @@ const InputPrefix = ({
18
20
  }, prefix, /*#__PURE__*/React.createElement(_JSXStyle, {
19
21
  id: "153011991",
20
22
  dynamic: [colors.grey600, spacers.dp4]
21
- }, [`div.__jsx-style-dynamic-selector{color:${colors.grey600};padding-right:${spacers.dp4};font-size:14px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}`]));
23
+ }, ["div.__jsx-style-dynamic-selector{color:".concat(colors.grey600, ";padding-right:").concat(spacers.dp4, ";font-size:14px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}")]));
22
24
  };
23
25
 
24
26
  InputPrefix.propTypes = {
@@ -5,19 +5,20 @@ import cx from 'classnames';
5
5
  import PropTypes from 'prop-types';
6
6
  import React from 'react';
7
7
 
8
- const InputWrapper = ({
9
- dataTest,
10
- onToggle,
11
- children,
12
- tabIndex,
13
- error,
14
- warning,
15
- valid,
16
- disabled,
17
- dense,
18
- className,
19
- inputRef
20
- }) => {
8
+ const InputWrapper = _ref => {
9
+ let {
10
+ dataTest,
11
+ onToggle,
12
+ children,
13
+ tabIndex,
14
+ error,
15
+ warning,
16
+ valid,
17
+ disabled,
18
+ dense,
19
+ className,
20
+ inputRef
21
+ } = _ref;
21
22
  const classNames = cx(className, 'root', {
22
23
  error,
23
24
  warning,
@@ -38,7 +39,7 @@ const InputWrapper = ({
38
39
  }, /*#__PURE__*/React.createElement(IconChevronDown16, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
39
40
  id: "248041060",
40
41
  dynamic: [colors.grey500, theme.focus, theme.focus, theme.valid, theme.warning, theme.error, colors.grey100, colors.grey500, theme.disabled]
41
- }, [`.root.__jsx-style-dynamic-selector{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:white;border-radius:3px;border:1px solid ${colors.grey500};box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;min-height:40px;padding:6px 12px;box-shadow:inset 0 1px 2px 0 rgba(48,54,60,0.1);}`, `.root.__jsx-style-dynamic-selector:not(.disabled):focus,.root.__jsx-style-dynamic-selector:not(.disabled):active{outline:none;box-shadow:inset 0 0 0 2px ${theme.focus};border-color:${theme.focus};}`, `.root.valid.__jsx-style-dynamic-selector{border-color:${theme.valid};}`, `.root.warning.__jsx-style-dynamic-selector{border-color:${theme.warning};}`, `.root.error.__jsx-style-dynamic-selector{border-color:${theme.error};}`, `.root.disabled.__jsx-style-dynamic-selector{background-color:${colors.grey100};border-color:${colors.grey500};color:${theme.disabled};cursor:not-allowed;}`, ".root.dense.__jsx-style-dynamic-selector{padding:4px 8px;min-height:32px;}", ".root-children.__jsx-style-dynamic-selector{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".root-right.__jsx-style-dynamic-selector{margin:4px 0px 0px 8px;}"]));
42
+ }, [".root.__jsx-style-dynamic-selector{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:white;border-radius:3px;border:1px solid ".concat(colors.grey500, ";box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;min-height:40px;padding:6px 12px;box-shadow:inset 0 1px 2px 0 rgba(48,54,60,0.1);}"), ".root.__jsx-style-dynamic-selector:not(.disabled):focus,.root.__jsx-style-dynamic-selector:not(.disabled):active{outline:none;box-shadow:inset 0 0 0 2px ".concat(theme.focus, ";border-color:").concat(theme.focus, ";}"), ".root.valid.__jsx-style-dynamic-selector{border-color:".concat(theme.valid, ";}"), ".root.warning.__jsx-style-dynamic-selector{border-color:".concat(theme.warning, ";}"), ".root.error.__jsx-style-dynamic-selector{border-color:".concat(theme.error, ";}"), ".root.disabled.__jsx-style-dynamic-selector{background-color:".concat(colors.grey100, ";border-color:").concat(colors.grey500, ";color:").concat(theme.disabled, ";cursor:not-allowed;}"), ".root.dense.__jsx-style-dynamic-selector{padding:4px 8px;min-height:32px;}", ".root-children.__jsx-style-dynamic-selector{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".root-right.__jsx-style-dynamic-selector{margin:4px 0px 0px 8px;}"]));
42
43
  };
43
44
 
44
45
  InputWrapper.defaultProps = {
@@ -4,21 +4,24 @@ import { colors, spacers, theme } from '@dhis2/ui-constants';
4
4
  import cx from 'classnames';
5
5
  import PropTypes from 'prop-types';
6
6
  import React from 'react';
7
- export const Loading = ({
8
- message,
9
- className,
10
- dataTest
11
- }) => /*#__PURE__*/React.createElement("div", {
12
- "data-test": dataTest,
13
- className: _JSXStyle.dynamic([["1068210086", [spacers.dp16, colors.grey700, theme.fonts, spacers.dp8, spacers.dp24]]]) + " " + (cx(className, 'container') || "")
14
- }, /*#__PURE__*/React.createElement("div", {
15
- className: _JSXStyle.dynamic([["1068210086", [spacers.dp16, colors.grey700, theme.fonts, spacers.dp8, spacers.dp24]]])
16
- }, /*#__PURE__*/React.createElement(CircularLoader, {
17
- small: true
18
- })), message, /*#__PURE__*/React.createElement(_JSXStyle, {
19
- id: "1068210086",
20
- dynamic: [spacers.dp16, colors.grey700, theme.fonts, spacers.dp8, spacers.dp24]
21
- }, [`.container.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:${spacers.dp16};-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;color:${colors.grey700};font-family:${theme.fonts};font-size:13px;padding:${spacers.dp8} ${spacers.dp24};}`]));
7
+ export const Loading = _ref => {
8
+ let {
9
+ message,
10
+ className,
11
+ dataTest
12
+ } = _ref;
13
+ return /*#__PURE__*/React.createElement("div", {
14
+ "data-test": dataTest,
15
+ className: _JSXStyle.dynamic([["1068210086", [spacers.dp16, colors.grey700, theme.fonts, spacers.dp8, spacers.dp24]]]) + " " + (cx(className, 'container') || "")
16
+ }, /*#__PURE__*/React.createElement("div", {
17
+ className: _JSXStyle.dynamic([["1068210086", [spacers.dp16, colors.grey700, theme.fonts, spacers.dp8, spacers.dp24]]])
18
+ }, /*#__PURE__*/React.createElement(CircularLoader, {
19
+ small: true
20
+ })), message, /*#__PURE__*/React.createElement(_JSXStyle, {
21
+ id: "1068210086",
22
+ dynamic: [spacers.dp16, colors.grey700, theme.fonts, spacers.dp8, spacers.dp24]
23
+ }, [".container.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:".concat(spacers.dp16, ";-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;color:").concat(colors.grey700, ";font-family:").concat(theme.fonts, ";font-size:13px;padding:").concat(spacers.dp8, " ").concat(spacers.dp24, ";}")]));
24
+ };
22
25
  Loading.propTypes = {
23
26
  dataTest: PropTypes.string.isRequired,
24
27
  className: PropTypes.string,
@@ -5,14 +5,15 @@ import { colors, elevations } from '@dhis2/ui-constants';
5
5
  import PropTypes from 'prop-types';
6
6
  import React from 'react';
7
7
 
8
- const MenuWrapper = ({
9
- children,
10
- dataTest,
11
- maxHeight,
12
- menuWidth,
13
- onClick,
14
- selectRef
15
- }) => {
8
+ const MenuWrapper = _ref => {
9
+ let {
10
+ children,
11
+ dataTest,
12
+ maxHeight,
13
+ menuWidth,
14
+ onClick,
15
+ selectRef
16
+ } = _ref;
16
17
  return /*#__PURE__*/React.createElement(Layer, {
17
18
  onClick: onClick,
18
19
  transparent: true
@@ -21,12 +22,12 @@ const MenuWrapper = ({
21
22
  placement: "bottom-start",
22
23
  observeReferenceResize: true
23
24
  }, /*#__PURE__*/React.createElement("div", {
24
- "data-test": `${dataTest}-menuwrapper`,
25
+ "data-test": "".concat(dataTest, "-menuwrapper"),
25
26
  className: _JSXStyle.dynamic([["1363246346", [menuWidth, maxHeight, colors.white, colors.grey200, elevations.e300]]])
26
27
  }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
27
28
  id: "1363246346",
28
29
  dynamic: [menuWidth, maxHeight, colors.white, colors.grey200, elevations.e300]
29
- }, [`div.__jsx-style-dynamic-selector{width:${menuWidth};height:auto;max-height:${maxHeight};overflow:auto;background:${colors.white};border:1px solid ${colors.grey200};border-radius:3px;box-shadow:${elevations.e300};}`]))));
30
+ }, ["div.__jsx-style-dynamic-selector{width:".concat(menuWidth, ";height:auto;max-height:").concat(maxHeight, ";overflow:auto;background:").concat(colors.white, ";border:1px solid ").concat(colors.grey200, ";border-radius:3px;box-shadow:").concat(elevations.e300, ";}")]))));
30
31
  };
31
32
 
32
33
  MenuWrapper.defaultProps = {
@@ -3,15 +3,18 @@ import { colors, spacers, theme } from '@dhis2/ui-constants';
3
3
  import PropTypes from 'prop-types';
4
4
  import React from 'react';
5
5
 
6
- const NoMatch = ({
7
- message,
8
- className
9
- }) => /*#__PURE__*/React.createElement("div", {
10
- className: _JSXStyle.dynamic([["849993029", [colors.grey700, theme.fonts, spacers.dp8, spacers.dp24]]]) + " " + (className || "")
11
- }, message, /*#__PURE__*/React.createElement(_JSXStyle, {
12
- id: "849993029",
13
- dynamic: [colors.grey700, theme.fonts, spacers.dp8, spacers.dp24]
14
- }, [`div.__jsx-style-dynamic-selector{color:${colors.grey700};font-family:${theme.fonts};font-size:13px;line-height:16px;padding:${spacers.dp8} ${spacers.dp24};text-align:center;}`]));
6
+ const NoMatch = _ref => {
7
+ let {
8
+ message,
9
+ className
10
+ } = _ref;
11
+ return /*#__PURE__*/React.createElement("div", {
12
+ className: _JSXStyle.dynamic([["849993029", [colors.grey700, theme.fonts, spacers.dp8, spacers.dp24]]]) + " " + (className || "")
13
+ }, message, /*#__PURE__*/React.createElement(_JSXStyle, {
14
+ id: "849993029",
15
+ dynamic: [colors.grey700, theme.fonts, spacers.dp8, spacers.dp24]
16
+ }, ["div.__jsx-style-dynamic-selector{color:".concat(colors.grey700, ";font-family:").concat(theme.fonts, ";font-size:13px;line-height:16px;padding:").concat(spacers.dp8, " ").concat(spacers.dp24, ";text-align:center;}")]));
17
+ };
15
18
 
16
19
  NoMatch.propTypes = {
17
20
  message: PropTypes.string.isRequired,
@@ -12,8 +12,8 @@ const SPACE_KEY = 32;
12
12
  const UP_KEY = 38;
13
13
  const DOWN_KEY = 40;
14
14
  export class Select extends Component {
15
- constructor(...args) {
16
- super(...args);
15
+ constructor() {
16
+ super(...arguments);
17
17
 
18
18
  _defineProperty(this, "state", {
19
19
  open: false,
@@ -154,8 +154,8 @@ export class Select extends Component {
154
154
  menuWidth
155
155
  } = this.state;
156
156
 
157
- if (offsetWidth && `${offsetWidth}px` !== menuWidth) {
158
- return `${offsetWidth}px`;
157
+ if (offsetWidth && "".concat(offsetWidth, "px") !== menuWidth) {
158
+ return "".concat(offsetWidth, "px");
159
159
  }
160
160
 
161
161
  return menuWidth;
@@ -212,13 +212,13 @@ export class Select extends Component {
212
212
  valid: valid,
213
213
  disabled: disabled,
214
214
  dense: dense,
215
- dataTest: `${dataTest}-input`
215
+ dataTest: "".concat(dataTest, "-input")
216
216
  }, input), open && /*#__PURE__*/React.createElement(MenuWrapper, {
217
217
  onClick: this.onOutsideClick,
218
218
  maxHeight: maxHeight,
219
219
  selectRef: this.selectRef,
220
220
  menuWidth: menuWidth,
221
- dataTest: `${dataTest}-menu`
221
+ dataTest: "".concat(dataTest, "-menu")
222
222
  }, menu));
223
223
  }
224
224
 
@@ -24,7 +24,8 @@ When('the SingleSelect menu is open', () => {
24
24
  Then('the SingleSelect input is left aligned with the menu', () => {
25
25
  const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
26
26
  const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
27
- cy.getAll(selectDataTest, menuDataTest).should(([inputs, menus]) => {
27
+ cy.getAll(selectDataTest, menuDataTest).should(_ref => {
28
+ let [inputs, menus] = _ref;
28
29
  expect(inputs.length).to.equal(1);
29
30
  expect(menus.length).to.equal(1);
30
31
  const $input = inputs[0];
@@ -37,7 +38,8 @@ Then('the SingleSelect input is left aligned with the menu', () => {
37
38
  When('the SingleSelect input and menu have the same width', () => {
38
39
  const inputSelector = '[data-test="dhis2-uicore-select"]';
39
40
  const menuSelector = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
40
- cy.getAll(inputSelector, menuSelector).should(([$input, $menu]) => {
41
+ cy.getAll(inputSelector, menuSelector).should(_ref2 => {
42
+ let [$input, $menu] = _ref2;
41
43
  const inputWidth = Math.round($input.outerWidth());
42
44
  const menuWidth = Math.round($menu.outerWidth());
43
45
  expect(inputWidth).to.equal(menuWidth);
@@ -21,7 +21,8 @@ When('the window is scrolled down', () => {
21
21
  Then('the top of the menu is aligned with the bottom of the input', () => {
22
22
  const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
23
23
  const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
24
- cy.getAll(selectDataTest, menuDataTest).should(([selects, menus]) => {
24
+ cy.getAll(selectDataTest, menuDataTest).should(_ref => {
25
+ let [selects, menus] = _ref;
25
26
  expect(selects.length).to.equal(1);
26
27
  expect(menus.length).to.equal(1);
27
28
  const $select = selects[0];
@@ -34,7 +35,8 @@ Then('the top of the menu is aligned with the bottom of the input', () => {
34
35
  Then('the bottom of the menu is aligned with the top of the input', () => {
35
36
  const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
36
37
  const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
37
- cy.getAll(selectDataTest, menuDataTest).should(([selects, menus]) => {
38
+ cy.getAll(selectDataTest, menuDataTest).should(_ref2 => {
39
+ let [selects, menus] = _ref2;
38
40
  expect(selects.length).to.equal(1);
39
41
  expect(menus.length).to.equal(1);
40
42
  const $select = selects[0];
@@ -47,7 +49,8 @@ Then('the bottom of the menu is aligned with the top of the input', () => {
47
49
  Then('it is rendered on top of the SingleSelect', () => {
48
50
  const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
49
51
  const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
50
- cy.getAll(selectDataTest, menuDataTest).should(([selects, menus]) => {
52
+ cy.getAll(selectDataTest, menuDataTest).should(_ref3 => {
53
+ let [selects, menus] = _ref3;
51
54
  expect(selects.length).to.equal(1);
52
55
  expect(menus.length).to.equal(1);
53
56
  const $select = selects[0];
@@ -61,7 +64,8 @@ Then('it is rendered on top of the SingleSelect', () => {
61
64
  Then('the left of the SingleSelect is aligned with the left of the anchor', () => {
62
65
  const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
63
66
  const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
64
- cy.getAll(selectDataTest, menuDataTest).should(([selects, menus]) => {
67
+ cy.getAll(selectDataTest, menuDataTest).should(_ref4 => {
68
+ let [selects, menus] = _ref4;
65
69
  expect(selects.length).to.equal(1);
66
70
  expect(menus.length).to.equal(1);
67
71
  const $select = selects[0];
@@ -2,28 +2,31 @@ import PropTypes from 'prop-types';
2
2
  import React from 'react';
3
3
  import { FilterableMenu as CommonFilterableMenu } from '../select/index.js';
4
4
  import { Menu } from './menu.js';
5
- export const FilterableMenu = ({
6
- dataTest,
7
- options,
8
- onChange,
9
- selected,
10
- empty,
11
- handleClose,
12
- handleFocusInput,
13
- placeholder,
14
- noMatchText
15
- }) => /*#__PURE__*/React.createElement(CommonFilterableMenu, {
16
- dataTest: dataTest,
17
- options: options,
18
- onChange: onChange,
19
- selected: selected,
20
- empty: empty,
21
- handleClose: handleClose,
22
- handleFocusInput: handleFocusInput,
23
- placeholder: placeholder,
24
- noMatchText: noMatchText,
25
- Menu: Menu
26
- });
5
+ export const FilterableMenu = _ref => {
6
+ let {
7
+ dataTest,
8
+ options,
9
+ onChange,
10
+ selected,
11
+ empty,
12
+ handleClose,
13
+ handleFocusInput,
14
+ placeholder,
15
+ noMatchText
16
+ } = _ref;
17
+ return /*#__PURE__*/React.createElement(CommonFilterableMenu, {
18
+ dataTest: dataTest,
19
+ options: options,
20
+ onChange: onChange,
21
+ selected: selected,
22
+ empty: empty,
23
+ handleClose: handleClose,
24
+ handleFocusInput: handleFocusInput,
25
+ placeholder: placeholder,
26
+ noMatchText: noMatchText,
27
+ Menu: Menu
28
+ });
29
+ };
27
30
  FilterableMenu.propTypes = {
28
31
  dataTest: PropTypes.string.isRequired,
29
32
  noMatchText: PropTypes.string.isRequired,
@@ -7,19 +7,20 @@ import React from 'react';
7
7
  import { InputClearButton, InputPlaceholder, InputPrefix } from '../select/index.js';
8
8
  import { Selection } from './selection.js';
9
9
 
10
- const Input = ({
11
- selected,
12
- onChange,
13
- clearable,
14
- clearText,
15
- placeholder,
16
- dataTest,
17
- prefix,
18
- options,
19
- className,
20
- disabled,
21
- inputMaxHeight
22
- }) => {
10
+ const Input = _ref => {
11
+ let {
12
+ selected,
13
+ onChange,
14
+ clearable,
15
+ clearText,
16
+ placeholder,
17
+ dataTest,
18
+ prefix,
19
+ options,
20
+ className,
21
+ disabled,
22
+ inputMaxHeight
23
+ } = _ref;
23
24
  const hasSelection = selected && typeof selected === 'string';
24
25
 
25
26
  const onClear = (_, e) => {
@@ -34,10 +35,10 @@ const Input = ({
34
35
  className: _JSXStyle.dynamic([["1360178250", [colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + (cx('root', className) || "")
35
36
  }, /*#__PURE__*/React.createElement(InputPrefix, {
36
37
  prefix: prefix,
37
- dataTest: `${dataTest}-prefix`
38
+ dataTest: "".concat(dataTest, "-prefix")
38
39
  }), !hasSelection && !prefix && /*#__PURE__*/React.createElement(InputPlaceholder, {
39
40
  placeholder: placeholder,
40
- dataTest: `${dataTest}-placeholder`
41
+ dataTest: "".concat(dataTest, "-placeholder")
41
42
  }), hasSelection && /*#__PURE__*/React.createElement("div", {
42
43
  className: _JSXStyle.dynamic([["1360178250", [colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + "root-input"
43
44
  }, /*#__PURE__*/React.createElement(Selection, {
@@ -48,14 +49,14 @@ const Input = ({
48
49
  }, /*#__PURE__*/React.createElement(InputClearButton, {
49
50
  onClear: onClear,
50
51
  clearText: clearText,
51
- dataTest: `${dataTest}-clear`
52
+ dataTest: "".concat(dataTest, "-clear")
52
53
  })), /*#__PURE__*/React.createElement(_JSXStyle, {
53
54
  id: "1360178250",
54
55
  dynamic: [colors.grey900]
55
- }, [`.root.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:${colors.grey900};font-size:14px;line-height:16px;}`, ".root-input.__jsx-style-dynamic-selector{overflow-y:auto;-webkit-flex:1;-ms-flex:1;flex:1;}", ".root-right.__jsx-style-dynamic-selector{margin-left:auto;margin-right:10px;}"]), /*#__PURE__*/React.createElement(_JSXStyle, {
56
+ }, [".root.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:".concat(colors.grey900, ";font-size:14px;line-height:16px;}"), ".root-input.__jsx-style-dynamic-selector{overflow-y:auto;-webkit-flex:1;-ms-flex:1;flex:1;}", ".root-right.__jsx-style-dynamic-selector{margin-left:auto;margin-right:10px;}"]), /*#__PURE__*/React.createElement(_JSXStyle, {
56
57
  id: "1331770409",
57
58
  dynamic: [inputMaxHeight]
58
- }, [`.root-input.__jsx-style-dynamic-selector{max-height:${inputMaxHeight};}`]));
59
+ }, [".root-input.__jsx-style-dynamic-selector{max-height:".concat(inputMaxHeight, ";}")]));
59
60
  };
60
61
 
61
62
  Input.defaultProps = {
@@ -7,15 +7,16 @@ const onIgnoredClick = (_, e) => {
7
7
  e.preventDefault();
8
8
  };
9
9
 
10
- const Menu = ({
11
- options,
12
- onChange,
13
- selected,
14
- empty,
15
- handleFocusInput,
16
- handleClose,
17
- dataTest
18
- }) => {
10
+ const Menu = _ref => {
11
+ let {
12
+ options,
13
+ onChange,
14
+ selected,
15
+ empty,
16
+ handleFocusInput,
17
+ handleClose,
18
+ dataTest
19
+ } = _ref;
19
20
  const renderedOptions = filterIgnored(options);
20
21
 
21
22
  if (React.Children.count(renderedOptions) === 0) {
@@ -23,7 +24,7 @@ const Menu = ({
23
24
  if (typeof empty === 'string') {
24
25
  return /*#__PURE__*/React.createElement(Empty, {
25
26
  message: empty,
26
- dataTest: `${dataTest}-empty`
27
+ dataTest: "".concat(dataTest, "-empty")
27
28
  });
28
29
  } // Otherwise just render the supplied markup
29
30