@canlooks/can-ui 0.0.164 → 0.0.165
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.style.d.ts +1 -1
- package/dist/cjs/components/actionSheet/actionSheet.style.d.ts +1 -1
- package/dist/cjs/components/alert/alert.style.d.ts +1 -1
- package/dist/cjs/components/anchorList/anchorList.style.d.ts +1 -1
- package/dist/cjs/components/app/app.style.d.ts +2 -2
- package/dist/cjs/components/avatar/avatar.style.d.ts +1 -1
- package/dist/cjs/components/avatar/avatarGroup.style.d.ts +1 -1
- package/dist/cjs/components/backdrop/backdrop.style.d.ts +1 -1
- package/dist/cjs/components/badge/badge.style.d.ts +1 -1
- package/dist/cjs/components/bottomNavigation/bottomNavigation.style.d.ts +1 -1
- package/dist/cjs/components/boundary/errorBoundary.style.d.ts +1 -1
- package/dist/cjs/components/breadcrumb/breadcrumb.style.d.ts +1 -1
- package/dist/cjs/components/bubble/bubble.style.d.ts +1 -1
- package/dist/cjs/components/bubbleConfirm/bubbleConfirm.style.d.ts +1 -1
- package/dist/cjs/components/button/button.style.d.ts +1 -1
- package/dist/cjs/components/calendar/calendar.style.d.ts +1 -1
- package/dist/cjs/components/card/card.style.d.ts +1 -1
- package/dist/cjs/components/cascade/cascade.style.d.ts +2 -2
- package/dist/cjs/components/checkboxBase/checkboxBase.style.d.ts +1 -1
- package/dist/cjs/components/colorPicker/colorPicker.style.d.ts +2 -2
- package/dist/cjs/components/counter/counter.style.d.ts +1 -1
- package/dist/cjs/components/curd/curd.style.d.ts +2 -2
- package/dist/cjs/components/curd/curdColumnConfig.js +27 -15
- package/dist/cjs/components/curd/curdColumnConfig.style.d.ts +1 -1
- package/dist/cjs/components/dataGrid/dataGrid.style.d.ts +1 -1
- package/dist/cjs/components/dataGrid/filterBubbleContent.style.d.ts +1 -1
- package/dist/cjs/components/dateTimePicker/dateTimePicker.style.d.ts +2 -2
- package/dist/cjs/components/dateTimePicker/timer.style.d.ts +1 -1
- package/dist/cjs/components/dateTimeRangePicker/dateTimeRangePicker.style.d.ts +1 -1
- package/dist/cjs/components/descriptions/descriptions.style.d.ts +2 -2
- package/dist/cjs/components/dialog/dialog.style.d.ts +1 -1
- package/dist/cjs/components/divider/divider.style.d.ts +1 -1
- package/dist/cjs/components/drawer/drawer.style.d.ts +1 -1
- package/dist/cjs/components/dropdown/dropdown.style.d.ts +1 -1
- package/dist/cjs/components/flex/flex.style.d.ts +1 -1
- package/dist/cjs/components/form/form.style.d.ts +1 -1
- package/dist/cjs/components/gallery/gallery.style.d.ts +1 -1
- package/dist/cjs/components/grid/grid.style.d.ts +2 -2
- package/dist/cjs/components/image/image.style.d.ts +1 -1
- package/dist/cjs/components/image/image.style.js +2 -0
- package/dist/cjs/components/input/input.style.d.ts +2 -2
- package/dist/cjs/components/inputBase/inputBase.style.d.ts +1 -1
- package/dist/cjs/components/loading/loading.style.d.ts +1 -1
- package/dist/cjs/components/loadingIndicator/loadingIndicator.style.d.ts +1 -1
- package/dist/cjs/components/loadingMask/loadingMask.style.d.ts +1 -1
- package/dist/cjs/components/menu/menu.style.d.ts +1 -1
- package/dist/cjs/components/menuItem/menuItem.style.d.ts +2 -2
- package/dist/cjs/components/modal/modal.style.d.ts +1 -1
- package/dist/cjs/components/optionsBase/optionsBase.style.d.ts +1 -1
- package/dist/cjs/components/overlayBase/overlayBase.style.d.ts +1 -1
- package/dist/cjs/components/pagination/pagination.style.d.ts +1 -1
- package/dist/cjs/components/palette/palette.style.d.ts +1 -1
- package/dist/cjs/components/pickerDialog/pickerDialog.style.d.ts +1 -1
- package/dist/cjs/components/pinchable/pinchable.style.d.ts +1 -1
- package/dist/cjs/components/placeholder/placeholder.style.d.ts +1 -1
- package/dist/cjs/components/popper/popper.style.d.ts +4 -4
- package/dist/cjs/components/progress/progress.style.d.ts +1 -1
- package/dist/cjs/components/rating/rating.style.d.ts +1 -1
- package/dist/cjs/components/resizable/resizable.style.d.ts +1 -1
- package/dist/cjs/components/scrollbar/scrollbar.style.d.ts +1 -1
- package/dist/cjs/components/segmented/segmented.style.d.ts +1 -1
- package/dist/cjs/components/selectBase/selectBase.style.d.ts +1 -1
- package/dist/cjs/components/selectedList/selectedList.style.d.ts +1 -1
- package/dist/cjs/components/serialInput/serialInput.style.d.ts +1 -1
- package/dist/cjs/components/skeleton/skeleton.style.d.ts +3 -3
- package/dist/cjs/components/slidableActions/slidableActions.style.d.ts +1 -1
- package/dist/cjs/components/slider/slider.style.d.ts +2 -2
- package/dist/cjs/components/snackbarBase/snackbarBase.style.d.ts +1 -1
- package/dist/cjs/components/sortableItem/sortableItem.d.ts +3 -2
- package/dist/cjs/components/sortableItem/sortableItem.js +7 -31
- package/dist/cjs/components/sortableItem/sortableItem.style.d.ts +0 -2
- package/dist/cjs/components/sortableItem/sortableItem.style.js +1 -20
- package/dist/cjs/components/status/status.style.d.ts +1 -1
- package/dist/cjs/components/stepper/step.style.d.ts +1 -1
- package/dist/cjs/components/stepper/stepper.style.d.ts +1 -1
- package/dist/cjs/components/switch/switch.style.d.ts +1 -1
- package/dist/cjs/components/table/table.style.d.ts +1 -1
- package/dist/cjs/components/table/tableSticky.style.d.ts +1 -1
- package/dist/cjs/components/tabs/tab.d.ts +3 -1
- package/dist/cjs/components/tabs/tab.js +2 -2
- package/dist/cjs/components/tabs/tabs.d.ts +2 -2
- package/dist/cjs/components/tabs/tabs.js +15 -18
- package/dist/cjs/components/tabs/tabs.style.d.ts +1 -1
- package/dist/cjs/components/tabs/tabsEllipsis.style.d.ts +1 -1
- package/dist/cjs/components/tag/tag.style.d.ts +1 -1
- package/dist/cjs/components/textarea/textarea.style.d.ts +1 -1
- package/dist/cjs/components/timeline/timeline.style.d.ts +2 -2
- package/dist/cjs/components/toggleButton/toggleButton.style.d.ts +1 -1
- package/dist/cjs/components/tooltip/tooltip.style.d.ts +1 -1
- package/dist/cjs/components/touchRipple/touchRipple.style.d.ts +1 -1
- package/dist/cjs/components/transfer/transfer.style.d.ts +1 -1
- package/dist/cjs/components/transitionBase/transitionBase.style.d.ts +5 -5
- package/dist/cjs/components/tree/tree.style.d.ts +1 -1
- package/dist/cjs/components/tree/treeDnd.style.d.ts +2 -2
- package/dist/cjs/components/typography/typography.style.d.ts +2 -2
- package/dist/cjs/components/upload/dropArea.style.d.ts +1 -1
- package/dist/cjs/components/upload/upload.js +13 -14
- package/dist/cjs/components/upload/upload.style.d.ts +2 -2
- package/dist/cjs/components/upload/upload.style.js +4 -10
- package/dist/cjs/components/waterfall/waterfall.style.d.ts +1 -1
- package/dist/cjs/extensions/documentViewer/documentViewer.style.d.ts +2 -2
- package/dist/cjs/extensions/textFormatter/textFormatter.style.d.ts +1 -1
- package/dist/cjs/utils/dnd.d.ts +8 -6
- package/dist/cjs/utils/dnd.js +48 -21
- package/dist/esm/components/accordion/accordion.style.d.ts +1 -1
- package/dist/esm/components/actionSheet/actionSheet.style.d.ts +1 -1
- package/dist/esm/components/alert/alert.style.d.ts +1 -1
- package/dist/esm/components/anchorList/anchorList.style.d.ts +1 -1
- package/dist/esm/components/app/app.style.d.ts +2 -2
- package/dist/esm/components/avatar/avatar.style.d.ts +1 -1
- package/dist/esm/components/avatar/avatarGroup.style.d.ts +1 -1
- package/dist/esm/components/backdrop/backdrop.style.d.ts +1 -1
- package/dist/esm/components/badge/badge.style.d.ts +1 -1
- package/dist/esm/components/bottomNavigation/bottomNavigation.style.d.ts +1 -1
- package/dist/esm/components/boundary/errorBoundary.style.d.ts +1 -1
- package/dist/esm/components/breadcrumb/breadcrumb.style.d.ts +1 -1
- package/dist/esm/components/bubble/bubble.style.d.ts +1 -1
- package/dist/esm/components/bubbleConfirm/bubbleConfirm.style.d.ts +1 -1
- package/dist/esm/components/button/button.style.d.ts +1 -1
- package/dist/esm/components/calendar/calendar.style.d.ts +1 -1
- package/dist/esm/components/card/card.style.d.ts +1 -1
- package/dist/esm/components/cascade/cascade.style.d.ts +2 -2
- package/dist/esm/components/checkboxBase/checkboxBase.style.d.ts +1 -1
- package/dist/esm/components/colorPicker/colorPicker.style.d.ts +2 -2
- package/dist/esm/components/counter/counter.style.d.ts +1 -1
- package/dist/esm/components/curd/curd.style.d.ts +2 -2
- package/dist/esm/components/curd/curdColumnConfig.js +29 -17
- package/dist/esm/components/curd/curdColumnConfig.style.d.ts +1 -1
- package/dist/esm/components/dataGrid/dataGrid.style.d.ts +1 -1
- package/dist/esm/components/dataGrid/filterBubbleContent.style.d.ts +1 -1
- package/dist/esm/components/dateTimePicker/dateTimePicker.style.d.ts +2 -2
- package/dist/esm/components/dateTimePicker/timer.style.d.ts +1 -1
- package/dist/esm/components/dateTimeRangePicker/dateTimeRangePicker.style.d.ts +1 -1
- package/dist/esm/components/descriptions/descriptions.style.d.ts +2 -2
- package/dist/esm/components/dialog/dialog.style.d.ts +1 -1
- package/dist/esm/components/divider/divider.style.d.ts +1 -1
- package/dist/esm/components/drawer/drawer.style.d.ts +1 -1
- package/dist/esm/components/dropdown/dropdown.style.d.ts +1 -1
- package/dist/esm/components/flex/flex.style.d.ts +1 -1
- package/dist/esm/components/form/form.style.d.ts +1 -1
- package/dist/esm/components/gallery/gallery.style.d.ts +1 -1
- package/dist/esm/components/grid/grid.style.d.ts +2 -2
- package/dist/esm/components/image/image.style.d.ts +1 -1
- package/dist/esm/components/image/image.style.js +2 -0
- package/dist/esm/components/input/input.style.d.ts +2 -2
- package/dist/esm/components/inputBase/inputBase.style.d.ts +1 -1
- package/dist/esm/components/loading/loading.style.d.ts +1 -1
- package/dist/esm/components/loadingIndicator/loadingIndicator.style.d.ts +1 -1
- package/dist/esm/components/loadingMask/loadingMask.style.d.ts +1 -1
- package/dist/esm/components/menu/menu.style.d.ts +1 -1
- package/dist/esm/components/menuItem/menuItem.style.d.ts +2 -2
- package/dist/esm/components/modal/modal.style.d.ts +1 -1
- package/dist/esm/components/optionsBase/optionsBase.style.d.ts +1 -1
- package/dist/esm/components/overlayBase/overlayBase.style.d.ts +1 -1
- package/dist/esm/components/pagination/pagination.style.d.ts +1 -1
- package/dist/esm/components/palette/palette.style.d.ts +1 -1
- package/dist/esm/components/pickerDialog/pickerDialog.style.d.ts +1 -1
- package/dist/esm/components/pinchable/pinchable.style.d.ts +1 -1
- package/dist/esm/components/placeholder/placeholder.style.d.ts +1 -1
- package/dist/esm/components/popper/popper.style.d.ts +4 -4
- package/dist/esm/components/progress/progress.style.d.ts +1 -1
- package/dist/esm/components/rating/rating.style.d.ts +1 -1
- package/dist/esm/components/resizable/resizable.style.d.ts +1 -1
- package/dist/esm/components/scrollbar/scrollbar.style.d.ts +1 -1
- package/dist/esm/components/segmented/segmented.style.d.ts +1 -1
- package/dist/esm/components/selectBase/selectBase.style.d.ts +1 -1
- package/dist/esm/components/selectedList/selectedList.style.d.ts +1 -1
- package/dist/esm/components/serialInput/serialInput.style.d.ts +1 -1
- package/dist/esm/components/skeleton/skeleton.style.d.ts +3 -3
- package/dist/esm/components/slidableActions/slidableActions.style.d.ts +1 -1
- package/dist/esm/components/slider/slider.style.d.ts +2 -2
- package/dist/esm/components/snackbarBase/snackbarBase.style.d.ts +1 -1
- package/dist/esm/components/sortableItem/sortableItem.d.ts +3 -2
- package/dist/esm/components/sortableItem/sortableItem.js +10 -34
- package/dist/esm/components/sortableItem/sortableItem.style.d.ts +0 -2
- package/dist/esm/components/sortableItem/sortableItem.style.js +0 -19
- package/dist/esm/components/status/status.style.d.ts +1 -1
- package/dist/esm/components/stepper/step.style.d.ts +1 -1
- package/dist/esm/components/stepper/stepper.style.d.ts +1 -1
- package/dist/esm/components/switch/switch.style.d.ts +1 -1
- package/dist/esm/components/table/table.style.d.ts +1 -1
- package/dist/esm/components/table/tableSticky.style.d.ts +1 -1
- package/dist/esm/components/tabs/tab.d.ts +3 -1
- package/dist/esm/components/tabs/tab.js +2 -2
- package/dist/esm/components/tabs/tabs.d.ts +2 -2
- package/dist/esm/components/tabs/tabs.js +16 -19
- package/dist/esm/components/tabs/tabs.style.d.ts +1 -1
- package/dist/esm/components/tabs/tabsEllipsis.style.d.ts +1 -1
- package/dist/esm/components/tag/tag.style.d.ts +1 -1
- package/dist/esm/components/textarea/textarea.style.d.ts +1 -1
- package/dist/esm/components/timeline/timeline.style.d.ts +2 -2
- package/dist/esm/components/toggleButton/toggleButton.style.d.ts +1 -1
- package/dist/esm/components/tooltip/tooltip.style.d.ts +1 -1
- package/dist/esm/components/touchRipple/touchRipple.style.d.ts +1 -1
- package/dist/esm/components/transfer/transfer.style.d.ts +1 -1
- package/dist/esm/components/transitionBase/transitionBase.style.d.ts +5 -5
- package/dist/esm/components/tree/tree.style.d.ts +1 -1
- package/dist/esm/components/tree/treeDnd.style.d.ts +2 -2
- package/dist/esm/components/typography/typography.style.d.ts +2 -2
- package/dist/esm/components/upload/dropArea.style.d.ts +1 -1
- package/dist/esm/components/upload/upload.js +14 -15
- package/dist/esm/components/upload/upload.style.d.ts +2 -2
- package/dist/esm/components/upload/upload.style.js +4 -10
- package/dist/esm/components/waterfall/waterfall.style.d.ts +1 -1
- package/dist/esm/extensions/documentViewer/documentViewer.style.d.ts +2 -2
- package/dist/esm/extensions/textFormatter/textFormatter.style.d.ts +1 -1
- package/dist/esm/utils/dnd.d.ts +8 -6
- package/dist/esm/utils/dnd.js +45 -20
- package/package.json +13 -13
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
|
-
import { Arguments } from '@dnd-kit/sortable/dist/hooks/useSortable';
|
|
3
2
|
import { Id, OverridableComponent, OverridableProps } from '../../types';
|
|
3
|
+
import { UseSortableInput } from '@dnd-kit/react/sortable';
|
|
4
4
|
export type SortableItemOwnProps = {
|
|
5
5
|
id: Id;
|
|
6
|
+
index: number;
|
|
6
7
|
disabled?: boolean;
|
|
7
|
-
sortableArguments?:
|
|
8
|
+
sortableArguments?: UseSortableInput;
|
|
8
9
|
noStyle?: boolean;
|
|
9
10
|
};
|
|
10
11
|
export type SortableItemProps<C extends ElementType = 'div'> = OverridableProps<SortableItemOwnProps, C>;
|
|
@@ -2,39 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SortableItem = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const sortable_1 = require("@dnd-kit/sortable");
|
|
7
|
-
const utilities_1 = require("@dnd-kit/utilities");
|
|
8
5
|
const utils_1 = require("../../utils");
|
|
9
|
-
const react_2 = require("@emotion/react");
|
|
10
6
|
const sortableItem_style_1 = require("./sortableItem.style");
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
const sortable_1 = require("@dnd-kit/react/sortable");
|
|
8
|
+
exports.SortableItem = (({ component: Component = 'div', id, index, disabled, sortableArguments, noStyle, ...props }) => {
|
|
9
|
+
const { ref } = (0, sortable_1.useSortable)({
|
|
13
10
|
...sortableArguments,
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
id,
|
|
12
|
+
index,
|
|
13
|
+
disabled
|
|
16
14
|
});
|
|
17
|
-
|
|
18
|
-
const removeListener = () => {
|
|
19
|
-
if (preventDefaultCallback.current) {
|
|
20
|
-
removeEventListener('touchmove', preventDefaultCallback.current);
|
|
21
|
-
preventDefaultCallback.current = void 0;
|
|
22
|
-
}
|
|
23
|
-
removeEventListener('pointerup', onPointerUp);
|
|
24
|
-
};
|
|
25
|
-
const onPointerUp = (0, react_1.useCallback)(removeListener, []);
|
|
26
|
-
const syncOnTouchStart = (0, utils_1.useSync)(props.onTouchStart);
|
|
27
|
-
const onTouchStart = (0, react_1.useCallback)((e) => {
|
|
28
|
-
syncOnTouchStart.current?.(e);
|
|
29
|
-
addEventListener('touchmove', preventDefaultCallback.current = e => {
|
|
30
|
-
e.cancelable && e.preventDefault();
|
|
31
|
-
}, { passive: false });
|
|
32
|
-
addEventListener('pointerup', onPointerUp);
|
|
33
|
-
}, []);
|
|
34
|
-
(0, react_1.useEffect)(() => removeListener, []);
|
|
35
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Component, { ...attributes, ...listeners, ...props, ref: (0, utils_1.cloneRef)(setNodeRef, props.ref), css: sortableItem_style_1.style, className: (0, utils_1.clsx)(sortableItem_style_1.classes.root, props.className), style: {
|
|
36
|
-
transform: utilities_1.CSS.Transform.toString(transform),
|
|
37
|
-
transition,
|
|
38
|
-
...props.style
|
|
39
|
-
}, onTouchStart: disabled ? void 0 : onTouchStart, "data-no-style": noStyle, "data-dragging": isDragging, "data-draggable": !disabled }), !noStyle && isDragging && (0, jsx_runtime_1.jsx)(react_2.Global, { styles: sortableItem_style_1.globalGrabbingStyle })] }));
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(Component, { ...props, ref: (0, utils_1.cloneRef)(ref, props.ref), className: (0, utils_1.clsx)(sortableItem_style_1.classes.root, props.className), "data-no-style": noStyle, "data-draggable": !disabled }));
|
|
40
16
|
});
|
|
@@ -1,24 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const react_1 = require("@emotion/react");
|
|
3
|
+
exports.classes = void 0;
|
|
5
4
|
const utils_1 = require("../../utils");
|
|
6
5
|
exports.classes = (0, utils_1.defineInnerClasses)('sortable-item');
|
|
7
|
-
exports.style = (0, react_1.css) `
|
|
8
|
-
@layer reset {
|
|
9
|
-
&:not([data-no-style=true]) {
|
|
10
|
-
&[data-draggable=true] {
|
|
11
|
-
cursor: grab;
|
|
12
|
-
|
|
13
|
-
&:active {
|
|
14
|
-
cursor: grabbing;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
20
|
-
exports.globalGrabbingStyle = (0, react_1.css) `
|
|
21
|
-
* {
|
|
22
|
-
cursor: grabbing;
|
|
23
|
-
}
|
|
24
|
-
`;
|
|
@@ -9,4 +9,4 @@ export declare const classes: {
|
|
|
9
9
|
} & {
|
|
10
10
|
root: string;
|
|
11
11
|
};
|
|
12
|
-
export declare function useStyle({ color, gap }: Required<Pick<StepProps, 'color' | 'gap'>>): import("@emotion/
|
|
12
|
+
export declare function useStyle({ color, gap }: Required<Pick<StepProps, 'color' | 'gap'>>): import("@emotion/utils").SerializedStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const style: () => import("@emotion/
|
|
1
|
+
export declare const style: () => import("@emotion/utils").SerializedStyles;
|
|
@@ -15,5 +15,7 @@ export interface TabProps extends Omit<DivProps, 'prefix'> {
|
|
|
15
15
|
sortable?: boolean;
|
|
16
16
|
/** @private 内部使用,用于表示改选项卡是否为激活状态 */
|
|
17
17
|
_active?: boolean;
|
|
18
|
+
/** @private */
|
|
19
|
+
_index?: number;
|
|
18
20
|
}
|
|
19
|
-
export declare const Tab: React.MemoExoticComponent<({ prefix, suffix, color, orientation, label, value, disabled, closable, onClose, sortable, _active, ...props }: TabProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
|
|
21
|
+
export declare const Tab: React.MemoExoticComponent<({ prefix, suffix, color, orientation, label, value, disabled, closable, onClose, sortable, _active, _index, ...props }: TabProps) => import("@emotion/react/jsx-runtime").JSX.Element>;
|
|
@@ -11,7 +11,7 @@ const faXmark_1 = require("@fortawesome/free-solid-svg-icons/faXmark");
|
|
|
11
11
|
const icon_1 = require("../icon");
|
|
12
12
|
const sortableItem_1 = require("../sortableItem");
|
|
13
13
|
const transitionBase_1 = require("../transitionBase");
|
|
14
|
-
exports.Tab = (0, react_1.memo)(({ prefix, suffix, color, orientation, label, value, disabled, closable, onClose, sortable, _active, ...props }) => {
|
|
14
|
+
exports.Tab = (0, react_1.memo)(({ prefix, suffix, color, orientation, label, value, disabled, closable, onClose, sortable, _active, _index, ...props }) => {
|
|
15
15
|
const context = (0, tabs_1.useTabsContext)();
|
|
16
16
|
const colorValue = (0, utils_1.useColor)(color ?? context.color);
|
|
17
17
|
const _closable = closable ?? context.closable;
|
|
@@ -20,7 +20,7 @@ exports.Tab = (0, react_1.memo)(({ prefix, suffix, color, orientation, label, va
|
|
|
20
20
|
context.onClose?.(value);
|
|
21
21
|
};
|
|
22
22
|
const _sortable = sortable ?? context.sortable;
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(sortableItem_1.SortableItem, { ...props, className: (0, utils_1.clsx)(tabs_style_1.classes.tabWrapper, props.className), component: transitionBase_1.Collapse, orientation: "horizontal", id: value, disabled: !_sortable, children: (0, jsx_runtime_1.jsxs)("div", { className: tabs_style_1.classes.tab, style: {
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(sortableItem_1.SortableItem, { ...props, className: (0, utils_1.clsx)(tabs_style_1.classes.tabWrapper, props.className), component: transitionBase_1.Collapse, orientation: "horizontal", id: value, index: _index, disabled: !_sortable, children: (0, jsx_runtime_1.jsxs)("div", { className: tabs_style_1.classes.tab, style: {
|
|
24
24
|
borderColor: context.variant === 'line' && !context.animating && _active ? colorValue : void 0,
|
|
25
25
|
color: _active ? colorValue : void 0,
|
|
26
26
|
...props.style
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, ReactElement, ReactNode, SetStateAction, Dispatch } from 'react';
|
|
2
2
|
import { ColorPropsValue, DivProps, Id, Obj, Size } from '../../types';
|
|
3
3
|
import { Tab, TabProps } from './tab';
|
|
4
|
-
import {
|
|
4
|
+
import { DragDropEvents } from '@dnd-kit/abstract';
|
|
5
5
|
export type TabType = TabProps & Obj;
|
|
6
6
|
type TabsSharedProps = {
|
|
7
7
|
variant?: 'line' | 'card';
|
|
@@ -32,7 +32,7 @@ export interface TabsProps<T extends TabType = TabType> extends TabsSharedProps,
|
|
|
32
32
|
* @param e
|
|
33
33
|
* @param tabs 仅{@link tabs}模式支持,使用children时,该参数为`undefined`
|
|
34
34
|
*/
|
|
35
|
-
onSort?(e:
|
|
35
|
+
onSort?(e: Parameters<DragDropEvents<any, any, any>['dragend']>[0], tabs?: T[]): void;
|
|
36
36
|
/** 触发change事件的事件,默认为`click` */
|
|
37
37
|
changeEvent?: 'click' | 'pointerDown';
|
|
38
38
|
}
|
|
@@ -11,9 +11,8 @@ const theme_1 = require("../theme");
|
|
|
11
11
|
const tab_1 = require("./tab");
|
|
12
12
|
const tabsEllipsis_1 = require("./tabsEllipsis");
|
|
13
13
|
const lineIndicator_1 = require("./lineIndicator");
|
|
14
|
-
const core_1 = require("@dnd-kit/core");
|
|
15
|
-
const sortable_1 = require("@dnd-kit/sortable");
|
|
16
14
|
const react_transition_group_1 = require("react-transition-group");
|
|
15
|
+
const react_3 = require("@dnd-kit/react");
|
|
17
16
|
const TabsContext = (0, react_2.createContext)({});
|
|
18
17
|
function useTabsContext() {
|
|
19
18
|
return (0, react_2.useContext)(TabsContext);
|
|
@@ -49,10 +48,10 @@ exports.Tabs = (0, react_2.memo)(({ tabs, labelKey = 'label', primaryKey = 'valu
|
|
|
49
48
|
}, value: value, label: p[labelKey], [eventName]: (e) => {
|
|
50
49
|
p[eventName]?.(e);
|
|
51
50
|
setInnerValue(value);
|
|
52
|
-
}, _active: active }));
|
|
51
|
+
}, _active: active, _index: i }));
|
|
53
52
|
});
|
|
54
53
|
}
|
|
55
|
-
return react_2.Children.map(props.children, c => {
|
|
54
|
+
return react_2.Children.map(props.children, (c, _index) => {
|
|
56
55
|
if ((0, react_2.isValidElement)(c)) {
|
|
57
56
|
const { value } = c.props;
|
|
58
57
|
const active = !(0, utils_1.isUnset)(value) && value === innerValue.current;
|
|
@@ -70,7 +69,8 @@ exports.Tabs = (0, react_2.memo)(({ tabs, labelKey = 'label', primaryKey = 'valu
|
|
|
70
69
|
!(0, utils_1.isUnset)(value) && setInnerValue(value);
|
|
71
70
|
}
|
|
72
71
|
},
|
|
73
|
-
_active: active
|
|
72
|
+
_active: active,
|
|
73
|
+
_index
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
return c;
|
|
@@ -125,26 +125,23 @@ exports.Tabs = (0, react_2.memo)(({ tabs, labelKey = 'label', primaryKey = 'valu
|
|
|
125
125
|
* ----------------------------------------------------------------
|
|
126
126
|
* 拖拽
|
|
127
127
|
*/
|
|
128
|
-
const
|
|
129
|
-
? tabs.map(tab => tab[primaryKey])
|
|
130
|
-
: react_2.Children.map(props.children, c => (0, react_2.isValidElement)(c) ? c.props.value : c);
|
|
131
|
-
const dragEndHandler = (e) => {
|
|
128
|
+
const dragEndHandler = e => {
|
|
132
129
|
if (props.onSort) {
|
|
133
130
|
const newTabs = tabs
|
|
134
131
|
? (0, utils_1.onDndDragEnd)(e, tabs, primaryKey)
|
|
135
132
|
: void 0;
|
|
136
|
-
props.onSort(e, newTabs);
|
|
133
|
+
newTabs && props.onSort(e, newTabs);
|
|
137
134
|
}
|
|
138
135
|
};
|
|
139
136
|
return ((0, jsx_runtime_1.jsxs)("div", { ...props, css: (0, tabs_style_1.useStyle)({ color, variant }), className: (0, utils_1.clsx)(tabs_style_1.classes.root, props.className), "data-size": size, "data-position": position, "data-animating": animating.current, "data-full-width": fullWidth, "data-read-only": readOnly, "data-disabled": disabled, children: [(0, jsx_runtime_1.jsx)("div", { className: tabs_style_1.classes.start, "data-show": shadowStart, children: !!prefix &&
|
|
140
|
-
(0, jsx_runtime_1.jsx)("div", { className: tabs_style_1.classes.prefix, children: prefix }) }), (0, jsx_runtime_1.jsx)("div", { ref: scrollRef, className: tabs_style_1.classes.scroll, onScroll: setShadow, children: (0, jsx_runtime_1.jsx)("div", { className: tabs_style_1.classes.scrollWrap, style: { justifyContent }, children: (0, jsx_runtime_1.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
137
|
+
(0, jsx_runtime_1.jsx)("div", { className: tabs_style_1.classes.prefix, children: prefix }) }), (0, jsx_runtime_1.jsx)("div", { ref: scrollRef, className: tabs_style_1.classes.scroll, onScroll: setShadow, children: (0, jsx_runtime_1.jsx)("div", { className: tabs_style_1.classes.scrollWrap, style: { justifyContent }, children: (0, jsx_runtime_1.jsxs)(TabsContext, { value: (0, react_2.useMemo)(() => ({
|
|
138
|
+
color, variant, closable, onClose, sortable,
|
|
139
|
+
animating: animating.current, setAnimating
|
|
140
|
+
}), [
|
|
141
|
+
color, variant, closable, onClose, sortable,
|
|
142
|
+
animating.current
|
|
143
|
+
]), children: [(0, jsx_runtime_1.jsx)(react_3.DragDropProvider, { sensors: utils_1.defaultSensors, onDragEnd: dragEndHandler, children: (0, jsx_runtime_1.jsx)(react_transition_group_1.TransitionGroup, { component: null, children: renderTabs() }) }), variant === 'line' &&
|
|
144
|
+
(0, jsx_runtime_1.jsx)(lineIndicator_1.LineIndicator, { value: innerValue.current, position: position, getActiveTab: getActiveTab })] }) }) }), (0, jsx_runtime_1.jsx)("div", { className: tabs_style_1.classes.end, "data-show": shadowEnd, children: !!(suffix || shadowStart || shadowEnd) &&
|
|
148
145
|
(0, jsx_runtime_1.jsxs)("div", { className: tabs_style_1.classes.suffix, children: [(shadowStart || shadowEnd) &&
|
|
149
146
|
(0, jsx_runtime_1.jsx)(tabsEllipsis_1.TabsEllipsis, { tabs: tabs, labelKey: labelKey, primaryKey: primaryKey, value: innerValue.current, onToggleSelected: setValueInEllipsis, children: props.children }), suffix] }) })] }));
|
|
150
147
|
});
|
|
@@ -18,4 +18,4 @@ export declare const classes: {
|
|
|
18
18
|
root: string;
|
|
19
19
|
};
|
|
20
20
|
export declare const indicatorWidth = 2;
|
|
21
|
-
export declare function useStyle({ color, variant }: Required<Pick<TabsProps, 'color' | 'variant'>>): import("@emotion/
|
|
21
|
+
export declare function useStyle({ color, variant }: Required<Pick<TabsProps, 'color' | 'variant'>>): import("@emotion/utils").SerializedStyles[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const tabsEllipsisPopperStyle: () => import("@emotion/
|
|
1
|
+
export declare const tabsEllipsisPopperStyle: () => import("@emotion/utils").SerializedStyles[];
|
|
@@ -7,4 +7,4 @@ export declare const classes: {
|
|
|
7
7
|
} & {
|
|
8
8
|
root: string;
|
|
9
9
|
};
|
|
10
|
-
export declare function useStyle({ color }: Required<Pick<TagProps, 'color'>>): import("@emotion/
|
|
10
|
+
export declare function useStyle({ color }: Required<Pick<TagProps, 'color'>>): import("@emotion/utils").SerializedStyles;
|
|
@@ -8,7 +8,7 @@ export declare const classes: {
|
|
|
8
8
|
} & {
|
|
9
9
|
root: string;
|
|
10
10
|
};
|
|
11
|
-
export declare const style: () => import("@emotion/
|
|
11
|
+
export declare const style: () => import("@emotion/utils").SerializedStyles;
|
|
12
12
|
export declare function useTimelineItemStyle({ color }: {
|
|
13
13
|
color: ColorPropsValue;
|
|
14
|
-
}): import("@emotion/
|
|
14
|
+
}): import("@emotion/utils").SerializedStyles;
|
|
@@ -2,8 +2,8 @@ import { TransitionBaseProps } from './transitionBase';
|
|
|
2
2
|
export declare const classes: {
|
|
3
3
|
root: string;
|
|
4
4
|
};
|
|
5
|
-
export declare function useTransitionBaseStyle({ timeout }: Required<Pick<TransitionBaseProps<any>, 'timeout'>>): import("@emotion/
|
|
6
|
-
export declare const fadeStyle: () => import("@emotion/
|
|
7
|
-
export declare const sweepingStyle: () => import("@emotion/
|
|
8
|
-
export declare function useGrowAndCollapseStyle({ orientation, _mode }: Required<Pick<TransitionBaseProps<any>, 'orientation' | '_mode'>>): import("@emotion/
|
|
9
|
-
export declare function useSlideStyle({ direction, offset }: Required<Pick<TransitionBaseProps<any>, 'direction' | 'offset'>>): import("@emotion/
|
|
5
|
+
export declare function useTransitionBaseStyle({ timeout }: Required<Pick<TransitionBaseProps<any>, 'timeout'>>): import("@emotion/utils").SerializedStyles;
|
|
6
|
+
export declare const fadeStyle: () => import("@emotion/utils").SerializedStyles;
|
|
7
|
+
export declare const sweepingStyle: () => import("@emotion/utils").SerializedStyles;
|
|
8
|
+
export declare function useGrowAndCollapseStyle({ orientation, _mode }: Required<Pick<TransitionBaseProps<any>, 'orientation' | '_mode'>>): import("@emotion/utils").SerializedStyles;
|
|
9
|
+
export declare function useSlideStyle({ direction, offset }: Required<Pick<TransitionBaseProps<any>, 'direction' | 'offset'>>): import("@emotion/utils").SerializedStyles;
|
|
@@ -12,5 +12,5 @@ export declare const treeDndClasses: {
|
|
|
12
12
|
};
|
|
13
13
|
export declare function useStyle({ indent }: {
|
|
14
14
|
indent: number;
|
|
15
|
-
}): import("@emotion/
|
|
16
|
-
export declare const globalGrabbingStyle: import("@emotion/
|
|
15
|
+
}): import("@emotion/utils").SerializedStyles;
|
|
16
|
+
export declare const globalGrabbingStyle: import("@emotion/utils").SerializedStyles;
|
|
@@ -10,5 +10,5 @@ export declare const classes: {
|
|
|
10
10
|
} & {
|
|
11
11
|
root: string;
|
|
12
12
|
};
|
|
13
|
-
export declare function useStyle({ color }: Required<Pick<TypographyProps, 'color'>>): import("@emotion/
|
|
14
|
-
export declare const editStyle: import("@emotion/
|
|
13
|
+
export declare function useStyle({ color }: Required<Pick<TypographyProps, 'color'>>): import("@emotion/utils").SerializedStyles;
|
|
14
|
+
export declare const editStyle: import("@emotion/utils").SerializedStyles;
|
|
@@ -10,13 +10,12 @@ const fileItem_1 = require("./fileItem");
|
|
|
10
10
|
const react_transition_group_1 = require("react-transition-group");
|
|
11
11
|
const transitionBase_1 = require("../transitionBase");
|
|
12
12
|
const imageItem_1 = require("./imageItem");
|
|
13
|
-
const core_1 = require("@dnd-kit/core");
|
|
14
|
-
const sortable_1 = require("@dnd-kit/sortable");
|
|
15
13
|
const sortableItem_1 = require("../sortableItem");
|
|
16
14
|
const dropArea_1 = require("./dropArea");
|
|
17
15
|
const icon_1 = require("../icon");
|
|
18
16
|
const faPlus_1 = require("@fortawesome/free-solid-svg-icons/faPlus");
|
|
19
17
|
const faUpload_1 = require("@fortawesome/free-solid-svg-icons/faUpload");
|
|
18
|
+
const react_2 = require("@dnd-kit/react");
|
|
20
19
|
const markFileId = (files) => {
|
|
21
20
|
if (files) {
|
|
22
21
|
for (const file of files) {
|
|
@@ -90,7 +89,7 @@ exports.Upload = (0, react_1.memo)(({ inputProps, type = 'file', accept = type =
|
|
|
90
89
|
const removeHandler = (id) => {
|
|
91
90
|
setInnerValue(o => o.filter(f => f.id !== id));
|
|
92
91
|
};
|
|
93
|
-
const dragEndHandler =
|
|
92
|
+
const dragEndHandler = e => {
|
|
94
93
|
const newValue = (0, utils_1.onDndDragEnd)(e, innerValue.current);
|
|
95
94
|
newValue && setInnerValue(newValue);
|
|
96
95
|
};
|
|
@@ -98,19 +97,19 @@ exports.Upload = (0, react_1.memo)(({ inputProps, type = 'file', accept = type =
|
|
|
98
97
|
ref: innerInputRef,
|
|
99
98
|
className: upload_style_1.classes.input,
|
|
100
99
|
onChange: inputChangeHandler
|
|
101
|
-
}), "data-hidden": "true" }), (0, jsx_runtime_1.jsx)(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
r
|
|
107
|
-
? itemRefs.current.set(file.id, r)
|
|
108
|
-
: itemRefs.current.delete(file.id);
|
|
109
|
-
}, file: file, onRemove: () => removeHandler(file.id), onUpload: onUpload }) }, file.id)) })] })
|
|
110
|
-
: (0, jsx_runtime_1.jsxs)(react_transition_group_1.TransitionGroup, { className: upload_style_1.classes.images, children: [(0, jsx_runtime_1.jsx)(transitionBase_1.Grow, { children: (0, jsx_runtime_1.jsx)("div", { className: upload_style_1.classes.imageWrap, "data-clickable": "true", children: (0, jsx_runtime_1.jsx)("div", { className: upload_style_1.classes.image, onClick: () => innerInputRef.current.click(), children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faPlus_1.faPlus }) }) }) }), innerValue.current.map(file => (0, jsx_runtime_1.jsx)(sortableItem_1.SortableItem, { component: transitionBase_1.Collapse, className: upload_style_1.classes.sortable, id: file.id, orientation: "horizontal", children: (0, jsx_runtime_1.jsx)(imageItem_1.ImageItem, { ref: r => {
|
|
100
|
+
}), "data-hidden": "true" }), (0, jsx_runtime_1.jsx)(react_2.DragDropProvider, { sensors: utils_1.defaultSensors, onDragEnd: dragEndHandler, children: type === 'file'
|
|
101
|
+
? (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [droppable
|
|
102
|
+
? (0, jsx_runtime_1.jsx)(dropArea_1.DropArea, { onClick: () => innerInputRef.current.click(), onDrop: changeFn })
|
|
103
|
+
: showButton &&
|
|
104
|
+
(0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outlined", prefix: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faUpload_1.faUpload }), ...buttonProps, onClick: buttonClick, children: buttonText }), (0, jsx_runtime_1.jsx)(react_transition_group_1.TransitionGroup, { className: upload_style_1.classes.files, children: innerValue.current.map((file, index) => (0, jsx_runtime_1.jsx)(sortableItem_1.SortableItem, { component: transitionBase_1.Collapse, className: upload_style_1.classes.sortableItem, id: file.id, index: index, disabled: !sortable, children: (0, jsx_runtime_1.jsx)(fileItem_1.FileItem, { ref: r => {
|
|
111
105
|
r
|
|
112
106
|
? itemRefs.current.set(file.id, r)
|
|
113
107
|
: itemRefs.current.delete(file.id);
|
|
114
|
-
},
|
|
108
|
+
}, file: file, onRemove: () => removeHandler(file.id), onUpload: onUpload }) }, file.id)) })] })
|
|
109
|
+
: (0, jsx_runtime_1.jsxs)(react_transition_group_1.TransitionGroup, { className: upload_style_1.classes.images, children: [(0, jsx_runtime_1.jsx)(transitionBase_1.Grow, { children: (0, jsx_runtime_1.jsx)("div", { className: upload_style_1.classes.imageWrap, "data-clickable": "true", children: (0, jsx_runtime_1.jsx)("div", { className: upload_style_1.classes.image, onClick: () => innerInputRef.current.click(), children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faPlus_1.faPlus }) }) }) }), innerValue.current.map((file, index) => (0, jsx_runtime_1.jsx)(sortableItem_1.SortableItem, { component: transitionBase_1.Collapse, className: upload_style_1.classes.sortableItem, id: file.id, index: index, disabled: !sortable, orientation: "horizontal", children: (0, jsx_runtime_1.jsx)(imageItem_1.ImageItem, { ref: r => {
|
|
110
|
+
r
|
|
111
|
+
? itemRefs.current.set(file.id, r)
|
|
112
|
+
: itemRefs.current.delete(file.id);
|
|
113
|
+
}, type: type, file: file, onRemove: () => removeHandler(file.id), onUpload: onUpload }, file.id) }, file.id))] }) })] }));
|
|
115
114
|
});
|
|
116
115
|
exports.Upload.DropArea = dropArea_1.DropArea;
|
|
@@ -8,10 +8,10 @@ export declare const classes: {
|
|
|
8
8
|
file: string;
|
|
9
9
|
files: string;
|
|
10
10
|
images: string;
|
|
11
|
-
sortable: string;
|
|
12
11
|
control: string;
|
|
13
12
|
imageWrap: string;
|
|
13
|
+
sortableItem: string;
|
|
14
14
|
} & {
|
|
15
15
|
root: string;
|
|
16
16
|
};
|
|
17
|
-
export declare const style: () => import("@emotion/
|
|
17
|
+
export declare const style: () => import("@emotion/utils").SerializedStyles;
|
|
@@ -17,7 +17,7 @@ exports.classes = (0, utils_1.defineInnerClasses)('upload', [
|
|
|
17
17
|
'images',
|
|
18
18
|
'imageWrap',
|
|
19
19
|
'image',
|
|
20
|
-
'
|
|
20
|
+
'sortableItem'
|
|
21
21
|
]);
|
|
22
22
|
exports.style = (0, utils_1.defineCss)(({ spacing, mode, text, gray, borderRadius, colors, divider, easing, background }) => {
|
|
23
23
|
const maskBg = (0, color_1.default)(background.content).alpha(.9).string();
|
|
@@ -150,18 +150,12 @@ exports.style = (0, utils_1.defineCss)(({ spacing, mode, text, gray, borderRadiu
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
.${exports.classes.sortable}[data-dragging=true] {
|
|
154
|
-
position: relative;
|
|
155
|
-
z-index: 1;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
153
|
&[data-sortable=true] {
|
|
159
|
-
.${exports.classes.
|
|
160
|
-
|
|
154
|
+
.${exports.classes.sortableItem}[data-dragging=true] {
|
|
155
|
+
position: relative;
|
|
156
|
+
z-index: 1;
|
|
161
157
|
}
|
|
162
|
-
}
|
|
163
158
|
|
|
164
|
-
&:not([data-sortable=true]) {
|
|
165
159
|
.${exports.classes.file}, .${exports.classes.imageWrap} {
|
|
166
160
|
cursor: default;
|
|
167
161
|
}
|
|
@@ -11,5 +11,5 @@ export declare const classes: {
|
|
|
11
11
|
} & {
|
|
12
12
|
root: string;
|
|
13
13
|
};
|
|
14
|
-
export declare const iframeStyle: import("@emotion/
|
|
15
|
-
export declare const svgStyle: () => import("@emotion/
|
|
14
|
+
export declare const iframeStyle: import("@emotion/utils").SerializedStyles;
|
|
15
|
+
export declare const svgStyle: () => import("@emotion/utils").SerializedStyles;
|
package/dist/cjs/utils/dnd.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { DragEndEvent } from '@dnd-kit/core';
|
|
2
1
|
import { Id, Obj } from '../types';
|
|
3
2
|
import { NodeType, SortInfo } from '../components/tree';
|
|
4
3
|
import { BezierFunc } from './bezier';
|
|
4
|
+
import { Customizable, DragDropEvents, Sensors } from '@dnd-kit/abstract';
|
|
5
5
|
/**
|
|
6
|
-
* 默认提供给@dnd-kit
|
|
6
|
+
* 默认提供给@dnd-kit<DragDropProvider/>的sensors属性
|
|
7
7
|
*/
|
|
8
|
-
export declare
|
|
8
|
+
export declare const defaultSensors: Customizable<Sensors>;
|
|
9
9
|
/**
|
|
10
|
-
* <
|
|
10
|
+
* <DragDropProvider>组件通用的onDragEnd方法
|
|
11
11
|
* @param e 事件
|
|
12
|
-
* @param
|
|
12
|
+
* @param items 传入需要排序的数组
|
|
13
13
|
* @param primaryKey 索引用的主键,默认为`id`
|
|
14
|
+
* @return 返回新的数组,但如果顺序未改变,会得到null
|
|
14
15
|
*/
|
|
15
|
-
export declare function onDndDragEnd<
|
|
16
|
+
export declare function onDndDragEnd<T extends Obj>({ operation }: Parameters<DragDropEvents<any, any, any>['dragend']>[0], items: T[], primaryKey?: keyof T): T[] | null;
|
|
17
|
+
export declare function arrayMove<T>(array: T[], from: number, to: number): T[];
|
|
16
18
|
/**
|
|
17
19
|
* <Tree>组件通用的onSort方法,注意:该方法会原地修改{@link treeNodes}
|
|
18
20
|
* @param info 信息
|