@genspectrum/dashboard-components 0.6.14 → 0.6.15
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 +12 -6
- package/dist/dashboard-components.js +97 -53
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +27 -9
- package/dist/style.css +2 -2
- package/package.json +3 -3
- package/src/index.ts +8 -0
- package/src/lapisApi/lapisApi.ts +15 -7
- package/src/preact/components/color-scale-selector-dropdown.stories.tsx +1 -1
- package/src/preact/components/error-boundary.stories.tsx +21 -4
- package/src/preact/components/error-display.stories.tsx +20 -2
- package/src/preact/components/error-display.tsx +64 -10
- package/src/preact/components/info.stories.tsx +5 -5
- package/src/preact/components/info.tsx +1 -3
- package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +2 -3
- package/src/preact/lineageFilter/lineage-filter.stories.tsx +2 -3
- package/src/preact/locationFilter/fetchAutocompletionList.ts +1 -14
- package/src/preact/locationFilter/location-filter.stories.tsx +2 -3
- package/src/preact/mutationFilter/mutation-filter.stories.tsx +2 -3
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +1 -1
- package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +1 -1
- package/src/preact/shared/floating-ui/hooks.ts +1 -1
- package/src/preact/textInput/text-input.stories.tsx +2 -3
- package/src/web-components/app.stories.ts +0 -2
- package/src/web-components/errorHandling.mdx +8 -0
- package/src/web-components/input/gs-date-range-selector.stories.ts +2 -3
- package/src/web-components/input/gs-lineage-filter.stories.ts +2 -3
- package/src/web-components/input/gs-location-filter.stories.ts +2 -3
- package/src/web-components/input/gs-mutation-filter.stories.ts +2 -3
- package/src/web-components/input/gs-text-input.stories.ts +2 -3
- package/standalone-bundle/dashboard-components.js +1719 -1686
- package/standalone-bundle/dashboard-components.js.map +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { consume } from '@lit/context';
|
|
2
|
-
import { withActions } from '@storybook/addon-actions/decorator';
|
|
3
2
|
import { expect, waitFor, within } from '@storybook/test';
|
|
4
3
|
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
5
4
|
import { html, LitElement } from 'lit';
|
|
@@ -30,7 +29,6 @@ const meta: Meta = {
|
|
|
30
29
|
codeExample,
|
|
31
30
|
},
|
|
32
31
|
}),
|
|
33
|
-
decorators: [withActions],
|
|
34
32
|
tags: ['autodocs'],
|
|
35
33
|
};
|
|
36
34
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
<Meta title='Components/Error Handling' />
|
|
4
|
+
|
|
5
|
+
# Error Handling
|
|
6
|
+
|
|
7
|
+
All components dispatch a `gs-error` event of type `ErrorEvent` when an error occurs.
|
|
8
|
+
The event contains an `error` property that holds the `Error` object.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { withActions } from '@storybook/addon-actions/decorator';
|
|
2
1
|
import { expect, waitFor } from '@storybook/test';
|
|
3
2
|
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
4
3
|
import { html } from 'lit';
|
|
5
4
|
|
|
6
5
|
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
|
|
6
|
+
import { previewHandles } from '../../../.storybook/preview';
|
|
7
7
|
import { LAPIS_URL } from '../../constants';
|
|
8
8
|
import { type DateRangeSelectorProps } from '../../preact/dateRangeSelector/date-range-selector';
|
|
9
9
|
import './gs-date-range-selector';
|
|
@@ -36,7 +36,7 @@ const meta: Meta<Required<DateRangeSelectorProps<'CustomDateRange'>>> = {
|
|
|
36
36
|
component: 'gs-date-range-selector',
|
|
37
37
|
parameters: withComponentDocs({
|
|
38
38
|
actions: {
|
|
39
|
-
handles: ['gs-date-range-changed'],
|
|
39
|
+
handles: ['gs-date-range-changed', ...previewHandles],
|
|
40
40
|
},
|
|
41
41
|
fetchMock: {},
|
|
42
42
|
componentDocs: {
|
|
@@ -87,7 +87,6 @@ const meta: Meta<Required<DateRangeSelectorProps<'CustomDateRange'>>> = {
|
|
|
87
87
|
initialDateFrom: '',
|
|
88
88
|
initialDateTo: '',
|
|
89
89
|
},
|
|
90
|
-
decorators: [withActions],
|
|
91
90
|
tags: ['autodocs'],
|
|
92
91
|
};
|
|
93
92
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { withActions } from '@storybook/addon-actions/decorator';
|
|
2
1
|
import { expect, fn, userEvent, waitFor } from '@storybook/test';
|
|
3
2
|
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
4
3
|
import { html } from 'lit';
|
|
5
4
|
|
|
6
5
|
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
|
|
6
|
+
import { previewHandles } from '../../../.storybook/preview';
|
|
7
7
|
import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
|
|
8
8
|
import '../app';
|
|
9
9
|
import './gs-lineage-filter';
|
|
@@ -24,7 +24,7 @@ const meta: Meta<Required<LineageFilterProps>> = {
|
|
|
24
24
|
component: 'gs-lineage-filter',
|
|
25
25
|
parameters: withComponentDocs({
|
|
26
26
|
actions: {
|
|
27
|
-
handles: ['gs-lineage-filter-changed'],
|
|
27
|
+
handles: ['gs-lineage-filter-changed', ...previewHandles],
|
|
28
28
|
},
|
|
29
29
|
fetchMock: {
|
|
30
30
|
mocks: [
|
|
@@ -49,7 +49,6 @@ const meta: Meta<Required<LineageFilterProps>> = {
|
|
|
49
49
|
codeExample,
|
|
50
50
|
},
|
|
51
51
|
}),
|
|
52
|
-
decorators: [withActions],
|
|
53
52
|
tags: ['autodocs'],
|
|
54
53
|
};
|
|
55
54
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { withActions } from '@storybook/addon-actions/decorator';
|
|
2
1
|
import { expect, fn, userEvent, waitFor } from '@storybook/test';
|
|
3
2
|
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
4
3
|
import { html } from 'lit';
|
|
5
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
5
|
|
|
7
6
|
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
|
|
7
|
+
import { previewHandles } from '../../../.storybook/preview';
|
|
8
8
|
import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
|
|
9
9
|
import '../app';
|
|
10
10
|
import './gs-location-filter';
|
|
@@ -25,7 +25,7 @@ const meta: Meta = {
|
|
|
25
25
|
component: 'gs-location-filter',
|
|
26
26
|
parameters: withComponentDocs({
|
|
27
27
|
actions: {
|
|
28
|
-
handles: ['gs-location-changed'],
|
|
28
|
+
handles: ['gs-location-changed', ...previewHandles],
|
|
29
29
|
},
|
|
30
30
|
componentDocs: {
|
|
31
31
|
opensShadowDom: true,
|
|
@@ -55,7 +55,6 @@ const meta: Meta = {
|
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
|
-
decorators: [withActions],
|
|
59
58
|
tags: ['autodocs'],
|
|
60
59
|
};
|
|
61
60
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { withActions } from '@storybook/addon-actions/decorator';
|
|
2
1
|
import { expect, fn, userEvent, waitFor } from '@storybook/test';
|
|
3
2
|
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
4
3
|
import { html } from 'lit';
|
|
5
4
|
|
|
6
5
|
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
|
|
6
|
+
import { previewHandles } from '../../../.storybook/preview';
|
|
7
7
|
import { LAPIS_URL, REFERENCE_GENOME_ENDPOINT } from '../../constants';
|
|
8
8
|
import '../app';
|
|
9
9
|
import { type MutationFilterProps } from '../../preact/mutationFilter/mutation-filter';
|
|
@@ -21,7 +21,7 @@ const meta: Meta<MutationFilterProps> = {
|
|
|
21
21
|
component: 'gs-mutation-filter',
|
|
22
22
|
parameters: withComponentDocs({
|
|
23
23
|
actions: {
|
|
24
|
-
handles: ['gs-mutation-filter-changed', 'gs-mutation-filter-on-blur'],
|
|
24
|
+
handles: ['gs-mutation-filter-changed', 'gs-mutation-filter-on-blur', ...previewHandles],
|
|
25
25
|
},
|
|
26
26
|
fetchMock: {},
|
|
27
27
|
componentDocs: {
|
|
@@ -38,7 +38,6 @@ const meta: Meta<MutationFilterProps> = {
|
|
|
38
38
|
},
|
|
39
39
|
width: { control: 'text' },
|
|
40
40
|
},
|
|
41
|
-
decorators: [withActions],
|
|
42
41
|
tags: ['autodocs'],
|
|
43
42
|
};
|
|
44
43
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { withActions } from '@storybook/addon-actions/decorator';
|
|
2
1
|
import { expect, fn, userEvent, waitFor } from '@storybook/test';
|
|
3
2
|
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
4
3
|
import { html } from 'lit';
|
|
5
4
|
|
|
6
5
|
import { withComponentDocs } from '../../../.storybook/ComponentDocsBlock';
|
|
6
|
+
import { previewHandles } from '../../../.storybook/preview';
|
|
7
7
|
import { AGGREGATED_ENDPOINT, LAPIS_URL } from '../../constants';
|
|
8
8
|
import '../app';
|
|
9
9
|
import './gs-text-input';
|
|
@@ -24,7 +24,7 @@ const meta: Meta<Required<TextInputProps>> = {
|
|
|
24
24
|
component: 'gs-text-input',
|
|
25
25
|
parameters: withComponentDocs({
|
|
26
26
|
actions: {
|
|
27
|
-
handles: ['gs-text-input-changed'],
|
|
27
|
+
handles: ['gs-text-input-changed', ...previewHandles],
|
|
28
28
|
},
|
|
29
29
|
fetchMock: {
|
|
30
30
|
mocks: [
|
|
@@ -71,7 +71,6 @@ const meta: Meta<Required<TextInputProps>> = {
|
|
|
71
71
|
},
|
|
72
72
|
},
|
|
73
73
|
},
|
|
74
|
-
decorators: [withActions],
|
|
75
74
|
tags: ['autodocs'],
|
|
76
75
|
};
|
|
77
76
|
|