@dhis2-ui/select 10.16.3-alpha.1 → 10.16.4
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/index.js +94 -57
- package/build/cjs/multi-select/features/menu_width_matches_input/index.js +2 -4
- package/build/cjs/multi-select/features/position/index.js +6 -12
- package/build/cjs/multi-select/filterable-menu.js +22 -25
- package/build/cjs/multi-select/input.js +14 -15
- package/build/cjs/multi-select/menu.js +24 -28
- package/build/cjs/multi-select/multi-select.e2e.stories.js +21 -32
- package/build/cjs/multi-select/multi-select.js +30 -31
- package/build/cjs/multi-select/multi-select.prod.stories.js +13 -21
- package/build/cjs/multi-select/selection-list.js +51 -57
- package/build/cjs/multi-select-option/multi-select-option.js +27 -30
- package/build/cjs/select/debounce/debounce.js +2 -6
- package/build/cjs/select/empty.js +11 -14
- package/build/cjs/select/filter-input.js +21 -24
- package/build/cjs/select/filterable-menu.js +6 -8
- package/build/cjs/select/input-clear-button.js +28 -31
- package/build/cjs/select/input-placeholder.js +5 -6
- package/build/cjs/select/input-prefix.js +5 -6
- package/build/cjs/select/input-wrapper.js +13 -14
- package/build/cjs/select/loading.js +15 -18
- package/build/cjs/select/menu-wrapper.js +8 -9
- package/build/cjs/select/no-match.js +9 -12
- package/build/cjs/select/select.js +3 -4
- package/build/cjs/simple-single-select/__stories__/DefaultPosition.js +1 -2
- package/build/cjs/simple-single-select/__stories__/Dense.js +1 -2
- package/build/cjs/simple-single-select/__stories__/Empty.js +1 -2
- package/build/cjs/simple-single-select/__stories__/EmptyWithEmptyNode.js +1 -2
- package/build/cjs/simple-single-select/__stories__/EmptyWithEmptyText.js +1 -2
- package/build/cjs/simple-single-select/__stories__/FlippedPosition.js +1 -2
- package/build/cjs/simple-single-select/__stories__/InfiniteLoading.js +1 -2
- package/build/cjs/simple-single-select/__stories__/ShiftedIntoView.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithClearButton.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithCustomLowMaxHeight.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithCustomOptions.js +17 -21
- package/build/cjs/simple-single-select/__stories__/WithDisabledOption.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithFilterField.js +5 -9
- package/build/cjs/simple-single-select/__stories__/WithInitialFocus.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithManyOptions.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithMultipleSelectsAndScrollableParent.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithNoMatchText.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithOnBlur.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithOnFocus.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithOptionsAndDisabled.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithOptionsAndLoading.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithOptionsAndLoadingText.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithPlaceholder.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithPlaceholderAndSelection.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithPrefix.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithPrefixAndSelection.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithRTL.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithScrollingParent.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithSelection.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithSelectionAndDisabled.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithServerSideFilteringDemo.js +25 -36
- package/build/cjs/simple-single-select/__stories__/WithSimpleFilteringDemo.js +4 -6
- package/build/cjs/simple-single-select/__stories__/WithoutOptionsAndLoading.js +1 -2
- package/build/cjs/simple-single-select/__stories__/WithoutSelection.js +1 -2
- package/build/cjs/simple-single-select/__stories__/simple-single-select-server-side-filtering/CustomDataProvider.js +19 -26
- package/build/cjs/simple-single-select/features/keyboard-interactions.test.e2e.js +9 -18
- package/build/cjs/simple-single-select/features/menu-positioning.test.e2e.js +8 -16
- package/build/cjs/simple-single-select/menu/empty.js +8 -11
- package/build/cjs/simple-single-select/menu/filter.js +11 -12
- package/build/cjs/simple-single-select/menu/loading.js +3 -4
- package/build/cjs/simple-single-select/menu/menu.js +26 -28
- package/build/cjs/simple-single-select/menu/no-match.js +9 -12
- package/build/cjs/simple-single-select/menu/option.js +20 -23
- package/build/cjs/simple-single-select/menu/options-list.js +23 -26
- package/build/cjs/simple-single-select/selected-value/clear-button.js +5 -6
- package/build/cjs/simple-single-select/selected-value/container.js +23 -25
- package/build/cjs/simple-single-select/selected-value/placeholder.js +5 -6
- package/build/cjs/simple-single-select/selected-value/prefix.js +5 -6
- package/build/cjs/simple-single-select/selected-value/selected-value.js +34 -35
- package/build/cjs/simple-single-select/simple-single-select.e2e.stories.js +1 -2
- package/build/cjs/simple-single-select/simple-single-select.js +47 -50
- package/build/cjs/simple-single-select/simple-single-select.test.js +14 -24
- package/build/cjs/simple-single-select/use-handle-key-press/use-focus-option.js +5 -6
- package/build/cjs/simple-single-select/use-handle-key-press/use-handle-key-press-on-combobox.js +31 -34
- package/build/cjs/simple-single-select/use-handle-key-press/use-handle-key-press-on-filter-input.js +11 -12
- package/build/cjs/simple-single-select/use-handle-key-press/use-handle-typing.js +10 -14
- package/build/cjs/simple-single-select/use-handle-key-press/use-highlight-first-option-on-previous-page.js +6 -7
- package/build/cjs/simple-single-select/use-handle-key-press/use-highlight-first-visible-option.js +5 -6
- package/build/cjs/simple-single-select/use-handle-key-press/use-highlight-last-option-on-next-page.js +6 -7
- package/build/cjs/simple-single-select/use-handle-key-press/use-highlight-last-visible-option.js +5 -6
- package/build/cjs/simple-single-select/use-handle-key-press/use-page-down.js +6 -7
- package/build/cjs/simple-single-select/use-handle-key-press/use-page-up.js +6 -7
- package/build/cjs/simple-single-select/use-handle-key-press/utils.js +17 -22
- package/build/cjs/simple-single-select-field/simple-single-select-field.js +3 -6
- package/build/cjs/simple-single-select-field/simple-single-select-field.prod.stories.js +1 -2
- package/build/cjs/simple-single-select-field/simple-single-select-field.test.js +3 -6
- package/build/cjs/single-select/features/menu_width_matches_input/index.js +2 -4
- package/build/cjs/single-select/features/position/index.js +4 -8
- package/build/cjs/single-select/filterable-menu.js +22 -25
- package/build/cjs/single-select/input.js +13 -14
- package/build/cjs/single-select/menu.js +9 -10
- package/build/cjs/single-select/selection.js +5 -6
- package/build/cjs/single-select/single-select.e2e.stories.js +18 -28
- package/build/cjs/single-select/single-select.js +29 -30
- package/build/cjs/single-select/single-select.prod.stories.js +7 -11
- package/build/cjs/single-select-option/single-select-option.js +25 -28
- package/build/es/locales/index.js +70 -33
- package/build/es/multi-select/features/menu_width_matches_input/index.js +2 -4
- package/build/es/multi-select/features/position/index.js +6 -12
- package/build/es/multi-select/filterable-menu.js +22 -25
- package/build/es/multi-select/input.js +14 -15
- package/build/es/multi-select/menu.js +24 -28
- package/build/es/multi-select/multi-select.e2e.stories.js +20 -30
- package/build/es/multi-select/multi-select.js +30 -31
- package/build/es/multi-select/multi-select.prod.stories.js +12 -19
- package/build/es/multi-select/selection-list.js +51 -57
- package/build/es/multi-select-option/multi-select-option.js +27 -30
- package/build/es/select/debounce/debounce.js +2 -6
- package/build/es/select/empty.js +11 -14
- package/build/es/select/filter-input.js +21 -24
- package/build/es/select/filterable-menu.js +5 -6
- package/build/es/select/input-clear-button.js +28 -31
- package/build/es/select/input-placeholder.js +5 -6
- package/build/es/select/input-prefix.js +5 -6
- package/build/es/select/input-wrapper.js +13 -14
- package/build/es/select/loading.js +15 -18
- package/build/es/select/menu-wrapper.js +8 -9
- package/build/es/select/no-match.js +9 -12
- package/build/es/select/select.js +2 -2
- package/build/es/simple-single-select/__stories__/WithCustomOptions.js +16 -19
- package/build/es/simple-single-select/__stories__/WithFilterField.js +4 -7
- package/build/es/simple-single-select/__stories__/WithServerSideFilteringDemo.js +24 -34
- package/build/es/simple-single-select/__stories__/WithSimpleFilteringDemo.js +3 -4
- package/build/es/simple-single-select/__stories__/simple-single-select-server-side-filtering/CustomDataProvider.js +19 -26
- package/build/es/simple-single-select/features/keyboard-interactions.test.e2e.js +9 -18
- package/build/es/simple-single-select/features/menu-positioning.test.e2e.js +8 -16
- package/build/es/simple-single-select/menu/empty.js +8 -11
- package/build/es/simple-single-select/menu/filter.js +11 -12
- package/build/es/simple-single-select/menu/loading.js +3 -4
- package/build/es/simple-single-select/menu/menu.js +25 -26
- package/build/es/simple-single-select/menu/no-match.js +9 -12
- package/build/es/simple-single-select/menu/option.js +19 -21
- package/build/es/simple-single-select/menu/options-list.js +22 -24
- package/build/es/simple-single-select/selected-value/clear-button.js +5 -6
- package/build/es/simple-single-select/selected-value/container.js +22 -23
- package/build/es/simple-single-select/selected-value/placeholder.js +5 -6
- package/build/es/simple-single-select/selected-value/prefix.js +5 -6
- package/build/es/simple-single-select/selected-value/selected-value.js +34 -35
- package/build/es/simple-single-select/simple-single-select.js +46 -48
- package/build/es/simple-single-select/simple-single-select.test.js +13 -22
- package/build/es/simple-single-select/use-handle-key-press/use-focus-option.js +5 -6
- package/build/es/simple-single-select/use-handle-key-press/use-handle-key-press-on-combobox.js +31 -34
- package/build/es/simple-single-select/use-handle-key-press/use-handle-key-press-on-filter-input.js +11 -12
- package/build/es/simple-single-select/use-handle-key-press/use-handle-typing.js +10 -14
- package/build/es/simple-single-select/use-handle-key-press/use-highlight-first-option-on-previous-page.js +6 -7
- package/build/es/simple-single-select/use-handle-key-press/use-highlight-first-visible-option.js +5 -6
- package/build/es/simple-single-select/use-handle-key-press/use-highlight-last-option-on-next-page.js +6 -7
- package/build/es/simple-single-select/use-handle-key-press/use-highlight-last-visible-option.js +5 -6
- package/build/es/simple-single-select/use-handle-key-press/use-page-down.js +6 -7
- package/build/es/simple-single-select/use-handle-key-press/use-page-up.js +6 -7
- package/build/es/simple-single-select/use-handle-key-press/utils.js +17 -22
- package/build/es/simple-single-select-field/simple-single-select-field.js +3 -6
- package/build/es/simple-single-select-field/simple-single-select-field.test.js +3 -6
- package/build/es/single-select/features/menu_width_matches_input/index.js +2 -4
- package/build/es/single-select/features/position/index.js +4 -8
- package/build/es/single-select/filterable-menu.js +22 -25
- package/build/es/single-select/input.js +13 -14
- package/build/es/single-select/menu.js +9 -10
- package/build/es/single-select/selection.js +5 -6
- package/build/es/single-select/single-select.e2e.stories.js +17 -26
- package/build/es/single-select/single-select.js +29 -30
- package/build/es/single-select/single-select.prod.stories.js +6 -9
- package/build/es/single-select-option/single-select-option.js +25 -28
- package/package.json +15 -15
- package/src/locales/index.js +102 -33
|
@@ -1,36 +1,31 @@
|
|
|
1
|
-
export function isEnabled(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} = _ref;
|
|
1
|
+
export function isEnabled({
|
|
2
|
+
disabled
|
|
3
|
+
}) {
|
|
5
4
|
return !disabled;
|
|
6
5
|
}
|
|
7
|
-
export function findNextOptionIndex(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} = _ref2;
|
|
6
|
+
export function findNextOptionIndex({
|
|
7
|
+
options,
|
|
8
|
+
activeIndex
|
|
9
|
+
}) {
|
|
12
10
|
const startIndex = activeIndex + 1;
|
|
13
11
|
const optionsToSearch = options.slice(startIndex);
|
|
14
12
|
|
|
15
13
|
// Need to add back the count we removed by slicing the options array
|
|
16
14
|
return startIndex + optionsToSearch.findIndex(isEnabled);
|
|
17
15
|
}
|
|
18
|
-
export function findPrevOptionIndex(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = _ref3;
|
|
16
|
+
export function findPrevOptionIndex({
|
|
17
|
+
options,
|
|
18
|
+
activeIndex
|
|
19
|
+
}) {
|
|
23
20
|
return options.slice(0, activeIndex).findLastIndex(isEnabled);
|
|
24
21
|
}
|
|
25
|
-
export function findFirstOptionIndex(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} = _ref4;
|
|
22
|
+
export function findFirstOptionIndex({
|
|
23
|
+
options
|
|
24
|
+
}) {
|
|
29
25
|
return options.findIndex(isEnabled);
|
|
30
26
|
}
|
|
31
|
-
export function findLastOptionIndex(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} = _ref5;
|
|
27
|
+
export function findLastOptionIndex({
|
|
28
|
+
options
|
|
29
|
+
}) {
|
|
35
30
|
return options.findLastIndex(isEnabled);
|
|
36
31
|
}
|
|
@@ -128,12 +128,9 @@ SimpleSingleSelectField.propTypes = {
|
|
|
128
128
|
* be used to supply the text to be shown.
|
|
129
129
|
**/
|
|
130
130
|
valueLabel: requiredIf(props => {
|
|
131
|
-
if (props.options.find(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
} = _ref2;
|
|
135
|
-
return props.value === value;
|
|
136
|
-
})) {
|
|
131
|
+
if (props.options.find(({
|
|
132
|
+
value
|
|
133
|
+
}) => props.value === value)) {
|
|
137
134
|
return false;
|
|
138
135
|
}
|
|
139
136
|
return props.value;
|
|
@@ -8,12 +8,9 @@ jest.mock('../simple-single-select/simple-single-select.js', () => ({
|
|
|
8
8
|
SimpleSingleSelect: jest.fn(() => /*#__PURE__*/React.createElement("div", null))
|
|
9
9
|
}));
|
|
10
10
|
jest.mock('@dhis2-ui/field', () => ({
|
|
11
|
-
Field: jest.fn(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} = _ref;
|
|
15
|
-
return children;
|
|
16
|
-
})
|
|
11
|
+
Field: jest.fn(({
|
|
12
|
+
children
|
|
13
|
+
}) => children)
|
|
17
14
|
}));
|
|
18
15
|
describe('<SimpleSingleSelectField />', () => {
|
|
19
16
|
afterEach(() => {
|
|
@@ -23,8 +23,7 @@ When('the SingleSelect menu is open', () => {
|
|
|
23
23
|
Then('the SingleSelect input is left aligned with the menu', () => {
|
|
24
24
|
const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
|
|
25
25
|
const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
26
|
-
cy.getAll(selectDataTest, menuDataTest).should(
|
|
27
|
-
let [inputs, menus] = _ref;
|
|
26
|
+
cy.getAll(selectDataTest, menuDataTest).should(([inputs, menus]) => {
|
|
28
27
|
expect(inputs.length).to.equal(1);
|
|
29
28
|
expect(menus.length).to.equal(1);
|
|
30
29
|
const $input = inputs[0];
|
|
@@ -37,8 +36,7 @@ Then('the SingleSelect input is left aligned with the menu', () => {
|
|
|
37
36
|
When('the SingleSelect input and menu have the same width', () => {
|
|
38
37
|
const inputSelector = '[data-test="dhis2-uicore-select"]';
|
|
39
38
|
const menuSelector = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
40
|
-
cy.getAll(inputSelector, menuSelector).should(
|
|
41
|
-
let [$input, $menu] = _ref2;
|
|
39
|
+
cy.getAll(inputSelector, menuSelector).should(([$input, $menu]) => {
|
|
42
40
|
const inputWidth = Math.round($input.outerWidth());
|
|
43
41
|
const menuWidth = Math.round($menu.outerWidth());
|
|
44
42
|
expect(inputWidth).to.equal(menuWidth);
|
|
@@ -21,8 +21,7 @@ When('the window is scrolled down', () => {
|
|
|
21
21
|
Then('the top of the menu is aligned with the bottom of the input', () => {
|
|
22
22
|
const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
|
|
23
23
|
const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
24
|
-
cy.getAll(selectDataTest, menuDataTest).should(
|
|
25
|
-
let [selects, menus] = _ref;
|
|
24
|
+
cy.getAll(selectDataTest, menuDataTest).should(([selects, menus]) => {
|
|
26
25
|
expect(selects.length).to.equal(1);
|
|
27
26
|
expect(menus.length).to.equal(1);
|
|
28
27
|
const $select = selects[0];
|
|
@@ -35,8 +34,7 @@ Then('the top of the menu is aligned with the bottom of the input', () => {
|
|
|
35
34
|
Then('the bottom of the menu is aligned with the top of the input', () => {
|
|
36
35
|
const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
|
|
37
36
|
const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
38
|
-
cy.getAll(selectDataTest, menuDataTest).should(
|
|
39
|
-
let [selects, menus] = _ref2;
|
|
37
|
+
cy.getAll(selectDataTest, menuDataTest).should(([selects, menus]) => {
|
|
40
38
|
expect(selects.length).to.equal(1);
|
|
41
39
|
expect(menus.length).to.equal(1);
|
|
42
40
|
const $select = selects[0];
|
|
@@ -49,8 +47,7 @@ Then('the bottom of the menu is aligned with the top of the input', () => {
|
|
|
49
47
|
Then('it is rendered on top of the SingleSelect', () => {
|
|
50
48
|
const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
|
|
51
49
|
const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
52
|
-
cy.getAll(selectDataTest, menuDataTest).should(
|
|
53
|
-
let [selects, menus] = _ref3;
|
|
50
|
+
cy.getAll(selectDataTest, menuDataTest).should(([selects, menus]) => {
|
|
54
51
|
expect(selects.length).to.equal(1);
|
|
55
52
|
expect(menus.length).to.equal(1);
|
|
56
53
|
const $select = selects[0];
|
|
@@ -64,8 +61,7 @@ Then('it is rendered on top of the SingleSelect', () => {
|
|
|
64
61
|
Then('the left of the SingleSelect is aligned with the left of the anchor', () => {
|
|
65
62
|
const selectDataTest = '[data-test="dhis2-uicore-singleselect"]';
|
|
66
63
|
const menuDataTest = '[data-test="dhis2-uicore-select-menu-menuwrapper"]';
|
|
67
|
-
cy.getAll(selectDataTest, menuDataTest).should(
|
|
68
|
-
let [selects, menus] = _ref4;
|
|
64
|
+
cy.getAll(selectDataTest, menuDataTest).should(([selects, menus]) => {
|
|
69
65
|
expect(selects.length).to.equal(1);
|
|
70
66
|
expect(menus.length).to.equal(1);
|
|
71
67
|
const $select = selects[0];
|
|
@@ -2,31 +2,28 @@ import PropTypes from 'prop-types';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { FilterableMenu as CommonFilterableMenu } from '../select/index.js';
|
|
4
4
|
import { Menu } from './menu.js';
|
|
5
|
-
export const FilterableMenu =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Menu: Menu
|
|
28
|
-
});
|
|
29
|
-
};
|
|
5
|
+
export const FilterableMenu = ({
|
|
6
|
+
dataTest,
|
|
7
|
+
options,
|
|
8
|
+
onChange,
|
|
9
|
+
selected,
|
|
10
|
+
empty,
|
|
11
|
+
handleClose,
|
|
12
|
+
handleFocusInput,
|
|
13
|
+
placeholder,
|
|
14
|
+
noMatchText
|
|
15
|
+
}) => /*#__PURE__*/React.createElement(CommonFilterableMenu, {
|
|
16
|
+
dataTest: dataTest,
|
|
17
|
+
options: options,
|
|
18
|
+
onChange: onChange,
|
|
19
|
+
selected: selected,
|
|
20
|
+
empty: empty,
|
|
21
|
+
handleClose: handleClose,
|
|
22
|
+
handleFocusInput: handleFocusInput,
|
|
23
|
+
placeholder: placeholder,
|
|
24
|
+
noMatchText: noMatchText,
|
|
25
|
+
Menu: Menu
|
|
26
|
+
});
|
|
30
27
|
FilterableMenu.propTypes = {
|
|
31
28
|
dataTest: PropTypes.string.isRequired,
|
|
32
29
|
noMatchText: PropTypes.string.isRequired,
|
|
@@ -6,20 +6,19 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { InputClearButton, InputPlaceholder, InputPrefix } from '../select/index.js';
|
|
8
8
|
import { Selection } from './selection.js';
|
|
9
|
-
const Input =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = _ref;
|
|
9
|
+
const Input = ({
|
|
10
|
+
selected,
|
|
11
|
+
onChange,
|
|
12
|
+
clearable,
|
|
13
|
+
clearText,
|
|
14
|
+
placeholder,
|
|
15
|
+
dataTest,
|
|
16
|
+
prefix,
|
|
17
|
+
options,
|
|
18
|
+
className,
|
|
19
|
+
disabled,
|
|
20
|
+
inputMaxHeight = '100px'
|
|
21
|
+
}) => {
|
|
23
22
|
const hasSelection = selected && typeof selected === 'string';
|
|
24
23
|
const onClear = e => {
|
|
25
24
|
const data = {
|
|
@@ -5,16 +5,15 @@ const onIgnoredClick = (_, e) => {
|
|
|
5
5
|
e.stopPropagation();
|
|
6
6
|
e.preventDefault();
|
|
7
7
|
};
|
|
8
|
-
const Menu =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = _ref;
|
|
8
|
+
const Menu = ({
|
|
9
|
+
options,
|
|
10
|
+
onChange,
|
|
11
|
+
selected,
|
|
12
|
+
empty = '',
|
|
13
|
+
handleFocusInput,
|
|
14
|
+
handleClose,
|
|
15
|
+
dataTest
|
|
16
|
+
}) => {
|
|
18
17
|
const renderedOptions = filterIgnored(options);
|
|
19
18
|
if (React.Children.count(renderedOptions) === 0) {
|
|
20
19
|
// If it's a string, supply it to our <Empty> component so it looks better
|
|
@@ -4,12 +4,11 @@ import cx from 'classnames';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { findOptionChild } from '../select/index.js';
|
|
7
|
-
const Selection =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} = _ref;
|
|
7
|
+
const Selection = ({
|
|
8
|
+
options,
|
|
9
|
+
selected,
|
|
10
|
+
className
|
|
11
|
+
}) => {
|
|
13
12
|
const isProduction = process.env.NODE_ENV === 'production';
|
|
14
13
|
const selectedOption = findOptionChild(selected, options);
|
|
15
14
|
if (!selectedOption) {
|
|
@@ -8,15 +8,12 @@ import { SingleSelect } from './index.js';
|
|
|
8
8
|
window.onChange = window.Cypress && window.Cypress.cy.stub();
|
|
9
9
|
window.onFocus = window.Cypress && window.Cypress.cy.stub();
|
|
10
10
|
window.onBlur = window.Cypress && window.Cypress.cy.stub();
|
|
11
|
-
const CustomSingleSelectOption =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
onClick: e => onClick({}, e)
|
|
18
|
-
}, label);
|
|
19
|
-
};
|
|
11
|
+
const CustomSingleSelectOption = ({
|
|
12
|
+
label,
|
|
13
|
+
onClick
|
|
14
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
onClick: e => onClick({}, e)
|
|
16
|
+
}, label);
|
|
20
17
|
CustomSingleSelectOption.propTypes = {
|
|
21
18
|
label: PropTypes.string,
|
|
22
19
|
onClick: PropTypes.func
|
|
@@ -565,23 +562,17 @@ export const MenuWidthChanging = () => {
|
|
|
565
562
|
flexGrow: 1
|
|
566
563
|
}
|
|
567
564
|
}, /*#__PURE__*/React.createElement(SingleSelect, {
|
|
568
|
-
onChange:
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
return /*#__PURE__*/React.createElement(SingleSelectOption, {
|
|
580
|
-
key: id,
|
|
581
|
-
value: id,
|
|
582
|
-
label: name
|
|
583
|
-
});
|
|
584
|
-
}))), toggle && /*#__PURE__*/React.createElement("div", {
|
|
565
|
+
onChange: ({
|
|
566
|
+
selected
|
|
567
|
+
}) => console.log('size changed to ' + selected)
|
|
568
|
+
}, options.map(({
|
|
569
|
+
name,
|
|
570
|
+
id
|
|
571
|
+
}) => /*#__PURE__*/React.createElement(SingleSelectOption, {
|
|
572
|
+
key: id,
|
|
573
|
+
value: id,
|
|
574
|
+
label: name
|
|
575
|
+
})))), toggle && /*#__PURE__*/React.createElement("div", {
|
|
585
576
|
style: {
|
|
586
577
|
padding: '30px',
|
|
587
578
|
border: '1px solid green'
|
|
@@ -8,36 +8,35 @@ import { Loading as CommonLoading, Select } from '../select/index.js';
|
|
|
8
8
|
import { FilterableMenu } from './filterable-menu.js';
|
|
9
9
|
import { Input } from './input.js';
|
|
10
10
|
import { Menu } from './menu.js';
|
|
11
|
-
const SingleSelect =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} = _ref;
|
|
11
|
+
const SingleSelect = ({
|
|
12
|
+
className,
|
|
13
|
+
selected = '',
|
|
14
|
+
tabIndex,
|
|
15
|
+
maxHeight,
|
|
16
|
+
inputMaxHeight,
|
|
17
|
+
onChange,
|
|
18
|
+
onFocus,
|
|
19
|
+
onKeyDown,
|
|
20
|
+
onBlur,
|
|
21
|
+
loading,
|
|
22
|
+
error,
|
|
23
|
+
warning,
|
|
24
|
+
valid,
|
|
25
|
+
disabled,
|
|
26
|
+
children,
|
|
27
|
+
clearable,
|
|
28
|
+
clearText,
|
|
29
|
+
filterable,
|
|
30
|
+
filterPlaceholder,
|
|
31
|
+
placeholder,
|
|
32
|
+
prefix,
|
|
33
|
+
empty,
|
|
34
|
+
loadingText,
|
|
35
|
+
noMatchText,
|
|
36
|
+
initialFocus,
|
|
37
|
+
dense,
|
|
38
|
+
dataTest = 'dhis2-uicore-singleselect'
|
|
39
|
+
}) => {
|
|
41
40
|
// If the select is filterable, use a filterable menu
|
|
42
41
|
const menu = filterable ? /*#__PURE__*/React.createElement(FilterableMenu, {
|
|
43
42
|
dataTest: dataTest,
|
|
@@ -22,15 +22,12 @@ const eventHandler = handlerName => (payload, event) => {
|
|
|
22
22
|
const onChange = eventHandler('onChange');
|
|
23
23
|
const onFocus = eventHandler('onFocus');
|
|
24
24
|
const onBlur = eventHandler('onBlur');
|
|
25
|
-
const CustomSingleSelectOption =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
onClick: e => onClick({}, e)
|
|
32
|
-
}, label);
|
|
33
|
-
};
|
|
25
|
+
const CustomSingleSelectOption = ({
|
|
26
|
+
label,
|
|
27
|
+
onClick
|
|
28
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
onClick: e => onClick({}, e)
|
|
30
|
+
}, label);
|
|
34
31
|
CustomSingleSelectOption.propTypes = {
|
|
35
32
|
label: PropTypes.string,
|
|
36
33
|
onClick: PropTypes.func
|
|
@@ -3,35 +3,32 @@ import { colors, spacers } from '@dhis2/ui-constants';
|
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import React from 'react';
|
|
6
|
-
const SingleSelectOption =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const SingleSelectOption = ({
|
|
7
|
+
label,
|
|
8
|
+
active,
|
|
9
|
+
disabled,
|
|
10
|
+
onClick,
|
|
11
|
+
className,
|
|
12
|
+
dataTest = 'dhis2-uicore-singleselectoption',
|
|
13
|
+
value
|
|
14
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
onClick: e => onClick({}, e),
|
|
16
|
+
"data-test": dataTest,
|
|
17
|
+
"data-value": value,
|
|
18
|
+
"data-label": label,
|
|
19
|
+
className: _JSXStyle.dynamic([["1307386342", [colors.grey900, spacers.dp8, spacers.dp12, colors.grey200, colors.teal050, colors.grey500, active ? `url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMuNjMyMDkgNy44MzIxNEMzLjI3MjA5IDcuNDcyMTQgMi43MjAwOSA3LjQ3MjE0IDIuMzYwMDkgNy44MzIxNEMyLjAwMDA5IDguMTkyMTQgMi4wMDAwOSA4Ljc0NDE0IDIuMzYwMDkgOS4xMDQxNEw1LjYyNDA5IDEyLjM2ODFDNS45ODQwOSAxMi43MjgxIDYuNTM2MDkgMTIuNzI4MSA2Ljg5NjA5IDEyLjM2ODFMMTQuNjQ4MSA0LjY0MDE0QzE1LjAwODEgNC4yODAxNCAxNS4wMDgxIDMuNzI4MTQgMTQuNjQ4MSAzLjM2ODE0QzE0LjI4ODEgMy4wMDgxNCAxMy43MzYxIDMuMDA4MTQgMTMuMzUyMSAzLjM2ODE0TDYuMjcyMDkgMTAuNDcyMUwzLjYzMjA5IDcuODMyMTRaIiBmaWxsPSIjMDA2OTVDIi8+Cjwvc3ZnPgo=')` : 'none']]]) + " " + (cx(className, {
|
|
10
20
|
disabled,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
disabled,
|
|
23
|
-
active
|
|
24
|
-
}) || "")
|
|
25
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
26
|
-
"aria-hidden": "true",
|
|
27
|
-
className: _JSXStyle.dynamic([["1307386342", [colors.grey900, spacers.dp8, spacers.dp12, colors.grey200, colors.teal050, colors.grey500, active ? `url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMuNjMyMDkgNy44MzIxNEMzLjI3MjA5IDcuNDcyMTQgMi43MjAwOSA3LjQ3MjE0IDIuMzYwMDkgNy44MzIxNEMyLjAwMDA5IDguMTkyMTQgMi4wMDAwOSA4Ljc0NDE0IDIuMzYwMDkgOS4xMDQxNEw1LjYyNDA5IDEyLjM2ODFDNS45ODQwOSAxMi43MjgxIDYuNTM2MDkgMTIuNzI4MSA2Ljg5NjA5IDEyLjM2ODFMMTQuNjQ4MSA0LjY0MDE0QzE1LjAwODEgNC4yODAxNCAxNS4wMDgxIDMuNzI4MTQgMTQuNjQ4MSAzLjM2ODE0QzE0LjI4ODEgMy4wMDgxNCAxMy43MzYxIDMuMDA4MTQgMTMuMzUyMSAzLjM2ODE0TDYuMjcyMDkgMTAuNDcyMUwzLjYzMjA5IDcuODMyMTRaIiBmaWxsPSIjMDA2OTVDIi8+Cjwvc3ZnPgo=')` : 'none']]]) + " " + "checkmark"
|
|
28
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
29
|
-
className: _JSXStyle.dynamic([["1307386342", [colors.grey900, spacers.dp8, spacers.dp12, colors.grey200, colors.teal050, colors.grey500, active ? `url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMuNjMyMDkgNy44MzIxNEMzLjI3MjA5IDcuNDcyMTQgMi43MjAwOSA3LjQ3MjE0IDIuMzYwMDkgNy44MzIxNEMyLjAwMDA5IDguMTkyMTQgMi4wMDAwOSA4Ljc0NDE0IDIuMzYwMDkgOS4xMDQxNEw1LjYyNDA5IDEyLjM2ODFDNS45ODQwOSAxMi43MjgxIDYuNTM2MDkgMTIuNzI4MSA2Ljg5NjA5IDEyLjM2ODFMMTQuNjQ4MSA0LjY0MDE0QzE1LjAwODEgNC4yODAxNCAxNS4wMDgxIDMuNzI4MTQgMTQuNjQ4MSAzLjM2ODE0QzE0LjI4ODEgMy4wMDgxNCAxMy43MzYxIDMuMDA4MTQgMTMuMzUyMSAzLjM2ODE0TDYuMjcyMDkgMTAuNDcyMUwzLjYzMjA5IDcuODMyMTRaIiBmaWxsPSIjMDA2OTVDIi8+Cjwvc3ZnPgo=')` : 'none']]]) + " " + "content"
|
|
30
|
-
}, label), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
31
|
-
id: "1307386342",
|
|
32
|
-
dynamic: [colors.grey900, spacers.dp8, spacers.dp12, colors.grey200, colors.teal050, colors.grey500, active ? `url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMuNjMyMDkgNy44MzIxNEMzLjI3MjA5IDcuNDcyMTQgMi43MjAwOSA3LjQ3MjE0IDIuMzYwMDkgNy44MzIxNEMyLjAwMDA5IDguMTkyMTQgMi4wMDAwOSA4Ljc0NDE0IDIuMzYwMDkgOS4xMDQxNEw1LjYyNDA5IDEyLjM2ODFDNS45ODQwOSAxMi43MjgxIDYuNTM2MDkgMTIuNzI4MSA2Ljg5NjA5IDEyLjM2ODFMMTQuNjQ4MSA0LjY0MDE0QzE1LjAwODEgNC4yODAxNCAxNS4wMDgxIDMuNzI4MTQgMTQuNjQ4MSAzLjM2ODE0QzE0LjI4ODEgMy4wMDgxNCAxMy43MzYxIDMuMDA4MTQgMTMuMzUyMSAzLjM2ODE0TDYuMjcyMDkgMTAuNDcyMUwzLjYzMjA5IDcuODMyMTRaIiBmaWxsPSIjMDA2OTVDIi8+Cjwvc3ZnPgo=')` : 'none']
|
|
33
|
-
}, [`div.__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;cursor:pointer;font-size:14px;-webkit-text-decoration:none;text-decoration:none;color:${colors.grey900};padding-block:${spacers.dp8};padding-inline:6px ${spacers.dp12};}`, `div.__jsx-style-dynamic-selector:hover{background-color:${colors.grey200};}`, `div.__jsx-style-dynamic-selector:active,div.active.__jsx-style-dynamic-selector{background-color:${colors.teal050};cursor:auto;}`, `div.disabled.__jsx-style-dynamic-selector{color:${colors.grey500};cursor:not-allowed;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}`, "div.disabled.__jsx-style-dynamic-selector:hover{background-color:initial;}", `div.__jsx-style-dynamic-selector .checkmark.__jsx-style-dynamic-selector{width:16px;height:16px;margin-inline-end:6px;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;background-size:contain;background-repeat:no-repeat;background-image:${active ? `url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMuNjMyMDkgNy44MzIxNEMzLjI3MjA5IDcuNDcyMTQgMi43MjAwOSA3LjQ3MjE0IDIuMzYwMDkgNy44MzIxNEMyLjAwMDA5IDguMTkyMTQgMi4wMDAwOSA4Ljc0NDE0IDIuMzYwMDkgOS4xMDQxNEw1LjYyNDA5IDEyLjM2ODFDNS45ODQwOSAxMi43MjgxIDYuNTM2MDkgMTIuNzI4MSA2Ljg5NjA5IDEyLjM2ODFMMTQuNjQ4MSA0LjY0MDE0QzE1LjAwODEgNC4yODAxNCAxNS4wMDgxIDMuNzI4MTQgMTQuNjQ4MSAzLjM2ODE0QzE0LjI4ODEgMy4wMDgxNCAxMy43MzYxIDMuMDA4MTQgMTMuMzUyMSAzLjM2ODE0TDYuMjcyMDkgMTAuNDcyMUwzLjYzMjA5IDcuODMyMTRaIiBmaWxsPSIjMDA2OTVDIi8+Cjwvc3ZnPgo=')` : 'none'};}`]));
|
|
34
|
-
};
|
|
21
|
+
active
|
|
22
|
+
}) || "")
|
|
23
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
24
|
+
"aria-hidden": "true",
|
|
25
|
+
className: _JSXStyle.dynamic([["1307386342", [colors.grey900, spacers.dp8, spacers.dp12, colors.grey200, colors.teal050, colors.grey500, active ? `url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMuNjMyMDkgNy44MzIxNEMzLjI3MjA5IDcuNDcyMTQgMi43MjAwOSA3LjQ3MjE0IDIuMzYwMDkgNy44MzIxNEMyLjAwMDA5IDguMTkyMTQgMi4wMDAwOSA4Ljc0NDE0IDIuMzYwMDkgOS4xMDQxNEw1LjYyNDA5IDEyLjM2ODFDNS45ODQwOSAxMi43MjgxIDYuNTM2MDkgMTIuNzI4MSA2Ljg5NjA5IDEyLjM2ODFMMTQuNjQ4MSA0LjY0MDE0QzE1LjAwODEgNC4yODAxNCAxNS4wMDgxIDMuNzI4MTQgMTQuNjQ4MSAzLjM2ODE0QzE0LjI4ODEgMy4wMDgxNCAxMy43MzYxIDMuMDA4MTQgMTMuMzUyMSAzLjM2ODE0TDYuMjcyMDkgMTAuNDcyMUwzLjYzMjA5IDcuODMyMTRaIiBmaWxsPSIjMDA2OTVDIi8+Cjwvc3ZnPgo=')` : 'none']]]) + " " + "checkmark"
|
|
26
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
27
|
+
className: _JSXStyle.dynamic([["1307386342", [colors.grey900, spacers.dp8, spacers.dp12, colors.grey200, colors.teal050, colors.grey500, active ? `url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMuNjMyMDkgNy44MzIxNEMzLjI3MjA5IDcuNDcyMTQgMi43MjAwOSA3LjQ3MjE0IDIuMzYwMDkgNy44MzIxNEMyLjAwMDA5IDguMTkyMTQgMi4wMDAwOSA4Ljc0NDE0IDIuMzYwMDkgOS4xMDQxNEw1LjYyNDA5IDEyLjM2ODFDNS45ODQwOSAxMi43MjgxIDYuNTM2MDkgMTIuNzI4MSA2Ljg5NjA5IDEyLjM2ODFMMTQuNjQ4MSA0LjY0MDE0QzE1LjAwODEgNC4yODAxNCAxNS4wMDgxIDMuNzI4MTQgMTQuNjQ4MSAzLjM2ODE0QzE0LjI4ODEgMy4wMDgxNCAxMy43MzYxIDMuMDA4MTQgMTMuMzUyMSAzLjM2ODE0TDYuMjcyMDkgMTAuNDcyMUwzLjYzMjA5IDcuODMyMTRaIiBmaWxsPSIjMDA2OTVDIi8+Cjwvc3ZnPgo=')` : 'none']]]) + " " + "content"
|
|
28
|
+
}, label), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
29
|
+
id: "1307386342",
|
|
30
|
+
dynamic: [colors.grey900, spacers.dp8, spacers.dp12, colors.grey200, colors.teal050, colors.grey500, active ? `url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMuNjMyMDkgNy44MzIxNEMzLjI3MjA5IDcuNDcyMTQgMi43MjAwOSA3LjQ3MjE0IDIuMzYwMDkgNy44MzIxNEMyLjAwMDA5IDguMTkyMTQgMi4wMDAwOSA4Ljc0NDE0IDIuMzYwMDkgOS4xMDQxNEw1LjYyNDA5IDEyLjM2ODFDNS45ODQwOSAxMi43MjgxIDYuNTM2MDkgMTIuNzI4MSA2Ljg5NjA5IDEyLjM2ODFMMTQuNjQ4MSA0LjY0MDE0QzE1LjAwODEgNC4yODAxNCAxNS4wMDgxIDMuNzI4MTQgMTQuNjQ4MSAzLjM2ODE0QzE0LjI4ODEgMy4wMDgxNCAxMy43MzYxIDMuMDA4MTQgMTMuMzUyMSAzLjM2ODE0TDYuMjcyMDkgMTAuNDcyMUwzLjYzMjA5IDcuODMyMTRaIiBmaWxsPSIjMDA2OTVDIi8+Cjwvc3ZnPgo=')` : 'none']
|
|
31
|
+
}, [`div.__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;cursor:pointer;font-size:14px;-webkit-text-decoration:none;text-decoration:none;color:${colors.grey900};padding-block:${spacers.dp8};padding-inline:6px ${spacers.dp12};}`, `div.__jsx-style-dynamic-selector:hover{background-color:${colors.grey200};}`, `div.__jsx-style-dynamic-selector:active,div.active.__jsx-style-dynamic-selector{background-color:${colors.teal050};cursor:auto;}`, `div.disabled.__jsx-style-dynamic-selector{color:${colors.grey500};cursor:not-allowed;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}`, "div.disabled.__jsx-style-dynamic-selector:hover{background-color:initial;}", `div.__jsx-style-dynamic-selector .checkmark.__jsx-style-dynamic-selector{width:16px;height:16px;margin-inline-end:6px;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;background-size:contain;background-repeat:no-repeat;background-image:${active ? `url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMuNjMyMDkgNy44MzIxNEMzLjI3MjA5IDcuNDcyMTQgMi43MjAwOSA3LjQ3MjE0IDIuMzYwMDkgNy44MzIxNEMyLjAwMDA5IDguMTkyMTQgMi4wMDAwOSA4Ljc0NDE0IDIuMzYwMDkgOS4xMDQxNEw1LjYyNDA5IDEyLjM2ODFDNS45ODQwOSAxMi43MjgxIDYuNTM2MDkgMTIuNzI4MSA2Ljg5NjA5IDEyLjM2ODFMMTQuNjQ4MSA0LjY0MDE0QzE1LjAwODEgNC4yODAxNCAxNS4wMDgxIDMuNzI4MTQgMTQuNjQ4MSAzLjM2ODE0QzE0LjI4ODEgMy4wMDgxNCAxMy43MzYxIDMuMDA4MTQgMTMuMzUyMSAzLjM2ODE0TDYuMjcyMDkgMTAuNDcyMUwzLjYzMjA5IDcuODMyMTRaIiBmaWxsPSIjMDA2OTVDIi8+Cjwvc3ZnPgo=')` : 'none'};}`]));
|
|
35
32
|
SingleSelectOption.propTypes = {
|
|
36
33
|
label: PropTypes.string.isRequired,
|
|
37
34
|
value: PropTypes.string.isRequired,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2-ui/select",
|
|
3
|
-
"version": "10.16.
|
|
3
|
+
"version": "10.16.4",
|
|
4
4
|
"description": "UI Select",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,21 +33,21 @@
|
|
|
33
33
|
"styled-jsx": "^4"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@dhis2-ui/box": "10.16.
|
|
37
|
-
"@dhis2-ui/button": "10.16.
|
|
38
|
-
"@dhis2-ui/card": "10.16.
|
|
39
|
-
"@dhis2-ui/checkbox": "10.16.
|
|
40
|
-
"@dhis2-ui/chip": "10.16.
|
|
41
|
-
"@dhis2-ui/field": "10.16.
|
|
42
|
-
"@dhis2-ui/input": "10.16.
|
|
43
|
-
"@dhis2-ui/layer": "10.16.
|
|
44
|
-
"@dhis2-ui/loader": "10.16.
|
|
45
|
-
"@dhis2-ui/popper": "10.16.
|
|
46
|
-
"@dhis2-ui/status-icon": "10.16.
|
|
47
|
-
"@dhis2-ui/tooltip": "10.16.
|
|
36
|
+
"@dhis2-ui/box": "10.16.4",
|
|
37
|
+
"@dhis2-ui/button": "10.16.4",
|
|
38
|
+
"@dhis2-ui/card": "10.16.4",
|
|
39
|
+
"@dhis2-ui/checkbox": "10.16.4",
|
|
40
|
+
"@dhis2-ui/chip": "10.16.4",
|
|
41
|
+
"@dhis2-ui/field": "10.16.4",
|
|
42
|
+
"@dhis2-ui/input": "10.16.4",
|
|
43
|
+
"@dhis2-ui/layer": "10.16.4",
|
|
44
|
+
"@dhis2-ui/loader": "10.16.4",
|
|
45
|
+
"@dhis2-ui/popper": "10.16.4",
|
|
46
|
+
"@dhis2-ui/status-icon": "10.16.4",
|
|
47
|
+
"@dhis2-ui/tooltip": "10.16.4",
|
|
48
48
|
"@dhis2/prop-types": "^3.1.2",
|
|
49
|
-
"@dhis2/ui-constants": "10.16.
|
|
50
|
-
"@dhis2/ui-icons": "10.16.
|
|
49
|
+
"@dhis2/ui-constants": "10.16.4",
|
|
50
|
+
"@dhis2/ui-icons": "10.16.4",
|
|
51
51
|
"classnames": "^2.3.1",
|
|
52
52
|
"prop-types": "^15.7.2"
|
|
53
53
|
},
|