@genspectrum/dashboard-components 1.10.0 → 1.10.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/custom-elements.json +33 -1
- package/dist/components.d.ts +28 -28
- package/dist/components.js +16 -1
- package/dist/components.js.map +1 -1
- package/dist/util.d.ts +28 -28
- package/package.json +1 -1
- package/src/preact/dateRangeFilter/date-range-filter.stories.tsx +2 -0
- package/src/web-components/input/gs-lineage-filter.stories.ts +48 -0
- package/src/web-components/input/gs-lineage-filter.tsx +16 -1
- package/src/web-components/input/gs-text-filter.stories.ts +9 -7
- package/standalone-bundle/dashboard-components.js +12 -1
- package/standalone-bundle/dashboard-components.js.map +1 -1
package/custom-elements.json
CHANGED
|
@@ -622,6 +622,22 @@
|
|
|
622
622
|
},
|
|
623
623
|
"default": "{ ...Template, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-lineage-filter'); await waitFor(() => { return expect(canvas.getByPlaceholderText('Enter a lineage')).toBeVisible(); }); }, }"
|
|
624
624
|
},
|
|
625
|
+
{
|
|
626
|
+
"kind": "variable",
|
|
627
|
+
"name": "LineageFilterStringValue",
|
|
628
|
+
"type": {
|
|
629
|
+
"text": "StoryObj<Required<LineageFilterProps>>"
|
|
630
|
+
},
|
|
631
|
+
"default": "{ render: (args) => { return html` <gs-app lapis=\"${LAPIS_URL}\"> <div class=\"max-w-(--breakpoint-lg)\"> <gs-lineage-filter lapisField=\"pangoLineage\" placeholderText=\"Enter a lineage\" value=\"B.1.1.7\" .multiSelect=${args.multiSelect} ></gs-lineage-filter> </div> </gs-app>`; }, args: { multiSelect: false, }, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-lineage-filter'); await waitFor(() => { return expect(canvas.getByPlaceholderText('Enter a lineage')).toBeVisible(); }); }, }"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"kind": "variable",
|
|
635
|
+
"name": "LineageFilterArrayValue",
|
|
636
|
+
"type": {
|
|
637
|
+
"text": "StoryObj<Required<LineageFilterProps>>"
|
|
638
|
+
},
|
|
639
|
+
"default": "{ render: (args) => { return html` <gs-app lapis=\"${LAPIS_URL}\"> <div class=\"max-w-(--breakpoint-lg)\"> <gs-lineage-filter lapisField=\"pangoLineage\" placeholderText=\"Enter a lineage\" value='[\"B.1.1.7\", \"B.1.1.10\"]' .multiSelect=${args.multiSelect} ></gs-lineage-filter> </div> </gs-app>`; }, args: { multiSelect: true, }, play: async ({ canvasElement }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-lineage-filter'); await waitFor(() => { return expect(canvas.getByPlaceholderText('Enter a lineage')).toBeVisible(); }); }, }"
|
|
640
|
+
},
|
|
625
641
|
{
|
|
626
642
|
"kind": "variable",
|
|
627
643
|
"name": "DelayToShowLoadingState",
|
|
@@ -672,6 +688,22 @@
|
|
|
672
688
|
"module": "src/web-components/input/gs-lineage-filter.stories.ts"
|
|
673
689
|
}
|
|
674
690
|
},
|
|
691
|
+
{
|
|
692
|
+
"kind": "js",
|
|
693
|
+
"name": "LineageFilterStringValue",
|
|
694
|
+
"declaration": {
|
|
695
|
+
"name": "LineageFilterStringValue",
|
|
696
|
+
"module": "src/web-components/input/gs-lineage-filter.stories.ts"
|
|
697
|
+
}
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
"kind": "js",
|
|
701
|
+
"name": "LineageFilterArrayValue",
|
|
702
|
+
"declaration": {
|
|
703
|
+
"name": "LineageFilterArrayValue",
|
|
704
|
+
"module": "src/web-components/input/gs-lineage-filter.stories.ts"
|
|
705
|
+
}
|
|
706
|
+
},
|
|
675
707
|
{
|
|
676
708
|
"kind": "js",
|
|
677
709
|
"name": "DelayToShowLoadingState",
|
|
@@ -1578,7 +1610,7 @@
|
|
|
1578
1610
|
"type": {
|
|
1579
1611
|
"text": "StoryObj<Required<TextFilterProps>>"
|
|
1580
1612
|
},
|
|
1581
|
-
"default": "{ ...Default, play: async ({ canvasElement, step }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-text-filter'); const inputField = () => canvas.getByPlaceholderText('Enter host name'); const listenerMock = fn(); await step('Setup event listener mock', () => { canvasElement.addEventListener(gsEventNames.textFilterChanged, listenerMock); }); await step('wait until data is loaded', async () => { await waitFor(() => { return expect(inputField()).toBeEnabled(); }); }); await step('Enters an invalid host name', async () => { await userEvent.type(inputField(), 'notInList'); await expect(listenerMock).not.toHaveBeenCalled(); }); await step('Empty input', async () => { await userEvent.type(inputField(), '{backspace>9/}'); }); await step('Enter a valid host name', async () => { await userEvent.type(inputField(), 'Homo s'); const dropdownOption = await canvas.findByText('Homo sapiens'); await userEvent.click(dropdownOption); }); await step('Verify event is fired with correct detail', async () => { await waitFor(async () => { await expect(listenerMock).toHaveBeenCalledWith( expect.objectContaining({ detail: { host: 'Homo sapiens', }, }), ); }); }); await step('Remove initial value', async () => { await userEvent.click(canvas.getByRole('button', { name: 'clear selection' })); await expect(listenerMock).toHaveBeenCalledWith( expect.objectContaining({ detail: { host: undefined, }, }), ); }); }, args: { ...Default.args, value: '', }, }"
|
|
1613
|
+
"default": "{ ...Default, play: async ({ canvasElement, step }) => { const canvas = await withinShadowRoot(canvasElement, 'gs-text-filter'); const inputField = () => canvas.getByPlaceholderText('Enter host name'); const listenerMock = fn(); await step('Setup event listener mock', () => { canvasElement.addEventListener(gsEventNames.textFilterChanged, listenerMock); }); await step('wait until data is loaded', async () => { await waitFor(() => { return expect(inputField()).toBeEnabled(); }); }); await step('Enters an invalid host name', async () => { await userEvent.type(inputField(), 'notInList'); await expect(listenerMock).not.toHaveBeenCalled(); }); await step('Empty input', async () => { await userEvent.type(inputField(), '{backspace>9/}'); }); await step('Enter a valid host name', async () => { await userEvent.type(inputField(), 'Homo s'); const dropdownOption = await canvas.findByText('Homo sapiens'); await userEvent.click(dropdownOption); }); await step('Verify event is fired with correct detail', async () => { await waitFor(async () => { await expect(listenerMock).toHaveBeenCalledWith( expect.objectContaining({ detail: { host: 'Homo sapiens', }, }), ); }); }); await step('Remove initial value', async () => { await userEvent.click(canvas.getByRole('button', { name: 'clear selection' })); await waitFor(async () => { await expect(listenerMock).toHaveBeenCalledWith( expect.objectContaining({ detail: { host: undefined, }, }), ); }); }); }, args: { ...Default.args, value: '', }, }"
|
|
1582
1614
|
}
|
|
1583
1615
|
],
|
|
1584
1616
|
"exports": [
|
package/dist/components.d.ts
CHANGED
|
@@ -1672,7 +1672,7 @@ declare global {
|
|
|
1672
1672
|
|
|
1673
1673
|
declare global {
|
|
1674
1674
|
interface HTMLElementTagNameMap {
|
|
1675
|
-
'gs-
|
|
1675
|
+
'gs-mutation-comparison-component': MutationComparisonComponent;
|
|
1676
1676
|
}
|
|
1677
1677
|
}
|
|
1678
1678
|
|
|
@@ -1680,7 +1680,7 @@ declare global {
|
|
|
1680
1680
|
declare global {
|
|
1681
1681
|
namespace JSX {
|
|
1682
1682
|
interface IntrinsicElements {
|
|
1683
|
-
'gs-
|
|
1683
|
+
'gs-mutation-comparison-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1684
1684
|
}
|
|
1685
1685
|
}
|
|
1686
1686
|
}
|
|
@@ -1688,7 +1688,7 @@ declare global {
|
|
|
1688
1688
|
|
|
1689
1689
|
declare global {
|
|
1690
1690
|
interface HTMLElementTagNameMap {
|
|
1691
|
-
'gs-
|
|
1691
|
+
'gs-genome-data-viewer': GenomeDataViewerComponent;
|
|
1692
1692
|
}
|
|
1693
1693
|
}
|
|
1694
1694
|
|
|
@@ -1696,7 +1696,7 @@ declare global {
|
|
|
1696
1696
|
declare global {
|
|
1697
1697
|
namespace JSX {
|
|
1698
1698
|
interface IntrinsicElements {
|
|
1699
|
-
'gs-
|
|
1699
|
+
'gs-genome-data-viewer': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
1702
1702
|
}
|
|
@@ -1704,7 +1704,7 @@ declare global {
|
|
|
1704
1704
|
|
|
1705
1705
|
declare global {
|
|
1706
1706
|
interface HTMLElementTagNameMap {
|
|
1707
|
-
'gs-
|
|
1707
|
+
'gs-mutations': MutationsComponent;
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
1710
|
|
|
@@ -1712,7 +1712,7 @@ declare global {
|
|
|
1712
1712
|
declare global {
|
|
1713
1713
|
namespace JSX {
|
|
1714
1714
|
interface IntrinsicElements {
|
|
1715
|
-
'gs-
|
|
1715
|
+
'gs-mutations': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1716
1716
|
}
|
|
1717
1717
|
}
|
|
1718
1718
|
}
|
|
@@ -1720,7 +1720,7 @@ declare global {
|
|
|
1720
1720
|
|
|
1721
1721
|
declare global {
|
|
1722
1722
|
interface HTMLElementTagNameMap {
|
|
1723
|
-
'gs-
|
|
1723
|
+
'gs-prevalence-over-time': PrevalenceOverTimeComponent;
|
|
1724
1724
|
}
|
|
1725
1725
|
}
|
|
1726
1726
|
|
|
@@ -1728,7 +1728,7 @@ declare global {
|
|
|
1728
1728
|
declare global {
|
|
1729
1729
|
namespace JSX {
|
|
1730
1730
|
interface IntrinsicElements {
|
|
1731
|
-
'gs-
|
|
1731
|
+
'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1732
1732
|
}
|
|
1733
1733
|
}
|
|
1734
1734
|
}
|
|
@@ -1784,7 +1784,7 @@ declare global {
|
|
|
1784
1784
|
|
|
1785
1785
|
declare global {
|
|
1786
1786
|
interface HTMLElementTagNameMap {
|
|
1787
|
-
'gs-
|
|
1787
|
+
'gs-sequences-by-location': SequencesByLocationComponent;
|
|
1788
1788
|
}
|
|
1789
1789
|
}
|
|
1790
1790
|
|
|
@@ -1792,7 +1792,7 @@ declare global {
|
|
|
1792
1792
|
declare global {
|
|
1793
1793
|
namespace JSX {
|
|
1794
1794
|
interface IntrinsicElements {
|
|
1795
|
-
'gs-
|
|
1795
|
+
'gs-sequences-by-location': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1796
1796
|
}
|
|
1797
1797
|
}
|
|
1798
1798
|
}
|
|
@@ -1800,7 +1800,7 @@ declare global {
|
|
|
1800
1800
|
|
|
1801
1801
|
declare global {
|
|
1802
1802
|
interface HTMLElementTagNameMap {
|
|
1803
|
-
'gs-
|
|
1803
|
+
'gs-mutations-over-time': MutationsOverTimeComponent;
|
|
1804
1804
|
}
|
|
1805
1805
|
}
|
|
1806
1806
|
|
|
@@ -1808,7 +1808,7 @@ declare global {
|
|
|
1808
1808
|
declare global {
|
|
1809
1809
|
namespace JSX {
|
|
1810
1810
|
interface IntrinsicElements {
|
|
1811
|
-
'gs-
|
|
1811
|
+
'gs-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1812
1812
|
}
|
|
1813
1813
|
}
|
|
1814
1814
|
}
|
|
@@ -1830,6 +1830,22 @@ declare global {
|
|
|
1830
1830
|
}
|
|
1831
1831
|
|
|
1832
1832
|
|
|
1833
|
+
declare global {
|
|
1834
|
+
interface HTMLElementTagNameMap {
|
|
1835
|
+
'gs-wastewater-mutations-over-time': WastewaterMutationsOverTimeComponent;
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
|
|
1840
|
+
declare global {
|
|
1841
|
+
namespace JSX {
|
|
1842
|
+
interface IntrinsicElements {
|
|
1843
|
+
'gs-wastewater-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
|
|
1833
1849
|
declare global {
|
|
1834
1850
|
interface HTMLElementTagNameMap {
|
|
1835
1851
|
'gs-date-range-filter': DateRangeFilterComponent;
|
|
@@ -1947,22 +1963,6 @@ declare global {
|
|
|
1947
1963
|
}
|
|
1948
1964
|
|
|
1949
1965
|
|
|
1950
|
-
declare global {
|
|
1951
|
-
interface HTMLElementTagNameMap {
|
|
1952
|
-
'gs-wastewater-mutations-over-time': WastewaterMutationsOverTimeComponent;
|
|
1953
|
-
}
|
|
1954
|
-
}
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
declare global {
|
|
1958
|
-
namespace JSX {
|
|
1959
|
-
interface IntrinsicElements {
|
|
1960
|
-
'gs-wastewater-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1961
|
-
}
|
|
1962
|
-
}
|
|
1963
|
-
}
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
1966
|
declare module 'chart.js' {
|
|
1967
1967
|
interface CartesianScaleTypeRegistry {
|
|
1968
1968
|
logit: {
|
package/dist/components.js
CHANGED
|
@@ -15855,7 +15855,22 @@ let LineageFilterComponent = class extends PreactLitAdapter {
|
|
|
15855
15855
|
}
|
|
15856
15856
|
};
|
|
15857
15857
|
__decorateClass$1([
|
|
15858
|
-
n$1({
|
|
15858
|
+
n$1({
|
|
15859
|
+
converter: (value) => {
|
|
15860
|
+
if (value === null) {
|
|
15861
|
+
return value;
|
|
15862
|
+
}
|
|
15863
|
+
try {
|
|
15864
|
+
const parsed = JSON.parse(value);
|
|
15865
|
+
if (Array.isArray(parsed) && parsed.every((v2) => typeof v2 === "string")) {
|
|
15866
|
+
return parsed;
|
|
15867
|
+
}
|
|
15868
|
+
return value;
|
|
15869
|
+
} catch {
|
|
15870
|
+
return value;
|
|
15871
|
+
}
|
|
15872
|
+
}
|
|
15873
|
+
})
|
|
15859
15874
|
], LineageFilterComponent.prototype, "value", 2);
|
|
15860
15875
|
__decorateClass$1([
|
|
15861
15876
|
n$1()
|