@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.
- 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,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 options and a loading flag is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With options and loading');
|
|
5
4
|
});
|
|
@@ -1,14 +1,10 @@
|
|
|
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 more than ten options is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With more than ten options');
|
|
5
4
|
});
|
|
6
5
|
Given('a MultiSelect with more than three options and a 100px max-height is rendered', () => {
|
|
7
6
|
cy.visitStory('MultiSelect', 'With more than three options and a 100px max-height');
|
|
8
7
|
});
|
|
9
|
-
Given('the MultiSelect is open', () => {
|
|
10
|
-
cy.get('[data-test="dhis2-uicore-select"]').click();
|
|
11
|
-
});
|
|
12
8
|
Then('has the default max-height', () => {
|
|
13
9
|
cy.get('[data-test="dhis2-uicore-select-menu-menuwrapper"]').should('have.css', 'max-height', '280px');
|
|
14
10
|
});
|
|
@@ -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 a placeholder and no selection is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With placeholder');
|
|
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 a prefix and no selection is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With prefix');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with invalid options is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With invalid options');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with a disabled option and onChange handler is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With disabled option and onChange');
|
|
5
4
|
});
|
|
@@ -10,7 +9,7 @@ When('an option is clicked', () => {
|
|
|
10
9
|
cy.contains('option one').click();
|
|
11
10
|
});
|
|
12
11
|
When('the selected option is clicked', () => {
|
|
13
|
-
cy.get('[data-test="dhis2-uicore-
|
|
12
|
+
cy.get('[data-test="dhis2-uicore-multiselectoption"]:contains("option one")').click();
|
|
14
13
|
});
|
|
15
14
|
When('another option is clicked', () => {
|
|
16
15
|
cy.contains('option two').click();
|
|
@@ -22,7 +21,7 @@ When('the disabled option is clicked', () => {
|
|
|
22
21
|
cy.contains('disabled option').click();
|
|
23
22
|
});
|
|
24
23
|
When('the selected option is clicked again', () => {
|
|
25
|
-
cy.get('[data-test="dhis2-uicore-multiselectoption"]
|
|
24
|
+
cy.get('[data-test="dhis2-uicore-multiselectoption"]:contains("option one")').click();
|
|
26
25
|
});
|
|
27
26
|
Then('the clicked option is selected', () => {
|
|
28
27
|
cy.window().should(win => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a clearable MultiSelect with a selection and onchange handler is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With clear button, selection and onChange');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a disabled MultiSelect with options is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With options and disabled');
|
|
5
4
|
});
|
|
@@ -15,9 +14,6 @@ Given('the MultiSelect is focused', () => {
|
|
|
15
14
|
cy.get('[data-test="dhis2-uicore-select-input"]').focus();
|
|
16
15
|
cy.focused().should('have.attr', 'data-test', 'dhis2-uicore-select-input');
|
|
17
16
|
});
|
|
18
|
-
When('the MultiSelect input is clicked', () => {
|
|
19
|
-
cy.get('[data-test="dhis2-uicore-select-input"]').click();
|
|
20
|
-
});
|
|
21
17
|
When('the down arrowkey is pressed on the focused element', () => {
|
|
22
18
|
cy.focused().type('{downarrow}');
|
|
23
19
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a filterable MultiSelect with options is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With filter field');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with options is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With options');
|
|
5
4
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a MultiSelect with options and onChange handler is rendered', () => {
|
|
3
3
|
cy.visitStory('MultiSelect', 'With options and onChange');
|
|
4
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 options with a duplicate value and this value is selected', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With duplicate selected option values');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a MultiSelect with hidden sibling elements', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'Menu width changing');
|
|
5
4
|
cy.get('[data-test="dhis2-uicore-multiselect"]').then($el => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, Then, When } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, Then, When } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('there is enough space below the anchor to fit the MultiSelect menu', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'Default position');
|
|
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 options and a selection is rendered', () => {
|
|
4
3
|
cy.visitStory('MultiSelect', 'With options and a selection');
|
|
5
4
|
});
|
|
@@ -23,7 +23,7 @@ const Input = _ref => {
|
|
|
23
23
|
} = _ref;
|
|
24
24
|
const hasSelection = selected.length > 0;
|
|
25
25
|
|
|
26
|
-
const onClear =
|
|
26
|
+
const onClear = e => {
|
|
27
27
|
const data = {
|
|
28
28
|
selected: []
|
|
29
29
|
};
|
|
@@ -32,7 +32,7 @@ const Input = _ref => {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
-
className: _JSXStyle.dynamic([["
|
|
35
|
+
className: _JSXStyle.dynamic([["64009541", [colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + (cx('root', className) || "")
|
|
36
36
|
}, /*#__PURE__*/React.createElement(InputPrefix, {
|
|
37
37
|
prefix: prefix,
|
|
38
38
|
dataTest: "".concat(dataTest, "-prefix")
|
|
@@ -40,22 +40,22 @@ const Input = _ref => {
|
|
|
40
40
|
placeholder: placeholder,
|
|
41
41
|
dataTest: "".concat(dataTest, "-placeholder")
|
|
42
42
|
}), hasSelection && /*#__PURE__*/React.createElement("div", {
|
|
43
|
-
className: _JSXStyle.dynamic([["
|
|
43
|
+
className: _JSXStyle.dynamic([["64009541", [colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + "root-input"
|
|
44
44
|
}, /*#__PURE__*/React.createElement(SelectionList, {
|
|
45
45
|
selected: selected,
|
|
46
46
|
onChange: onChange,
|
|
47
47
|
options: options,
|
|
48
48
|
disabled: disabled
|
|
49
49
|
})), hasSelection && clearable && !disabled && /*#__PURE__*/React.createElement("div", {
|
|
50
|
-
className: _JSXStyle.dynamic([["
|
|
50
|
+
className: _JSXStyle.dynamic([["64009541", [colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + "root-right"
|
|
51
51
|
}, /*#__PURE__*/React.createElement(InputClearButton, {
|
|
52
52
|
onClear: onClear,
|
|
53
53
|
clearText: clearText,
|
|
54
54
|
dataTest: "".concat(dataTest, "-clear")
|
|
55
55
|
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
56
|
-
id: "
|
|
56
|
+
id: "64009541",
|
|
57
57
|
dynamic: [colors.grey900]
|
|
58
|
-
}, [".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;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;
|
|
58
|
+
}, [".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;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.createElement(_JSXStyle, {
|
|
59
59
|
id: "1331770409",
|
|
60
60
|
dynamic: [inputMaxHeight]
|
|
61
61
|
}, [".root-input.__jsx-style-dynamic-selector{max-height:".concat(inputMaxHeight, ";}")]));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a MultiSelectField with validation text is rendered', () => {
|
|
3
3
|
cy.visitStory('MultiSelectField', 'With validation text');
|
|
4
4
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a MultiSelectField with label and a required flag is rendered', () => {
|
|
3
3
|
cy.visitStory('MultiSelectField', 'With label and required status');
|
|
4
4
|
});
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a clearable MultiSelectField with selected option is rendered', () => {
|
|
3
3
|
cy.visitStory('MultiSelectField', 'With clearable and selected option');
|
|
4
4
|
});
|
|
5
|
+
When('the clear button is hovered', () => {
|
|
6
|
+
cy.get('[data-test="dhis2-uicore-multiselect-clear"]').trigger('mouseover', 'top');
|
|
7
|
+
});
|
|
5
8
|
Then('the clear text is visible', () => {
|
|
6
9
|
cy.contains('Clear').should('be.visible');
|
|
7
10
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, Then, When } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, Then, When } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a filterable MultiSelectField is rendered', () => {
|
|
3
3
|
cy.visitStory('MultiSelectField', 'With filterable');
|
|
4
4
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, Then, When } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, Then, When } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a filterable MultiSelectField is rendered', () => {
|
|
3
3
|
cy.visitStory('MultiSelectField', 'With filterable');
|
|
4
4
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
import { Tooltip } from '@dhis2-ui/tooltip';
|
|
3
|
+
import { colors, theme } from '@dhis2/ui-constants';
|
|
2
4
|
import PropTypes from 'prop-types';
|
|
3
5
|
import React from 'react';
|
|
4
6
|
|
|
@@ -9,14 +11,29 @@ const InputClearButton = _ref => {
|
|
|
9
11
|
className,
|
|
10
12
|
dataTest
|
|
11
13
|
} = _ref;
|
|
12
|
-
return /*#__PURE__*/React.createElement(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
15
|
+
openDelay: 500,
|
|
16
|
+
content: clearText
|
|
17
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
18
|
+
"data-test": dataTest,
|
|
16
19
|
onClick: onClear,
|
|
17
20
|
type: "button",
|
|
18
|
-
className: className
|
|
19
|
-
},
|
|
21
|
+
className: _JSXStyle.dynamic([["2606883952", [colors.grey500, colors.grey800, colors.grey200, theme.focus]]]) + " " + (className || "")
|
|
22
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
23
|
+
width: "16",
|
|
24
|
+
height: "16",
|
|
25
|
+
viewBox: "0 0 16 16",
|
|
26
|
+
fill: "none",
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28
|
+
className: _JSXStyle.dynamic([["2606883952", [colors.grey500, colors.grey800, colors.grey200, theme.focus]]])
|
|
29
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
30
|
+
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",
|
|
31
|
+
fill: "none",
|
|
32
|
+
className: _JSXStyle.dynamic([["2606883952", [colors.grey500, colors.grey800, colors.grey200, theme.focus]]])
|
|
33
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
34
|
+
id: "2606883952",
|
|
35
|
+
dynamic: [colors.grey500, colors.grey800, colors.grey200, theme.focus]
|
|
36
|
+
}, ["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(colors.grey500, ";}"), "button.__jsx-style-dynamic-selector:hover svg.__jsx-style-dynamic-selector path.__jsx-style-dynamic-selector{fill:".concat(colors.grey800, ";}"), "button.__jsx-style-dynamic-selector:hover{background:".concat(colors.grey200, ";}"), "button.__jsx-style-dynamic-selector:focus{outline:2px solid ".concat(theme.focus, ";}")])));
|
|
20
37
|
};
|
|
21
38
|
|
|
22
39
|
InputClearButton.propTypes = {
|
|
@@ -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 SingleSelect with onBlur handler is rendered', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', '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 SingleSelect with onFocus handler is rendered', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', '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 SingleSelect with initial focus is rendered', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', 'With initialFocus');
|
|
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 SingleSelect with options and a loading flag is rendered', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', 'With options and loading');
|
|
5
4
|
});
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a SingleSelect with more than ten options is rendered', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', 'With more than ten options');
|
|
5
4
|
});
|
|
6
5
|
Given('a SingleSelect with more than three options and a 100px max-height is rendered', () => {
|
|
7
6
|
cy.visitStory('SingleSelect', 'With more than three options and a 100px max-height');
|
|
8
7
|
});
|
|
9
|
-
Given('the SingleSelect is open', () => {
|
|
10
|
-
cy.get('[data-test="dhis2-uicore-select"]').click();
|
|
11
|
-
});
|
|
12
8
|
Then('has the default max-height', () => {
|
|
13
9
|
cy.get('[data-test="dhis2-uicore-select-menu-menuwrapper"]').should('have.css', 'max-height', '280px');
|
|
14
10
|
});
|
|
@@ -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 SingleSelect with a placeholder and no selection is rendered', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', 'With placeholder');
|
|
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 SingleSelect with a prefix and no selection is rendered', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', 'With prefix');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a SingleSelect with invalid options is rendered', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', 'With invalid options');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a SingleSelect with a disabled option and onChange handler is rendered', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', 'With disabled option and onChange');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a clearable SingleSelect with a selection and onchange handler is rendered', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', 'With clear button, selection and onChange');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a disabled SingleSelect with options is rendered', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', 'With options and disabled');
|
|
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('an empty SingleSelect is rendered', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', 'Empty');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a filterable SingleSelect with options is rendered', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', 'With filter field');
|
|
5
4
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a SingleSelect with options is rendered', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', 'With options');
|
|
5
4
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a SingleSelect with options and onChange handler is rendered', () => {
|
|
3
3
|
cy.visitStory('SingleSelect', 'With options and onChange');
|
|
4
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 SingleSelect with options with a duplicate value and this value is selected', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', 'With duplicate selected option values');
|
|
5
4
|
});
|
|
@@ -7,6 +6,6 @@ Then('the first option with the selected value is displayed in the input', () =>
|
|
|
7
6
|
cy.get('[data-test="dhis2-uicore-select-input"]').should('contain', 'option one');
|
|
8
7
|
});
|
|
9
8
|
Then('both options are highlighted in the dropdown', () => {
|
|
10
|
-
cy.get('[data-test="dhis2-uicore-singleselectoption"]
|
|
11
|
-
cy.get('[data-test="dhis2-uicore-singleselectoption"]
|
|
9
|
+
cy.get('[data-test="dhis2-uicore-singleselectoption"]:contains("option one")').should('have.class', 'active');
|
|
10
|
+
cy.get('[data-test="dhis2-uicore-singleselectoption"]:contains("option one a")').should('have.class', 'active');
|
|
12
11
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps';
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
3
2
|
Given('a SingleSelect with hidden sibling elements', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', 'Menu width changing');
|
|
5
4
|
cy.get('[data-test="dhis2-uicore-singleselect"]').then($el => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, Then, When } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, Then, When } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('there is enough space below the anchor to fit the SingleSelect menu', () => {
|
|
3
3
|
cy.visitStory('SingleSelect', 'Default position');
|
|
4
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 SingleSelect with options and a selection is rendered', () => {
|
|
4
3
|
cy.visitStory('SingleSelect', 'With options and a selection');
|
|
5
4
|
});
|
|
@@ -23,7 +23,7 @@ const Input = _ref => {
|
|
|
23
23
|
} = _ref;
|
|
24
24
|
const hasSelection = selected && typeof selected === 'string';
|
|
25
25
|
|
|
26
|
-
const onClear =
|
|
26
|
+
const onClear = e => {
|
|
27
27
|
const data = {
|
|
28
28
|
selected: ''
|
|
29
29
|
};
|
|
@@ -32,7 +32,7 @@ const Input = _ref => {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
-
className: _JSXStyle.dynamic([["
|
|
35
|
+
className: _JSXStyle.dynamic([["2186325794", [colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + (cx('root', className) || "")
|
|
36
36
|
}, /*#__PURE__*/React.createElement(InputPrefix, {
|
|
37
37
|
prefix: prefix,
|
|
38
38
|
dataTest: "".concat(dataTest, "-prefix")
|
|
@@ -40,20 +40,20 @@ const Input = _ref => {
|
|
|
40
40
|
placeholder: placeholder,
|
|
41
41
|
dataTest: "".concat(dataTest, "-placeholder")
|
|
42
42
|
}), hasSelection && /*#__PURE__*/React.createElement("div", {
|
|
43
|
-
className: _JSXStyle.dynamic([["
|
|
43
|
+
className: _JSXStyle.dynamic([["2186325794", [colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + "root-input"
|
|
44
44
|
}, /*#__PURE__*/React.createElement(Selection, {
|
|
45
45
|
selected: selected,
|
|
46
46
|
options: options
|
|
47
47
|
})), hasSelection && clearable && !disabled && /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
className: _JSXStyle.dynamic([["
|
|
48
|
+
className: _JSXStyle.dynamic([["2186325794", [colors.grey900]], ["1331770409", [inputMaxHeight]]]) + " " + "root-right"
|
|
49
49
|
}, /*#__PURE__*/React.createElement(InputClearButton, {
|
|
50
50
|
onClear: onClear,
|
|
51
51
|
clearText: clearText,
|
|
52
52
|
dataTest: "".concat(dataTest, "-clear")
|
|
53
53
|
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
54
|
-
id: "
|
|
54
|
+
id: "2186325794",
|
|
55
55
|
dynamic: [colors.grey900]
|
|
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-inline-start:auto;
|
|
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-inline-start:auto;}"]), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
57
57
|
id: "1331770409",
|
|
58
58
|
dynamic: [inputMaxHeight]
|
|
59
59
|
}, [".root-input.__jsx-style-dynamic-selector{max-height:".concat(inputMaxHeight, ";}")]));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a SingleSelectField with validation text is rendered', () => {
|
|
3
3
|
cy.visitStory('SingleSelectField', 'With validation text');
|
|
4
4
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a SingleSelectField with label and a required flag is rendered', () => {
|
|
3
3
|
cy.visitStory('SingleSelectField', 'With label and required status');
|
|
4
4
|
});
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { Given, Then } from 'cypress-cucumber-preprocessor
|
|
1
|
+
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor';
|
|
2
2
|
Given('a clearable SingleSelectField with selected option is rendered', () => {
|
|
3
3
|
cy.visitStory('SingleSelectField', 'With clearable and selected option');
|
|
4
4
|
});
|
|
5
|
+
When('the clear button is hovered', () => {
|
|
6
|
+
cy.get('[data-test="dhis2-uicore-singleselect-clear"]').trigger('mouseover', 'top');
|
|
7
|
+
});
|
|
5
8
|
Then('the clear text is visible', () => {
|
|
6
9
|
cy.contains('Clear').should('be.visible');
|
|
7
10
|
});
|