@genspectrum/dashboard-components 0.13.1 → 0.13.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/components.d.ts +46 -46
- package/dist/components.js +28 -9
- package/dist/components.js.map +1 -1
- package/dist/util.d.ts +46 -46
- package/package.json +1 -1
- package/src/preact/components/downshift-combobox.tsx +18 -20
- package/src/preact/textInput/fetchStringAutocompleteList.spec.ts +34 -0
- package/src/preact/textInput/fetchStringAutocompleteList.ts +16 -2
- package/src/preact/textInput/text-input.tsx +22 -8
- package/standalone-bundle/dashboard-components.js +29 -16
- package/standalone-bundle/dashboard-components.js.map +1 -1
package/dist/components.d.ts
CHANGED
|
@@ -1346,7 +1346,11 @@ declare global {
|
|
|
1346
1346
|
|
|
1347
1347
|
declare global {
|
|
1348
1348
|
interface HTMLElementTagNameMap {
|
|
1349
|
-
'gs-
|
|
1349
|
+
'gs-date-range-selector': DateRangeSelectorComponent;
|
|
1350
|
+
}
|
|
1351
|
+
interface HTMLElementEventMap {
|
|
1352
|
+
'gs-date-range-filter-changed': CustomEvent<Record<string, string>>;
|
|
1353
|
+
'gs-date-range-option-changed': DateRangeOptionChangedEvent;
|
|
1350
1354
|
}
|
|
1351
1355
|
}
|
|
1352
1356
|
|
|
@@ -1354,7 +1358,7 @@ declare global {
|
|
|
1354
1358
|
declare global {
|
|
1355
1359
|
namespace JSX {
|
|
1356
1360
|
interface IntrinsicElements {
|
|
1357
|
-
'gs-
|
|
1361
|
+
'gs-date-range-selector': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1358
1362
|
}
|
|
1359
1363
|
}
|
|
1360
1364
|
}
|
|
@@ -1362,7 +1366,10 @@ declare global {
|
|
|
1362
1366
|
|
|
1363
1367
|
declare global {
|
|
1364
1368
|
interface HTMLElementTagNameMap {
|
|
1365
|
-
'gs-
|
|
1369
|
+
'gs-location-filter': LocationFilterComponent;
|
|
1370
|
+
}
|
|
1371
|
+
interface HTMLElementEventMap {
|
|
1372
|
+
'gs-location-changed': LocationChangedEvent;
|
|
1366
1373
|
}
|
|
1367
1374
|
}
|
|
1368
1375
|
|
|
@@ -1370,7 +1377,7 @@ declare global {
|
|
|
1370
1377
|
declare global {
|
|
1371
1378
|
namespace JSX {
|
|
1372
1379
|
interface IntrinsicElements {
|
|
1373
|
-
'gs-
|
|
1380
|
+
'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1374
1381
|
}
|
|
1375
1382
|
}
|
|
1376
1383
|
}
|
|
@@ -1378,7 +1385,10 @@ declare global {
|
|
|
1378
1385
|
|
|
1379
1386
|
declare global {
|
|
1380
1387
|
interface HTMLElementTagNameMap {
|
|
1381
|
-
'gs-
|
|
1388
|
+
'gs-text-input': TextInputComponent;
|
|
1389
|
+
}
|
|
1390
|
+
interface HTMLElementEventMap {
|
|
1391
|
+
'gs-text-input-changed': TextInputChangedEvent;
|
|
1382
1392
|
}
|
|
1383
1393
|
}
|
|
1384
1394
|
|
|
@@ -1386,7 +1396,7 @@ declare global {
|
|
|
1386
1396
|
declare global {
|
|
1387
1397
|
namespace JSX {
|
|
1388
1398
|
interface IntrinsicElements {
|
|
1389
|
-
'gs-
|
|
1399
|
+
'gs-text-input': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1390
1400
|
}
|
|
1391
1401
|
}
|
|
1392
1402
|
}
|
|
@@ -1394,7 +1404,10 @@ declare global {
|
|
|
1394
1404
|
|
|
1395
1405
|
declare global {
|
|
1396
1406
|
interface HTMLElementTagNameMap {
|
|
1397
|
-
'gs-
|
|
1407
|
+
'gs-mutation-filter': MutationFilterComponent;
|
|
1408
|
+
}
|
|
1409
|
+
interface HTMLElementEventMap {
|
|
1410
|
+
'gs-mutation-filter-changed': CustomEvent<MutationsFilter>;
|
|
1398
1411
|
}
|
|
1399
1412
|
}
|
|
1400
1413
|
|
|
@@ -1402,7 +1415,7 @@ declare global {
|
|
|
1402
1415
|
declare global {
|
|
1403
1416
|
namespace JSX {
|
|
1404
1417
|
interface IntrinsicElements {
|
|
1405
|
-
'gs-
|
|
1418
|
+
'gs-mutation-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1406
1419
|
}
|
|
1407
1420
|
}
|
|
1408
1421
|
}
|
|
@@ -1410,7 +1423,10 @@ declare global {
|
|
|
1410
1423
|
|
|
1411
1424
|
declare global {
|
|
1412
1425
|
interface HTMLElementTagNameMap {
|
|
1413
|
-
'gs-
|
|
1426
|
+
'gs-lineage-filter': LineageFilterComponent;
|
|
1427
|
+
}
|
|
1428
|
+
interface HTMLElementEventMap {
|
|
1429
|
+
'gs-lineage-filter-changed': LineageFilterChangedEvent;
|
|
1414
1430
|
}
|
|
1415
1431
|
}
|
|
1416
1432
|
|
|
@@ -1418,7 +1434,7 @@ declare global {
|
|
|
1418
1434
|
declare global {
|
|
1419
1435
|
namespace JSX {
|
|
1420
1436
|
interface IntrinsicElements {
|
|
1421
|
-
'gs-
|
|
1437
|
+
'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1422
1438
|
}
|
|
1423
1439
|
}
|
|
1424
1440
|
}
|
|
@@ -1426,7 +1442,7 @@ declare global {
|
|
|
1426
1442
|
|
|
1427
1443
|
declare global {
|
|
1428
1444
|
interface HTMLElementTagNameMap {
|
|
1429
|
-
'gs-
|
|
1445
|
+
'gs-wastewater-mutations-over-time': WastewaterMutationsOverTimeComponent;
|
|
1430
1446
|
}
|
|
1431
1447
|
}
|
|
1432
1448
|
|
|
@@ -1434,7 +1450,7 @@ declare global {
|
|
|
1434
1450
|
declare global {
|
|
1435
1451
|
namespace JSX {
|
|
1436
1452
|
interface IntrinsicElements {
|
|
1437
|
-
'gs-
|
|
1453
|
+
'gs-wastewater-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1438
1454
|
}
|
|
1439
1455
|
}
|
|
1440
1456
|
}
|
|
@@ -1442,7 +1458,7 @@ declare global {
|
|
|
1442
1458
|
|
|
1443
1459
|
declare global {
|
|
1444
1460
|
interface HTMLElementTagNameMap {
|
|
1445
|
-
'gs-
|
|
1461
|
+
'gs-mutation-comparison-component': MutationComparisonComponent;
|
|
1446
1462
|
}
|
|
1447
1463
|
}
|
|
1448
1464
|
|
|
@@ -1450,7 +1466,7 @@ declare global {
|
|
|
1450
1466
|
declare global {
|
|
1451
1467
|
namespace JSX {
|
|
1452
1468
|
interface IntrinsicElements {
|
|
1453
|
-
'gs-
|
|
1469
|
+
'gs-mutation-comparison-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1454
1470
|
}
|
|
1455
1471
|
}
|
|
1456
1472
|
}
|
|
@@ -1458,7 +1474,7 @@ declare global {
|
|
|
1458
1474
|
|
|
1459
1475
|
declare global {
|
|
1460
1476
|
interface HTMLElementTagNameMap {
|
|
1461
|
-
'gs-
|
|
1477
|
+
'gs-mutations-component': MutationsComponent;
|
|
1462
1478
|
}
|
|
1463
1479
|
}
|
|
1464
1480
|
|
|
@@ -1466,7 +1482,7 @@ declare global {
|
|
|
1466
1482
|
declare global {
|
|
1467
1483
|
namespace JSX {
|
|
1468
1484
|
interface IntrinsicElements {
|
|
1469
|
-
'gs-
|
|
1485
|
+
'gs-mutations-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1470
1486
|
}
|
|
1471
1487
|
}
|
|
1472
1488
|
}
|
|
@@ -1474,7 +1490,7 @@ declare global {
|
|
|
1474
1490
|
|
|
1475
1491
|
declare global {
|
|
1476
1492
|
interface HTMLElementTagNameMap {
|
|
1477
|
-
'gs-
|
|
1493
|
+
'gs-prevalence-over-time': PrevalenceOverTimeComponent;
|
|
1478
1494
|
}
|
|
1479
1495
|
}
|
|
1480
1496
|
|
|
@@ -1482,7 +1498,7 @@ declare global {
|
|
|
1482
1498
|
declare global {
|
|
1483
1499
|
namespace JSX {
|
|
1484
1500
|
interface IntrinsicElements {
|
|
1485
|
-
'gs-
|
|
1501
|
+
'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1486
1502
|
}
|
|
1487
1503
|
}
|
|
1488
1504
|
}
|
|
@@ -1490,7 +1506,7 @@ declare global {
|
|
|
1490
1506
|
|
|
1491
1507
|
declare global {
|
|
1492
1508
|
interface HTMLElementTagNameMap {
|
|
1493
|
-
'gs-
|
|
1509
|
+
'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
|
|
1494
1510
|
}
|
|
1495
1511
|
}
|
|
1496
1512
|
|
|
@@ -1498,7 +1514,7 @@ declare global {
|
|
|
1498
1514
|
declare global {
|
|
1499
1515
|
namespace JSX {
|
|
1500
1516
|
interface IntrinsicElements {
|
|
1501
|
-
'gs-
|
|
1517
|
+
'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1502
1518
|
}
|
|
1503
1519
|
}
|
|
1504
1520
|
}
|
|
@@ -1506,11 +1522,7 @@ declare global {
|
|
|
1506
1522
|
|
|
1507
1523
|
declare global {
|
|
1508
1524
|
interface HTMLElementTagNameMap {
|
|
1509
|
-
'gs-
|
|
1510
|
-
}
|
|
1511
|
-
interface HTMLElementEventMap {
|
|
1512
|
-
'gs-date-range-filter-changed': CustomEvent<Record<string, string>>;
|
|
1513
|
-
'gs-date-range-option-changed': DateRangeOptionChangedEvent;
|
|
1525
|
+
'gs-number-sequences-over-time': NumberSequencesOverTimeComponent;
|
|
1514
1526
|
}
|
|
1515
1527
|
}
|
|
1516
1528
|
|
|
@@ -1518,7 +1530,7 @@ declare global {
|
|
|
1518
1530
|
declare global {
|
|
1519
1531
|
namespace JSX {
|
|
1520
1532
|
interface IntrinsicElements {
|
|
1521
|
-
'gs-
|
|
1533
|
+
'gs-number-sequences-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1522
1534
|
}
|
|
1523
1535
|
}
|
|
1524
1536
|
}
|
|
@@ -1526,10 +1538,7 @@ declare global {
|
|
|
1526
1538
|
|
|
1527
1539
|
declare global {
|
|
1528
1540
|
interface HTMLElementTagNameMap {
|
|
1529
|
-
'gs-
|
|
1530
|
-
}
|
|
1531
|
-
interface HTMLElementEventMap {
|
|
1532
|
-
'gs-location-changed': LocationChangedEvent;
|
|
1541
|
+
'gs-aggregate': AggregateComponent;
|
|
1533
1542
|
}
|
|
1534
1543
|
}
|
|
1535
1544
|
|
|
@@ -1537,7 +1546,7 @@ declare global {
|
|
|
1537
1546
|
declare global {
|
|
1538
1547
|
namespace JSX {
|
|
1539
1548
|
interface IntrinsicElements {
|
|
1540
|
-
'gs-
|
|
1549
|
+
'gs-aggregate': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1541
1550
|
}
|
|
1542
1551
|
}
|
|
1543
1552
|
}
|
|
@@ -1545,10 +1554,7 @@ declare global {
|
|
|
1545
1554
|
|
|
1546
1555
|
declare global {
|
|
1547
1556
|
interface HTMLElementTagNameMap {
|
|
1548
|
-
'gs-
|
|
1549
|
-
}
|
|
1550
|
-
interface HTMLElementEventMap {
|
|
1551
|
-
'gs-text-input-changed': TextInputChangedEvent;
|
|
1557
|
+
'gs-mutations-over-time': MutationsOverTimeComponent;
|
|
1552
1558
|
}
|
|
1553
1559
|
}
|
|
1554
1560
|
|
|
@@ -1556,7 +1562,7 @@ declare global {
|
|
|
1556
1562
|
declare global {
|
|
1557
1563
|
namespace JSX {
|
|
1558
1564
|
interface IntrinsicElements {
|
|
1559
|
-
'gs-
|
|
1565
|
+
'gs-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1560
1566
|
}
|
|
1561
1567
|
}
|
|
1562
1568
|
}
|
|
@@ -1564,10 +1570,7 @@ declare global {
|
|
|
1564
1570
|
|
|
1565
1571
|
declare global {
|
|
1566
1572
|
interface HTMLElementTagNameMap {
|
|
1567
|
-
'gs-
|
|
1568
|
-
}
|
|
1569
|
-
interface HTMLElementEventMap {
|
|
1570
|
-
'gs-mutation-filter-changed': CustomEvent<MutationsFilter>;
|
|
1573
|
+
'gs-sequences-by-location': SequencesByLocationComponent;
|
|
1571
1574
|
}
|
|
1572
1575
|
}
|
|
1573
1576
|
|
|
@@ -1575,7 +1578,7 @@ declare global {
|
|
|
1575
1578
|
declare global {
|
|
1576
1579
|
namespace JSX {
|
|
1577
1580
|
interface IntrinsicElements {
|
|
1578
|
-
'gs-
|
|
1581
|
+
'gs-sequences-by-location': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1579
1582
|
}
|
|
1580
1583
|
}
|
|
1581
1584
|
}
|
|
@@ -1583,10 +1586,7 @@ declare global {
|
|
|
1583
1586
|
|
|
1584
1587
|
declare global {
|
|
1585
1588
|
interface HTMLElementTagNameMap {
|
|
1586
|
-
'gs-
|
|
1587
|
-
}
|
|
1588
|
-
interface HTMLElementEventMap {
|
|
1589
|
-
'gs-lineage-filter-changed': LineageFilterChangedEvent;
|
|
1589
|
+
'gs-statistics': StatisticsComponent;
|
|
1590
1590
|
}
|
|
1591
1591
|
}
|
|
1592
1592
|
|
|
@@ -1594,7 +1594,7 @@ declare global {
|
|
|
1594
1594
|
declare global {
|
|
1595
1595
|
namespace JSX {
|
|
1596
1596
|
interface IntrinsicElements {
|
|
1597
|
-
'gs-
|
|
1597
|
+
'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1598
1598
|
}
|
|
1599
1599
|
}
|
|
1600
1600
|
}
|
package/dist/components.js
CHANGED
|
@@ -14694,10 +14694,10 @@ function DownshiftCombobox({
|
|
|
14694
14694
|
]
|
|
14695
14695
|
}
|
|
14696
14696
|
) }),
|
|
14697
|
-
|
|
14697
|
+
/* @__PURE__ */ u$1(
|
|
14698
14698
|
"ul",
|
|
14699
14699
|
{
|
|
14700
|
-
className:
|
|
14700
|
+
className: `absolute bg-white mt-1 shadow-md max-h-80 overflow-scroll z-10 w-full min-w-32 ${isOpen ? "" : "hidden"}`,
|
|
14701
14701
|
...getMenuProps(),
|
|
14702
14702
|
children: items.length > 0 ? items.map((item, index) => /* @__PURE__ */ u$1(
|
|
14703
14703
|
"li",
|
|
@@ -14854,9 +14854,19 @@ async function fetchStringAutocompleteList({
|
|
|
14854
14854
|
lapisFilter,
|
|
14855
14855
|
signal
|
|
14856
14856
|
}) {
|
|
14857
|
-
const fetchAggregatedOperator = new FetchAggregatedOperator(lapisFilter ?? {}, [
|
|
14857
|
+
const fetchAggregatedOperator = new FetchAggregatedOperator(lapisFilter ?? {}, [
|
|
14858
|
+
field
|
|
14859
|
+
]);
|
|
14858
14860
|
const data = (await fetchAggregatedOperator.evaluate(lapis, signal)).content;
|
|
14859
|
-
return data.map((item) => item[field]).sort()
|
|
14861
|
+
return data.map((item) => ({ count: item.count, value: item[field] })).filter((item) => item.value !== null).sort((a2, b3) => {
|
|
14862
|
+
if (a2.value === null) {
|
|
14863
|
+
return 1;
|
|
14864
|
+
}
|
|
14865
|
+
if (b3.value === null) {
|
|
14866
|
+
return -1;
|
|
14867
|
+
}
|
|
14868
|
+
return a2.value.localeCompare(b3.value);
|
|
14869
|
+
});
|
|
14860
14870
|
}
|
|
14861
14871
|
const textSelectorPropsSchema = z$2.object({
|
|
14862
14872
|
lapisField: z$2.string().min(1),
|
|
@@ -14900,26 +14910,35 @@ const TextSelector = ({
|
|
|
14900
14910
|
placeholderText,
|
|
14901
14911
|
data
|
|
14902
14912
|
}) => {
|
|
14913
|
+
const initialSelectedItem = data.find((candidate) => candidate.value == value);
|
|
14903
14914
|
return /* @__PURE__ */ u$1(
|
|
14904
14915
|
DownshiftCombobox,
|
|
14905
14916
|
{
|
|
14906
14917
|
allItems: data,
|
|
14907
|
-
value,
|
|
14918
|
+
value: initialSelectedItem,
|
|
14908
14919
|
filterItemsByInputValue: filterByInputValue$1,
|
|
14909
|
-
createEvent: (item) => new TextInputChangedEvent({ [lapisField]: item ?? void 0 }),
|
|
14910
|
-
itemToString: (item) => item ?? "",
|
|
14920
|
+
createEvent: (item) => new TextInputChangedEvent({ [lapisField]: (item == null ? void 0 : item.value) ?? void 0 }),
|
|
14921
|
+
itemToString: (item) => (item == null ? void 0 : item.value) ?? "",
|
|
14911
14922
|
placeholderText,
|
|
14912
14923
|
formatItemInList: (item) => {
|
|
14913
|
-
return /* @__PURE__ */ u$1("
|
|
14924
|
+
return /* @__PURE__ */ u$1("p", { children: [
|
|
14925
|
+
/* @__PURE__ */ u$1("span", { children: item.value }),
|
|
14926
|
+
/* @__PURE__ */ u$1("span", { className: "ml-2 text-gray-500", children: [
|
|
14927
|
+
"(",
|
|
14928
|
+
item.count,
|
|
14929
|
+
")"
|
|
14930
|
+
] })
|
|
14931
|
+
] });
|
|
14914
14932
|
}
|
|
14915
14933
|
}
|
|
14916
14934
|
);
|
|
14917
14935
|
};
|
|
14918
14936
|
function filterByInputValue$1(item, inputValue) {
|
|
14937
|
+
var _a;
|
|
14919
14938
|
if (inputValue === void 0 || inputValue === null || inputValue === "") {
|
|
14920
14939
|
return true;
|
|
14921
14940
|
}
|
|
14922
|
-
return item == null ? void 0 :
|
|
14941
|
+
return (_a = item.value) == null ? void 0 : _a.toLowerCase().includes((inputValue == null ? void 0 : inputValue.toLowerCase()) || "");
|
|
14923
14942
|
}
|
|
14924
14943
|
var __defProp$2 = Object.defineProperty;
|
|
14925
14944
|
var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
|