@creekjs/web-components 1.0.5 → 1.0.7
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 +32 -16
- package/README.md +117 -66
- package/dist/creek-config-provider/CreekConfigContext.d.ts +4 -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.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.js +47 -4
- package/dist/creek-config-provider/index.js.map +3 -3
- package/dist/creek-hooks/useApp/index.d.ts +3 -3
- package/dist/creek-keep-alive/index.d.ts +24 -1
- 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.js +3 -1
- package/dist/creek-layout/ActionRender/FullScreen.js.map +2 -2
- package/dist/creek-layout/ActionRender/LayoutSettings.d.ts +5 -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.js.map +2 -2
- package/dist/creek-layout/ActionRender/index.d.ts +1 -0
- package/dist/creek-layout/ActionRender/index.js +3 -0
- package/dist/creek-layout/ActionRender/index.js.map +2 -2
- package/dist/creek-layout/index.d.ts +5 -5
- package/dist/creek-layout/index.js +79 -16
- package/dist/creek-layout/index.js.map +3 -3
- package/dist/creek-layout/useLayoutSettingsStore.d.ts +20 -0
- package/dist/creek-layout/useLayoutSettingsStore.js +45 -0
- package/dist/creek-layout/useLayoutSettingsStore.js.map +7 -0
- package/dist/creek-locale-button/index.d.ts +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.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.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.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.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.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.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.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.js +10 -0
- package/dist/creek-table/hooks/index.js.map +2 -2
- package/dist/creek-table/hooks/useAutoWidthColumns.d.ts +1 -1
- package/dist/creek-table/hooks/useAutoWidthColumns.js +76 -17
- package/dist/creek-table/hooks/useAutoWidthColumns.js.map +2 -2
- package/dist/creek-table/hooks/useEllipsisColumns.d.ts +8 -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.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.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.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.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.js +44 -5
- package/dist/creek-table/hooks/useTableScrollHeight.js.map +2 -2
- package/dist/creek-table/type.d.ts +4 -6
- package/dist/creek-table/type.js.map +1 -1
- package/dist/index.d.ts +4 -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.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.js +49 -0
- package/dist/locales/zh-CN.js.map +7 -0
- package/dist/utils/i18n.d.ts +2 -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 +22 -8
- 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/ActionRender/FullScreen.tsx +10 -6
- package/src/creek-layout/ActionRender/LayoutSettings.tsx +67 -0
- package/src/creek-layout/ActionRender/UserInfo.tsx +1 -1
- package/src/creek-layout/ActionRender/index.tsx +1 -0
- package/src/creek-layout/index.tsx +89 -22
- 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-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/useApp/DrawerHelper.d.ts.map +0 -1
- package/dist/creek-hooks/useApp/ModalHelper.d.ts.map +0 -1
- package/dist/creek-hooks/useApp/index.d.ts.map +0 -1
- package/dist/creek-hooks/useApp/types.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/ActionRender/FullScreen.d.ts.map +0 -1
- package/dist/creek-layout/ActionRender/UserInfo.d.ts.map +0 -1
- package/dist/creek-layout/ActionRender/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/index.d.ts.map +0 -1
- package/dist/creek-loading/index.d.ts.map +0 -1
- package/dist/creek-table/SearchTable.d.ts.map +0 -1
- package/dist/creek-table/TableOptionRender.d.ts +0 -9
- package/dist/creek-table/TableOptionRender.d.ts.map +0 -1
- package/dist/creek-table/TableOptionRender.js +0 -74
- package/dist/creek-table/TableOptionRender.js.map +0 -7
- 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/useAutoWidthColumns.d.ts.map +0 -1
- package/dist/creek-table/hooks/useElementDistance.d.ts.map +0 -1
- package/dist/creek-table/hooks/useTableScrollHeight.d.ts.map +0 -1
- package/dist/creek-table/index.d.ts.map +0 -1
- package/dist/creek-table/toolBarRender.d.ts +0 -5
- package/dist/creek-table/toolBarRender.d.ts.map +0 -1
- package/dist/creek-table/toolBarRender.js +0 -58
- package/dist/creek-table/toolBarRender.js.map +0 -7
- package/dist/creek-table/type.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/src/creek-table/TableOptionRender.tsx +0 -57
- package/src/creek-table/toolBarRender.tsx +0 -28
|
@@ -0,0 +1,45 @@
|
|
|
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/useLayoutSettingsStore.ts
|
|
20
|
+
var useLayoutSettingsStore_exports = {};
|
|
21
|
+
__export(useLayoutSettingsStore_exports, {
|
|
22
|
+
useLayoutSettingsStore: () => useLayoutSettingsStore
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(useLayoutSettingsStore_exports);
|
|
25
|
+
var import_zustand = require("zustand");
|
|
26
|
+
var import_middleware = require("zustand/middleware");
|
|
27
|
+
var useLayoutSettingsStore = (0, import_zustand.create)()(
|
|
28
|
+
(0, import_middleware.persist)(
|
|
29
|
+
(set) => ({
|
|
30
|
+
colorPrimary: void 0,
|
|
31
|
+
showFullScreen: true,
|
|
32
|
+
showLocaleButton: true,
|
|
33
|
+
keepAlive: true,
|
|
34
|
+
setSettings: (settings) => set((state) => ({ ...state, ...settings }))
|
|
35
|
+
}),
|
|
36
|
+
{
|
|
37
|
+
name: "creek-layout-settings"
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
useLayoutSettingsStore
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=useLayoutSettingsStore.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/creek-layout/useLayoutSettingsStore.ts"],
|
|
4
|
+
"sourcesContent": ["import { create } from 'zustand';\nimport { persist } from 'zustand/middleware';\n\nexport type LayoutSettingsStore = {\n colorPrimary?: string;\n showFullScreen?: boolean;\n showLocaleButton?: boolean;\n keepAlive?: boolean;\n setSettings: (settings: Partial<LayoutSettingsStore>) => void;\n};\n\nexport const useLayoutSettingsStore = create<LayoutSettingsStore>()(\n persist(\n (set) => ({\n colorPrimary: undefined,\n showFullScreen: true,\n showLocaleButton: true,\n keepAlive: true,\n setSettings: (settings) => set((state) => ({ ...state, ...settings })),\n }),\n {\n name: 'creek-layout-settings',\n }\n )\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuB;AACvB,wBAAwB;AAUjB,IAAM,6BAAyB,uBAA4B;AAAA,MAChE;AAAA,IACE,CAAC,SAAS;AAAA,MACR,cAAc;AAAA,MACd,gBAAgB;AAAA,MAChB,kBAAkB;AAAA,MAClB,WAAW;AAAA,MACX,aAAa,CAAC,aAAa,IAAI,CAAC,WAAW,EAAE,GAAG,OAAO,GAAG,SAAS,EAAE;AAAA,IACvE;AAAA,IACA;AAAA,MACE,MAAM;AAAA,IACR;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CreekLocaleButton: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,66 @@
|
|
|
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-locale-button/index.tsx
|
|
20
|
+
var creek_locale_button_exports = {};
|
|
21
|
+
__export(creek_locale_button_exports, {
|
|
22
|
+
CreekLocaleButton: () => CreekLocaleButton
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(creek_locale_button_exports);
|
|
25
|
+
var import_icons = require("@ant-design/icons");
|
|
26
|
+
var import_antd = require("antd");
|
|
27
|
+
var import_react = require("@creekjs/i18n/react");
|
|
28
|
+
var import_creek_config_provider = require("../creek-config-provider");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
var CreekLocaleButton = () => {
|
|
31
|
+
var _a;
|
|
32
|
+
const t = (0, import_react.useT)();
|
|
33
|
+
const { locale, changeLocale } = (0, import_creek_config_provider.useAppLocale)();
|
|
34
|
+
const items = [
|
|
35
|
+
{
|
|
36
|
+
key: "zh-CN",
|
|
37
|
+
label: t("creek-locale-button.index.jianTiZhongWen", "简体中文"),
|
|
38
|
+
disabled: locale === "zh-CN"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: "en-US",
|
|
42
|
+
label: "English",
|
|
43
|
+
disabled: locale === "en-US"
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
const currentLabel = ((_a = items.find((item) => item.key === locale)) == null ? void 0 : _a.label) || "Language";
|
|
47
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
|
+
import_antd.Dropdown,
|
|
49
|
+
{
|
|
50
|
+
menu: {
|
|
51
|
+
items,
|
|
52
|
+
onClick: (e) => changeLocale(e.key)
|
|
53
|
+
},
|
|
54
|
+
placement: "bottomRight",
|
|
55
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { size: "small", align: "center", children: [
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.GlobalOutlined, {}),
|
|
57
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Typography.Text, { children: currentLabel })
|
|
58
|
+
] })
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
+
0 && (module.exports = {
|
|
64
|
+
CreekLocaleButton
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/creek-locale-button/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { GlobalOutlined } from '@ant-design/icons';\nimport { Dropdown, Space, Typography } from 'antd';\n\nimport { useT } from '@creekjs/i18n/react';\n\nimport { useAppLocale } from '../creek-config-provider';\n\nexport const CreekLocaleButton = () => {\n const t = useT();\n\n const { locale, changeLocale } = useAppLocale();\n\n const items = [\n {\n key: 'zh-CN',\n label: t('creek-locale-button.index.jianTiZhongWen', '简体中文'),\n disabled: locale === 'zh-CN',\n },\n {\n key: 'en-US',\n label: 'English',\n disabled: locale === 'en-US',\n },\n ];\n\n const currentLabel = items.find((item) => item.key === locale)?.label || 'Language';\n\n return (\n <Dropdown\n menu={{\n items,\n onClick: (e) => changeLocale(e.key),\n }}\n placement=\"bottomRight\"\n >\n <Space size=\"small\" align=\"center\">\n <GlobalOutlined />\n <Typography.Text>{currentLabel}</Typography.Text>\n </Space>\n </Dropdown>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,kBAA4C;AAE5C,mBAAqB;AAErB,mCAA6B;AA8BvB;AA5BC,IAAM,oBAAoB,MAAM;AAPvC;AAQE,QAAM,QAAI,mBAAK;AAEf,QAAM,EAAE,QAAQ,aAAa,QAAI,2CAAa;AAE9C,QAAM,QAAQ;AAAA,IACZ;AAAA,MACE,KAAK;AAAA,MACL,OAAO,EAAE,4CAA4C,MAAM;AAAA,MAC3D,UAAU,WAAW;AAAA,IACvB;AAAA,IACA;AAAA,MACE,KAAK;AAAA,MACL,OAAO;AAAA,MACP,UAAU,WAAW;AAAA,IACvB;AAAA,EACF;AAEA,QAAM,iBAAe,WAAM,KAAK,CAAC,SAAS,KAAK,QAAQ,MAAM,MAAxC,mBAA2C,UAAS;AAEzE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,QACJ;AAAA,QACA,SAAS,CAAC,MAAM,aAAa,EAAE,GAAG;AAAA,MACpC;AAAA,MACA,WAAU;AAAA,MAEV,uDAAC,qBAAM,MAAK,SAAQ,OAAM,UACxB;AAAA,oDAAC,+BAAe;AAAA,QAChB,4CAAC,uBAAW,MAAX,EAAiB,wBAAa;AAAA,SACjC;AAAA;AAAA,EACF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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-page-container/index.tsx
|
|
30
|
+
var creek_page_container_exports = {};
|
|
31
|
+
__export(creek_page_container_exports, {
|
|
32
|
+
CreekPageContainer: () => CreekPageContainer
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(creek_page_container_exports);
|
|
35
|
+
var import_pro_components = require("@ant-design/pro-components");
|
|
36
|
+
var import_antd_style = require("antd-style");
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
var useStyles = (0, import_antd_style.createStyles)(({ token }) => ({
|
|
40
|
+
container: {
|
|
41
|
+
padding: token.padding
|
|
42
|
+
}
|
|
43
|
+
}));
|
|
44
|
+
var CreekPageContainer = (props) => {
|
|
45
|
+
const { header, className, children, ...rest } = props;
|
|
46
|
+
const { styles } = useStyles();
|
|
47
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
|
+
import_pro_components.PageContainer,
|
|
49
|
+
{
|
|
50
|
+
header: {
|
|
51
|
+
title: null,
|
|
52
|
+
// 默认没有标题
|
|
53
|
+
breadcrumb: {},
|
|
54
|
+
// 保留面包屑配置能力
|
|
55
|
+
...header
|
|
56
|
+
// 允许外部覆盖
|
|
57
|
+
},
|
|
58
|
+
className: (0, import_classnames.default)(styles.container, className),
|
|
59
|
+
...rest,
|
|
60
|
+
children
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
+
0 && (module.exports = {
|
|
66
|
+
CreekPageContainer
|
|
67
|
+
});
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/creek-page-container/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { PageContainer, PageContainerProps } from '@ant-design/pro-components';\nimport { createStyles } from 'antd-style';\nimport React from 'react';\n\nimport classnames from 'classnames';\n\nconst useStyles = createStyles(({ token }) => ({\n container: {\n padding: token.padding,\n },\n}));\n\nexport type CreekPageContainerProps = PageContainerProps;\n\nexport const CreekPageContainer: React.FC<CreekPageContainerProps> = (props) => {\n const { header, className, children, ...rest } = props;\n const { styles } = useStyles();\n\n return (\n <PageContainer\n header={{\n title: null, // 默认没有标题\n breadcrumb: {}, // 保留面包屑配置能力\n ...header, // 允许外部覆盖\n }}\n className={classnames(styles.container, className)}\n {...rest}\n >\n {children}\n </PageContainer>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAkD;AAClD,wBAA6B;AAG7B,wBAAuB;AAenB;AAbJ,IAAM,gBAAY,gCAAa,CAAC,EAAE,MAAM,OAAO;AAAA,EAC7C,WAAW;AAAA,IACT,SAAS,MAAM;AAAA,EACjB;AACF,EAAE;AAIK,IAAM,qBAAwD,CAAC,UAAU;AAC9E,QAAM,EAAE,QAAQ,WAAW,UAAU,GAAG,KAAK,IAAI;AACjD,QAAM,EAAE,OAAO,IAAI,UAAU;AAE7B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,QAAQ;AAAA,QACN,OAAO;AAAA;AAAA,QACP,YAAY,CAAC;AAAA;AAAA,QACb,GAAG;AAAA;AAAA,MACL;AAAA,MACA,eAAW,kBAAAA,SAAW,OAAO,WAAW,SAAS;AAAA,MAChD,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;",
|
|
6
|
+
"names": ["classnames"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './scrollbar';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/creek-style/index.ts
|
|
17
|
+
var creek_style_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(creek_style_exports);
|
|
19
|
+
__reExport(creek_style_exports, require("./scrollbar"), module.exports);
|
|
20
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
21
|
+
0 && (module.exports = {
|
|
22
|
+
...require("./scrollbar")
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
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-style/scrollbar.ts
|
|
20
|
+
var scrollbar_exports = {};
|
|
21
|
+
__export(scrollbar_exports, {
|
|
22
|
+
GlobalScrollbarStyle: () => GlobalScrollbarStyle
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(scrollbar_exports);
|
|
25
|
+
var import_antd_style = require("antd-style");
|
|
26
|
+
var GlobalScrollbarStyle = (0, import_antd_style.createGlobalStyle)(({ theme: token }) => {
|
|
27
|
+
return {
|
|
28
|
+
"*": {
|
|
29
|
+
scrollbarWidth: "auto",
|
|
30
|
+
scrollbarColor: `${token.colorFillSecondary} transparent !important`
|
|
31
|
+
},
|
|
32
|
+
/* Webkit (Chrome, Safari, Edge) 滚动条样式 */
|
|
33
|
+
"& *::-webkit-scrollbar": {
|
|
34
|
+
width: "6px !important",
|
|
35
|
+
height: "6px !important",
|
|
36
|
+
backgroundColor: "transparent !important"
|
|
37
|
+
},
|
|
38
|
+
"& *::-webkit-scrollbar-thumb": {
|
|
39
|
+
backgroundColor: `${token.colorFillSecondary} !important`,
|
|
40
|
+
borderRadius: "3px !important",
|
|
41
|
+
transition: "all 0.3s",
|
|
42
|
+
"&:hover": {
|
|
43
|
+
backgroundColor: `${token.colorFill} !important`
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"& *::-webkit-scrollbar-track": {
|
|
47
|
+
backgroundColor: "transparent !important"
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
+
0 && (module.exports = {
|
|
53
|
+
GlobalScrollbarStyle
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=scrollbar.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/creek-style/scrollbar.ts"],
|
|
4
|
+
"sourcesContent": ["import { createGlobalStyle } from 'antd-style';\n\nexport const GlobalScrollbarStyle = createGlobalStyle(({ theme: token }) => {\n return {\n '*': {\n scrollbarWidth: 'auto',\n scrollbarColor: `${token.colorFillSecondary} transparent !important`,\n },\n /* Webkit (Chrome, Safari, Edge) 滚动条样式 */\n '& *::-webkit-scrollbar': {\n width: '6px !important',\n height: '6px !important',\n backgroundColor: 'transparent !important',\n },\n\n '& *::-webkit-scrollbar-thumb': {\n backgroundColor: `${token.colorFillSecondary} !important`,\n borderRadius: '3px !important',\n transition: 'all 0.3s',\n '&:hover': {\n backgroundColor: `${token.colorFill} !important`,\n },\n },\n\n '& *::-webkit-scrollbar-track': {\n backgroundColor: 'transparent !important',\n },\n };\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAkC;AAE3B,IAAM,2BAAuB,qCAAkB,CAAC,EAAE,OAAO,MAAM,MAAM;AAC1E,SAAO;AAAA,IACL,KAAK;AAAA,MACH,gBAAgB;AAAA,MAChB,gBAAgB,GAAG,MAAM;AAAA,IAC3B;AAAA;AAAA,IAEA,0BAA0B;AAAA,MACxB,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,iBAAiB;AAAA,IACnB;AAAA,IAEA,gCAAgC;AAAA,MAC9B,iBAAiB,GAAG,MAAM;AAAA,MAC1B,cAAc;AAAA,MACd,YAAY;AAAA,MACZ,WAAW;AAAA,QACT,iBAAiB,GAAG,MAAM;AAAA,MAC5B;AAAA,IACF;AAAA,IAEA,gCAAgC;AAAA,MAC9B,iBAAiB;AAAA,IACnB;AAAA,EACF;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import { ParamsType } from '@ant-design/pro-components';
|
|
2
2
|
import { CreekTableProps } from './type';
|
|
3
|
+
export type SearchTableStyleOptions = {
|
|
4
|
+
prefixCls?: string;
|
|
5
|
+
scrollY?: number;
|
|
6
|
+
tableContainerHeight?: number;
|
|
7
|
+
tableHeight?: number;
|
|
8
|
+
bordered?: boolean;
|
|
9
|
+
hasHeaderTitle?: boolean;
|
|
10
|
+
hasScroll?: boolean;
|
|
11
|
+
};
|
|
3
12
|
export declare const SearchProTable: <T extends ParamsType, U extends ParamsType, ValueType = "text">(props: CreekTableProps<T, U, ValueType>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -33,90 +33,127 @@ __export(SearchTable_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(SearchTable_exports);
|
|
35
35
|
var import_pro_components = require("@ant-design/pro-components");
|
|
36
|
-
var
|
|
36
|
+
var import_ahooks = require("ahooks");
|
|
37
37
|
var import_antd_style = require("antd-style");
|
|
38
38
|
var import_classnames = __toESM(require("classnames"));
|
|
39
|
-
var import_lodash = __toESM(require("lodash"));
|
|
40
39
|
var import_react = require("react");
|
|
40
|
+
var import_creek_style = require("../creek-style");
|
|
41
41
|
var import_hooks = require("./hooks");
|
|
42
|
-
var import_TableOptionRender = require("./TableOptionRender");
|
|
43
|
-
var import_toolBarRender = require("./toolBarRender");
|
|
44
42
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
-
var useStyles = (0, import_antd_style.createStyles)(({
|
|
43
|
+
var useStyles = (0, import_antd_style.createStyles)(({ token }, options) => {
|
|
44
|
+
const { prefixCls = "ant", scrollY, tableHeight, bordered, hasHeaderTitle, tableContainerHeight, hasScroll } = options;
|
|
46
45
|
return {
|
|
47
|
-
"creek-table-container":
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
46
|
+
"creek-table-container": {
|
|
47
|
+
overflow: "hidden",
|
|
48
|
+
position: "relative",
|
|
49
|
+
height: tableHeight ? `${tableHeight}px` : "auto",
|
|
50
|
+
backgroundColor: token.colorBgContainer,
|
|
51
|
+
[`.${prefixCls}-table`]: {
|
|
52
|
+
minHeight: `${tableContainerHeight}px`
|
|
53
|
+
},
|
|
54
|
+
[`.${prefixCls}-table-container`]: {
|
|
55
|
+
borderBottom: "none",
|
|
56
|
+
overflow: "hidden"
|
|
57
|
+
},
|
|
58
|
+
[`.${prefixCls}-table-header`]: {
|
|
59
|
+
borderRight: bordered && hasScroll ? `1px solid ${token.colorBorderSecondary}` : "none"
|
|
60
|
+
},
|
|
61
|
+
[`.${prefixCls}-table-body`]: {
|
|
62
|
+
overflowY: "auto",
|
|
63
|
+
maxHeight: `${scrollY}px`,
|
|
64
|
+
borderRight: bordered && hasScroll ? `1px solid ${token.colorBorderSecondary}` : "none"
|
|
65
|
+
},
|
|
66
|
+
// 兼容非 scroll.y 模式下的 table 容器
|
|
67
|
+
[`.${prefixCls}-table-content`]: {
|
|
68
|
+
overflowY: "hidden",
|
|
69
|
+
maxHeight: scrollY ? `${scrollY}px` : void 0
|
|
70
|
+
},
|
|
71
|
+
[`.${prefixCls}-table-cell-scrollbar`]: {
|
|
72
|
+
boxShadow: bordered ? "none!important" : "inherit",
|
|
73
|
+
borderInlineEnd: bordered ? `none!important` : "none",
|
|
74
|
+
display: hasScroll ? "table-cell" : "none",
|
|
75
|
+
width: hasScroll ? "initial" : "0px!important",
|
|
76
|
+
minWidth: hasScroll ? "initial" : "0px!important",
|
|
77
|
+
maxWidth: hasScroll ? "initial" : "0px!important",
|
|
78
|
+
padding: hasScroll ? "initial" : "0px!important",
|
|
79
|
+
margin: hasScroll ? "initial" : "0px!important"
|
|
80
|
+
},
|
|
81
|
+
[`.${prefixCls}-pagination`]: {
|
|
82
|
+
[`.${prefixCls}-pagination-total-text`]: {
|
|
83
|
+
flex: 1
|
|
81
84
|
}
|
|
82
|
-
}
|
|
83
|
-
|
|
85
|
+
},
|
|
86
|
+
[`.${prefixCls}-pro-table-search`]: {
|
|
87
|
+
marginBlockEnd: 0,
|
|
88
|
+
borderBottom: `1px solid ${token.colorBorderSecondary}`
|
|
89
|
+
},
|
|
90
|
+
[`.${prefixCls}-pro-query-filter-container`]: {
|
|
91
|
+
[`.${prefixCls}-pro-query-filter`]: {
|
|
92
|
+
padding: token.paddingXS
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
// 如果没有 headerTitle,toolbar 展示在 headerTitle 的区域
|
|
96
|
+
[`.${prefixCls}-pro-table-list-toolbar-right`]: !hasHeaderTitle ? {
|
|
97
|
+
flex: 1
|
|
98
|
+
} : {},
|
|
99
|
+
[`.${prefixCls}-pro-table-list-toolbar-setting-items`]: !hasHeaderTitle ? {
|
|
100
|
+
marginLeft: "auto"
|
|
101
|
+
} : {}
|
|
102
|
+
}
|
|
84
103
|
};
|
|
85
104
|
});
|
|
86
105
|
var SearchProTable = (props) => {
|
|
87
|
-
var _a;
|
|
88
|
-
const {
|
|
106
|
+
var _a, _b;
|
|
107
|
+
const {
|
|
108
|
+
columns,
|
|
109
|
+
prefixCls = "ant",
|
|
110
|
+
className,
|
|
111
|
+
optionsRender,
|
|
112
|
+
tableViewRender,
|
|
113
|
+
pagination,
|
|
114
|
+
pageFixedBottom = true,
|
|
115
|
+
pageFixedBottomConfig,
|
|
116
|
+
resizable = true,
|
|
117
|
+
bordered = true,
|
|
118
|
+
options,
|
|
119
|
+
size,
|
|
120
|
+
headerTitle,
|
|
121
|
+
showIndex = true,
|
|
122
|
+
...restProps
|
|
123
|
+
} = props;
|
|
89
124
|
const proTableRef = (0, import_react.useRef)(null);
|
|
90
|
-
const
|
|
91
|
-
const {
|
|
92
|
-
const
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
125
|
+
const [resizedWidths, setResizedWidths] = (0, import_ahooks.useSafeState)({});
|
|
126
|
+
const { finalOptions, tableSize, finalOptionsRender } = (0, import_hooks.useTableOptions)(options, size, optionsRender);
|
|
127
|
+
const columnsWithIndex = (0, import_hooks.useIndexColumn)(columns, showIndex);
|
|
128
|
+
const processedColumns = (0, import_hooks.useEllipsisColumns)(columnsWithIndex);
|
|
129
|
+
const { columns: adaptiveColumns, totalWidth } = (0, import_hooks.useAutoWidthColumns)(processedColumns, proTableRef, resizedWidths, bordered, tableSize);
|
|
130
|
+
const { columns: resizableColumns, components } = (0, import_hooks.useResizableColumns)(adaptiveColumns, resizable, resizedWidths, setResizedWidths, proTableRef);
|
|
131
|
+
const { scrollY, tableHeight, tableContainerHeight, hasScroll } = (0, import_hooks.useTableScrollHeight)(prefixCls, proTableRef, pageFixedBottom, pageFixedBottomConfig == null ? void 0 : pageFixedBottomConfig.bottomFix);
|
|
132
|
+
const { styles } = useStyles({ scrollY, tableHeight, prefixCls, bordered, hasHeaderTitle: !!headerTitle, tableContainerHeight, hasScroll });
|
|
133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref: proTableRef, children: [
|
|
134
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_creek_style.GlobalScrollbarStyle, {}),
|
|
135
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
136
|
+
import_pro_components.ProTable,
|
|
137
|
+
{
|
|
138
|
+
components,
|
|
139
|
+
headerTitle,
|
|
140
|
+
options: finalOptions,
|
|
141
|
+
optionsRender: finalOptionsRender,
|
|
142
|
+
size: tableSize,
|
|
143
|
+
...restProps,
|
|
144
|
+
className: (0, import_classnames.default)(styles["creek-table-container"], className),
|
|
145
|
+
columns: resizableColumns,
|
|
146
|
+
bordered,
|
|
147
|
+
scroll: {
|
|
148
|
+
y: hasScroll ? scrollY || ((_a = restProps.scroll) == null ? void 0 : _a.y) : void 0,
|
|
149
|
+
x: totalWidth ?? ((_b = restProps.scroll) == null ? void 0 : _b.x)
|
|
150
|
+
},
|
|
151
|
+
toolbar: {
|
|
152
|
+
...restProps.toolbar
|
|
153
|
+
}
|
|
117
154
|
}
|
|
118
|
-
|
|
119
|
-
|
|
155
|
+
)
|
|
156
|
+
] });
|
|
120
157
|
};
|
|
121
158
|
// Annotate the CommonJS export names for ESM import in node:
|
|
122
159
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/creek-table/SearchTable.tsx"],
|
|
4
|
-
"sourcesContent": ["import { ParamsType, ProTable } from '@ant-design/pro-components';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAqC;AACrC,
|
|
6
|
-
"names": ["classnames"
|
|
4
|
+
"sourcesContent": ["import { ParamsType, ProTable } from '@ant-design/pro-components';\nimport { useSafeState } from 'ahooks';\nimport { createStyles } from 'antd-style';\nimport classnames from 'classnames';\nimport { useRef } from 'react';\n\nimport { GlobalScrollbarStyle } from '../creek-style';\nimport { useAutoWidthColumns, useEllipsisColumns, useIndexColumn, useResizableColumns, useTableOptions, useTableScrollHeight } from './hooks';\n\nimport { CreekTableProps } from './type';\n\nexport type SearchTableStyleOptions = {\n prefixCls?: string;\n scrollY?: number;\n tableContainerHeight?: number;\n tableHeight?: number;\n bordered?: boolean;\n hasHeaderTitle?: boolean;\n hasScroll?: boolean;\n};\n\nconst useStyles = createStyles(({ token }, options: SearchTableStyleOptions) => {\n const { prefixCls = 'ant', scrollY, tableHeight, bordered, hasHeaderTitle, tableContainerHeight, hasScroll } = options;\n return {\n 'creek-table-container': {\n overflow: 'hidden',\n position: 'relative',\n height: tableHeight ? `${tableHeight}px` : 'auto',\n backgroundColor: token.colorBgContainer,\n [`.${prefixCls}-table`]: {\n minHeight: `${tableContainerHeight}px`,\n },\n [`.${prefixCls}-table-container`]: {\n borderBottom: 'none',\n overflow: 'hidden'\n },\n \n [`.${prefixCls}-table-header`]: {\n borderRight: (bordered && hasScroll) ? `1px solid ${token.colorBorderSecondary}` : 'none',\n },\n [`.${prefixCls}-table-body`]: {\n overflowY: 'auto',\n maxHeight: `${scrollY}px`,\n borderRight: (bordered && hasScroll) ? `1px solid ${token.colorBorderSecondary}` : 'none',\n },\n // 兼容非 scroll.y 模式下的 table 容器\n [`.${prefixCls}-table-content`]: {\n overflowY: 'hidden',\n maxHeight: scrollY ? `${scrollY}px` : undefined,\n },\n\n [`.${prefixCls}-table-cell-scrollbar`]: {\n boxShadow: bordered ? 'none!important' : 'inherit',\n borderInlineEnd: bordered ? `none!important` : 'none',\n display: hasScroll ? 'table-cell' : 'none',\n width: hasScroll ? 'initial' : '0px!important',\n minWidth: hasScroll ? 'initial' : '0px!important',\n maxWidth: hasScroll ? 'initial' : '0px!important',\n padding: hasScroll ? 'initial' : '0px!important',\n margin: hasScroll ? 'initial' : '0px!important',\n },\n\n [`.${prefixCls}-pagination`]: {\n [`.${prefixCls}-pagination-total-text`]: {\n flex: 1,\n },\n },\n [`.${prefixCls}-pro-table-search`]: {\n marginBlockEnd: 0,\n borderBottom: `1px solid ${token.colorBorderSecondary}`,\n },\n\n [`.${prefixCls}-pro-query-filter-container`]: {\n [`.${prefixCls}-pro-query-filter`]: {\n padding: token.paddingXS,\n },\n },\n\n // 如果没有 headerTitle,toolbar 展示在 headerTitle 的区域\n [`.${prefixCls}-pro-table-list-toolbar-right`]: !hasHeaderTitle\n ? {\n flex: 1,\n }\n : {},\n [`.${prefixCls}-pro-table-list-toolbar-setting-items`]: !hasHeaderTitle\n ? {\n marginLeft: 'auto',\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 {\n columns,\n prefixCls = 'ant',\n className,\n optionsRender,\n tableViewRender,\n pagination,\n pageFixedBottom = true,\n pageFixedBottomConfig,\n resizable = true,\n bordered = true,\n options,\n size,\n headerTitle,\n showIndex = true,\n ...restProps\n } = props;\n\n const proTableRef = useRef<HTMLDivElement>(null);\n\n // 状态提升:管理列宽调整状态,以便 useAutoWidthColumns 能感知到\n const [resizedWidths, setResizedWidths] = useSafeState<Record<string, number>>({});\n\n // 使用自定义 Hook 管理 options 和 size\n const { finalOptions, tableSize, finalOptionsRender } = useTableOptions<T, U, ValueType>(options, size, optionsRender);\n\n const columnsWithIndex = useIndexColumn<T, ValueType>(columns, showIndex);\n\n // 处理 columns,默认开启 ellipsis\n const processedColumns = useEllipsisColumns(columnsWithIndex);\n\n const { columns: adaptiveColumns, totalWidth } = useAutoWidthColumns<T, ValueType>(processedColumns, proTableRef, resizedWidths, bordered, tableSize);\n\n const { columns: resizableColumns, components } = useResizableColumns<T, ValueType>(adaptiveColumns, resizable, resizedWidths, setResizedWidths, proTableRef);\n\n const { scrollY, tableHeight, tableContainerHeight, hasScroll } = useTableScrollHeight(prefixCls, proTableRef, pageFixedBottom, pageFixedBottomConfig?.bottomFix);\n\n const { styles } = useStyles({ scrollY, tableHeight, prefixCls, bordered, hasHeaderTitle: !!headerTitle, tableContainerHeight, hasScroll });\n\n\n return (\n <div ref={proTableRef}>\n <GlobalScrollbarStyle />\n {/* 自定义滚动条 */}\n <ProTable<T, U, ValueType>\n components={components}\n headerTitle={headerTitle}\n options={finalOptions}\n optionsRender={finalOptionsRender}\n size={tableSize}\n {...restProps}\n className={classnames(styles['creek-table-container'], className)}\n columns={resizableColumns}\n bordered={bordered}\n scroll={{\n y: hasScroll ? scrollY || restProps.scroll?.y : undefined,\n x: totalWidth ?? restProps.scroll?.x,\n }}\n toolbar={{\n ...restProps.toolbar,\n }}\n />\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["classnames"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ProTableProps } from '@ant-design/pro-components';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type SizeType = ProTableProps<any, any>['size'];
|
|
4
|
+
interface DensityIconProps {
|
|
5
|
+
tableSize: SizeType;
|
|
6
|
+
setTableSize: (size: SizeType) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const DensityIcon: React.FC<DensityIconProps>;
|
|
9
|
+
export {};
|