@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,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/creek-table/hooks/useStatusColumns.tsx"],
|
|
4
|
+
"sourcesContent": ["import { ProColumns } from '@ant-design/pro-components';\nimport { Badge, Tag } from 'antd';\nimport { get } from 'lodash';\nimport React, { useMemo } from 'react';\n\n// Preset colors for automatic assignment when no semantic match is found\nconst PRESET_COLORS = [\n 'blue',\n 'green',\n 'volcano',\n 'orange',\n 'gold',\n 'lime',\n 'cyan',\n 'geekblue',\n 'purple',\n 'magenta',\n];\n\n// Semantic keywords mapping\nconst SEMANTIC_STATUS_MAP: Record<string, string> = {\n // Success / Green\n success: 'success',\n ok: 'success',\n pass: 'success',\n complete: 'success',\n finish: 'success',\n online: 'success',\n active: 'success',\n enable: 'success',\n published: 'success',\n open: 'success',\n 正常: 'success',\n 成功: 'success',\n 完成: 'success',\n 通过: 'success',\n 启用: 'success',\n 在线: 'success',\n 发布: 'success',\n 开启: 'success',\n 已发布: 'success',\n\n // Error / Red\n fail: 'error',\n error: 'error',\n reject: 'error',\n stop: 'error',\n close: 'error',\n offline: 'error',\n disable: 'error',\n banned: 'error',\n exception: 'error',\n blocked: 'error',\n 失败: 'error',\n 错误: 'error',\n 拒绝: 'error',\n 停止: 'error',\n 关闭: 'error',\n 离线: 'error',\n 禁用: 'error',\n 异常: 'error',\n 封禁: 'error',\n\n // Processing / Blue\n process: 'processing',\n running: 'processing',\n pending: 'processing',\n waiting: 'processing',\n loading: 'processing',\n init: 'processing',\n doing: 'processing',\n 进行中: 'processing',\n 处理中: 'processing',\n 等待: 'processing',\n 加载: 'processing',\n 初始化: 'processing',\n 启动: 'processing',\n 运行中: 'processing',\n\n // Warning / Warning\n warn: 'warning',\n timeout: 'warning',\n expire: 'warning',\n risk: 'warning',\n abnormal: 'warning',\n 警告: 'warning',\n 超时: 'warning',\n 过期: 'warning',\n 风险: 'warning',\n\n // Default\n default: 'default',\n normal: 'default',\n unknown: 'default',\n 默认: 'default',\n 未知: 'default',\n};\n\n// Helper to determine status color based on text or key\nconst inferStatusColor = (key: string | number, text: string): string => {\n const normalizedKey = String(key).toLowerCase();\n const normalizedText = String(text).toLowerCase();\n\n // 1. Try to match key first\n for (const keyword in SEMANTIC_STATUS_MAP) {\n if (normalizedKey.includes(keyword)) {\n return SEMANTIC_STATUS_MAP[keyword];\n }\n }\n\n // 2. Try to match text\n for (const keyword in SEMANTIC_STATUS_MAP) {\n if (normalizedText.includes(keyword)) {\n return SEMANTIC_STATUS_MAP[keyword];\n }\n }\n\n // 3. Fallback to deterministic hash color\n // Use a simple hash of the key to pick a color from PRESET_COLORS\n let hash = 0;\n for (let i = 0; i < normalizedKey.length; i++) {\n hash = normalizedKey.charCodeAt(i) + ((hash << 5) - hash);\n }\n const index = Math.abs(hash) % PRESET_COLORS.length;\n return PRESET_COLORS[index];\n};\n\nexport const useStatusColumns = <T, ValueType>(\n columns?: ProColumns<T, ValueType>[],\n) => {\n return useMemo(() => {\n return columns?.map((col) => {\n // If user has custom render, we respect it and do nothing\n if (col.render) {\n return col;\n }\n\n // If no valueEnum, we do nothing\n if (!col.valueEnum) {\n return col;\n }\n\n // Check fieldProps for explicit status render mode: 'tag' | 'badge' | 'none' | undefined (auto)\n // We use fieldProps because it's a standard place to put custom column props without TS errors\n const statusRender = (col.fieldProps as any)?.statusRender;\n \n\n if (statusRender === 'none') {\n return col;\n }\n\n // We wrap the render function to support Tag and Badge automatically based on valueEnum properties\n return {\n ...col,\n render: (\n dom: React.ReactNode,\n entity: T,\n index: number,\n action: any,\n schema: any,\n ) => {\n const valueEnum = schema?.valueEnum;\n if (!valueEnum) {\n return dom;\n }\n\n // Get raw value\n const dataIndex = col.dataIndex || col.key;\n // dataIndex can be array or string\n const rawValue =\n typeof dataIndex === 'string' || Array.isArray(dataIndex)\n ? get(entity, dataIndex as any)\n : undefined;\n\n if (rawValue === undefined || rawValue === null) {\n return dom;\n }\n\n // valueEnum can be Map or Object\n let enumItem = null;\n if (valueEnum instanceof Map) {\n enumItem = valueEnum.get(rawValue);\n // Try string key if number key fails, or vice versa\n if (!enumItem && typeof rawValue === 'number') {\n enumItem = valueEnum.get(String(rawValue));\n } else if (!enumItem && typeof rawValue === 'string') {\n enumItem = valueEnum.get(Number(rawValue));\n }\n } else {\n enumItem = valueEnum[rawValue as string];\n }\n\n if (!enumItem) {\n return dom;\n }\n\n // 1. If color is present, render Tag (unless forced to badge)\n if (enumItem.color && statusRender !== 'badge') {\n return (\n <Tag color={enumItem.color} style={{ margin: 0 }}>\n {enumItem.text || dom}\n </Tag>\n );\n }\n\n // 2. If status is present, render Badge (unless forced to tag)\n // ProTable usually handles this, but since we overrode render, we must handle it\n if (enumItem.status && statusRender !== 'tag') {\n const status = String(enumItem.status).toLowerCase();\n return <Badge status={status as any} text={enumItem.text || dom} />;\n }\n\n // 3. If neither is present, try to infer color automatically\n // Only infer if it's NOT explicitly set to null/false (in case user wants plain text)\n if (enumItem.status === null || enumItem.status === false) {\n return dom;\n }\n const inferred = inferStatusColor(\n rawValue,\n enumItem.text || String(rawValue),\n );\n\n // Force Tag mode\n if (statusRender === 'tag') {\n // Map semantic status to actual colors for Tag\n let tagColor = inferred;\n if (inferred === 'processing') tagColor = 'blue';\n if (inferred === 'error') tagColor = 'error';\n if (inferred === 'success') tagColor = 'success';\n if (inferred === 'warning') tagColor = 'warning';\n if (inferred === 'default') tagColor = 'default';\n\n return (\n <Tag color={tagColor} style={{ margin: 0 }}>\n {enumItem.text || dom}\n </Tag>\n );\n }\n\n // Default / Force Badge mode\n // If it is a semantic status, use status prop\n if (['success', 'processing', 'error', 'default', 'warning'].includes(inferred)) {\n return <Badge status={inferred as any} text={enumItem.text || dom} />;\n }\n\n // Otherwise use color prop (for preset colors like 'volcano', 'gold', etc.)\n return <Badge color={inferred} text={enumItem.text || dom} />;\n },\n } as ProColumns<T, ValueType>;\n });\n }, [columns]);\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ParamsType, ProTableProps } from '@ant-design/pro-components';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to manage ProTable options logic including density and settings
|
|
4
|
+
*
|
|
5
|
+
* @param options User provided options configuration
|
|
6
|
+
* @param size User provided size (density)
|
|
7
|
+
* @returns { finalOptions, tableSize, setTableSize }
|
|
8
|
+
*/
|
|
9
|
+
export declare const useTableOptions: <T extends ParamsType, U extends ParamsType, ValueType = "text">(options: ProTableProps<T, U, ValueType>['options'], size?: ProTableProps<T, U, ValueType>['size'], optionsRender?: ProTableProps<T, U, ValueType>['optionsRender']) => {
|
|
10
|
+
finalOptions: ProTableProps<T, U, ValueType>['options'];
|
|
11
|
+
tableSize: ProTableProps<T, U, ValueType>['size'];
|
|
12
|
+
setTableSize: React.Dispatch<React.SetStateAction<ProTableProps<T, U, ValueType>['size']>>;
|
|
13
|
+
showDensity: boolean;
|
|
14
|
+
finalOptionsRender: ProTableProps<T, U, ValueType>['optionsRender'];
|
|
15
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
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/hooks/useTableOptions.tsx
|
|
20
|
+
var useTableOptions_exports = {};
|
|
21
|
+
__export(useTableOptions_exports, {
|
|
22
|
+
useTableOptions: () => useTableOptions
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(useTableOptions_exports);
|
|
25
|
+
var import_ahooks = require("ahooks");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_components = require("../components");
|
|
28
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
var useTableOptions = (options, size, optionsRender) => {
|
|
30
|
+
const [tableSize, setTableSize] = (0, import_ahooks.useSafeState)(size || "small");
|
|
31
|
+
(0, import_react.useEffect)(() => {
|
|
32
|
+
if (size) {
|
|
33
|
+
setTableSize(size);
|
|
34
|
+
}
|
|
35
|
+
}, [size]);
|
|
36
|
+
const tableSizeRef = (0, import_react.useRef)(tableSize);
|
|
37
|
+
tableSizeRef.current = tableSize;
|
|
38
|
+
const showDensity = options !== false && (options == null ? void 0 : options.density) !== false;
|
|
39
|
+
const finalOptions = options === false ? false : {
|
|
40
|
+
setting: true,
|
|
41
|
+
reload: false,
|
|
42
|
+
fullScreen: false,
|
|
43
|
+
...options,
|
|
44
|
+
density: false
|
|
45
|
+
};
|
|
46
|
+
const finalOptionsRender = (opts, defaultDom) => {
|
|
47
|
+
const doms = [...defaultDom];
|
|
48
|
+
const currentTableSize = tableSizeRef.current;
|
|
49
|
+
if (showDensity) {
|
|
50
|
+
doms.unshift(
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
+
import_components.DensityIcon,
|
|
53
|
+
{
|
|
54
|
+
tableSize: currentTableSize,
|
|
55
|
+
setTableSize
|
|
56
|
+
},
|
|
57
|
+
"density"
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
if (optionsRender) {
|
|
62
|
+
return optionsRender(opts, doms);
|
|
63
|
+
}
|
|
64
|
+
return doms;
|
|
65
|
+
};
|
|
66
|
+
return {
|
|
67
|
+
finalOptions,
|
|
68
|
+
tableSize,
|
|
69
|
+
setTableSize,
|
|
70
|
+
showDensity,
|
|
71
|
+
finalOptionsRender
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
useTableOptions
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=useTableOptions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/creek-table/hooks/useTableOptions.tsx"],
|
|
4
|
+
"sourcesContent": ["import { ParamsType, ProTableProps } from '@ant-design/pro-components';\nimport { useSafeState } from 'ahooks';\nimport { useEffect, useRef } from 'react';\nimport { DensityIcon } from '../components';\n\n/**\n * Hook to manage ProTable options logic including density and settings\n * \n * @param options User provided options configuration\n * @param size User provided size (density)\n * @returns { finalOptions, tableSize, setTableSize }\n */\nexport const useTableOptions = <T extends ParamsType, U extends ParamsType, ValueType = 'text'>(\n options: ProTableProps<T, U, ValueType>['options'],\n size?: ProTableProps<T, U, ValueType>['size'],\n optionsRender?: ProTableProps<T, U, ValueType>['optionsRender']\n): {\n finalOptions: ProTableProps<T, U, ValueType>['options'];\n tableSize: ProTableProps<T, U, ValueType>['size'];\n setTableSize: React.Dispatch<React.SetStateAction<ProTableProps<T, U, ValueType>['size']>>;\n showDensity: boolean;\n finalOptionsRender: ProTableProps<T, U, ValueType>['optionsRender'];\n} => {\n // Manage table density state, defaulting to 'small' (compact)\n // Supports controlled mode and switching\n const [tableSize, setTableSize] = useSafeState<ProTableProps<T, U, ValueType>['size']>(size || 'small');\n\n // Sync internal state if size prop changes\n useEffect(() => {\n if (size) {\n setTableSize(size);\n }\n }, [size]);\n\n // Use ref to store latest tableSize to avoid stale closures in optionsRender\n const tableSizeRef = useRef(tableSize);\n tableSizeRef.current = tableSize;\n\n // Merge default options with user provided options\n // Default: show density and setting, hide reload and fullScreen\n const showDensity = options !== false && (options?.density !== false);\n\n const finalOptions: ProTableProps<T, U, ValueType>['options'] =\n options === false\n ? false\n : {\n setting: true,\n reload: false,\n fullScreen: false,\n ...options,\n density: false,\n };\n\n const finalOptionsRender: ProTableProps<T, U, ValueType>['optionsRender'] = (opts, defaultDom) => {\n const doms = [...defaultDom];\n const currentTableSize = tableSizeRef.current;\n \n if (showDensity) {\n doms.unshift(\n <DensityIcon \n key=\"density\" \n tableSize={currentTableSize} \n setTableSize={setTableSize} \n />\n );\n }\n\n if (optionsRender) {\n return optionsRender(opts, doms);\n }\n return doms;\n };\n\n return {\n finalOptions,\n tableSize,\n setTableSize,\n showDensity,\n finalOptionsRender,\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA6B;AAC7B,mBAAkC;AAClC,wBAA4B;AAwDpB;AA/CD,IAAM,kBAAkB,CAC7B,SACA,MACA,kBAOG;AAGH,QAAM,CAAC,WAAW,YAAY,QAAI,4BAAqD,QAAQ,OAAO;AAGtG,8BAAU,MAAM;AACd,QAAI,MAAM;AACR,mBAAa,IAAI;AAAA,IACnB;AAAA,EACF,GAAG,CAAC,IAAI,CAAC;AAGT,QAAM,mBAAe,qBAAO,SAAS;AACrC,eAAa,UAAU;AAIvB,QAAM,cAAc,YAAY,UAAU,mCAAS,aAAY;AAE/D,QAAM,eACJ,YAAY,QACR,QACA;AAAA,IACE,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,GAAG;AAAA,IACH,SAAS;AAAA,EACX;AAEN,QAAM,qBAAsE,CAAC,MAAM,eAAe;AAChG,UAAM,OAAO,CAAC,GAAG,UAAU;AAC3B,UAAM,mBAAmB,aAAa;AAEtC,QAAI,aAAa;AACf,WAAK;AAAA,QACH;AAAA,UAAC;AAAA;AAAA,YAEC,WAAW;AAAA,YACX;AAAA;AAAA,UAFI;AAAA,QAGN;AAAA,MACF;AAAA,IACF;AAEA,QAAI,eAAe;AACjB,aAAO,cAAc,MAAM,IAAI;AAAA,IACjC;AACA,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export declare const useTableScrollHeight: (prefixCls: string, tableRef: React.RefObject<HTMLDivElement>, pageFixedBottom?: boolean,
|
|
1
|
+
export declare const useTableScrollHeight: (prefixCls: string, tableRef: React.RefObject<HTMLDivElement>, pageFixedBottom?: boolean, offsetBottom?: number) => {
|
|
2
|
+
scrollY: number | undefined;
|
|
3
|
+
tableHeight: number | undefined;
|
|
4
|
+
tableContainerHeight: number | undefined;
|
|
5
|
+
hasScroll: boolean;
|
|
6
|
+
};
|
|
@@ -24,15 +24,38 @@ __export(useTableScrollHeight_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(useTableScrollHeight_exports);
|
|
25
25
|
var import_ahooks = require("ahooks");
|
|
26
26
|
var import_react = require("react");
|
|
27
|
-
var useTableScrollHeight = (prefixCls, tableRef, pageFixedBottom = true,
|
|
27
|
+
var useTableScrollHeight = (prefixCls, tableRef, pageFixedBottom = true, offsetBottom = 0) => {
|
|
28
28
|
const [scrollY, setScrollY] = (0, import_react.useState)(void 0);
|
|
29
|
+
const [tableHeight, setTableHeight] = (0, import_react.useState)(void 0);
|
|
30
|
+
const [tableContainerHeight, setTableContainerHeight] = (0, import_react.useState)(0);
|
|
31
|
+
const [hasScroll, setHasScroll] = (0, import_react.useState)(false);
|
|
29
32
|
const { run: calcHeight } = (0, import_ahooks.useDebounceFn)(
|
|
30
33
|
() => {
|
|
31
34
|
if (!pageFixedBottom || !tableRef.current)
|
|
32
35
|
return;
|
|
33
36
|
const tableEl = tableRef.current;
|
|
37
|
+
if (tableEl.offsetParent === null)
|
|
38
|
+
return;
|
|
34
39
|
const tableHeader = tableEl.querySelector(`.${prefixCls}-table-thead`);
|
|
35
|
-
const tableBody = tableEl.querySelector(`.${prefixCls}-table-
|
|
40
|
+
const tableBody = tableEl.querySelector(`.${prefixCls}-table-tbody`);
|
|
41
|
+
let currentContentPadding = 0;
|
|
42
|
+
const layoutContentEl = tableEl.closest(`div[class*="pro-layout-content"]`);
|
|
43
|
+
if (layoutContentEl) {
|
|
44
|
+
const style = window.getComputedStyle(layoutContentEl);
|
|
45
|
+
const paddingBottom = parseFloat(style.paddingBottom);
|
|
46
|
+
if (!isNaN(paddingBottom)) {
|
|
47
|
+
currentContentPadding = paddingBottom;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
let currentCardContentPadding = 0;
|
|
51
|
+
const cardContentEl = tableEl.querySelector(`.${prefixCls}-pro-card-body`);
|
|
52
|
+
if (cardContentEl) {
|
|
53
|
+
const style = window.getComputedStyle(cardContentEl);
|
|
54
|
+
const paddingBottom = parseFloat(style.paddingBottom);
|
|
55
|
+
if (!isNaN(paddingBottom)) {
|
|
56
|
+
currentCardContentPadding = paddingBottom;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
36
59
|
let top = 0;
|
|
37
60
|
if (tableHeader) {
|
|
38
61
|
top = tableHeader.getBoundingClientRect().bottom;
|
|
@@ -40,19 +63,30 @@ var useTableScrollHeight = (prefixCls, tableRef, pageFixedBottom = true, content
|
|
|
40
63
|
top = tableBody.getBoundingClientRect().top;
|
|
41
64
|
}
|
|
42
65
|
const windowHeight = window.innerHeight;
|
|
43
|
-
let height = windowHeight - top -
|
|
66
|
+
let height = windowHeight - top - currentContentPadding - currentCardContentPadding - offsetBottom;
|
|
67
|
+
let currentTableHeight = windowHeight - tableEl.getBoundingClientRect().top;
|
|
44
68
|
const pagination = tableEl.querySelector(`.${prefixCls}-pagination`);
|
|
45
69
|
if (pagination) {
|
|
46
70
|
const paginationHeight = pagination.clientHeight;
|
|
47
71
|
const styles = window.getComputedStyle(pagination);
|
|
48
72
|
const totalPaginationMargin = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
|
|
49
73
|
height = height - paginationHeight - totalPaginationMargin;
|
|
74
|
+
setTableHeight(0);
|
|
50
75
|
} else {
|
|
51
76
|
height = height - 40;
|
|
77
|
+
setTableHeight(currentTableHeight);
|
|
52
78
|
}
|
|
79
|
+
let currentHasScroll = false;
|
|
80
|
+
if (tableBody) {
|
|
81
|
+
currentHasScroll = tableBody.scrollHeight > height;
|
|
82
|
+
}
|
|
83
|
+
setHasScroll(currentHasScroll);
|
|
53
84
|
setScrollY(height);
|
|
85
|
+
if (tableHeader) {
|
|
86
|
+
setTableContainerHeight(height + (tableHeader == null ? void 0 : tableHeader.clientHeight));
|
|
87
|
+
}
|
|
54
88
|
},
|
|
55
|
-
{ wait:
|
|
89
|
+
{ wait: 16, leading: true }
|
|
56
90
|
);
|
|
57
91
|
(0, import_react.useEffect)(() => {
|
|
58
92
|
calcHeight();
|
|
@@ -63,7 +97,12 @@ var useTableScrollHeight = (prefixCls, tableRef, pageFixedBottom = true, content
|
|
|
63
97
|
return () => observer.disconnect();
|
|
64
98
|
}, [tableRef, pageFixedBottom, prefixCls]);
|
|
65
99
|
(0, import_ahooks.useEventListener)("resize", calcHeight);
|
|
66
|
-
return
|
|
100
|
+
return {
|
|
101
|
+
scrollY,
|
|
102
|
+
tableHeight,
|
|
103
|
+
tableContainerHeight,
|
|
104
|
+
hasScroll
|
|
105
|
+
};
|
|
67
106
|
};
|
|
68
107
|
// Annotate the CommonJS export names for ESM import in node:
|
|
69
108
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/creek-table/hooks/useTableScrollHeight.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useDebounceFn, useEventListener } from 'ahooks';\nimport { useEffect, useState } from 'react';\n\nexport const useTableScrollHeight = (prefixCls: string, tableRef: React.RefObject<HTMLDivElement>, pageFixedBottom: boolean = true,
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAgD;AAChD,mBAAoC;AAE7B,IAAM,uBAAuB,CAAC,WAAmB,UAA2C,kBAA2B,MAAM,
|
|
4
|
+
"sourcesContent": ["import { useDebounceFn, useEventListener } from 'ahooks';\nimport { useEffect, useState } from 'react';\n\nexport const useTableScrollHeight = (prefixCls: string, tableRef: React.RefObject<HTMLDivElement>, pageFixedBottom: boolean = true, offsetBottom: number = 0) => {\n const [scrollY, setScrollY] = useState<number | undefined>(undefined);\n const [tableHeight, setTableHeight] = useState<number | undefined>(undefined);\n const [tableContainerHeight, setTableContainerHeight] = useState<number | undefined>(0);\n const [hasScroll, setHasScroll] = useState<boolean>(false);\n\n const { run: calcHeight } = useDebounceFn(\n () => {\n if (!pageFixedBottom || !tableRef.current) return;\n\n const tableEl = tableRef.current;\n\n // 如果元素不可见(例如在 display: none 的 tab 中),不进行计算,防止计算出错误的高度\n if (tableEl.offsetParent === null) return;\n\n const tableHeader = tableEl.querySelector(`.${prefixCls}-table-thead`);\n const tableBody = tableEl.querySelector(`.${prefixCls}-table-tbody`);\n\n // 尝试动态获取 layout content padding\n // Ant Design Pro Layout 的 content 容器通常有 class 包含 'pro-layout-content'\n // 例如:ant-pro-layout-content, my-prefix-pro-layout-content\n let currentContentPadding = 0; // 默认使用传入的\n\n const layoutContentEl = tableEl.closest(`div[class*=\"pro-layout-content\"]`);\n if (layoutContentEl) {\n const style = window.getComputedStyle(layoutContentEl);\n // 我们主要关心底部的 padding,因为它影响到底部留白\n const paddingBottom = parseFloat(style.paddingBottom);\n if (!isNaN(paddingBottom)) {\n currentContentPadding = paddingBottom;\n }\n }\n\n // 尝试动态获取 layout content padding\n // Ant Design Pro Layout 的 content 容器通常有 class 包含 'pro-layout-content'\n // 例如:ant-pro-layout-content, my-prefix-pro-layout-content\n let currentCardContentPadding = 0; // 默认使用传入的\n\n const cardContentEl = tableEl.querySelector(`.${prefixCls}-pro-card-body`);\n if (cardContentEl) {\n const style = window.getComputedStyle(cardContentEl);\n // 我们主要关心底部的 padding,因为它影响到底部留白\n const paddingBottom = parseFloat(style.paddingBottom);\n if (!isNaN(paddingBottom)) {\n currentCardContentPadding = paddingBottom;\n }\n }\n\n let top = 0;\n if (tableHeader) {\n top = tableHeader.getBoundingClientRect().bottom;\n } else if (tableBody) {\n top = tableBody.getBoundingClientRect().top;\n }\n\n const windowHeight = window.innerHeight;\n\n let height = windowHeight - top - currentContentPadding - currentCardContentPadding - offsetBottom;\n let currentTableHeight = windowHeight - tableEl.getBoundingClientRect().top;\n\n const pagination = tableEl.querySelector(`.${prefixCls}-pagination`);\n\n if (pagination) {\n const paginationHeight = pagination.clientHeight;\n\n const styles = window.getComputedStyle(pagination);\n const totalPaginationMargin = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);\n\n height = height - paginationHeight - totalPaginationMargin;\n setTableHeight(0);\n } else {\n // 如果没有找到分页,预留一个高度(假设分页高度为 24px + margin 16px = 40px)\n // 这样可以避免初始加载时高度过大,导致出现滚动条,然后分页出现后高度又变小\n height = height - 40;\n\n setTableHeight(currentTableHeight);\n }\n\n let currentHasScroll = false;\n if (tableBody) {\n currentHasScroll = tableBody.scrollHeight > height;\n }\n setHasScroll(currentHasScroll);\n\n // Minimum height to avoid crashes or ugly rendering\n setScrollY(height);\n\n if (tableHeader) {\n setTableContainerHeight(height + tableHeader?.clientHeight);\n }\n },\n { wait: 16,leading: true },\n );\n\n useEffect(() => {\n // Initial calculation\n calcHeight();\n\n // Observer for DOM changes that might affect position\n const observer = new MutationObserver(calcHeight);\n if (tableRef.current) {\n observer.observe(tableRef.current, { childList: true, subtree: true });\n }\n return () => observer.disconnect();\n }, [tableRef, pageFixedBottom, prefixCls]);\n\n useEventListener('resize', calcHeight);\n\n return {\n scrollY,\n tableHeight,\n tableContainerHeight,\n hasScroll,\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAgD;AAChD,mBAAoC;AAE7B,IAAM,uBAAuB,CAAC,WAAmB,UAA2C,kBAA2B,MAAM,eAAuB,MAAM;AAC/J,QAAM,CAAC,SAAS,UAAU,QAAI,uBAA6B,MAAS;AACpE,QAAM,CAAC,aAAa,cAAc,QAAI,uBAA6B,MAAS;AAC5E,QAAM,CAAC,sBAAsB,uBAAuB,QAAI,uBAA6B,CAAC;AACtF,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAkB,KAAK;AAEzD,QAAM,EAAE,KAAK,WAAW,QAAI;AAAA,IAC1B,MAAM;AACJ,UAAI,CAAC,mBAAmB,CAAC,SAAS;AAAS;AAE3C,YAAM,UAAU,SAAS;AAGzB,UAAI,QAAQ,iBAAiB;AAAM;AAEnC,YAAM,cAAc,QAAQ,cAAc,IAAI,uBAAuB;AACrE,YAAM,YAAY,QAAQ,cAAc,IAAI,uBAAuB;AAKnE,UAAI,wBAAwB;AAE5B,YAAM,kBAAkB,QAAQ,QAAQ,kCAAkC;AAC1E,UAAI,iBAAiB;AACnB,cAAM,QAAQ,OAAO,iBAAiB,eAAe;AAErD,cAAM,gBAAgB,WAAW,MAAM,aAAa;AACpD,YAAI,CAAC,MAAM,aAAa,GAAG;AACzB,kCAAwB;AAAA,QAC1B;AAAA,MACF;AAKA,UAAI,4BAA4B;AAEhC,YAAM,gBAAgB,QAAQ,cAAc,IAAI,yBAAyB;AACzE,UAAI,eAAe;AACjB,cAAM,QAAQ,OAAO,iBAAiB,aAAa;AAEnD,cAAM,gBAAgB,WAAW,MAAM,aAAa;AACpD,YAAI,CAAC,MAAM,aAAa,GAAG;AACzB,sCAA4B;AAAA,QAC9B;AAAA,MACF;AAEA,UAAI,MAAM;AACV,UAAI,aAAa;AACf,cAAM,YAAY,sBAAsB,EAAE;AAAA,MAC5C,WAAW,WAAW;AACpB,cAAM,UAAU,sBAAsB,EAAE;AAAA,MAC1C;AAEA,YAAM,eAAe,OAAO;AAE5B,UAAI,SAAS,eAAe,MAAM,wBAAwB,4BAA4B;AACtF,UAAI,qBAAqB,eAAe,QAAQ,sBAAsB,EAAE;AAExE,YAAM,aAAa,QAAQ,cAAc,IAAI,sBAAsB;AAEnE,UAAI,YAAY;AACd,cAAM,mBAAmB,WAAW;AAEpC,cAAM,SAAS,OAAO,iBAAiB,UAAU;AACjD,cAAM,wBAAwB,WAAW,OAAO,SAAS,IAAI,WAAW,OAAO,YAAY;AAE3F,iBAAS,SAAS,mBAAmB;AACrC,uBAAe,CAAC;AAAA,MAClB,OAAO;AAGL,iBAAS,SAAS;AAElB,uBAAe,kBAAkB;AAAA,MACnC;AAEA,UAAI,mBAAmB;AACvB,UAAI,WAAW;AACb,2BAAmB,UAAU,eAAe;AAAA,MAC9C;AACA,mBAAa,gBAAgB;AAG7B,iBAAW,MAAM;AAEjB,UAAI,aAAa;AACf,gCAAwB,UAAS,2CAAa,aAAY;AAAA,MAC5D;AAAA,IACF;AAAA,IACA,EAAE,MAAM,IAAG,SAAS,KAAK;AAAA,EAC3B;AAEA,8BAAU,MAAM;AAEd,eAAW;AAGX,UAAM,WAAW,IAAI,iBAAiB,UAAU;AAChD,QAAI,SAAS,SAAS;AACpB,eAAS,QAAQ,SAAS,SAAS,EAAE,WAAW,MAAM,SAAS,KAAK,CAAC;AAAA,IACvE;AACA,WAAO,MAAM,SAAS,WAAW;AAAA,EACnC,GAAG,CAAC,UAAU,iBAAiB,SAAS,CAAC;AAEzC,sCAAiB,UAAU,UAAU;AAErC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,15 +5,13 @@ export type OptionRenderCustom = {
|
|
|
5
5
|
icon?: React.ReactNode;
|
|
6
6
|
onClick?: () => void;
|
|
7
7
|
};
|
|
8
|
-
export type CreekTableProps<T extends ParamsType, U extends ParamsType, ValueType = 'text'> =
|
|
8
|
+
export type CreekTableProps<T extends ParamsType, U extends ParamsType, ValueType = 'text'> = ProTableProps<T, U, ValueType> & {
|
|
9
9
|
pageFixedBottom?: boolean;
|
|
10
10
|
pageFixedBottomConfig?: {
|
|
11
11
|
/** 底部保留空间(如固定在底部的元素高度),默认 0 */
|
|
12
12
|
bottomFix?: number;
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
autoAddFilterForColumn?: boolean;
|
|
14
|
+
showIndex?: boolean;
|
|
15
|
+
/** 是否可拖动列宽,默认 true */
|
|
16
|
+
resizable?: boolean;
|
|
19
17
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/creek-table/type.ts"],
|
|
4
|
-
"sourcesContent": ["import { ParamsType, ProTableProps } from '@ant-design/pro-components';\n\nexport type OptionRenderCustom = {\n text?: string;\n icon?: React.ReactNode;\n onClick?: () => void;\n};\n\nexport type CreekTableProps<T extends ParamsType, U extends ParamsType, ValueType = 'text'> =
|
|
4
|
+
"sourcesContent": ["import { ParamsType, ProTableProps } from '@ant-design/pro-components';\n\nexport type OptionRenderCustom = {\n text?: string;\n icon?: React.ReactNode;\n onClick?: () => void;\n};\n\nexport type CreekTableProps<T extends ParamsType, U extends ParamsType, ValueType = 'text'> = ProTableProps<T, U, ValueType> & {\n pageFixedBottom?: boolean; // 是否固定分页在底部\n pageFixedBottomConfig?: {\n /** 底部保留空间(如固定在底部的元素高度),默认 0 */\n bottomFix?: number;\n };\n // 是否显示序号列,默认 true\n showIndex?: boolean;\n /** 是否可拖动列宽,默认 true */\n resizable?: boolean;\n};\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export * from './creek-config-provider';
|
|
2
2
|
export * from './creek-hooks';
|
|
3
3
|
export * from './creek-icon';
|
|
4
|
+
export * from './creek-keep-alive';
|
|
4
5
|
export * from './creek-layout';
|
|
5
6
|
export * from './creek-loading';
|
|
7
|
+
export * from './creek-locale-button';
|
|
8
|
+
export * from './creek-page-container';
|
|
9
|
+
export * from './creek-style';
|
|
6
10
|
export * from './creek-table';
|
package/dist/index.js
CHANGED
|
@@ -19,16 +19,24 @@ module.exports = __toCommonJS(src_exports);
|
|
|
19
19
|
__reExport(src_exports, require("./creek-config-provider"), module.exports);
|
|
20
20
|
__reExport(src_exports, require("./creek-hooks"), module.exports);
|
|
21
21
|
__reExport(src_exports, require("./creek-icon"), module.exports);
|
|
22
|
+
__reExport(src_exports, require("./creek-keep-alive"), module.exports);
|
|
22
23
|
__reExport(src_exports, require("./creek-layout"), module.exports);
|
|
23
24
|
__reExport(src_exports, require("./creek-loading"), module.exports);
|
|
25
|
+
__reExport(src_exports, require("./creek-locale-button"), module.exports);
|
|
26
|
+
__reExport(src_exports, require("./creek-page-container"), module.exports);
|
|
27
|
+
__reExport(src_exports, require("./creek-style"), module.exports);
|
|
24
28
|
__reExport(src_exports, require("./creek-table"), module.exports);
|
|
25
29
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
30
|
0 && (module.exports = {
|
|
27
31
|
...require("./creek-config-provider"),
|
|
28
32
|
...require("./creek-hooks"),
|
|
29
33
|
...require("./creek-icon"),
|
|
34
|
+
...require("./creek-keep-alive"),
|
|
30
35
|
...require("./creek-layout"),
|
|
31
36
|
...require("./creek-loading"),
|
|
37
|
+
...require("./creek-locale-button"),
|
|
38
|
+
...require("./creek-page-container"),
|
|
39
|
+
...require("./creek-style"),
|
|
32
40
|
...require("./creek-table")
|
|
33
41
|
});
|
|
34
42
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["\nexport * from './creek-config-provider';\nexport * from './creek-hooks';\nexport * from './creek-icon';\nexport * from './creek-layout';\nexport * from './creek-loading';\nexport * from './creek-table';\n\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AACA,wBAAc,oCADd;AAEA,wBAAc,0BAFd;AAGA,wBAAc,yBAHd;AAIA,wBAAc
|
|
4
|
+
"sourcesContent": ["\nexport * from './creek-config-provider';\nexport * from './creek-hooks';\nexport * from './creek-icon';\nexport * from './creek-keep-alive';\nexport * from './creek-layout';\nexport * from './creek-loading';\nexport * from './creek-locale-button';\nexport * from './creek-page-container';\nexport * from './creek-style';\nexport * from './creek-table';\n\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AACA,wBAAc,oCADd;AAEA,wBAAc,0BAFd;AAGA,wBAAc,yBAHd;AAIA,wBAAc,+BAJd;AAKA,wBAAc,2BALd;AAMA,wBAAc,4BANd;AAOA,wBAAc,kCAPd;AAQA,wBAAc,mCARd;AASA,wBAAc,0BATd;AAUA,wBAAc,0BAVd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'creek-keep-alive.index.guanBiDangQian': string;
|
|
3
|
+
'creek-keep-alive.index.guanBiQiTa': string;
|
|
4
|
+
'creek-keep-alive.index.guanBiYouCe': string;
|
|
5
|
+
'creek-layout.ActionRender.FullScreen.tuiChuQuanPing': string;
|
|
6
|
+
'creek-layout.ActionRender.FullScreen.quanPing': string;
|
|
7
|
+
'creek-table.components.DensityIcon.kuanSong': string;
|
|
8
|
+
'creek-table.components.DensityIcon.zhongDeng': string;
|
|
9
|
+
'creek-table.components.DensityIcon.jinCou': string;
|
|
10
|
+
'creek-table.components.DensityIcon.biaoGeMiDu(KuanSong)': string;
|
|
11
|
+
'creek-table.components.DensityIcon.biaoGeMiDu(ZhongDeng)': string;
|
|
12
|
+
'creek-table.components.DensityIcon.biaoGeMiDu(JinCou)': string;
|
|
13
|
+
'creek-table.components.DensityIcon.biaoGeMiDu': string;
|
|
14
|
+
'creek-table.components.EllipsisTooltip.fuZhiChengGong': string;
|
|
15
|
+
'creek-table.components.EllipsisTooltip.fuZhiShiBai': string;
|
|
16
|
+
'creek-table.components.EllipsisTooltip.fuZhi': string;
|
|
17
|
+
'creek-table.hooks.useIndexColumn.xuHao': string;
|
|
18
|
+
'creek-layout.ActionRender.LayoutSettings.title': string;
|
|
19
|
+
'creek-layout.ActionRender.LayoutSettings.themeColor': string;
|
|
20
|
+
'creek-layout.ActionRender.LayoutSettings.showFullScreen': string;
|
|
21
|
+
'creek-layout.ActionRender.LayoutSettings.showLocaleButton': string;
|
|
22
|
+
'creek-locale-button.index.jianTiZhongWen': string;
|
|
23
|
+
'creek-layout.ActionRender.LayoutSettings.keepAlive': string;
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
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/locales/en-US.ts
|
|
20
|
+
var en_US_exports = {};
|
|
21
|
+
__export(en_US_exports, {
|
|
22
|
+
default: () => en_US_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(en_US_exports);
|
|
25
|
+
var en_US_default = {
|
|
26
|
+
"creek-keep-alive.index.guanBiDangQian": "Close Current",
|
|
27
|
+
"creek-keep-alive.index.guanBiQiTa": "Close Others",
|
|
28
|
+
"creek-keep-alive.index.guanBiYouCe": "Close Right",
|
|
29
|
+
"creek-layout.ActionRender.FullScreen.tuiChuQuanPing": "Exit Full Screen",
|
|
30
|
+
"creek-layout.ActionRender.FullScreen.quanPing": "Full Screen",
|
|
31
|
+
"creek-table.components.DensityIcon.kuanSong": "Loose",
|
|
32
|
+
"creek-table.components.DensityIcon.zhongDeng": "Medium",
|
|
33
|
+
"creek-table.components.DensityIcon.jinCou": "Compact",
|
|
34
|
+
"creek-table.components.DensityIcon.biaoGeMiDu(KuanSong)": "Table Density (Loose)",
|
|
35
|
+
"creek-table.components.DensityIcon.biaoGeMiDu(ZhongDeng)": "Table Density (Medium)",
|
|
36
|
+
"creek-table.components.DensityIcon.biaoGeMiDu(JinCou)": "Table Density (Compact)",
|
|
37
|
+
"creek-table.components.DensityIcon.biaoGeMiDu": "Table Density",
|
|
38
|
+
"creek-table.components.EllipsisTooltip.fuZhiChengGong": "Copied Successfully",
|
|
39
|
+
"creek-table.components.EllipsisTooltip.fuZhiShiBai": "Copy Failed",
|
|
40
|
+
"creek-table.components.EllipsisTooltip.fuZhi": "Copy",
|
|
41
|
+
"creek-table.hooks.useIndexColumn.xuHao": "No.",
|
|
42
|
+
"creek-layout.ActionRender.LayoutSettings.title": "System Settings",
|
|
43
|
+
"creek-layout.ActionRender.LayoutSettings.themeColor": "Theme Color",
|
|
44
|
+
"creek-layout.ActionRender.LayoutSettings.showFullScreen": "Show Full Screen Button",
|
|
45
|
+
"creek-layout.ActionRender.LayoutSettings.showLocaleButton": "Show Locale Button",
|
|
46
|
+
"creek-locale-button.index.jianTiZhongWen": "Simplified Chinese",
|
|
47
|
+
"creek-layout.ActionRender.LayoutSettings.keepAlive": "Enable Page Cache (Keep Alive)"
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=en-US.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/locales/en-US.ts"],
|
|
4
|
+
"sourcesContent": ["export default {\n 'creek-keep-alive.index.guanBiDangQian': 'Close Current',\n 'creek-keep-alive.index.guanBiQiTa': 'Close Others',\n 'creek-keep-alive.index.guanBiYouCe': 'Close Right',\n 'creek-layout.ActionRender.FullScreen.tuiChuQuanPing': 'Exit Full Screen',\n 'creek-layout.ActionRender.FullScreen.quanPing': 'Full Screen',\n 'creek-table.components.DensityIcon.kuanSong': 'Loose',\n 'creek-table.components.DensityIcon.zhongDeng': 'Medium',\n 'creek-table.components.DensityIcon.jinCou': 'Compact',\n 'creek-table.components.DensityIcon.biaoGeMiDu(KuanSong)': 'Table Density (Loose)',\n 'creek-table.components.DensityIcon.biaoGeMiDu(ZhongDeng)': 'Table Density (Medium)',\n 'creek-table.components.DensityIcon.biaoGeMiDu(JinCou)': 'Table Density (Compact)',\n 'creek-table.components.DensityIcon.biaoGeMiDu': 'Table Density',\n 'creek-table.components.EllipsisTooltip.fuZhiChengGong': 'Copied Successfully',\n 'creek-table.components.EllipsisTooltip.fuZhiShiBai': 'Copy Failed',\n 'creek-table.components.EllipsisTooltip.fuZhi': 'Copy',\n 'creek-table.hooks.useIndexColumn.xuHao': 'No.',\n 'creek-layout.ActionRender.LayoutSettings.title': 'System Settings',\n 'creek-layout.ActionRender.LayoutSettings.themeColor': 'Theme Color',\n 'creek-layout.ActionRender.LayoutSettings.showFullScreen': 'Show Full Screen Button',\n 'creek-layout.ActionRender.LayoutSettings.showLocaleButton': 'Show Locale Button',\n 'creek-locale-button.index.jianTiZhongWen': 'Simplified Chinese',\n 'creek-layout.ActionRender.LayoutSettings.keepAlive': 'Enable Page Cache (Keep Alive)',\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,gBAAQ;AAAA,EACb,yCAAyC;AAAA,EACzC,qCAAqC;AAAA,EACrC,sCAAsC;AAAA,EACtC,uDAAuD;AAAA,EACvD,iDAAiD;AAAA,EACjD,+CAA+C;AAAA,EAC/C,gDAAgD;AAAA,EAChD,6CAA6C;AAAA,EAC7C,2DAA2D;AAAA,EAC3D,4DAA4D;AAAA,EAC5D,yDAAyD;AAAA,EACzD,iDAAiD;AAAA,EACjD,yDAAyD;AAAA,EACzD,sDAAsD;AAAA,EACtD,gDAAgD;AAAA,EAChD,0CAA0C;AAAA,EAC1C,kDAAkD;AAAA,EAClD,uDAAuD;AAAA,EACvD,2DAA2D;AAAA,EAC3D,6DAA6D;AAAA,EAC7D,4CAA4C;AAAA,EAC5C,sDAAsD;AACxD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"creek-keep-alive.index.guanBiDangQian": string;
|
|
3
|
+
"creek-keep-alive.index.guanBiQiTa": string;
|
|
4
|
+
"creek-keep-alive.index.guanBiYouCe": string;
|
|
5
|
+
"creek-layout.ActionRender.FullScreen.tuiChuQuanPing": string;
|
|
6
|
+
"creek-layout.ActionRender.FullScreen.quanPing": string;
|
|
7
|
+
"creek-table.components.DensityIcon.kuanSong": string;
|
|
8
|
+
"creek-table.components.DensityIcon.zhongDeng": string;
|
|
9
|
+
"creek-table.components.DensityIcon.jinCou": string;
|
|
10
|
+
"creek-table.components.DensityIcon.biaoGeMiDu(KuanSong)": string;
|
|
11
|
+
"creek-table.components.DensityIcon.biaoGeMiDu(ZhongDeng)": string;
|
|
12
|
+
"creek-table.components.DensityIcon.biaoGeMiDu(JinCou)": string;
|
|
13
|
+
"creek-table.components.DensityIcon.biaoGeMiDu": string;
|
|
14
|
+
"creek-table.components.EllipsisTooltip.fuZhiChengGong": string;
|
|
15
|
+
"creek-table.components.EllipsisTooltip.fuZhiShiBai": string;
|
|
16
|
+
"creek-table.components.EllipsisTooltip.fuZhi": string;
|
|
17
|
+
"creek-table.hooks.useIndexColumn.xuHao": string;
|
|
18
|
+
"creek-layout.ActionRender.LayoutSettings.title": string;
|
|
19
|
+
"creek-layout.ActionRender.LayoutSettings.themeColor": string;
|
|
20
|
+
"creek-layout.ActionRender.LayoutSettings.showFullScreen": string;
|
|
21
|
+
"creek-layout.ActionRender.LayoutSettings.showLocaleButton": string;
|
|
22
|
+
"creek-locale-button.index.jianTiZhongWen": string;
|
|
23
|
+
"creek-layout.ActionRender.LayoutSettings.keepAlive": string;
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
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/locales/zh-CN.ts
|
|
20
|
+
var zh_CN_exports = {};
|
|
21
|
+
__export(zh_CN_exports, {
|
|
22
|
+
default: () => zh_CN_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(zh_CN_exports);
|
|
25
|
+
var zh_CN_default = {
|
|
26
|
+
"creek-keep-alive.index.guanBiDangQian": "关闭当前",
|
|
27
|
+
"creek-keep-alive.index.guanBiQiTa": "关闭其他",
|
|
28
|
+
"creek-keep-alive.index.guanBiYouCe": "关闭右侧",
|
|
29
|
+
"creek-layout.ActionRender.FullScreen.tuiChuQuanPing": "退出全屏",
|
|
30
|
+
"creek-layout.ActionRender.FullScreen.quanPing": "全屏",
|
|
31
|
+
"creek-table.components.DensityIcon.kuanSong": "宽松",
|
|
32
|
+
"creek-table.components.DensityIcon.zhongDeng": "中等",
|
|
33
|
+
"creek-table.components.DensityIcon.jinCou": "紧凑",
|
|
34
|
+
"creek-table.components.DensityIcon.biaoGeMiDu(KuanSong)": "表格密度 (宽松)",
|
|
35
|
+
"creek-table.components.DensityIcon.biaoGeMiDu(ZhongDeng)": "表格密度 (中等)",
|
|
36
|
+
"creek-table.components.DensityIcon.biaoGeMiDu(JinCou)": "表格密度 (紧凑)",
|
|
37
|
+
"creek-table.components.DensityIcon.biaoGeMiDu": "表格密度",
|
|
38
|
+
"creek-table.components.EllipsisTooltip.fuZhiChengGong": "复制成功",
|
|
39
|
+
"creek-table.components.EllipsisTooltip.fuZhiShiBai": "复制失败",
|
|
40
|
+
"creek-table.components.EllipsisTooltip.fuZhi": "复制",
|
|
41
|
+
"creek-table.hooks.useIndexColumn.xuHao": "序号",
|
|
42
|
+
"creek-layout.ActionRender.LayoutSettings.title": "系统设置",
|
|
43
|
+
"creek-layout.ActionRender.LayoutSettings.themeColor": "主题色",
|
|
44
|
+
"creek-layout.ActionRender.LayoutSettings.showFullScreen": "展示全屏按钮",
|
|
45
|
+
"creek-layout.ActionRender.LayoutSettings.showLocaleButton": "展示国际化按钮",
|
|
46
|
+
"creek-locale-button.index.jianTiZhongWen": "简体中文",
|
|
47
|
+
"creek-layout.ActionRender.LayoutSettings.keepAlive": "开启页面缓存 (Keep Alive)"
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=zh-CN.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/locales/zh-CN.ts"],
|
|
4
|
+
"sourcesContent": ["export default {\n \"creek-keep-alive.index.guanBiDangQian\": \"关闭当前\",\n \"creek-keep-alive.index.guanBiQiTa\": \"关闭其他\",\n \"creek-keep-alive.index.guanBiYouCe\": \"关闭右侧\",\n \"creek-layout.ActionRender.FullScreen.tuiChuQuanPing\": \"退出全屏\",\n \"creek-layout.ActionRender.FullScreen.quanPing\": \"全屏\",\n \"creek-table.components.DensityIcon.kuanSong\": \"宽松\",\n \"creek-table.components.DensityIcon.zhongDeng\": \"中等\",\n \"creek-table.components.DensityIcon.jinCou\": \"紧凑\",\n \"creek-table.components.DensityIcon.biaoGeMiDu(KuanSong)\": \"表格密度 (宽松)\",\n \"creek-table.components.DensityIcon.biaoGeMiDu(ZhongDeng)\": \"表格密度 (中等)\",\n \"creek-table.components.DensityIcon.biaoGeMiDu(JinCou)\": \"表格密度 (紧凑)\",\n \"creek-table.components.DensityIcon.biaoGeMiDu\": \"表格密度\",\n \"creek-table.components.EllipsisTooltip.fuZhiChengGong\": \"复制成功\",\n \"creek-table.components.EllipsisTooltip.fuZhiShiBai\": \"复制失败\",\n \"creek-table.components.EllipsisTooltip.fuZhi\": \"复制\",\n \"creek-table.hooks.useIndexColumn.xuHao\": \"序号\",\n \"creek-layout.ActionRender.LayoutSettings.title\": \"系统设置\",\n \"creek-layout.ActionRender.LayoutSettings.themeColor\": \"主题色\",\n \"creek-layout.ActionRender.LayoutSettings.showFullScreen\": \"展示全屏按钮\",\n \"creek-layout.ActionRender.LayoutSettings.showLocaleButton\": \"展示国际化按钮\",\n \"creek-locale-button.index.jianTiZhongWen\": \"简体中文\",\n \"creek-layout.ActionRender.LayoutSettings.keepAlive\": \"开启页面缓存 (Keep Alive)\"\n};"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAO,gBAAQ;AAAA,EACb,yCAAyC;AAAA,EACzC,qCAAqC;AAAA,EACrC,sCAAsC;AAAA,EACtC,uDAAuD;AAAA,EACvD,iDAAiD;AAAA,EACjD,+CAA+C;AAAA,EAC/C,gDAAgD;AAAA,EAChD,6CAA6C;AAAA,EAC7C,2DAA2D;AAAA,EAC3D,4DAA4D;AAAA,EAC5D,yDAAyD;AAAA,EACzD,iDAAiD;AAAA,EACjD,yDAAyD;AAAA,EACzD,sDAAsD;AAAA,EACtD,gDAAgD;AAAA,EAChD,0CAA0C;AAAA,EAC1C,kDAAkD;AAAA,EAClD,uDAAuD;AAAA,EACvD,2DAA2D;AAAA,EAC3D,6DAA6D;AAAA,EAC7D,4CAA4C;AAAA,EAC5C,sDAAsD;AACxD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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/utils/i18n.ts
|
|
20
|
+
var i18n_exports = {};
|
|
21
|
+
__export(i18n_exports, {
|
|
22
|
+
setLocaleMessages: () => import_react.setLocaleMessages,
|
|
23
|
+
t: () => import_react.t,
|
|
24
|
+
useT: () => import_react.useT
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(i18n_exports);
|
|
27
|
+
var import_react = require("@creekjs/i18n/react");
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
setLocaleMessages,
|
|
31
|
+
t,
|
|
32
|
+
useT
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=i18n.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/i18n.ts"],
|
|
4
|
+
"sourcesContent": ["import { setLocaleMessages, t, useT } from '@creekjs/i18n/react';\n\nexport { setLocaleMessages, t, useT };\n\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/i18n.config.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
// 语言文件类型 (ts/js/json)
|
|
3
|
+
localeFileType: 'ts',
|
|
4
|
+
|
|
5
|
+
// 语言包输出的主入口文件路径
|
|
6
|
+
// 注意:实际生成的翻译文件会存放在该文件同级目录下以文件名命名的文件夹中
|
|
7
|
+
// 例如:src/locales/zh-CN.ts -> 生成的文件在 src/locales/zh-CN/ 目录下
|
|
8
|
+
localePath: './src/locales/zh-CN.ts',
|
|
9
|
+
|
|
10
|
+
// 要扫描的文件路径 (Glob)
|
|
11
|
+
path: 'src/**/*.{ts,tsx,js,jsx}',
|
|
12
|
+
|
|
13
|
+
// 排除的文件/目录
|
|
14
|
+
exclude: ['**/node_modules/**', '**/dist/**', '**/.umi/**', '**/locales/**', '**/utils/i18n.ts'],
|
|
15
|
+
|
|
16
|
+
// 国际化函数名称 (默认为 't')
|
|
17
|
+
tFunction: 't',
|
|
18
|
+
|
|
19
|
+
// 国际化函数的导入语句
|
|
20
|
+
importStatement: 'import { t } from "@/utils/i18n"',
|
|
21
|
+
|
|
22
|
+
// 是否使用目录结构作为命名空间 (默认为 true)
|
|
23
|
+
useDirectoryAsNamespace: false,
|
|
24
|
+
|
|
25
|
+
// 开启 React Hooks 模式 (useT)
|
|
26
|
+
useT: true,
|
|
27
|
+
};
|