@alveole/components 0.34.4 → 0.34.7
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.
|
@@ -6,6 +6,7 @@ export type DocumentViewerProps = BoxProps & {
|
|
|
6
6
|
title: string;
|
|
7
7
|
source: string;
|
|
8
8
|
height?: BoxProps['height'];
|
|
9
|
+
ChildrenProps?: Omit<BoxProps, 'children'>;
|
|
9
10
|
};
|
|
10
11
|
export declare const DocumentViewer: (props: DocumentViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
//# sourceMappingURL=DocumentViewer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentViewer.d.ts","sourceRoot":"","sources":["../../../src/ui/DocumentViewer/DocumentViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAOzD,MAAM,MAAM,sBAAsB,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC;AACxD,eAAO,MAAM,wBAAwB,GAAI,OAAO,MAAM,KAAG,KAAK,IAAI,sBAC/B,CAAC;AAEpC,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG;IAC3C,IAAI,EAAE,OAAO,GAAG,KAAK,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"DocumentViewer.d.ts","sourceRoot":"","sources":["../../../src/ui/DocumentViewer/DocumentViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAOzD,MAAM,MAAM,sBAAsB,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,CAAC;AACxD,eAAO,MAAM,wBAAwB,GAAI,OAAO,MAAM,KAAG,KAAK,IAAI,sBAC/B,CAAC;AAEpC,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG;IAC3C,IAAI,EAAE,OAAO,GAAG,KAAK,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC5B,aAAa,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,4CAsFxD,CAAC"}
|
|
@@ -7,7 +7,7 @@ import { DocumentViewerPDF } from './DocumentViewerPDF';
|
|
|
7
7
|
import { DocumentViewerToolbar } from './DocumentViewerToolbar';
|
|
8
8
|
export const isDocumentViewerRotation = (value) => [0, 90, 180, 270].includes(value);
|
|
9
9
|
export const DocumentViewer = (props) => {
|
|
10
|
-
const { children, title, source, type, height = '100%', ...boxProps } = props;
|
|
10
|
+
const { children, title, source, type, height = '100%', ChildrenProps, ...boxProps } = props;
|
|
11
11
|
const styles = useStyles();
|
|
12
12
|
const [rotation, setRotation] = React.useState(0);
|
|
13
13
|
const [page, setPage] = React.useState(1);
|
|
@@ -44,5 +44,5 @@ export const DocumentViewer = (props) => {
|
|
|
44
44
|
return (_jsxs(Box, { tag: "document-viewer-wrapper", height: height, style: styles.viewerWrapper, children: [_jsxs(Box, { tag: "document-viewer", flex: 1, height: '100%', minW: 0, style: { flexBasis: 0 }, ...boxProps, children: [_jsx(DocumentViewerToolbar, { title: title, state: state, withChildren: children != null, onRotateLeft: () => handleRotate('left'), onRotateRight: () => handleRotate('right'), onNextPage: handleNextPage, onPreviousPage: handlePreviousPage }), _jsx(Box, { tag: "document-viewer-container", style: {
|
|
45
45
|
...styles.viewerContainer,
|
|
46
46
|
...(children ? { borderBottomRightRadius: 0 } : {}),
|
|
47
|
-
}, children: _jsxs(Box, { flex: 1, children: [type === 'image' && _jsx(DocumentViewerImage, { source: source, rotation: rotation, height: height }), type === 'pdf' && (_jsx(DocumentViewerPDF, { source: source, page: page, rotation: rotation, height: height, onReady: handlePdfReady }))] }) })] }), children && (_jsx(Box, { tag: "document-viewer-children", style: styles.children, children: children }))] }));
|
|
47
|
+
}, children: _jsxs(Box, { flex: 1, children: [type === 'image' && _jsx(DocumentViewerImage, { source: source, rotation: rotation, height: height }), type === 'pdf' && (_jsx(DocumentViewerPDF, { source: source, page: page, rotation: rotation, height: height, onReady: handlePdfReady }))] }) })] }), children && (_jsx(Box, { tag: "document-viewer-children", ...ChildrenProps, style: [styles.children, ChildrenProps?.style], children: children }))] }));
|
|
48
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/ui/ListItem/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAO,QAAQ,EAAqB,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAU,WAAW,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,SAAS,EAAc,MAAM,eAAe,CAAC;AAGtD,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;IAC9C,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,GAAG,KAAK,CAAC,CAAC;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/ui/ListItem/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAO,QAAQ,EAAqB,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAU,WAAW,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,SAAS,EAAc,MAAM,eAAe,CAAC;AAGtD,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;IAC9C,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,GAAG,KAAK,CAAC,CAAC;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,4CAwD5C,CAAC"}
|
|
@@ -7,5 +7,5 @@ import { useStyles } from './ListItem.styles';
|
|
|
7
7
|
export const ListItem = (props) => {
|
|
8
8
|
const { children, title, description, style, AvatarProps, IconProps, preview_url, trailing, loading = false, showSeparateur = true, ...itemProps } = props;
|
|
9
9
|
const styles = useStyles();
|
|
10
|
-
return (_jsxs(Box, { tag: "resource-item", style: [styles.item, style], hoverStyle: styles.itemHover, ...itemProps, children: [preview_url ? (_jsx(Box, { style: styles.previewContainer, children: _jsx(Image, { source: { uri: preview_url }, width: styles.preview.width, height: styles.preview.height, contentFit: "contain" }) })) : (_jsxs(_Fragment, { children: [IconProps && _jsx(LucideIcon, { size: "sm", color: styles.defaultIcon.color, ...IconProps }), AvatarProps && _jsx(Avatar, { size: "xs", ...AvatarProps })] })), _jsxs(Box, { style: styles.detail, children: [showSeparateur && _jsx(Box, { style: styles.separateur }), _jsxs(Box, { style: styles.principal, children: [_jsx(Typography, { style: styles.title, children: title }), description && _jsx(Typography, { style: styles.description, children: description })] }), trailing && trailing()] }), loading && (_jsx(Box, { style: styles.loading, children: _jsx(ActivityIndicator, { size: "small", color: styles.loading.color }) }))] }));
|
|
10
|
+
return (_jsxs(Box, { children: [_jsxs(Box, { tag: "resource-item", style: [styles.item, style], hoverStyle: styles.itemHover, ...itemProps, children: [preview_url ? (_jsx(Box, { style: styles.previewContainer, children: _jsx(Image, { source: { uri: preview_url }, width: styles.preview.width, height: styles.preview.height, contentFit: "contain" }) })) : (_jsxs(_Fragment, { children: [IconProps && _jsx(LucideIcon, { size: "sm", color: styles.defaultIcon.color, ...IconProps }), AvatarProps && _jsx(Avatar, { size: "xs", ...AvatarProps })] })), _jsxs(Box, { style: styles.detail, children: [showSeparateur && _jsx(Box, { style: styles.separateur }), _jsxs(Box, { style: styles.principal, children: [_jsx(Typography, { style: styles.title, children: title }), description && _jsx(Typography, { style: styles.description, children: description })] }), trailing && trailing()] }), loading && (_jsx(Box, { style: styles.loading, children: _jsx(ActivityIndicator, { size: "small", color: styles.loading.color }) }))] }), children] }));
|
|
11
11
|
};
|