@genspectrum/dashboard-components 0.11.7 → 0.12.0
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 -12
- package/dist/{dateRangeOption-Bh2p78z0.js → LocationChangedEvent-CORvQvXv.js} +11 -1
- package/dist/LocationChangedEvent-CORvQvXv.js.map +1 -0
- package/dist/components.d.ts +45 -51
- package/dist/components.js +3880 -613
- package/dist/components.js.map +1 -1
- package/dist/style.css +151 -4
- package/dist/util.d.ts +50 -44
- 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/mutationFilter/mutation-filter-info.tsx +73 -10
- 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/standalone-bundle/dashboard-components.js +10956 -8607
- package/standalone-bundle/dashboard-components.js.map +1 -1
- package/standalone-bundle/style.css +1 -1
- package/dist/dateRangeOption-Bh2p78z0.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { customElement, property } from 'lit/decorators.js';
|
|
2
2
|
import type { DetailedHTMLProps, HTMLAttributes } from 'react';
|
|
3
3
|
|
|
4
|
+
import { type LocationChangedEvent } from '../../preact/locationFilter/LocationChangedEvent';
|
|
4
5
|
import { LocationFilter, type LocationFilterProps } from '../../preact/locationFilter/location-filter';
|
|
5
6
|
import type { Equals, Expect } from '../../utils/typeAssertions';
|
|
6
7
|
import { PreactLitAdapter } from '../PreactLitAdapter';
|
|
@@ -14,11 +15,6 @@ import { PreactLitAdapter } from '../PreactLitAdapter';
|
|
|
14
15
|
* The component retrieves a list of all possible values for these fields from the Lapis instance.
|
|
15
16
|
* This list is then utilized to display autocomplete suggestions and to validate the input.
|
|
16
17
|
*
|
|
17
|
-
* Given `fields` are `['field1', 'field2', ..., 'fieldN']`,
|
|
18
|
-
* then valid values for the location filter must be in the form `valueForField1 / valueForField2 / ... / valueForFieldK`,
|
|
19
|
-
* where `1 <= K <= N`.
|
|
20
|
-
* Values for the fields `i > K` are considered `undefined`.
|
|
21
|
-
*
|
|
22
18
|
* @fires {CustomEvent<Record<string, string>>} gs-location-changed
|
|
23
19
|
* Fired when a value from the datalist is selected or when a valid value is typed into the field.
|
|
24
20
|
* The `details` of this event contain an object with all `fields` as keys
|
|
@@ -37,10 +33,9 @@ import { PreactLitAdapter } from '../PreactLitAdapter';
|
|
|
37
33
|
export class LocationFilterComponent extends PreactLitAdapter {
|
|
38
34
|
/**
|
|
39
35
|
* The initial value to use for this location filter.
|
|
40
|
-
* Must be of the form `valueForField1 / valueForField2 / ... / valueForFieldN`.
|
|
41
36
|
*/
|
|
42
|
-
@property()
|
|
43
|
-
|
|
37
|
+
@property({ type: Object })
|
|
38
|
+
value: Record<string, string | null | undefined> | undefined = undefined;
|
|
44
39
|
|
|
45
40
|
/**
|
|
46
41
|
* Required.
|
|
@@ -70,7 +65,7 @@ export class LocationFilterComponent extends PreactLitAdapter {
|
|
|
70
65
|
override render() {
|
|
71
66
|
return (
|
|
72
67
|
<LocationFilter
|
|
73
|
-
|
|
68
|
+
value={this.value}
|
|
74
69
|
fields={this.fields}
|
|
75
70
|
width={this.width}
|
|
76
71
|
placeholderText={this.placeholderText}
|
|
@@ -85,7 +80,7 @@ declare global {
|
|
|
85
80
|
}
|
|
86
81
|
|
|
87
82
|
interface HTMLElementEventMap {
|
|
88
|
-
'gs-location-changed':
|
|
83
|
+
'gs-location-changed': LocationChangedEvent;
|
|
89
84
|
}
|
|
90
85
|
}
|
|
91
86
|
|
|
@@ -99,9 +94,7 @@ declare global {
|
|
|
99
94
|
}
|
|
100
95
|
|
|
101
96
|
/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
|
|
102
|
-
type InitialValueMatches = Expect<
|
|
103
|
-
Equals<typeof LocationFilterComponent.prototype.initialValue, LocationFilterProps['initialValue']>
|
|
104
|
-
>;
|
|
97
|
+
type InitialValueMatches = Expect<Equals<typeof LocationFilterComponent.prototype.value, LocationFilterProps['value']>>;
|
|
105
98
|
type FieldsMatches = Expect<Equals<typeof LocationFilterComponent.prototype.fields, LocationFilterProps['fields']>>;
|
|
106
99
|
type PlaceholderTextMatches = Expect<
|
|
107
100
|
Equals<typeof LocationFilterComponent.prototype.placeholderText, LocationFilterProps['placeholderText']>
|