@creekjs/web-components 1.0.4 → 1.0.6
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/.turbo/turbo-father$colon$build.log +33 -17
- package/README.md +97 -18
- package/dist/creek-config-provider/CreekConfigContext.d.ts +4 -0
- package/dist/creek-config-provider/CreekConfigContext.d.ts.map +1 -0
- package/dist/creek-config-provider/CreekConfigContext.js.map +2 -2
- package/dist/creek-config-provider/CreekI18nProvider.d.ts +22 -0
- package/dist/creek-config-provider/CreekI18nProvider.d.ts.map +1 -0
- package/dist/creek-config-provider/CreekI18nProvider.js +92 -0
- package/dist/creek-config-provider/CreekI18nProvider.js.map +7 -0
- package/dist/creek-config-provider/index.d.ts +5 -3
- package/dist/creek-config-provider/index.d.ts.map +1 -0
- package/dist/creek-config-provider/index.js +47 -4
- package/dist/creek-config-provider/index.js.map +3 -3
- package/dist/creek-hooks/index.d.ts.map +1 -0
- package/dist/creek-hooks/useApp/DrawerHelper.d.ts.map +1 -0
- package/dist/creek-hooks/useApp/ModalHelper.d.ts.map +1 -0
- package/dist/creek-hooks/useApp/index.d.ts +3 -3
- package/dist/creek-hooks/useApp/index.d.ts.map +1 -0
- package/dist/creek-hooks/useApp/types.d.ts.map +1 -0
- package/dist/creek-hooks/useViewportHeight.d.ts.map +1 -0
- package/dist/creek-icon/index.d.ts.map +1 -0
- package/dist/creek-keep-alive/index.d.ts +24 -1
- package/dist/creek-keep-alive/index.d.ts.map +1 -0
- package/dist/creek-keep-alive/index.js +141 -4
- package/dist/creek-keep-alive/index.js.map +2 -2
- package/dist/creek-layout/ActionRender/FullScreen.d.ts.map +1 -0
- package/dist/creek-layout/{HeaderContent → ActionRender}/FullScreen.js +4 -2
- package/dist/creek-layout/ActionRender/FullScreen.js.map +7 -0
- package/dist/creek-layout/ActionRender/LayoutSettings.d.ts +5 -0
- package/dist/creek-layout/ActionRender/LayoutSettings.d.ts.map +1 -0
- package/dist/creek-layout/ActionRender/LayoutSettings.js +73 -0
- package/dist/creek-layout/ActionRender/LayoutSettings.js.map +7 -0
- package/dist/creek-layout/ActionRender/UserInfo.d.ts +8 -0
- package/dist/creek-layout/ActionRender/UserInfo.d.ts.map +1 -0
- package/dist/creek-layout/{HeaderContent → ActionRender}/UserInfo.js +7 -29
- package/dist/creek-layout/ActionRender/UserInfo.js.map +7 -0
- package/dist/creek-layout/ActionRender/index.d.ts +3 -0
- package/dist/creek-layout/ActionRender/index.d.ts.map +1 -0
- package/dist/creek-layout/ActionRender/index.js +36 -0
- package/dist/creek-layout/ActionRender/index.js.map +7 -0
- package/dist/creek-layout/CollapseButton.d.ts.map +1 -0
- package/dist/creek-layout/Exception/NotFound.d.ts.map +1 -0
- package/dist/creek-layout/Exception/NotFoundPage.d.ts.map +1 -0
- package/dist/creek-layout/Exception/index.d.ts.map +1 -0
- package/dist/creek-layout/index.d.ts +9 -2
- package/dist/creek-layout/index.d.ts.map +1 -0
- package/dist/creek-layout/index.js +96 -39
- package/dist/creek-layout/index.js.map +3 -3
- package/dist/creek-layout/useLayoutSettingsStore.d.ts +20 -0
- package/dist/creek-layout/useLayoutSettingsStore.d.ts.map +1 -0
- package/dist/creek-layout/useLayoutSettingsStore.js +45 -0
- package/dist/creek-layout/useLayoutSettingsStore.js.map +7 -0
- package/dist/creek-loading/index.d.ts.map +1 -0
- package/dist/creek-locale-button/index.d.ts +1 -0
- package/dist/creek-locale-button/index.d.ts.map +1 -0
- package/dist/creek-locale-button/index.js +66 -0
- package/dist/creek-locale-button/index.js.map +7 -0
- package/dist/creek-page-container/index.d.ts +4 -0
- package/dist/creek-page-container/index.d.ts.map +1 -0
- package/dist/creek-page-container/index.js +68 -0
- package/dist/creek-page-container/index.js.map +7 -0
- package/dist/creek-style/index.d.ts +1 -0
- package/dist/creek-style/index.d.ts.map +1 -0
- package/dist/creek-style/index.js +24 -0
- package/dist/creek-style/index.js.map +7 -0
- package/dist/creek-style/scrollbar.d.ts +2 -0
- package/dist/creek-style/scrollbar.d.ts.map +1 -0
- package/dist/creek-style/scrollbar.js +55 -0
- package/dist/creek-style/scrollbar.js.map +7 -0
- package/dist/creek-table/SearchTable.d.ts +9 -0
- package/dist/creek-table/SearchTable.d.ts.map +1 -0
- package/dist/creek-table/SearchTable.js +109 -72
- package/dist/creek-table/SearchTable.js.map +3 -3
- package/dist/creek-table/components/DensityIcon.d.ts +9 -0
- package/dist/creek-table/components/DensityIcon.d.ts.map +1 -0
- package/dist/creek-table/components/DensityIcon.js +77 -0
- package/dist/creek-table/components/DensityIcon.js.map +7 -0
- package/dist/creek-table/components/EllipsisTooltip.d.ts +9 -0
- package/dist/creek-table/components/EllipsisTooltip.d.ts.map +1 -0
- package/dist/creek-table/components/EllipsisTooltip.js +122 -0
- package/dist/creek-table/components/EllipsisTooltip.js.map +7 -0
- package/dist/creek-table/components/index.d.ts +2 -0
- package/dist/creek-table/components/index.d.ts.map +1 -0
- package/dist/creek-table/components/index.js +26 -0
- package/dist/creek-table/components/index.js.map +7 -0
- package/dist/creek-table/hooks/index.d.ts +5 -0
- package/dist/creek-table/hooks/index.d.ts.map +1 -0
- package/dist/creek-table/hooks/index.js +10 -0
- package/dist/creek-table/hooks/index.js.map +2 -2
- package/dist/creek-table/hooks/useAdaptiveToolBar.d.ts.map +1 -0
- package/dist/creek-table/hooks/useAutoWidthColumns.d.ts +1 -1
- package/dist/creek-table/hooks/useAutoWidthColumns.d.ts.map +1 -0
- package/dist/creek-table/hooks/useAutoWidthColumns.js +76 -17
- package/dist/creek-table/hooks/useAutoWidthColumns.js.map +2 -2
- package/dist/creek-table/hooks/useElementDistance.d.ts.map +1 -0
- package/dist/creek-table/hooks/useEllipsisColumns.d.ts +8 -0
- package/dist/creek-table/hooks/useEllipsisColumns.d.ts.map +1 -0
- package/dist/creek-table/hooks/useEllipsisColumns.js +58 -0
- package/dist/creek-table/hooks/useEllipsisColumns.js.map +7 -0
- package/dist/creek-table/hooks/useIndexColumn.d.ts +2 -0
- package/dist/creek-table/hooks/useIndexColumn.d.ts.map +1 -0
- package/dist/creek-table/hooks/useIndexColumn.js +52 -0
- package/dist/creek-table/hooks/useIndexColumn.js.map +7 -0
- package/dist/creek-table/hooks/useResizableColumns.d.ts +20 -0
- package/dist/creek-table/hooks/useResizableColumns.d.ts.map +1 -0
- package/dist/creek-table/hooks/useResizableColumns.js +279 -0
- package/dist/creek-table/hooks/useResizableColumns.js.map +7 -0
- package/dist/creek-table/hooks/useStatusColumns.d.ts +2 -0
- package/dist/creek-table/hooks/useStatusColumns.d.ts.map +1 -0
- package/dist/creek-table/hooks/useStatusColumns.js +215 -0
- package/dist/creek-table/hooks/useStatusColumns.js.map +7 -0
- package/dist/creek-table/hooks/useTableOptions.d.ts +15 -0
- package/dist/creek-table/hooks/useTableOptions.d.ts.map +1 -0
- package/dist/creek-table/hooks/useTableOptions.js +78 -0
- package/dist/creek-table/hooks/useTableOptions.js.map +7 -0
- package/dist/creek-table/hooks/useTableScrollHeight.d.ts +6 -1
- package/dist/creek-table/hooks/useTableScrollHeight.d.ts.map +1 -0
- package/dist/creek-table/hooks/useTableScrollHeight.js +44 -5
- package/dist/creek-table/hooks/useTableScrollHeight.js.map +2 -2
- package/dist/creek-table/index.d.ts.map +1 -0
- package/dist/creek-table/type.d.ts +4 -6
- package/dist/creek-table/type.d.ts.map +1 -0
- package/dist/creek-table/type.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +2 -2
- package/dist/locales/en-US.d.ts +25 -0
- package/dist/locales/en-US.d.ts.map +1 -0
- package/dist/locales/en-US.js +49 -0
- package/dist/locales/en-US.js.map +7 -0
- package/dist/locales/zh-CN.d.ts +25 -0
- package/dist/locales/zh-CN.d.ts.map +1 -0
- package/dist/locales/zh-CN.js +49 -0
- package/dist/locales/zh-CN.js.map +7 -0
- package/dist/utils/i18n.d.ts +2 -0
- package/dist/utils/i18n.d.ts.map +1 -0
- package/dist/utils/i18n.js +34 -0
- package/dist/utils/i18n.js.map +7 -0
- package/i18n.config.ts +27 -0
- package/package.json +17 -3
- package/src/creek-config-provider/CreekConfigContext.tsx +5 -1
- package/src/creek-config-provider/CreekI18nProvider.tsx +87 -0
- package/src/creek-config-provider/index.tsx +53 -4
- package/src/creek-keep-alive/index.tsx +225 -6
- package/src/creek-layout/{HeaderContent → ActionRender}/FullScreen.tsx +10 -6
- package/src/creek-layout/ActionRender/LayoutSettings.tsx +67 -0
- package/src/creek-layout/ActionRender/UserInfo.tsx +43 -0
- package/src/creek-layout/ActionRender/index.tsx +4 -0
- package/src/creek-layout/index.tsx +121 -53
- package/src/creek-layout/useLayoutSettingsStore.ts +25 -0
- package/src/creek-locale-button/index.tsx +42 -0
- package/src/creek-page-container/index.tsx +32 -0
- package/src/creek-style/index.ts +1 -0
- package/src/creek-style/scrollbar.ts +29 -0
- package/src/creek-table/SearchTable.tsx +125 -72
- package/src/creek-table/components/DensityIcon.tsx +63 -0
- package/src/creek-table/components/EllipsisTooltip.tsx +116 -0
- package/src/creek-table/components/index.tsx +3 -0
- package/src/creek-table/hooks/index.ts +5 -1
- package/src/creek-table/hooks/useAutoWidthColumns.tsx +93 -19
- package/src/creek-table/hooks/useEllipsisColumns.tsx +47 -0
- package/src/creek-table/hooks/useIndexColumn.tsx +27 -0
- package/src/creek-table/hooks/useResizableColumns.tsx +323 -0
- package/src/creek-table/hooks/useStatusColumns.tsx +252 -0
- package/src/creek-table/hooks/useTableOptions.tsx +81 -0
- package/src/creek-table/hooks/useTableScrollHeight.tsx +61 -6
- package/src/creek-table/type.ts +5 -7
- package/src/index.tsx +4 -0
- package/src/locales/en-US.ts +24 -0
- package/src/locales/zh-CN.ts +24 -0
- package/src/utils/i18n.ts +4 -0
- package/dist/creek-layout/HeaderContent/FullScreen.js.map +0 -7
- package/dist/creek-layout/HeaderContent/UserInfo.d.ts +0 -1
- package/dist/creek-layout/HeaderContent/UserInfo.js.map +0 -7
- package/dist/creek-layout/HeaderContent/index.d.ts +0 -1
- package/dist/creek-layout/HeaderContent/index.js +0 -49
- package/dist/creek-layout/HeaderContent/index.js.map +0 -7
- package/dist/creek-table/TableOptionRender.d.ts +0 -9
- package/dist/creek-table/TableOptionRender.js +0 -74
- package/dist/creek-table/TableOptionRender.js.map +0 -7
- package/dist/creek-table/toolBarRender.d.ts +0 -5
- package/dist/creek-table/toolBarRender.js +0 -58
- package/dist/creek-table/toolBarRender.js.map +0 -7
- package/src/creek-layout/HeaderContent/UserInfo.tsx +0 -54
- package/src/creek-layout/HeaderContent/index.tsx +0 -24
- package/src/creek-table/TableOptionRender.tsx +0 -57
- package/src/creek-table/toolBarRender.tsx +0 -28
- /package/dist/creek-layout/{HeaderContent → ActionRender}/FullScreen.d.ts +0 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { useDebounceFn, useEventListener } from 'ahooks';
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
|
|
4
|
-
export const useTableScrollHeight = (prefixCls: string, tableRef: React.RefObject<HTMLDivElement>, pageFixedBottom: boolean = true,
|
|
4
|
+
export const useTableScrollHeight = (prefixCls: string, tableRef: React.RefObject<HTMLDivElement>, pageFixedBottom: boolean = true, offsetBottom: number = 0) => {
|
|
5
5
|
const [scrollY, setScrollY] = useState<number | undefined>(undefined);
|
|
6
|
+
const [tableHeight, setTableHeight] = useState<number | undefined>(undefined);
|
|
7
|
+
const [tableContainerHeight, setTableContainerHeight] = useState<number | undefined>(0);
|
|
8
|
+
const [hasScroll, setHasScroll] = useState<boolean>(false);
|
|
6
9
|
|
|
7
10
|
const { run: calcHeight } = useDebounceFn(
|
|
8
11
|
() => {
|
|
@@ -10,8 +13,41 @@ export const useTableScrollHeight = (prefixCls: string, tableRef: React.RefObjec
|
|
|
10
13
|
|
|
11
14
|
const tableEl = tableRef.current;
|
|
12
15
|
|
|
16
|
+
// 如果元素不可见(例如在 display: none 的 tab 中),不进行计算,防止计算出错误的高度
|
|
17
|
+
if (tableEl.offsetParent === null) return;
|
|
18
|
+
|
|
13
19
|
const tableHeader = tableEl.querySelector(`.${prefixCls}-table-thead`);
|
|
14
|
-
const tableBody = tableEl.querySelector(`.${prefixCls}-table-
|
|
20
|
+
const tableBody = tableEl.querySelector(`.${prefixCls}-table-tbody`);
|
|
21
|
+
|
|
22
|
+
// 尝试动态获取 layout content padding
|
|
23
|
+
// Ant Design Pro Layout 的 content 容器通常有 class 包含 'pro-layout-content'
|
|
24
|
+
// 例如:ant-pro-layout-content, my-prefix-pro-layout-content
|
|
25
|
+
let currentContentPadding = 0; // 默认使用传入的
|
|
26
|
+
|
|
27
|
+
const layoutContentEl = tableEl.closest(`div[class*="pro-layout-content"]`);
|
|
28
|
+
if (layoutContentEl) {
|
|
29
|
+
const style = window.getComputedStyle(layoutContentEl);
|
|
30
|
+
// 我们主要关心底部的 padding,因为它影响到底部留白
|
|
31
|
+
const paddingBottom = parseFloat(style.paddingBottom);
|
|
32
|
+
if (!isNaN(paddingBottom)) {
|
|
33
|
+
currentContentPadding = paddingBottom;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// 尝试动态获取 layout content padding
|
|
38
|
+
// Ant Design Pro Layout 的 content 容器通常有 class 包含 'pro-layout-content'
|
|
39
|
+
// 例如:ant-pro-layout-content, my-prefix-pro-layout-content
|
|
40
|
+
let currentCardContentPadding = 0; // 默认使用传入的
|
|
41
|
+
|
|
42
|
+
const cardContentEl = tableEl.querySelector(`.${prefixCls}-pro-card-body`);
|
|
43
|
+
if (cardContentEl) {
|
|
44
|
+
const style = window.getComputedStyle(cardContentEl);
|
|
45
|
+
// 我们主要关心底部的 padding,因为它影响到底部留白
|
|
46
|
+
const paddingBottom = parseFloat(style.paddingBottom);
|
|
47
|
+
if (!isNaN(paddingBottom)) {
|
|
48
|
+
currentCardContentPadding = paddingBottom;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
15
51
|
|
|
16
52
|
let top = 0;
|
|
17
53
|
if (tableHeader) {
|
|
@@ -21,8 +57,9 @@ export const useTableScrollHeight = (prefixCls: string, tableRef: React.RefObjec
|
|
|
21
57
|
}
|
|
22
58
|
|
|
23
59
|
const windowHeight = window.innerHeight;
|
|
24
|
-
|
|
25
|
-
let height = windowHeight - top -
|
|
60
|
+
|
|
61
|
+
let height = windowHeight - top - currentContentPadding - currentCardContentPadding - offsetBottom;
|
|
62
|
+
let currentTableHeight = windowHeight - tableEl.getBoundingClientRect().top;
|
|
26
63
|
|
|
27
64
|
const pagination = tableEl.querySelector(`.${prefixCls}-pagination`);
|
|
28
65
|
|
|
@@ -33,16 +70,29 @@ export const useTableScrollHeight = (prefixCls: string, tableRef: React.RefObjec
|
|
|
33
70
|
const totalPaginationMargin = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
|
|
34
71
|
|
|
35
72
|
height = height - paginationHeight - totalPaginationMargin;
|
|
73
|
+
setTableHeight(0);
|
|
36
74
|
} else {
|
|
37
75
|
// 如果没有找到分页,预留一个高度(假设分页高度为 24px + margin 16px = 40px)
|
|
38
76
|
// 这样可以避免初始加载时高度过大,导致出现滚动条,然后分页出现后高度又变小
|
|
39
77
|
height = height - 40;
|
|
78
|
+
|
|
79
|
+
setTableHeight(currentTableHeight);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
let currentHasScroll = false;
|
|
83
|
+
if (tableBody) {
|
|
84
|
+
currentHasScroll = tableBody.scrollHeight > height;
|
|
40
85
|
}
|
|
86
|
+
setHasScroll(currentHasScroll);
|
|
41
87
|
|
|
42
88
|
// Minimum height to avoid crashes or ugly rendering
|
|
43
89
|
setScrollY(height);
|
|
90
|
+
|
|
91
|
+
if (tableHeader) {
|
|
92
|
+
setTableContainerHeight(height + tableHeader?.clientHeight);
|
|
93
|
+
}
|
|
44
94
|
},
|
|
45
|
-
{ wait:
|
|
95
|
+
{ wait: 16,leading: true },
|
|
46
96
|
);
|
|
47
97
|
|
|
48
98
|
useEffect(() => {
|
|
@@ -59,5 +109,10 @@ export const useTableScrollHeight = (prefixCls: string, tableRef: React.RefObjec
|
|
|
59
109
|
|
|
60
110
|
useEventListener('resize', calcHeight);
|
|
61
111
|
|
|
62
|
-
return
|
|
112
|
+
return {
|
|
113
|
+
scrollY,
|
|
114
|
+
tableHeight,
|
|
115
|
+
tableContainerHeight,
|
|
116
|
+
hasScroll,
|
|
117
|
+
};
|
|
63
118
|
};
|
package/src/creek-table/type.ts
CHANGED
|
@@ -6,16 +6,14 @@ export type OptionRenderCustom = {
|
|
|
6
6
|
onClick?: () => void;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
export type CreekTableProps<T extends ParamsType, U extends ParamsType, ValueType = 'text'> =
|
|
9
|
+
export type CreekTableProps<T extends ParamsType, U extends ParamsType, ValueType = 'text'> = ProTableProps<T, U, ValueType> & {
|
|
10
10
|
pageFixedBottom?: boolean; // 是否固定分页在底部
|
|
11
11
|
pageFixedBottomConfig?: {
|
|
12
12
|
/** 底部保留空间(如固定在底部的元素高度),默认 0 */
|
|
13
13
|
bottomFix?: number;
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// 是否自动为列添加筛选功能,默认 true
|
|
20
|
-
autoAddFilterForColumn?: boolean;
|
|
15
|
+
// 是否显示序号列,默认 true
|
|
16
|
+
showIndex?: boolean;
|
|
17
|
+
/** 是否可拖动列宽,默认 true */
|
|
18
|
+
resizable?: boolean;
|
|
21
19
|
};
|
package/src/index.tsx
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
export * from './creek-config-provider';
|
|
3
3
|
export * from './creek-hooks';
|
|
4
4
|
export * from './creek-icon';
|
|
5
|
+
export * from './creek-keep-alive';
|
|
5
6
|
export * from './creek-layout';
|
|
6
7
|
export * from './creek-loading';
|
|
8
|
+
export * from './creek-locale-button';
|
|
9
|
+
export * from './creek-page-container';
|
|
10
|
+
export * from './creek-style';
|
|
7
11
|
export * from './creek-table';
|
|
8
12
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
'creek-keep-alive.index.guanBiDangQian': 'Close Current',
|
|
3
|
+
'creek-keep-alive.index.guanBiQiTa': 'Close Others',
|
|
4
|
+
'creek-keep-alive.index.guanBiYouCe': 'Close Right',
|
|
5
|
+
'creek-layout.ActionRender.FullScreen.tuiChuQuanPing': 'Exit Full Screen',
|
|
6
|
+
'creek-layout.ActionRender.FullScreen.quanPing': 'Full Screen',
|
|
7
|
+
'creek-table.components.DensityIcon.kuanSong': 'Loose',
|
|
8
|
+
'creek-table.components.DensityIcon.zhongDeng': 'Medium',
|
|
9
|
+
'creek-table.components.DensityIcon.jinCou': 'Compact',
|
|
10
|
+
'creek-table.components.DensityIcon.biaoGeMiDu(KuanSong)': 'Table Density (Loose)',
|
|
11
|
+
'creek-table.components.DensityIcon.biaoGeMiDu(ZhongDeng)': 'Table Density (Medium)',
|
|
12
|
+
'creek-table.components.DensityIcon.biaoGeMiDu(JinCou)': 'Table Density (Compact)',
|
|
13
|
+
'creek-table.components.DensityIcon.biaoGeMiDu': 'Table Density',
|
|
14
|
+
'creek-table.components.EllipsisTooltip.fuZhiChengGong': 'Copied Successfully',
|
|
15
|
+
'creek-table.components.EllipsisTooltip.fuZhiShiBai': 'Copy Failed',
|
|
16
|
+
'creek-table.components.EllipsisTooltip.fuZhi': 'Copy',
|
|
17
|
+
'creek-table.hooks.useIndexColumn.xuHao': 'No.',
|
|
18
|
+
'creek-layout.ActionRender.LayoutSettings.title': 'System Settings',
|
|
19
|
+
'creek-layout.ActionRender.LayoutSettings.themeColor': 'Theme Color',
|
|
20
|
+
'creek-layout.ActionRender.LayoutSettings.showFullScreen': 'Show Full Screen Button',
|
|
21
|
+
'creek-layout.ActionRender.LayoutSettings.showLocaleButton': 'Show Locale Button',
|
|
22
|
+
'creek-locale-button.index.jianTiZhongWen': 'Simplified Chinese',
|
|
23
|
+
'creek-layout.ActionRender.LayoutSettings.keepAlive': 'Enable Page Cache (Keep Alive)',
|
|
24
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"creek-keep-alive.index.guanBiDangQian": "关闭当前",
|
|
3
|
+
"creek-keep-alive.index.guanBiQiTa": "关闭其他",
|
|
4
|
+
"creek-keep-alive.index.guanBiYouCe": "关闭右侧",
|
|
5
|
+
"creek-layout.ActionRender.FullScreen.tuiChuQuanPing": "退出全屏",
|
|
6
|
+
"creek-layout.ActionRender.FullScreen.quanPing": "全屏",
|
|
7
|
+
"creek-table.components.DensityIcon.kuanSong": "宽松",
|
|
8
|
+
"creek-table.components.DensityIcon.zhongDeng": "中等",
|
|
9
|
+
"creek-table.components.DensityIcon.jinCou": "紧凑",
|
|
10
|
+
"creek-table.components.DensityIcon.biaoGeMiDu(KuanSong)": "表格密度 (宽松)",
|
|
11
|
+
"creek-table.components.DensityIcon.biaoGeMiDu(ZhongDeng)": "表格密度 (中等)",
|
|
12
|
+
"creek-table.components.DensityIcon.biaoGeMiDu(JinCou)": "表格密度 (紧凑)",
|
|
13
|
+
"creek-table.components.DensityIcon.biaoGeMiDu": "表格密度",
|
|
14
|
+
"creek-table.components.EllipsisTooltip.fuZhiChengGong": "复制成功",
|
|
15
|
+
"creek-table.components.EllipsisTooltip.fuZhiShiBai": "复制失败",
|
|
16
|
+
"creek-table.components.EllipsisTooltip.fuZhi": "复制",
|
|
17
|
+
"creek-table.hooks.useIndexColumn.xuHao": "序号",
|
|
18
|
+
"creek-layout.ActionRender.LayoutSettings.title": "系统设置",
|
|
19
|
+
"creek-layout.ActionRender.LayoutSettings.themeColor": "主题色",
|
|
20
|
+
"creek-layout.ActionRender.LayoutSettings.showFullScreen": "展示全屏按钮",
|
|
21
|
+
"creek-layout.ActionRender.LayoutSettings.showLocaleButton": "展示国际化按钮",
|
|
22
|
+
"creek-locale-button.index.jianTiZhongWen": "简体中文",
|
|
23
|
+
"creek-layout.ActionRender.LayoutSettings.keepAlive": "开启页面缓存 (Keep Alive)"
|
|
24
|
+
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/creek-layout/HeaderContent/FullScreen.tsx"],
|
|
4
|
-
"sourcesContent": ["import { FullscreenExitOutlined, FullscreenOutlined } from \"@ant-design/icons\";\nimport { useFullscreen, useMemoizedFn } from \"ahooks\";\nimport { Tooltip } from \"antd\";\nimport { create } from \"zustand\";\n\nexport type FullScreenStore = {\n isFullScreen: boolean;\n changeFullScreen: () => void;\n};\n\nexport const useFullScreenStore = create<FullScreenStore>((set, get) => {\n return {\n isFullScreen: false,\n changeFullScreen: () => {\n const _isFullScreen = get().isFullScreen;\n set({\n isFullScreen: !_isFullScreen,\n });\n },\n };\n});\n\nexport const FullScreen = () => {\n const [, { toggleFullscreen }] = useFullscreen(document.body);\n\n const { isFullScreen, changeFullScreen } = useFullScreenStore.getState();\n\n const handleFullScreen = useMemoizedFn(() => {\n toggleFullscreen();\n changeFullScreen();\n });\n\n return (\n <>\n {isFullScreen ? (\n <Tooltip title=\"退出全屏\" placement=\"top\">\n <FullscreenExitOutlined onClick={handleFullScreen} />\n </Tooltip>\n ) : (\n <Tooltip title=\"全屏\" placement=\"top\">\n <FullscreenOutlined onClick={handleFullScreen} />\n </Tooltip>\n )}\n </>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2D;AAC3D,oBAA6C;AAC7C,kBAAwB;AACxB,qBAAuB;AA8BnB;AAvBG,IAAM,yBAAqB,uBAAwB,CAAC,KAAK,QAAQ;AACtE,SAAO;AAAA,IACL,cAAc;AAAA,IACd,kBAAkB,MAAM;AACtB,YAAM,gBAAgB,IAAI,EAAE;AAC5B,UAAI;AAAA,QACF,cAAc,CAAC;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AACF,CAAC;AAEM,IAAM,aAAa,MAAM;AAC9B,QAAM,CAAC,EAAE,EAAE,iBAAiB,CAAC,QAAI,6BAAc,SAAS,IAAI;AAE5D,QAAM,EAAE,cAAc,iBAAiB,IAAI,mBAAmB,SAAS;AAEvE,QAAM,uBAAmB,6BAAc,MAAM;AAC3C,qBAAiB;AACjB,qBAAiB;AAAA,EACnB,CAAC;AAED,SACE,2EACG,yBACC,4CAAC,uBAAQ,OAAM,QAAO,WAAU,OAC9B,sDAAC,uCAAuB,SAAS,kBAAkB,GACrD,IAEA,4CAAC,uBAAQ,OAAM,MAAK,WAAU,OAC5B,sDAAC,mCAAmB,SAAS,kBAAkB,GACjD,GAEJ;AAEJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const UserInfo: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/creek-layout/HeaderContent/UserInfo.tsx"],
|
|
4
|
-
"sourcesContent": ["import { LogoutOutlined } from \"@ant-design/icons\";\nimport { Avatar, Dropdown, DropDownProps, Space } from \"antd\";\nimport { createStyles } from \"antd-style\";\n\nconst useStyles = createStyles(({ token }) => ({\n avatarContainer: {\n backgroundColor: token.colorPrimary,\n width: 24,\n height: 24,\n },\n userInfoDropdownOverlay: {\n \".ant-dropdown-menu\": {\n padding: \"8px 0\",\n },\n \".ant-dropdown-menu-item\": {\n \".ant-dropdown-menu-item-icon\": {\n fontSize: \"18px\",\n marginRight: \"8px\",\n },\n },\n },\n}));\n\nexport const UserInfo = () => {\n const { styles } = useStyles();\n\n const userInfoMenu: DropDownProps[\"menu\"] = {\n items: [\n {\n key: \"logout\",\n label: (\n <Space size={8}>\n <LogoutOutlined />\n <span>退出登录</span>\n </Space>\n ),\n onClick: () => {},\n },\n ],\n };\n return (\n <Dropdown\n arrow\n placement=\"bottom\"\n overlayClassName={styles.userInfoDropdownOverlay}\n menu={userInfoMenu}\n >\n <Space size={4} align=\"center\">\n <Avatar className={styles.avatarContainer}>C</Avatar>\n <span>Creek</span>\n </Space>\n </Dropdown>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,kBAAuD;AACvD,wBAA6B;AA6BnB;AA3BV,IAAM,gBAAY,gCAAa,CAAC,EAAE,MAAM,OAAO;AAAA,EAC7C,iBAAiB;AAAA,IACf,iBAAiB,MAAM;AAAA,IACvB,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EACA,yBAAyB;AAAA,IACvB,sBAAsB;AAAA,MACpB,SAAS;AAAA,IACX;AAAA,IACA,2BAA2B;AAAA,MACzB,gCAAgC;AAAA,QAC9B,UAAU;AAAA,QACV,aAAa;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF,EAAE;AAEK,IAAM,WAAW,MAAM;AAC5B,QAAM,EAAE,OAAO,IAAI,UAAU;AAE7B,QAAM,eAAsC;AAAA,IAC1C,OAAO;AAAA,MACL;AAAA,QACE,KAAK;AAAA,QACL,OACE,6CAAC,qBAAM,MAAM,GACX;AAAA,sDAAC,+BAAe;AAAA,UAChB,4CAAC,UAAK,kBAAI;AAAA,WACZ;AAAA,QAEF,SAAS,MAAM;AAAA,QAAC;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAK;AAAA,MACL,WAAU;AAAA,MACV,kBAAkB,OAAO;AAAA,MACzB,MAAM;AAAA,MAEN,uDAAC,qBAAM,MAAM,GAAG,OAAM,UACpB;AAAA,oDAAC,sBAAO,WAAW,OAAO,iBAAiB,eAAC;AAAA,QAC5C,4CAAC,UAAK,mBAAK;AAAA,SACb;AAAA;AAAA,EACF;AAEJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const HeaderContent: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/creek-layout/HeaderContent/index.tsx
|
|
20
|
-
var HeaderContent_exports = {};
|
|
21
|
-
__export(HeaderContent_exports, {
|
|
22
|
-
HeaderContent: () => HeaderContent
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(HeaderContent_exports);
|
|
25
|
-
var import_antd = require("antd");
|
|
26
|
-
var import_antd_style = require("antd-style");
|
|
27
|
-
var import_FullScreen = require("./FullScreen");
|
|
28
|
-
var import_UserInfo = require("./UserInfo");
|
|
29
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
-
var useStyles = (0, import_antd_style.createStyles)(({}) => ({
|
|
31
|
-
dividerContainer: {
|
|
32
|
-
backgroundColor: "#9b9999"
|
|
33
|
-
}
|
|
34
|
-
}));
|
|
35
|
-
var HeaderContent = () => {
|
|
36
|
-
const { styles } = useStyles();
|
|
37
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Flex, { justify: "space-between", children: [
|
|
38
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}),
|
|
39
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { split: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Divider, { type: "vertical", className: styles.dividerContainer }), children: [
|
|
40
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FullScreen.FullScreen, {}),
|
|
41
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_UserInfo.UserInfo, {})
|
|
42
|
-
] })
|
|
43
|
-
] });
|
|
44
|
-
};
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
HeaderContent
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/creek-layout/HeaderContent/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Divider, Flex, Space } from 'antd';\nimport { createStyles } from 'antd-style';\n\nimport { FullScreen } from './FullScreen';\nimport { UserInfo } from './UserInfo';\n\nconst useStyles = createStyles(({}) => ({\n dividerContainer: {\n backgroundColor: '#9b9999',\n },\n}));\n\nexport const HeaderContent = () => {\n const { styles } = useStyles();\n return (\n <Flex justify=\"space-between\">\n <span />\n <Space split={<Divider type=\"vertical\" className={styles.dividerContainer} />}>\n <FullScreen />\n <UserInfo />\n </Space>\n </Flex>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqC;AACrC,wBAA6B;AAE7B,wBAA2B;AAC3B,sBAAyB;AAYnB;AAVN,IAAM,gBAAY,gCAAa,CAAC,CAAC,OAAO;AAAA,EACtC,kBAAkB;AAAA,IAChB,iBAAiB;AAAA,EACnB;AACF,EAAE;AAEK,IAAM,gBAAgB,MAAM;AACjC,QAAM,EAAE,OAAO,IAAI,UAAU;AAC7B,SACE,6CAAC,oBAAK,SAAQ,iBACZ;AAAA,gDAAC,UAAK;AAAA,IACN,6CAAC,qBAAM,OAAO,4CAAC,uBAAQ,MAAK,YAAW,WAAW,OAAO,kBAAkB,GACzE;AAAA,kDAAC,gCAAW;AAAA,MACZ,4CAAC,4BAAS;AAAA,OACZ;AAAA,KACF;AAEJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ParamsType } from '@ant-design/pro-components';
|
|
3
|
-
import { OptionRenderCustom } from './type';
|
|
4
|
-
export type TableOptionRenderProps<T extends ParamsType, U extends ParamsType, ValueType = 'text'> = {
|
|
5
|
-
defaultDom?: React.ReactNode[];
|
|
6
|
-
importConfig?: OptionRenderCustom;
|
|
7
|
-
exportConfig?: OptionRenderCustom;
|
|
8
|
-
};
|
|
9
|
-
export declare const TableOptionRender: <T extends ParamsType, U extends ParamsType, ValueType = "text">(props: TableOptionRenderProps<T, U, ValueType>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/creek-table/TableOptionRender.tsx
|
|
20
|
-
var TableOptionRender_exports = {};
|
|
21
|
-
__export(TableOptionRender_exports, {
|
|
22
|
-
TableOptionRender: () => TableOptionRender
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(TableOptionRender_exports);
|
|
25
|
-
var import_icons = require("@ant-design/icons");
|
|
26
|
-
var import_antd = require("antd");
|
|
27
|
-
var import_antd_style = require("antd-style");
|
|
28
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
-
var useStyles = (0, import_antd_style.createStyles)(({ prefixCls, token }) => {
|
|
30
|
-
return {
|
|
31
|
-
"table-option-render-item": {
|
|
32
|
-
border: `1px solid ${token.colorBorder}`,
|
|
33
|
-
borderRadius: token.borderRadius,
|
|
34
|
-
padding: "8px",
|
|
35
|
-
cursor: "pointer"
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
var TableOptionRender = (props) => {
|
|
40
|
-
const { defaultDom, importConfig, exportConfig } = props;
|
|
41
|
-
const { styles } = useStyles();
|
|
42
|
-
const [reload, dis, setting] = defaultDom || [];
|
|
43
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { size: 8, children: [
|
|
44
|
-
importConfig && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
-
"span",
|
|
46
|
-
{
|
|
47
|
-
className: styles["table-option-render-item"],
|
|
48
|
-
onClick: () => {
|
|
49
|
-
var _a;
|
|
50
|
-
(_a = importConfig.onClick) == null ? void 0 : _a.call(importConfig);
|
|
51
|
-
},
|
|
52
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tooltip, { title: importConfig.text || "导入", children: importConfig.icon || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ImportOutlined, {}) })
|
|
53
|
-
}
|
|
54
|
-
),
|
|
55
|
-
exportConfig && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56
|
-
"span",
|
|
57
|
-
{
|
|
58
|
-
className: styles["table-option-render-item"],
|
|
59
|
-
onClick: () => {
|
|
60
|
-
var _a;
|
|
61
|
-
(_a = exportConfig.onClick) == null ? void 0 : _a.call(exportConfig);
|
|
62
|
-
},
|
|
63
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tooltip, { title: exportConfig.text || "导出", children: exportConfig.icon || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ExportOutlined, {}) })
|
|
64
|
-
}
|
|
65
|
-
),
|
|
66
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles["table-option-render-item"], children: reload }),
|
|
67
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles["table-option-render-item"], children: setting })
|
|
68
|
-
] });
|
|
69
|
-
};
|
|
70
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
71
|
-
0 && (module.exports = {
|
|
72
|
-
TableOptionRender
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=TableOptionRender.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/creek-table/TableOptionRender.tsx"],
|
|
4
|
-
"sourcesContent": ["import { ExportOutlined, ImportOutlined } from '@ant-design/icons';\nimport { ParamsType } from '@ant-design/pro-components';\nimport { Space, Tooltip } from 'antd';\nimport { createStyles } from 'antd-style';\n\nimport { OptionRenderCustom } from './type';\n\nconst useStyles = createStyles(({ prefixCls, token }) => {\n return {\n 'table-option-render-item': {\n border: `1px solid ${token.colorBorder}`,\n borderRadius: token.borderRadius,\n padding: '8px',\n cursor: 'pointer',\n },\n };\n});\n\nexport type TableOptionRenderProps<T extends ParamsType, U extends ParamsType, ValueType = 'text'> = {\n defaultDom?: React.ReactNode[];\n importConfig?: OptionRenderCustom;\n exportConfig?: OptionRenderCustom;\n};\n\nexport const TableOptionRender = <T extends ParamsType, U extends ParamsType, ValueType = 'text'>(props: TableOptionRenderProps<T, U, ValueType>) => {\n const { defaultDom, importConfig, exportConfig } = props;\n\n const { styles } = useStyles();\n\n const [reload, dis, setting] = defaultDom || [];\n return (\n <Space size={8}>\n {importConfig && (\n <span\n className={styles['table-option-render-item']}\n onClick={() => {\n importConfig.onClick?.();\n }}\n >\n <Tooltip title={importConfig.text || '导入'}>{importConfig.icon || <ImportOutlined />}</Tooltip>\n </span>\n )}\n {exportConfig && (\n <span\n className={styles['table-option-render-item']}\n onClick={() => {\n exportConfig.onClick?.();\n }}\n >\n <Tooltip title={exportConfig.text || '导出'}>{exportConfig.icon || <ExportOutlined />}</Tooltip>\n </span>\n )}\n <span className={styles['table-option-render-item']}>{reload}</span>\n <span className={styles['table-option-render-item']}>{setting}</span>\n </Space>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+C;AAE/C,kBAA+B;AAC/B,wBAA6B;AA4BzB;AAxBJ,IAAM,gBAAY,gCAAa,CAAC,EAAE,WAAW,MAAM,MAAM;AACvD,SAAO;AAAA,IACL,4BAA4B;AAAA,MAC1B,QAAQ,aAAa,MAAM;AAAA,MAC3B,cAAc,MAAM;AAAA,MACpB,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAAA,EACF;AACF,CAAC;AAQM,IAAM,oBAAoB,CAAiE,UAAmD;AACnJ,QAAM,EAAE,YAAY,cAAc,aAAa,IAAI;AAEnD,QAAM,EAAE,OAAO,IAAI,UAAU;AAE7B,QAAM,CAAC,QAAQ,KAAK,OAAO,IAAI,cAAc,CAAC;AAC9C,SACE,6CAAC,qBAAM,MAAM,GACV;AAAA,oBACC;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,OAAO,0BAA0B;AAAA,QAC5C,SAAS,MAAM;AAnCzB;AAoCY,6BAAa,YAAb;AAAA,QACF;AAAA,QAEA,sDAAC,uBAAQ,OAAO,aAAa,QAAQ,MAAO,uBAAa,QAAQ,4CAAC,+BAAe,GAAG;AAAA;AAAA,IACtF;AAAA,IAED,gBACC;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,OAAO,0BAA0B;AAAA,QAC5C,SAAS,MAAM;AA7CzB;AA8CY,6BAAa,YAAb;AAAA,QACF;AAAA,QAEA,sDAAC,uBAAQ,OAAO,aAAa,QAAQ,MAAO,uBAAa,QAAQ,4CAAC,+BAAe,GAAG;AAAA;AAAA,IACtF;AAAA,IAEF,4CAAC,UAAK,WAAW,OAAO,0BAA0B,GAAI,kBAAO;AAAA,IAC7D,4CAAC,UAAK,WAAW,OAAO,0BAA0B,GAAI,mBAAQ;AAAA,KAChE;AAEJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// src/creek-table/toolBarRender.tsx
|
|
20
|
-
var toolBarRender_exports = {};
|
|
21
|
-
__export(toolBarRender_exports, {
|
|
22
|
-
toolBarRender: () => toolBarRender
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(toolBarRender_exports);
|
|
25
|
-
var import_icons = require("@ant-design/icons");
|
|
26
|
-
var import_antd = require("antd");
|
|
27
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
-
var toolBarRender = (options) => {
|
|
29
|
-
var _a;
|
|
30
|
-
const { shouldCollapse, restProps, args = [] } = options;
|
|
31
|
-
const baseActions = ((_a = restProps.toolBarRender) == null ? void 0 : _a.call(restProps, ...args)) || [];
|
|
32
|
-
if (!shouldCollapse || baseActions.length <= 1) {
|
|
33
|
-
return baseActions;
|
|
34
|
-
}
|
|
35
|
-
const [first, ...rest] = baseActions;
|
|
36
|
-
return [
|
|
37
|
-
first,
|
|
38
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
39
|
-
import_antd.Dropdown,
|
|
40
|
-
{
|
|
41
|
-
menu: {
|
|
42
|
-
items: rest.map((item, index) => ({ key: index, label: item }))
|
|
43
|
-
},
|
|
44
|
-
trigger: ["click"],
|
|
45
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Button, { children: [
|
|
46
|
-
"更多 ",
|
|
47
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.DownOutlined, {})
|
|
48
|
-
] })
|
|
49
|
-
},
|
|
50
|
-
"more"
|
|
51
|
-
)
|
|
52
|
-
];
|
|
53
|
-
};
|
|
54
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
-
0 && (module.exports = {
|
|
56
|
-
toolBarRender
|
|
57
|
-
});
|
|
58
|
-
//# sourceMappingURL=toolBarRender.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/creek-table/toolBarRender.tsx"],
|
|
4
|
-
"sourcesContent": ["import { DownOutlined } from '@ant-design/icons';\nimport { Button, Dropdown } from 'antd';\n\nexport const toolBarRender = (options: { shouldCollapse: boolean; restProps: any; args?: any[] }) => {\n const { shouldCollapse, restProps, args = [] } = options;\n\n const baseActions = restProps.toolBarRender?.(...args) || [];\n if (!shouldCollapse || baseActions.length <= 1) {\n return baseActions;\n }\n\n const [first, ...rest] = baseActions;\n\n return [\n first,\n <Dropdown\n key=\"more\"\n menu={{\n items: rest.map((item: React.ReactDOM, index: number) => ({ key: index, label: item })),\n }}\n trigger={['click']}\n >\n <Button>\n 更多 <DownOutlined />\n </Button>\n </Dropdown>,\n ];\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6B;AAC7B,kBAAiC;AAqB3B;AAnBC,IAAM,gBAAgB,CAAC,YAAuE;AAHrG;AAIE,QAAM,EAAE,gBAAgB,WAAW,OAAO,CAAC,EAAE,IAAI;AAEjD,QAAM,gBAAc,eAAU,kBAAV,mCAA0B,GAAG,UAAS,CAAC;AAC3D,MAAI,CAAC,kBAAkB,YAAY,UAAU,GAAG;AAC9C,WAAO;AAAA,EACT;AAEA,QAAM,CAAC,OAAO,GAAG,IAAI,IAAI;AAEzB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QAEC,MAAM;AAAA,UACJ,OAAO,KAAK,IAAI,CAAC,MAAsB,WAAmB,EAAE,KAAK,OAAO,OAAO,KAAK,EAAE;AAAA,QACxF;AAAA,QACA,SAAS,CAAC,OAAO;AAAA,QAEjB,uDAAC,sBAAO;AAAA;AAAA,UACH,4CAAC,6BAAa;AAAA,WACnB;AAAA;AAAA,MARI;AAAA,IASN;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { LogoutOutlined } from "@ant-design/icons";
|
|
2
|
-
import { Avatar, Dropdown, DropDownProps, Space } from "antd";
|
|
3
|
-
import { createStyles } from "antd-style";
|
|
4
|
-
|
|
5
|
-
const useStyles = createStyles(({ token }) => ({
|
|
6
|
-
avatarContainer: {
|
|
7
|
-
backgroundColor: token.colorPrimary,
|
|
8
|
-
width: 24,
|
|
9
|
-
height: 24,
|
|
10
|
-
},
|
|
11
|
-
userInfoDropdownOverlay: {
|
|
12
|
-
".ant-dropdown-menu": {
|
|
13
|
-
padding: "8px 0",
|
|
14
|
-
},
|
|
15
|
-
".ant-dropdown-menu-item": {
|
|
16
|
-
".ant-dropdown-menu-item-icon": {
|
|
17
|
-
fontSize: "18px",
|
|
18
|
-
marginRight: "8px",
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
}));
|
|
23
|
-
|
|
24
|
-
export const UserInfo = () => {
|
|
25
|
-
const { styles } = useStyles();
|
|
26
|
-
|
|
27
|
-
const userInfoMenu: DropDownProps["menu"] = {
|
|
28
|
-
items: [
|
|
29
|
-
{
|
|
30
|
-
key: "logout",
|
|
31
|
-
label: (
|
|
32
|
-
<Space size={8}>
|
|
33
|
-
<LogoutOutlined />
|
|
34
|
-
<span>退出登录</span>
|
|
35
|
-
</Space>
|
|
36
|
-
),
|
|
37
|
-
onClick: () => {},
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
};
|
|
41
|
-
return (
|
|
42
|
-
<Dropdown
|
|
43
|
-
arrow
|
|
44
|
-
placement="bottom"
|
|
45
|
-
overlayClassName={styles.userInfoDropdownOverlay}
|
|
46
|
-
menu={userInfoMenu}
|
|
47
|
-
>
|
|
48
|
-
<Space size={4} align="center">
|
|
49
|
-
<Avatar className={styles.avatarContainer}>C</Avatar>
|
|
50
|
-
<span>Creek</span>
|
|
51
|
-
</Space>
|
|
52
|
-
</Dropdown>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Divider, Flex, Space } from 'antd';
|
|
2
|
-
import { createStyles } from 'antd-style';
|
|
3
|
-
|
|
4
|
-
import { FullScreen } from './FullScreen';
|
|
5
|
-
import { UserInfo } from './UserInfo';
|
|
6
|
-
|
|
7
|
-
const useStyles = createStyles(({}) => ({
|
|
8
|
-
dividerContainer: {
|
|
9
|
-
backgroundColor: '#9b9999',
|
|
10
|
-
},
|
|
11
|
-
}));
|
|
12
|
-
|
|
13
|
-
export const HeaderContent = () => {
|
|
14
|
-
const { styles } = useStyles();
|
|
15
|
-
return (
|
|
16
|
-
<Flex justify="space-between">
|
|
17
|
-
<span />
|
|
18
|
-
<Space split={<Divider type="vertical" className={styles.dividerContainer} />}>
|
|
19
|
-
<FullScreen />
|
|
20
|
-
<UserInfo />
|
|
21
|
-
</Space>
|
|
22
|
-
</Flex>
|
|
23
|
-
);
|
|
24
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { ExportOutlined, ImportOutlined } from '@ant-design/icons';
|
|
2
|
-
import { ParamsType } from '@ant-design/pro-components';
|
|
3
|
-
import { Space, Tooltip } from 'antd';
|
|
4
|
-
import { createStyles } from 'antd-style';
|
|
5
|
-
|
|
6
|
-
import { OptionRenderCustom } from './type';
|
|
7
|
-
|
|
8
|
-
const useStyles = createStyles(({ prefixCls, token }) => {
|
|
9
|
-
return {
|
|
10
|
-
'table-option-render-item': {
|
|
11
|
-
border: `1px solid ${token.colorBorder}`,
|
|
12
|
-
borderRadius: token.borderRadius,
|
|
13
|
-
padding: '8px',
|
|
14
|
-
cursor: 'pointer',
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export type TableOptionRenderProps<T extends ParamsType, U extends ParamsType, ValueType = 'text'> = {
|
|
20
|
-
defaultDom?: React.ReactNode[];
|
|
21
|
-
importConfig?: OptionRenderCustom;
|
|
22
|
-
exportConfig?: OptionRenderCustom;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const TableOptionRender = <T extends ParamsType, U extends ParamsType, ValueType = 'text'>(props: TableOptionRenderProps<T, U, ValueType>) => {
|
|
26
|
-
const { defaultDom, importConfig, exportConfig } = props;
|
|
27
|
-
|
|
28
|
-
const { styles } = useStyles();
|
|
29
|
-
|
|
30
|
-
const [reload, dis, setting] = defaultDom || [];
|
|
31
|
-
return (
|
|
32
|
-
<Space size={8}>
|
|
33
|
-
{importConfig && (
|
|
34
|
-
<span
|
|
35
|
-
className={styles['table-option-render-item']}
|
|
36
|
-
onClick={() => {
|
|
37
|
-
importConfig.onClick?.();
|
|
38
|
-
}}
|
|
39
|
-
>
|
|
40
|
-
<Tooltip title={importConfig.text || '导入'}>{importConfig.icon || <ImportOutlined />}</Tooltip>
|
|
41
|
-
</span>
|
|
42
|
-
)}
|
|
43
|
-
{exportConfig && (
|
|
44
|
-
<span
|
|
45
|
-
className={styles['table-option-render-item']}
|
|
46
|
-
onClick={() => {
|
|
47
|
-
exportConfig.onClick?.();
|
|
48
|
-
}}
|
|
49
|
-
>
|
|
50
|
-
<Tooltip title={exportConfig.text || '导出'}>{exportConfig.icon || <ExportOutlined />}</Tooltip>
|
|
51
|
-
</span>
|
|
52
|
-
)}
|
|
53
|
-
<span className={styles['table-option-render-item']}>{reload}</span>
|
|
54
|
-
<span className={styles['table-option-render-item']}>{setting}</span>
|
|
55
|
-
</Space>
|
|
56
|
-
);
|
|
57
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { DownOutlined } from '@ant-design/icons';
|
|
2
|
-
import { Button, Dropdown } from 'antd';
|
|
3
|
-
|
|
4
|
-
export const toolBarRender = (options: { shouldCollapse: boolean; restProps: any; args?: any[] }) => {
|
|
5
|
-
const { shouldCollapse, restProps, args = [] } = options;
|
|
6
|
-
|
|
7
|
-
const baseActions = restProps.toolBarRender?.(...args) || [];
|
|
8
|
-
if (!shouldCollapse || baseActions.length <= 1) {
|
|
9
|
-
return baseActions;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const [first, ...rest] = baseActions;
|
|
13
|
-
|
|
14
|
-
return [
|
|
15
|
-
first,
|
|
16
|
-
<Dropdown
|
|
17
|
-
key="more"
|
|
18
|
-
menu={{
|
|
19
|
-
items: rest.map((item: React.ReactDOM, index: number) => ({ key: index, label: item })),
|
|
20
|
-
}}
|
|
21
|
-
trigger={['click']}
|
|
22
|
-
>
|
|
23
|
-
<Button>
|
|
24
|
-
更多 <DownOutlined />
|
|
25
|
-
</Button>
|
|
26
|
-
</Dropdown>,
|
|
27
|
-
];
|
|
28
|
-
};
|
|
File without changes
|