@entur/dropdown 6.0.2 → 6.0.3-RC.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DropdownList.d.ts +3 -3
- package/dist/dropdown.cjs.development.js +42 -71
- package/dist/dropdown.cjs.development.js.map +1 -1
- package/dist/dropdown.cjs.production.min.js +1 -1
- package/dist/dropdown.cjs.production.min.js.map +1 -1
- package/dist/dropdown.esm.js +42 -71
- package/dist/dropdown.esm.js.map +1 -1
- package/dist/styles.css +93 -81
- package/dist/utils.d.ts +6 -16
- package/package.json +11 -11
package/dist/styles.css
CHANGED
|
@@ -1,67 +1,35 @@
|
|
|
1
1
|
/* DO NOT CHANGE!*/
|
|
2
2
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
3
|
-
.eds-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
width: 100%;
|
|
14
|
-
z-index: 20;
|
|
15
|
-
}
|
|
16
|
-
.eds-contrast .eds-dropdown-list {
|
|
17
|
-
box-shadow: 0 0.0625rem 0.1875rem rgb(57, 61, 121);
|
|
3
|
+
.eds-dropdown__searchable-selected-item {
|
|
4
|
+
display: block;
|
|
5
|
+
font-size: 1rem;
|
|
6
|
+
line-height: 1rem;
|
|
7
|
+
margin-right: -1rem;
|
|
8
|
+
padding: calc(1rem + 0.25rem) 0 0.25rem 1rem;
|
|
9
|
+
font-family: inherit;
|
|
10
|
+
overflow-x: hidden;
|
|
11
|
+
text-overflow: ellipsis;
|
|
12
|
+
white-space: nowrap;
|
|
18
13
|
}
|
|
19
|
-
.eds-
|
|
20
|
-
|
|
14
|
+
.eds-dropdown__searchable-selected-item__wrapper {
|
|
15
|
+
max-width: 65%;
|
|
21
16
|
}
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
|
|
18
|
+
.eds-form-control.eds-dropdown__input::-moz-placeholder {
|
|
19
|
+
-moz-transition: none;
|
|
20
|
+
transition: none;
|
|
24
21
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
22
|
+
|
|
23
|
+
.eds-form-control.eds-dropdown__input::placeholder {
|
|
24
|
+
transition: none;
|
|
29
25
|
}
|
|
30
|
-
.eds-
|
|
26
|
+
.eds-inline-spinner {
|
|
31
27
|
align-items: center;
|
|
32
|
-
background-color: #f8f8f8;
|
|
33
|
-
border-bottom: 0.125rem solid #e9e9e9;
|
|
34
|
-
border-left: 0.125rem solid #e9e9e9;
|
|
35
|
-
border-right: 0.125rem solid #e9e9e9;
|
|
36
|
-
color: #181c56;
|
|
37
28
|
display: flex;
|
|
38
|
-
justify-content:
|
|
39
|
-
|
|
40
|
-
font-size: 1rem;
|
|
41
|
-
line-height: 1.25rem;
|
|
42
|
-
padding: 0.75rem 1rem;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
height: 100%;
|
|
43
31
|
width: 100%;
|
|
44
32
|
}
|
|
45
|
-
.eds-dropdown-list__item:first-child {
|
|
46
|
-
border-top: 0.125rem solid #e9e9e9;
|
|
47
|
-
}
|
|
48
|
-
.eds-dropdown-list__item:last-child {
|
|
49
|
-
border-bottom: none;
|
|
50
|
-
}
|
|
51
|
-
.eds-contrast .eds-dropdown-list__item {
|
|
52
|
-
color: #181c56;
|
|
53
|
-
border-color: #54568c;
|
|
54
|
-
background-color: #ffffff;
|
|
55
|
-
}
|
|
56
|
-
.eds-dropdown-list__item--highlighted {
|
|
57
|
-
background-color: #d1d4e3;
|
|
58
|
-
}
|
|
59
|
-
.eds-contrast .eds-dropdown-list__item--highlighted {
|
|
60
|
-
background-color: #d1d4e3;
|
|
61
|
-
}
|
|
62
|
-
.eds-dropdown-list-icon {
|
|
63
|
-
margin-left: 0.75rem;
|
|
64
|
-
}
|
|
65
33
|
/* DO NOT CHANGE!*/
|
|
66
34
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
67
35
|
.eds-dropdown-wrapper {
|
|
@@ -122,36 +90,68 @@
|
|
|
122
90
|
}
|
|
123
91
|
/* DO NOT CHANGE!*/
|
|
124
92
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
125
|
-
.eds-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
93
|
+
.eds-dropdown-list {
|
|
94
|
+
border-radius: 0.25rem;
|
|
95
|
+
box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.25);
|
|
96
|
+
display: none;
|
|
97
|
+
list-style: none;
|
|
98
|
+
margin: 0;
|
|
99
|
+
max-height: 50vh;
|
|
100
|
+
padding: 0;
|
|
101
|
+
position: relative;
|
|
102
|
+
overflow-y: auto;
|
|
103
|
+
width: 100%;
|
|
104
|
+
z-index: 20;
|
|
135
105
|
}
|
|
136
|
-
.eds-
|
|
137
|
-
|
|
106
|
+
.eds-contrast .eds-dropdown-list {
|
|
107
|
+
box-shadow: 0 0.0625rem 0.1875rem rgb(57, 61, 121);
|
|
138
108
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
-moz-transition: none;
|
|
142
|
-
transition: none;
|
|
109
|
+
.eds-dropdown-list--open {
|
|
110
|
+
display: inline-block;
|
|
143
111
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
transition: none;
|
|
112
|
+
.eds-dropdown-list:focus {
|
|
113
|
+
outline: none;
|
|
147
114
|
}
|
|
148
|
-
|
|
115
|
+
@media all and (min-width: 50rem) {
|
|
116
|
+
.eds-dropdown-list {
|
|
117
|
+
max-height: 30vh;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
.eds-dropdown-list__item {
|
|
149
121
|
align-items: center;
|
|
122
|
+
background-color: #f8f8f8;
|
|
123
|
+
border-bottom: 0.125rem solid #e9e9e9;
|
|
124
|
+
border-left: 0.125rem solid #e9e9e9;
|
|
125
|
+
border-right: 0.125rem solid #e9e9e9;
|
|
126
|
+
color: #181c56;
|
|
150
127
|
display: flex;
|
|
151
|
-
justify-content:
|
|
152
|
-
|
|
128
|
+
justify-content: space-between;
|
|
129
|
+
font-family: inherit;
|
|
130
|
+
font-size: 1rem;
|
|
131
|
+
line-height: 1.25rem;
|
|
132
|
+
padding: 0.75rem 1rem;
|
|
153
133
|
width: 100%;
|
|
154
134
|
}
|
|
135
|
+
.eds-dropdown-list__item:first-child {
|
|
136
|
+
border-top: 0.125rem solid #e9e9e9;
|
|
137
|
+
}
|
|
138
|
+
.eds-dropdown-list__item:last-child {
|
|
139
|
+
border-bottom: none;
|
|
140
|
+
}
|
|
141
|
+
.eds-contrast .eds-dropdown-list__item {
|
|
142
|
+
color: #181c56;
|
|
143
|
+
border-color: #54568c;
|
|
144
|
+
background-color: #ffffff;
|
|
145
|
+
}
|
|
146
|
+
.eds-dropdown-list__item--highlighted {
|
|
147
|
+
background-color: #d1d4e3;
|
|
148
|
+
}
|
|
149
|
+
.eds-contrast .eds-dropdown-list__item--highlighted {
|
|
150
|
+
background-color: #d1d4e3;
|
|
151
|
+
}
|
|
152
|
+
.eds-dropdown-list-icon {
|
|
153
|
+
margin-left: 0.75rem;
|
|
154
|
+
}
|
|
155
155
|
/* DO NOT CHANGE!*/
|
|
156
156
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
157
157
|
.eds-dropdown__toggle-button {
|
|
@@ -285,6 +285,7 @@
|
|
|
285
285
|
border: 0.125rem solid var(--components-form-basemenu-border);
|
|
286
286
|
border-radius: 0.25rem;
|
|
287
287
|
box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.25);
|
|
288
|
+
cursor: default;
|
|
288
289
|
}
|
|
289
290
|
.eds-dropdown__list:focus {
|
|
290
291
|
outline: none;
|
|
@@ -392,6 +393,11 @@
|
|
|
392
393
|
border-color: transparent;
|
|
393
394
|
color: var(--components-dropdown-dropdown-standard-text-disabled);
|
|
394
395
|
}
|
|
396
|
+
.eds-dropdown__selected-item-tag__text {
|
|
397
|
+
text-wrap: nowrap;
|
|
398
|
+
text-overflow: ellipsis;
|
|
399
|
+
overflow-x: hidden;
|
|
400
|
+
}
|
|
395
401
|
.eds-contrast .eds-dropdown .eds-icon-button {
|
|
396
402
|
color: var(--components-button-iconbutton-standard-text);
|
|
397
403
|
}
|
|
@@ -445,8 +451,8 @@
|
|
|
445
451
|
display: flex;
|
|
446
452
|
justify-content: center;
|
|
447
453
|
height: 100%;
|
|
448
|
-
width:
|
|
449
|
-
margin-left:
|
|
454
|
+
width: 1.5rem;
|
|
455
|
+
margin-left: 0.25rem;
|
|
450
456
|
}
|
|
451
457
|
.eds-dropdown__appendix__toggle-button--loading-dots .eds-loading-dots__dot {
|
|
452
458
|
background-color: var(--components-loader-loader-standard-text);
|
|
@@ -462,6 +468,9 @@
|
|
|
462
468
|
}
|
|
463
469
|
/* DO NOT CHANGE!*/
|
|
464
470
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
471
|
+
.eds-dropdown {
|
|
472
|
+
cursor: pointer;
|
|
473
|
+
}
|
|
465
474
|
.eds-dropdown__input {
|
|
466
475
|
flex: 1;
|
|
467
476
|
width: 0;
|
|
@@ -481,7 +490,6 @@
|
|
|
481
490
|
overflow-x: hidden;
|
|
482
491
|
text-overflow: ellipsis;
|
|
483
492
|
line-height: 1rem;
|
|
484
|
-
cursor: pointer;
|
|
485
493
|
}
|
|
486
494
|
.eds-dropdown__selected-item.focus-visible {
|
|
487
495
|
outline: none;
|
|
@@ -489,6 +497,9 @@
|
|
|
489
497
|
.eds-dropdown__selected-item:focus-visible {
|
|
490
498
|
outline: none;
|
|
491
499
|
}
|
|
500
|
+
.eds-dropdown--searchable {
|
|
501
|
+
cursor: text;
|
|
502
|
+
}
|
|
492
503
|
.eds-dropdown--searchable__selected-item {
|
|
493
504
|
position: relative;
|
|
494
505
|
flex: 1;
|
|
@@ -498,18 +509,19 @@
|
|
|
498
509
|
white-space: nowrap;
|
|
499
510
|
line-height: 1rem;
|
|
500
511
|
font-family: inherit;
|
|
501
|
-
cursor: text;
|
|
502
512
|
}
|
|
503
513
|
.eds-dropdown--searchable__selected-item--hidden {
|
|
504
514
|
flex: 0;
|
|
505
515
|
}
|
|
516
|
+
.eds-dropdown--multiselect {
|
|
517
|
+
cursor: text;
|
|
518
|
+
}
|
|
506
519
|
.eds-dropdown--multiselect__selected-items-and-input {
|
|
507
520
|
display: flex;
|
|
508
521
|
flex-wrap: wrap;
|
|
509
522
|
flex: 1;
|
|
510
523
|
gap: 0.5rem;
|
|
511
524
|
min-width: 0;
|
|
512
|
-
cursor: text;
|
|
513
525
|
}
|
|
514
526
|
.eds-dropdown--multiselect__selected-items-and-input--filled {
|
|
515
527
|
padding: 1.25rem 0rem 0.25rem;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UseComboboxState } from 'downshift';
|
|
2
2
|
import { NormalizedDropdownItemType } from './types';
|
|
3
3
|
export declare const EMPTY_INPUT = "";
|
|
4
4
|
export declare function lowerCaseFilterTest(item: NormalizedDropdownItemType<any>, input: string | undefined): boolean;
|
|
5
5
|
export declare function noFilter<ValueType>(item: NormalizedDropdownItemType<ValueType>, input: string | undefined): boolean;
|
|
6
6
|
export declare const itemToString: (item: NormalizedDropdownItemType<any> | null) => string;
|
|
7
|
+
export declare const itemToKey: (item: NormalizedDropdownItemType<any> | null) => any;
|
|
7
8
|
export declare const isFunctionWithQueryArgument: (object: any) => boolean;
|
|
8
9
|
type useMultiselectUtilsType<ValueType> = {
|
|
9
10
|
selectedItems: NormalizedDropdownItemType<ValueType>[];
|
|
@@ -15,10 +16,9 @@ export declare const useMultiselectUtils: <ValueType>({ listItems, selectedItems
|
|
|
15
16
|
allListItemsAreSelected: boolean;
|
|
16
17
|
clickedItemIsInSelectedItems: (clickedItem: NormalizedDropdownItemType<ValueType>) => boolean;
|
|
17
18
|
clickedItemIsSelectAll: (clickedItem: NormalizedDropdownItemType<string | ValueType>) => boolean;
|
|
18
|
-
handleListItemClicked: ({ clickedItem, onChange,
|
|
19
|
+
handleListItemClicked: ({ clickedItem, onChange, }: {
|
|
19
20
|
clickedItem: NormalizedDropdownItemType<any>;
|
|
20
21
|
onChange: (value: NormalizedDropdownItemType<ValueType>[]) => void;
|
|
21
|
-
setLastRemovedItem: any;
|
|
22
22
|
}) => void;
|
|
23
23
|
hasSelectedItems: boolean;
|
|
24
24
|
listItemsWithoutSelectAll: NormalizedDropdownItemType<ValueType>[];
|
|
@@ -28,18 +28,8 @@ export declare const useMultiselectUtils: <ValueType>({ listItems, selectedItems
|
|
|
28
28
|
someListItemsAreSelected: boolean;
|
|
29
29
|
unselectAllListItems: (onChange: (value: NormalizedDropdownItemType<ValueType>[]) => void) => void;
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
export declare function getA11yStatusMessage<ValueType>(options: UseComboboxState<NormalizedDropdownItemType<ValueType>> & {
|
|
32
32
|
selectAllItemIncluded?: boolean;
|
|
33
|
-
|
|
34
|
-
};
|
|
35
|
-
export declare function getA11yStatusMessage<Item>(options: getA11yStatusMessageType<Item>): string;
|
|
36
|
-
type getA11ySelectionMessageType<Item> = A11yStatusMessageOptions<Item> & {
|
|
37
|
-
selectAllItem?: NormalizedDropdownItemType<string>;
|
|
38
|
-
};
|
|
39
|
-
export declare function getA11ySelectionMessage(options: getA11ySelectionMessageType<NormalizedDropdownItemType<any>>): string;
|
|
40
|
-
type getA11yRemovalMessageType<Item> = A11yRemovalMessage<Item> & {
|
|
41
|
-
selectAllItem?: NormalizedDropdownItemType<string>;
|
|
42
|
-
removedItem?: NormalizedDropdownItemType<any>;
|
|
43
|
-
};
|
|
44
|
-
export declare function getA11yRemovalMessage(options: getA11yRemovalMessageType<NormalizedDropdownItemType<any>>): string;
|
|
33
|
+
resultCount: number;
|
|
34
|
+
}): string;
|
|
45
35
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entur/dropdown",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.3-RC.1",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/dropdown.esm.js",
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
"react-dom": ">=16.8.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@entur/a11y": "^0.2.
|
|
31
|
-
"@entur/button": "^3.2.
|
|
32
|
-
"@entur/chip": "^0.7.
|
|
33
|
-
"@entur/form": "^8.0.
|
|
34
|
-
"@entur/icons": "^7.
|
|
35
|
-
"@entur/loader": "^0.5.
|
|
30
|
+
"@entur/a11y": "^0.2.90-RC.1",
|
|
31
|
+
"@entur/button": "^3.2.31-RC.1",
|
|
32
|
+
"@entur/chip": "^0.7.18-RC.1",
|
|
33
|
+
"@entur/form": "^8.1.0-RC.1",
|
|
34
|
+
"@entur/icons": "^7.3.0-RC.1",
|
|
35
|
+
"@entur/loader": "^0.5.9-RC.1",
|
|
36
36
|
"@entur/tokens": "^3.17.0",
|
|
37
|
-
"@entur/tooltip": "^
|
|
38
|
-
"@entur/utils": "^0.11.1",
|
|
37
|
+
"@entur/tooltip": "^4.0.0-RC.1",
|
|
38
|
+
"@entur/utils": "^0.11.2-RC.1",
|
|
39
39
|
"@floating-ui/react-dom": "^2.1.0",
|
|
40
40
|
"classnames": "^2.3.1",
|
|
41
|
-
"downshift": "^
|
|
41
|
+
"downshift": "^9.0.8"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "d7b4d04bcbef5d3861b802b0a6af3f36a91a4118"
|
|
44
44
|
}
|