@dhis2-ui/select 9.5.0-alpha.1 → 9.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 (125) hide show
  1. package/build/cjs/locales/lo/translations.json +3 -3
  2. package/build/cjs/multi-select/features/accepts_blur_cb/index.js +3 -5
  3. package/build/cjs/multi-select/features/accepts_focus_cb/index.js +3 -5
  4. package/build/cjs/multi-select/features/accepts_initial_focus/index.js +2 -4
  5. package/build/cjs/multi-select/features/accepts_loading/index.js +5 -7
  6. package/build/cjs/multi-select/features/accepts_max_height/index.js +5 -10
  7. package/build/cjs/multi-select/features/accepts_placeholder/index.js +6 -8
  8. package/build/cjs/multi-select/features/accepts_prefix/index.js +5 -7
  9. package/build/cjs/multi-select/features/allows_invalid_options/index.js +6 -8
  10. package/build/cjs/multi-select/features/allows_selecting/index.js +16 -18
  11. package/build/cjs/multi-select/features/can_be_cleared/index.js +4 -6
  12. package/build/cjs/multi-select/features/can_be_disabled/index.js +9 -14
  13. package/build/cjs/multi-select/features/can_be_empty/index.js +7 -9
  14. package/build/cjs/multi-select/features/can_be_filtered/index.js +6 -8
  15. package/build/cjs/multi-select/features/can_be_opened_and_closed/index.js +8 -10
  16. package/build/cjs/multi-select/features/common/index.js +10 -10
  17. package/build/cjs/multi-select/features/duplicate_option_values/index.js +4 -6
  18. package/build/cjs/multi-select/features/menu_width_matches_input/index.js +8 -10
  19. package/build/cjs/multi-select/features/position/index.js +15 -17
  20. package/build/cjs/multi-select/features/shows_selections/index.js +5 -7
  21. package/build/cjs/multi-select/input.js +6 -6
  22. package/build/cjs/multi-select-field/features/accepts_help_text/index.js +3 -3
  23. package/build/cjs/multi-select-field/features/accepts_label/index.js +3 -3
  24. package/build/cjs/multi-select-field/features/accepts_validation_text/index.js +3 -3
  25. package/build/cjs/multi-select-field/features/can_be_required/index.js +3 -3
  26. package/build/cjs/multi-select-field/features/has_default_clear_text/index.js +6 -3
  27. package/build/cjs/multi-select-field/features/has_default_clear_text.feature +1 -0
  28. package/build/cjs/multi-select-field/features/has_default_empty_text/index.js +4 -4
  29. package/build/cjs/multi-select-field/features/has_default_filter_nomatch_text/index.js +5 -5
  30. package/build/cjs/multi-select-field/features/has_default_filter_placeholder/index.js +4 -4
  31. package/build/cjs/multi-select-field/features/has_default_loading_text/index.js +4 -4
  32. package/build/cjs/select/input-clear-button.js +26 -7
  33. package/build/cjs/single-select/features/accepts_blur_cb/index.js +3 -5
  34. package/build/cjs/single-select/features/accepts_focus_cb/index.js +3 -5
  35. package/build/cjs/single-select/features/accepts_initial_focus/index.js +2 -4
  36. package/build/cjs/single-select/features/accepts_loading/index.js +5 -7
  37. package/build/cjs/single-select/features/accepts_max_height/index.js +5 -10
  38. package/build/cjs/single-select/features/accepts_placeholder/index.js +6 -8
  39. package/build/cjs/single-select/features/accepts_prefix/index.js +5 -7
  40. package/build/cjs/single-select/features/allows_invalid_options/index.js +6 -8
  41. package/build/cjs/single-select/features/allows_selecting/index.js +7 -9
  42. package/build/cjs/single-select/features/can_be_cleared/index.js +4 -6
  43. package/build/cjs/single-select/features/can_be_disabled/index.js +9 -11
  44. package/build/cjs/single-select/features/can_be_empty/index.js +7 -9
  45. package/build/cjs/single-select/features/can_be_filtered/index.js +6 -8
  46. package/build/cjs/single-select/features/can_be_opened_and_closed/index.js +8 -10
  47. package/build/cjs/single-select/features/common/index.js +9 -9
  48. package/build/cjs/single-select/features/duplicate_option_values/index.js +6 -8
  49. package/build/cjs/single-select/features/menu_width_matches_input/index.js +8 -10
  50. package/build/cjs/single-select/features/position/index.js +10 -10
  51. package/build/cjs/single-select/features/shows_selections/index.js +3 -5
  52. package/build/cjs/single-select/input.js +6 -6
  53. package/build/cjs/single-select-field/features/accepts_help_text/index.js +3 -3
  54. package/build/cjs/single-select-field/features/accepts_label/index.js +3 -3
  55. package/build/cjs/single-select-field/features/accepts_validation_text/index.js +3 -3
  56. package/build/cjs/single-select-field/features/can_be_required/index.js +3 -3
  57. package/build/cjs/single-select-field/features/has_default_clear_text/index.js +6 -3
  58. package/build/cjs/single-select-field/features/has_default_clear_text.feature +1 -0
  59. package/build/cjs/single-select-field/features/has_default_empty_text/index.js +4 -4
  60. package/build/cjs/single-select-field/features/has_default_filter_nomatch_text/index.js +5 -5
  61. package/build/cjs/single-select-field/features/has_default_filter_placeholder/index.js +4 -4
  62. package/build/cjs/single-select-field/features/has_default_loading_text/index.js +4 -4
  63. package/build/es/locales/lo/translations.json +3 -3
  64. package/build/es/multi-select/features/accepts_blur_cb/index.js +1 -2
  65. package/build/es/multi-select/features/accepts_focus_cb/index.js +1 -2
  66. package/build/es/multi-select/features/accepts_initial_focus/index.js +1 -2
  67. package/build/es/multi-select/features/accepts_loading/index.js +1 -2
  68. package/build/es/multi-select/features/accepts_max_height/index.js +1 -5
  69. package/build/es/multi-select/features/accepts_placeholder/index.js +1 -2
  70. package/build/es/multi-select/features/accepts_prefix/index.js +1 -2
  71. package/build/es/multi-select/features/allows_invalid_options/index.js +1 -2
  72. package/build/es/multi-select/features/allows_selecting/index.js +3 -4
  73. package/build/es/multi-select/features/can_be_cleared/index.js +1 -2
  74. package/build/es/multi-select/features/can_be_disabled/index.js +1 -5
  75. package/build/es/multi-select/features/can_be_empty/index.js +1 -2
  76. package/build/es/multi-select/features/can_be_filtered/index.js +1 -2
  77. package/build/es/multi-select/features/can_be_opened_and_closed/index.js +1 -2
  78. package/build/es/multi-select/features/common/index.js +1 -1
  79. package/build/es/multi-select/features/duplicate_option_values/index.js +1 -2
  80. package/build/es/multi-select/features/menu_width_matches_input/index.js +1 -2
  81. package/build/es/multi-select/features/position/index.js +1 -2
  82. package/build/es/multi-select/features/shows_selections/index.js +1 -2
  83. package/build/es/multi-select/input.js +6 -6
  84. package/build/es/multi-select-field/features/accepts_help_text/index.js +1 -1
  85. package/build/es/multi-select-field/features/accepts_label/index.js +1 -1
  86. package/build/es/multi-select-field/features/accepts_validation_text/index.js +1 -1
  87. package/build/es/multi-select-field/features/can_be_required/index.js +1 -1
  88. package/build/es/multi-select-field/features/has_default_clear_text/index.js +4 -1
  89. package/build/es/multi-select-field/features/has_default_clear_text.feature +1 -0
  90. package/build/es/multi-select-field/features/has_default_empty_text/index.js +1 -1
  91. package/build/es/multi-select-field/features/has_default_filter_nomatch_text/index.js +1 -1
  92. package/build/es/multi-select-field/features/has_default_filter_placeholder/index.js +1 -1
  93. package/build/es/multi-select-field/features/has_default_loading_text/index.js +1 -1
  94. package/build/es/select/input-clear-button.js +24 -7
  95. package/build/es/single-select/features/accepts_blur_cb/index.js +1 -2
  96. package/build/es/single-select/features/accepts_focus_cb/index.js +1 -2
  97. package/build/es/single-select/features/accepts_initial_focus/index.js +1 -2
  98. package/build/es/single-select/features/accepts_loading/index.js +1 -2
  99. package/build/es/single-select/features/accepts_max_height/index.js +1 -5
  100. package/build/es/single-select/features/accepts_placeholder/index.js +1 -2
  101. package/build/es/single-select/features/accepts_prefix/index.js +1 -2
  102. package/build/es/single-select/features/allows_invalid_options/index.js +1 -2
  103. package/build/es/single-select/features/allows_selecting/index.js +1 -2
  104. package/build/es/single-select/features/can_be_cleared/index.js +1 -2
  105. package/build/es/single-select/features/can_be_disabled/index.js +1 -2
  106. package/build/es/single-select/features/can_be_empty/index.js +1 -2
  107. package/build/es/single-select/features/can_be_filtered/index.js +1 -2
  108. package/build/es/single-select/features/can_be_opened_and_closed/index.js +1 -2
  109. package/build/es/single-select/features/common/index.js +1 -1
  110. package/build/es/single-select/features/duplicate_option_values/index.js +3 -4
  111. package/build/es/single-select/features/menu_width_matches_input/index.js +1 -2
  112. package/build/es/single-select/features/position/index.js +1 -1
  113. package/build/es/single-select/features/shows_selections/index.js +1 -2
  114. package/build/es/single-select/input.js +6 -6
  115. package/build/es/single-select-field/features/accepts_help_text/index.js +1 -1
  116. package/build/es/single-select-field/features/accepts_label/index.js +1 -1
  117. package/build/es/single-select-field/features/accepts_validation_text/index.js +1 -1
  118. package/build/es/single-select-field/features/can_be_required/index.js +1 -1
  119. package/build/es/single-select-field/features/has_default_clear_text/index.js +4 -1
  120. package/build/es/single-select-field/features/has_default_clear_text.feature +1 -0
  121. package/build/es/single-select-field/features/has_default_empty_text/index.js +1 -1
  122. package/build/es/single-select-field/features/has_default_filter_nomatch_text/index.js +1 -1
  123. package/build/es/single-select-field/features/has_default_filter_placeholder/index.js +1 -1
  124. package/build/es/single-select-field/features/has_default_loading_text/index.js +1 -1
  125. package/package.json +15 -14
@@ -1,19 +1,17 @@
1
1
  "use strict";
2
2
 
3
- require("../common/index.js");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- var _steps = require("cypress-cucumber-preprocessor/steps");
6
-
7
- (0, _steps.Given)('there is enough space below the anchor to fit the MultiSelect menu', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('there is enough space below the anchor to fit the MultiSelect menu', () => {
8
6
  cy.visitStory('MultiSelect', 'Default position');
9
7
  });
10
- (0, _steps.Given)('there is not enough space below the anchor to fit the MultiSelect menu', () => {
8
+ (0, _cypressCucumberPreprocessor.Given)('there is not enough space below the anchor to fit the MultiSelect menu', () => {
11
9
  cy.visitStory('MultiSelect', 'Flipped position');
12
10
  });
13
- (0, _steps.Given)('there is not enough space above or below the anchor to fit the MultiSelect menu', () => {
11
+ (0, _cypressCucumberPreprocessor.Given)('there is not enough space above or below the anchor to fit the MultiSelect menu', () => {
14
12
  cy.visitStory('MultiSelect', 'Shifted into view');
15
13
  });
16
- (0, _steps.Given)('the input is empty', () => {
14
+ (0, _cypressCucumberPreprocessor.Given)('the input is empty', () => {
17
15
  cy.get('[data-test="dhis2-uicore-select-input"]').should('exist').should('have.length', 1).then(inputs => {
18
16
  const $input = inputs[0];
19
17
  const inputRect = $input.getBoundingClientRect();
@@ -21,19 +19,19 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
21
19
  }).as('emptyInputHeight');
22
20
  cy.get('[data-test="dhis2-uicore-select-input"] .root').should('be.empty');
23
21
  });
24
- (0, _steps.When)('the MultiSelect is clicked', () => {
22
+ (0, _cypressCucumberPreprocessor.When)('the MultiSelect is clicked', () => {
25
23
  cy.get('[data-test="dhis2-uicore-multiselect"]').click();
26
24
  });
27
- (0, _steps.When)('the window is scrolled down', () => {
25
+ (0, _cypressCucumberPreprocessor.When)('the window is scrolled down', () => {
28
26
  cy.scrollTo(0, 800);
29
27
  });
30
- (0, _steps.When)('the window is resized to a greater width', () => {
28
+ (0, _cypressCucumberPreprocessor.When)('the window is resized to a greater width', () => {
31
29
  cy.viewport(1200, 660);
32
30
  });
33
- (0, _steps.When)('an option is clicked', () => {
31
+ (0, _cypressCucumberPreprocessor.When)('an option is clicked', () => {
34
32
  cy.contains('option one').click();
35
33
  });
36
- (0, _steps.Then)('the Input remains the same height', () => {
34
+ (0, _cypressCucumberPreprocessor.Then)('the Input remains the same height', () => {
37
35
  const emptyInputHeight = '@emptyInputHeight';
38
36
  const inputDataTest = '[data-test="dhis2-uicore-select-input"]';
39
37
  cy.getAll(emptyInputHeight, inputDataTest).should(_ref => {
@@ -44,7 +42,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
44
42
  expect(inputRect.height).to.equal(emptyInputHeight);
45
43
  });
46
44
  });
47
- (0, _steps.Then)('the top of the menu is aligned with the bottom of the input', () => {
45
+ (0, _cypressCucumberPreprocessor.Then)('the top of the menu is aligned with the bottom of the input', () => {
48
46
  const selectDataTest = '[data-test="dhis2-uicore-multiselect"]';
49
47
  const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
50
48
  cy.getAll(selectDataTest, menuDataTest).should(_ref2 => {
@@ -58,7 +56,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
58
56
  expect(menuRect.top).to.equal(selectRect.bottom);
59
57
  });
60
58
  });
61
- (0, _steps.Then)('the bottom of the menu is aligned with the top of the input', () => {
59
+ (0, _cypressCucumberPreprocessor.Then)('the bottom of the menu is aligned with the top of the input', () => {
62
60
  const selectDataTest = '[data-test="dhis2-uicore-multiselect"]';
63
61
  const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
64
62
  cy.getAll(selectDataTest, menuDataTest).should(_ref3 => {
@@ -72,7 +70,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
72
70
  expect(selectRect.top).to.equal(menuRect.bottom);
73
71
  });
74
72
  });
75
- (0, _steps.Then)('it is rendered on top of the MultiSelect', () => {
73
+ (0, _cypressCucumberPreprocessor.Then)('it is rendered on top of the MultiSelect', () => {
76
74
  const selectDataTest = '[data-test="dhis2-uicore-multiselect"]';
77
75
  const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
78
76
  cy.getAll(selectDataTest, menuDataTest).should(_ref4 => {
@@ -87,7 +85,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
87
85
  expect(menuRect.bottom).to.be.greaterThan(selectRect.bottom);
88
86
  });
89
87
  });
90
- (0, _steps.Then)('the left of the Menu is aligned with the left of the Input', () => {
88
+ (0, _cypressCucumberPreprocessor.Then)('the left of the Menu is aligned with the left of the Input', () => {
91
89
  const selectDataTest = '[data-test="dhis2-uicore-multiselect"]';
92
90
  const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
93
91
  cy.getAll(selectDataTest, menuDataTest).should(_ref5 => {
@@ -101,7 +99,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
101
99
  expect(selectRect.left).to.equal(menuRect.left);
102
100
  });
103
101
  });
104
- (0, _steps.Then)('the Menu and the Input have an equal width', () => {
102
+ (0, _cypressCucumberPreprocessor.Then)('the Menu and the Input have an equal width', () => {
105
103
  const inputDataTest = '[data-test="dhis2-uicore-multiselect"] .root-input';
106
104
  const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
107
105
  cy.getAll(inputDataTest, menuDataTest).should(_ref6 => {
@@ -1,19 +1,17 @@
1
1
  "use strict";
2
2
 
3
- require("../common/index.js");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- var _steps = require("cypress-cucumber-preprocessor/steps");
6
-
7
- (0, _steps.Given)('a MultiSelect with options and a selection is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a MultiSelect with options and a selection is rendered', () => {
8
6
  cy.visitStory('MultiSelect', 'With options and a selection');
9
7
  });
10
- (0, _steps.Given)('a MultiSelect with options and multiple selections is rendered', () => {
8
+ (0, _cypressCucumberPreprocessor.Given)('a MultiSelect with options and multiple selections is rendered', () => {
11
9
  cy.visitStory('MultiSelect', 'With options and multiple selections');
12
10
  });
13
- (0, _steps.Then)('the selection is displayed', () => {
11
+ (0, _cypressCucumberPreprocessor.Then)('the selection is displayed', () => {
14
12
  cy.contains('option one').should('be.visible');
15
13
  });
16
- (0, _steps.Then)('the selections are displayed', () => {
14
+ (0, _cypressCucumberPreprocessor.Then)('the selections are displayed', () => {
17
15
  cy.contains('option one').should('be.visible');
18
16
  cy.contains('option two').should('be.visible');
19
17
  });
@@ -39,7 +39,7 @@ const Input = _ref => {
39
39
  } = _ref;
40
40
  const hasSelection = selected.length > 0;
41
41
 
42
- const onClear = (_, e) => {
42
+ const onClear = e => {
43
43
  const data = {
44
44
  selected: []
45
45
  };
@@ -48,7 +48,7 @@ const Input = _ref => {
48
48
  };
49
49
 
50
50
  return /*#__PURE__*/_react.default.createElement("div", {
51
- className: _style.default.dynamic([["1209882888", [_uiConstants.colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + ((0, _classnames.default)('root', className) || "")
51
+ className: _style.default.dynamic([["64009541", [_uiConstants.colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + ((0, _classnames.default)('root', className) || "")
52
52
  }, /*#__PURE__*/_react.default.createElement(_index.InputPrefix, {
53
53
  prefix: prefix,
54
54
  dataTest: "".concat(dataTest, "-prefix")
@@ -56,22 +56,22 @@ const Input = _ref => {
56
56
  placeholder: placeholder,
57
57
  dataTest: "".concat(dataTest, "-placeholder")
58
58
  }), hasSelection && /*#__PURE__*/_react.default.createElement("div", {
59
- className: _style.default.dynamic([["1209882888", [_uiConstants.colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + "root-input"
59
+ className: _style.default.dynamic([["64009541", [_uiConstants.colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + "root-input"
60
60
  }, /*#__PURE__*/_react.default.createElement(_selectionList.SelectionList, {
61
61
  selected: selected,
62
62
  onChange: onChange,
63
63
  options: options,
64
64
  disabled: disabled
65
65
  })), hasSelection && clearable && !disabled && /*#__PURE__*/_react.default.createElement("div", {
66
- className: _style.default.dynamic([["1209882888", [_uiConstants.colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + "root-right"
66
+ className: _style.default.dynamic([["64009541", [_uiConstants.colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + "root-right"
67
67
  }, /*#__PURE__*/_react.default.createElement(_index.InputClearButton, {
68
68
  onClear: onClear,
69
69
  clearText: clearText,
70
70
  dataTest: "".concat(dataTest, "-clear")
71
71
  })), /*#__PURE__*/_react.default.createElement(_style.default, {
72
- id: "1209882888",
72
+ id: "64009541",
73
73
  dynamic: [_uiConstants.colors.grey900]
74
- }, [".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(_uiConstants.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;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:wrap;-ms-flex-flow:wrap;flex-flow:wrap;gap:4px;}", ".root-right.__jsx-style-dynamic-selector{margin-inline-start:auto;margin-inline-end:10px;}"]), /*#__PURE__*/_react.default.createElement(_style.default, {
74
+ }, [".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(_uiConstants.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;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:wrap;-ms-flex-flow:wrap;flex-flow:wrap;gap:4px;}", ".root-right.__jsx-style-dynamic-selector{margin-inline-start:auto;}"]), /*#__PURE__*/_react.default.createElement(_style.default, {
75
75
  id: "1331770409",
76
76
  dynamic: [inputMaxHeight]
77
77
  }, [".root-input.__jsx-style-dynamic-selector{max-height:".concat(inputMaxHeight, ";}")]));
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('a MultiSelectField with help text is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a MultiSelectField with help text is rendered', () => {
6
6
  cy.visitStory('MultiSelectField', 'With help text');
7
7
  });
8
- (0, _steps.Then)('the help text is visible', () => {
8
+ (0, _cypressCucumberPreprocessor.Then)('the help text is visible', () => {
9
9
  cy.contains('The help text').should('be.visible');
10
10
  });
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('a MultiSelectField with a label is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a MultiSelectField with a label is rendered', () => {
6
6
  cy.visitStory('MultiSelectField', 'With label');
7
7
  });
8
- (0, _steps.Then)('the label is visible', () => {
8
+ (0, _cypressCucumberPreprocessor.Then)('the label is visible', () => {
9
9
  cy.contains('The label').should('be.visible');
10
10
  });
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('a MultiSelectField with validation text is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a MultiSelectField with validation text is rendered', () => {
6
6
  cy.visitStory('MultiSelectField', 'With validation text');
7
7
  });
8
- (0, _steps.Then)('the validation text is visible', () => {
8
+ (0, _cypressCucumberPreprocessor.Then)('the validation text is visible', () => {
9
9
  cy.contains('The validation text').should('be.visible');
10
10
  });
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('a MultiSelectField with label and a required flag is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a MultiSelectField with label and a required flag is rendered', () => {
6
6
  cy.visitStory('MultiSelectField', 'With label and required status');
7
7
  });
8
- (0, _steps.Then)('the required indicator is visible', () => {
8
+ (0, _cypressCucumberPreprocessor.Then)('the required indicator is visible', () => {
9
9
  cy.get('[data-test="dhis2-uiwidgets-multiselectfield-label-required"]').should('be.visible');
10
10
  });
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
 
3
- var _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('a clearable MultiSelectField with selected option is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a clearable MultiSelectField with selected option is rendered', () => {
6
6
  cy.visitStory('MultiSelectField', 'With clearable and selected option');
7
7
  });
8
- (0, _steps.Then)('the clear text is visible', () => {
8
+ (0, _cypressCucumberPreprocessor.When)('the clear button is hovered', () => {
9
+ cy.get('[data-test="dhis2-uicore-multiselect-clear"]').trigger('mouseover', 'top');
10
+ });
11
+ (0, _cypressCucumberPreprocessor.Then)('the clear text is visible', () => {
9
12
  cy.contains('Clear').should('be.visible');
10
13
  });
@@ -2,4 +2,5 @@ Feature: Clear text for the MultiSelectField
2
2
 
3
3
  Scenario: Rendering a clearable MultiSelectField
4
4
  Given a clearable MultiSelectField with selected option is rendered
5
+ When the clear button is hovered
5
6
  Then the clear text is visible
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
 
3
- var _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('an empty MultiSelectField is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('an empty MultiSelectField is rendered', () => {
6
6
  cy.visitStory('MultiSelectField', 'Without options');
7
7
  });
8
- (0, _steps.When)('the Select is opened', () => {
8
+ (0, _cypressCucumberPreprocessor.When)('the Select is opened', () => {
9
9
  cy.get('[data-test="dhis2-uicore-select-input"]').click();
10
10
  });
11
- (0, _steps.Then)('the empty text is visible', () => {
11
+ (0, _cypressCucumberPreprocessor.Then)('the empty text is visible', () => {
12
12
  cy.contains('No data found').should('be.visible');
13
13
  });
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
 
3
- var _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('a filterable MultiSelectField is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a filterable MultiSelectField is rendered', () => {
6
6
  cy.visitStory('MultiSelectField', 'With filterable');
7
7
  });
8
- (0, _steps.When)('the Select is opened', () => {
8
+ (0, _cypressCucumberPreprocessor.When)('the Select is opened', () => {
9
9
  cy.get('[data-test="dhis2-uicore-select-input"]').click();
10
10
  });
11
- (0, _steps.When)('a filter that does not match any options is entered', () => {
11
+ (0, _cypressCucumberPreprocessor.When)('a filter that does not match any options is entered', () => {
12
12
  cy.focused().type('Two');
13
13
  });
14
- (0, _steps.Then)('the no match text is visible', () => {
14
+ (0, _cypressCucumberPreprocessor.Then)('the no match text is visible', () => {
15
15
  cy.contains('No options found').should('be.visible');
16
16
  });
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
 
3
- var _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('a filterable MultiSelectField is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a filterable MultiSelectField is rendered', () => {
6
6
  cy.visitStory('MultiSelectField', 'With filterable');
7
7
  });
8
- (0, _steps.When)('the Select is opened', () => {
8
+ (0, _cypressCucumberPreprocessor.When)('the Select is opened', () => {
9
9
  cy.get('[data-test="dhis2-uicore-select-input"]').click();
10
10
  });
11
- (0, _steps.Then)('the filter placeholder exists', () => {
11
+ (0, _cypressCucumberPreprocessor.Then)('the filter placeholder exists', () => {
12
12
  cy.get('[data-test="dhis2-uicore-multiselect-filterinput"] [placeholder="Type to filter options"]').should('exist');
13
13
  });
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
 
3
- var _steps = require("cypress-cucumber-preprocessor/steps");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- (0, _steps.Given)('a loading MultiSelectField is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a loading MultiSelectField is rendered', () => {
6
6
  cy.visitStory('MultiSelectField', 'With loading');
7
7
  });
8
- (0, _steps.When)('the Select is opened', () => {
8
+ (0, _cypressCucumberPreprocessor.When)('the Select is opened', () => {
9
9
  cy.get('[data-test="dhis2-uicore-select-input"]').click();
10
10
  });
11
- (0, _steps.Then)('the loading text is visible', () => {
11
+ (0, _cypressCucumberPreprocessor.Then)('the loading text is visible', () => {
12
12
  cy.contains('Loading options').should('be.visible');
13
13
  });
@@ -5,7 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.InputClearButton = void 0;
7
7
 
8
- var _button = require("@dhis2-ui/button");
8
+ var _style = _interopRequireDefault(require("styled-jsx/style"));
9
+
10
+ var _tooltip = require("@dhis2-ui/tooltip");
11
+
12
+ var _uiConstants = require("@dhis2/ui-constants");
9
13
 
10
14
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
15
 
@@ -20,14 +24,29 @@ const InputClearButton = _ref => {
20
24
  className,
21
25
  dataTest
22
26
  } = _ref;
23
- return /*#__PURE__*/_react.default.createElement(_button.Button, {
24
- small: true,
25
- secondary: true,
26
- dataTest: dataTest,
27
+ return /*#__PURE__*/_react.default.createElement(_tooltip.Tooltip, {
28
+ openDelay: 500,
29
+ content: clearText
30
+ }, /*#__PURE__*/_react.default.createElement("button", {
31
+ "data-test": dataTest,
27
32
  onClick: onClear,
28
33
  type: "button",
29
- className: className
30
- }, clearText);
34
+ className: _style.default.dynamic([["2606883952", [_uiConstants.colors.grey500, _uiConstants.colors.grey800, _uiConstants.colors.grey200, _uiConstants.theme.focus]]]) + " " + (className || "")
35
+ }, /*#__PURE__*/_react.default.createElement("svg", {
36
+ width: "16",
37
+ height: "16",
38
+ viewBox: "0 0 16 16",
39
+ fill: "none",
40
+ xmlns: "http://www.w3.org/2000/svg",
41
+ className: _style.default.dynamic([["2606883952", [_uiConstants.colors.grey500, _uiConstants.colors.grey800, _uiConstants.colors.grey200, _uiConstants.theme.focus]]])
42
+ }, /*#__PURE__*/_react.default.createElement("path", {
43
+ d: "M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16Zm3.536-5.879a1 1 0 1 1-1.415 1.414l-2.12-2.12-2.122 2.121a1 1 0 1 1-1.415-1.414L6.586 8 4.464 5.878A1 1 0 1 1 5.88 4.464L8 6.586l2.121-2.121a1 1 0 1 1 1.415 1.414L9.415 8l2.12 2.121Z",
44
+ fill: "none",
45
+ className: _style.default.dynamic([["2606883952", [_uiConstants.colors.grey500, _uiConstants.colors.grey800, _uiConstants.colors.grey200, _uiConstants.theme.focus]]])
46
+ })), /*#__PURE__*/_react.default.createElement(_style.default, {
47
+ id: "2606883952",
48
+ dynamic: [_uiConstants.colors.grey500, _uiConstants.colors.grey800, _uiConstants.colors.grey200, _uiConstants.theme.focus]
49
+ }, ["button.__jsx-style-dynamic-selector{background:none;border:none;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;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;height:24px;width:24px;border-radius:3px;}", "button.__jsx-style-dynamic-selector svg.__jsx-style-dynamic-selector path.__jsx-style-dynamic-selector{fill:".concat(_uiConstants.colors.grey500, ";}"), "button.__jsx-style-dynamic-selector:hover svg.__jsx-style-dynamic-selector path.__jsx-style-dynamic-selector{fill:".concat(_uiConstants.colors.grey800, ";}"), "button.__jsx-style-dynamic-selector:hover{background:".concat(_uiConstants.colors.grey200, ";}"), "button.__jsx-style-dynamic-selector:focus{outline:2px solid ".concat(_uiConstants.theme.focus, ";}")])));
31
50
  };
32
51
 
33
52
  exports.InputClearButton = InputClearButton;
@@ -1,13 +1,11 @@
1
1
  "use strict";
2
2
 
3
- require("../common/index.js");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- var _steps = require("cypress-cucumber-preprocessor/steps");
6
-
7
- (0, _steps.Given)('a SingleSelect with onBlur handler is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a SingleSelect with onBlur handler is rendered', () => {
8
6
  cy.visitStory('SingleSelect', 'With onBlur');
9
7
  });
10
- (0, _steps.Then)('the onBlur handler is called', () => {
8
+ (0, _cypressCucumberPreprocessor.Then)('the onBlur handler is called', () => {
11
9
  cy.window().should(win => {
12
10
  expect(win.onBlur).to.be.calledOnce;
13
11
  expect(win.onBlur).to.be.calledWith({
@@ -1,13 +1,11 @@
1
1
  "use strict";
2
2
 
3
- require("../common/index.js");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- var _steps = require("cypress-cucumber-preprocessor/steps");
6
-
7
- (0, _steps.Given)('a SingleSelect with onFocus handler is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a SingleSelect with onFocus handler is rendered', () => {
8
6
  cy.visitStory('SingleSelect', 'With onFocus');
9
7
  });
10
- (0, _steps.Then)('the onFocus handler is called', () => {
8
+ (0, _cypressCucumberPreprocessor.Then)('the onFocus handler is called', () => {
11
9
  cy.window().should(win => {
12
10
  expect(win.onFocus).to.be.calledOnce;
13
11
  expect(win.onFocus).to.be.calledWith({
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
 
3
- require("../common/index.js");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- var _steps = require("cypress-cucumber-preprocessor/steps");
6
-
7
- (0, _steps.Given)('a SingleSelect with initial focus is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a SingleSelect with initial focus is rendered', () => {
8
6
  cy.visitStory('SingleSelect', 'With initialFocus');
9
7
  });
@@ -1,18 +1,16 @@
1
1
  "use strict";
2
2
 
3
- require("../common/index.js");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- var _steps = require("cypress-cucumber-preprocessor/steps");
6
-
7
- (0, _steps.Given)('a SingleSelect with options and a loading flag is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a SingleSelect with options and a loading flag is rendered', () => {
8
6
  cy.visitStory('SingleSelect', 'With options and loading');
9
7
  });
10
- (0, _steps.Given)('a SingleSelect with options, a loading flag and a loading text is rendered', () => {
8
+ (0, _cypressCucumberPreprocessor.Given)('a SingleSelect with options, a loading flag and a loading text is rendered', () => {
11
9
  cy.visitStory('SingleSelect', 'With options, loading and loading text');
12
10
  });
13
- (0, _steps.Then)('the loading spinner is displayed', () => {
11
+ (0, _cypressCucumberPreprocessor.Then)('the loading spinner is displayed', () => {
14
12
  cy.get('[data-test="dhis2-uicore-circularloader"]').should('be.visible');
15
13
  });
16
- (0, _steps.Then)('the loading text is displayed', () => {
14
+ (0, _cypressCucumberPreprocessor.Then)('the loading text is displayed', () => {
17
15
  cy.get('[data-test="dhis2-uicore-singleselect-loading"]').contains('Loading options').should('be.visible');
18
16
  });
@@ -1,21 +1,16 @@
1
1
  "use strict";
2
2
 
3
- require("../common/index.js");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- var _steps = require("cypress-cucumber-preprocessor/steps");
6
-
7
- (0, _steps.Given)('a SingleSelect with more than ten options is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a SingleSelect with more than ten options is rendered', () => {
8
6
  cy.visitStory('SingleSelect', 'With more than ten options');
9
7
  });
10
- (0, _steps.Given)('a SingleSelect with more than three options and a 100px max-height is rendered', () => {
8
+ (0, _cypressCucumberPreprocessor.Given)('a SingleSelect with more than three options and a 100px max-height is rendered', () => {
11
9
  cy.visitStory('SingleSelect', 'With more than three options and a 100px max-height');
12
10
  });
13
- (0, _steps.Given)('the SingleSelect is open', () => {
14
- cy.get('[data-test="dhis2-uicore-select"]').click();
15
- });
16
- (0, _steps.Then)('has the default max-height', () => {
11
+ (0, _cypressCucumberPreprocessor.Then)('has the default max-height', () => {
17
12
  cy.get('[data-test="dhis2-uicore-select-menu-menuwrapper"]').should('have.css', 'max-height', '280px');
18
13
  });
19
- (0, _steps.Then)('has a max-height of 100px', () => {
14
+ (0, _cypressCucumberPreprocessor.Then)('has a max-height of 100px', () => {
20
15
  cy.get('[data-test="dhis2-uicore-select-menu-menuwrapper"]').should('have.css', 'max-height', '100px');
21
16
  });
@@ -1,21 +1,19 @@
1
1
  "use strict";
2
2
 
3
- require("../common/index.js");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- var _steps = require("cypress-cucumber-preprocessor/steps");
6
-
7
- (0, _steps.Given)('a SingleSelect with a placeholder and no selection is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a SingleSelect with a placeholder and no selection is rendered', () => {
8
6
  cy.visitStory('SingleSelect', 'With placeholder');
9
7
  });
10
- (0, _steps.Given)('a SingleSelect with a placeholder and a selection is rendered', () => {
8
+ (0, _cypressCucumberPreprocessor.Given)('a SingleSelect with a placeholder and a selection is rendered', () => {
11
9
  cy.visitStory('SingleSelect', 'With placeholder and selection');
12
10
  });
13
- (0, _steps.Then)('the placeholder is shown', () => {
11
+ (0, _cypressCucumberPreprocessor.Then)('the placeholder is shown', () => {
14
12
  cy.get('[data-test="dhis2-uicore-singleselect-placeholder"]').contains('Placeholder text').should('be.visible');
15
13
  });
16
- (0, _steps.Then)('the placeholder is not rendered', () => {
14
+ (0, _cypressCucumberPreprocessor.Then)('the placeholder is not rendered', () => {
17
15
  cy.get('[data-test="dhis2-uicore-singleselect-placeholder"]').should('not.exist');
18
16
  });
19
- (0, _steps.Then)('the selection is displayed', () => {
17
+ (0, _cypressCucumberPreprocessor.Then)('the selection is displayed', () => {
20
18
  cy.contains('option one').should('be.visible');
21
19
  });
@@ -1,18 +1,16 @@
1
1
  "use strict";
2
2
 
3
- require("../common/index.js");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- var _steps = require("cypress-cucumber-preprocessor/steps");
6
-
7
- (0, _steps.Given)('a SingleSelect with a prefix and no selection is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a SingleSelect with a prefix and no selection is rendered', () => {
8
6
  cy.visitStory('SingleSelect', 'With prefix');
9
7
  });
10
- (0, _steps.Given)('a SingleSelect with a prefix and a selection is rendered', () => {
8
+ (0, _cypressCucumberPreprocessor.Given)('a SingleSelect with a prefix and a selection is rendered', () => {
11
9
  cy.visitStory('SingleSelect', 'With prefix and selection');
12
10
  });
13
- (0, _steps.Then)('the prefix is shown', () => {
11
+ (0, _cypressCucumberPreprocessor.Then)('the prefix is shown', () => {
14
12
  cy.get('[data-test="dhis2-uicore-singleselect-prefix"]').contains('Prefix text').should('be.visible');
15
13
  });
16
- (0, _steps.Then)('the selection is shown', () => {
14
+ (0, _cypressCucumberPreprocessor.Then)('the selection is shown', () => {
17
15
  cy.contains('option one').should('be.visible');
18
16
  });
@@ -1,24 +1,22 @@
1
1
  "use strict";
2
2
 
3
- require("../common/index.js");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- var _steps = require("cypress-cucumber-preprocessor/steps");
6
-
7
- (0, _steps.Given)('a SingleSelect with invalid options is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a SingleSelect with invalid options is rendered', () => {
8
6
  cy.visitStory('SingleSelect', 'With invalid options');
9
7
  });
10
- (0, _steps.Given)('a SingleSelect with invalid filterable options is rendered', () => {
8
+ (0, _cypressCucumberPreprocessor.Given)('a SingleSelect with invalid filterable options is rendered', () => {
11
9
  cy.visitStory('SingleSelect', 'With invalid filterable options');
12
10
  });
13
- (0, _steps.When)('the user enters a filter string', () => {
11
+ (0, _cypressCucumberPreprocessor.When)('the user enters a filter string', () => {
14
12
  cy.get('[data-test="dhis2-uicore-singleselect-filterinput"]').click().focused().type('invalid');
15
13
  });
16
- (0, _steps.Then)('the invalid options are displayed', () => {
14
+ (0, _cypressCucumberPreprocessor.Then)('the invalid options are displayed', () => {
17
15
  cy.contains('invalid one').should('be.visible');
18
16
  cy.contains('invalid two').should('be.visible');
19
17
  cy.contains('invalid three').should('be.visible');
20
18
  });
21
- (0, _steps.Then)('the invalid options are not rendered', () => {
19
+ (0, _cypressCucumberPreprocessor.Then)('the invalid options are not rendered', () => {
22
20
  cy.contains('invalid one').should('not.exist');
23
21
  cy.contains('invalid two').should('not.exist');
24
22
  cy.contains('invalid three').should('not.exist');
@@ -1,22 +1,20 @@
1
1
  "use strict";
2
2
 
3
- require("../common/index.js");
3
+ var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
4
 
5
- var _steps = require("cypress-cucumber-preprocessor/steps");
6
-
7
- (0, _steps.Given)('a SingleSelect with a disabled option and onChange handler is rendered', () => {
5
+ (0, _cypressCucumberPreprocessor.Given)('a SingleSelect with a disabled option and onChange handler is rendered', () => {
8
6
  cy.visitStory('SingleSelect', 'With disabled option and onChange');
9
7
  });
10
- (0, _steps.Given)('a SingleSelect with custom options and onChange handler is rendered', () => {
8
+ (0, _cypressCucumberPreprocessor.Given)('a SingleSelect with custom options and onChange handler is rendered', () => {
11
9
  cy.visitStory('SingleSelect', 'With custom options and onChange');
12
10
  });
13
- (0, _steps.When)('an option is clicked', () => {
11
+ (0, _cypressCucumberPreprocessor.When)('an option is clicked', () => {
14
12
  cy.contains('option one').click();
15
13
  });
16
- (0, _steps.When)('the disabled option is clicked', () => {
14
+ (0, _cypressCucumberPreprocessor.When)('the disabled option is clicked', () => {
17
15
  cy.contains('disabled option').click();
18
16
  });
19
- (0, _steps.Then)('the clicked option is selected', () => {
17
+ (0, _cypressCucumberPreprocessor.Then)('the clicked option is selected', () => {
20
18
  cy.window().should(win => {
21
19
  expect(win.onChange).to.be.calledOnce;
22
20
  expect(win.onChange).to.be.calledWith({
@@ -24,7 +22,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
24
22
  });
25
23
  });
26
24
  });
27
- (0, _steps.Then)('the onchange handler is not called', () => {
25
+ (0, _cypressCucumberPreprocessor.Then)('the onchange handler is not called', () => {
28
26
  cy.window().should(win => {
29
27
  expect(win.onChange).to.not.be.called;
30
28
  });