@entur/dropdown 6.0.3-beta.0 → 6.0.3-beta.2
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/dropdown.cjs.development.js +32 -55
- 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 +32 -55
- package/dist/dropdown.esm.js.map +1 -1
- package/dist/styles.css +122 -116
- package/dist/utils.d.ts +7 -16
- package/package.json +10 -10
package/dist/styles.css
CHANGED
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
.eds-inline-spinner {
|
|
2
|
-
align-items: center;
|
|
3
|
-
display: flex;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
height: 100%;
|
|
6
|
-
width: 100%;
|
|
7
|
-
}
|
|
8
|
-
/* DO NOT CHANGE!*/
|
|
9
|
-
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
10
|
-
.eds-dropdown__searchable-selected-item {
|
|
11
|
-
display: block;
|
|
12
|
-
font-size: 1rem;
|
|
13
|
-
line-height: 1rem;
|
|
14
|
-
margin-right: -1rem;
|
|
15
|
-
padding: calc(1rem + 0.25rem) 0 0.25rem 1rem;
|
|
16
|
-
font-family: inherit;
|
|
17
|
-
overflow-x: hidden;
|
|
18
|
-
text-overflow: ellipsis;
|
|
19
|
-
white-space: nowrap;
|
|
20
|
-
}
|
|
21
|
-
.eds-dropdown__searchable-selected-item__wrapper {
|
|
22
|
-
max-width: 65%;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.eds-form-control.eds-dropdown__input::-moz-placeholder {
|
|
26
|
-
-moz-transition: none;
|
|
27
|
-
transition: none;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.eds-form-control.eds-dropdown__input::placeholder {
|
|
31
|
-
transition: none;
|
|
32
|
-
}
|
|
33
1
|
/* DO NOT CHANGE!*/
|
|
34
2
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
35
3
|
.eds-dropdown-list {
|
|
@@ -96,94 +64,28 @@
|
|
|
96
64
|
}
|
|
97
65
|
/* DO NOT CHANGE!*/
|
|
98
66
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
99
|
-
.eds-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
.eds-multi-select__selected-items {
|
|
103
|
-
display: flex;
|
|
104
|
-
align-items: center;
|
|
105
|
-
flex-wrap: wrap;
|
|
106
|
-
position: relative;
|
|
107
|
-
flex: 1 1 0%;
|
|
108
|
-
padding: 0.25rem;
|
|
109
|
-
}
|
|
110
|
-
.eds-multi-select__selected-items-tag.eds-tag-chip {
|
|
111
|
-
margin-left: 0.25rem;
|
|
112
|
-
white-space: nowrap;
|
|
113
|
-
}
|
|
114
|
-
.eds-contrast .eds-multi-select__selected-items-tag.eds-tag-chip svg {
|
|
115
|
-
color: #181c56;
|
|
116
|
-
}
|
|
117
|
-
.eds-multi-select__selected-items-tag.eds-tag-chip:focus {
|
|
118
|
-
outline-offset: 0.125rem;
|
|
119
|
-
}
|
|
120
|
-
.eds-contrast .eds-multi-select__selected-items-tag.eds-tag-chip {
|
|
121
|
-
color: #181c56;
|
|
122
|
-
background: #ebebf1;
|
|
123
|
-
border: 0.0625rem solid #d1d4e3;
|
|
124
|
-
}
|
|
125
|
-
.eds-contrast .eds-multi-select__selected-items-tag.eds-tag-chip .eds-tag-chip__close-button:hover {
|
|
126
|
-
background: #babbcf;
|
|
127
|
-
}
|
|
128
|
-
.eds-multi-select__input {
|
|
129
|
-
flex: 1 1;
|
|
130
|
-
min-height: 44px;
|
|
131
|
-
display: flex;
|
|
132
|
-
align-items: center;
|
|
133
|
-
}
|
|
134
|
-
.eds-multi-select__placeholder {
|
|
135
|
-
padding-left: 1.5rem;
|
|
136
|
-
line-height: 1.375rem;
|
|
67
|
+
.eds-dropdown__searchable-selected-item {
|
|
68
|
+
display: block;
|
|
137
69
|
font-size: 1rem;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
.eds-checkbox-icon__path {
|
|
145
|
-
transform-origin: 50% 50%;
|
|
146
|
-
stroke-dasharray: 48;
|
|
147
|
-
stroke-dashoffset: 48;
|
|
148
|
-
stroke-width: 0.375rem;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.eds-multiselect {
|
|
152
|
-
position: relative;
|
|
153
|
-
}
|
|
154
|
-
.eds-multiselect__button {
|
|
70
|
+
line-height: 1rem;
|
|
71
|
+
margin-right: -1rem;
|
|
72
|
+
padding: calc(1rem + 0.25rem) 0 0.25rem 1rem;
|
|
73
|
+
font-family: inherit;
|
|
74
|
+
overflow-x: hidden;
|
|
155
75
|
text-overflow: ellipsis;
|
|
76
|
+
white-space: nowrap;
|
|
156
77
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
display: inline-flex;
|
|
160
|
-
justify-content: center;
|
|
161
|
-
align-items: center;
|
|
162
|
-
position: relative;
|
|
163
|
-
margin-right: 0.75rem;
|
|
164
|
-
height: 1.25rem;
|
|
165
|
-
width: 1.25rem;
|
|
166
|
-
border: 0.125rem solid #181c56;
|
|
167
|
-
border-radius: 0.0625rem;
|
|
168
|
-
background-color: transparent;
|
|
169
|
-
color: #ffffff;
|
|
78
|
+
.eds-dropdown__searchable-selected-item__wrapper {
|
|
79
|
+
max-width: 65%;
|
|
170
80
|
}
|
|
171
81
|
|
|
172
|
-
.eds-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
.eds-multiselect-checkbox--checked .eds-checkbox-icon {
|
|
176
|
-
visibility: visible;
|
|
177
|
-
}
|
|
178
|
-
.eds-multiselect-checkbox--checked .eds-checkbox-icon__path {
|
|
179
|
-
stroke: #ffffff;
|
|
180
|
-
animation: stroke ease-in-out 0.2s 0.1s forwards;
|
|
82
|
+
.eds-form-control.eds-dropdown__input::-moz-placeholder {
|
|
83
|
+
-moz-transition: none;
|
|
84
|
+
transition: none;
|
|
181
85
|
}
|
|
182
86
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
stroke-dashoffset: 0;
|
|
186
|
-
}
|
|
87
|
+
.eds-form-control.eds-dropdown__input::placeholder {
|
|
88
|
+
transition: none;
|
|
187
89
|
}
|
|
188
90
|
/* DO NOT CHANGE!*/
|
|
189
91
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
@@ -243,6 +145,13 @@
|
|
|
243
145
|
.eds-contrast .eds-form-control-wrapper--disabled .eds-dropdown__divider {
|
|
244
146
|
background-color: #8285a8;
|
|
245
147
|
}
|
|
148
|
+
.eds-inline-spinner {
|
|
149
|
+
align-items: center;
|
|
150
|
+
display: flex;
|
|
151
|
+
justify-content: center;
|
|
152
|
+
height: 100%;
|
|
153
|
+
width: 100%;
|
|
154
|
+
}
|
|
246
155
|
/* DO NOT CHANGE!*/
|
|
247
156
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
248
157
|
.eds-dropdown__toggle-button {
|
|
@@ -273,6 +182,97 @@
|
|
|
273
182
|
}
|
|
274
183
|
/* DO NOT CHANGE!*/
|
|
275
184
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
185
|
+
.eds-multi-select {
|
|
186
|
+
position: relative;
|
|
187
|
+
}
|
|
188
|
+
.eds-multi-select__selected-items {
|
|
189
|
+
display: flex;
|
|
190
|
+
align-items: center;
|
|
191
|
+
flex-wrap: wrap;
|
|
192
|
+
position: relative;
|
|
193
|
+
flex: 1 1 0%;
|
|
194
|
+
padding: 0.25rem;
|
|
195
|
+
}
|
|
196
|
+
.eds-multi-select__selected-items-tag.eds-tag-chip {
|
|
197
|
+
margin-left: 0.25rem;
|
|
198
|
+
white-space: nowrap;
|
|
199
|
+
}
|
|
200
|
+
.eds-contrast .eds-multi-select__selected-items-tag.eds-tag-chip svg {
|
|
201
|
+
color: #181c56;
|
|
202
|
+
}
|
|
203
|
+
.eds-multi-select__selected-items-tag.eds-tag-chip:focus {
|
|
204
|
+
outline-offset: 0.125rem;
|
|
205
|
+
}
|
|
206
|
+
.eds-contrast .eds-multi-select__selected-items-tag.eds-tag-chip {
|
|
207
|
+
color: #181c56;
|
|
208
|
+
background: #ebebf1;
|
|
209
|
+
border: 0.0625rem solid #d1d4e3;
|
|
210
|
+
}
|
|
211
|
+
.eds-contrast .eds-multi-select__selected-items-tag.eds-tag-chip .eds-tag-chip__close-button:hover {
|
|
212
|
+
background: #babbcf;
|
|
213
|
+
}
|
|
214
|
+
.eds-multi-select__input {
|
|
215
|
+
flex: 1 1;
|
|
216
|
+
min-height: 44px;
|
|
217
|
+
display: flex;
|
|
218
|
+
align-items: center;
|
|
219
|
+
}
|
|
220
|
+
.eds-multi-select__placeholder {
|
|
221
|
+
padding-left: 1.5rem;
|
|
222
|
+
line-height: 1.375rem;
|
|
223
|
+
font-size: 1rem;
|
|
224
|
+
}
|
|
225
|
+
.eds-checkbox-icon {
|
|
226
|
+
height: 1rem;
|
|
227
|
+
width: 1rem;
|
|
228
|
+
visibility: hidden;
|
|
229
|
+
}
|
|
230
|
+
.eds-checkbox-icon__path {
|
|
231
|
+
transform-origin: 50% 50%;
|
|
232
|
+
stroke-dasharray: 48;
|
|
233
|
+
stroke-dashoffset: 48;
|
|
234
|
+
stroke-width: 0.375rem;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.eds-multiselect {
|
|
238
|
+
position: relative;
|
|
239
|
+
}
|
|
240
|
+
.eds-multiselect__button {
|
|
241
|
+
text-overflow: ellipsis;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.eds-multiselect-checkbox {
|
|
245
|
+
display: inline-flex;
|
|
246
|
+
justify-content: center;
|
|
247
|
+
align-items: center;
|
|
248
|
+
position: relative;
|
|
249
|
+
margin-right: 0.75rem;
|
|
250
|
+
height: 1.25rem;
|
|
251
|
+
width: 1.25rem;
|
|
252
|
+
border: 0.125rem solid #181c56;
|
|
253
|
+
border-radius: 0.0625rem;
|
|
254
|
+
background-color: transparent;
|
|
255
|
+
color: #ffffff;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.eds-multiselect-checkbox--checked {
|
|
259
|
+
background-color: #181c56;
|
|
260
|
+
}
|
|
261
|
+
.eds-multiselect-checkbox--checked .eds-checkbox-icon {
|
|
262
|
+
visibility: visible;
|
|
263
|
+
}
|
|
264
|
+
.eds-multiselect-checkbox--checked .eds-checkbox-icon__path {
|
|
265
|
+
stroke: #ffffff;
|
|
266
|
+
animation: stroke ease-in-out 0.2s 0.1s forwards;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
@keyframes stroke {
|
|
270
|
+
100% {
|
|
271
|
+
stroke-dashoffset: 0;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/* DO NOT CHANGE!*/
|
|
275
|
+
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
276
276
|
.eds-dropdown__list {
|
|
277
277
|
box-sizing: content-box;
|
|
278
278
|
z-index: 20;
|
|
@@ -462,6 +462,9 @@
|
|
|
462
462
|
}
|
|
463
463
|
/* DO NOT CHANGE!*/
|
|
464
464
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
465
|
+
.eds-dropdown {
|
|
466
|
+
cursor: pointer;
|
|
467
|
+
}
|
|
465
468
|
.eds-dropdown__input {
|
|
466
469
|
flex: 1;
|
|
467
470
|
width: 0;
|
|
@@ -481,7 +484,6 @@
|
|
|
481
484
|
overflow-x: hidden;
|
|
482
485
|
text-overflow: ellipsis;
|
|
483
486
|
line-height: 1rem;
|
|
484
|
-
cursor: pointer;
|
|
485
487
|
}
|
|
486
488
|
.eds-dropdown__selected-item.focus-visible {
|
|
487
489
|
outline: none;
|
|
@@ -489,6 +491,9 @@
|
|
|
489
491
|
.eds-dropdown__selected-item:focus-visible {
|
|
490
492
|
outline: none;
|
|
491
493
|
}
|
|
494
|
+
.eds-dropdown--searchable {
|
|
495
|
+
cursor: text;
|
|
496
|
+
}
|
|
492
497
|
.eds-dropdown--searchable__selected-item {
|
|
493
498
|
position: relative;
|
|
494
499
|
flex: 1;
|
|
@@ -498,18 +503,19 @@
|
|
|
498
503
|
white-space: nowrap;
|
|
499
504
|
line-height: 1rem;
|
|
500
505
|
font-family: inherit;
|
|
501
|
-
cursor: text;
|
|
502
506
|
}
|
|
503
507
|
.eds-dropdown--searchable__selected-item--hidden {
|
|
504
508
|
flex: 0;
|
|
505
509
|
}
|
|
510
|
+
.eds-dropdown--multiselect {
|
|
511
|
+
cursor: text;
|
|
512
|
+
}
|
|
506
513
|
.eds-dropdown--multiselect__selected-items-and-input {
|
|
507
514
|
display: flex;
|
|
508
515
|
flex-wrap: wrap;
|
|
509
516
|
flex: 1;
|
|
510
517
|
gap: 0.5rem;
|
|
511
518
|
min-width: 0;
|
|
512
|
-
cursor: text;
|
|
513
519
|
}
|
|
514
520
|
.eds-dropdown--multiselect__selected-items-and-input--filled {
|
|
515
521
|
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,10 @@ 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, setLastRemovedItem, }: {
|
|
19
|
+
handleListItemClicked: ({ clickedItem, onChange, setLastClickedItem: setLastRemovedItem, }: {
|
|
19
20
|
clickedItem: NormalizedDropdownItemType<any>;
|
|
20
21
|
onChange: (value: NormalizedDropdownItemType<ValueType>[]) => void;
|
|
21
|
-
|
|
22
|
+
setLastClickedItem: any;
|
|
22
23
|
}) => void;
|
|
23
24
|
hasSelectedItems: boolean;
|
|
24
25
|
listItemsWithoutSelectAll: NormalizedDropdownItemType<ValueType>[];
|
|
@@ -28,18 +29,8 @@ export declare const useMultiselectUtils: <ValueType>({ listItems, selectedItems
|
|
|
28
29
|
someListItemsAreSelected: boolean;
|
|
29
30
|
unselectAllListItems: (onChange: (value: NormalizedDropdownItemType<ValueType>[]) => void) => void;
|
|
30
31
|
};
|
|
31
|
-
|
|
32
|
+
export declare function getA11yStatusMessage<ValueType>(options: UseComboboxState<NormalizedDropdownItemType<ValueType>> & {
|
|
32
33
|
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;
|
|
34
|
+
resultCount: number;
|
|
35
|
+
}): string;
|
|
45
36
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entur/dropdown",
|
|
3
|
-
"version": "6.0.3-beta.
|
|
3
|
+
"version": "6.0.3-beta.2",
|
|
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.18-beta.
|
|
33
|
-
"@entur/form": "^8.1.0-beta.
|
|
30
|
+
"@entur/a11y": "^0.2.90-beta.0",
|
|
31
|
+
"@entur/button": "^3.2.31-beta.0",
|
|
32
|
+
"@entur/chip": "^0.7.18-beta.1",
|
|
33
|
+
"@entur/form": "^8.1.0-beta.1",
|
|
34
34
|
"@entur/icons": "^7.2.0",
|
|
35
|
-
"@entur/loader": "^0.5.
|
|
35
|
+
"@entur/loader": "^0.5.9-beta.0",
|
|
36
36
|
"@entur/tokens": "^3.17.0",
|
|
37
|
-
"@entur/tooltip": "^4.0.0-beta.
|
|
38
|
-
"@entur/utils": "^0.11.
|
|
37
|
+
"@entur/tooltip": "^4.0.0-beta.1",
|
|
38
|
+
"@entur/utils": "^0.11.2-beta.0",
|
|
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": "bf6f8921dac8b869172f77ab6da76401e40bbc9b"
|
|
44
44
|
}
|