@canlooks/can-ui 0.0.163 → 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.js +6 -2
- 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.d.ts +1 -0
- package/dist/cjs/components/dataGrid/dataGrid.js +6 -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.js +7 -3
- 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.d.ts +1 -0
- package/dist/esm/components/dataGrid/dataGrid.js +6 -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
|
@@ -2,5 +2,5 @@ import { Theme } from '../theme';
|
|
|
2
2
|
export declare const classes: {
|
|
3
3
|
root: string;
|
|
4
4
|
};
|
|
5
|
-
export declare const appStyleCallback: (theme: Theme) => import("@emotion/
|
|
6
|
-
export declare const style: () => import("@emotion/
|
|
5
|
+
export declare const appStyleCallback: (theme: Theme) => import("@emotion/utils").SerializedStyles;
|
|
6
|
+
export declare const style: () => import("@emotion/utils").SerializedStyles;
|
|
@@ -2,4 +2,4 @@ import { BackdropProps } from './backdrop';
|
|
|
2
2
|
export declare const classes: {
|
|
3
3
|
root: string;
|
|
4
4
|
};
|
|
5
|
-
export declare function useStyle({ variant }: Pick<BackdropProps, 'variant'>): import("@emotion/
|
|
5
|
+
export declare function useStyle({ variant }: Pick<BackdropProps, 'variant'>): import("@emotion/utils").SerializedStyles;
|
|
@@ -11,5 +11,5 @@ export declare const classes: {
|
|
|
11
11
|
} & {
|
|
12
12
|
root: string;
|
|
13
13
|
};
|
|
14
|
-
export declare const style: () => import("@emotion/
|
|
15
|
-
export declare const cascadePopperStyle: () => import("@emotion/
|
|
14
|
+
export declare const style: () => import("@emotion/utils").SerializedStyles;
|
|
15
|
+
export declare const cascadePopperStyle: () => import("@emotion/utils").SerializedStyles[];
|
|
@@ -10,4 +10,4 @@ export declare const classes: {
|
|
|
10
10
|
} & {
|
|
11
11
|
root: string;
|
|
12
12
|
};
|
|
13
|
-
export declare function useStyle({ color }: Required<Pick<CheckboxBaseProps, 'color'>>): import("@emotion/
|
|
13
|
+
export declare function useStyle({ color }: Required<Pick<CheckboxBaseProps, 'color'>>): import("@emotion/utils").SerializedStyles;
|
|
@@ -6,5 +6,5 @@ export declare const classes: {
|
|
|
6
6
|
} & {
|
|
7
7
|
root: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const style: () => import("@emotion/
|
|
10
|
-
export declare const colorPickerPopperStyle: () => import("@emotion/
|
|
9
|
+
export declare const style: () => import("@emotion/utils").SerializedStyles;
|
|
10
|
+
export declare const colorPickerPopperStyle: () => import("@emotion/utils").SerializedStyles[];
|
|
@@ -134,6 +134,7 @@ exports.Curd = (0, react_1.memo)((props) => {
|
|
|
134
134
|
* -------------------------------------------------------------
|
|
135
135
|
* 行数据
|
|
136
136
|
*/
|
|
137
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
137
138
|
const { setOptions } = (0, selectionContext_1.useSelectionContext)();
|
|
138
139
|
const [innerRows, _setInnerRows] = (0, utils_1.useDerivedState)(props.rows);
|
|
139
140
|
(0, react_1.useEffect)(() => {
|
|
@@ -142,6 +143,7 @@ exports.Curd = (0, react_1.memo)((props) => {
|
|
|
142
143
|
const setInnerRows = (data) => {
|
|
143
144
|
setOptions?.(data);
|
|
144
145
|
_setInnerRows(data);
|
|
146
|
+
containerRef.current.scrollTop = 0;
|
|
145
147
|
};
|
|
146
148
|
const [innerTotal, setInnerTotal] = (0, utils_1.useDerivedState)(props.paginationProps?.total || 0);
|
|
147
149
|
const suppressReload = (0, react_1.useRef)(false);
|
|
@@ -245,10 +247,12 @@ exports.Curd = (0, react_1.memo)((props) => {
|
|
|
245
247
|
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [toolbarRight, (0, jsx_runtime_1.jsx)(divider_1.Divider, { className: curd_style_1.classes.divider, orientation: "vertical" })] }), reloadable &&
|
|
246
248
|
(0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { title: "\u5237\u65B0", children: (0, jsx_runtime_1.jsx)(button_1.Button, { shape: "circular", variant: "text", color: "text.secondary", prefix: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faRotateRight_1.faRotateRight }), loading: innerLoading.current, onClick: reloadHandler }) }), resizable &&
|
|
247
249
|
(0, jsx_runtime_1.jsx)(curdResizable_1.CurdResizable, { innerSize: innerSize.current, setInnerSize: setInnerSize }), columnConfigurable &&
|
|
248
|
-
(0, jsx_runtime_1.jsx)(curdColumnConfig_1.CurdColumnConfig, { columns: orderedColumns, innerVisible: innerVisible.current, setInnerVisible: setInnerVisible, setInnerOrder: setInnerOrder })] })] }), (0, jsx_runtime_1.jsx)("div", { className: curd_style_1.classes.card, children: (0, jsx_runtime_1.jsx)(dataGrid_1.DataGrid, { ...dataGridProps,
|
|
250
|
+
(0, jsx_runtime_1.jsx)(curdColumnConfig_1.CurdColumnConfig, { columns: orderedColumns, innerVisible: innerVisible.current, setInnerVisible: setInnerVisible, setInnerOrder: setInnerOrder })] })] }), (0, jsx_runtime_1.jsx)("div", { className: curd_style_1.classes.card, children: (0, jsx_runtime_1.jsx)(dataGrid_1.DataGrid, { ...dataGridProps, slotProps: {
|
|
251
|
+
container: { ref: (0, utils_1.cloneRef)(containerRef, dataGridProps?.slotProps?.container?.ref) }
|
|
252
|
+
}, tableProps: {
|
|
249
253
|
...props.tableProps,
|
|
250
254
|
...resizable && { size: innerSize.current }
|
|
251
|
-
}, loading: innerLoading.current, rows: innerRows.current, paginatable: !loadRows && props.paginatable, renderPagination: loadRows && props.paginatable !== false
|
|
255
|
+
}, columns: actualColumns, loading: innerLoading.current, rows: innerRows.current, paginatable: !loadRows && props.paginatable, renderPagination: loadRows && props.paginatable !== false
|
|
252
256
|
? () => (0, jsx_runtime_1.jsx)(pagination_1.Pagination, { ...props.paginationProps, total: innerTotal.current, page: innerPage.current, onPageChange: setInnerPage, pageSize: innerPageSize.current, onPageSizeChange: setInnerPageSize })
|
|
253
257
|
: props.renderPagination, orderColumn: innerOrderColumn.current, orderType: innerOrderType.current, onOrderChange: orderChangeHandler, _noRenderFormTag: true }) })] }), (creatable || updatable) &&
|
|
254
258
|
(0, jsx_runtime_1.jsx)(curdDialog_1.CurdDialog, { ...dialogProps, ref: curdDialogRef, onFinish: finishHandler, curdProps: props })] }));
|
|
@@ -19,5 +19,5 @@ export declare const classes: {
|
|
|
19
19
|
} & {
|
|
20
20
|
root: string;
|
|
21
21
|
};
|
|
22
|
-
export declare const style: () => import("@emotion/
|
|
23
|
-
export declare const dialogStyle: () => import("@emotion/
|
|
22
|
+
export declare const style: () => import("@emotion/utils").SerializedStyles;
|
|
23
|
+
export declare const dialogStyle: () => import("@emotion/utils").SerializedStyles;
|
|
@@ -9,16 +9,28 @@ const curdColumnConfig_style_1 = require("./curdColumnConfig.style");
|
|
|
9
9
|
const menuItem_1 = require("../menuItem");
|
|
10
10
|
const checkbox_1 = require("../checkbox");
|
|
11
11
|
const sortableItem_1 = require("../sortableItem");
|
|
12
|
-
const core_1 = require("@dnd-kit/core");
|
|
13
|
-
const sortable_1 = require("@dnd-kit/sortable");
|
|
14
12
|
const utils_1 = require("../../utils");
|
|
15
13
|
const icon_1 = require("../icon");
|
|
16
14
|
const faGear_1 = require("@fortawesome/free-solid-svg-icons/faGear");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const dragEndHandler =
|
|
20
|
-
const newColumns = (0, utils_1.onDndDragEnd)(e, columns, '_key');
|
|
21
|
-
newColumns && setInnerOrder(newColumns.flatMap(col => col._key ?? []));
|
|
15
|
+
const react_2 = require("@dnd-kit/react");
|
|
16
|
+
exports.CurdColumnConfig = (0, react_1.memo)((props) => {
|
|
17
|
+
const dragEndHandler = e => {
|
|
18
|
+
const newColumns = (0, utils_1.onDndDragEnd)(e, props.columns || [], '_key');
|
|
19
|
+
newColumns && props.setInnerOrder(newColumns.flatMap(col => col._key ?? []));
|
|
20
|
+
};
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(react_2.DragDropProvider, { sensors: utils_1.defaultSensors, onDragEnd: dragEndHandler, children: (0, jsx_runtime_1.jsx)(CurdColumnConfigContent, { ...props }) }));
|
|
22
|
+
});
|
|
23
|
+
const CurdColumnConfigContent = (0, react_1.memo)(({ columns, innerVisible, setInnerVisible }) => {
|
|
24
|
+
const isDragging = (0, react_1.useRef)(false);
|
|
25
|
+
(0, react_2.useDragDropMonitor)({
|
|
26
|
+
onDragStart: () => isDragging.current = true,
|
|
27
|
+
onDragEnd: () => isDragging.current = false
|
|
28
|
+
});
|
|
29
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
30
|
+
const openChangeHandler = (open) => {
|
|
31
|
+
if (open || !isDragging.current) {
|
|
32
|
+
setOpen(open);
|
|
33
|
+
}
|
|
22
34
|
};
|
|
23
35
|
const visibleSet = (0, react_1.useMemo)(() => {
|
|
24
36
|
return new Set(innerVisible);
|
|
@@ -28,12 +40,12 @@ exports.CurdColumnConfig = (0, react_1.memo)(({ columns, innerVisible, setInnerV
|
|
|
28
40
|
? [...o, key]
|
|
29
41
|
: o.filter(k => k !== key));
|
|
30
42
|
};
|
|
31
|
-
return ((0, jsx_runtime_1.jsx)(bubble_1.Bubble, { css: curdColumnConfig_style_1.style,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)(bubble_1.Bubble, { css: curdColumnConfig_style_1.style, open: open, onOpenChange: openChangeHandler, placement: "bottomRight", trigger: ['hover', 'click'], content: (0, jsx_runtime_1.jsxs)("div", { className: curdColumnConfig_style_1.classes.content, children: [(0, jsx_runtime_1.jsxs)("div", { className: curdColumnConfig_style_1.classes.title, children: [(0, jsx_runtime_1.jsx)("div", { className: curdColumnConfig_style_1.classes.titleText, children: "\u5217\u8BBE\u7F6E" }), (0, jsx_runtime_1.jsx)("div", { className: curdColumnConfig_style_1.classes.description, children: "\u62D6\u62FD\u8C03\u6574\u987A\u5E8F" })] }), columns?.map((col, i) => {
|
|
44
|
+
const id = col._key;
|
|
45
|
+
const checked = !(0, utils_1.isUnset)(id) && visibleSet.has(id);
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(sortableItem_1.SortableItem, { id: id ?? i, index: i, component: menuItem_1.MenuItem, className: curdColumnConfig_style_1.classes.item, prefix: (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { className: curdColumnConfig_style_1.classes.checkbox, checked: checked, onChange: e => {
|
|
47
|
+
e.stopPropagation();
|
|
48
|
+
toggleVisible(id, e.target.checked);
|
|
49
|
+
} }), onClick: () => toggleVisible(id, !checked), label: col.titleText ?? col.title, noStyle: true }, id ?? i));
|
|
50
|
+
})] }), autoClose: false, children: (0, jsx_runtime_1.jsx)(button_1.Button, { shape: "circular", variant: "text", color: "text.secondary", children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faGear_1.faGear }) }) }));
|
|
39
51
|
});
|
|
@@ -53,6 +53,7 @@ export interface ColumnType<R extends RowType = RowType> extends Omit<ComponentP
|
|
|
53
53
|
_negativeRowSpan?: number;
|
|
54
54
|
}
|
|
55
55
|
interface DataGridSharedProps<R extends RowType = RowType> extends SlotsAndProps<{
|
|
56
|
+
container: ComponentProps<'div'>;
|
|
56
57
|
tr: ComponentProps<'tr'>;
|
|
57
58
|
}> {
|
|
58
59
|
rowProps?(row: R, index: number, rows: R[]): ComponentProps<'tr'>;
|
|
@@ -130,7 +130,12 @@ exports.DataGrid = (0, react_1.memo)(({ slots, slotProps, columns, rows, rowProp
|
|
|
130
130
|
const { page, pageSize } = _paginationProps;
|
|
131
131
|
return orderedRows?.slice((page - 1) * pageSize, page * pageSize);
|
|
132
132
|
}, [orderedRows, _paginationProps.page, _paginationProps.pageSize, paginatable]);
|
|
133
|
-
const
|
|
133
|
+
const { container: Container = table_1.TableContainer } = slots || {};
|
|
134
|
+
const { container: containerProps } = slotProps || {};
|
|
135
|
+
const renderedContent = ((0, jsx_runtime_1.jsx)(columnResize_1.ColumnResizeContext, { columnResizable: columnResizable, children: ({ scrollerRef, tableRef }) => (0, jsx_runtime_1.jsxs)(Container, { ...(0, utils_1.mergeComponentProps)(containerProps, {
|
|
136
|
+
ref: scrollerRef,
|
|
137
|
+
className: dataGrid_style_1.classes.container
|
|
138
|
+
}), children: [(0, jsx_runtime_1.jsx)(table_1.Table, { size: size, bordered: bordered, striped: striped, ...tableProps, ref: (0, utils_1.cloneRef)(tableProps?.ref, tableRef), children: (0, jsx_runtime_1.jsxs)(selectionContext_1.SelectionContext, { options: rows, primaryKey: primaryKey, childrenKey: childrenKey !== null ? childrenKey : void 0, relation: relation, integration: integration, disabled: !selectable, multiple: multiple, defaultValue: defaultValue, value: value, onChange: onChange, children: [(0, jsx_runtime_1.jsx)(dataGridHead_1.DataGridHead, { rows: rows, flattedColumns: flattedColumns, completedColumns: completedColumns, primaryKey: primaryKey, allowSelectAll: allowSelectAll, columnResizable: columnResizable, orderColumn: innerOrderColumn.current, orderType: innerOrderType.current, onOrderChange: orderChangeHandler, filterBubbleProps: filterBubbleProps, onFilterClick: onFilterClick }), (0, jsx_runtime_1.jsx)("tbody", { children: (0, jsx_runtime_1.jsx)(DataGridContext, { value: (0, react_1.useMemo)(() => ({
|
|
134
139
|
slots, slotProps,
|
|
135
140
|
rowProps, primaryKey, childrenKey, clickRowToSelect, indent, renderExpandIcon,
|
|
136
141
|
expandedSet, flattedColumns, toggleExpanded
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const filterOptionsStyle: import("@emotion/
|
|
1
|
+
export declare const filterOptionsStyle: import("@emotion/utils").SerializedStyles;
|
|
@@ -6,5 +6,5 @@ export declare const classes: {
|
|
|
6
6
|
} & {
|
|
7
7
|
root: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const style: () => import("@emotion/
|
|
10
|
-
export declare const datePickerPopperStyle: () => import("@emotion/
|
|
9
|
+
export declare const style: () => import("@emotion/utils").SerializedStyles;
|
|
10
|
+
export declare const datePickerPopperStyle: () => import("@emotion/utils").SerializedStyles[];
|
|
@@ -11,5 +11,5 @@ export declare const classes: {
|
|
|
11
11
|
} & {
|
|
12
12
|
root: string;
|
|
13
13
|
};
|
|
14
|
-
export declare const tableStyle: () => import("@emotion/
|
|
15
|
-
export declare const gridItemStyle: () => import("@emotion/
|
|
14
|
+
export declare const tableStyle: () => import("@emotion/utils").SerializedStyles;
|
|
15
|
+
export declare const gridItemStyle: () => import("@emotion/utils").SerializedStyles;
|
|
@@ -8,8 +8,8 @@ export declare function useContainerStyle({ columnCount, columnGap, rowGap }: {
|
|
|
8
8
|
columnCount: ResponsiveValue;
|
|
9
9
|
columnGap: ResponsiveValue;
|
|
10
10
|
rowGap: ResponsiveValue;
|
|
11
|
-
}): import("@emotion/
|
|
11
|
+
}): import("@emotion/utils").SerializedStyles;
|
|
12
12
|
export declare function useItemStyle({ span, offset }: {
|
|
13
13
|
span: ResponsiveValue;
|
|
14
14
|
offset: ResponsiveValue;
|
|
15
|
-
}): import("@emotion/
|
|
15
|
+
}): import("@emotion/utils").SerializedStyles;
|
|
@@ -44,6 +44,7 @@ exports.style = (0, utils_1.defineCss)(({ background, easing, spacing }) => {
|
|
|
44
44
|
align-items: center;
|
|
45
45
|
justify-content: center;
|
|
46
46
|
opacity: 0;
|
|
47
|
+
z-index: -1;
|
|
47
48
|
transition: opacity .25s ${easing.easeOut};
|
|
48
49
|
|
|
49
50
|
.${exports.classes.previewButton} {
|
|
@@ -60,6 +61,7 @@ exports.style = (0, utils_1.defineCss)(({ background, easing, spacing }) => {
|
|
|
60
61
|
&:hover {
|
|
61
62
|
.${exports.classes.mask} {
|
|
62
63
|
opacity: 1;
|
|
64
|
+
z-index: 0;
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
}
|
|
@@ -4,5 +4,5 @@ export declare const classes: {
|
|
|
4
4
|
} & {
|
|
5
5
|
root: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const commonNativeInputStyle: import("@emotion/
|
|
8
|
-
export declare const style: import("@emotion/
|
|
7
|
+
export declare const commonNativeInputStyle: import("@emotion/utils").SerializedStyles;
|
|
8
|
+
export declare const style: 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<InputBaseProps<any>, 'color'>>): import("@emotion/
|
|
10
|
+
export declare function useStyle({ color }: Required<Pick<InputBaseProps<any>, 'color'>>): import("@emotion/utils").SerializedStyles;
|
|
@@ -4,4 +4,4 @@ export declare const classes: {
|
|
|
4
4
|
} & {
|
|
5
5
|
root: string;
|
|
6
6
|
};
|
|
7
|
-
export declare function useStyle({ color, borderWidth }: Required<Pick<LoadingIndicatorProps, 'color' | 'borderWidth'>>): import("@emotion/
|
|
7
|
+
export declare function useStyle({ color, borderWidth }: Required<Pick<LoadingIndicatorProps, 'color' | 'borderWidth'>>): import("@emotion/utils").SerializedStyles;
|
|
@@ -15,6 +15,6 @@ export declare const paddingHorizontal: {
|
|
|
15
15
|
medium: number;
|
|
16
16
|
large: number;
|
|
17
17
|
};
|
|
18
|
-
export declare function useStyle({ color }: Required<Pick<MenuItemProps, 'color'>>): import("@emotion/
|
|
18
|
+
export declare function useStyle({ color }: Required<Pick<MenuItemProps, 'color'>>): import("@emotion/utils").SerializedStyles;
|
|
19
19
|
export declare const menuListPadding = 4;
|
|
20
|
-
export declare const childrenStyle: () => import("@emotion/
|
|
20
|
+
export declare const childrenStyle: () => import("@emotion/utils").SerializedStyles;
|
|
@@ -18,4 +18,4 @@ export declare const classes: {
|
|
|
18
18
|
root: string;
|
|
19
19
|
};
|
|
20
20
|
export declare const getTransparentBackground: (a: string, b: string) => string;
|
|
21
|
-
export declare const style: () => import("@emotion/
|
|
21
|
+
export declare const style: () => import("@emotion/utils").SerializedStyles;
|
|
@@ -4,15 +4,15 @@ export declare const classes: {
|
|
|
4
4
|
} & {
|
|
5
5
|
root: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const style: () => import("@emotion/
|
|
7
|
+
export declare const style: () => import("@emotion/utils").SerializedStyles[];
|
|
8
8
|
/**
|
|
9
9
|
* 通用弹框箭头样式
|
|
10
10
|
* @param colorValue
|
|
11
11
|
* @param arrowSize
|
|
12
12
|
*/
|
|
13
|
-
export declare const popperArrowStyle: (colorValue: string, arrowSize?: number) => import("@emotion/
|
|
13
|
+
export declare const popperArrowStyle: (colorValue: string, arrowSize?: number) => import("@emotion/utils").SerializedStyles;
|
|
14
14
|
/**
|
|
15
15
|
* 通用弹框样式
|
|
16
16
|
*/
|
|
17
|
-
export declare const popperStyleCallback: ({ background, borderRadius, boxShadow }: Theme) => import("@emotion/
|
|
18
|
-
export declare const popperStyle: () => import("@emotion/
|
|
17
|
+
export declare const popperStyleCallback: ({ background, borderRadius, boxShadow }: Theme) => import("@emotion/utils").SerializedStyles;
|
|
18
|
+
export declare const popperStyle: () => import("@emotion/utils").SerializedStyles;
|
|
@@ -8,4 +8,4 @@ export declare const classes: {
|
|
|
8
8
|
} & {
|
|
9
9
|
root: string;
|
|
10
10
|
};
|
|
11
|
-
export declare function useStyle({ color, variant }: Required<Pick<ProgressProps, 'color' | 'variant'>>): import("@emotion/
|
|
11
|
+
export declare function useStyle({ color, variant }: Required<Pick<ProgressProps, 'color' | 'variant'>>): import("@emotion/utils").SerializedStyles;
|
|
@@ -9,4 +9,4 @@ export declare const classes: {
|
|
|
9
9
|
export declare const handleCursors: {
|
|
10
10
|
[P in Handle]?: string;
|
|
11
11
|
};
|
|
12
|
-
export declare function useStyle({ variant, handleSize, handleColor }: Required<Pick<ResizableProps, 'variant' | 'handleSize' | 'handleColor'>>): import("@emotion/
|
|
12
|
+
export declare function useStyle({ variant, handleSize, handleColor }: Required<Pick<ResizableProps, 'variant' | 'handleSize' | 'handleColor'>>): import("@emotion/utils").SerializedStyles[];
|