@dhis2-ui/select 9.5.0-alpha.1 → 9.5.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.
- package/build/cjs/locales/lo/translations.json +3 -3
- package/build/cjs/multi-select/features/accepts_blur_cb/index.js +3 -5
- package/build/cjs/multi-select/features/accepts_focus_cb/index.js +3 -5
- package/build/cjs/multi-select/features/accepts_initial_focus/index.js +2 -4
- package/build/cjs/multi-select/features/accepts_loading/index.js +5 -7
- package/build/cjs/multi-select/features/accepts_max_height/index.js +5 -10
- package/build/cjs/multi-select/features/accepts_placeholder/index.js +6 -8
- package/build/cjs/multi-select/features/accepts_prefix/index.js +5 -7
- package/build/cjs/multi-select/features/allows_invalid_options/index.js +6 -8
- package/build/cjs/multi-select/features/allows_selecting/index.js +16 -18
- package/build/cjs/multi-select/features/can_be_cleared/index.js +4 -6
- package/build/cjs/multi-select/features/can_be_disabled/index.js +9 -14
- package/build/cjs/multi-select/features/can_be_empty/index.js +7 -9
- package/build/cjs/multi-select/features/can_be_filtered/index.js +6 -8
- package/build/cjs/multi-select/features/can_be_opened_and_closed/index.js +8 -10
- package/build/cjs/multi-select/features/common/index.js +10 -10
- package/build/cjs/multi-select/features/duplicate_option_values/index.js +4 -6
- package/build/cjs/multi-select/features/menu_width_matches_input/index.js +8 -10
- package/build/cjs/multi-select/features/position/index.js +15 -17
- package/build/cjs/multi-select/features/shows_selections/index.js +5 -7
- package/build/cjs/multi-select/input.js +6 -6
- package/build/cjs/multi-select-field/features/accepts_help_text/index.js +3 -3
- package/build/cjs/multi-select-field/features/accepts_label/index.js +3 -3
- package/build/cjs/multi-select-field/features/accepts_validation_text/index.js +3 -3
- package/build/cjs/multi-select-field/features/can_be_required/index.js +3 -3
- package/build/cjs/multi-select-field/features/has_default_clear_text/index.js +6 -3
- package/build/cjs/multi-select-field/features/has_default_clear_text.feature +1 -0
- package/build/cjs/multi-select-field/features/has_default_empty_text/index.js +4 -4
- package/build/cjs/multi-select-field/features/has_default_filter_nomatch_text/index.js +5 -5
- package/build/cjs/multi-select-field/features/has_default_filter_placeholder/index.js +4 -4
- package/build/cjs/multi-select-field/features/has_default_loading_text/index.js +4 -4
- package/build/cjs/select/input-clear-button.js +26 -7
- package/build/cjs/single-select/features/accepts_blur_cb/index.js +3 -5
- package/build/cjs/single-select/features/accepts_focus_cb/index.js +3 -5
- package/build/cjs/single-select/features/accepts_initial_focus/index.js +2 -4
- package/build/cjs/single-select/features/accepts_loading/index.js +5 -7
- package/build/cjs/single-select/features/accepts_max_height/index.js +5 -10
- package/build/cjs/single-select/features/accepts_placeholder/index.js +6 -8
- package/build/cjs/single-select/features/accepts_prefix/index.js +5 -7
- package/build/cjs/single-select/features/allows_invalid_options/index.js +6 -8
- package/build/cjs/single-select/features/allows_selecting/index.js +7 -9
- package/build/cjs/single-select/features/can_be_cleared/index.js +4 -6
- package/build/cjs/single-select/features/can_be_disabled/index.js +9 -11
- package/build/cjs/single-select/features/can_be_empty/index.js +7 -9
- package/build/cjs/single-select/features/can_be_filtered/index.js +6 -8
- package/build/cjs/single-select/features/can_be_opened_and_closed/index.js +8 -10
- package/build/cjs/single-select/features/common/index.js +9 -9
- package/build/cjs/single-select/features/duplicate_option_values/index.js +6 -8
- package/build/cjs/single-select/features/menu_width_matches_input/index.js +8 -10
- package/build/cjs/single-select/features/position/index.js +10 -10
- package/build/cjs/single-select/features/shows_selections/index.js +3 -5
- package/build/cjs/single-select/input.js +6 -6
- package/build/cjs/single-select-field/features/accepts_help_text/index.js +3 -3
- package/build/cjs/single-select-field/features/accepts_label/index.js +3 -3
- package/build/cjs/single-select-field/features/accepts_validation_text/index.js +3 -3
- package/build/cjs/single-select-field/features/can_be_required/index.js +3 -3
- package/build/cjs/single-select-field/features/has_default_clear_text/index.js +6 -3
- package/build/cjs/single-select-field/features/has_default_clear_text.feature +1 -0
- package/build/cjs/single-select-field/features/has_default_empty_text/index.js +4 -4
- package/build/cjs/single-select-field/features/has_default_filter_nomatch_text/index.js +5 -5
- package/build/cjs/single-select-field/features/has_default_filter_placeholder/index.js +4 -4
- package/build/cjs/single-select-field/features/has_default_loading_text/index.js +4 -4
- package/build/es/locales/lo/translations.json +3 -3
- package/build/es/multi-select/features/accepts_blur_cb/index.js +1 -2
- package/build/es/multi-select/features/accepts_focus_cb/index.js +1 -2
- package/build/es/multi-select/features/accepts_initial_focus/index.js +1 -2
- package/build/es/multi-select/features/accepts_loading/index.js +1 -2
- package/build/es/multi-select/features/accepts_max_height/index.js +1 -5
- package/build/es/multi-select/features/accepts_placeholder/index.js +1 -2
- package/build/es/multi-select/features/accepts_prefix/index.js +1 -2
- package/build/es/multi-select/features/allows_invalid_options/index.js +1 -2
- package/build/es/multi-select/features/allows_selecting/index.js +3 -4
- package/build/es/multi-select/features/can_be_cleared/index.js +1 -2
- package/build/es/multi-select/features/can_be_disabled/index.js +1 -5
- package/build/es/multi-select/features/can_be_empty/index.js +1 -2
- package/build/es/multi-select/features/can_be_filtered/index.js +1 -2
- package/build/es/multi-select/features/can_be_opened_and_closed/index.js +1 -2
- package/build/es/multi-select/features/common/index.js +1 -1
- package/build/es/multi-select/features/duplicate_option_values/index.js +1 -2
- package/build/es/multi-select/features/menu_width_matches_input/index.js +1 -2
- package/build/es/multi-select/features/position/index.js +1 -2
- package/build/es/multi-select/features/shows_selections/index.js +1 -2
- package/build/es/multi-select/input.js +6 -6
- package/build/es/multi-select-field/features/accepts_help_text/index.js +1 -1
- package/build/es/multi-select-field/features/accepts_label/index.js +1 -1
- package/build/es/multi-select-field/features/accepts_validation_text/index.js +1 -1
- package/build/es/multi-select-field/features/can_be_required/index.js +1 -1
- package/build/es/multi-select-field/features/has_default_clear_text/index.js +4 -1
- package/build/es/multi-select-field/features/has_default_clear_text.feature +1 -0
- package/build/es/multi-select-field/features/has_default_empty_text/index.js +1 -1
- package/build/es/multi-select-field/features/has_default_filter_nomatch_text/index.js +1 -1
- package/build/es/multi-select-field/features/has_default_filter_placeholder/index.js +1 -1
- package/build/es/multi-select-field/features/has_default_loading_text/index.js +1 -1
- package/build/es/select/input-clear-button.js +24 -7
- package/build/es/single-select/features/accepts_blur_cb/index.js +1 -2
- package/build/es/single-select/features/accepts_focus_cb/index.js +1 -2
- package/build/es/single-select/features/accepts_initial_focus/index.js +1 -2
- package/build/es/single-select/features/accepts_loading/index.js +1 -2
- package/build/es/single-select/features/accepts_max_height/index.js +1 -5
- package/build/es/single-select/features/accepts_placeholder/index.js +1 -2
- package/build/es/single-select/features/accepts_prefix/index.js +1 -2
- package/build/es/single-select/features/allows_invalid_options/index.js +1 -2
- package/build/es/single-select/features/allows_selecting/index.js +1 -2
- package/build/es/single-select/features/can_be_cleared/index.js +1 -2
- package/build/es/single-select/features/can_be_disabled/index.js +1 -2
- package/build/es/single-select/features/can_be_empty/index.js +1 -2
- package/build/es/single-select/features/can_be_filtered/index.js +1 -2
- package/build/es/single-select/features/can_be_opened_and_closed/index.js +1 -2
- package/build/es/single-select/features/common/index.js +1 -1
- package/build/es/single-select/features/duplicate_option_values/index.js +3 -4
- package/build/es/single-select/features/menu_width_matches_input/index.js +1 -2
- package/build/es/single-select/features/position/index.js +1 -1
- package/build/es/single-select/features/shows_selections/index.js +1 -2
- package/build/es/single-select/input.js +6 -6
- package/build/es/single-select-field/features/accepts_help_text/index.js +1 -1
- package/build/es/single-select-field/features/accepts_label/index.js +1 -1
- package/build/es/single-select-field/features/accepts_validation_text/index.js +1 -1
- package/build/es/single-select-field/features/can_be_required/index.js +1 -1
- package/build/es/single-select-field/features/has_default_clear_text/index.js +4 -1
- package/build/es/single-select-field/features/has_default_clear_text.feature +1 -0
- package/build/es/single-select-field/features/has_default_empty_text/index.js +1 -1
- package/build/es/single-select-field/features/has_default_filter_nomatch_text/index.js +1 -1
- package/build/es/single-select-field/features/has_default_filter_placeholder/index.js +1 -1
- package/build/es/single-select-field/features/has_default_loading_text/index.js +1 -1
- package/package.json +15 -14
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(0, _steps.Given)('a clearable SingleSelect with a selection and onchange handler is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a clearable SingleSelect with a selection and onchange handler is rendered', () => {
|
|
8
6
|
cy.visitStory('SingleSelect', 'With clear button, selection and onChange');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.When)('the clear button is clicked', () => {
|
|
11
9
|
cy.get('[data-test="dhis2-uicore-singleselect-clear"]').click();
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('the SingleSelect is cleared', () => {
|
|
14
12
|
cy.window().should(win => {
|
|
15
13
|
expect(win.onChange).to.be.calledOnce;
|
|
16
14
|
expect(win.onChange).to.be.calledWith({
|
|
@@ -1,33 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(0, _steps.Given)('a disabled SingleSelect with options is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a disabled SingleSelect with options is rendered', () => {
|
|
8
6
|
cy.visitStory('SingleSelect', 'With options and disabled');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('a disabled SingleSelect with options and a selection is rendered', () => {
|
|
11
9
|
cy.visitStory('SingleSelect', 'With options, a selection and disabled');
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Given)('the SingleSelect is closed', () => {
|
|
14
12
|
cy.contains('option one').should('not.exist');
|
|
15
13
|
cy.contains('option two').should('not.exist');
|
|
16
14
|
cy.contains('option three').should('not.exist');
|
|
17
15
|
});
|
|
18
|
-
(0,
|
|
16
|
+
(0, _cypressCucumberPreprocessor.Given)('the SingleSelect is focused', () => {
|
|
19
17
|
cy.get('[data-test="dhis2-uicore-select-input"]').focus();
|
|
20
18
|
cy.focused().should('have.attr', 'data-test', 'dhis2-uicore-select-input');
|
|
21
19
|
});
|
|
22
|
-
(0,
|
|
20
|
+
(0, _cypressCucumberPreprocessor.When)('the down arrowkey is pressed on the focused element', () => {
|
|
23
21
|
cy.focused().type('{downarrow}');
|
|
24
22
|
});
|
|
25
|
-
(0,
|
|
23
|
+
(0, _cypressCucumberPreprocessor.When)('the spacebar is pressed on the focused element', () => {
|
|
26
24
|
cy.focused().type(' ');
|
|
27
25
|
});
|
|
28
|
-
(0,
|
|
26
|
+
(0, _cypressCucumberPreprocessor.When)('the up arrowkey is pressed on the focused element', () => {
|
|
29
27
|
cy.focused().type('{uparrow}');
|
|
30
28
|
});
|
|
31
|
-
(0,
|
|
29
|
+
(0, _cypressCucumberPreprocessor.Then)('the selection is displayed', () => {
|
|
32
30
|
cy.contains('option one').should('be.visible');
|
|
33
31
|
});
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(0, _steps.Given)('an empty SingleSelect is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('an empty SingleSelect is rendered', () => {
|
|
8
6
|
cy.visitStory('SingleSelect', 'Empty');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('an empty SingleSelect with custom empty text is rendered', () => {
|
|
11
9
|
cy.visitStory('SingleSelect', 'Empty with empty text');
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Given)('an empty SingleSelect with custom empty component is rendered', () => {
|
|
14
12
|
cy.visitStory('SingleSelect', 'Empty with empty component');
|
|
15
13
|
});
|
|
16
|
-
(0,
|
|
14
|
+
(0, _cypressCucumberPreprocessor.Then)('an empty menu is displayed', () => {
|
|
17
15
|
cy.get('[data-test="dhis2-uicore-layer"]').should('exist');
|
|
18
16
|
});
|
|
19
|
-
(0,
|
|
17
|
+
(0, _cypressCucumberPreprocessor.Then)('the custom empty text is displayed', () => {
|
|
20
18
|
cy.get('[data-test="dhis2-uicore-singleselect-empty"]').contains('Custom empty text').should('be.visible');
|
|
21
19
|
});
|
|
22
|
-
(0,
|
|
20
|
+
(0, _cypressCucumberPreprocessor.Then)('the custom empty component is displayed', () => {
|
|
23
21
|
cy.contains('Custom empty component').should('be.visible');
|
|
24
22
|
cy.get('.custom-empty').should('exist');
|
|
25
23
|
});
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(0, _steps.Given)('a filterable SingleSelect with options is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a filterable SingleSelect with options is rendered', () => {
|
|
8
6
|
cy.visitStory('SingleSelect', 'With filter field');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.When)('the user enters a filter string', () => {
|
|
11
9
|
cy.focused().type('one');
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.When)("the user enters a filter string that doesn't match any options", () => {
|
|
14
12
|
cy.focused().type('does not exist');
|
|
15
13
|
});
|
|
16
|
-
(0,
|
|
14
|
+
(0, _cypressCucumberPreprocessor.Then)('the matching options are displayed', () => {
|
|
17
15
|
cy.contains('option one').should('be.visible');
|
|
18
16
|
cy.contains('option two').should('not.exist');
|
|
19
17
|
cy.contains('option three').should('not.exist');
|
|
20
18
|
});
|
|
21
|
-
(0,
|
|
19
|
+
(0, _cypressCucumberPreprocessor.Then)('the no match text is displayed', () => {
|
|
22
20
|
cy.contains('No match found').should('be.visible');
|
|
23
21
|
});
|
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(0, _steps.Given)('a SingleSelect with options is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a SingleSelect with options is rendered', () => {
|
|
8
6
|
cy.visitStory('SingleSelect', 'With options');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('the SingleSelect is closed', () => {
|
|
11
9
|
cy.contains('option one').should('not.exist');
|
|
12
10
|
cy.contains('option two').should('not.exist');
|
|
13
11
|
cy.contains('option three').should('not.exist');
|
|
14
12
|
});
|
|
15
|
-
(0,
|
|
13
|
+
(0, _cypressCucumberPreprocessor.Given)('the SingleSelect is focused', () => {
|
|
16
14
|
cy.get('[data-test="dhis2-uicore-select-input"]').focus();
|
|
17
15
|
cy.focused().should('have.attr', 'data-test', 'dhis2-uicore-select-input');
|
|
18
16
|
});
|
|
19
|
-
(0,
|
|
17
|
+
(0, _cypressCucumberPreprocessor.When)('the down arrowkey is pressed on the focused element', () => {
|
|
20
18
|
cy.focused().type('{downarrow}');
|
|
21
19
|
});
|
|
22
|
-
(0,
|
|
20
|
+
(0, _cypressCucumberPreprocessor.When)('the spacebar is pressed on the focused element', () => {
|
|
23
21
|
cy.focused().type(' ');
|
|
24
22
|
});
|
|
25
|
-
(0,
|
|
23
|
+
(0, _cypressCucumberPreprocessor.When)('the up arrowkey is pressed on the focused element', () => {
|
|
26
24
|
cy.focused().type('{uparrow}');
|
|
27
25
|
});
|
|
28
|
-
(0,
|
|
26
|
+
(0, _cypressCucumberPreprocessor.When)('the escape key is pressed on the focused element', () => {
|
|
29
27
|
cy.focused().type('{esc}');
|
|
30
28
|
});
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a SingleSelect with options and onChange handler is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelect', 'With options and onChange');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('a SingleSelect with options, a selection and onChange handler is rendered', () => {
|
|
9
9
|
cy.visitStory('SingleSelect', 'With options, a selection and onChange');
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Given)('the SingleSelect is open', () => {
|
|
12
12
|
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
13
13
|
cy.contains('option one').should('exist');
|
|
14
14
|
cy.contains('option two').should('exist');
|
|
15
15
|
cy.contains('option three').should('exist');
|
|
16
16
|
});
|
|
17
|
-
(0,
|
|
17
|
+
(0, _cypressCucumberPreprocessor.When)('the SingleSelect input is clicked', () => {
|
|
18
18
|
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
19
19
|
});
|
|
20
|
-
(0,
|
|
20
|
+
(0, _cypressCucumberPreprocessor.When)('the user clicks the backdrop layer', () => {
|
|
21
21
|
cy.get('[data-test="dhis2-uicore-layer"]').click();
|
|
22
22
|
});
|
|
23
|
-
(0,
|
|
23
|
+
(0, _cypressCucumberPreprocessor.Then)('the options are not rendered', () => {
|
|
24
24
|
cy.contains('option one').should('not.exist');
|
|
25
25
|
cy.contains('option two').should('not.exist');
|
|
26
26
|
cy.contains('option three').should('not.exist');
|
|
27
27
|
});
|
|
28
|
-
(0,
|
|
28
|
+
(0, _cypressCucumberPreprocessor.Then)('the options are displayed', () => {
|
|
29
29
|
cy.contains('option one').should('be.visible');
|
|
30
30
|
cy.contains('option two').should('be.visible');
|
|
31
31
|
cy.contains('option three').should('be.visible');
|
|
32
32
|
});
|
|
33
|
-
(0,
|
|
33
|
+
(0, _cypressCucumberPreprocessor.Then)('the SingleSelect has focus', () => {
|
|
34
34
|
cy.focused().should('have.attr', 'data-test', 'dhis2-uicore-select-input');
|
|
35
35
|
});
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(0, _steps.Given)('a SingleSelect with options with a duplicate value and this value is selected', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a SingleSelect with options with a duplicate value and this value is selected', () => {
|
|
8
6
|
cy.visitStory('SingleSelect', 'With duplicate selected option values');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Then)('the first option with the selected value is displayed in the input', () => {
|
|
11
9
|
cy.get('[data-test="dhis2-uicore-select-input"]').should('contain', 'option one');
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
14
|
-
cy.get('[data-test="dhis2-uicore-singleselectoption"]
|
|
15
|
-
cy.get('[data-test="dhis2-uicore-singleselectoption"]
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('both options are highlighted in the dropdown', () => {
|
|
12
|
+
cy.get('[data-test="dhis2-uicore-singleselectoption"]:contains("option one")').should('have.class', 'active');
|
|
13
|
+
cy.get('[data-test="dhis2-uicore-singleselectoption"]:contains("option one a")').should('have.class', 'active');
|
|
16
14
|
});
|
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(0, _steps.Given)('a SingleSelect with hidden sibling elements', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a SingleSelect with hidden sibling elements', () => {
|
|
8
6
|
cy.visitStory('SingleSelect', 'Menu width changing');
|
|
9
7
|
cy.get('[data-test="dhis2-uicore-singleselect"]').then($el => {
|
|
10
8
|
cy.wrap($el.outerWidth()).as('originalWidth');
|
|
11
9
|
});
|
|
12
10
|
});
|
|
13
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.When)('the button is clicked', () => {
|
|
14
12
|
cy.get('button').click();
|
|
15
13
|
});
|
|
16
|
-
(0,
|
|
14
|
+
(0, _cypressCucumberPreprocessor.Then)('the siblings are displayed', () => {
|
|
17
15
|
cy.get('.toggler').should('exist').and('have.length', 2);
|
|
18
16
|
});
|
|
19
|
-
(0,
|
|
17
|
+
(0, _cypressCucumberPreprocessor.Then)('the menu width has decreased', () => {
|
|
20
18
|
cy.get('[data-test="dhis2-uicore-singleselect"]').then($el => {
|
|
21
19
|
const newWidth = $el.outerWidth();
|
|
22
20
|
cy.get('@originalWidth').should('be.greaterThan', newWidth);
|
|
23
21
|
});
|
|
24
22
|
});
|
|
25
|
-
(0,
|
|
23
|
+
(0, _cypressCucumberPreprocessor.When)('the SingleSelect menu is open', () => {
|
|
26
24
|
cy.get('[data-test="dhis2-uicore-select-menu-menuwrapper"]').should('be.visible');
|
|
27
25
|
});
|
|
28
|
-
(0,
|
|
26
|
+
(0, _cypressCucumberPreprocessor.Then)('the SingleSelect input is left aligned with the menu', () => {
|
|
29
27
|
const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
|
|
30
28
|
const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
31
29
|
cy.getAll(selectDataTest, menuDataTest).should(_ref => {
|
|
@@ -39,7 +37,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
39
37
|
expect(Math.round(inputRect.left)).to.equal(Math.round(menuRect.left));
|
|
40
38
|
});
|
|
41
39
|
});
|
|
42
|
-
(0,
|
|
40
|
+
(0, _cypressCucumberPreprocessor.When)('the SingleSelect input and menu have the same width', () => {
|
|
43
41
|
const inputSelector = '[data-test="dhis2-uicore-select"]';
|
|
44
42
|
const menuSelector = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
45
43
|
cy.getAll(inputSelector, menuSelector).should(_ref2 => {
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('there is enough space below the anchor to fit the SingleSelect menu', () => {
|
|
6
6
|
cy.visitStory('SingleSelect', 'Default position');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Given)('there is not enough space below the anchor to fit the SingleSelect menu', () => {
|
|
9
9
|
cy.visitStory('SingleSelect', 'Flipped position');
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Given)('there is not enough space above or below the anchor to fit the SingleSelect menu', () => {
|
|
12
12
|
cy.visitStory('SingleSelect', 'Shifted into view');
|
|
13
13
|
});
|
|
14
|
-
(0,
|
|
14
|
+
(0, _cypressCucumberPreprocessor.When)('the SingleSelect is clicked', () => {
|
|
15
15
|
cy.get('[data-test="dhis2-uicore-singleselect"]').click();
|
|
16
16
|
});
|
|
17
|
-
(0,
|
|
17
|
+
(0, _cypressCucumberPreprocessor.When)('the window is scrolled down', () => {
|
|
18
18
|
// Ensure the body can scroll first
|
|
19
19
|
cy.get('body').then($body => {
|
|
20
20
|
$body.height('5000px');
|
|
21
21
|
});
|
|
22
22
|
cy.scrollTo(0, 800);
|
|
23
23
|
});
|
|
24
|
-
(0,
|
|
24
|
+
(0, _cypressCucumberPreprocessor.Then)('the top of the menu is aligned with the bottom of the input', () => {
|
|
25
25
|
const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
|
|
26
26
|
const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
27
27
|
cy.getAll(selectDataTest, menuDataTest).should(_ref => {
|
|
@@ -35,7 +35,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
35
35
|
expect(menuRect.top).to.equal(selectRect.bottom);
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
|
-
(0,
|
|
38
|
+
(0, _cypressCucumberPreprocessor.Then)('the bottom of the menu is aligned with the top of the input', () => {
|
|
39
39
|
const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
|
|
40
40
|
const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
41
41
|
cy.getAll(selectDataTest, menuDataTest).should(_ref2 => {
|
|
@@ -49,7 +49,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
49
49
|
expect(selectRect.top).to.equal(menuRect.bottom);
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
|
-
(0,
|
|
52
|
+
(0, _cypressCucumberPreprocessor.Then)('it is rendered on top of the SingleSelect', () => {
|
|
53
53
|
const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
|
|
54
54
|
const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
55
55
|
cy.getAll(selectDataTest, menuDataTest).should(_ref3 => {
|
|
@@ -64,7 +64,7 @@ var _steps = require("cypress-cucumber-preprocessor/steps");
|
|
|
64
64
|
expect(menuRect.bottom).to.be.greaterThan(selectRect.bottom);
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
|
-
(0,
|
|
67
|
+
(0, _cypressCucumberPreprocessor.Then)('the left of the SingleSelect is aligned with the left of the anchor', () => {
|
|
68
68
|
const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
|
|
69
69
|
const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
70
70
|
cy.getAll(selectDataTest, menuDataTest).should(_ref4 => {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(0, _steps.Given)('a SingleSelect with options and a selection is rendered', () => {
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a SingleSelect with options and a selection is rendered', () => {
|
|
8
6
|
cy.visitStory('SingleSelect', 'With options and a selection');
|
|
9
7
|
});
|
|
10
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Then)('the selection is displayed', () => {
|
|
11
9
|
cy.contains('option one').should('be.visible');
|
|
12
10
|
});
|
|
@@ -39,7 +39,7 @@ const Input = _ref => {
|
|
|
39
39
|
} = _ref;
|
|
40
40
|
const hasSelection = selected && typeof selected === 'string';
|
|
41
41
|
|
|
42
|
-
const onClear =
|
|
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([["
|
|
51
|
+
className: _style.default.dynamic([["2186325794", [_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,20 +56,20 @@ 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([["
|
|
59
|
+
className: _style.default.dynamic([["2186325794", [_uiConstants.colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + "root-input"
|
|
60
60
|
}, /*#__PURE__*/_react.default.createElement(_selection.Selection, {
|
|
61
61
|
selected: selected,
|
|
62
62
|
options: options
|
|
63
63
|
})), hasSelection && clearable && !disabled && /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
-
className: _style.default.dynamic([["
|
|
64
|
+
className: _style.default.dynamic([["2186325794", [_uiConstants.colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + "root-right"
|
|
65
65
|
}, /*#__PURE__*/_react.default.createElement(_index.InputClearButton, {
|
|
66
66
|
onClear: onClear,
|
|
67
67
|
clearText: clearText,
|
|
68
68
|
dataTest: "".concat(dataTest, "-clear")
|
|
69
69
|
})), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
70
|
-
id: "
|
|
70
|
+
id: "2186325794",
|
|
71
71
|
dynamic: [_uiConstants.colors.grey900]
|
|
72
|
-
}, [".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;}", ".root-right.__jsx-style-dynamic-selector{margin-inline-start:auto;
|
|
72
|
+
}, [".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;}", ".root-right.__jsx-style-dynamic-selector{margin-inline-start:auto;}"]), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
73
73
|
id: "1331770409",
|
|
74
74
|
dynamic: [inputMaxHeight]
|
|
75
75
|
}, [".root-input.__jsx-style-dynamic-selector{max-height:".concat(inputMaxHeight, ";}")]));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a SingleSelectField with help text is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With help text');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
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
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a SingleSelectField with a label is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With label');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
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
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a SingleSelectField with validation text is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With validation text');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
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
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a SingleSelectField with label and a required flag is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With label and required status');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.Then)('the required indicator is visible', () => {
|
|
9
9
|
cy.get('[data-test="dhis2-uiwidgets-singleselectfield-label-required"]').should('be.visible');
|
|
10
10
|
});
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a clearable SingleSelectField with selected option is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With clearable and selected option');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.When)('the clear button is hovered', () => {
|
|
9
|
+
cy.get('[data-test="dhis2-uicore-singleselect-clear"]').trigger('mouseover', 'top');
|
|
10
|
+
});
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('the clear text is visible', () => {
|
|
9
12
|
cy.contains('Clear').should('be.visible');
|
|
10
13
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('an empty SingleSelectField is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'Without options');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.When)('the Select is opened', () => {
|
|
9
9
|
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
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
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a filterable SingleSelectField is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With filterable');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.When)('the Select is opened', () => {
|
|
9
9
|
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.When)('a filter that does not match any options is entered', () => {
|
|
12
12
|
cy.focused().type('Two');
|
|
13
13
|
});
|
|
14
|
-
(0,
|
|
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
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a filterable SingleSelectField is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With filterable');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.When)('the Select is opened', () => {
|
|
9
9
|
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('the filter placeholder exists', () => {
|
|
12
12
|
cy.get('[data-test="dhis2-uicore-singleselect-filterinput"] [placeholder="Type to filter options"]').should('exist');
|
|
13
13
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
|
4
4
|
|
|
5
|
-
(0,
|
|
5
|
+
(0, _cypressCucumberPreprocessor.Given)('a loading SingleSelectField is rendered', () => {
|
|
6
6
|
cy.visitStory('SingleSelectField', 'With loading');
|
|
7
7
|
});
|
|
8
|
-
(0,
|
|
8
|
+
(0, _cypressCucumberPreprocessor.When)('the Select is opened', () => {
|
|
9
9
|
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
10
10
|
});
|
|
11
|
-
(0,
|
|
11
|
+
(0, _cypressCucumberPreprocessor.Then)('the loading text is visible', () => {
|
|
12
12
|
cy.contains('Loading options').should('be.visible');
|
|
13
13
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"Clear": "ລຶບ",
|
|
3
3
|
"No data found": "ບໍ່ພົບຂໍ້ມູນ",
|
|
4
|
-
"Type to filter options": "",
|
|
5
|
-
"Loading options": "",
|
|
6
|
-
"No options found": ""
|
|
4
|
+
"Type to filter options": "ປະເພດຕົວເລືອກການກອງ",
|
|
5
|
+
"Loading options": "ໂຫຼດຕົວເລືອກ",
|
|
6
|
+
"No options found": "ບໍ່ພົບຕົວເລືອກ"
|
|
7
7
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with onBlur handler is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With onBlur');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with onFocus handler is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With onFocus');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with initial focus is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With initialFocus');
|
|
5
4
|
});
|