@canlooks/can-ui 0.0.68 → 0.0.70
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/dist/cjs/components/accordion/accordion.js +2 -2
- package/dist/cjs/components/alert/alert.js +4 -3
- package/dist/cjs/components/boundary/errorBoundary.js +2 -2
- package/dist/cjs/components/bubbleConfirm/bubbleConfirm.js +2 -2
- package/dist/cjs/components/calendar/panelYear.js +2 -2
- package/dist/cjs/components/cascade/cascade.js +3 -3
- package/dist/cjs/components/cascade/cascadePanel.js +2 -2
- package/dist/cjs/components/checkboxBase/checkboxBase.js +2 -2
- package/dist/cjs/components/counter/counter.js +3 -3
- package/dist/cjs/components/curd/curd.js +6 -6
- package/dist/cjs/components/curd/curd.style.js +5 -0
- package/dist/cjs/components/curd/curdColumnConfig.js +2 -2
- package/dist/cjs/components/curd/curdDialog.js +2 -2
- package/dist/cjs/components/curd/curdFilter.js +3 -3
- package/dist/cjs/components/curd/curdResizable.js +2 -2
- package/dist/cjs/components/dataGrid/dataGridHead.js +2 -2
- package/dist/cjs/components/dataGrid/dataGridRows.js +3 -3
- package/dist/cjs/components/dateTimePicker/dateTimePicker.js +3 -3
- package/dist/cjs/components/dialog/dialog.js +2 -2
- package/dist/cjs/components/drawer/drawer.js +2 -2
- package/dist/cjs/components/gallery/gallery.js +5 -5
- package/dist/cjs/components/image/image.d.ts +1 -1
- package/dist/cjs/components/image/image.js +5 -4
- package/dist/cjs/components/inputBase/inputBase.js +2 -2
- package/dist/cjs/components/menuItem/menuItem.js +2 -2
- package/dist/cjs/components/pagination/pager.js +3 -3
- package/dist/cjs/components/palette/palette.js +2 -2
- package/dist/cjs/components/pickerDialog/pickerDialog.js +2 -2
- package/dist/cjs/components/pinchable/pinchable.js +7 -0
- package/dist/cjs/components/progress/progress.js +3 -3
- package/dist/cjs/components/rating/rating.js +2 -2
- package/dist/cjs/components/select/select.js +3 -3
- package/dist/cjs/components/snackbarBase/snackbarBase.js +3 -3
- package/dist/cjs/components/stepper/step.js +5 -5
- package/dist/cjs/components/tabs/tabsEllipsis.js +2 -2
- package/dist/cjs/components/tag/tag.js +2 -2
- package/dist/cjs/components/transfer/transfer.js +3 -3
- package/dist/cjs/components/tree/tree.js +2 -2
- package/dist/cjs/components/tree/treeNode.js +2 -2
- package/dist/cjs/components/treeSelect/treeSelect.js +2 -2
- package/dist/cjs/components/typography/typography.js +4 -4
- package/dist/cjs/components/upload/dropArea.js +2 -2
- package/dist/cjs/components/upload/fileItem.js +5 -5
- package/dist/cjs/components/upload/imageItem.js +3 -3
- package/dist/cjs/components/upload/upload.js +3 -3
- package/dist/cjs/extensions/documentViewer/documentViewer.js +4 -3
- package/dist/cjs/extensions/documentViewer/documentViewer.style.js +2 -1
- package/dist/cjs/extensions/documentViewer/svgViewer.d.ts +2 -2
- package/dist/cjs/extensions/documentViewer/svgViewer.js +13 -9
- package/dist/esm/components/accordion/accordion.js +1 -1
- package/dist/esm/components/alert/alert.js +2 -1
- package/dist/esm/components/boundary/errorBoundary.js +1 -1
- package/dist/esm/components/bubbleConfirm/bubbleConfirm.js +1 -1
- package/dist/esm/components/calendar/panelYear.js +1 -1
- package/dist/esm/components/cascade/cascade.js +1 -1
- package/dist/esm/components/cascade/cascadePanel.js +1 -1
- package/dist/esm/components/checkboxBase/checkboxBase.js +1 -1
- package/dist/esm/components/counter/counter.js +1 -1
- package/dist/esm/components/curd/curd.js +2 -2
- package/dist/esm/components/curd/curd.style.js +5 -0
- package/dist/esm/components/curd/curdColumnConfig.js +1 -1
- package/dist/esm/components/curd/curdDialog.js +1 -1
- package/dist/esm/components/curd/curdFilter.js +1 -1
- package/dist/esm/components/curd/curdResizable.js +1 -1
- package/dist/esm/components/dataGrid/dataGridHead.js +1 -1
- package/dist/esm/components/dataGrid/dataGridRows.js +1 -1
- package/dist/esm/components/dateTimePicker/dateTimePicker.js +1 -1
- package/dist/esm/components/dialog/dialog.js +1 -1
- package/dist/esm/components/drawer/drawer.js +1 -1
- package/dist/esm/components/gallery/gallery.js +1 -1
- package/dist/esm/components/image/image.d.ts +1 -1
- package/dist/esm/components/image/image.js +3 -2
- package/dist/esm/components/inputBase/inputBase.js +1 -1
- package/dist/esm/components/menuItem/menuItem.js +1 -1
- package/dist/esm/components/pagination/pager.js +1 -1
- package/dist/esm/components/palette/palette.js +1 -1
- package/dist/esm/components/pickerDialog/pickerDialog.js +1 -1
- package/dist/esm/components/pinchable/pinchable.js +7 -0
- package/dist/esm/components/progress/progress.js +1 -1
- package/dist/esm/components/rating/rating.js +1 -1
- package/dist/esm/components/select/select.js +1 -1
- package/dist/esm/components/snackbarBase/snackbarBase.js +1 -1
- package/dist/esm/components/stepper/step.js +1 -1
- package/dist/esm/components/tabs/tabsEllipsis.js +1 -1
- package/dist/esm/components/tag/tag.js +1 -1
- package/dist/esm/components/transfer/transfer.js +1 -1
- package/dist/esm/components/tree/tree.js +1 -1
- package/dist/esm/components/tree/treeNode.js +1 -1
- package/dist/esm/components/treeSelect/treeSelect.js +1 -1
- package/dist/esm/components/typography/typography.js +1 -1
- package/dist/esm/components/upload/dropArea.js +1 -1
- package/dist/esm/components/upload/fileItem.js +1 -1
- package/dist/esm/components/upload/imageItem.js +1 -1
- package/dist/esm/components/upload/upload.js +1 -1
- package/dist/esm/extensions/documentViewer/documentViewer.js +2 -1
- package/dist/esm/extensions/documentViewer/documentViewer.style.js +2 -1
- package/dist/esm/extensions/documentViewer/svgViewer.d.ts +2 -2
- package/dist/esm/extensions/documentViewer/svgViewer.js +12 -8
- package/documentation/dist/assets/{index-GiFWv3kZ.js → index-DvrKS6Tv.js} +2978 -2957
- package/documentation/dist/index.html +1 -1
- package/package.json +1 -2
|
@@ -4,7 +4,7 @@ import { classes, style } from './bubbleConfirm.style';
|
|
|
4
4
|
import { clsx, useControlled, useLoading } from '../../utils';
|
|
5
5
|
import { Button } from '../button';
|
|
6
6
|
import { useTheme } from '../theme';
|
|
7
|
-
import { Icon } from '
|
|
7
|
+
import { Icon } from '../icon';
|
|
8
8
|
import { faCircleQuestion } from '@fortawesome/free-solid-svg-icons/faCircleQuestion';
|
|
9
9
|
export function BubbleConfirm({ icon = _jsx(Icon, { icon: faCircleQuestion }), title, footer, showArrow = true, offset, loading = false, onConfirm, defaultOpen = false, open, onOpenChange, ...props }) {
|
|
10
10
|
const { spacing } = useTheme();
|
|
@@ -3,7 +3,7 @@ import { memo, useState } from 'react';
|
|
|
3
3
|
import { classes } from './calendar.style';
|
|
4
4
|
import { Button } from '../button';
|
|
5
5
|
import { Tooltip } from '../tooltip';
|
|
6
|
-
import { Icon } from '
|
|
6
|
+
import { Icon } from '../icon';
|
|
7
7
|
import { faAngleLeft } from '@fortawesome/free-solid-svg-icons/faAngleLeft';
|
|
8
8
|
import { faAngleRight } from '@fortawesome/free-solid-svg-icons/faAngleRight';
|
|
9
9
|
export const PanelYear = memo(({ innerD, setInnerD, onSelected, min, max }) => {
|
|
@@ -9,7 +9,7 @@ import { classes, cascadePopperStyle, style } from './cascade.style';
|
|
|
9
9
|
import { CascadePanel } from './cascadePanel';
|
|
10
10
|
import { SearchResult } from './searchResult';
|
|
11
11
|
import { useSelection } from '../selectionContext';
|
|
12
|
-
import { Icon } from '
|
|
12
|
+
import { Icon } from '../icon';
|
|
13
13
|
import { faMagnifyingGlass } from '@fortawesome/free-solid-svg-icons/faMagnifyingGlass';
|
|
14
14
|
import { faCaretDown } from '@fortawesome/free-solid-svg-icons/faCaretDown';
|
|
15
15
|
const CascadeContext = createContext({});
|
|
@@ -7,7 +7,7 @@ import { classes } from './cascade.style';
|
|
|
7
7
|
import { Collapse } from '../transitionBase';
|
|
8
8
|
import { useCascadeContext } from './cascade';
|
|
9
9
|
import { isUnset } from '../../utils';
|
|
10
|
-
import { Icon } from '
|
|
10
|
+
import { Icon } from '../icon';
|
|
11
11
|
import { faChevronRight } from '@fortawesome/free-solid-svg-icons/faChevronRight';
|
|
12
12
|
export function CascadePanel({ options, index = 0 }) {
|
|
13
13
|
const { innerLoading, loadingOption, multiple, showCheckbox, primaryKey, labelKey, childrenKey, pathifiedValue, selectionStatus, optionsMap, openedPanels, onOptionClick, onCheckboxClick, verticalIndex, setVerticalIndex, horizontalIndex } = useCascadeContext();
|
|
@@ -3,7 +3,7 @@ import { memo, useRef } from 'react';
|
|
|
3
3
|
import { clsx, cloneRef, useControlled, useTouchSpread } from '../../utils';
|
|
4
4
|
import { classes, useStyle } from './checkboxBase.style';
|
|
5
5
|
import { useCheckboxBaseGroupContext } from '../checkboxBaseGroup';
|
|
6
|
-
import { Icon } from '
|
|
6
|
+
import { Icon } from '../icon';
|
|
7
7
|
import { faCheck } from '@fortawesome/free-solid-svg-icons/faCheck';
|
|
8
8
|
export const CheckboxBase = memo(({ inputProps, _type, size, color, label, value, indeterminate, disabled, readOnly, defaultChecked = false, checked, onChange, ...props }) => {
|
|
9
9
|
const context = useCheckboxBaseGroupContext();
|
|
@@ -5,7 +5,7 @@ import { clsx, useControlled } from '../../utils';
|
|
|
5
5
|
import { Button } from '../button';
|
|
6
6
|
import { Input } from '../input';
|
|
7
7
|
import { Flex } from '../flex';
|
|
8
|
-
import { Icon } from '
|
|
8
|
+
import { Icon } from '../icon';
|
|
9
9
|
import { faMinus } from '@fortawesome/free-solid-svg-icons/faMinus';
|
|
10
10
|
import { faPlus } from '@fortawesome/free-solid-svg-icons/faPlus';
|
|
11
11
|
export const Counter = memo(({ size, min = -Infinity, max = Infinity, step = 1, precision = 0, defaultValue = 0, value, onChange, decreaseProps, increaseProps, inputProps, ...props }) => {
|
|
@@ -14,7 +14,7 @@ import { CurdDialog } from './curdDialog';
|
|
|
14
14
|
import { useAppContext } from '../app';
|
|
15
15
|
import { BubbleConfirm } from '../bubbleConfirm';
|
|
16
16
|
import { useSelectionContext } from '../selectionContext';
|
|
17
|
-
import { Icon } from '
|
|
17
|
+
import { Icon } from '../icon';
|
|
18
18
|
import { faTrashCan } from '@fortawesome/free-regular-svg-icons/faTrashCan';
|
|
19
19
|
import { faPenToSquare } from '@fortawesome/free-regular-svg-icons/faPenToSquare';
|
|
20
20
|
import { faPlus } from '@fortawesome/free-solid-svg-icons/faPlus';
|
|
@@ -92,7 +92,7 @@ export const Curd = memo((props) => {
|
|
|
92
92
|
* -------------------------------------------------------------
|
|
93
93
|
* 表格设置
|
|
94
94
|
*/
|
|
95
|
-
const [innerSize, setInnerSize] = useDerivedState(props.tableProps?.size || 'medium');
|
|
95
|
+
const [innerSize, setInnerSize] = useDerivedState(props.size || props.tableProps?.size || 'medium');
|
|
96
96
|
const [innerPage, setInnerPage] = useControlled(props.paginationProps?.defaultPage ?? 1, props.paginationProps?.page, props.paginationProps?.onPageChange);
|
|
97
97
|
const [innerPageSize, setInnerPageSize] = useControlled(props.paginationProps?.defaultPageSize ?? 10, props.paginationProps?.pageSize, props.paginationProps?.onPageSizeChange);
|
|
98
98
|
const [innerOrderColumn, setInnerOrderColumn] = useControlled(props.defaultOrderColumn, props.orderColumn);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { defineInnerClasses, defineCss } from '../../utils';
|
|
3
3
|
import { classes as buttonClasses } from '../button/button.style';
|
|
4
|
+
import { classes as loadingClasses } from '../loading/loading.style';
|
|
4
5
|
export const classes = defineInnerClasses('curd', [
|
|
5
6
|
'filter',
|
|
6
7
|
'filterGridContainer',
|
|
@@ -73,6 +74,10 @@ export const style = defineCss(({ spacing, text, background, borderRadius }) =>
|
|
|
73
74
|
.${classes.card} {
|
|
74
75
|
min-height: 0;
|
|
75
76
|
border-radius: ${borderRadius}px;
|
|
77
|
+
|
|
78
|
+
.${loadingClasses.container} {
|
|
79
|
+
height: 100%;
|
|
80
|
+
}
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
&[data-variant=standard] {
|
|
@@ -9,7 +9,7 @@ import { SortableItem } from '../sortableItem';
|
|
|
9
9
|
import { DndContext } from '@dnd-kit/core';
|
|
10
10
|
import { SortableContext } from '@dnd-kit/sortable';
|
|
11
11
|
import { isUnset, onDndDragEnd, useDndSensors } from '../../utils';
|
|
12
|
-
import { Icon } from '
|
|
12
|
+
import { Icon } from '../icon';
|
|
13
13
|
import { faGear } from '@fortawesome/free-solid-svg-icons/faGear';
|
|
14
14
|
export const CurdColumnConfig = memo(({ columns, innerVisible, setInnerVisible, setInnerOrder, }) => {
|
|
15
15
|
columns ||= [];
|
|
@@ -9,7 +9,7 @@ import { Loading } from '../loading';
|
|
|
9
9
|
import { Button } from '../button';
|
|
10
10
|
import { classes, dialogStyle } from './curd.style';
|
|
11
11
|
import { PickerDialog } from '../pickerDialog';
|
|
12
|
-
import { Icon } from '
|
|
12
|
+
import { Icon } from '../icon';
|
|
13
13
|
import { faCopy } from '@fortawesome/free-regular-svg-icons/faCopy';
|
|
14
14
|
export const CurdDialog = memo(({ ref, onFinish, curdProps, ...props }) => {
|
|
15
15
|
const { columns, rowToForm, copyable, titleKey, formProps, formRef, dataName = '', createName = '添加', updateName = '编辑' } = curdProps;
|
|
@@ -8,7 +8,7 @@ import { Grid } from '../grid';
|
|
|
8
8
|
import { Button } from '../button';
|
|
9
9
|
import { Collapse } from '../transitionBase';
|
|
10
10
|
import { useTheme } from '../theme';
|
|
11
|
-
import { Icon } from '
|
|
11
|
+
import { Icon } from '../icon';
|
|
12
12
|
import { faChevronDown } from '@fortawesome/free-solid-svg-icons/faChevronDown';
|
|
13
13
|
import { faFilter } from '@fortawesome/free-solid-svg-icons/faFilter';
|
|
14
14
|
export const CurdFilter = memo(({ ref, columns, expandable, showButton, renderConditions, buttonProps, onFilter, ...props }) => {
|
|
@@ -4,7 +4,7 @@ import { Tooltip } from '../tooltip';
|
|
|
4
4
|
import { Bubble } from '../bubble';
|
|
5
5
|
import { MenuItem } from '../menuItem';
|
|
6
6
|
import { Button } from '../button';
|
|
7
|
-
import { Icon } from '
|
|
7
|
+
import { Icon } from '../icon';
|
|
8
8
|
import { faArrowsUpDown } from '@fortawesome/free-solid-svg-icons/faArrowsUpDown';
|
|
9
9
|
export const CurdResizable = memo(({ innerSize, setInnerSize }) => {
|
|
10
10
|
return (_jsx(Tooltip, { title: "\u8868\u683C\u5C3A\u5BF8", children: _jsx(Bubble, { placement: "bottom", content: _jsxs(_Fragment, { children: [_jsx(MenuItem, { value: "small", label: "\u5C0F", selected: innerSize === 'small', onClick: () => setInnerSize('small') }), _jsx(MenuItem, { value: "medium", label: "\u4E2D", selected: innerSize === 'medium', onClick: () => setInnerSize('medium') }), _jsx(MenuItem, { value: "large", label: "\u5927", selected: innerSize === 'large', onClick: () => setInnerSize('large') })] }), children: _jsx(Button, { shape: "circular", variant: "text", color: "text.secondary", children: _jsx(Icon, { icon: faArrowsUpDown }) }) }) }));
|
|
@@ -6,7 +6,7 @@ import { DataGrid } from './dataGrid';
|
|
|
6
6
|
import { useRenderHead } from './columnResize';
|
|
7
7
|
import { Checkbox } from '../checkbox';
|
|
8
8
|
import { isUnset } from '../../utils';
|
|
9
|
-
import { Icon } from '
|
|
9
|
+
import { Icon } from '../icon';
|
|
10
10
|
import { useSelectionContext } from '../selectionContext';
|
|
11
11
|
import { Tooltip } from '../tooltip';
|
|
12
12
|
import { faCaretDown } from '@fortawesome/free-solid-svg-icons/faCaretDown';
|
|
@@ -9,7 +9,7 @@ import { Radio } from '../radio';
|
|
|
9
9
|
import { TdCell } from '../table';
|
|
10
10
|
import { Button } from '../button';
|
|
11
11
|
import { Collapse } from '../transitionBase';
|
|
12
|
-
import { Icon } from '
|
|
12
|
+
import { Icon } from '../icon';
|
|
13
13
|
import { faMinusSquare } from '@fortawesome/free-regular-svg-icons/faMinusSquare';
|
|
14
14
|
import { faPlusSquare } from '@fortawesome/free-regular-svg-icons/faPlusSquare';
|
|
15
15
|
import { classes } from './dataGrid.style';
|
|
@@ -8,7 +8,7 @@ import dayjs from 'dayjs';
|
|
|
8
8
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
9
9
|
import { Calendar } from '../calendar';
|
|
10
10
|
import { Timer } from './timer';
|
|
11
|
-
import { Icon } from '
|
|
11
|
+
import { Icon } from '../icon';
|
|
12
12
|
import { faCalendar } from '@fortawesome/free-regular-svg-icons/faCalendar';
|
|
13
13
|
import { faClock } from '@fortawesome/free-regular-svg-icons/faClock';
|
|
14
14
|
dayjs.extend(customParseFormat);
|
|
@@ -5,7 +5,7 @@ import { classes, style } from './dialog.style';
|
|
|
5
5
|
import { clsx, cloneRef, useControlled, useEscapeClosable, useLoading } from '../../utils';
|
|
6
6
|
import { Button } from '../button';
|
|
7
7
|
import { Draggable } from '../draggable';
|
|
8
|
-
import { Icon } from '
|
|
8
|
+
import { Icon } from '../icon';
|
|
9
9
|
import { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';
|
|
10
10
|
export function Dialog({ ref, icon, title, footer, prefix, suffix, width = 420, minWidth, maxWidth = '100%', showClose = true, closeProps, showConfirm = true, confirmText = '确 定', confirmProps, onConfirm, confirmLoading = false, showCancel = true, cancelText = '取 消', cancelProps, onCancel, draggable = true, maskClosable = true, escapeClosable = true, defaultOpen = false, open, onClose, ...props }) {
|
|
11
11
|
const [innerOpen, _setInnerOpen] = useControlled(defaultOpen, open);
|
|
@@ -5,7 +5,7 @@ import { clsx, useControlled } from '../../utils';
|
|
|
5
5
|
import { OverlayBase } from '../overlayBase';
|
|
6
6
|
import { Button } from '../button';
|
|
7
7
|
import { Slide } from '../transitionBase';
|
|
8
|
-
import { Icon } from '
|
|
8
|
+
import { Icon } from '../icon';
|
|
9
9
|
import { faAnglesRight } from '@fortawesome/free-solid-svg-icons/faAnglesRight';
|
|
10
10
|
const placementToDirection = {
|
|
11
11
|
left: 'right',
|
|
@@ -5,7 +5,7 @@ import { clsx, cubicBezier, range, toArray, useControlled, useDraggable, useSync
|
|
|
5
5
|
import { classes, style } from './gallery.style';
|
|
6
6
|
import { Button } from '../button';
|
|
7
7
|
import { Tooltip } from '../tooltip';
|
|
8
|
-
import { Icon } from '
|
|
8
|
+
import { Icon } from '../icon';
|
|
9
9
|
import { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';
|
|
10
10
|
import { faExpand } from '@fortawesome/free-solid-svg-icons/faExpand';
|
|
11
11
|
import { faAngleLeft } from '@fortawesome/free-solid-svg-icons/faAngleLeft';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { CSSProperties, ReactNode, JSX, ReactElement } from 'react';
|
|
2
2
|
import { DivProps } from '../../types';
|
|
3
|
-
import { Gallery, ImagePreviewProps } from '../gallery
|
|
3
|
+
import { Gallery, ImagePreviewProps } from '../gallery';
|
|
4
4
|
export interface ImageProps extends DivProps {
|
|
5
5
|
src?: string;
|
|
6
6
|
fallback?: string;
|
|
@@ -2,8 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import { memo, useRef } from 'react';
|
|
3
3
|
import { classes, style } from './image.style';
|
|
4
4
|
import { clsx, cloneRef, useControlled, useDerivedState } from '../../utils';
|
|
5
|
-
import { Gallery } from '../gallery
|
|
6
|
-
import { Icon
|
|
5
|
+
import { Gallery } from '../gallery';
|
|
6
|
+
import { Icon } from '../icon';
|
|
7
|
+
import { Skeleton } from '../skeleton';
|
|
7
8
|
import { faEye } from '@fortawesome/free-regular-svg-icons/faEye';
|
|
8
9
|
export const Image = memo(({ src, fallback, onLoad, onError, renderLoading, alt = '', width, height, objectFit = 'cover', objectPosition = 'center', imgProps, actions, previewable = true, previewProps, onPreview, ...props }) => {
|
|
9
10
|
const imgRef = useRef(null);
|
|
@@ -5,7 +5,7 @@ import { clsx, fixInputNumber, useControlled } from '../../utils';
|
|
|
5
5
|
import { useTheme } from '../theme';
|
|
6
6
|
import { Button } from '../button';
|
|
7
7
|
import { LoadingIndicator } from '../loadingIndicator';
|
|
8
|
-
import { Icon } from '
|
|
8
|
+
import { Icon } from '../icon';
|
|
9
9
|
import { faCircleXmark } from '@fortawesome/free-solid-svg-icons/faCircleXmark';
|
|
10
10
|
export const InputBase = (({ variant = 'outlined', size, shape, color = 'primary', children, prefix, suffix, onClear, loading, type, clearable = type !== 'number',
|
|
11
11
|
// 以下属性传递给<input/>
|
|
@@ -6,7 +6,7 @@ import { Checkbox } from '../checkbox';
|
|
|
6
6
|
import { usePopperContext } from '../popper';
|
|
7
7
|
import { useMenuContext } from '../menu';
|
|
8
8
|
import { Collapse } from '../transitionBase';
|
|
9
|
-
import { Icon } from '
|
|
9
|
+
import { Icon } from '../icon';
|
|
10
10
|
import { faChevronDown } from '@fortawesome/free-solid-svg-icons/faChevronDown';
|
|
11
11
|
export const MenuItem = memo(({ value, size, color = 'primary', emphasized = false, selected, focused = false, disabled = false, showCheckbox, checkboxProps, ellipsis, prefix, label, suffix, searchToken, _level = 0, indent, expandIcon, defaultExpanded = false, expanded, onExpandedChange, ...props }) => {
|
|
12
12
|
const context = useMenuContext();
|
|
@@ -5,7 +5,7 @@ import { classes } from './pagination.style';
|
|
|
5
5
|
import { usePaginationContext } from './pagination';
|
|
6
6
|
import { clsx } from '../../utils';
|
|
7
7
|
import { useTheme } from '../theme';
|
|
8
|
-
import { Icon } from '
|
|
8
|
+
import { Icon } from '../icon';
|
|
9
9
|
import { faEllipsis } from '@fortawesome/free-solid-svg-icons/faEllipsis';
|
|
10
10
|
import { faAngleLeft } from '@fortawesome/free-solid-svg-icons/faAngleLeft';
|
|
11
11
|
import { faAngleRight } from '@fortawesome/free-solid-svg-icons/faAngleRight';
|
|
@@ -7,7 +7,7 @@ import { Slider } from '../slider';
|
|
|
7
7
|
import Color from 'color';
|
|
8
8
|
import { Button } from '../button';
|
|
9
9
|
import { ColorValueInput } from './colorValueInput';
|
|
10
|
-
import { Icon } from '
|
|
10
|
+
import { Icon } from '../icon';
|
|
11
11
|
import { faChevronDown } from '@fortawesome/free-solid-svg-icons/faChevronDown';
|
|
12
12
|
const sliderProps = {
|
|
13
13
|
railSize: 9,
|
|
@@ -7,7 +7,7 @@ import { SelectionContext } from '../selectionContext';
|
|
|
7
7
|
import { Divider } from '../divider';
|
|
8
8
|
import { SelectedList } from '../selectedList';
|
|
9
9
|
import { Button } from '../button';
|
|
10
|
-
import { Icon } from '
|
|
10
|
+
import { Icon } from '../icon';
|
|
11
11
|
import { faTrashCan } from '@fortawesome/free-regular-svg-icons/faTrashCan';
|
|
12
12
|
export const PickerDialog = (({ ref, dialogRef, multiple, children, showSelectedList = !!multiple, selectedListPlacement = 'right', selectedListProps, selectedItemProps, onConfirm, rows, nodes,
|
|
13
13
|
// 以下属性从SelectionContextBaseProps继承
|
|
@@ -140,6 +140,12 @@ export const Pinchable = (({ component: Component = 'div', ref, gestureOptions,
|
|
|
140
140
|
resetZoom();
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
|
+
const wheelHandler = (e) => {
|
|
144
|
+
childrenProps.onMouseWheel?.(e);
|
|
145
|
+
e.deltaY > 0
|
|
146
|
+
? zoomFn(innerScale.current * .8, e.clientX, e.clientY)
|
|
147
|
+
: zoomFn(innerScale.current * 1.2, e.clientX, e.clientY);
|
|
148
|
+
};
|
|
143
149
|
return (_jsx(Component, { ...props, ref: wrapperRef, css: style, className: clsx(classes.root, props.className), ...pinchableHandles, children: cloneElement(children, {
|
|
144
150
|
ref: cloneRef(contentRef, childrenProps.ref),
|
|
145
151
|
className: clsx(classes.content, childrenProps.className),
|
|
@@ -152,6 +158,7 @@ export const Pinchable = (({ component: Component = 'div', ref, gestureOptions,
|
|
|
152
158
|
},
|
|
153
159
|
...draggableHandles,
|
|
154
160
|
onDoubleClick: doubleClickHandler,
|
|
161
|
+
onWheel: wheelHandler,
|
|
155
162
|
onTransitionEnd: e => e.currentTarget.dataset.transition = 'false'
|
|
156
163
|
}) }));
|
|
157
164
|
});
|
|
@@ -4,7 +4,7 @@ import { classes, useStyle } from './progress.style';
|
|
|
4
4
|
import { clsx } from '../../utils';
|
|
5
5
|
import { useTheme } from '../theme';
|
|
6
6
|
import { css, keyframes } from '@emotion/react';
|
|
7
|
-
import { Icon } from '
|
|
7
|
+
import { Icon } from '../icon';
|
|
8
8
|
import { faCircleCheck } from '@fortawesome/free-solid-svg-icons/faCircleCheck';
|
|
9
9
|
import { faCircleXmark } from '@fortawesome/free-solid-svg-icons/faCircleXmark';
|
|
10
10
|
export const Progress = memo(({ showInfo = true, renderInfo, color, status = 'default', variant = 'linear', gapDegree = 90, size = 60, indeterminate = false, barWidth = 4, strokeLinecap = variant === 'gauge' ? 'butt' : 'round', value = 0, ...props }) => {
|
|
@@ -3,7 +3,7 @@ import { cloneElement, isValidElement, memo, useState } from 'react';
|
|
|
3
3
|
import { clsx, useControlled } from '../../utils';
|
|
4
4
|
import { classes, useStyle } from './rating.style';
|
|
5
5
|
import { useTheme } from '../theme';
|
|
6
|
-
import { Icon } from '
|
|
6
|
+
import { Icon } from '../icon';
|
|
7
7
|
import { faStar } from '@fortawesome/free-solid-svg-icons/faStar';
|
|
8
8
|
export const Rating = memo(({ color = '#FFCC00', size, count = 5, renderStar = _jsx(Icon, { icon: faStar }), allowHalf, highlightSelectedOnly = false, defaultValue = 0, value, onChange, readOnly, disabled, ...props }) => {
|
|
9
9
|
const theme = useTheme();
|
|
@@ -11,7 +11,7 @@ import { Input } from '../input';
|
|
|
11
11
|
import { LoadingIndicator } from '../loadingIndicator';
|
|
12
12
|
import { popperStyle } from '../popper/popper.style';
|
|
13
13
|
import { useShallowSelection } from '../selectionContext';
|
|
14
|
-
import { Icon } from '
|
|
14
|
+
import { Icon } from '../icon';
|
|
15
15
|
import { faChevronDown } from '@fortawesome/free-solid-svg-icons/faChevronDown';
|
|
16
16
|
import { faMagnifyingGlass } from '@fortawesome/free-solid-svg-icons/faMagnifyingGlass';
|
|
17
17
|
export const Select = memo(({ inputProps, popperProps, popperRef, defaultOpen = false, open, onOpenChange, sizeAdaptable = true, children, multiple, defaultValue, value, onChange, renderBackfill, searchable, defaultSearchValue = '', searchValue, onSearchChange, searchInputProps,
|
|
@@ -8,7 +8,7 @@ import { TransitionGroup } from 'react-transition-group';
|
|
|
8
8
|
import { StatusIcon, statusMapToIconDefinition } from '../status';
|
|
9
9
|
import { Button } from '../button';
|
|
10
10
|
import { createPortal } from 'react-dom';
|
|
11
|
-
import { Icon } from '
|
|
11
|
+
import { Icon } from '../icon';
|
|
12
12
|
import { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';
|
|
13
13
|
export class SnackbarBaseMethods {
|
|
14
14
|
async info(_) {
|
|
@@ -4,7 +4,7 @@ import { clsx } from '../../utils';
|
|
|
4
4
|
import { classes, useStyle } from './step.style';
|
|
5
5
|
import { useStepperContext } from './stepper';
|
|
6
6
|
import { useTheme } from '../theme';
|
|
7
|
-
import { Icon } from '
|
|
7
|
+
import { Icon } from '../icon';
|
|
8
8
|
import { faCheck } from '@fortawesome/free-solid-svg-icons/faCheck';
|
|
9
9
|
import { faCircleInfo } from '@fortawesome/free-solid-svg-icons/faCircleInfo';
|
|
10
10
|
import { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';
|
|
@@ -4,7 +4,7 @@ import { classes } from './tabs.style';
|
|
|
4
4
|
import { Popper } from '../popper';
|
|
5
5
|
import { tabsEllipsisPopperStyle } from './tabsEllipsis.style';
|
|
6
6
|
import { OptionsBase } from '../optionsBase';
|
|
7
|
-
import { Icon } from '
|
|
7
|
+
import { Icon } from '../icon';
|
|
8
8
|
import { faEllipsis } from '@fortawesome/free-solid-svg-icons/faEllipsis';
|
|
9
9
|
export const TabsEllipsis = memo(({ tabs, children, labelKey = 'label', primaryKey = 'value', value, onToggleSelected }) => {
|
|
10
10
|
const [open, setOpen] = useState(false);
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { classes, useStyle } from './tag.style';
|
|
4
4
|
import { clsx } from '../../utils';
|
|
5
|
-
import { Icon } from '
|
|
5
|
+
import { Icon } from '../icon';
|
|
6
6
|
import { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';
|
|
7
7
|
export const Tag = memo(({ variant = 'outlined', color = 'text.secondary', shape = 'square', size = 'small', prefix, suffix, clickable, closable, onClose, ...props }) => {
|
|
8
8
|
const closeHandler = (e) => {
|
|
@@ -4,7 +4,7 @@ import { classes, style } from './transfer.style';
|
|
|
4
4
|
import { clsx, useControlled } from '../../utils';
|
|
5
5
|
import { Button } from '../button';
|
|
6
6
|
import { TransferPanel } from './transferPanel';
|
|
7
|
-
import { Icon } from '
|
|
7
|
+
import { Icon } from '../icon';
|
|
8
8
|
import { faAngleLeft } from '@fortawesome/free-solid-svg-icons/faAngleLeft';
|
|
9
9
|
import { faAngleRight } from '@fortawesome/free-solid-svg-icons/faAngleRight';
|
|
10
10
|
const TransferContext = createContext({});
|
|
@@ -8,7 +8,7 @@ import { clsx, useTreeSearch } from '../../utils';
|
|
|
8
8
|
import { Highlight } from '../highlight';
|
|
9
9
|
import { Placeholder } from '../placeholder';
|
|
10
10
|
import { TreeNode } from './treeNode';
|
|
11
|
-
import { Icon } from '
|
|
11
|
+
import { Icon } from '../icon';
|
|
12
12
|
import { faMagnifyingGlass } from '@fortawesome/free-solid-svg-icons/faMagnifyingGlass';
|
|
13
13
|
const TreeContext = createContext({});
|
|
14
14
|
export function useTreeContext() {
|
|
@@ -7,7 +7,7 @@ import { Button } from '../button';
|
|
|
7
7
|
import { Checkbox } from '../checkbox';
|
|
8
8
|
import { useTreeContext } from './tree';
|
|
9
9
|
import { useSelectionContext } from '../selectionContext';
|
|
10
|
-
import { Icon } from '
|
|
10
|
+
import { Icon } from '../icon';
|
|
11
11
|
import { faChevronRight } from '@fortawesome/free-solid-svg-icons/faChevronRight';
|
|
12
12
|
export const TreeNode = memo(({ value, label, prefix, suffix, disabled, _level = 0, ...props }) => {
|
|
13
13
|
const { expandedSet = new Set(), toggleExpanded, indent, renderExpandIcon, showCheckbox, readOnly, clickLabelToExpand, ...context } = useTreeContext();
|
|
@@ -9,7 +9,7 @@ import { popperStyle } from '../popper/popper.style';
|
|
|
9
9
|
import { Tag } from '../tag';
|
|
10
10
|
import { classes, style } from './treeSelect.style';
|
|
11
11
|
import { useSelection } from '../selectionContext';
|
|
12
|
-
import { Icon } from '
|
|
12
|
+
import { Icon } from '../icon';
|
|
13
13
|
import { faChevronDown } from '@fortawesome/free-solid-svg-icons/faChevronDown';
|
|
14
14
|
export const TreeSelect = memo(({ inputProps, popperProps, popperRef, nodes, options, defaultValue, value, onChange, sizeAdaptable, loading, defaultOpen, open, onOpenChange, renderBackfill,
|
|
15
15
|
// 以下属性转发至<InputBase/>
|
|
@@ -6,7 +6,7 @@ import { Button } from '../button';
|
|
|
6
6
|
import { Tooltip } from '../tooltip';
|
|
7
7
|
import { Input } from '../input';
|
|
8
8
|
import { Textarea } from '../textarea';
|
|
9
|
-
import { Icon } from '
|
|
9
|
+
import { Icon } from '../icon';
|
|
10
10
|
import { faCheck } from '@fortawesome/free-solid-svg-icons/faCheck';
|
|
11
11
|
import { faCopy } from '@fortawesome/free-regular-svg-icons/faCopy';
|
|
12
12
|
import { faPenToSquare } from '@fortawesome/free-regular-svg-icons/faPenToSquare';
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import { memo, useEffect, useState } from 'react';
|
|
3
3
|
import { classes, style } from './dropArea.style';
|
|
4
4
|
import { clsx } from '../../utils';
|
|
5
|
-
import { Icon } from '
|
|
5
|
+
import { Icon } from '../icon';
|
|
6
6
|
import { faInbox } from '@fortawesome/free-solid-svg-icons/faInbox';
|
|
7
7
|
export const DropArea = memo(({ description = '点击选择文件,或将文件拖拽到这里', onDrop, ...props }) => {
|
|
8
8
|
const [draggingOver, setDraggingOver] = useState(false);
|
|
@@ -6,7 +6,7 @@ import { Button } from '../button';
|
|
|
6
6
|
import { Progress } from '../progress';
|
|
7
7
|
import { useTheme } from '../theme';
|
|
8
8
|
import { useItemStatus } from './itemStatus';
|
|
9
|
-
import { Icon } from '
|
|
9
|
+
import { Icon } from '../icon';
|
|
10
10
|
import { faCircleCheck } from '@fortawesome/free-solid-svg-icons/faCircleCheck';
|
|
11
11
|
import { faCircleXmark } from '@fortawesome/free-solid-svg-icons/faCircleXmark';
|
|
12
12
|
import { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';
|
|
@@ -6,7 +6,7 @@ import { Image } from '../image';
|
|
|
6
6
|
import { Button } from '../button';
|
|
7
7
|
import { Progress } from '../progress';
|
|
8
8
|
import { clsx } from '../../utils';
|
|
9
|
-
import { Icon } from '
|
|
9
|
+
import { Icon } from '../icon';
|
|
10
10
|
import { faTrashCan } from '@fortawesome/free-regular-svg-icons/faTrashCan';
|
|
11
11
|
import { faEye } from '@fortawesome/free-regular-svg-icons/faEye';
|
|
12
12
|
export const ImageItem = memo((props) => {
|
|
@@ -11,7 +11,7 @@ import { DndContext } from '@dnd-kit/core';
|
|
|
11
11
|
import { SortableContext } from '@dnd-kit/sortable';
|
|
12
12
|
import { SortableItem } from '../sortableItem';
|
|
13
13
|
import { DropArea } from './dropArea';
|
|
14
|
-
import { Icon } from '
|
|
14
|
+
import { Icon } from '../icon';
|
|
15
15
|
import { faPlus } from '@fortawesome/free-solid-svg-icons/faPlus';
|
|
16
16
|
import { faUpload } from '@fortawesome/free-solid-svg-icons/faUpload';
|
|
17
17
|
const markFileId = (files) => {
|
|
@@ -7,7 +7,8 @@ import { Button } from '../../components/button';
|
|
|
7
7
|
import { iframeStyle } from './documentViewer.style';
|
|
8
8
|
import { useDerivedState, useLoading } from '../../utils';
|
|
9
9
|
import { PdfViewer } from './pdfViewer';
|
|
10
|
-
import {
|
|
10
|
+
import { Icon } from '../../components/icon';
|
|
11
|
+
import { Gallery } from '../../components/gallery';
|
|
11
12
|
import { faDownload } from '@fortawesome/free-solid-svg-icons/faDownload';
|
|
12
13
|
export const DocumentViewer = memo(({ src, filename, onError, type, extension, setDocumentTitle = true }) => {
|
|
13
14
|
const mimeType = useMemo(() => {
|
|
@@ -61,7 +61,7 @@ export const svgStyle = defineCss(({ spacing, background, divider, text, colors,
|
|
|
61
61
|
background-color: ${background.body};
|
|
62
62
|
overflow: hidden;
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
.${classes.svgContent}, .${classes.object} {
|
|
66
66
|
width: 100%;
|
|
67
67
|
height: 100%;
|
|
@@ -69,6 +69,7 @@ export const svgStyle = defineCss(({ spacing, background, divider, text, colors,
|
|
|
69
69
|
|
|
70
70
|
.${classes.object} {
|
|
71
71
|
pointer-events: none;
|
|
72
|
+
user-select: none;
|
|
72
73
|
transition: rotate .4s ${easing.easeOut};
|
|
73
74
|
}
|
|
74
75
|
`);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ReactZoomPanPinchProps } from 'react-zoom-pan-pinch';
|
|
2
1
|
import { Theme } from '../../components/theme';
|
|
3
2
|
import { LoadingProps } from '../../components/loading';
|
|
4
3
|
import { DocumentViewerBaseProps } from './documentViewer';
|
|
4
|
+
import { PinchableProps } from '../../components/pinchable';
|
|
5
5
|
export interface SvgViewerProps extends DocumentViewerBaseProps, Omit<LoadingProps, 'onError'> {
|
|
6
6
|
/** 是否显示下载按钮,默认为true */
|
|
7
7
|
showDownload?: boolean;
|
|
8
8
|
/** 是否可切换主题,默认为true */
|
|
9
9
|
themeSwitchable?: boolean;
|
|
10
10
|
onThemeChange?(mode: Theme['mode']): void;
|
|
11
|
-
|
|
11
|
+
pinchableProps?: PinchableProps;
|
|
12
12
|
}
|
|
13
13
|
export declare const SvgViewer: import("react").MemoExoticComponent<(props: SvgViewerProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { memo, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { classes, svgStyle } from './documentViewer.style';
|
|
4
|
-
import { TransformWrapper, TransformComponent } from 'react-zoom-pan-pinch';
|
|
5
4
|
import { clsx } from '../../utils';
|
|
6
5
|
import { Button } from '../../components/button';
|
|
7
6
|
import { Tooltip } from '../../components/tooltip';
|
|
@@ -10,7 +9,7 @@ import { Switch } from '../../components/switch';
|
|
|
10
9
|
import { ThemeProvider, useTheme } from '../../components/theme';
|
|
11
10
|
import { Loading } from '../../components/loading';
|
|
12
11
|
import { useBlob, useDocumentTitle } from './documentViewer';
|
|
13
|
-
import { Icon } from '
|
|
12
|
+
import { Icon } from '../../components/icon';
|
|
14
13
|
import { faDiagramProject } from '@fortawesome/free-solid-svg-icons/faDiagramProject';
|
|
15
14
|
import { faDownload } from '@fortawesome/free-solid-svg-icons/faDownload';
|
|
16
15
|
import { faExpand } from '@fortawesome/free-solid-svg-icons/faExpand';
|
|
@@ -20,6 +19,7 @@ import { faRotateLeft } from '@fortawesome/free-solid-svg-icons/faRotateLeft';
|
|
|
20
19
|
import { faRotateRight } from '@fortawesome/free-solid-svg-icons/faRotateRight';
|
|
21
20
|
import { faMagnifyingGlassMinus } from '@fortawesome/free-solid-svg-icons/faMagnifyingGlassMinus';
|
|
22
21
|
import { faMagnifyingGlassPlus } from '@fortawesome/free-solid-svg-icons/faMagnifyingGlassPlus';
|
|
22
|
+
import { Pinchable } from '../../components/pinchable';
|
|
23
23
|
const commonButtonProps = {
|
|
24
24
|
variant: 'text',
|
|
25
25
|
shape: 'circular'
|
|
@@ -27,7 +27,7 @@ const commonButtonProps = {
|
|
|
27
27
|
export const SvgViewer = memo((props) => {
|
|
28
28
|
return (_jsx(ThemeProvider, { children: _jsx(SvgViewerContent, { ...props }) }));
|
|
29
29
|
});
|
|
30
|
-
function SvgViewerContent({ showDownload = true, themeSwitchable = true, onThemeChange,
|
|
30
|
+
function SvgViewerContent({ showDownload = true, themeSwitchable = true, onThemeChange, pinchableProps,
|
|
31
31
|
// 从DocumentViewerBaseProps继承来的属性
|
|
32
32
|
src, filename, onError, setDocumentTitle, ...props }) {
|
|
33
33
|
/**
|
|
@@ -57,13 +57,17 @@ src, filename, onError, setDocumentTitle, ...props }) {
|
|
|
57
57
|
return URL.createObjectURL(file);
|
|
58
58
|
}
|
|
59
59
|
return;
|
|
60
|
-
}, [blob]);
|
|
60
|
+
}, [blob, filename]);
|
|
61
61
|
/**
|
|
62
62
|
* ---------------------------------------------------------------
|
|
63
63
|
* 工具栏
|
|
64
64
|
*/
|
|
65
|
-
const
|
|
65
|
+
const pinchableRef = useRef(null);
|
|
66
66
|
const [rotate, setRotate] = useState(0);
|
|
67
|
+
const resetHandler = () => {
|
|
68
|
+
pinchableRef.current.reset();
|
|
69
|
+
setRotate(0);
|
|
70
|
+
};
|
|
67
71
|
const downloadHandler = () => {
|
|
68
72
|
if (src) {
|
|
69
73
|
const a = document.createElement('a');
|
|
@@ -73,9 +77,9 @@ src, filename, onError, setDocumentTitle, ...props }) {
|
|
|
73
77
|
}
|
|
74
78
|
};
|
|
75
79
|
const objectOnLoad = () => {
|
|
76
|
-
transformWrapperRef.current
|
|
80
|
+
// transformWrapperRef.current!.centerView()
|
|
77
81
|
};
|
|
78
|
-
return (_jsxs(Loading, { ...props, css: svgStyle, className: clsx(classes.svgViewer, props.className), open: loading, children: [_jsxs("div", { className: classes.svgToolbar, children: [_jsxs("div", { className: classes.svgTitle, children: [_jsx(Icon, { icon: faDiagramProject, className: classes.svgIcon }), _jsx("div", { children: filename })] }), _jsxs("div", { className: classes.svgToolbarRight, children: [_jsx(Tooltip, { title: "\u65CB\u8F6C-90\u00B0", children: _jsx(Button, { ...commonButtonProps, onClick: () => setRotate(rotate - 90), children: _jsx(Icon, { icon: faRotateLeft }) }) }), _jsx(Tooltip, { title: "\u65CB\u8F6C90\u00B0", children: _jsx(Button, { ...commonButtonProps, onClick: () => setRotate(rotate + 90), children: _jsx(Icon, { icon: faRotateRight }) }) }), _jsx(Tooltip, { title: "\u7F29\u5C0F", children: _jsx(Button, { ...commonButtonProps, onClick: () =>
|
|
82
|
+
return (_jsxs(Loading, { ...props, css: svgStyle, className: clsx(classes.svgViewer, props.className), open: loading, children: [_jsxs("div", { className: classes.svgToolbar, children: [_jsxs("div", { className: classes.svgTitle, children: [_jsx(Icon, { icon: faDiagramProject, className: classes.svgIcon }), _jsx("div", { children: filename })] }), _jsxs("div", { className: classes.svgToolbarRight, children: [_jsx(Tooltip, { title: "\u65CB\u8F6C-90\u00B0", children: _jsx(Button, { ...commonButtonProps, onClick: () => setRotate(rotate - 90), children: _jsx(Icon, { icon: faRotateLeft }) }) }), _jsx(Tooltip, { title: "\u65CB\u8F6C90\u00B0", children: _jsx(Button, { ...commonButtonProps, onClick: () => setRotate(rotate + 90), children: _jsx(Icon, { icon: faRotateRight }) }) }), _jsx(Tooltip, { title: "\u7F29\u5C0F", children: _jsx(Button, { ...commonButtonProps, onClick: () => pinchableRef.current.zoomOut(), children: _jsx(Icon, { icon: faMagnifyingGlassMinus }) }) }), _jsx(Tooltip, { title: "\u653E\u5927", children: _jsx(Button, { ...commonButtonProps, onClick: () => pinchableRef.current.zoomIn(), children: _jsx(Icon, { icon: faMagnifyingGlassPlus }) }) }), _jsx(Tooltip, { title: "\u9002\u5E94\u5C4F\u5E55", children: _jsx(Button, { ...commonButtonProps, onClick: resetHandler, children: _jsx(Icon, { icon: faExpand }) }) }), themeSwitchable &&
|
|
79
83
|
_jsxs(_Fragment, { children: [_jsx(Divider, { className: classes.svgDivider, orientation: "vertical" }), _jsx(Switch, { checkedLabel: _jsx(Icon, { icon: faSun }), unCheckedLabel: _jsx(Icon, { icon: faMoon }), checked: mode === 'light', onChange: themeChangeHandler })] }), showDownload &&
|
|
80
|
-
_jsxs(_Fragment, { children: [_jsx(Divider, { className: classes.svgDivider, orientation: "vertical" }), _jsx(Button, { prefix: _jsx(Icon, { icon: faDownload }), onClick: downloadHandler, children: "\u4E0B\u8F7D" })] })] })] }), _jsx(
|
|
84
|
+
_jsxs(_Fragment, { children: [_jsx(Divider, { className: classes.svgDivider, orientation: "vertical" }), _jsx(Button, { prefix: _jsx(Icon, { icon: faDownload }), onClick: downloadHandler, children: "\u4E0B\u8F7D" })] })] })] }), _jsx(Pinchable, { ...pinchableProps, ref: pinchableRef, className: clsx(classes.svgContainer, pinchableProps?.className), children: _jsx("div", { className: classes.svgContent, children: _jsx("object", { className: classes.object, data: data, style: { rotate: `${rotate}deg` }, onLoad: objectOnLoad, onError: onError }) }) })] }));
|
|
81
85
|
}
|