@canlooks/can-ui 0.0.41 → 0.0.43
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/alert/alert.style.js +1 -0
- package/dist/cjs/components/checkboxBase/checkboxBase.js +1 -2
- package/dist/cjs/components/checkboxBaseGroup/checkboxBaseGroup.d.ts +0 -2
- package/dist/cjs/components/checkboxBaseGroup/checkboxBaseGroup.js +3 -3
- package/dist/cjs/components/clickAway/clickAway.d.ts +285 -1
- package/dist/cjs/components/clickAway/clickAway.js +1 -2
- package/dist/cjs/components/dataGrid/columnResize.js +5 -5
- package/dist/cjs/components/dataGrid/dataGrid.js +1 -1
- package/dist/cjs/components/dataGrid/dataGridRows.js +3 -1
- package/dist/cjs/components/descriptions/descriptionItem.d.ts +3 -3
- package/dist/cjs/components/draggable/draggable.d.ts +6 -6
- package/dist/cjs/components/draggable/draggable.js +13 -18
- package/dist/cjs/components/{image/imagePreview.d.ts → gallery/gallery.d.ts} +7 -3
- package/dist/cjs/components/gallery/gallery.js +165 -0
- package/dist/{esm/components/image/imagePreview.style.d.ts → cjs/components/gallery/gallery.style.d.ts} +3 -1
- package/dist/cjs/components/{image/imagePreview.style.js → gallery/gallery.style.js} +49 -13
- package/dist/cjs/components/gallery/imageItem.d.ts +14 -0
- package/dist/cjs/components/gallery/imageItem.js +51 -0
- package/dist/cjs/components/gallery/index.d.ts +1 -0
- package/dist/cjs/components/gallery/index.js +4 -0
- package/dist/cjs/components/image/image.d.ts +2 -2
- package/dist/cjs/components/image/image.js +3 -3
- package/dist/cjs/components/image/index.d.ts +0 -1
- package/dist/cjs/components/image/index.js +0 -1
- package/dist/cjs/components/overlayBase/overlayBase.js +1 -1
- package/dist/cjs/components/palette/palette.d.ts +3 -3
- package/dist/cjs/components/palette/palette.js +9 -9
- package/dist/cjs/components/pickerDialog/pickerDialog.style.js +6 -0
- package/dist/cjs/components/pinchable/index.d.ts +1 -0
- package/dist/cjs/components/pinchable/index.js +4 -0
- package/dist/cjs/components/pinchable/pinchable.d.ts +33 -0
- package/dist/cjs/components/pinchable/pinchable.js +160 -0
- package/dist/cjs/components/pinchable/pinchable.style.d.ts +6 -0
- package/dist/cjs/components/pinchable/pinchable.style.js +21 -0
- package/dist/cjs/components/placeholder/placeholder.style.js +1 -0
- package/dist/cjs/components/progress/progress.d.ts +1 -1
- package/dist/cjs/components/rating/rating.d.ts +2 -2
- package/dist/cjs/components/rating/rating.js +2 -5
- package/dist/cjs/components/rating/rating.style.js +1 -2
- package/dist/cjs/components/resizable/resizable.d.ts +2 -2
- package/dist/cjs/components/resizable/resizable.js +12 -12
- package/dist/cjs/components/scrollbar/scrollbar.d.ts +1 -1
- package/dist/cjs/components/scrollbar/scrollbar.js +6 -6
- package/dist/cjs/components/segmented/SegmentedOption.d.ts +1 -1
- package/dist/cjs/components/selectedList/selectedItem.js +1 -1
- package/dist/cjs/components/selectedList/selectedList.style.js +1 -1
- package/dist/cjs/components/skeleton/skeleton.d.ts +1 -1
- package/dist/cjs/components/slidableActions/slidableActions.d.ts +9 -5
- package/dist/cjs/components/slidableActions/slidableActions.js +21 -25
- package/dist/cjs/components/slidableActions/slidableActions.style.d.ts +1 -1
- package/dist/cjs/components/slidableActions/slidableActions.style.js +14 -13
- package/dist/cjs/components/slidableActions/slidableActionsAction.d.ts +4 -2
- package/dist/cjs/components/slidableActions/slidableActionsAction.js +6 -2
- package/dist/cjs/components/slider/slider.d.ts +3 -3
- package/dist/cjs/components/slider/slider.js +8 -8
- package/dist/cjs/components/tabs/tabs.js +1 -1
- package/dist/cjs/components/theme/themeVariables.js +1 -1
- package/dist/cjs/components/upload/itemStatus.d.ts +1 -1
- package/dist/cjs/components/upload/itemStatus.js +3 -0
- package/dist/cjs/components/upload/upload.d.ts +3 -3
- package/dist/cjs/components/upload/upload.js +1 -1
- package/dist/cjs/extensions/documentViewer/documentViewer.js +1 -2
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/utils/dnd.d.ts +0 -42
- package/dist/cjs/utils/dnd.js +0 -121
- package/dist/cjs/utils/gesture.d.ts +69 -0
- package/dist/cjs/utils/gesture.js +250 -0
- package/dist/cjs/utils/index.d.ts +1 -0
- package/dist/cjs/utils/index.js +1 -0
- package/dist/cjs/utils/style.js +1 -1
- package/dist/cjs/utils/utils.d.ts +0 -2
- package/dist/cjs/utils/utils.js +0 -2
- package/dist/esm/components/alert/alert.style.js +1 -0
- package/dist/esm/components/checkboxBase/checkboxBase.js +1 -2
- package/dist/esm/components/checkboxBaseGroup/checkboxBaseGroup.d.ts +0 -2
- package/dist/esm/components/checkboxBaseGroup/checkboxBaseGroup.js +4 -4
- package/dist/esm/components/clickAway/clickAway.d.ts +285 -1
- package/dist/esm/components/clickAway/clickAway.js +2 -3
- package/dist/esm/components/dataGrid/columnResize.js +6 -6
- package/dist/esm/components/dataGrid/dataGrid.js +1 -1
- package/dist/esm/components/dataGrid/dataGridRows.js +3 -1
- package/dist/esm/components/descriptions/descriptionItem.d.ts +3 -3
- package/dist/esm/components/draggable/draggable.d.ts +6 -6
- package/dist/esm/components/draggable/draggable.js +14 -19
- package/dist/esm/components/{image/imagePreview.d.ts → gallery/gallery.d.ts} +7 -3
- package/dist/esm/components/gallery/gallery.js +162 -0
- package/dist/{cjs/components/image/imagePreview.style.d.ts → esm/components/gallery/gallery.style.d.ts} +3 -1
- package/dist/esm/components/{image/imagePreview.style.js → gallery/gallery.style.js} +49 -13
- package/dist/esm/components/gallery/imageItem.d.ts +14 -0
- package/dist/esm/components/gallery/imageItem.js +48 -0
- package/dist/esm/components/gallery/index.d.ts +1 -0
- package/dist/esm/components/gallery/index.js +1 -0
- package/dist/esm/components/image/image.d.ts +2 -2
- package/dist/esm/components/image/image.js +3 -3
- package/dist/esm/components/image/index.d.ts +0 -1
- package/dist/esm/components/image/index.js +0 -1
- package/dist/esm/components/overlayBase/overlayBase.js +1 -1
- package/dist/esm/components/palette/palette.d.ts +3 -3
- package/dist/esm/components/palette/palette.js +10 -10
- package/dist/esm/components/pickerDialog/pickerDialog.style.js +6 -0
- package/dist/esm/components/pinchable/index.d.ts +1 -0
- package/dist/esm/components/pinchable/index.js +1 -0
- package/dist/esm/components/pinchable/pinchable.d.ts +33 -0
- package/dist/esm/components/pinchable/pinchable.js +157 -0
- package/dist/esm/components/pinchable/pinchable.style.d.ts +6 -0
- package/dist/esm/components/pinchable/pinchable.style.js +18 -0
- package/dist/esm/components/placeholder/placeholder.style.js +1 -0
- package/dist/esm/components/progress/progress.d.ts +1 -1
- package/dist/esm/components/rating/rating.d.ts +2 -2
- package/dist/esm/components/rating/rating.js +2 -5
- package/dist/esm/components/rating/rating.style.js +1 -2
- package/dist/esm/components/resizable/resizable.d.ts +2 -2
- package/dist/esm/components/resizable/resizable.js +13 -13
- package/dist/esm/components/scrollbar/scrollbar.d.ts +1 -1
- package/dist/esm/components/scrollbar/scrollbar.js +7 -7
- package/dist/esm/components/segmented/SegmentedOption.d.ts +1 -1
- package/dist/esm/components/selectedList/selectedItem.js +1 -1
- package/dist/esm/components/selectedList/selectedList.style.js +1 -1
- package/dist/esm/components/skeleton/skeleton.d.ts +1 -1
- package/dist/esm/components/slidableActions/slidableActions.d.ts +9 -5
- package/dist/esm/components/slidableActions/slidableActions.js +22 -26
- package/dist/esm/components/slidableActions/slidableActions.style.d.ts +1 -1
- package/dist/esm/components/slidableActions/slidableActions.style.js +14 -13
- package/dist/esm/components/slidableActions/slidableActionsAction.d.ts +4 -2
- package/dist/esm/components/slidableActions/slidableActionsAction.js +6 -2
- package/dist/esm/components/slider/slider.d.ts +3 -3
- package/dist/esm/components/slider/slider.js +9 -9
- package/dist/esm/components/tabs/tabs.js +1 -1
- package/dist/esm/components/theme/themeVariables.js +1 -1
- package/dist/esm/components/upload/itemStatus.d.ts +1 -1
- package/dist/esm/components/upload/itemStatus.js +3 -0
- package/dist/esm/components/upload/upload.d.ts +3 -3
- package/dist/esm/components/upload/upload.js +1 -1
- package/dist/esm/extensions/documentViewer/documentViewer.js +2 -3
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/utils/dnd.d.ts +0 -42
- package/dist/esm/utils/dnd.js +0 -120
- package/dist/esm/utils/gesture.d.ts +69 -0
- package/dist/esm/utils/gesture.js +245 -0
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/style.js +1 -1
- package/dist/esm/utils/utils.d.ts +0 -2
- package/dist/esm/utils/utils.js +0 -2
- package/documentation/dist/assets/{index-B6FOULC1.js → index-DXo4Z-bc.js} +1281 -1271
- package/documentation/dist/components/actionSheet.md +3 -3
- package/documentation/dist/components/autocomplete.md +10 -10
- package/documentation/dist/components/breadcrumb.md +1 -1
- package/documentation/dist/components/checkbox.md +24 -1
- package/documentation/dist/components/contextMenu.md +1 -1
- package/documentation/dist/components/counter.md +13 -13
- package/documentation/dist/components/dialog.md +3 -3
- package/documentation/dist/components/formDialog.md +6 -6
- package/documentation/dist/components/image.md +5 -3
- package/documentation/dist/components/menu.md +1 -1
- package/documentation/dist/components/pagination.md +15 -1
- package/documentation/dist/components/pickerDialog.md +56 -0
- package/documentation/dist/components/placeholder.md +30 -0
- package/documentation/dist/components/progress.md +43 -0
- package/documentation/dist/components/radio.md +37 -0
- package/documentation/dist/components/rating.md +35 -0
- package/documentation/dist/components/resizable.md +41 -0
- package/documentation/dist/components/scrollbar.md +31 -0
- package/documentation/dist/components/segmented.md +56 -0
- package/documentation/dist/components/select.md +30 -0
- package/documentation/dist/components/skeleton.md +26 -0
- package/documentation/dist/components/slidableActions.md +53 -0
- package/documentation/dist/guide/globalMethods.md +6 -6
- package/documentation/dist/index.html +1 -1
- package/package.json +6 -6
- package/dist/cjs/components/image/imagePreview.js +0 -63
- package/dist/esm/components/image/imagePreview.js +0 -60
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cloneElement, isValidElement,
|
|
1
|
+
import { cloneElement, isValidElement, useEffect, useRef } from 'react';
|
|
2
2
|
import { cloneRef, isChildOf, toArray, useSync } from '../../utils';
|
|
3
3
|
export function ClickAway({ ref, container = self, eventType = 'click', onClickAway, disabled, children, targets, ...props }) {
|
|
4
4
|
const syncOnClickAway = useSync(onClickAway);
|
|
@@ -26,11 +26,10 @@ export function ClickAway({ ref, container = self, eventType = 'click', onClickA
|
|
|
26
26
|
containerEl.removeEventListener(standardEventType, onClick);
|
|
27
27
|
};
|
|
28
28
|
}, [disabled]);
|
|
29
|
-
const clonedRef = useCallback(cloneRef(children?.props.ref, ref, childRef), [children?.props.ref, ref]);
|
|
30
29
|
return !disabled && isValidElement(children)
|
|
31
30
|
? cloneElement(children, {
|
|
32
31
|
...props,
|
|
33
|
-
ref:
|
|
32
|
+
ref: cloneRef(children.props.ref, ref, childRef)
|
|
34
33
|
})
|
|
35
34
|
: children;
|
|
36
35
|
}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import { ThCell } from '../table';
|
|
3
3
|
import { createContext, useContext, useRef } from 'react';
|
|
4
4
|
import { classes } from './dataGrid.style';
|
|
5
|
-
import {
|
|
5
|
+
import { useDraggable } from '../../utils';
|
|
6
6
|
const ColumnResizeContextProvider = createContext({
|
|
7
7
|
columnResizable: false,
|
|
8
8
|
columnRefs: { current: [] },
|
|
@@ -34,7 +34,7 @@ function ResizableColumn(props) {
|
|
|
34
34
|
}
|
|
35
35
|
return next;
|
|
36
36
|
};
|
|
37
|
-
const
|
|
37
|
+
const draggableHandles = useDraggable({
|
|
38
38
|
onDragStart(e) {
|
|
39
39
|
const next = findNext();
|
|
40
40
|
return {
|
|
@@ -43,11 +43,11 @@ function ResizableColumn(props) {
|
|
|
43
43
|
nextStartWidth: next?.offsetWidth
|
|
44
44
|
};
|
|
45
45
|
},
|
|
46
|
-
onDrag({
|
|
46
|
+
onDrag({ diff: [dx, dy], data: { selfStartWidth, nextStartWidth } }) {
|
|
47
47
|
const next = findNext();
|
|
48
|
-
cellRef.current.style.width =
|
|
48
|
+
cellRef.current.style.width = selfStartWidth + dx + 'px';
|
|
49
49
|
if (next) {
|
|
50
|
-
next.style.width =
|
|
50
|
+
next.style.width = nextStartWidth - dy + 'px';
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
53
53
|
scrollToEnd();
|
|
@@ -62,5 +62,5 @@ function ResizableColumn(props) {
|
|
|
62
62
|
columnRefs.current.push(r);
|
|
63
63
|
cellRef.current = r;
|
|
64
64
|
}
|
|
65
|
-
}, children: [props.children, _jsx("div", { className: classes.resizeHandle, ...
|
|
65
|
+
}, children: [props.children, _jsx("div", { className: classes.resizeHandle, ...draggableHandles })] }));
|
|
66
66
|
}
|
|
@@ -13,7 +13,7 @@ const DataGridContext = createContext({});
|
|
|
13
13
|
export function useDataGridContext() {
|
|
14
14
|
return useContext(DataGridContext);
|
|
15
15
|
}
|
|
16
|
-
export const DataGrid = memo(({ columns, rows, rowProps, primaryKey = 'id', childrenKey = null, defaultOrderColumn, orderColumn, defaultOrderType = 'descend', orderType, onOrderChange, selectable
|
|
16
|
+
export const DataGrid = memo(({ columns, rows, rowProps, primaryKey = 'id', childrenKey = null, defaultOrderColumn, orderColumn, defaultOrderType = 'descend', orderType, onOrderChange, selectable, relation = 'dependent', integration = 'shallowest', allowSelectAll = true, clickRowToSelect = true, selectorProps, indent = 24, renderExpandIcon, defaultExpanded = [], expanded, onExpandedChange, paginatable = true, paginationProps = {}, renderPagination, loading, emptyPlaceholder, columnResizable = false, size, bordered, striped, tableProps, multiple, defaultValue, value, onChange, ...props }) => {
|
|
17
17
|
/**
|
|
18
18
|
* ---------------------------------------------------------------
|
|
19
19
|
* 选择行
|
|
@@ -43,7 +43,9 @@ export const DataGridRows = memo(({ rows, _level = 0 }) => {
|
|
|
43
43
|
expandableIndex = j;
|
|
44
44
|
}
|
|
45
45
|
const Component = multiple ? Checkbox : Radio;
|
|
46
|
-
return (_jsx(TdCell, { className: classes.selectable, sticky: j === 0 ? 'left' : void 0, children: _jsx(Component, { checked: status === 2, indeterminate: status === 1, onChange: () =>
|
|
46
|
+
return (_jsx(TdCell, { className: classes.selectable, sticky: j === 0 ? 'left' : void 0, children: _jsx(Component, { checked: status === 2, indeterminate: status === 1, onChange: () => {
|
|
47
|
+
toggleSelected(trKey, row);
|
|
48
|
+
}, onClick: e => e.stopPropagation() }) }, j + '_selectable'));
|
|
47
49
|
}
|
|
48
50
|
const {
|
|
49
51
|
// 排除无需加入dom节点的属性
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactNode, ElementType
|
|
1
|
+
import { ReactNode, ElementType } from 'react';
|
|
2
2
|
import { DescriptionsSharedProps } from './descriptions';
|
|
3
3
|
import { GridItemProps } from '../grid';
|
|
4
|
-
import { MergeProps, ResponsiveProp } from '../../types';
|
|
4
|
+
import { MergeProps, OverridableComponent, ResponsiveProp } from '../../types';
|
|
5
5
|
export interface DescriptionGridItemOwnProps extends DescriptionsSharedProps {
|
|
6
6
|
label?: ReactNode;
|
|
7
7
|
/** @alias {@link children} */
|
|
@@ -13,4 +13,4 @@ export interface DescriptionTableItemProps extends DescriptionGridItemOwnProps {
|
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
}
|
|
15
15
|
export type DescriptionItemProps<C extends ElementType = 'div'> = MergeProps<DescriptionGridItemOwnProps, GridItemProps<C>> | DescriptionTableItemProps;
|
|
16
|
-
export declare const DescriptionItem: <
|
|
16
|
+
export declare const DescriptionItem: OverridableComponent<DescriptionItemProps>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { DraggableGestureOptions, HandleProps } from '../../utils';
|
|
3
3
|
import { DefineElement } from '../../types';
|
|
4
4
|
export type DraggableTargetProps = {
|
|
5
5
|
style: {
|
|
6
6
|
translate: string;
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
|
-
export interface DraggableProps
|
|
10
|
-
translateLimit?(
|
|
9
|
+
export interface DraggableProps extends DraggableGestureOptions {
|
|
10
|
+
translateLimit?(targetTranslate: [number, number]): [number, number];
|
|
11
11
|
container?: DefineElement;
|
|
12
|
-
children: ReactElement | ((targetProps: DraggableTargetProps, handleProps: HandleProps
|
|
12
|
+
children: ReactElement | ((targetProps: DraggableTargetProps, handleProps: HandleProps) => ReactNode);
|
|
13
13
|
}
|
|
14
|
-
export declare function Draggable
|
|
14
|
+
export declare function Draggable({ translateLimit, container, children, ...draggableOptions }: DraggableProps): ReactNode;
|
|
@@ -1,37 +1,32 @@
|
|
|
1
1
|
import { cloneElement, isValidElement, useMemo, useState } from 'react';
|
|
2
|
-
import { range,
|
|
2
|
+
import { range, useDraggable } from '../../utils';
|
|
3
3
|
export function Draggable({ translateLimit, container, children, ...draggableOptions }) {
|
|
4
|
-
const syncOptions = useSync(draggableOptions);
|
|
5
|
-
const syncTranslateLimit = useSync(translateLimit);
|
|
6
|
-
const syncContainer = useSync(container);
|
|
7
4
|
const [translate, setTranslate] = useState([0, 0]);
|
|
8
5
|
const props = children.props;
|
|
9
|
-
const
|
|
6
|
+
const draggableHandles = useDraggable({
|
|
10
7
|
...draggableOptions,
|
|
11
8
|
onDragStart(e) {
|
|
12
|
-
|
|
9
|
+
draggableOptions.onDragStart?.(e);
|
|
13
10
|
return [...translate];
|
|
14
11
|
},
|
|
15
12
|
onDrag(info, e) {
|
|
16
|
-
|
|
17
|
-
const {
|
|
18
|
-
let newX = startX +
|
|
19
|
-
let newY = startY +
|
|
20
|
-
if (
|
|
21
|
-
[newX, newY] =
|
|
13
|
+
draggableOptions.onDrag?.(info, e);
|
|
14
|
+
const { diff: [dx, dy], data: [startX, startY] } = info;
|
|
15
|
+
let newX = startX + dx;
|
|
16
|
+
let newY = startY + dy;
|
|
17
|
+
if (translateLimit) {
|
|
18
|
+
[newX, newY] = translateLimit([newX, newY]);
|
|
22
19
|
}
|
|
23
20
|
else {
|
|
24
|
-
const containerEl = typeof
|
|
21
|
+
const containerEl = typeof container === 'function' ? container() : container;
|
|
25
22
|
if (containerEl) {
|
|
26
23
|
const { clientWidth, clientHeight } = containerEl;
|
|
27
|
-
newX = range(startX +
|
|
28
|
-
newY = range(startY +
|
|
24
|
+
newX = range(startX + dx, -clientWidth / 2, clientWidth / 2);
|
|
25
|
+
newY = range(startY + dy, -clientHeight / 2, clientHeight / 2);
|
|
29
26
|
}
|
|
30
27
|
}
|
|
31
28
|
setTranslate([newX, newY]);
|
|
32
29
|
},
|
|
33
|
-
onPointerDown: props?.onPointerDown,
|
|
34
|
-
onTouchStart: props?.onTouchStart,
|
|
35
30
|
onClick: props?.onClick
|
|
36
31
|
});
|
|
37
32
|
const style = useMemo(() => ({
|
|
@@ -41,11 +36,11 @@ export function Draggable({ translateLimit, container, children, ...draggableOpt
|
|
|
41
36
|
if (isValidElement(children)) {
|
|
42
37
|
return cloneElement(children, {
|
|
43
38
|
style,
|
|
44
|
-
...
|
|
39
|
+
...draggableHandles
|
|
45
40
|
});
|
|
46
41
|
}
|
|
47
42
|
if (typeof children === 'function') {
|
|
48
|
-
return children({ style: { translate: `${translate[0]}px ${translate[1]}px` } },
|
|
43
|
+
return children({ style: { translate: `${translate[0]}px ${translate[1]}px` } }, draggableHandles);
|
|
49
44
|
}
|
|
50
45
|
return children;
|
|
51
46
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ModalProps } from '../modal';
|
|
3
|
-
import { ReactZoomPanPinchProps } from 'react-zoom-pan-pinch';
|
|
4
3
|
export interface ImagePreviewProps extends ModalProps {
|
|
5
4
|
src?: string | string[];
|
|
6
5
|
defaultIndex?: number;
|
|
@@ -16,6 +15,11 @@ export interface ImagePreviewProps extends ModalProps {
|
|
|
16
15
|
showClose?: boolean;
|
|
17
16
|
/** 自定义渲染控制按钮 */
|
|
18
17
|
renderControl?: ReactNode;
|
|
19
|
-
|
|
18
|
+
/** 元素弹性移动距离,默认为24 */
|
|
19
|
+
bounceElementTranslate?: number;
|
|
20
|
+
/** 手指弹性拖拽距离,默认为240 */
|
|
21
|
+
bounceDragDistance?: number;
|
|
22
|
+
/** 滑动生效的速度,默认为450 (px/s) */
|
|
23
|
+
effectiveSpeed?: number;
|
|
20
24
|
}
|
|
21
|
-
export declare const
|
|
25
|
+
export declare const Gallery: import("react").MemoExoticComponent<({ src, defaultIndex, index, onIndexChange, defaultOpen, open, onOpenChange, showRotation, showZoom, showClose, renderControl, bounceElementTranslate, bounceDragDistance, effectiveSpeed, ...props }: ImagePreviewProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { memo, useRef } from 'react';
|
|
3
|
+
import { Modal } from '../modal';
|
|
4
|
+
import { clsx, cubicBezier, range, toArray, useControlled, useDraggable, useSync } from '../../utils';
|
|
5
|
+
import { classes, style } from './gallery.style';
|
|
6
|
+
import { Button } from '../button';
|
|
7
|
+
import { Tooltip } from '../tooltip';
|
|
8
|
+
import { Icon } from '../..';
|
|
9
|
+
import { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';
|
|
10
|
+
import { faExpand } from '@fortawesome/free-solid-svg-icons/faExpand';
|
|
11
|
+
import { faAngleLeft } from '@fortawesome/free-solid-svg-icons/faAngleLeft';
|
|
12
|
+
import { faAngleRight } from '@fortawesome/free-solid-svg-icons/faAngleRight';
|
|
13
|
+
import { faArrowRotateLeft } from '@fortawesome/free-solid-svg-icons/faArrowRotateLeft';
|
|
14
|
+
import { faArrowRotateRight } from '@fortawesome/free-solid-svg-icons/faArrowRotateRight';
|
|
15
|
+
import { faMagnifyingGlassPlus } from '@fortawesome/free-solid-svg-icons/faMagnifyingGlassPlus';
|
|
16
|
+
import { faMagnifyingGlassMinus } from '@fortawesome/free-solid-svg-icons/faMagnifyingGlassMinus';
|
|
17
|
+
import { ImageItem } from './imageItem';
|
|
18
|
+
const commonControlProps = {
|
|
19
|
+
className: classes.button,
|
|
20
|
+
shape: 'circular',
|
|
21
|
+
size: 'large',
|
|
22
|
+
color: 'text'
|
|
23
|
+
};
|
|
24
|
+
const bounceBezier = cubicBezier(0, 0, 0, 1);
|
|
25
|
+
export const Gallery = memo(({ src = [], defaultIndex = 0, index, onIndexChange, defaultOpen = false, open, onOpenChange, showRotation = true, showZoom = true, showClose = true, renderControl, bounceElementTranslate = 24, bounceDragDistance = 240, effectiveSpeed = 450, ...props }) => {
|
|
26
|
+
const srcArr = useSync(toArray(src));
|
|
27
|
+
const [innerOpen, setInnerOpen] = useControlled(defaultOpen, open, onOpenChange);
|
|
28
|
+
const close = () => {
|
|
29
|
+
setInnerOpen(false);
|
|
30
|
+
};
|
|
31
|
+
const [innerIndex, setInnerIndex] = useControlled(defaultIndex, index, onIndexChange);
|
|
32
|
+
const wrapperRef = useRef(null);
|
|
33
|
+
const imageItemRefs = useRef([]);
|
|
34
|
+
imageItemRefs.current = [];
|
|
35
|
+
/**
|
|
36
|
+
* --------------------------------------------------------------
|
|
37
|
+
* 左右滚动翻页
|
|
38
|
+
*/
|
|
39
|
+
const draggableHandles = useDraggable({
|
|
40
|
+
onDragStart() {
|
|
41
|
+
wrapperRef.current.dataset.transition = 'drag';
|
|
42
|
+
return {
|
|
43
|
+
isFit: imageItemRefs.current[innerIndex.current].isFit(),
|
|
44
|
+
startLeft: -innerIndex.current * wrapperRef.current.offsetWidth
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
onDrag({ diff: [dx], data: { isFit: { left, right }, startLeft } }) {
|
|
48
|
+
if ((!left && dx > 0) || (!right && dx < 0)) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const min = -wrapperRef.current.offsetWidth * (srcArr.current.length - 1);
|
|
52
|
+
const max = 0;
|
|
53
|
+
let newLeft = range(startLeft + dx, min - bounceDragDistance, max + bounceDragDistance);
|
|
54
|
+
if (newLeft < min) {
|
|
55
|
+
newLeft = min - bounceBezier(-(newLeft - min) / bounceDragDistance) * bounceElementTranslate;
|
|
56
|
+
}
|
|
57
|
+
else if (newLeft > max) {
|
|
58
|
+
newLeft = max + bounceBezier((newLeft - max) / bounceDragDistance) * bounceElementTranslate;
|
|
59
|
+
}
|
|
60
|
+
wrapperRef.current.style.left = newLeft + 'px';
|
|
61
|
+
},
|
|
62
|
+
onDragEnd({ diff: [dx], speed: [speedX], data: { isFit: { left, right } } }) {
|
|
63
|
+
wrapperRef.current.dataset.transition = '';
|
|
64
|
+
if (!dx) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if ((!left && dx > 0) || (!right && dx < 0)) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
alowSlideTransition();
|
|
71
|
+
const reset = () => {
|
|
72
|
+
wrapperRef.current.style.left = -innerIndex.current * wrapperRef.current.offsetWidth + 'px';
|
|
73
|
+
};
|
|
74
|
+
const goPrev = () => {
|
|
75
|
+
innerIndex.current === 0
|
|
76
|
+
? reset()
|
|
77
|
+
: goPrevLoop();
|
|
78
|
+
};
|
|
79
|
+
const goNext = () => {
|
|
80
|
+
innerIndex.current === srcArr.current.length - 1
|
|
81
|
+
? reset()
|
|
82
|
+
: goNextLoop();
|
|
83
|
+
};
|
|
84
|
+
if (effectiveSpeed && speedX * 1000 >= effectiveSpeed) {
|
|
85
|
+
dx > 0 ? goPrev() : goNext();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const halfWidth = wrapperRef.current.offsetWidth / 2;
|
|
89
|
+
if (dx > halfWidth) {
|
|
90
|
+
goPrev();
|
|
91
|
+
}
|
|
92
|
+
else if (dx < -halfWidth) {
|
|
93
|
+
goNext();
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
reset();
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
onClick: () => {
|
|
100
|
+
doubleClicked.current = false;
|
|
101
|
+
setTimeout(() => {
|
|
102
|
+
!doubleClicked.current && close();
|
|
103
|
+
}, 250);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
const doubleClicked = useRef(false);
|
|
107
|
+
const doubleClickHandler = () => {
|
|
108
|
+
doubleClicked.current = true;
|
|
109
|
+
};
|
|
110
|
+
const alowSlideTransition = () => {
|
|
111
|
+
wrapperRef.current && (wrapperRef.current.dataset.transition = 'set');
|
|
112
|
+
};
|
|
113
|
+
const goPrevLoop = () => {
|
|
114
|
+
alowSlideTransition();
|
|
115
|
+
setInnerIndex(o => {
|
|
116
|
+
imageItemRefs.current[o].reset();
|
|
117
|
+
return (o + srcArr.current.length - 1) % srcArr.current.length;
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
const goNextLoop = () => {
|
|
121
|
+
alowSlideTransition();
|
|
122
|
+
setInnerIndex(o => {
|
|
123
|
+
imageItemRefs.current[o].reset();
|
|
124
|
+
return (o + 1) % srcArr.current.length;
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* -----------------------------------------------------------------------------
|
|
129
|
+
* 放大缩小与旋转
|
|
130
|
+
*/
|
|
131
|
+
const rotateLeft = () => {
|
|
132
|
+
imageItemRefs.current[innerIndex.current].rotateLeft();
|
|
133
|
+
};
|
|
134
|
+
const rotateRight = () => {
|
|
135
|
+
imageItemRefs.current[innerIndex.current].rotateRight();
|
|
136
|
+
};
|
|
137
|
+
const zoomIn = () => {
|
|
138
|
+
imageItemRefs.current[innerIndex.current].zoomIn();
|
|
139
|
+
};
|
|
140
|
+
const zoomOut = () => {
|
|
141
|
+
imageItemRefs.current[innerIndex.current].zoomOut();
|
|
142
|
+
};
|
|
143
|
+
const reset = () => {
|
|
144
|
+
imageItemRefs.current[innerIndex.current].reset();
|
|
145
|
+
};
|
|
146
|
+
const resetAll = () => {
|
|
147
|
+
imageItemRefs.current.forEach(item => {
|
|
148
|
+
item.reset(false);
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
return (_jsx(Modal, { ...props, css: style, className: clsx(classes.root, props.className), open: innerOpen.current, onClosed: resetAll, maskProps: {
|
|
152
|
+
...props.maskProps,
|
|
153
|
+
children: (_jsxs(_Fragment, { children: [_jsxs("div", { className: classes.control, children: [renderControl, showRotation &&
|
|
154
|
+
_jsxs(_Fragment, { children: [_jsx(Tooltip, { title: "\u65CB\u8F6C-90\u00B0", children: _jsx(Button, { ...commonControlProps, onClick: rotateLeft, children: _jsx(Icon, { icon: faArrowRotateLeft }) }) }), _jsx(Tooltip, { title: "\u65CB\u8F6C90\u00B0", children: _jsx(Button, { ...commonControlProps, onClick: rotateRight, children: _jsx(Icon, { icon: faArrowRotateRight }) }) })] }), showZoom &&
|
|
155
|
+
_jsxs(_Fragment, { children: [_jsx(Tooltip, { title: "\u7F29\u5C0F", children: _jsx(Button, { ...commonControlProps, onClick: zoomOut, children: _jsx(Icon, { icon: faMagnifyingGlassMinus }) }) }), _jsx(Tooltip, { title: "\u653E\u5927", children: _jsx(Button, { ...commonControlProps, onClick: zoomIn, children: _jsx(Icon, { icon: faMagnifyingGlassPlus }) }) }), _jsx(Tooltip, { title: "\u9002\u5E94\u5C4F\u5E55", children: _jsx(Button, { ...commonControlProps, onClick: reset, children: _jsx(Icon, { icon: faExpand }) }) })] }), showClose &&
|
|
156
|
+
_jsx(Button, { ...commonControlProps, onClick: close, children: _jsx(Icon, { icon: faXmark }) })] }), srcArr.current.length > 1 &&
|
|
157
|
+
_jsxs(_Fragment, { children: [_jsxs("div", { className: classes.swap, children: [_jsx(Button, { ...commonControlProps, onClick: goPrevLoop, children: _jsx(Icon, { icon: faAngleLeft }) }), _jsx(Button, { ...commonControlProps, onClick: goNextLoop, children: _jsx(Icon, { icon: faAngleRight }) })] }), _jsxs("div", { className: classes.counter, children: [innerIndex.current + 1, " / ", srcArr.current.length] })] })] }))
|
|
158
|
+
}, children: srcArr.current.length > 0 &&
|
|
159
|
+
_jsx("div", { className: classes.galleryContainer, ...draggableHandles, onDoubleClick: doubleClickHandler, children: _jsx("div", { ref: wrapperRef, className: classes.galleryWrapper, style: { left: -innerIndex.current * 100 + '%' }, onTransitionEnd: e => e.currentTarget.dataset.transition = '', children: srcArr.current.map((src, i) => _jsx(ImageItem, { ref: r => {
|
|
160
|
+
r && imageItemRefs.current.push(r);
|
|
161
|
+
}, style: { left: i * 100 + '%' }, src: src }, i)) }) }) }));
|
|
162
|
+
});
|
|
@@ -6,10 +6,12 @@ export const classes = defineInnerClasses('image-preview', [
|
|
|
6
6
|
'control',
|
|
7
7
|
'swap',
|
|
8
8
|
'counter',
|
|
9
|
-
'
|
|
9
|
+
'galleryContainer',
|
|
10
|
+
'galleryWrapper',
|
|
11
|
+
'imageItem',
|
|
10
12
|
'image'
|
|
11
13
|
]);
|
|
12
|
-
export const style = defineCss(({ spacing, easing }) => css `
|
|
14
|
+
export const style = defineCss(({ spacing, easing, breakpoints }) => css `
|
|
13
15
|
.${classes.control} {
|
|
14
16
|
display: flex;
|
|
15
17
|
gap: ${spacing[4]}px;
|
|
@@ -49,11 +51,11 @@ export const style = defineCss(({ spacing, easing }) => css `
|
|
|
49
51
|
background-image: none !important;
|
|
50
52
|
background-color: rgba(0, 0, 0, .4);
|
|
51
53
|
transition: background-color .25s ${easing.easeOut};
|
|
52
|
-
|
|
54
|
+
|
|
53
55
|
&:hover {
|
|
54
56
|
background-color: rgba(0, 0, 0, .3);
|
|
55
57
|
}
|
|
56
|
-
|
|
58
|
+
|
|
57
59
|
&:active {
|
|
58
60
|
transition: background-color 0s;
|
|
59
61
|
background-color: rgba(0, 0, 0, .5);
|
|
@@ -68,17 +70,51 @@ export const style = defineCss(({ spacing, easing }) => css `
|
|
|
68
70
|
padding: 0;
|
|
69
71
|
}
|
|
70
72
|
|
|
71
|
-
.${classes.
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
.${classes.galleryContainer} {
|
|
74
|
+
&, .${classes.galleryWrapper}, .${classes.imageItem}, .${classes.image} {
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 100%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
position: relative;
|
|
74
81
|
|
|
75
|
-
.${classes.
|
|
76
|
-
|
|
82
|
+
.${classes.galleryWrapper} {
|
|
83
|
+
&, .${classes.imageItem} {
|
|
84
|
+
position: absolute;
|
|
85
|
+
top: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&[data-transition=set] {
|
|
89
|
+
transition: left .5s ${easing.bounce} 0s;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&[data-transition=drag] {
|
|
93
|
+
transition: left .1s linear;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.${classes.imageItem} {
|
|
97
|
+
padding: 90px;
|
|
98
|
+
|
|
99
|
+
.${classes.image} {
|
|
100
|
+
object-fit: contain;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@media (max-width: ${breakpoints.sm}px) {
|
|
107
|
+
.${classes.control}, .${classes.swap}, .${classes.button} {
|
|
108
|
+
display: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.${classes.galleryContainer} .${classes.galleryWrapper} {
|
|
112
|
+
&[data-transition=true] {
|
|
113
|
+
transition: left .4s ${easing.ease};
|
|
114
|
+
}
|
|
77
115
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
max-height: 100%;
|
|
81
|
-
transition: rotate .4s ${easing.easeOut};
|
|
116
|
+
.${classes.imageItem} {
|
|
117
|
+
padding: 0;
|
|
82
118
|
}
|
|
83
119
|
}
|
|
84
120
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { PinchableProps, PinchableRef } from '../pinchable';
|
|
3
|
+
export interface ImageItemRef extends PinchableRef {
|
|
4
|
+
isFit(): {
|
|
5
|
+
left: boolean;
|
|
6
|
+
right: boolean;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
interface ImageItemProps extends PinchableProps {
|
|
10
|
+
ref?: Ref<ImageItemRef>;
|
|
11
|
+
src?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function ImageItem({ ref, src, ...props }: ImageItemProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { classes } from './gallery.style';
|
|
3
|
+
import { useEffect, useImperativeHandle, useRef } from 'react';
|
|
4
|
+
import { clsx } from '../../utils';
|
|
5
|
+
import { Pinchable } from '../pinchable';
|
|
6
|
+
export function ImageItem({ ref, src, ...props }) {
|
|
7
|
+
useImperativeHandle(ref, () => {
|
|
8
|
+
if (pinchableRef.current) {
|
|
9
|
+
pinchableRef.current.isFit = () => {
|
|
10
|
+
const { x: pinchableX, width: pinchableWidth } = pinchableRef.current.getBoundingClientRect();
|
|
11
|
+
const { x: imgX, width: imgWidth } = imgRef.current.getBoundingClientRect();
|
|
12
|
+
return {
|
|
13
|
+
left: imgX >= pinchableX,
|
|
14
|
+
right: imgX + imgWidth <= pinchableX + pinchableWidth
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return pinchableRef.current;
|
|
19
|
+
});
|
|
20
|
+
const pinchableRef = useRef(null);
|
|
21
|
+
const imgRef = useRef(null);
|
|
22
|
+
const fitSize = () => {
|
|
23
|
+
const img = imgRef.current;
|
|
24
|
+
const imgRatio = img.naturalWidth / img.naturalHeight;
|
|
25
|
+
const pinchableRatio = pinchableRef.current.clientWidth / pinchableRef.current.clientHeight;
|
|
26
|
+
if (imgRatio >= pinchableRatio) {
|
|
27
|
+
img.style.width = '100%';
|
|
28
|
+
img.style.height = 'auto';
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
img.style.width = 'auto';
|
|
32
|
+
img.style.height = '100%';
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
!imgRef.current.complete && imgRef.current.addEventListener('load', fitSize, { once: true });
|
|
37
|
+
}, []);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
40
|
+
imgRef.current.complete && fitSize();
|
|
41
|
+
});
|
|
42
|
+
resizeObserver.observe(pinchableRef.current);
|
|
43
|
+
return () => {
|
|
44
|
+
resizeObserver.disconnect();
|
|
45
|
+
};
|
|
46
|
+
}, []);
|
|
47
|
+
return (_jsx(Pinchable, { ref: pinchableRef, className: clsx(classes.imageItem, props.className), ...props, children: _jsx("img", { ref: imgRef, className: classes.image, src: src, draggable: false, alt: "" }) }));
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './gallery';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './gallery';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { CSSProperties, ReactNode, JSX, ReactElement } from 'react';
|
|
2
2
|
import { DivProps } from '../../types';
|
|
3
|
-
import {
|
|
3
|
+
import { Gallery, ImagePreviewProps } from '../gallery/gallery';
|
|
4
4
|
export interface ImageProps extends DivProps {
|
|
5
5
|
src?: string;
|
|
6
6
|
fallback?: string;
|
|
@@ -20,5 +20,5 @@ export interface ImageProps extends DivProps {
|
|
|
20
20
|
}
|
|
21
21
|
export declare const Image: {
|
|
22
22
|
(props: ImageProps): ReactElement;
|
|
23
|
-
|
|
23
|
+
Gallery: typeof Gallery;
|
|
24
24
|
};
|
|
@@ -2,7 +2,7 @@ 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 {
|
|
5
|
+
import { Gallery } from '../gallery/gallery';
|
|
6
6
|
import { Icon, Skeleton } from '../..';
|
|
7
7
|
import { faEye } from '@fortawesome/free-regular-svg-icons/faEye';
|
|
8
8
|
export const Image = memo(({ src, fallback, onLoad, onError, renderLoading, alt = '', width, height, objectFit = 'cover', objectPosition = 'center', imgProps, actions, previewable = true, previewProps, onPreview, ...props }) => {
|
|
@@ -43,6 +43,6 @@ export const Image = memo(({ src, fallback, onLoad, onError, renderLoading, alt
|
|
|
43
43
|
}, onLoad: loadHandler, onError: errorHandler }), loading.current &&
|
|
44
44
|
(renderLoading ?? _jsx(Skeleton, { className: classes.skeleton })), !!renderedActions && !failed.current &&
|
|
45
45
|
_jsx("div", { className: classes.mask, children: renderedActions }), previewable && src &&
|
|
46
|
-
_jsx(
|
|
46
|
+
_jsx(Gallery, { src: [src], ...previewProps, open: previewOpen.current, onOpenChange: setPreviewOpen })] }));
|
|
47
47
|
});
|
|
48
|
-
Image.
|
|
48
|
+
Image.Gallery = Gallery;
|
|
@@ -36,5 +36,5 @@ export function OverlayBase({ container, forceRender, open, onMaskClick, singleL
|
|
|
36
36
|
onClosed?.();
|
|
37
37
|
forceRender === false && setShouldRender(false);
|
|
38
38
|
};
|
|
39
|
-
return shouldRender.current && createPortal(_jsxs("div", { ...props, css: style, className: clsx(classes.root, props.className), "data-open": open, "data-custom-container":
|
|
39
|
+
return shouldRender.current && createPortal(_jsxs("div", { ...props, css: style, className: clsx(classes.root, props.className), "data-open": open, "data-custom-container": containerEl !== document.body, children: [_jsx(Fade, { timeout: overlayBaseTransitionDuration, ...maskProps, in: open, className: clsx(classes.mask, maskProps?.className), onClick: clickHandler, onEntered: onEntered, onExited: onExited }), props.children] }), containerEl);
|
|
40
40
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DivProps } from '../../types';
|
|
2
|
-
import {
|
|
2
|
+
import { GestureOptions } from '../../utils';
|
|
3
3
|
import { ColorInstance } from 'color';
|
|
4
4
|
export interface PaletteProps extends Omit<DivProps, 'defaultValue' | 'onChange'> {
|
|
5
5
|
defaultValue?: ColorInstance;
|
|
6
6
|
value?: ColorInstance;
|
|
7
7
|
onChange?(value: ColorInstance): void;
|
|
8
|
-
|
|
8
|
+
gestureOptions?: GestureOptions;
|
|
9
9
|
}
|
|
10
|
-
export declare const Palette: import("react").MemoExoticComponent<({ defaultValue, value, onChange,
|
|
10
|
+
export declare const Palette: import("react").MemoExoticComponent<({ defaultValue, value, onChange, gestureOptions, ...props }: PaletteProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
|