@performant-software/semantic-components 1.2.0-beta.27 → 1.2.0-beta.29
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/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/package.json +3 -2
- package/src/components/BibliographyList.js +1 -1
- package/src/components/DataTable.js +2 -2
- package/src/components/ImageCarousel.js +10 -0
- package/src/components/LazyIIIF.js +14 -6
- package/src/components/SimpleEditPage.js +2 -2
- package/src/index.js +0 -1
- package/types/components/BibliographyList.js.flow +1 -1
- package/types/components/DataTable.js.flow +2 -2
- package/types/components/ImageCarousel.js.flow +10 -0
- package/types/components/LazyIIIF.js.flow +14 -6
- package/types/components/SimpleEditPage.js.flow +2 -2
- package/types/components/ViewPDFButton.js.flow +68 -0
- package/types/index.js.flow +0 -1
- package/webpack.config.js +3 -0
- package/src/components/IIIFModal.js +0 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@performant-software/semantic-components",
|
|
3
|
-
"version": "1.2.0-beta.
|
|
3
|
+
"version": "1.2.0-beta.29",
|
|
4
4
|
"description": "A package of shared components based on the Semantic UI Framework.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./build/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"build": "webpack --mode production && flow-copy-source -v src types"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@performant-software/shared-components": "^1.2.0-beta.
|
|
15
|
+
"@performant-software/shared-components": "^1.2.0-beta.29",
|
|
16
16
|
"@react-google-maps/api": "^2.8.1",
|
|
17
17
|
"axios": "^0.26.1",
|
|
18
18
|
"i18next": "^19.4.4",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"zotero-translation-client": "^5.0.1"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
+
"@samvera/clover-iiif": "^2.3.2",
|
|
35
36
|
"react": ">= 16.13.1 < 19.0.0",
|
|
36
37
|
"react-dom": ">= 16.13.1 < 19.0.0"
|
|
37
38
|
},
|
|
@@ -23,7 +23,7 @@ import SortSelector from './SortSelector';
|
|
|
23
23
|
import { SORT_DESCENDING } from '../constants/Sort';
|
|
24
24
|
import StyleSelector from './StyleSelector';
|
|
25
25
|
import Toaster from './Toaster';
|
|
26
|
-
import useList, { Props as ListProps } from './List';
|
|
26
|
+
import useList, { type Props as ListProps } from './List';
|
|
27
27
|
import ZoteroTranslateContext from '../context/ZoteroTranslateContext';
|
|
28
28
|
import './BibliographyList.css';
|
|
29
29
|
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
import _ from 'underscore';
|
|
14
14
|
import i18n from '../i18n/i18n';
|
|
15
15
|
import ColumnResize from './ColumnResize';
|
|
16
|
-
import useColumnSelector, { Props as ColumnSelectorProps } from './DataTableColumnSelector';
|
|
17
|
-
import useList, { Props as ListProps } from './List';
|
|
16
|
+
import useColumnSelector, { type Props as ColumnSelectorProps } from './DataTableColumnSelector';
|
|
17
|
+
import useList, { type Props as ListProps } from './List';
|
|
18
18
|
import './DataTable.css';
|
|
19
19
|
|
|
20
20
|
import type { Action } from './List';
|
|
@@ -22,10 +22,20 @@ type ImageType = {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
type Props = {
|
|
25
|
+
/**
|
|
26
|
+
* The array of images to display.
|
|
27
|
+
*/
|
|
25
28
|
images: Array<ImageType>,
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Callback fired when the close icon is clicked.
|
|
32
|
+
*/
|
|
26
33
|
onClose: () => void
|
|
27
34
|
};
|
|
28
35
|
|
|
36
|
+
/**
|
|
37
|
+
* This component renders a full screen image carousel component used to scroll through the passed array of images.
|
|
38
|
+
*/
|
|
29
39
|
const ImageCarousel = (props: Props) => {
|
|
30
40
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
31
41
|
const [visible, setVisible] = useState(true);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
+
import Viewer from '@samvera/clover-iiif/viewer';
|
|
3
4
|
import React, { useState, type Node } from 'react';
|
|
4
|
-
import { Button } from 'semantic-ui-react';
|
|
5
|
+
import { Button, Modal } from 'semantic-ui-react';
|
|
5
6
|
import _ from 'underscore';
|
|
6
7
|
import i18n from '../i18n/i18n';
|
|
7
|
-
import IIIFModal from './IIIFModal';
|
|
8
8
|
import LazyMedia from './LazyMedia';
|
|
9
9
|
|
|
10
10
|
type Props = {
|
|
@@ -34,11 +34,19 @@ const LazyIIIF = ({ manifest, options = {}, ...props }: Props) => {
|
|
|
34
34
|
{ props.children }
|
|
35
35
|
</LazyMedia>
|
|
36
36
|
{ modal && (
|
|
37
|
-
<
|
|
38
|
-
|
|
37
|
+
<Modal
|
|
38
|
+
centered={false}
|
|
39
|
+
closeIcon
|
|
39
40
|
onClose={() => setModal(false)}
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
open
|
|
42
|
+
>
|
|
43
|
+
<Modal.Content>
|
|
44
|
+
<Viewer
|
|
45
|
+
iiifContent={manifest}
|
|
46
|
+
options={_.defaults(options, { showIIIFBadge: false })}
|
|
47
|
+
/>
|
|
48
|
+
</Modal.Content>
|
|
49
|
+
</Modal>
|
|
42
50
|
)}
|
|
43
51
|
</>
|
|
44
52
|
);
|
package/src/index.js
CHANGED
|
@@ -47,7 +47,6 @@ export { default as FuzzyDate } from './components/FuzzyDate';
|
|
|
47
47
|
export { default as GoogleMap } from './components/GoogleMap';
|
|
48
48
|
export { default as GooglePlacesSearch } from './components/GooglePlacesSearch';
|
|
49
49
|
export { default as HorizontalCards } from './components/HorizontalCards';
|
|
50
|
-
export { default as IIIFModal } from './components/IIIFModal';
|
|
51
50
|
export { default as ImageCarousel } from './components/ImageCarousel';
|
|
52
51
|
export { default as ItemCollection } from './components/ItemCollection';
|
|
53
52
|
export { default as ItemList } from './components/ItemList';
|
|
@@ -23,7 +23,7 @@ import SortSelector from './SortSelector';
|
|
|
23
23
|
import { SORT_DESCENDING } from '../constants/Sort';
|
|
24
24
|
import StyleSelector from './StyleSelector';
|
|
25
25
|
import Toaster from './Toaster';
|
|
26
|
-
import useList, { Props as ListProps } from './List';
|
|
26
|
+
import useList, { type Props as ListProps } from './List';
|
|
27
27
|
import ZoteroTranslateContext from '../context/ZoteroTranslateContext';
|
|
28
28
|
import './BibliographyList.css';
|
|
29
29
|
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
import _ from 'underscore';
|
|
14
14
|
import i18n from '../i18n/i18n';
|
|
15
15
|
import ColumnResize from './ColumnResize';
|
|
16
|
-
import useColumnSelector, { Props as ColumnSelectorProps } from './DataTableColumnSelector';
|
|
17
|
-
import useList, { Props as ListProps } from './List';
|
|
16
|
+
import useColumnSelector, { type Props as ColumnSelectorProps } from './DataTableColumnSelector';
|
|
17
|
+
import useList, { type Props as ListProps } from './List';
|
|
18
18
|
import './DataTable.css';
|
|
19
19
|
|
|
20
20
|
import type { Action } from './List';
|
|
@@ -22,10 +22,20 @@ type ImageType = {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
type Props = {
|
|
25
|
+
/**
|
|
26
|
+
* The array of images to display.
|
|
27
|
+
*/
|
|
25
28
|
images: Array<ImageType>,
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Callback fired when the close icon is clicked.
|
|
32
|
+
*/
|
|
26
33
|
onClose: () => void
|
|
27
34
|
};
|
|
28
35
|
|
|
36
|
+
/**
|
|
37
|
+
* This component renders a full screen image carousel component used to scroll through the passed array of images.
|
|
38
|
+
*/
|
|
29
39
|
const ImageCarousel = (props: Props) => {
|
|
30
40
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
31
41
|
const [visible, setVisible] = useState(true);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
+
import Viewer from '@samvera/clover-iiif/viewer';
|
|
3
4
|
import React, { useState, type Node } from 'react';
|
|
4
|
-
import { Button } from 'semantic-ui-react';
|
|
5
|
+
import { Button, Modal } from 'semantic-ui-react';
|
|
5
6
|
import _ from 'underscore';
|
|
6
7
|
import i18n from '../i18n/i18n';
|
|
7
|
-
import IIIFModal from './IIIFModal';
|
|
8
8
|
import LazyMedia from './LazyMedia';
|
|
9
9
|
|
|
10
10
|
type Props = {
|
|
@@ -34,11 +34,19 @@ const LazyIIIF = ({ manifest, options = {}, ...props }: Props) => {
|
|
|
34
34
|
{ props.children }
|
|
35
35
|
</LazyMedia>
|
|
36
36
|
{ modal && (
|
|
37
|
-
<
|
|
38
|
-
|
|
37
|
+
<Modal
|
|
38
|
+
centered={false}
|
|
39
|
+
closeIcon
|
|
39
40
|
onClose={() => setModal(false)}
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
open
|
|
42
|
+
>
|
|
43
|
+
<Modal.Content>
|
|
44
|
+
<Viewer
|
|
45
|
+
iiifContent={manifest}
|
|
46
|
+
options={_.defaults(options, { showIIIFBadge: false })}
|
|
47
|
+
/>
|
|
48
|
+
</Modal.Content>
|
|
49
|
+
</Modal>
|
|
42
50
|
)}
|
|
43
51
|
</>
|
|
44
52
|
);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
import { Icon, Button } from 'semantic-ui-react';
|
|
5
|
+
import i18n from '../i18n/i18n';
|
|
6
|
+
|
|
7
|
+
type Props = {
|
|
8
|
+
basic?: boolean,
|
|
9
|
+
className?: string,
|
|
10
|
+
color?: string,
|
|
11
|
+
compact?: boolean,
|
|
12
|
+
primary?: boolean,
|
|
13
|
+
size?: string,
|
|
14
|
+
secondary?: boolean,
|
|
15
|
+
url: string,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const ViewPDFButton = (props: Props) => {
|
|
19
|
+
/**
|
|
20
|
+
* Sets the appropriate class names based on the formatting props.
|
|
21
|
+
*
|
|
22
|
+
* @type {string}
|
|
23
|
+
*/
|
|
24
|
+
const className = useMemo(() => {
|
|
25
|
+
const classNames = ['ui', 'button'];
|
|
26
|
+
|
|
27
|
+
if (props.basic) {
|
|
28
|
+
classNames.push('basic');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (props.className) {
|
|
32
|
+
classNames.push(...props.className.split(' '));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (props.color) {
|
|
36
|
+
classNames.push(props.color);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (props.compact) {
|
|
40
|
+
classNames.push('compact');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (props.primary) {
|
|
44
|
+
classNames.push('primary');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (props.secondary) {
|
|
48
|
+
classNames.push('secondary');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (props.size) {
|
|
52
|
+
classNames.push(props.size);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return classNames.join(' ');
|
|
56
|
+
}, [props.basic, props.color]);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Button className={className} onClick={() => window.open(props.url, '_blank')}>
|
|
60
|
+
<Icon
|
|
61
|
+
name='file pdf'
|
|
62
|
+
/>
|
|
63
|
+
{i18n.t('Common.buttons.pdf')}
|
|
64
|
+
</Button>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default ViewPDFButton;
|
package/types/index.js.flow
CHANGED
|
@@ -47,7 +47,6 @@ export { default as FuzzyDate } from './components/FuzzyDate';
|
|
|
47
47
|
export { default as GoogleMap } from './components/GoogleMap';
|
|
48
48
|
export { default as GooglePlacesSearch } from './components/GooglePlacesSearch';
|
|
49
49
|
export { default as HorizontalCards } from './components/HorizontalCards';
|
|
50
|
-
export { default as IIIFModal } from './components/IIIFModal';
|
|
51
50
|
export { default as ImageCarousel } from './components/ImageCarousel';
|
|
52
51
|
export { default as ItemCollection } from './components/ItemCollection';
|
|
53
52
|
export { default as ItemList } from './components/ItemList';
|
package/webpack.config.js
CHANGED
|
@@ -2,6 +2,9 @@ const { configure } = require('@performant-software/webpack-config');
|
|
|
2
2
|
const path = require('path');
|
|
3
3
|
|
|
4
4
|
module.exports = configure(__dirname, {
|
|
5
|
+
externals: [
|
|
6
|
+
'@samvera/clover-iiif'
|
|
7
|
+
],
|
|
5
8
|
resolve: {
|
|
6
9
|
alias: {
|
|
7
10
|
'../../theme.config$': path.join(__dirname, '/src/css/theme.config'),
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Modal } from 'semantic-ui-react';
|
|
5
|
-
import { IIIFViewer } from '@performant-software/shared-components';
|
|
6
|
-
|
|
7
|
-
type Props = {
|
|
8
|
-
onClose: () => void
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const IIIFModal = ({ onClose, ...props }: Props) => (
|
|
12
|
-
<Modal
|
|
13
|
-
centered={false}
|
|
14
|
-
closeIcon
|
|
15
|
-
onClose={onClose}
|
|
16
|
-
open
|
|
17
|
-
>
|
|
18
|
-
<Modal.Content>
|
|
19
|
-
<IIIFViewer
|
|
20
|
-
{...props}
|
|
21
|
-
/>
|
|
22
|
-
</Modal.Content>
|
|
23
|
-
</Modal>
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
export default IIIFModal;
|