@genspectrum/dashboard-components 0.16.4 → 0.17.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.
Files changed (58) hide show
  1. package/custom-elements.json +130 -74
  2. package/dist/{LineageFilterChangedEvent-COWV-Y0k.js → LineageFilterChangedEvent-DkvWdq_G.js} +2 -2
  3. package/dist/LineageFilterChangedEvent-DkvWdq_G.js.map +1 -0
  4. package/dist/components.d.ts +64 -48
  5. package/dist/components.js +858 -242
  6. package/dist/components.js.map +1 -1
  7. package/dist/style.css +391 -12
  8. package/dist/util.d.ts +23 -25
  9. package/dist/util.js +1 -1
  10. package/package.json +2 -1
  11. package/src/preact/components/clearable-select.stories.tsx +75 -0
  12. package/src/preact/components/clearable-select.tsx +76 -0
  13. package/src/preact/components/downshift-combobox.tsx +9 -7
  14. package/src/preact/dateRangeFilter/computeInitialValues.spec.ts +31 -33
  15. package/src/preact/dateRangeFilter/computeInitialValues.ts +2 -15
  16. package/src/preact/dateRangeFilter/date-picker.tsx +66 -0
  17. package/src/preact/dateRangeFilter/date-range-filter.stories.tsx +69 -31
  18. package/src/preact/dateRangeFilter/date-range-filter.tsx +136 -139
  19. package/src/preact/dateRangeFilter/dateRangeOption.ts +11 -11
  20. package/src/preact/mutationsOverTime/mutations-over-time-grid.tsx +133 -84
  21. package/src/preact/mutationsOverTime/mutations-over-time.stories.tsx +46 -16
  22. package/src/preact/mutationsOverTime/mutations-over-time.tsx +3 -0
  23. package/src/preact/shared/WithClassName/WithClassName.ts +1 -0
  24. package/src/preact/shared/icons/DeleteIcon.tsx +3 -0
  25. package/src/preact/shared/stories/expectOptionSelected.tsx +7 -0
  26. package/src/preact/shared/tanstackTable/pagination.tsx +132 -0
  27. package/src/preact/shared/tanstackTable/tanstackTable.tsx +43 -0
  28. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.stories.tsx +2 -1
  29. package/src/preact/wastewater/mutationsOverTime/wastewater-mutations-over-time.tsx +3 -5
  30. package/src/utilEntrypoint.ts +1 -1
  31. package/src/web-components/MutationAnnotations.mdx +33 -0
  32. package/src/web-components/ResizeContainer.mdx +1 -1
  33. package/src/web-components/errorHandling.mdx +1 -1
  34. package/src/web-components/gs-app.ts +2 -2
  35. package/src/web-components/input/gs-date-range-filter.stories.ts +38 -32
  36. package/src/web-components/input/gs-date-range-filter.tsx +8 -2
  37. package/src/web-components/input/gs-lineage-filter.tsx +1 -1
  38. package/src/web-components/input/gs-location-filter.tsx +1 -1
  39. package/src/web-components/input/gs-mutation-filter.tsx +1 -1
  40. package/src/web-components/input/gs-text-filter.tsx +1 -1
  41. package/src/web-components/visualization/gs-aggregate.tsx +2 -2
  42. package/src/web-components/visualization/gs-mutation-comparison.tsx +5 -2
  43. package/src/web-components/visualization/gs-mutations-over-time.spec-d.ts +39 -0
  44. package/src/web-components/visualization/gs-mutations-over-time.stories.ts +4 -0
  45. package/src/web-components/visualization/gs-mutations-over-time.tsx +13 -33
  46. package/src/web-components/visualization/gs-mutations.tsx +5 -2
  47. package/src/web-components/visualization/gs-number-sequences-over-time.tsx +2 -2
  48. package/src/web-components/visualization/gs-prevalence-over-time.tsx +2 -2
  49. package/src/web-components/visualization/gs-relative-growth-advantage.tsx +2 -2
  50. package/src/web-components/visualization/gs-sequences-by-location.tsx +2 -2
  51. package/src/web-components/visualization/gs-statistics.tsx +2 -2
  52. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.spec-d.ts +24 -0
  53. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.stories.ts +3 -3
  54. package/src/web-components/wastewaterVisualization/gs-wastewater-mutations-over-time.tsx +7 -38
  55. package/standalone-bundle/dashboard-components.js +18384 -16486
  56. package/standalone-bundle/dashboard-components.js.map +1 -1
  57. package/standalone-bundle/style.css +1 -1
  58. package/dist/LineageFilterChangedEvent-COWV-Y0k.js.map +0 -1
@@ -14,7 +14,7 @@ const codeExample = String.raw`
14
14
  sequenceType='nucleotide'
15
15
  width='100%'
16
16
  height='700px'
17
- maxNumberOfGridRows='100'
17
+ pageSizes='[5,10]'
18
18
  >
19
19
  <span slot="infoText">Some info text</span>
20
20
  </gs-wastewater-mutations-over-time>`;
@@ -37,7 +37,7 @@ const meta: Meta<WastewaterMutationsOverTimeProps & { infoText: string }> = {
37
37
  width: '100%',
38
38
  height: undefined,
39
39
  infoText: 'Some info text',
40
- maxNumberOfGridRows: 100,
40
+ pageSizes: [10, 20, 30, 40, 50],
41
41
  },
42
42
  parameters: withComponentDocs({
43
43
  componentDocs: {
@@ -70,7 +70,7 @@ export const WastewaterMutationsOverTime: StoryObj<WastewaterMutationsOverTimePr
70
70
  .sequenceType=${args.sequenceType}
71
71
  .width=${args.width}
72
72
  .height=${args.height}
73
- .maxNumberOfGridRows=${args.maxNumberOfGridRows}
73
+ .pageSizes=${args.pageSizes}
74
74
  >
75
75
  <span slot="infoText">${args.infoText}</span>
76
76
  </gs-wastewater-mutations-over-time>
@@ -3,11 +3,7 @@ import { customElement, property } from 'lit/decorators.js';
3
3
  import { type DetailedHTMLProps, type HTMLAttributes } from 'react';
4
4
 
5
5
  import { MutationAnnotationsContextProvider } from '../../preact/MutationAnnotationsContext';
6
- import {
7
- WastewaterMutationsOverTime,
8
- type WastewaterMutationsOverTimeProps,
9
- } from '../../preact/wastewater/mutationsOverTime/wastewater-mutations-over-time';
10
- import { type Equals, type Expect } from '../../utils/typeAssertions';
6
+ import { WastewaterMutationsOverTime } from '../../preact/wastewater/mutationsOverTime/wastewater-mutations-over-time';
11
7
  import { PreactLitAdapterWithGridJsStyles } from '../PreactLitAdapterWithGridJsStyles';
12
8
  import { type MutationAnnotations, mutationAnnotationsContext } from '../mutation-annotations-context';
13
9
 
@@ -55,7 +51,7 @@ export class WastewaterMutationsOverTimeComponent extends PreactLitAdapterWithGr
55
51
  /**
56
52
  * The width of the component.
57
53
  *
58
- * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
54
+ * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-size-of-components--docs for more information.
59
55
  */
60
56
  @property({ type: String })
61
57
  width: string = '100%';
@@ -63,16 +59,16 @@ export class WastewaterMutationsOverTimeComponent extends PreactLitAdapterWithGr
63
59
  /**
64
60
  * The height of the component.
65
61
  *
66
- * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/components-size-of-components--docs for more information.
62
+ * Visit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-size-of-components--docs for more information.
67
63
  */
68
64
  @property({ type: String })
69
65
  height: string | undefined = undefined;
70
66
 
71
67
  /**
72
- * The maximum number of grid rows to display.
68
+ * The number of rows per page, which can be selected by the user.
73
69
  */
74
- @property({ type: Number })
75
- maxNumberOfGridRows: number = 100;
70
+ @property({ type: Array })
71
+ pageSizes: number[] | number = [10, 20, 30, 40, 50];
76
72
 
77
73
  /**
78
74
  * @internal
@@ -88,7 +84,7 @@ export class WastewaterMutationsOverTimeComponent extends PreactLitAdapterWithGr
88
84
  sequenceType={this.sequenceType}
89
85
  width={this.width}
90
86
  height={this.height}
91
- maxNumberOfGridRows={this.maxNumberOfGridRows}
87
+ pageSizes={this.pageSizes}
92
88
  />
93
89
  </MutationAnnotationsContextProvider>
94
90
  );
@@ -109,30 +105,3 @@ declare global {
109
105
  }
110
106
  }
111
107
  }
112
-
113
- /* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
114
- type LapisFilterMatches = Expect<
115
- Equals<
116
- typeof WastewaterMutationsOverTimeComponent.prototype.lapisFilter,
117
- WastewaterMutationsOverTimeProps['lapisFilter']
118
- >
119
- >;
120
- type SequenceTypeMatches = Expect<
121
- Equals<
122
- typeof WastewaterMutationsOverTimeComponent.prototype.sequenceType,
123
- WastewaterMutationsOverTimeProps['sequenceType']
124
- >
125
- >;
126
- type WidthMatches = Expect<
127
- Equals<typeof WastewaterMutationsOverTimeComponent.prototype.width, WastewaterMutationsOverTimeProps['width']>
128
- >;
129
- type HeightMatches = Expect<
130
- Equals<typeof WastewaterMutationsOverTimeComponent.prototype.height, WastewaterMutationsOverTimeProps['height']>
131
- >;
132
- type MaxNumberOfGridRowsMatches = Expect<
133
- Equals<
134
- typeof WastewaterMutationsOverTimeComponent.prototype.maxNumberOfGridRows,
135
- WastewaterMutationsOverTimeProps['maxNumberOfGridRows']
136
- >
137
- >;
138
- /* eslint-enable @typescript-eslint/no-unused-vars, no-unused-vars */