@genspectrum/dashboard-components 0.11.7 → 0.12.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/custom-elements.json +16 -16
- package/dist/{dateRangeOption-Bh2p78z0.js → LocationChangedEvent-CORvQvXv.js} +11 -1
- package/dist/LocationChangedEvent-CORvQvXv.js.map +1 -0
- package/dist/components.d.ts +27 -33
- package/dist/components.js +4034 -655
- package/dist/components.js.map +1 -1
- package/dist/style.css +151 -4
- package/dist/util.d.ts +32 -26
- package/dist/util.js +2 -1
- package/package.json +2 -1
- package/src/preact/components/csv-download-button.tsx +2 -2
- package/src/preact/downshift_types.d.ts +3 -0
- package/src/preact/locationFilter/LocationChangedEvent.ts +11 -0
- package/src/preact/locationFilter/fetchAutocompletionList.spec.ts +5 -5
- package/src/preact/locationFilter/fetchAutocompletionList.ts +9 -2
- package/src/preact/locationFilter/location-filter.stories.tsx +94 -10
- package/src/preact/locationFilter/location-filter.tsx +183 -62
- package/src/preact/map/sequences-by-location-map.tsx +3 -3
- package/src/preact/mutationFilter/mutation-filter-info.tsx +73 -10
- package/src/preact/textInput/TextInputChangedEvent.ts +11 -0
- package/src/preact/textInput/fetchAutocompleteList.ts +1 -1
- package/src/preact/textInput/text-input.stories.tsx +20 -3
- package/src/preact/textInput/text-input.tsx +139 -36
- package/src/utilEntrypoint.ts +2 -0
- package/src/web-components/input/gs-location-filter.stories.ts +34 -29
- package/src/web-components/input/gs-location-filter.tsx +6 -13
- package/src/web-components/input/gs-text-input.stories.ts +30 -7
- package/standalone-bundle/dashboard-components.js +11073 -8625
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/standalone-bundle/style.css +1 -1
- package/dist/dateRangeOption-Bh2p78z0.js.map +0 -1
package/dist/style.css
CHANGED
|
@@ -1296,6 +1296,19 @@ html {
|
|
|
1296
1296
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1297
1297
|
}
|
|
1298
1298
|
|
|
1299
|
+
:where(.menu li:not(.menu-title, .disabled) > *:not(ul, details, .menu-title)):not(.active, .btn):hover, :where(.menu li:not(.menu-title, .disabled) > details > summary:not(.menu-title)):not(.active, .btn):hover {
|
|
1300
|
+
cursor: pointer;
|
|
1301
|
+
outline: 2px solid transparent;
|
|
1302
|
+
outline-offset: 2px;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
@supports (color: oklch(0% 0 0)) {
|
|
1306
|
+
|
|
1307
|
+
:where(.menu li:not(.menu-title, .disabled) > *:not(ul, details, .menu-title)):not(.active, .btn):hover, :where(.menu li:not(.menu-title, .disabled) > details > summary:not(.menu-title)):not(.active, .btn):hover {
|
|
1308
|
+
background-color: var(--fallback-bc,oklch(var(--bc)/0.1));
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1299
1312
|
.tab[disabled],
|
|
1300
1313
|
.tab[disabled]:hover {
|
|
1301
1314
|
cursor: not-allowed;
|
|
@@ -1426,6 +1439,31 @@ html {
|
|
|
1426
1439
|
cursor: pointer;
|
|
1427
1440
|
text-decoration-line: underline;
|
|
1428
1441
|
}
|
|
1442
|
+
.menu {
|
|
1443
|
+
display: flex;
|
|
1444
|
+
flex-direction: column;
|
|
1445
|
+
flex-wrap: wrap;
|
|
1446
|
+
font-size: 0.875rem;
|
|
1447
|
+
line-height: 1.25rem;
|
|
1448
|
+
padding: 0.5rem;
|
|
1449
|
+
}
|
|
1450
|
+
.menu :where(li ul) {
|
|
1451
|
+
position: relative;
|
|
1452
|
+
white-space: nowrap;
|
|
1453
|
+
margin-inline-start: 1rem;
|
|
1454
|
+
padding-inline-start: 0.5rem;
|
|
1455
|
+
}
|
|
1456
|
+
.menu :where(li:not(.menu-title) > *:not(ul, details, .menu-title, .btn)), .menu :where(li:not(.menu-title) > details > summary:not(.menu-title)) {
|
|
1457
|
+
display: grid;
|
|
1458
|
+
grid-auto-flow: column;
|
|
1459
|
+
align-content: flex-start;
|
|
1460
|
+
align-items: center;
|
|
1461
|
+
gap: 0.5rem;
|
|
1462
|
+
grid-auto-columns: minmax(auto, max-content) auto max-content;
|
|
1463
|
+
-webkit-user-select: none;
|
|
1464
|
+
-moz-user-select: none;
|
|
1465
|
+
user-select: none;
|
|
1466
|
+
}
|
|
1429
1467
|
.menu li.disabled {
|
|
1430
1468
|
cursor: not-allowed;
|
|
1431
1469
|
-webkit-user-select: none;
|
|
@@ -1433,6 +1471,20 @@ html {
|
|
|
1433
1471
|
user-select: none;
|
|
1434
1472
|
color: var(--fallback-bc,oklch(var(--bc)/0.3));
|
|
1435
1473
|
}
|
|
1474
|
+
.menu :where(li > .menu-dropdown:not(.menu-dropdown-show)) {
|
|
1475
|
+
display: none;
|
|
1476
|
+
}
|
|
1477
|
+
:where(.menu li) {
|
|
1478
|
+
position: relative;
|
|
1479
|
+
display: flex;
|
|
1480
|
+
flex-shrink: 0;
|
|
1481
|
+
flex-direction: column;
|
|
1482
|
+
flex-wrap: wrap;
|
|
1483
|
+
align-items: stretch;
|
|
1484
|
+
}
|
|
1485
|
+
:where(.menu li) .badge {
|
|
1486
|
+
justify-self: end;
|
|
1487
|
+
}
|
|
1436
1488
|
.modal {
|
|
1437
1489
|
pointer-events: none;
|
|
1438
1490
|
position: fixed;
|
|
@@ -1992,6 +2044,40 @@ input.tab:checked + .tab-content,
|
|
|
1992
2044
|
.loading-md {
|
|
1993
2045
|
width: 1.5rem;
|
|
1994
2046
|
}
|
|
2047
|
+
:where(.menu li:empty) {
|
|
2048
|
+
--tw-bg-opacity: 1;
|
|
2049
|
+
background-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));
|
|
2050
|
+
opacity: 0.1;
|
|
2051
|
+
margin: 0.5rem 1rem;
|
|
2052
|
+
height: 1px;
|
|
2053
|
+
}
|
|
2054
|
+
.menu :where(li ul):before {
|
|
2055
|
+
position: absolute;
|
|
2056
|
+
bottom: 0.75rem;
|
|
2057
|
+
inset-inline-start: 0px;
|
|
2058
|
+
top: 0.75rem;
|
|
2059
|
+
width: 1px;
|
|
2060
|
+
--tw-bg-opacity: 1;
|
|
2061
|
+
background-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));
|
|
2062
|
+
opacity: 0.1;
|
|
2063
|
+
content: "";
|
|
2064
|
+
}
|
|
2065
|
+
.menu :where(li:not(.menu-title) > *:not(ul, details, .menu-title, .btn)),
|
|
2066
|
+
.menu :where(li:not(.menu-title) > details > summary:not(.menu-title)) {
|
|
2067
|
+
border-radius: var(--rounded-btn, 0.5rem);
|
|
2068
|
+
padding-left: 1rem;
|
|
2069
|
+
padding-right: 1rem;
|
|
2070
|
+
padding-top: 0.5rem;
|
|
2071
|
+
padding-bottom: 0.5rem;
|
|
2072
|
+
text-align: start;
|
|
2073
|
+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
|
|
2074
|
+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
|
|
2075
|
+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
|
|
2076
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
2077
|
+
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
2078
|
+
transition-duration: 200ms;
|
|
2079
|
+
text-wrap: balance;
|
|
2080
|
+
}
|
|
1995
2081
|
:where(.menu li:not(.menu-title, .disabled) > *:not(ul, details, .menu-title)):not(summary, .active, .btn).focus, :where(.menu li:not(.menu-title, .disabled) > *:not(ul, details, .menu-title)):not(summary, .active, .btn):focus, :where(.menu li:not(.menu-title, .disabled) > *:not(ul, details, .menu-title)):is(summary):not(.active, .btn):focus-visible, :where(.menu li:not(.menu-title, .disabled) > details > summary:not(.menu-title)):not(summary, .active, .btn).focus, :where(.menu li:not(.menu-title, .disabled) > details > summary:not(.menu-title)):not(summary, .active, .btn):focus, :where(.menu li:not(.menu-title, .disabled) > details > summary:not(.menu-title)):is(summary):not(.active, .btn):focus-visible {
|
|
1996
2082
|
cursor: pointer;
|
|
1997
2083
|
background-color: var(--fallback-bc,oklch(var(--bc)/0.1));
|
|
@@ -2008,6 +2094,30 @@ input.tab:checked + .tab-content,
|
|
|
2008
2094
|
--tw-text-opacity: 1;
|
|
2009
2095
|
color: var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity)));
|
|
2010
2096
|
}
|
|
2097
|
+
.menu :where(li > details > summary)::-webkit-details-marker {
|
|
2098
|
+
display: none;
|
|
2099
|
+
}
|
|
2100
|
+
.menu :where(li > details > summary):after,
|
|
2101
|
+
.menu :where(li > .menu-dropdown-toggle):after {
|
|
2102
|
+
justify-self: end;
|
|
2103
|
+
display: block;
|
|
2104
|
+
margin-top: -0.5rem;
|
|
2105
|
+
height: 0.5rem;
|
|
2106
|
+
width: 0.5rem;
|
|
2107
|
+
transform: rotate(45deg);
|
|
2108
|
+
transition-property: transform, margin-top;
|
|
2109
|
+
transition-duration: 0.3s;
|
|
2110
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
2111
|
+
content: "";
|
|
2112
|
+
transform-origin: 75% 75%;
|
|
2113
|
+
box-shadow: 2px 2px;
|
|
2114
|
+
pointer-events: none;
|
|
2115
|
+
}
|
|
2116
|
+
.menu :where(li > details[open] > summary):after,
|
|
2117
|
+
.menu :where(li > .menu-dropdown-toggle.menu-dropdown-show):after {
|
|
2118
|
+
transform: rotate(225deg);
|
|
2119
|
+
margin-top: 0;
|
|
2120
|
+
}
|
|
2011
2121
|
.mockup-phone .display {
|
|
2012
2122
|
overflow: hidden;
|
|
2013
2123
|
border-radius: 40px;
|
|
@@ -3098,6 +3208,9 @@ input.tab:checked + .tab-content,
|
|
|
3098
3208
|
.h-full {
|
|
3099
3209
|
height: 100%;
|
|
3100
3210
|
}
|
|
3211
|
+
.max-h-80 {
|
|
3212
|
+
max-height: 20rem;
|
|
3213
|
+
}
|
|
3101
3214
|
.w-10 {
|
|
3102
3215
|
width: 2.5rem;
|
|
3103
3216
|
}
|
|
@@ -3129,6 +3242,9 @@ input.tab:checked + .tab-content,
|
|
|
3129
3242
|
width: -moz-max-content;
|
|
3130
3243
|
width: max-content;
|
|
3131
3244
|
}
|
|
3245
|
+
.min-w-32 {
|
|
3246
|
+
min-width: 8rem;
|
|
3247
|
+
}
|
|
3132
3248
|
.min-w-\[7\.5rem\] {
|
|
3133
3249
|
min-width: 7.5rem;
|
|
3134
3250
|
}
|
|
@@ -3188,6 +3304,12 @@ input.tab:checked + .tab-content,
|
|
|
3188
3304
|
.justify-between {
|
|
3189
3305
|
justify-content: space-between;
|
|
3190
3306
|
}
|
|
3307
|
+
.gap-0\.5 {
|
|
3308
|
+
gap: 0.125rem;
|
|
3309
|
+
}
|
|
3310
|
+
.gap-1 {
|
|
3311
|
+
gap: 0.25rem;
|
|
3312
|
+
}
|
|
3191
3313
|
.gap-2 {
|
|
3192
3314
|
gap: 0.5rem;
|
|
3193
3315
|
}
|
|
@@ -3237,10 +3359,6 @@ input.tab:checked + .tab-content,
|
|
|
3237
3359
|
.border-b-2 {
|
|
3238
3360
|
border-bottom-width: 2px;
|
|
3239
3361
|
}
|
|
3240
|
-
.border-error {
|
|
3241
|
-
--tw-border-opacity: 1;
|
|
3242
|
-
border-color: var(--fallback-er,oklch(var(--er)/var(--tw-border-opacity, 1)));
|
|
3243
|
-
}
|
|
3244
3362
|
.border-gray-100 {
|
|
3245
3363
|
--tw-border-opacity: 1;
|
|
3246
3364
|
border-color: rgb(243 244 246 / var(--tw-border-opacity, 1));
|
|
@@ -3261,6 +3379,10 @@ input.tab:checked + .tab-content,
|
|
|
3261
3379
|
--tw-border-opacity: 1;
|
|
3262
3380
|
border-color: rgb(100 116 139 / var(--tw-border-opacity, 1));
|
|
3263
3381
|
}
|
|
3382
|
+
.bg-blue-300 {
|
|
3383
|
+
--tw-bg-opacity: 1;
|
|
3384
|
+
background-color: rgb(147 197 253 / var(--tw-bg-opacity, 1));
|
|
3385
|
+
}
|
|
3264
3386
|
.bg-red-200 {
|
|
3265
3387
|
--tw-bg-opacity: 1;
|
|
3266
3388
|
background-color: rgb(254 202 202 / var(--tw-bg-opacity, 1));
|
|
@@ -3276,6 +3398,9 @@ input.tab:checked + .tab-content,
|
|
|
3276
3398
|
.p-1 {
|
|
3277
3399
|
padding: 0.25rem;
|
|
3278
3400
|
}
|
|
3401
|
+
.p-1\.5 {
|
|
3402
|
+
padding: 0.375rem;
|
|
3403
|
+
}
|
|
3279
3404
|
.p-2 {
|
|
3280
3405
|
padding: 0.5rem;
|
|
3281
3406
|
}
|
|
@@ -3286,6 +3411,14 @@ input.tab:checked + .tab-content,
|
|
|
3286
3411
|
padding-left: 0.25rem;
|
|
3287
3412
|
padding-right: 0.25rem;
|
|
3288
3413
|
}
|
|
3414
|
+
.px-2 {
|
|
3415
|
+
padding-left: 0.5rem;
|
|
3416
|
+
padding-right: 0.5rem;
|
|
3417
|
+
}
|
|
3418
|
+
.px-3 {
|
|
3419
|
+
padding-left: 0.75rem;
|
|
3420
|
+
padding-right: 0.75rem;
|
|
3421
|
+
}
|
|
3289
3422
|
.px-4 {
|
|
3290
3423
|
padding-left: 1rem;
|
|
3291
3424
|
padding-right: 1rem;
|
|
@@ -3356,6 +3489,10 @@ input.tab:checked + .tab-content,
|
|
|
3356
3489
|
--tw-text-opacity: 1;
|
|
3357
3490
|
color: rgb(37 99 235 / var(--tw-text-opacity, 1));
|
|
3358
3491
|
}
|
|
3492
|
+
.text-gray-500 {
|
|
3493
|
+
--tw-text-opacity: 1;
|
|
3494
|
+
color: rgb(107 114 128 / var(--tw-text-opacity, 1));
|
|
3495
|
+
}
|
|
3359
3496
|
.text-gray-600 {
|
|
3360
3497
|
--tw-text-opacity: 1;
|
|
3361
3498
|
color: rgb(75 85 99 / var(--tw-text-opacity, 1));
|
|
@@ -3381,6 +3518,16 @@ input.tab:checked + .tab-content,
|
|
|
3381
3518
|
--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
|
|
3382
3519
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
3383
3520
|
}
|
|
3521
|
+
.shadow-md {
|
|
3522
|
+
--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
3523
|
+
--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);
|
|
3524
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
3525
|
+
}
|
|
3526
|
+
.shadow-sm {
|
|
3527
|
+
--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
3528
|
+
--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
|
|
3529
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
3530
|
+
}
|
|
3384
3531
|
.blur {
|
|
3385
3532
|
--tw-blur: blur(8px);
|
|
3386
3533
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
package/dist/util.d.ts
CHANGED
|
@@ -160,6 +160,12 @@ declare const lapisFilterSchema: default_2.ZodIntersection<default_2.ZodRecord<d
|
|
|
160
160
|
aminoAcidInsertions?: string[] | undefined;
|
|
161
161
|
}>>;
|
|
162
162
|
|
|
163
|
+
declare type LapisLocationFilter = Record<string, string | null | undefined>;
|
|
164
|
+
|
|
165
|
+
export declare class LocationChangedEvent extends CustomEvent<LapisLocationFilter> {
|
|
166
|
+
constructor(detail: LapisLocationFilter);
|
|
167
|
+
}
|
|
168
|
+
|
|
163
169
|
export declare type MapSource = default_2.infer<typeof mapSourceSchema>;
|
|
164
170
|
|
|
165
171
|
declare const mapSourceSchema: default_2.ZodObject<{
|
|
@@ -882,7 +888,7 @@ declare global {
|
|
|
882
888
|
|
|
883
889
|
declare global {
|
|
884
890
|
interface HTMLElementTagNameMap {
|
|
885
|
-
'gs-
|
|
891
|
+
'gs-number-sequences-over-time': NumberSequencesOverTimeComponent;
|
|
886
892
|
}
|
|
887
893
|
}
|
|
888
894
|
|
|
@@ -890,7 +896,7 @@ declare global {
|
|
|
890
896
|
declare global {
|
|
891
897
|
namespace JSX {
|
|
892
898
|
interface IntrinsicElements {
|
|
893
|
-
'gs-
|
|
899
|
+
'gs-number-sequences-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
894
900
|
}
|
|
895
901
|
}
|
|
896
902
|
}
|
|
@@ -898,7 +904,7 @@ declare global {
|
|
|
898
904
|
|
|
899
905
|
declare global {
|
|
900
906
|
interface HTMLElementTagNameMap {
|
|
901
|
-
'gs-
|
|
907
|
+
'gs-aggregate': AggregateComponent;
|
|
902
908
|
}
|
|
903
909
|
}
|
|
904
910
|
|
|
@@ -906,7 +912,7 @@ declare global {
|
|
|
906
912
|
declare global {
|
|
907
913
|
namespace JSX {
|
|
908
914
|
interface IntrinsicElements {
|
|
909
|
-
'gs-
|
|
915
|
+
'gs-aggregate': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
910
916
|
}
|
|
911
917
|
}
|
|
912
918
|
}
|
|
@@ -914,7 +920,7 @@ declare global {
|
|
|
914
920
|
|
|
915
921
|
declare global {
|
|
916
922
|
interface HTMLElementTagNameMap {
|
|
917
|
-
'gs-
|
|
923
|
+
'gs-mutations-over-time': MutationsOverTimeComponent;
|
|
918
924
|
}
|
|
919
925
|
}
|
|
920
926
|
|
|
@@ -922,7 +928,7 @@ declare global {
|
|
|
922
928
|
declare global {
|
|
923
929
|
namespace JSX {
|
|
924
930
|
interface IntrinsicElements {
|
|
925
|
-
'gs-
|
|
931
|
+
'gs-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
926
932
|
}
|
|
927
933
|
}
|
|
928
934
|
}
|
|
@@ -930,7 +936,7 @@ declare global {
|
|
|
930
936
|
|
|
931
937
|
declare global {
|
|
932
938
|
interface HTMLElementTagNameMap {
|
|
933
|
-
'gs-
|
|
939
|
+
'gs-sequences-by-location': SequencesByLocationComponent;
|
|
934
940
|
}
|
|
935
941
|
}
|
|
936
942
|
|
|
@@ -938,7 +944,7 @@ declare global {
|
|
|
938
944
|
declare global {
|
|
939
945
|
namespace JSX {
|
|
940
946
|
interface IntrinsicElements {
|
|
941
|
-
'gs-
|
|
947
|
+
'gs-sequences-by-location': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
942
948
|
}
|
|
943
949
|
}
|
|
944
950
|
}
|
|
@@ -946,7 +952,7 @@ declare global {
|
|
|
946
952
|
|
|
947
953
|
declare global {
|
|
948
954
|
interface HTMLElementTagNameMap {
|
|
949
|
-
'gs-
|
|
955
|
+
'gs-statistics': StatisticsComponent;
|
|
950
956
|
}
|
|
951
957
|
}
|
|
952
958
|
|
|
@@ -954,7 +960,7 @@ declare global {
|
|
|
954
960
|
declare global {
|
|
955
961
|
namespace JSX {
|
|
956
962
|
interface IntrinsicElements {
|
|
957
|
-
'gs-
|
|
963
|
+
'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
958
964
|
}
|
|
959
965
|
}
|
|
960
966
|
}
|
|
@@ -962,10 +968,11 @@ declare global {
|
|
|
962
968
|
|
|
963
969
|
declare global {
|
|
964
970
|
interface HTMLElementTagNameMap {
|
|
965
|
-
'gs-
|
|
971
|
+
'gs-date-range-selector': DateRangeSelectorComponent;
|
|
966
972
|
}
|
|
967
973
|
interface HTMLElementEventMap {
|
|
968
|
-
'gs-
|
|
974
|
+
'gs-date-range-filter-changed': CustomEvent<Record<string, string>>;
|
|
975
|
+
'gs-date-range-option-changed': DateRangeOptionChangedEvent;
|
|
969
976
|
}
|
|
970
977
|
}
|
|
971
978
|
|
|
@@ -973,7 +980,7 @@ declare global {
|
|
|
973
980
|
declare global {
|
|
974
981
|
namespace JSX {
|
|
975
982
|
interface IntrinsicElements {
|
|
976
|
-
'gs-
|
|
983
|
+
'gs-date-range-selector': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
977
984
|
}
|
|
978
985
|
}
|
|
979
986
|
}
|
|
@@ -981,11 +988,10 @@ declare global {
|
|
|
981
988
|
|
|
982
989
|
declare global {
|
|
983
990
|
interface HTMLElementTagNameMap {
|
|
984
|
-
'gs-
|
|
991
|
+
'gs-location-filter': LocationFilterComponent;
|
|
985
992
|
}
|
|
986
993
|
interface HTMLElementEventMap {
|
|
987
|
-
'gs-
|
|
988
|
-
'gs-date-range-option-changed': DateRangeOptionChangedEvent;
|
|
994
|
+
'gs-location-changed': LocationChangedEvent;
|
|
989
995
|
}
|
|
990
996
|
}
|
|
991
997
|
|
|
@@ -993,7 +999,7 @@ declare global {
|
|
|
993
999
|
declare global {
|
|
994
1000
|
namespace JSX {
|
|
995
1001
|
interface IntrinsicElements {
|
|
996
|
-
'gs-
|
|
1002
|
+
'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
997
1003
|
}
|
|
998
1004
|
}
|
|
999
1005
|
}
|
|
@@ -1001,10 +1007,10 @@ declare global {
|
|
|
1001
1007
|
|
|
1002
1008
|
declare global {
|
|
1003
1009
|
interface HTMLElementTagNameMap {
|
|
1004
|
-
'gs-
|
|
1010
|
+
'gs-mutation-filter': MutationFilterComponent;
|
|
1005
1011
|
}
|
|
1006
1012
|
interface HTMLElementEventMap {
|
|
1007
|
-
'gs-
|
|
1013
|
+
'gs-mutation-filter-changed': CustomEvent<MutationsFilter>;
|
|
1008
1014
|
}
|
|
1009
1015
|
}
|
|
1010
1016
|
|
|
@@ -1012,7 +1018,7 @@ declare global {
|
|
|
1012
1018
|
declare global {
|
|
1013
1019
|
namespace JSX {
|
|
1014
1020
|
interface IntrinsicElements {
|
|
1015
|
-
'gs-
|
|
1021
|
+
'gs-mutation-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1016
1022
|
}
|
|
1017
1023
|
}
|
|
1018
1024
|
}
|
|
@@ -1020,10 +1026,10 @@ declare global {
|
|
|
1020
1026
|
|
|
1021
1027
|
declare global {
|
|
1022
1028
|
interface HTMLElementTagNameMap {
|
|
1023
|
-
'gs-
|
|
1029
|
+
'gs-lineage-filter': LineageFilterComponent;
|
|
1024
1030
|
}
|
|
1025
1031
|
interface HTMLElementEventMap {
|
|
1026
|
-
'gs-
|
|
1032
|
+
'gs-lineage-filter-changed': CustomEvent<Record<string, string>>;
|
|
1027
1033
|
}
|
|
1028
1034
|
}
|
|
1029
1035
|
|
|
@@ -1031,7 +1037,7 @@ declare global {
|
|
|
1031
1037
|
declare global {
|
|
1032
1038
|
namespace JSX {
|
|
1033
1039
|
interface IntrinsicElements {
|
|
1034
|
-
'gs-
|
|
1040
|
+
'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1035
1041
|
}
|
|
1036
1042
|
}
|
|
1037
1043
|
}
|
|
@@ -1039,10 +1045,10 @@ declare global {
|
|
|
1039
1045
|
|
|
1040
1046
|
declare global {
|
|
1041
1047
|
interface HTMLElementTagNameMap {
|
|
1042
|
-
'gs-
|
|
1048
|
+
'gs-text-input': TextInputComponent;
|
|
1043
1049
|
}
|
|
1044
1050
|
interface HTMLElementEventMap {
|
|
1045
|
-
'gs-
|
|
1051
|
+
'gs-text-input-changed': CustomEvent<Record<string, string>>;
|
|
1046
1052
|
}
|
|
1047
1053
|
}
|
|
1048
1054
|
|
|
@@ -1050,7 +1056,7 @@ declare global {
|
|
|
1050
1056
|
declare global {
|
|
1051
1057
|
namespace JSX {
|
|
1052
1058
|
interface IntrinsicElements {
|
|
1053
|
-
'gs-
|
|
1059
|
+
'gs-text-input': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1054
1060
|
}
|
|
1055
1061
|
}
|
|
1056
1062
|
}
|
package/dist/util.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genspectrum/dashboard-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "GenSpectrum web components for building dashboards",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"chartjs-chart-error-bars": "^4.4.0",
|
|
88
88
|
"chartjs-chart-venn": "^4.3.0",
|
|
89
89
|
"dayjs": "^1.11.10",
|
|
90
|
+
"downshift": "^9.0.8",
|
|
90
91
|
"flatpickr": "^4.6.13",
|
|
91
92
|
"gridjs": "^6.2.0",
|
|
92
93
|
"leaflet": "^1.9.4",
|
|
@@ -33,9 +33,9 @@ export const CsvDownloadButton: FunctionComponent<CsvDownloadButtonProps> = ({
|
|
|
33
33
|
const getDownloadContent = () => {
|
|
34
34
|
const data = getData();
|
|
35
35
|
const keys = getDataKeys(data);
|
|
36
|
-
const header =
|
|
36
|
+
const header = keys.join(',');
|
|
37
37
|
const rows = data.map((row) => keys.map((key) => row[key]).join(',')).join('\n');
|
|
38
|
-
return header
|
|
38
|
+
return `${header}\n${rows}\n`;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
const getDataKeys = (data: Record<string, DataValue>[]) => {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type LapisLocationFilter = Record<string, string | null | undefined>;
|
|
2
|
+
|
|
3
|
+
export class LocationChangedEvent extends CustomEvent<LapisLocationFilter> {
|
|
4
|
+
constructor(detail: LapisLocationFilter) {
|
|
5
|
+
super('gs-location-changed', {
|
|
6
|
+
detail,
|
|
7
|
+
bubbles: true,
|
|
8
|
+
composed: true,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -23,14 +23,14 @@ describe('fetchAutocompletionList', () => {
|
|
|
23
23
|
const result = await fetchAutocompletionList(fields, DUMMY_LAPIS_URL);
|
|
24
24
|
|
|
25
25
|
expect(result).to.deep.equal([
|
|
26
|
-
{ region: 'region1', country:
|
|
27
|
-
{ region: 'region1', country: 'country1_1', division:
|
|
26
|
+
{ region: 'region1', country: undefined, division: undefined },
|
|
27
|
+
{ region: 'region1', country: 'country1_1', division: undefined },
|
|
28
28
|
{ region: 'region1', country: 'country1_1', division: 'division1_1_1' },
|
|
29
29
|
{ region: 'region1', country: 'country1_1', division: 'division1_1_2' },
|
|
30
|
-
{ region: 'region1', country: 'country1_2', division:
|
|
30
|
+
{ region: 'region1', country: 'country1_2', division: undefined },
|
|
31
31
|
{ region: 'region1', country: 'country1_2', division: 'division1_2_1' },
|
|
32
|
-
{ region: 'region2', country:
|
|
33
|
-
{ region: 'region2', country: 'country2_1', division:
|
|
32
|
+
{ region: 'region2', country: undefined, division: undefined },
|
|
33
|
+
{ region: 'region2', country: 'country2_1', division: undefined },
|
|
34
34
|
]);
|
|
35
35
|
});
|
|
36
36
|
});
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { FetchAggregatedOperator } from '../../operator/FetchAggregatedOperator';
|
|
2
2
|
|
|
3
|
-
export async function fetchAutocompletionList(
|
|
3
|
+
export async function fetchAutocompletionList(
|
|
4
|
+
fields: string[],
|
|
5
|
+
lapis: string,
|
|
6
|
+
signal?: AbortSignal,
|
|
7
|
+
): Promise<Record<string, string | undefined>[]> {
|
|
4
8
|
const toAncestorInHierarchyOverwriteValues = Array(fields.length - 1)
|
|
5
9
|
.fill(0)
|
|
6
10
|
.map((_, i) => i + 1)
|
|
@@ -20,7 +24,10 @@ export async function fetchAutocompletionList(fields: string[], lapis: string, s
|
|
|
20
24
|
return setOfAllHierarchies;
|
|
21
25
|
}, new Set());
|
|
22
26
|
|
|
23
|
-
return [...locationValues]
|
|
27
|
+
return [...locationValues]
|
|
28
|
+
.map((json) => JSON.parse(json))
|
|
29
|
+
.sort(compareLocationEntries(fields))
|
|
30
|
+
.map((entry) => fields.reduce((acc, field) => ({ ...acc, [field]: entry[field] ?? undefined }), {}));
|
|
24
31
|
}
|
|
25
32
|
|
|
26
33
|
function compareLocationEntries(fields: string[]) {
|