Skip to content

Commit bb93af7

Browse files
authored
Merge pull request #295 from performant-software/feature/rc291_timeline_facet
RC #291 - Timeline Facet
2 parents 6a32fb1 + df957a2 commit bb93af7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1700
-212
lines changed

packages/controlled-vocabulary/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@performant-software/controlled-vocabulary",
3-
"version": "2.2.9",
3+
"version": "2.2.10",
44
"description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.",
55
"license": "MIT",
66
"main": "./dist/index.cjs.js",
@@ -23,8 +23,8 @@
2323
"underscore": "^1.13.2"
2424
},
2525
"peerDependencies": {
26-
"@performant-software/semantic-components": "^2.2.9",
27-
"@performant-software/shared-components": "^2.2.9",
26+
"@performant-software/semantic-components": "^2.2.10",
27+
"@performant-software/shared-components": "^2.2.10",
2828
"react": ">= 16.13.1 < 19.0.0",
2929
"react-dom": ">= 16.13.1 < 19.0.0"
3030
},

packages/core-data/package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@performant-software/core-data",
3-
"version": "2.2.9",
3+
"version": "2.2.10",
44
"description": "A package of components used with the Core Data platform.",
55
"license": "MIT",
66
"main": "./dist/index.cjs.js",
@@ -22,8 +22,11 @@
2222
"dependencies": {
2323
"@radix-ui/react-accordion": "^1.1.2",
2424
"@radix-ui/react-checkbox": "^1.0.4",
25-
"@radix-ui/react-dialog": "^1.0.5",
25+
"@radix-ui/react-dialog": "^1.1.1",
2626
"@radix-ui/react-dropdown-menu": "^2.0.6",
27+
"@radix-ui/react-popover": "^1.1.1",
28+
"@radix-ui/react-slider": "^1.2.0",
29+
"@radix-ui/react-tooltip": "^1.1.2",
2730
"@samvera/clover-iiif": "^2.3.2",
2831
"@turf/turf": "^6.5.0",
2932
"clsx": "^2.1.0",
@@ -37,8 +40,8 @@
3740
"underscore": "^1.13.2"
3841
},
3942
"peerDependencies": {
40-
"@performant-software/shared-components": "^2.2.9",
41-
"@performant-software/geospatial": "^2.2.9",
43+
"@performant-software/geospatial": "^2.2.10",
44+
"@performant-software/shared-components": "^2.2.10",
4245
"@peripleo/maplibre": "^0.5.2",
4346
"@peripleo/peripleo": "^0.5.2",
4447
"react": ">= 16.13.1 < 19.0.0",

packages/core-data/src/components/EventDetails.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import LoadAnimation from './LoadAnimation';
66
import { useEventsService, useLoader } from '../hooks/CoreData';
77

88
type Props = {
9+
/**
10+
* (Optional) class name to apply to the root element.
11+
*/
12+
className?: string,
13+
914
/**
1015
* Identifier for the event to fetch.
1116
*/
@@ -25,7 +30,7 @@ const EventDetails = (props: Props) => {
2530
*/
2631
const onLoad = useCallback(() => EventsService.fetchOne(props.id), [props.id]);
2732

28-
const { data: { event } = {}, loading } = useLoader(onLoad);
33+
const { data: { event } = {}, loading } = useLoader(onLoad, {}, [props.id]);
2934

3035
if (loading) {
3136
return (
@@ -38,7 +43,9 @@ const EventDetails = (props: Props) => {
3843
}
3944

4045
return (
41-
<div>
46+
<div
47+
className={props.className}
48+
>
4249
<h1
4350
className='pr-6 py-1 font-bold text-2xl'
4451
>
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
// @flow
2+
3+
import clsx from 'clsx';
4+
import React from 'react';
5+
import _ from 'underscore';
6+
import type { Event as EventType } from '../types/Event';
7+
import EventUtils from '../utils/Event';
8+
9+
type Props = {
10+
/**
11+
* (Optional) class name to apply to the root element.
12+
*/
13+
className?: string,
14+
15+
/**
16+
* If `true`, the event description will be displayed on the card.
17+
*/
18+
description?: boolean,
19+
20+
/**
21+
* The list of events records to display.
22+
*/
23+
events: Array<EventType>,
24+
25+
/**
26+
* Callback that returns `true` if the passed event is selected.
27+
*/
28+
isSelected?: (event: EventType) => boolean,
29+
30+
/**
31+
* Callback fired when the event row is clicked.
32+
*/
33+
onClick?: (event: EventType) => void
34+
};
35+
36+
const EventsList = (props: Props) => (
37+
<ul
38+
className={props.className}
39+
>
40+
{ _.map(props.events, (event) => (
41+
<li>
42+
<div
43+
className='min-h-[5.5em] border-b flex flex-col justify-start'
44+
>
45+
<button
46+
className={clsx(
47+
'py-3',
48+
'px-4',
49+
'flex-grow',
50+
'text-left',
51+
'inline-flex',
52+
'flex-col',
53+
'rounded-none',
54+
{ 'hover:bg-event-selected': props.isSelected(event) },
55+
{ 'text-white': props.isSelected(event) },
56+
{ 'bg-event-selected': props.isSelected(event) }
57+
)}
58+
onClick={() => props.onClick(event)}
59+
type='button'
60+
>
61+
<div
62+
className='flex justify-between w-full items-center'
63+
>
64+
<div
65+
className='flex-grow'
66+
>
67+
<div>
68+
{ EventUtils.getDateView(event) }
69+
</div>
70+
<h2
71+
className='text-xl font-bold'
72+
>
73+
{ event.name }
74+
</h2>
75+
</div>
76+
</div>
77+
{ props.description && (
78+
<p
79+
className={clsx(
80+
'py-2',
81+
{ 'text-muted': !props.isSelected(event) }
82+
)}
83+
>
84+
{ event.description }
85+
</p>
86+
)}
87+
</button>
88+
</div>
89+
</li>
90+
))}
91+
</ul>
92+
);
93+
94+
EventsList.defaultProps = {
95+
isSelected: () => false,
96+
onClick: () => {}
97+
};
98+
99+
export default EventsList;

0 commit comments

Comments
 (0)