@genspectrum/dashboard-components 0.19.3 → 0.19.4
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 +223 -0
- package/dist/{LineageFilterChangedEvent-b0iuroUL.js → LineageFilterChangedEvent-GgkxoF3X.js} +4 -2
- package/dist/{LineageFilterChangedEvent-b0iuroUL.js.map → LineageFilterChangedEvent-GgkxoF3X.js.map} +1 -1
- package/dist/components.d.ts +146 -29
- package/dist/components.js +555 -234
- package/dist/components.js.map +1 -1
- package/dist/util.d.ts +51 -29
- package/dist/util.js +1 -1
- package/package.json +1 -1
- package/src/preact/components/min-max-range-slider.tsx +19 -4
- package/src/preact/dateRangeFilter/date-range-filter.stories.tsx +4 -1
- package/src/preact/genomeViewer/loadGff3.spec.ts +1 -1
- package/src/preact/genomeViewer/loadGff3.ts +12 -6
- package/src/preact/numberRangeFilter/NumberRangeFilterChangedEvent.ts +31 -0
- package/src/preact/numberRangeFilter/number-range-filter.stories.tsx +383 -0
- package/src/preact/numberRangeFilter/number-range-filter.tsx +159 -0
- package/src/preact/numberRangeFilter/useSelectedRangeReducer.ts +137 -0
- package/src/utils/gsEventNames.ts +2 -0
- package/src/web-components/input/gs-number-range-filter.spec.ts +27 -0
- package/src/web-components/input/gs-number-range-filter.stories.ts +96 -0
- package/src/web-components/input/gs-number-range-filter.tsx +148 -0
- package/src/web-components/input/gs-text-filter.stories.ts +2 -2
- package/src/web-components/input/index.ts +1 -0
- package/standalone-bundle/dashboard-components.js +6921 -6640
- package/standalone-bundle/dashboard-components.js.map +1 -1
package/custom-elements.json
CHANGED
|
@@ -1204,6 +1204,221 @@
|
|
|
1204
1204
|
}
|
|
1205
1205
|
]
|
|
1206
1206
|
},
|
|
1207
|
+
{
|
|
1208
|
+
"kind": "javascript-module",
|
|
1209
|
+
"path": "src/web-components/input/gs-number-range-filter.spec.ts",
|
|
1210
|
+
"declarations": [],
|
|
1211
|
+
"exports": []
|
|
1212
|
+
},
|
|
1213
|
+
{
|
|
1214
|
+
"kind": "javascript-module",
|
|
1215
|
+
"path": "src/web-components/input/gs-number-range-filter.stories.ts",
|
|
1216
|
+
"declarations": [
|
|
1217
|
+
{
|
|
1218
|
+
"kind": "variable",
|
|
1219
|
+
"name": "meta",
|
|
1220
|
+
"type": {
|
|
1221
|
+
"text": "Meta<NumberRangeFilterProps>"
|
|
1222
|
+
},
|
|
1223
|
+
"default": "{ title: 'Input/Number range filter', component: 'gs-number-range-filter', parameters: withComponentDocs({ actions: { handles: [gsEventNames.numberRangeFilterChanged, gsEventNames.numberRangeValueChanged], }, componentDocs: { opensShadowDom: true, expectsChildren: false, codeExample, }, }), tags: ['autodocs'], argTypes: { value: { control: { type: 'object', }, }, lapisField: { control: { type: 'text', }, }, sliderMin: { control: { type: 'number', }, }, sliderMax: { control: { type: 'number', }, }, sliderStep: { control: { type: 'number', }, }, width: { control: { type: 'text', }, }, }, }"
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
"kind": "variable",
|
|
1227
|
+
"name": "Default",
|
|
1228
|
+
"type": {
|
|
1229
|
+
"text": "StoryObj<NumberRangeFilterProps>"
|
|
1230
|
+
},
|
|
1231
|
+
"default": "{ render: (args) => { return html` <gs-app lapis=\"${LAPIS_URL}\"> <gs-number-range-filter .value=${args.value} .lapisField=${args.lapisField} .sliderMin=${args.sliderMin} .sliderMax=${args.sliderMax} .sliderStep=${args.sliderStep} .width=${args.width} > </gs-number-range-filter> </gs-app> `; }, args: { lapisField: 'age', value: { min: 10, max: 90 }, sliderMin: 0, sliderMax: 100, sliderStep: 0.1, width: '100%', }, }"
|
|
1232
|
+
}
|
|
1233
|
+
],
|
|
1234
|
+
"exports": [
|
|
1235
|
+
{
|
|
1236
|
+
"kind": "js",
|
|
1237
|
+
"name": "default",
|
|
1238
|
+
"declaration": {
|
|
1239
|
+
"name": "meta",
|
|
1240
|
+
"module": "src/web-components/input/gs-number-range-filter.stories.ts"
|
|
1241
|
+
}
|
|
1242
|
+
},
|
|
1243
|
+
{
|
|
1244
|
+
"kind": "js",
|
|
1245
|
+
"name": "Default",
|
|
1246
|
+
"declaration": {
|
|
1247
|
+
"name": "Default",
|
|
1248
|
+
"module": "src/web-components/input/gs-number-range-filter.stories.ts"
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
]
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
"kind": "javascript-module",
|
|
1255
|
+
"path": "src/web-components/input/gs-number-range-filter.tsx",
|
|
1256
|
+
"declarations": [
|
|
1257
|
+
{
|
|
1258
|
+
"kind": "class",
|
|
1259
|
+
"description": "\n## Context\n\nThis component lets the user specify filters for a `float` or `int` field in LAPIS.\nIt consists of two text input fields and a slider.\n\nThe slider must be restricted to a certain range.\nUsers can however still enter values outside of this range in the text input fields.",
|
|
1260
|
+
"name": "NumberRangeFilterComponent",
|
|
1261
|
+
"members": [
|
|
1262
|
+
{
|
|
1263
|
+
"kind": "field",
|
|
1264
|
+
"name": "value",
|
|
1265
|
+
"type": {
|
|
1266
|
+
"text": "{ min?: number; max?: number }"
|
|
1267
|
+
},
|
|
1268
|
+
"default": "{}",
|
|
1269
|
+
"description": "The value to use for this number filter.\n\nMust be of the form:\n```\n{\n [`${lapisField}From`]: number | undefined\n [`${lapisField}To`]: number | undefined\n}\n```\n\nThis is the same format that the `gs-number-value-changed` event will emit.",
|
|
1270
|
+
"attribute": "value"
|
|
1271
|
+
},
|
|
1272
|
+
{
|
|
1273
|
+
"kind": "field",
|
|
1274
|
+
"name": "lapisField",
|
|
1275
|
+
"type": {
|
|
1276
|
+
"text": "string"
|
|
1277
|
+
},
|
|
1278
|
+
"default": "''",
|
|
1279
|
+
"description": "Required.\n\nThe LAPIS field name to use for this text filter.\nThe field must exist on this LAPIS instance.",
|
|
1280
|
+
"attribute": "lapisField"
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
"kind": "field",
|
|
1284
|
+
"name": "sliderMin",
|
|
1285
|
+
"type": {
|
|
1286
|
+
"text": "number"
|
|
1287
|
+
},
|
|
1288
|
+
"default": "0",
|
|
1289
|
+
"description": "The `min` value to use for the slider.",
|
|
1290
|
+
"attribute": "sliderMin"
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
"kind": "field",
|
|
1294
|
+
"name": "sliderMax",
|
|
1295
|
+
"type": {
|
|
1296
|
+
"text": "number"
|
|
1297
|
+
},
|
|
1298
|
+
"default": "100",
|
|
1299
|
+
"description": "The `max` value to use for the slider.",
|
|
1300
|
+
"attribute": "sliderMax"
|
|
1301
|
+
},
|
|
1302
|
+
{
|
|
1303
|
+
"kind": "field",
|
|
1304
|
+
"name": "sliderStep",
|
|
1305
|
+
"type": {
|
|
1306
|
+
"text": "number"
|
|
1307
|
+
},
|
|
1308
|
+
"default": "1",
|
|
1309
|
+
"description": "The `step` value to use for the slider.\n\nThis attribute has no effect on the text input.",
|
|
1310
|
+
"attribute": "sliderStep"
|
|
1311
|
+
},
|
|
1312
|
+
{
|
|
1313
|
+
"kind": "field",
|
|
1314
|
+
"name": "width",
|
|
1315
|
+
"type": {
|
|
1316
|
+
"text": "string"
|
|
1317
|
+
},
|
|
1318
|
+
"default": "'100%'",
|
|
1319
|
+
"description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-size-of-components--docs for more information.",
|
|
1320
|
+
"attribute": "width"
|
|
1321
|
+
}
|
|
1322
|
+
],
|
|
1323
|
+
"events": [
|
|
1324
|
+
{
|
|
1325
|
+
"type": {
|
|
1326
|
+
"text": "CustomEvent<Record<string, string | undefined>>"
|
|
1327
|
+
},
|
|
1328
|
+
"description": "Fired when the slider is released, `onBlur` on the input fields after the user has typed a valid range in the input fields, or when one of the input fields is cleared. The `details` of this event contain an object with `${lapisField}From` and `${lapisField}To` as keys. The values are the numbers from the input fields or `undefined` if the input field is empty: ``` { [`${lapisField}From`]: number | undefined [`${lapisField}To`]: number | undefined } ``` Example: ``` { ageFrom: 18, ageTo: undefined } ```",
|
|
1329
|
+
"name": "gs-number-range-filter-changed"
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
"type": {
|
|
1333
|
+
"text": "CustomEvent<Record<string, string | undefined>>"
|
|
1334
|
+
},
|
|
1335
|
+
"description": "Similar to the `gs-number-range-filter-changed` event, but contains an `event.detail` that has a fixed format: ``` { min: number | undefined max: number | undefined } ``` This event should be used when you want to control this component externally. The `event.detail` can be used as the value of the component. Example: ``` { min: 18, max: undefined } ```",
|
|
1336
|
+
"name": "gs-number-range-value-changed"
|
|
1337
|
+
}
|
|
1338
|
+
],
|
|
1339
|
+
"attributes": [
|
|
1340
|
+
{
|
|
1341
|
+
"name": "value",
|
|
1342
|
+
"type": {
|
|
1343
|
+
"text": "{ min?: number; max?: number }"
|
|
1344
|
+
},
|
|
1345
|
+
"default": "{}",
|
|
1346
|
+
"description": "The value to use for this number filter.\n\nMust be of the form:\n```\n{\n [`${lapisField}From`]: number | undefined\n [`${lapisField}To`]: number | undefined\n}\n```\n\nThis is the same format that the `gs-number-value-changed` event will emit.",
|
|
1347
|
+
"fieldName": "value"
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
"name": "lapisField",
|
|
1351
|
+
"type": {
|
|
1352
|
+
"text": "string"
|
|
1353
|
+
},
|
|
1354
|
+
"default": "''",
|
|
1355
|
+
"description": "Required.\n\nThe LAPIS field name to use for this text filter.\nThe field must exist on this LAPIS instance.",
|
|
1356
|
+
"fieldName": "lapisField"
|
|
1357
|
+
},
|
|
1358
|
+
{
|
|
1359
|
+
"name": "sliderMin",
|
|
1360
|
+
"type": {
|
|
1361
|
+
"text": "number"
|
|
1362
|
+
},
|
|
1363
|
+
"default": "0",
|
|
1364
|
+
"description": "The `min` value to use for the slider.",
|
|
1365
|
+
"fieldName": "sliderMin"
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
"name": "sliderMax",
|
|
1369
|
+
"type": {
|
|
1370
|
+
"text": "number"
|
|
1371
|
+
},
|
|
1372
|
+
"default": "100",
|
|
1373
|
+
"description": "The `max` value to use for the slider.",
|
|
1374
|
+
"fieldName": "sliderMax"
|
|
1375
|
+
},
|
|
1376
|
+
{
|
|
1377
|
+
"name": "sliderStep",
|
|
1378
|
+
"type": {
|
|
1379
|
+
"text": "number"
|
|
1380
|
+
},
|
|
1381
|
+
"default": "1",
|
|
1382
|
+
"description": "The `step` value to use for the slider.\n\nThis attribute has no effect on the text input.",
|
|
1383
|
+
"fieldName": "sliderStep"
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
"name": "width",
|
|
1387
|
+
"type": {
|
|
1388
|
+
"text": "string"
|
|
1389
|
+
},
|
|
1390
|
+
"default": "'100%'",
|
|
1391
|
+
"description": "The width of the component.\n\nVisit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-size-of-components--docs for more information.",
|
|
1392
|
+
"fieldName": "width"
|
|
1393
|
+
}
|
|
1394
|
+
],
|
|
1395
|
+
"superclass": {
|
|
1396
|
+
"name": "PreactLitAdapter",
|
|
1397
|
+
"module": "/src/web-components/PreactLitAdapter"
|
|
1398
|
+
},
|
|
1399
|
+
"tagName": "gs-number-range-filter",
|
|
1400
|
+
"customElement": true
|
|
1401
|
+
}
|
|
1402
|
+
],
|
|
1403
|
+
"exports": [
|
|
1404
|
+
{
|
|
1405
|
+
"kind": "js",
|
|
1406
|
+
"name": "NumberRangeFilterComponent",
|
|
1407
|
+
"declaration": {
|
|
1408
|
+
"name": "NumberRangeFilterComponent",
|
|
1409
|
+
"module": "src/web-components/input/gs-number-range-filter.tsx"
|
|
1410
|
+
}
|
|
1411
|
+
},
|
|
1412
|
+
{
|
|
1413
|
+
"kind": "custom-element-definition",
|
|
1414
|
+
"name": "gs-number-range-filter",
|
|
1415
|
+
"declaration": {
|
|
1416
|
+
"name": "NumberRangeFilterComponent",
|
|
1417
|
+
"module": "src/web-components/input/gs-number-range-filter.tsx"
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
]
|
|
1421
|
+
},
|
|
1207
1422
|
{
|
|
1208
1423
|
"kind": "javascript-module",
|
|
1209
1424
|
"path": "src/web-components/input/gs-text-filter.stories.ts",
|
|
@@ -1447,6 +1662,14 @@
|
|
|
1447
1662
|
"name": "LineageFilterComponent",
|
|
1448
1663
|
"module": "./gs-lineage-filter"
|
|
1449
1664
|
}
|
|
1665
|
+
},
|
|
1666
|
+
{
|
|
1667
|
+
"kind": "js",
|
|
1668
|
+
"name": "NumberRangeFilterComponent",
|
|
1669
|
+
"declaration": {
|
|
1670
|
+
"name": "NumberRangeFilterComponent",
|
|
1671
|
+
"module": "./gs-number-range-filter"
|
|
1672
|
+
}
|
|
1450
1673
|
}
|
|
1451
1674
|
]
|
|
1452
1675
|
},
|
package/dist/{LineageFilterChangedEvent-b0iuroUL.js → LineageFilterChangedEvent-GgkxoF3X.js}
RENAMED
|
@@ -6,7 +6,9 @@ const gsEventNames = {
|
|
|
6
6
|
mutationFilterChanged: "gs-mutation-filter-changed",
|
|
7
7
|
lineageFilterChanged: "gs-lineage-filter-changed",
|
|
8
8
|
locationChanged: "gs-location-changed",
|
|
9
|
-
textFilterChanged: "gs-text-filter-changed"
|
|
9
|
+
textFilterChanged: "gs-text-filter-changed",
|
|
10
|
+
numberRangeFilterChanged: "gs-number-range-filter-changed",
|
|
11
|
+
numberRangeValueChanged: "gs-number-range-value-changed"
|
|
10
12
|
};
|
|
11
13
|
const mutationsFilterSchema = z.object({
|
|
12
14
|
nucleotideMutations: z.array(z.string()),
|
|
@@ -158,4 +160,4 @@ export {
|
|
|
158
160
|
temporalGranularitySchema as t,
|
|
159
161
|
views as v
|
|
160
162
|
};
|
|
161
|
-
//# sourceMappingURL=LineageFilterChangedEvent-
|
|
163
|
+
//# sourceMappingURL=LineageFilterChangedEvent-GgkxoF3X.js.map
|
package/dist/{LineageFilterChangedEvent-b0iuroUL.js.map → LineageFilterChangedEvent-GgkxoF3X.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineageFilterChangedEvent-b0iuroUL.js","sources":["../src/utils/gsEventNames.ts","../src/types.ts","../src/preact/dateRangeFilter/dateConversion.ts","../src/preact/dateRangeFilter/dateRangeOption.ts","../src/preact/locationFilter/LocationChangedEvent.ts","../src/preact/textFilter/TextFilterChangedEvent.ts","../src/preact/lineageFilter/LineageFilterChangedEvent.ts"],"sourcesContent":["export const gsEventNames = {\n error: 'gs-error',\n dateRangeFilterChanged: 'gs-date-range-filter-changed',\n dateRangeOptionChanged: 'gs-date-range-option-changed',\n mutationFilterChanged: 'gs-mutation-filter-changed',\n lineageFilterChanged: 'gs-lineage-filter-changed',\n locationChanged: 'gs-location-changed',\n textFilterChanged: 'gs-text-filter-changed',\n} as const;\n","import z from 'zod';\n\nimport {\n type Deletion,\n type DeletionClass,\n type Insertion,\n type InsertionClass,\n type Substitution,\n type SubstitutionClass,\n} from './utils/mutations';\n\nexport const mutationsFilterSchema = z.object({\n nucleotideMutations: z.array(z.string()),\n aminoAcidMutations: z.array(z.string()),\n nucleotideInsertions: z.array(z.string()),\n aminoAcidInsertions: z.array(z.string()),\n});\nexport type MutationsFilter = z.infer<typeof mutationsFilterSchema>;\n\nexport const lapisFilterSchema = z\n .record(z.union([z.string(), z.array(z.string()), z.number(), z.null(), z.boolean(), z.undefined()]))\n .and(mutationsFilterSchema.partial());\nexport type LapisFilter = z.infer<typeof lapisFilterSchema>;\n\nexport const namedLapisFilterSchema = z.object({\n lapisFilter: lapisFilterSchema,\n displayName: z.string(),\n});\nexport type NamedLapisFilter = z.infer<typeof namedLapisFilterSchema>;\n\nexport const lapisLocationFilterSchema = z.record(z.union([z.string(), z.undefined()]));\nexport type LapisLocationFilter = z.infer<typeof lapisLocationFilterSchema>;\n\nexport const temporalGranularitySchema = z.union([\n z.literal('day'),\n z.literal('week'),\n z.literal('month'),\n z.literal('year'),\n]);\nexport type TemporalGranularity = z.infer<typeof temporalGranularitySchema>;\n\nexport const sequenceTypeSchema = z.union([z.literal('nucleotide'), z.literal('amino acid')]);\nexport type SequenceType = z.infer<typeof sequenceTypeSchema>;\n\nexport type SubstitutionOrDeletion = 'substitution' | 'deletion';\n\nexport type MutationType = SubstitutionOrDeletion | 'insertion';\n\nexport type SubstitutionEntry<T extends Substitution = SubstitutionClass> = {\n type: 'substitution';\n mutation: T;\n count: number;\n proportion: number;\n};\n\nexport type DeletionEntry<T extends Deletion = DeletionClass> = {\n type: 'deletion';\n mutation: T;\n count: number;\n proportion: number;\n};\n\nexport type InsertionEntry<T extends Insertion = InsertionClass> = { type: 'insertion'; mutation: T; count: number };\n\nexport type SubstitutionOrDeletionEntry<\n S extends Substitution = SubstitutionClass,\n D extends Deletion = DeletionClass,\n> = SubstitutionEntry<S> | DeletionEntry<D>;\n\nexport type MutationEntry = SubstitutionEntry | DeletionEntry | InsertionEntry;\n\nexport const views = {\n table: 'table',\n venn: 'venn',\n grid: 'grid',\n insertions: 'insertions',\n bar: 'bar',\n line: 'line',\n bubble: 'bubble',\n map: 'map',\n} as const;\n","export const toYYYYMMDD = (date: Date) => {\n const options: Intl.DateTimeFormatOptions = { year: 'numeric', month: '2-digit', day: '2-digit' };\n return date.toLocaleDateString('en-CA', options);\n};\n","import z from 'zod';\n\nimport { toYYYYMMDD } from './dateConversion';\nimport { gsEventNames } from '../../utils/gsEventNames';\n\n/**\n * A date range option that can be used in the `gs-date-range-filter` component.\n */\nexport const dateRangeOptionSchema = z.object({\n /** The label of the date range option that will be shown to the user */\n label: z.string(),\n /**\n * The start date of the date range in the format `YYYY-MM-DD`.\n * If not set, the date range selector will default to the `earliestDate` property.\n */\n dateFrom: z.string().date().optional(),\n /**\n * The end date of the date range in the format `YYYY-MM-DD`.\n * If not set, the date range selector will default to the current date.\n */\n dateTo: z.string().date().optional(),\n});\n\nexport type DateRangeOption = z.infer<typeof dateRangeOptionSchema>;\n\nexport const dateRangeValueSchema = z\n .union([\n z.string(),\n z.object({\n dateFrom: z.string().date().optional(),\n dateTo: z.string().date().optional(),\n }),\n ])\n .nullable();\n\nexport type DateRangeValue = z.infer<typeof dateRangeValueSchema>;\n\nexport class DateRangeOptionChangedEvent extends CustomEvent<DateRangeValue> {\n constructor(detail: DateRangeValue) {\n super(gsEventNames.dateRangeOptionChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n\nconst today = new Date();\n\nconst twoWeeksAgo = new Date();\ntwoWeeksAgo.setDate(today.getDate() - 14);\n\nconst lastMonth = new Date(today);\nlastMonth.setMonth(today.getMonth() - 1);\n\nconst last2Months = new Date(today);\nlast2Months.setMonth(today.getMonth() - 2);\n\nconst last3Months = new Date(today);\nlast3Months.setMonth(today.getMonth() - 3);\n\nconst last6Months = new Date(today);\nlast6Months.setMonth(today.getMonth() - 6);\n\nconst lastYear = new Date(today);\nlastYear.setFullYear(today.getFullYear() - 1);\n\n/**\n * Presets for the `gs-date-range-filter` component that can be used as `dateRangeOptions`.\n */\nexport const dateRangeOptionPresets = {\n last2Weeks: {\n label: 'Last 2 weeks',\n dateFrom: toYYYYMMDD(twoWeeksAgo),\n },\n lastMonth: {\n label: 'Last month',\n dateFrom: toYYYYMMDD(lastMonth),\n },\n last2Months: {\n label: 'Last 2 months',\n dateFrom: toYYYYMMDD(last2Months),\n },\n last3Months: {\n label: 'Last 3 months',\n dateFrom: toYYYYMMDD(last3Months),\n },\n last6Months: {\n label: 'Last 6 months',\n dateFrom: toYYYYMMDD(last6Months),\n },\n lastYear: {\n label: 'Last year',\n dateFrom: toYYYYMMDD(lastYear),\n },\n allTimes: {\n label: 'All times',\n },\n} satisfies Record<string, DateRangeOption>;\n","import { type LapisLocationFilter } from '../../types';\nimport { gsEventNames } from '../../utils/gsEventNames';\n\nexport class LocationChangedEvent extends CustomEvent<LapisLocationFilter> {\n constructor(detail: LapisLocationFilter) {\n super(gsEventNames.locationChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n","import { gsEventNames } from '../../utils/gsEventNames';\n\ntype LapisTextFilter = Record<string, string | undefined>;\n\nexport class TextFilterChangedEvent extends CustomEvent<LapisTextFilter> {\n constructor(detail: LapisTextFilter) {\n super(gsEventNames.textFilterChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n","import { gsEventNames } from '../../utils/gsEventNames';\n\ntype LapisLineageFilter = Record<string, string | undefined>;\n\nexport class LineageFilterChangedEvent extends CustomEvent<LapisLineageFilter> {\n constructor(detail: LapisLineageFilter) {\n super(gsEventNames.lineageFilterChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n"],"names":[],"mappings":";AAAO,MAAM,eAAe;AAAA,EACxB,OAAO;AAAA,EACP,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,mBAAmB;AACvB;ACGa,MAAA,wBAAwB,EAAE,OAAO;AAAA,EAC1C,qBAAqB,EAAE,MAAM,EAAE,QAAQ;AAAA,EACvC,oBAAoB,EAAE,MAAM,EAAE,QAAQ;AAAA,EACtC,sBAAsB,EAAE,MAAM,EAAE,QAAQ;AAAA,EACxC,qBAAqB,EAAE,MAAM,EAAE,OAAQ,CAAA;AAC3C,CAAC;AAGM,MAAM,oBAAoB,EAC5B,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAQ,CAAA,GAAG,EAAE,OAAO,GAAG,EAAE,QAAQ,EAAE,QAAW,GAAA,EAAE,UAAW,CAAA,CAAC,CAAC,EACnG,IAAI,sBAAsB,QAAS,CAAA;AAG3B,MAAA,yBAAyB,EAAE,OAAO;AAAA,EAC3C,aAAa;AAAA,EACb,aAAa,EAAE,OAAO;AAC1B,CAAC;AAGM,MAAM,4BAA4B,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAU,GAAA,EAAE,UAAW,CAAA,CAAC,CAAC;AAGzE,MAAA,4BAA4B,EAAE,MAAM;AAAA,EAC7C,EAAE,QAA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kCAAkC,YAAgC;AAAA,EAC3E,YAAY,QAA4B;AACpC,UAAM,aAAa,sBAAsB;AAAA,MACrC;AAAA,MACA,SAAS;AAAA,MACT,UAAU;AAAA,IAAA,CACb;AAAA,EAAA;AAET;"}
|
|
1
|
+
{"version":3,"file":"LineageFilterChangedEvent-GgkxoF3X.js","sources":["../src/utils/gsEventNames.ts","../src/types.ts","../src/preact/dateRangeFilter/dateConversion.ts","../src/preact/dateRangeFilter/dateRangeOption.ts","../src/preact/locationFilter/LocationChangedEvent.ts","../src/preact/textFilter/TextFilterChangedEvent.ts","../src/preact/lineageFilter/LineageFilterChangedEvent.ts"],"sourcesContent":["export const gsEventNames = {\n error: 'gs-error',\n dateRangeFilterChanged: 'gs-date-range-filter-changed',\n dateRangeOptionChanged: 'gs-date-range-option-changed',\n mutationFilterChanged: 'gs-mutation-filter-changed',\n lineageFilterChanged: 'gs-lineage-filter-changed',\n locationChanged: 'gs-location-changed',\n textFilterChanged: 'gs-text-filter-changed',\n numberRangeFilterChanged: 'gs-number-range-filter-changed',\n numberRangeValueChanged: 'gs-number-range-value-changed',\n} as const;\n","import z from 'zod';\n\nimport {\n type Deletion,\n type DeletionClass,\n type Insertion,\n type InsertionClass,\n type Substitution,\n type SubstitutionClass,\n} from './utils/mutations';\n\nexport const mutationsFilterSchema = z.object({\n nucleotideMutations: z.array(z.string()),\n aminoAcidMutations: z.array(z.string()),\n nucleotideInsertions: z.array(z.string()),\n aminoAcidInsertions: z.array(z.string()),\n});\nexport type MutationsFilter = z.infer<typeof mutationsFilterSchema>;\n\nexport const lapisFilterSchema = z\n .record(z.union([z.string(), z.array(z.string()), z.number(), z.null(), z.boolean(), z.undefined()]))\n .and(mutationsFilterSchema.partial());\nexport type LapisFilter = z.infer<typeof lapisFilterSchema>;\n\nexport const namedLapisFilterSchema = z.object({\n lapisFilter: lapisFilterSchema,\n displayName: z.string(),\n});\nexport type NamedLapisFilter = z.infer<typeof namedLapisFilterSchema>;\n\nexport const lapisLocationFilterSchema = z.record(z.union([z.string(), z.undefined()]));\nexport type LapisLocationFilter = z.infer<typeof lapisLocationFilterSchema>;\n\nexport const temporalGranularitySchema = z.union([\n z.literal('day'),\n z.literal('week'),\n z.literal('month'),\n z.literal('year'),\n]);\nexport type TemporalGranularity = z.infer<typeof temporalGranularitySchema>;\n\nexport const sequenceTypeSchema = z.union([z.literal('nucleotide'), z.literal('amino acid')]);\nexport type SequenceType = z.infer<typeof sequenceTypeSchema>;\n\nexport type SubstitutionOrDeletion = 'substitution' | 'deletion';\n\nexport type MutationType = SubstitutionOrDeletion | 'insertion';\n\nexport type SubstitutionEntry<T extends Substitution = SubstitutionClass> = {\n type: 'substitution';\n mutation: T;\n count: number;\n proportion: number;\n};\n\nexport type DeletionEntry<T extends Deletion = DeletionClass> = {\n type: 'deletion';\n mutation: T;\n count: number;\n proportion: number;\n};\n\nexport type InsertionEntry<T extends Insertion = InsertionClass> = { type: 'insertion'; mutation: T; count: number };\n\nexport type SubstitutionOrDeletionEntry<\n S extends Substitution = SubstitutionClass,\n D extends Deletion = DeletionClass,\n> = SubstitutionEntry<S> | DeletionEntry<D>;\n\nexport type MutationEntry = SubstitutionEntry | DeletionEntry | InsertionEntry;\n\nexport const views = {\n table: 'table',\n venn: 'venn',\n grid: 'grid',\n insertions: 'insertions',\n bar: 'bar',\n line: 'line',\n bubble: 'bubble',\n map: 'map',\n} as const;\n","export const toYYYYMMDD = (date: Date) => {\n const options: Intl.DateTimeFormatOptions = { year: 'numeric', month: '2-digit', day: '2-digit' };\n return date.toLocaleDateString('en-CA', options);\n};\n","import z from 'zod';\n\nimport { toYYYYMMDD } from './dateConversion';\nimport { gsEventNames } from '../../utils/gsEventNames';\n\n/**\n * A date range option that can be used in the `gs-date-range-filter` component.\n */\nexport const dateRangeOptionSchema = z.object({\n /** The label of the date range option that will be shown to the user */\n label: z.string(),\n /**\n * The start date of the date range in the format `YYYY-MM-DD`.\n * If not set, the date range selector will default to the `earliestDate` property.\n */\n dateFrom: z.string().date().optional(),\n /**\n * The end date of the date range in the format `YYYY-MM-DD`.\n * If not set, the date range selector will default to the current date.\n */\n dateTo: z.string().date().optional(),\n});\n\nexport type DateRangeOption = z.infer<typeof dateRangeOptionSchema>;\n\nexport const dateRangeValueSchema = z\n .union([\n z.string(),\n z.object({\n dateFrom: z.string().date().optional(),\n dateTo: z.string().date().optional(),\n }),\n ])\n .nullable();\n\nexport type DateRangeValue = z.infer<typeof dateRangeValueSchema>;\n\nexport class DateRangeOptionChangedEvent extends CustomEvent<DateRangeValue> {\n constructor(detail: DateRangeValue) {\n super(gsEventNames.dateRangeOptionChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n\nconst today = new Date();\n\nconst twoWeeksAgo = new Date();\ntwoWeeksAgo.setDate(today.getDate() - 14);\n\nconst lastMonth = new Date(today);\nlastMonth.setMonth(today.getMonth() - 1);\n\nconst last2Months = new Date(today);\nlast2Months.setMonth(today.getMonth() - 2);\n\nconst last3Months = new Date(today);\nlast3Months.setMonth(today.getMonth() - 3);\n\nconst last6Months = new Date(today);\nlast6Months.setMonth(today.getMonth() - 6);\n\nconst lastYear = new Date(today);\nlastYear.setFullYear(today.getFullYear() - 1);\n\n/**\n * Presets for the `gs-date-range-filter` component that can be used as `dateRangeOptions`.\n */\nexport const dateRangeOptionPresets = {\n last2Weeks: {\n label: 'Last 2 weeks',\n dateFrom: toYYYYMMDD(twoWeeksAgo),\n },\n lastMonth: {\n label: 'Last month',\n dateFrom: toYYYYMMDD(lastMonth),\n },\n last2Months: {\n label: 'Last 2 months',\n dateFrom: toYYYYMMDD(last2Months),\n },\n last3Months: {\n label: 'Last 3 months',\n dateFrom: toYYYYMMDD(last3Months),\n },\n last6Months: {\n label: 'Last 6 months',\n dateFrom: toYYYYMMDD(last6Months),\n },\n lastYear: {\n label: 'Last year',\n dateFrom: toYYYYMMDD(lastYear),\n },\n allTimes: {\n label: 'All times',\n },\n} satisfies Record<string, DateRangeOption>;\n","import { type LapisLocationFilter } from '../../types';\nimport { gsEventNames } from '../../utils/gsEventNames';\n\nexport class LocationChangedEvent extends CustomEvent<LapisLocationFilter> {\n constructor(detail: LapisLocationFilter) {\n super(gsEventNames.locationChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n","import { gsEventNames } from '../../utils/gsEventNames';\n\ntype LapisTextFilter = Record<string, string | undefined>;\n\nexport class TextFilterChangedEvent extends CustomEvent<LapisTextFilter> {\n constructor(detail: LapisTextFilter) {\n super(gsEventNames.textFilterChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n","import { gsEventNames } from '../../utils/gsEventNames';\n\ntype LapisLineageFilter = Record<string, string | undefined>;\n\nexport class LineageFilterChangedEvent extends CustomEvent<LapisLineageFilter> {\n constructor(detail: LapisLineageFilter) {\n super(gsEventNames.lineageFilterChanged, {\n detail,\n bubbles: true,\n composed: true,\n });\n }\n}\n"],"names":[],"mappings":";AAAO,MAAM,eAAe;AAAA,EACxB,OAAO;AAAA,EACP,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,0BAA0B;AAAA,EAC1B,yBAAyB;AAC7B;ACCa,MAAA,wBAAwB,EAAE,OAAO;AAAA,EAC1C,qBAAqB,EAAE,MAAM,EAAE,QAAQ;AAAA,EACvC,oBAAoB,EAAE,MAAM,EAAE,QAAQ;AAAA,EACtC,sBAAsB,EAAE,MAAM,EAAE,QAAQ;AAAA,EACxC,qBAAqB,EAAE,MAAM,EAAE,OAAQ,CAAA;AAC3C,CAAC;AAGM,MAAM,oBAAoB,EAC5B,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAQ,CAAA,GAAG,EAAE,OAAO,GAAG,EAAE,QAAQ,EAAE,QAAW,GAAA,EAAE,UAAW,CAAA,CAAC,CAAC,EACnG,IAAI,sBAAsB,QAAS,CAAA;AA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AA,MAChC;AAAA,MACA,SAAS;AAAA,MACT,UAAU;AAAA,IAAA,CACb;AAAA,EAAA;AAET;ACPO,MAAM,+BAA+B,YAA6B;AAAA,EACrE,YAAY,QAAyB;AACjC,UAAM,aAAa,mBAAmB;AAAA,MAClC;AAAA,MACA,SAAS;AAAA,MACT,UAAU;AAAA,IAAA,CACb;AAAA,EAAA;AAET;ACRO,MAAM,kCAAkC,YAAgC;AAAA,EAC3E,YAAY,QAA4B;AACpC,UAAM,aAAa,sBAAsB;AAAA,MACrC;AAAA,MACA,SAAS;AAAA,MACT,UAAU;AAAA,IAAA,CACb;AAAA,EAAA;AAET;"}
|
package/dist/components.d.ts
CHANGED
|
@@ -752,6 +752,103 @@ export declare class MutationsOverTimeComponent extends PreactLitAdapterWithGrid
|
|
|
752
752
|
render(): JSX_2.Element;
|
|
753
753
|
}
|
|
754
754
|
|
|
755
|
+
/**
|
|
756
|
+
*
|
|
757
|
+
* ## Context
|
|
758
|
+
*
|
|
759
|
+
* This component lets the user specify filters for a `float` or `int` field in LAPIS.
|
|
760
|
+
* It consists of two text input fields and a slider.
|
|
761
|
+
*
|
|
762
|
+
* The slider must be restricted to a certain range.
|
|
763
|
+
* Users can however still enter values outside of this range in the text input fields.
|
|
764
|
+
*
|
|
765
|
+
* @fires {CustomEvent<Record<string, string | undefined>>} gs-number-range-filter-changed
|
|
766
|
+
* Fired when the slider is released,
|
|
767
|
+
* `onBlur` on the input fields after the user has typed a valid range in the input fields,
|
|
768
|
+
* or when one of the input fields is cleared.
|
|
769
|
+
* The `details` of this event contain an object with `${lapisField}From` and `${lapisField}To` as keys.
|
|
770
|
+
* The values are the numbers from the input fields or `undefined` if the input field is empty:
|
|
771
|
+
* ```
|
|
772
|
+
* {
|
|
773
|
+
* [`${lapisField}From`]: number | undefined
|
|
774
|
+
* [`${lapisField}To`]: number | undefined
|
|
775
|
+
* }
|
|
776
|
+
* ```
|
|
777
|
+
* Example:
|
|
778
|
+
* ```
|
|
779
|
+
* {
|
|
780
|
+
* ageFrom: 18,
|
|
781
|
+
* ageTo: undefined
|
|
782
|
+
* }
|
|
783
|
+
* ```
|
|
784
|
+
*
|
|
785
|
+
* @fires {CustomEvent<Record<string, string | undefined>>} gs-number-range-value-changed
|
|
786
|
+
* Similar to the `gs-number-range-filter-changed` event,
|
|
787
|
+
* but contains an `event.detail` that has a fixed format:
|
|
788
|
+
* ```
|
|
789
|
+
* {
|
|
790
|
+
* min: number | undefined
|
|
791
|
+
* max: number | undefined
|
|
792
|
+
* }
|
|
793
|
+
* ```
|
|
794
|
+
* This event should be used when you want to control this component externally.
|
|
795
|
+
* The `event.detail` can be used as the value of the component.
|
|
796
|
+
* Example:
|
|
797
|
+
* ```
|
|
798
|
+
* {
|
|
799
|
+
* min: 18,
|
|
800
|
+
* max: undefined
|
|
801
|
+
* }
|
|
802
|
+
* ```
|
|
803
|
+
*/
|
|
804
|
+
export declare class NumberRangeFilterComponent extends PreactLitAdapter {
|
|
805
|
+
/**
|
|
806
|
+
* The value to use for this number filter.
|
|
807
|
+
*
|
|
808
|
+
* Must be of the form:
|
|
809
|
+
* ```
|
|
810
|
+
* {
|
|
811
|
+
* [`${lapisField}From`]: number | undefined
|
|
812
|
+
* [`${lapisField}To`]: number | undefined
|
|
813
|
+
* }
|
|
814
|
+
* ```
|
|
815
|
+
*
|
|
816
|
+
* This is the same format that the `gs-number-value-changed` event will emit.
|
|
817
|
+
*/
|
|
818
|
+
value: {
|
|
819
|
+
min?: number;
|
|
820
|
+
max?: number;
|
|
821
|
+
};
|
|
822
|
+
/**
|
|
823
|
+
* Required.
|
|
824
|
+
*
|
|
825
|
+
* The LAPIS field name to use for this text filter.
|
|
826
|
+
* The field must exist on this LAPIS instance.
|
|
827
|
+
*/
|
|
828
|
+
lapisField: string;
|
|
829
|
+
/**
|
|
830
|
+
* The `min` value to use for the slider.
|
|
831
|
+
*/
|
|
832
|
+
sliderMin: number;
|
|
833
|
+
/**
|
|
834
|
+
* The `max` value to use for the slider.
|
|
835
|
+
*/
|
|
836
|
+
sliderMax: number;
|
|
837
|
+
/**
|
|
838
|
+
* The `step` value to use for the slider.
|
|
839
|
+
*
|
|
840
|
+
* This attribute has no effect on the text input.
|
|
841
|
+
*/
|
|
842
|
+
sliderStep: number;
|
|
843
|
+
/**
|
|
844
|
+
* The width of the component.
|
|
845
|
+
*
|
|
846
|
+
* Visit https://genspectrum.github.io/dashboard-components/?path=/docs/concepts-size-of-components--docs for more information.
|
|
847
|
+
*/
|
|
848
|
+
width: string;
|
|
849
|
+
render(): JSX_2.Element;
|
|
850
|
+
}
|
|
851
|
+
|
|
755
852
|
/**
|
|
756
853
|
* ## Context
|
|
757
854
|
*
|
|
@@ -1503,7 +1600,7 @@ declare global {
|
|
|
1503
1600
|
|
|
1504
1601
|
declare global {
|
|
1505
1602
|
interface HTMLElementTagNameMap {
|
|
1506
|
-
'gs-
|
|
1603
|
+
'gs-prevalence-over-time': PrevalenceOverTimeComponent;
|
|
1507
1604
|
}
|
|
1508
1605
|
}
|
|
1509
1606
|
|
|
@@ -1511,7 +1608,7 @@ declare global {
|
|
|
1511
1608
|
declare global {
|
|
1512
1609
|
namespace JSX {
|
|
1513
1610
|
interface IntrinsicElements {
|
|
1514
|
-
'gs-
|
|
1611
|
+
'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1515
1612
|
}
|
|
1516
1613
|
}
|
|
1517
1614
|
}
|
|
@@ -1519,7 +1616,7 @@ declare global {
|
|
|
1519
1616
|
|
|
1520
1617
|
declare global {
|
|
1521
1618
|
interface HTMLElementTagNameMap {
|
|
1522
|
-
'gs-
|
|
1619
|
+
'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
|
|
1523
1620
|
}
|
|
1524
1621
|
}
|
|
1525
1622
|
|
|
@@ -1527,7 +1624,7 @@ declare global {
|
|
|
1527
1624
|
declare global {
|
|
1528
1625
|
namespace JSX {
|
|
1529
1626
|
interface IntrinsicElements {
|
|
1530
|
-
'gs-
|
|
1627
|
+
'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1531
1628
|
}
|
|
1532
1629
|
}
|
|
1533
1630
|
}
|
|
@@ -1535,7 +1632,7 @@ declare global {
|
|
|
1535
1632
|
|
|
1536
1633
|
declare global {
|
|
1537
1634
|
interface HTMLElementTagNameMap {
|
|
1538
|
-
'gs-
|
|
1635
|
+
'gs-aggregate': AggregateComponent;
|
|
1539
1636
|
}
|
|
1540
1637
|
}
|
|
1541
1638
|
|
|
@@ -1543,7 +1640,7 @@ declare global {
|
|
|
1543
1640
|
declare global {
|
|
1544
1641
|
namespace JSX {
|
|
1545
1642
|
interface IntrinsicElements {
|
|
1546
|
-
'gs-
|
|
1643
|
+
'gs-aggregate': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1547
1644
|
}
|
|
1548
1645
|
}
|
|
1549
1646
|
}
|
|
@@ -1551,7 +1648,7 @@ declare global {
|
|
|
1551
1648
|
|
|
1552
1649
|
declare global {
|
|
1553
1650
|
interface HTMLElementTagNameMap {
|
|
1554
|
-
'gs-
|
|
1651
|
+
'gs-number-sequences-over-time': NumberSequencesOverTimeComponent;
|
|
1555
1652
|
}
|
|
1556
1653
|
}
|
|
1557
1654
|
|
|
@@ -1559,7 +1656,7 @@ declare global {
|
|
|
1559
1656
|
declare global {
|
|
1560
1657
|
namespace JSX {
|
|
1561
1658
|
interface IntrinsicElements {
|
|
1562
|
-
'gs-
|
|
1659
|
+
'gs-number-sequences-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1563
1660
|
}
|
|
1564
1661
|
}
|
|
1565
1662
|
}
|
|
@@ -1583,7 +1680,7 @@ declare global {
|
|
|
1583
1680
|
|
|
1584
1681
|
declare global {
|
|
1585
1682
|
interface HTMLElementTagNameMap {
|
|
1586
|
-
'gs-
|
|
1683
|
+
'gs-sequences-by-location': SequencesByLocationComponent;
|
|
1587
1684
|
}
|
|
1588
1685
|
}
|
|
1589
1686
|
|
|
@@ -1591,7 +1688,7 @@ declare global {
|
|
|
1591
1688
|
declare global {
|
|
1592
1689
|
namespace JSX {
|
|
1593
1690
|
interface IntrinsicElements {
|
|
1594
|
-
'gs-
|
|
1691
|
+
'gs-sequences-by-location': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1595
1692
|
}
|
|
1596
1693
|
}
|
|
1597
1694
|
}
|
|
@@ -1599,7 +1696,11 @@ declare global {
|
|
|
1599
1696
|
|
|
1600
1697
|
declare global {
|
|
1601
1698
|
interface HTMLElementTagNameMap {
|
|
1602
|
-
'gs-
|
|
1699
|
+
'gs-date-range-filter': DateRangeFilterComponent;
|
|
1700
|
+
}
|
|
1701
|
+
interface HTMLElementEventMap {
|
|
1702
|
+
[gsEventNames.dateRangeFilterChanged]: CustomEvent<Record<string, string>>;
|
|
1703
|
+
[gsEventNames.dateRangeOptionChanged]: DateRangeOptionChangedEvent;
|
|
1603
1704
|
}
|
|
1604
1705
|
}
|
|
1605
1706
|
|
|
@@ -1607,7 +1708,7 @@ declare global {
|
|
|
1607
1708
|
declare global {
|
|
1608
1709
|
namespace JSX {
|
|
1609
1710
|
interface IntrinsicElements {
|
|
1610
|
-
'gs-
|
|
1711
|
+
'gs-date-range-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1611
1712
|
}
|
|
1612
1713
|
}
|
|
1613
1714
|
}
|
|
@@ -1615,7 +1716,10 @@ declare global {
|
|
|
1615
1716
|
|
|
1616
1717
|
declare global {
|
|
1617
1718
|
interface HTMLElementTagNameMap {
|
|
1618
|
-
'gs-
|
|
1719
|
+
'gs-location-filter': LocationFilterComponent;
|
|
1720
|
+
}
|
|
1721
|
+
interface HTMLElementEventMap {
|
|
1722
|
+
[gsEventNames.locationChanged]: LocationChangedEvent;
|
|
1619
1723
|
}
|
|
1620
1724
|
}
|
|
1621
1725
|
|
|
@@ -1623,7 +1727,7 @@ declare global {
|
|
|
1623
1727
|
declare global {
|
|
1624
1728
|
namespace JSX {
|
|
1625
1729
|
interface IntrinsicElements {
|
|
1626
|
-
'gs-
|
|
1730
|
+
'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1627
1731
|
}
|
|
1628
1732
|
}
|
|
1629
1733
|
}
|
|
@@ -1631,11 +1735,7 @@ declare global {
|
|
|
1631
1735
|
|
|
1632
1736
|
declare global {
|
|
1633
1737
|
interface HTMLElementTagNameMap {
|
|
1634
|
-
'gs-
|
|
1635
|
-
}
|
|
1636
|
-
interface HTMLElementEventMap {
|
|
1637
|
-
[gsEventNames.dateRangeFilterChanged]: CustomEvent<Record<string, string>>;
|
|
1638
|
-
[gsEventNames.dateRangeOptionChanged]: DateRangeOptionChangedEvent;
|
|
1738
|
+
'gs-statistics': StatisticsComponent;
|
|
1639
1739
|
}
|
|
1640
1740
|
}
|
|
1641
1741
|
|
|
@@ -1643,7 +1743,7 @@ declare global {
|
|
|
1643
1743
|
declare global {
|
|
1644
1744
|
namespace JSX {
|
|
1645
1745
|
interface IntrinsicElements {
|
|
1646
|
-
'gs-
|
|
1746
|
+
'gs-statistics': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1647
1747
|
}
|
|
1648
1748
|
}
|
|
1649
1749
|
}
|
|
@@ -1651,10 +1751,10 @@ declare global {
|
|
|
1651
1751
|
|
|
1652
1752
|
declare global {
|
|
1653
1753
|
interface HTMLElementTagNameMap {
|
|
1654
|
-
'gs-
|
|
1754
|
+
'gs-text-filter': TextFilterComponent;
|
|
1655
1755
|
}
|
|
1656
1756
|
interface HTMLElementEventMap {
|
|
1657
|
-
[gsEventNames.
|
|
1757
|
+
[gsEventNames.textFilterChanged]: TextFilterChangedEvent;
|
|
1658
1758
|
}
|
|
1659
1759
|
}
|
|
1660
1760
|
|
|
@@ -1662,7 +1762,7 @@ declare global {
|
|
|
1662
1762
|
declare global {
|
|
1663
1763
|
namespace JSX {
|
|
1664
1764
|
interface IntrinsicElements {
|
|
1665
|
-
'gs-
|
|
1765
|
+
'gs-text-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1666
1766
|
}
|
|
1667
1767
|
}
|
|
1668
1768
|
}
|
|
@@ -1670,10 +1770,10 @@ declare global {
|
|
|
1670
1770
|
|
|
1671
1771
|
declare global {
|
|
1672
1772
|
interface HTMLElementTagNameMap {
|
|
1673
|
-
'gs-
|
|
1773
|
+
'gs-lineage-filter': LineageFilterComponent;
|
|
1674
1774
|
}
|
|
1675
1775
|
interface HTMLElementEventMap {
|
|
1676
|
-
[gsEventNames.
|
|
1776
|
+
[gsEventNames.lineageFilterChanged]: LineageFilterChangedEvent;
|
|
1677
1777
|
}
|
|
1678
1778
|
}
|
|
1679
1779
|
|
|
@@ -1681,7 +1781,7 @@ declare global {
|
|
|
1681
1781
|
declare global {
|
|
1682
1782
|
namespace JSX {
|
|
1683
1783
|
interface IntrinsicElements {
|
|
1684
|
-
'gs-
|
|
1784
|
+
'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1685
1785
|
}
|
|
1686
1786
|
}
|
|
1687
1787
|
}
|
|
@@ -1708,10 +1808,11 @@ declare global {
|
|
|
1708
1808
|
|
|
1709
1809
|
declare global {
|
|
1710
1810
|
interface HTMLElementTagNameMap {
|
|
1711
|
-
'gs-
|
|
1811
|
+
'gs-number-range-filter': NumberRangeFilterComponent;
|
|
1712
1812
|
}
|
|
1713
1813
|
interface HTMLElementEventMap {
|
|
1714
|
-
[gsEventNames.
|
|
1814
|
+
[gsEventNames.numberRangeFilterChanged]: NumberRangeFilterChangedEvent;
|
|
1815
|
+
[gsEventNames.numberRangeValueChanged]: NumberRangeValueChangedEvent;
|
|
1715
1816
|
}
|
|
1716
1817
|
}
|
|
1717
1818
|
|
|
@@ -1719,7 +1820,23 @@ declare global {
|
|
|
1719
1820
|
declare global {
|
|
1720
1821
|
namespace JSX {
|
|
1721
1822
|
interface IntrinsicElements {
|
|
1722
|
-
'gs-
|
|
1823
|
+
'gs-number-range-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
|
|
1829
|
+
declare global {
|
|
1830
|
+
interface HTMLElementTagNameMap {
|
|
1831
|
+
'gs-wastewater-mutations-over-time': WastewaterMutationsOverTimeComponent;
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
|
|
1836
|
+
declare global {
|
|
1837
|
+
namespace JSX {
|
|
1838
|
+
interface IntrinsicElements {
|
|
1839
|
+
'gs-wastewater-mutations-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
1723
1840
|
}
|
|
1724
1841
|
}
|
|
1725
1842
|
}
|