@creekjs/web-components 1.0.2 → 1.0.4
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/.fatherrc.ts +1 -5
- package/.turbo/turbo-father$colon$build.log +39 -0
- package/.turbo/turbo-father$colon$dev.log +33 -0
- package/dist/creek-config-provider/CreekConfigContext.js +31 -2
- package/dist/creek-config-provider/CreekConfigContext.js.map +7 -0
- package/dist/creek-config-provider/index.js +35 -13
- package/dist/creek-config-provider/index.js.map +7 -0
- package/dist/creek-hooks/index.d.ts +1 -0
- package/dist/creek-hooks/index.js +26 -1
- package/dist/creek-hooks/index.js.map +7 -0
- package/dist/creek-hooks/useApp/DrawerHelper.d.ts +9 -0
- package/dist/creek-hooks/useApp/DrawerHelper.js +62 -0
- package/dist/creek-hooks/useApp/DrawerHelper.js.map +7 -0
- package/dist/creek-hooks/useApp/ModalHelper.d.ts +9 -0
- package/dist/creek-hooks/useApp/ModalHelper.js +62 -0
- package/dist/creek-hooks/useApp/ModalHelper.js.map +7 -0
- package/dist/creek-hooks/useApp/index.d.ts +25 -0
- package/dist/creek-hooks/useApp/index.js +118 -0
- package/dist/creek-hooks/useApp/index.js.map +7 -0
- package/dist/creek-hooks/useApp/types.d.ts +26 -0
- package/dist/creek-hooks/useApp/types.js +18 -0
- package/dist/creek-hooks/useApp/types.js.map +7 -0
- package/dist/creek-hooks/useViewportHeight.js +99 -97
- package/dist/creek-hooks/useViewportHeight.js.map +7 -0
- package/dist/creek-icon/index.js +53 -31
- package/dist/creek-icon/index.js.map +7 -0
- package/dist/creek-keep-alive/index.js +36 -18
- package/dist/creek-keep-alive/index.js.map +7 -0
- package/dist/creek-layout/CollapseButton.js +69 -47
- package/dist/creek-layout/CollapseButton.js.map +7 -0
- package/dist/creek-layout/Exception/NotFound.js +42 -13
- package/dist/creek-layout/Exception/NotFound.js.map +7 -0
- package/dist/creek-layout/Exception/NotFoundPage.js +30 -5
- package/dist/creek-layout/Exception/NotFoundPage.js.map +7 -0
- package/dist/creek-layout/Exception/index.js +37 -8
- package/dist/creek-layout/Exception/index.js.map +7 -0
- package/dist/creek-layout/HeaderContent/FullScreen.js +45 -39
- package/dist/creek-layout/HeaderContent/FullScreen.js.map +7 -0
- package/dist/creek-layout/HeaderContent/UserInfo.js +75 -53
- package/dist/creek-layout/HeaderContent/UserInfo.js.map +7 -0
- package/dist/creek-layout/HeaderContent/index.js +48 -28
- package/dist/creek-layout/HeaderContent/index.js.map +7 -0
- package/dist/creek-layout/index.js +117 -81
- package/dist/creek-layout/index.js.map +7 -0
- package/dist/creek-loading/index.js +55 -48
- package/dist/creek-loading/index.js.map +7 -0
- package/dist/creek-table/SearchTable.js +118 -114
- package/dist/creek-table/SearchTable.js.map +7 -0
- package/dist/creek-table/TableOptionRender.js +69 -60
- package/dist/creek-table/TableOptionRender.js.map +7 -0
- package/dist/creek-table/hooks/index.d.ts +2 -1
- package/dist/creek-table/hooks/index.js +30 -3
- package/dist/creek-table/hooks/index.js.map +7 -0
- package/dist/creek-table/hooks/useAdaptiveToolBar.js +48 -36
- package/dist/creek-table/hooks/useAdaptiveToolBar.js.map +7 -0
- package/dist/creek-table/hooks/useAutoWidthColumns.d.ts +6 -0
- package/dist/creek-table/hooks/useAutoWidthColumns.js +187 -0
- package/dist/creek-table/hooks/useAutoWidthColumns.js.map +7 -0
- package/dist/creek-table/hooks/useElementDistance.js +51 -39
- package/dist/creek-table/hooks/useElementDistance.js.map +7 -0
- package/dist/creek-table/hooks/useTableScrollHeight.d.ts +1 -0
- package/dist/creek-table/hooks/useTableScrollHeight.js +72 -0
- package/dist/creek-table/hooks/useTableScrollHeight.js.map +7 -0
- package/dist/creek-table/index.js +35 -25
- package/dist/creek-table/index.js.map +7 -0
- package/dist/creek-table/toolBarRender.d.ts +1 -0
- package/dist/creek-table/toolBarRender.js +55 -33
- package/dist/creek-table/toolBarRender.js.map +7 -0
- package/dist/creek-table/type.d.ts +1 -1
- package/dist/creek-table/type.js +18 -1
- package/dist/creek-table/type.js.map +7 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +34 -7
- package/dist/index.js.map +7 -0
- package/package.json +2 -2
- package/src/creek-hooks/index.ts +2 -0
- package/src/creek-hooks/useApp/DrawerHelper.tsx +43 -0
- package/src/creek-hooks/useApp/ModalHelper.tsx +43 -0
- package/src/creek-hooks/useApp/index.tsx +119 -0
- package/src/creek-hooks/useApp/types.ts +25 -0
- package/src/creek-hooks/useViewportHeight.tsx +34 -5
- package/src/creek-layout/index.tsx +2 -2
- package/src/creek-table/SearchTable.tsx +69 -77
- package/src/creek-table/hooks/index.ts +3 -1
- package/src/creek-table/hooks/useAutoWidthColumns.tsx +212 -0
- package/src/creek-table/hooks/useTableScrollHeight.tsx +63 -0
- package/src/creek-table/index.tsx +2 -6
- package/src/creek-table/toolBarRender.tsx +3 -3
- package/src/creek-table/type.ts +1 -1
- package/src/index.tsx +2 -2
- package/dist/bg-center/index.d.ts +0 -5
- package/dist/bg-center/index.d.ts.map +0 -1
- package/dist/bg-center/index.js +0 -28
- package/dist/creek-config-provider/CreekConfigContext.d.ts.map +0 -1
- package/dist/creek-config-provider/index.d.ts.map +0 -1
- package/dist/creek-hooks/index.d.ts.map +0 -1
- package/dist/creek-hooks/useViewportHeight.d.ts.map +0 -1
- package/dist/creek-icon/index.d.ts.map +0 -1
- package/dist/creek-keep-alive/index.d.ts.map +0 -1
- package/dist/creek-layout/CollapseButton.d.ts.map +0 -1
- package/dist/creek-layout/Exception/NotFound.d.ts.map +0 -1
- package/dist/creek-layout/Exception/NotFoundPage.d.ts.map +0 -1
- package/dist/creek-layout/Exception/index.d.ts.map +0 -1
- package/dist/creek-layout/HeaderContent/FullScreen.d.ts.map +0 -1
- package/dist/creek-layout/HeaderContent/UserInfo.d.ts.map +0 -1
- package/dist/creek-layout/HeaderContent/index.d.ts.map +0 -1
- package/dist/creek-layout/index.d.ts.map +0 -1
- package/dist/creek-loading/index.d.ts.map +0 -1
- package/dist/creek-search/CreekSearch.d.ts +0 -7
- package/dist/creek-search/CreekSearch.d.ts.map +0 -1
- package/dist/creek-search/CreekSearch.js +0 -51
- package/dist/creek-search/CreekSearchContext.d.ts +0 -54
- package/dist/creek-search/CreekSearchContext.d.ts.map +0 -1
- package/dist/creek-search/CreekSearchContext.js +0 -546
- package/dist/creek-search/CreekSearchFilterDisplay.d.ts +0 -5
- package/dist/creek-search/CreekSearchFilterDisplay.d.ts.map +0 -1
- package/dist/creek-search/CreekSearchFilterDisplay.js +0 -97
- package/dist/creek-search/CreekSearchInput.d.ts +0 -4
- package/dist/creek-search/CreekSearchInput.d.ts.map +0 -1
- package/dist/creek-search/CreekSearchInput.js +0 -96
- package/dist/creek-search/CreekSearchValueSelector.d.ts +0 -5
- package/dist/creek-search/CreekSearchValueSelector.d.ts.map +0 -1
- package/dist/creek-search/CreekSearchValueSelector.js +0 -422
- package/dist/creek-search/index.d.ts +0 -5
- package/dist/creek-search/index.d.ts.map +0 -1
- package/dist/creek-search/index.js +0 -5
- package/dist/creek-search/type.d.ts +0 -8
- package/dist/creek-search/type.d.ts.map +0 -1
- package/dist/creek-search/type.js +0 -1
- package/dist/creek-table/SearchTable.d.ts.map +0 -1
- package/dist/creek-table/TableOptionRender.d.ts.map +0 -1
- package/dist/creek-table/TableViewContent.d.ts +0 -4
- package/dist/creek-table/TableViewContent.d.ts.map +0 -1
- package/dist/creek-table/TableViewContent.js +0 -47
- package/dist/creek-table/hooks/index.d.ts.map +0 -1
- package/dist/creek-table/hooks/useAdaptiveToolBar.d.ts.map +0 -1
- package/dist/creek-table/hooks/useAutoAddFilterToColumns.d.ts +0 -12
- package/dist/creek-table/hooks/useAutoAddFilterToColumns.d.ts.map +0 -1
- package/dist/creek-table/hooks/useAutoAddFilterToColumns.js +0 -96
- package/dist/creek-table/hooks/useElementDistance.d.ts.map +0 -1
- package/dist/creek-table/index.d.ts.map +0 -1
- package/dist/creek-table/toolBarRender.d.ts.map +0 -1
- package/dist/creek-table/type.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/src/bg-center/index.tsx +0 -26
- package/src/creek-search/CreekSearch.tsx +0 -60
- package/src/creek-search/CreekSearchContext.tsx +0 -593
- package/src/creek-search/CreekSearchFilterDisplay.tsx +0 -84
- package/src/creek-search/CreekSearchInput.tsx +0 -75
- package/src/creek-search/CreekSearchValueSelector.tsx +0 -324
- package/src/creek-search/index.tsx +0 -5
- package/src/creek-search/type.ts +0 -9
- package/src/creek-table/TableViewContent.tsx +0 -46
- package/src/creek-table/hooks/useAutoAddFilterToColumns.tsx +0 -90
|
@@ -1,87 +1,123 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/creek-layout/index.tsx
|
|
31
|
+
var creek_layout_exports = {};
|
|
32
|
+
__export(creek_layout_exports, {
|
|
33
|
+
CreekLayout: () => CreekLayout
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(creek_layout_exports);
|
|
36
|
+
var import_pro_components = require("@ant-design/pro-components");
|
|
37
|
+
var import_ahooks = require("ahooks");
|
|
38
|
+
var import_antd = require("antd");
|
|
39
|
+
var import_classnames = __toESM(require("classnames"));
|
|
40
|
+
var import_CollapseButton = require("./CollapseButton");
|
|
41
|
+
var import_Exception = require("./Exception");
|
|
42
|
+
var import_HeaderContent = require("./HeaderContent");
|
|
43
|
+
__reExport(creek_layout_exports, require("./Exception"), module.exports);
|
|
44
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
+
var CreekLayout = (props) => {
|
|
46
|
+
const {
|
|
47
|
+
route,
|
|
48
|
+
userConfig,
|
|
49
|
+
runtimeConfig,
|
|
50
|
+
children,
|
|
51
|
+
location,
|
|
52
|
+
navigate,
|
|
53
|
+
...more
|
|
54
|
+
} = props;
|
|
55
|
+
const { useToken } = import_antd.theme;
|
|
56
|
+
const { token } = useToken();
|
|
57
|
+
const { collapsed } = (0, import_CollapseButton.useCollapsedStore)();
|
|
58
|
+
const menuItemRender = (0, import_ahooks.useMemoizedFn)(
|
|
59
|
+
(itemProps, defaultDom) => {
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
|
+
"span",
|
|
62
|
+
{
|
|
63
|
+
onClick: () => {
|
|
64
|
+
if (navigate) {
|
|
65
|
+
navigate(itemProps.path);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
children: defaultDom
|
|
36
69
|
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
+
import_pro_components.ProLayout,
|
|
75
|
+
{
|
|
76
|
+
className: (0, import_classnames.default)("creek-layout-container", userConfig == null ? void 0 : userConfig.className),
|
|
77
|
+
layout: "mix",
|
|
78
|
+
route,
|
|
79
|
+
title: userConfig == null ? void 0 : userConfig.title,
|
|
80
|
+
siderWidth: 212,
|
|
81
|
+
location,
|
|
82
|
+
menuItemRender,
|
|
83
|
+
headerContentRender: () => {
|
|
84
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_HeaderContent.HeaderContent, {});
|
|
37
85
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
86
|
+
token: {
|
|
87
|
+
header: {
|
|
88
|
+
colorBgHeader: "#fff",
|
|
89
|
+
colorHeaderTitle: "rgba(0, 0, 0, 0.80);",
|
|
90
|
+
colorTextMenuSelected: token.colorPrimary,
|
|
91
|
+
heightLayoutHeader: 48
|
|
92
|
+
},
|
|
93
|
+
sider: {
|
|
94
|
+
colorMenuBackground: "#f7f8fa",
|
|
95
|
+
colorBgMenuItemSelected: "transparent",
|
|
96
|
+
colorTextMenuActive: token.colorPrimary,
|
|
97
|
+
colorTextMenuSelected: token.colorPrimary,
|
|
98
|
+
colorTextMenuItemHover: token.colorPrimary,
|
|
99
|
+
colorTextMenu: "#333"
|
|
100
|
+
},
|
|
101
|
+
pageContainer: {
|
|
102
|
+
paddingBlockPageContainerContent: token.padding,
|
|
103
|
+
paddingInlinePageContainerContent: token.padding,
|
|
104
|
+
colorBgPageContainer: "linear-gradient(180deg, #F7F9FF 0%, #FFF 45.59%);"
|
|
105
|
+
}
|
|
58
106
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
colorTextMenuItemHover: token.colorPrimary,
|
|
65
|
-
colorTextMenu: "#333"
|
|
107
|
+
fixSiderbar: true,
|
|
108
|
+
fixedHeader: true,
|
|
109
|
+
collapsed,
|
|
110
|
+
collapsedButtonRender: (collapsed2) => {
|
|
111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CollapseButton.CollapsedButton, { collapsed: collapsed2 });
|
|
66
112
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
paddingInlinePageContainerContent: 20,
|
|
70
|
-
colorBgPageContainer: 'linear-gradient(180deg, #F7F9FF 0%, #FFF 45.59%);'
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
fixSiderbar: true,
|
|
74
|
-
fixedHeader: true,
|
|
75
|
-
collapsed: collapsed,
|
|
76
|
-
collapsedButtonRender: function collapsedButtonRender(collapsed) {
|
|
77
|
-
return /*#__PURE__*/_jsx(CollapsedButton, {
|
|
78
|
-
collapsed: collapsed
|
|
79
|
-
});
|
|
113
|
+
...more,
|
|
114
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Exception.Exception, { children })
|
|
80
115
|
}
|
|
81
|
-
|
|
82
|
-
children: /*#__PURE__*/_jsx(Exception, {
|
|
83
|
-
children: children
|
|
84
|
-
})
|
|
85
|
-
}));
|
|
116
|
+
);
|
|
86
117
|
};
|
|
87
|
-
export
|
|
118
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
119
|
+
0 && (module.exports = {
|
|
120
|
+
CreekLayout,
|
|
121
|
+
...require("./Exception")
|
|
122
|
+
});
|
|
123
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/creek-layout/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { ProLayout, ProLayoutProps } from \"@ant-design/pro-components\";\nimport { useMemoizedFn } from \"ahooks\";\nimport { theme } from \"antd\";\nimport classnames from \"classnames\";\n\nimport { CollapsedButton, useCollapsedStore } from \"./CollapseButton\";\nimport { Exception } from \"./Exception\";\nimport { HeaderContent } from \"./HeaderContent\";\n\nexport type LayoutProps = ProLayoutProps & {\n runtimeConfig: ProLayoutProps;\n userConfig?: ProLayoutProps;\n navigate?: (path?: string | number) => void;\n initialInfo?: {\n initialState: any;\n loading: boolean;\n setInitialState: () => void;\n };\n};\n\nexport const CreekLayout = (props: LayoutProps) => {\n const {\n route,\n userConfig,\n runtimeConfig,\n children,\n location,\n navigate,\n ...more\n } = props;\n\n const { useToken } = theme;\n const { token } = useToken();\n\n const { collapsed } = useCollapsedStore();\n\n const menuItemRender: ProLayoutProps[\"menuItemRender\"] = useMemoizedFn(\n (itemProps, defaultDom) => {\n return (\n <span\n onClick={() => {\n if (navigate) {\n navigate(itemProps.path);\n }\n }}\n >\n {defaultDom}\n </span>\n );\n }\n );\n\n return (\n <ProLayout\n className={classnames(\"creek-layout-container\", userConfig?.className)}\n layout=\"mix\"\n route={route}\n title={userConfig?.title}\n siderWidth={212}\n location={location}\n menuItemRender={menuItemRender}\n headerContentRender={() => {\n return <HeaderContent />;\n }}\n token={{\n header: {\n colorBgHeader: \"#fff\",\n colorHeaderTitle: \"rgba(0, 0, 0, 0.80);\",\n colorTextMenuSelected: token.colorPrimary,\n heightLayoutHeader: 48,\n },\n sider: {\n colorMenuBackground: \"#f7f8fa\",\n colorBgMenuItemSelected: \"transparent\",\n colorTextMenuActive: token.colorPrimary,\n colorTextMenuSelected: token.colorPrimary,\n colorTextMenuItemHover: token.colorPrimary,\n colorTextMenu: \"#333\",\n },\n pageContainer: {\n paddingBlockPageContainerContent: token.padding,\n paddingInlinePageContainerContent: token.padding,\n colorBgPageContainer: 'linear-gradient(180deg, #F7F9FF 0%, #FFF 45.59%);'\n },\n }}\n fixSiderbar\n fixedHeader\n collapsed={collapsed}\n collapsedButtonRender={(collapsed) => {\n return <CollapsedButton collapsed={collapsed} />;\n }}\n {...more}\n >\n <Exception>{children}</Exception>\n </ProLayout>\n );\n};\n\nexport * from \"./Exception\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA0C;AAC1C,oBAA8B;AAC9B,kBAAsB;AACtB,wBAAuB;AAEvB,4BAAmD;AACnD,uBAA0B;AAC1B,2BAA8B;AA2F9B,iCAAc,wBAlGd;AAuCQ;AAnBD,IAAM,cAAc,CAAC,UAAuB;AACjD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,EAAE,SAAS,IAAI;AACrB,QAAM,EAAE,MAAM,IAAI,SAAS;AAE3B,QAAM,EAAE,UAAU,QAAI,yCAAkB;AAExC,QAAM,qBAAmD;AAAA,IACvD,CAAC,WAAW,eAAe;AACzB,aACE;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,MAAM;AACb,gBAAI,UAAU;AACZ,uBAAS,UAAU,IAAI;AAAA,YACzB;AAAA,UACF;AAAA,UAEC;AAAA;AAAA,MACH;AAAA,IAEJ;AAAA,EACF;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,kBAAAA,SAAW,0BAA0B,yCAAY,SAAS;AAAA,MACrE,QAAO;AAAA,MACP;AAAA,MACA,OAAO,yCAAY;AAAA,MACnB,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,MACA,qBAAqB,MAAM;AACzB,eAAO,4CAAC,sCAAc;AAAA,MACxB;AAAA,MACA,OAAO;AAAA,QACL,QAAQ;AAAA,UACN,eAAe;AAAA,UACf,kBAAkB;AAAA,UAClB,uBAAuB,MAAM;AAAA,UAC7B,oBAAoB;AAAA,QACtB;AAAA,QACA,OAAO;AAAA,UACL,qBAAqB;AAAA,UACrB,yBAAyB;AAAA,UACzB,qBAAqB,MAAM;AAAA,UAC3B,uBAAuB,MAAM;AAAA,UAC7B,wBAAwB,MAAM;AAAA,UAC9B,eAAe;AAAA,QACjB;AAAA,QACA,eAAe;AAAA,UACb,kCAAkC,MAAM;AAAA,UACxC,mCAAmC,MAAM;AAAA,UACzC,sBAAsB;AAAA,QACxB;AAAA,MACF;AAAA,MACA,aAAW;AAAA,MACX,aAAW;AAAA,MACX;AAAA,MACA,uBAAuB,CAACC,eAAc;AACpC,eAAO,4CAAC,yCAAgB,WAAWA,YAAW;AAAA,MAChD;AAAA,MACC,GAAG;AAAA,MAEJ,sDAAC,8BAAW,UAAS;AAAA;AAAA,EACvB;AAEJ;",
|
|
6
|
+
"names": ["classnames", "collapsed"]
|
|
7
|
+
}
|
|
@@ -1,52 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export var Loading = /*#__PURE__*/function () {
|
|
15
|
-
function Loading() {
|
|
16
|
-
_classCallCheck(this, Loading);
|
|
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 });
|
|
17
14
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/creek-loading/index.tsx
|
|
20
|
+
var creek_loading_exports = {};
|
|
21
|
+
__export(creek_loading_exports, {
|
|
22
|
+
Loading: () => Loading
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(creek_loading_exports);
|
|
25
|
+
var import_antd = require("antd");
|
|
26
|
+
var import_client = require("react-dom/client");
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
+
var Loading = class {
|
|
29
|
+
static createContainer() {
|
|
30
|
+
if (this.container)
|
|
25
31
|
return this.container;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (this.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
this.container = null;
|
|
44
|
-
this.root = null;
|
|
45
|
-
}
|
|
32
|
+
this.container = document.createElement("div");
|
|
33
|
+
document.body.appendChild(this.container);
|
|
34
|
+
this.root = (0, import_client.createRoot)(this.container);
|
|
35
|
+
return this.container;
|
|
36
|
+
}
|
|
37
|
+
static open(config) {
|
|
38
|
+
var _a;
|
|
39
|
+
this.createContainer();
|
|
40
|
+
(_a = this.root) == null ? void 0 : _a.render(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Spin, { ...config, fullscreen: true }));
|
|
41
|
+
}
|
|
42
|
+
static close() {
|
|
43
|
+
if (this.root) {
|
|
44
|
+
this.root.unmount();
|
|
45
|
+
if (this.container) {
|
|
46
|
+
document.body.removeChild(this.container);
|
|
47
|
+
this.container = null;
|
|
48
|
+
this.root = null;
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Loading.container = null;
|
|
54
|
+
Loading.root = null;
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
Loading
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/creek-loading/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Spin } from 'antd';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\n\nexport class Loading {\n private static container: HTMLDivElement | null = null;\n private static root: ReturnType<typeof createRoot> | null = null;\n\n private static createContainer() {\n if (this.container) return this.container;\n\n this.container = document.createElement('div');\n document.body.appendChild(this.container);\n this.root = createRoot(this.container);\n return this.container;\n }\n\n static open(config?: React.ComponentProps<typeof Spin>) {\n this.createContainer();\n\n this.root?.render(<Spin {...config} fullscreen></Spin>);\n }\n\n static close() {\n if (this.root) {\n this.root.unmount();\n\n if (this.container) {\n document.body.removeChild(this.container);\n this.container = null;\n this.root = null;\n }\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB;AAErB,oBAA2B;AAkBL;AAhBf,IAAM,UAAN,MAAc;AAAA,EAInB,OAAe,kBAAkB;AAC/B,QAAI,KAAK;AAAW,aAAO,KAAK;AAEhC,SAAK,YAAY,SAAS,cAAc,KAAK;AAC7C,aAAS,KAAK,YAAY,KAAK,SAAS;AACxC,SAAK,WAAO,0BAAW,KAAK,SAAS;AACrC,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,OAAO,KAAK,QAA4C;AAjB1D;AAkBI,SAAK,gBAAgB;AAErB,eAAK,SAAL,mBAAW,OAAO,4CAAC,oBAAM,GAAG,QAAQ,YAAU,MAAC;AAAA,EACjD;AAAA,EAEA,OAAO,QAAQ;AACb,QAAI,KAAK,MAAM;AACb,WAAK,KAAK,QAAQ;AAElB,UAAI,KAAK,WAAW;AAClB,iBAAS,KAAK,YAAY,KAAK,SAAS;AACxC,aAAK,YAAY;AACjB,aAAK,OAAO;AAAA,MACd;AAAA,IACF;AAAA,EACF;AACF;AA9Ba,QACI,YAAmC;AADvC,QAEI,OAA6C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,121 +1,125 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/creek-table/SearchTable.tsx
|
|
30
|
+
var SearchTable_exports = {};
|
|
31
|
+
__export(SearchTable_exports, {
|
|
32
|
+
SearchProTable: () => SearchProTable
|
|
30
33
|
});
|
|
34
|
+
module.exports = __toCommonJS(SearchTable_exports);
|
|
35
|
+
var import_pro_components = require("@ant-design/pro-components");
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_antd_style = require("antd-style");
|
|
38
|
+
var import_classnames = __toESM(require("classnames"));
|
|
39
|
+
var import_lodash = __toESM(require("lodash"));
|
|
40
|
+
var import_react = require("react");
|
|
41
|
+
var import_hooks = require("./hooks");
|
|
42
|
+
var import_TableOptionRender = require("./TableOptionRender");
|
|
43
|
+
var import_toolBarRender = require("./toolBarRender");
|
|
44
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
+
var useStyles = (0, import_antd_style.createStyles)(({ css, token }, { scrollY, prefixCls }) => {
|
|
46
|
+
return {
|
|
47
|
+
"creek-table-container": css`
|
|
48
|
+
.${prefixCls}-table-body {
|
|
49
|
+
overflow-y: auto !important;
|
|
50
|
+
min-height: ${typeof scrollY === "number" ? `${scrollY}px` : scrollY ?? "auto"};
|
|
31
51
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
_props$prefixCls = props.prefixCls,
|
|
37
|
-
prefixCls = _props$prefixCls === void 0 ? 'ant' : _props$prefixCls,
|
|
38
|
-
_props$autoAddFilterF = props.autoAddFilterForColumn,
|
|
39
|
-
autoAddFilterForColumn = _props$autoAddFilterF === void 0 ? true : _props$autoAddFilterF,
|
|
40
|
-
className = props.className,
|
|
41
|
-
_optionsRender = props.optionsRender,
|
|
42
|
-
_tableViewRender = props.tableViewRender,
|
|
43
|
-
pagination = props.pagination,
|
|
44
|
-
_props$pageFixedBotto = props.pageFixedBottom,
|
|
45
|
-
pageFixedBottom = _props$pageFixedBotto === void 0 ? true : _props$pageFixedBotto,
|
|
46
|
-
pageFixedBottomConfig = props.pageFixedBottomConfig,
|
|
47
|
-
restProps = _objectWithoutProperties(props, _excluded);
|
|
48
|
-
var searchContext = useSearchContext();
|
|
49
|
-
var filters = searchContext.filters,
|
|
50
|
-
filtersToParams = searchContext.filtersToParams;
|
|
51
|
-
var proTableRef = useRef(null);
|
|
52
|
+
/* Firefox 滚动条样式 */
|
|
53
|
+
scrollbar-width: thin;
|
|
54
|
+
scrollbar-color: ${token.colorFillSecondary} transparent;
|
|
55
|
+
}
|
|
52
56
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
/* Webkit (Chrome, Safari, Edge) 滚动条样式 */
|
|
58
|
+
& *::-webkit-scrollbar {
|
|
59
|
+
width: 6px !important;
|
|
60
|
+
height: 6px !important;
|
|
61
|
+
background-color: transparent !important;
|
|
62
|
+
}
|
|
59
63
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
shouldCollapse = _useAdaptiveToolBar.shouldCollapse;
|
|
66
|
-
var _useStyles = useStyles(),
|
|
67
|
-
styles = _useStyles.styles;
|
|
64
|
+
& *::-webkit-scrollbar-thumb {
|
|
65
|
+
background-color: ${token.colorFillSecondary} !important;
|
|
66
|
+
border-radius: 3px !important;
|
|
67
|
+
transition: all 0.3s;
|
|
68
|
+
}
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
var result = filtersToParams(filters);
|
|
72
|
-
return result;
|
|
73
|
-
}, [filters]);
|
|
74
|
-
return /*#__PURE__*/_jsx("div", {
|
|
75
|
-
ref: proTableRef,
|
|
76
|
-
children: /*#__PURE__*/_jsx(ProTable, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
77
|
-
className: classnames(styles['creek-table-container'], className),
|
|
78
|
-
columns: columnsWithFilter,
|
|
79
|
-
toolbar: _objectSpread({}, restProps.toolbar),
|
|
80
|
-
params: _objectSpread(_objectSpread({}, params), finalParams),
|
|
81
|
-
search: false,
|
|
82
|
-
pagination: _objectSpread({
|
|
83
|
-
showTotal: function showTotal(total) {
|
|
84
|
-
return /*#__PURE__*/_jsxs("span", {
|
|
85
|
-
children: ["\u5171 ", total, " \u6761"]
|
|
86
|
-
});
|
|
87
|
-
},
|
|
88
|
-
showSizeChanger: true
|
|
89
|
-
}, pagination),
|
|
90
|
-
optionsRender: function optionsRender(defaultProps, dom) {
|
|
91
|
-
var _restProps$options, _restProps$options2;
|
|
92
|
-
return _.isFunction(_optionsRender) ? _optionsRender(defaultProps, dom) : restProps !== null && restProps !== void 0 && restProps.options ? [/*#__PURE__*/_jsx(TableOptionRender, {
|
|
93
|
-
defaultDom: dom,
|
|
94
|
-
importConfig: restProps === null || restProps === void 0 || (_restProps$options = restProps.options) === null || _restProps$options === void 0 ? void 0 : _restProps$options.importConfig,
|
|
95
|
-
exportConfig: restProps === null || restProps === void 0 || (_restProps$options2 = restProps.options) === null || _restProps$options2 === void 0 ? void 0 : _restProps$options2.exportConfig
|
|
96
|
-
}, "option")] : [];
|
|
97
|
-
},
|
|
98
|
-
toolBarRender: function toolBarRender() {
|
|
99
|
-
return _toolBarRender({
|
|
100
|
-
shouldCollapse: shouldCollapse,
|
|
101
|
-
restProps: restProps
|
|
102
|
-
});
|
|
70
|
+
& *::-webkit-scrollbar-thumb:hover {
|
|
71
|
+
background-color: ${token.colorFill} !important;
|
|
103
72
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
// 在表格内容区上方显示筛选条件
|
|
108
|
-
,
|
|
109
|
-
tableViewRender: function tableViewRender(defaultProps, defaultDom) {
|
|
110
|
-
return _.isFunction(_tableViewRender) ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
111
|
-
children: [/*#__PURE__*/_jsx(CreekFilterDisplay, {}), _tableViewRender(defaultProps, defaultDom)]
|
|
112
|
-
}) : /*#__PURE__*/_jsx(TableViewContent, {
|
|
113
|
-
pageFixedBottom: pageFixedBottom,
|
|
114
|
-
pageFixedBottomConfig: pageFixedBottomConfig,
|
|
115
|
-
prefixCls: prefixCls,
|
|
116
|
-
children: defaultDom
|
|
117
|
-
});
|
|
73
|
+
|
|
74
|
+
& *::-webkit-scrollbar-track {
|
|
75
|
+
background-color: transparent !important;
|
|
118
76
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
77
|
+
|
|
78
|
+
.${prefixCls}-pagination {
|
|
79
|
+
.${prefixCls}-pagination-total-text {
|
|
80
|
+
flex: 1;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
var SearchProTable = (props) => {
|
|
87
|
+
var _a;
|
|
88
|
+
const { columns, prefixCls = "ant", autoAddFilterForColumn = true, className, optionsRender, tableViewRender, pagination, pageFixedBottom = true, pageFixedBottomConfig, ...restProps } = props;
|
|
89
|
+
const proTableRef = (0, import_react.useRef)(null);
|
|
90
|
+
const { token } = import_antd.theme.useToken();
|
|
91
|
+
const { columns: adaptiveColumns, totalWidth } = (0, import_hooks.useAutoWidthColumns)(columns, proTableRef);
|
|
92
|
+
const scrollY = (0, import_hooks.useTableScrollHeight)(prefixCls, proTableRef, pageFixedBottom, token.paddingContentVerticalLG, (pageFixedBottomConfig == null ? void 0 : pageFixedBottomConfig.bottomFix) || token.padding);
|
|
93
|
+
const { styles } = useStyles({ scrollY, prefixCls });
|
|
94
|
+
console.log("scrollY", scrollY);
|
|
95
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: proTableRef, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
+
import_pro_components.ProTable,
|
|
97
|
+
{
|
|
98
|
+
...props,
|
|
99
|
+
className: (0, import_classnames.default)(styles["creek-table-container"], className),
|
|
100
|
+
columns: adaptiveColumns,
|
|
101
|
+
scroll: {
|
|
102
|
+
x: totalWidth,
|
|
103
|
+
y: scrollY ?? ((_a = restProps.scroll) == null ? void 0 : _a.y)
|
|
104
|
+
},
|
|
105
|
+
toolbar: {
|
|
106
|
+
...restProps.toolbar
|
|
107
|
+
},
|
|
108
|
+
optionsRender: (defaultProps, dom) => {
|
|
109
|
+
var _a2, _b;
|
|
110
|
+
return import_lodash.default.isFunction(optionsRender) ? optionsRender(defaultProps, dom) : (restProps == null ? void 0 : restProps.options) ? [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TableOptionRender.TableOptionRender, { defaultDom: dom, importConfig: (_a2 = restProps == null ? void 0 : restProps.options) == null ? void 0 : _a2.importConfig, exportConfig: (_b = restProps == null ? void 0 : restProps.options) == null ? void 0 : _b.exportConfig }, "option")] : [];
|
|
111
|
+
},
|
|
112
|
+
toolBarRender: (...args) => {
|
|
113
|
+
return (0, import_toolBarRender.toolBarRender)({ shouldCollapse: false, restProps, args });
|
|
114
|
+
},
|
|
115
|
+
tableViewRender: (defaultProps, defaultDom) => {
|
|
116
|
+
return import_lodash.default.isFunction(tableViewRender) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: tableViewRender(defaultProps, defaultDom) }) : defaultDom;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
) });
|
|
120
|
+
};
|
|
121
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
122
|
+
0 && (module.exports = {
|
|
123
|
+
SearchProTable
|
|
124
|
+
});
|
|
125
|
+
//# sourceMappingURL=SearchTable.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/creek-table/SearchTable.tsx"],
|
|
4
|
+
"sourcesContent": ["import { ParamsType, ProTable } from '@ant-design/pro-components';\nimport { theme } from 'antd';\nimport { createStyles } from 'antd-style';\nimport classnames from 'classnames';\nimport _ from 'lodash';\nimport { useRef } from 'react';\n\nimport { useAutoWidthColumns, useTableScrollHeight } from './hooks';\nimport { TableOptionRender } from './TableOptionRender';\nimport { toolBarRender } from './toolBarRender';\nimport { CreekTableProps } from './type';\n\nconst useStyles = createStyles(({ css, token }, { scrollY, prefixCls }: { scrollY?: number | string; prefixCls: string }) => {\n return {\n 'creek-table-container': css`\n .${prefixCls}-table-body {\n overflow-y: auto !important;\n min-height: ${typeof scrollY === 'number' ? `${scrollY}px` : (scrollY ?? 'auto')};\n\n /* Firefox 滚动条样式 */\n scrollbar-width: thin;\n scrollbar-color: ${token.colorFillSecondary} transparent;\n }\n\n /* Webkit (Chrome, Safari, Edge) 滚动条样式 */\n & *::-webkit-scrollbar {\n width: 6px !important;\n height: 6px !important;\n background-color: transparent !important;\n }\n\n & *::-webkit-scrollbar-thumb {\n background-color: ${token.colorFillSecondary} !important;\n border-radius: 3px !important;\n transition: all 0.3s;\n }\n\n & *::-webkit-scrollbar-thumb:hover {\n background-color: ${token.colorFill} !important;\n }\n\n & *::-webkit-scrollbar-track {\n background-color: transparent !important;\n }\n\n .${prefixCls}-pagination {\n .${prefixCls}-pagination-total-text {\n flex: 1;\n }\n }\n `,\n };\n});\n\n// 独立的 ProTable 组件\nexport const SearchProTable = <T extends ParamsType, U extends ParamsType, ValueType = 'text'>(props: CreekTableProps<T, U, ValueType>) => {\n const { columns, prefixCls = 'ant', autoAddFilterForColumn = true, className, optionsRender, tableViewRender, pagination, pageFixedBottom = true, pageFixedBottomConfig, ...restProps } = props;\n\n const proTableRef = useRef<HTMLDivElement>(null);\n\n const { token } = theme.useToken();\n\n // // 使用自定义 hook 处理工具栏的自适应功能\n // const { shouldCollapse } = useAdaptiveToolBar({\n // containerRef: proTableRef,\n // prefixCls,\n // });ƒ\n\n const { columns: adaptiveColumns, totalWidth } = useAutoWidthColumns(columns, proTableRef);\n\n const scrollY = useTableScrollHeight(prefixCls, proTableRef, pageFixedBottom, token.paddingContentVerticalLG, pageFixedBottomConfig?.bottomFix || token.padding);\n\n const { styles } = useStyles({ scrollY, prefixCls });\n\n console.log('scrollY', scrollY);\n\n return (\n <div ref={proTableRef}>\n <ProTable<T, U, ValueType>\n {...props}\n className={classnames(styles['creek-table-container'], className)}\n columns={adaptiveColumns}\n scroll={{\n x: totalWidth,\n y: scrollY ?? restProps.scroll?.y,\n }}\n toolbar={{\n ...restProps.toolbar,\n }}\n optionsRender={(defaultProps, dom) => {\n return _.isFunction(optionsRender)\n ? optionsRender(defaultProps, dom)\n : restProps?.options\n ? [<TableOptionRender key=\"option\" defaultDom={dom} importConfig={restProps?.options?.importConfig} exportConfig={restProps?.options?.exportConfig} />]\n : [];\n }}\n toolBarRender={(...args) => {\n return toolBarRender({ shouldCollapse: false, restProps, args });\n }}\n // 在表格内容区上方显示筛选条件\n tableViewRender={(defaultProps, defaultDom) => {\n return _.isFunction(tableViewRender) ? <>{tableViewRender(defaultProps, defaultDom)}</> : defaultDom;\n }}\n />\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAqC;AACrC,kBAAsB;AACtB,wBAA6B;AAC7B,wBAAuB;AACvB,oBAAc;AACd,mBAAuB;AAEvB,mBAA0D;AAC1D,+BAAkC;AAClC,2BAA8B;AAoFb;AAjFjB,IAAM,gBAAY,gCAAa,CAAC,EAAE,KAAK,MAAM,GAAG,EAAE,SAAS,UAAU,MAAwD;AAC3H,SAAO;AAAA,IACL,yBAAyB;AAAA,SACpB;AAAA;AAAA,sBAEa,OAAO,YAAY,WAAW,GAAG,cAAe,WAAW;AAAA;AAAA;AAAA;AAAA,2BAItD,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAWL,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAMN,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAOzB;AAAA,WACE;AAAA;AAAA;AAAA;AAAA;AAAA,EAKT;AACF,CAAC;AAGM,IAAM,iBAAiB,CAAiE,UAA4C;AAvD3I;AAwDE,QAAM,EAAE,SAAS,YAAY,OAAO,yBAAyB,MAAM,WAAW,eAAe,iBAAiB,YAAY,kBAAkB,MAAM,uBAAuB,GAAG,UAAU,IAAI;AAE1L,QAAM,kBAAc,qBAAuB,IAAI;AAE/C,QAAM,EAAE,MAAM,IAAI,kBAAM,SAAS;AAQjC,QAAM,EAAE,SAAS,iBAAiB,WAAW,QAAI,kCAAoB,SAAS,WAAW;AAEzF,QAAM,cAAU,mCAAqB,WAAW,aAAa,iBAAiB,MAAM,2BAA0B,+DAAuB,cAAa,MAAM,OAAO;AAE/J,QAAM,EAAE,OAAO,IAAI,UAAU,EAAE,SAAS,UAAU,CAAC;AAEnD,UAAQ,IAAI,WAAW,OAAO;AAE9B,SACE,4CAAC,SAAI,KAAK,aACR;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,eAAW,kBAAAA,SAAW,OAAO,uBAAuB,GAAG,SAAS;AAAA,MAChE,SAAS;AAAA,MACT,QAAQ;AAAA,QACN,GAAG;AAAA,QACH,GAAG,aAAW,eAAU,WAAV,mBAAkB;AAAA,MAClC;AAAA,MACA,SAAS;AAAA,QACP,GAAG,UAAU;AAAA,MACf;AAAA,MACA,eAAe,CAAC,cAAc,QAAQ;AAzF9C,YAAAC,KAAA;AA0FU,eAAO,cAAAC,QAAE,WAAW,aAAa,IAC7B,cAAc,cAAc,GAAG,KAC/B,uCAAW,WACT,CAAC,4CAAC,8CAA+B,YAAY,KAAK,eAAcD,MAAA,uCAAW,YAAX,gBAAAA,IAAoB,cAAc,eAAc,4CAAW,YAAX,mBAAoB,gBAA5G,QAA0H,CAAE,IACpJ,CAAC;AAAA,MACT;AAAA,MACA,eAAe,IAAI,SAAS;AAC1B,mBAAO,oCAAc,EAAE,gBAAgB,OAAO,WAAW,KAAK,CAAC;AAAA,MACjE;AAAA,MAEA,iBAAiB,CAAC,cAAc,eAAe;AAC7C,eAAO,cAAAC,QAAE,WAAW,eAAe,IAAI,2EAAG,0BAAgB,cAAc,UAAU,GAAE,IAAM;AAAA,MAC5F;AAAA;AAAA,EACF,GACF;AAEJ;",
|
|
6
|
+
"names": ["classnames", "_a", "_"]
|
|
7
|
+
}
|