@creekjs/web-components 1.0.6 → 1.0.8
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 +26 -26
- package/README.md +26 -54
- package/dist/creek-layout/index.d.ts.map +1 -1
- package/dist/creek-layout/index.js +19 -15
- package/dist/creek-layout/index.js.map +2 -2
- package/dist/creek-layout/useLayoutSettingsStore.js +3 -3
- package/dist/creek-layout/useLayoutSettingsStore.js.map +1 -1
- package/package.json +11 -11
- package/src/creek-layout/index.tsx +20 -12
- package/src/creek-layout/useLayoutSettingsStore.ts +3 -3
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @creekjs/web-components@1.0.
|
|
3
|
+
> @creekjs/web-components@1.0.7 father:build /Users/ernestwang/Documents/code-resoorce/creek/packages/web-components
|
|
4
4
|
> father build
|
|
5
5
|
|
|
6
6
|
[36minfo[39m - Clean output directories
|
|
7
7
|
[36minfo[39m - Bundless for [33msrc[39m directory to [33mcjs[39m format
|
|
8
8
|
[35mevent[39m - Bundless [90mCreekConfigContext.tsx[39m to [90mdist/creek-config-provider/CreekConfigContext.js[39m (with declaration)
|
|
9
|
-
[35mevent[39m - Bundless [90mModalHelper.tsx[39m to [90mdist/creek-hooks/useApp/ModalHelper.js[39m (with declaration)
|
|
10
9
|
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-config-provider/index.js[39m (with declaration)
|
|
10
|
+
[35mevent[39m - Bundless [90mCreekI18nProvider.tsx[39m to [90mdist/creek-config-provider/CreekI18nProvider.js[39m (with declaration)
|
|
11
11
|
[35mevent[39m - Bundless [90mindex.ts[39m to [90mdist/creek-hooks/index.js[39m (with declaration)
|
|
12
|
+
[35mevent[39m - Bundless [90mModalHelper.tsx[39m to [90mdist/creek-hooks/useApp/ModalHelper.js[39m (with declaration)
|
|
13
|
+
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-hooks/useApp/index.js[39m (with declaration)
|
|
14
|
+
[35mevent[39m - Bundless [90museViewportHeight.tsx[39m to [90mdist/creek-hooks/useViewportHeight.js[39m (with declaration)
|
|
12
15
|
[35mevent[39m - Bundless [90mtypes.ts[39m to [90mdist/creek-hooks/useApp/types.js[39m (with declaration)
|
|
13
|
-
[35mevent[39m - Bundless [90mDrawerHelper.tsx[39m to [90mdist/creek-hooks/useApp/DrawerHelper.js[39m (with declaration)
|
|
14
|
-
[35mevent[39m - Bundless [90mCreekI18nProvider.tsx[39m to [90mdist/creek-config-provider/CreekI18nProvider.js[39m (with declaration)
|
|
15
16
|
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-keep-alive/index.js[39m (with declaration)
|
|
16
|
-
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-hooks/useApp/index.js[39m (with declaration)
|
|
17
17
|
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-icon/index.js[39m (with declaration)
|
|
18
|
+
[35mevent[39m - Bundless [90mDrawerHelper.tsx[39m to [90mdist/creek-hooks/useApp/DrawerHelper.js[39m (with declaration)
|
|
19
|
+
[35mevent[39m - Bundless [90mFullScreen.tsx[39m to [90mdist/creek-layout/ActionRender/FullScreen.js[39m (with declaration)
|
|
20
|
+
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-layout/ActionRender/index.js[39m (with declaration)
|
|
18
21
|
[35mevent[39m - Bundless [90mUserInfo.tsx[39m to [90mdist/creek-layout/ActionRender/UserInfo.js[39m (with declaration)
|
|
19
|
-
[35mevent[39m - Bundless [90museViewportHeight.tsx[39m to [90mdist/creek-hooks/useViewportHeight.js[39m (with declaration)
|
|
20
|
-
[35mevent[39m - Bundless [90mNotFound.tsx[39m to [90mdist/creek-layout/Exception/NotFound.js[39m (with declaration)
|
|
21
22
|
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-layout/Exception/index.js[39m (with declaration)
|
|
22
|
-
[35mevent[39m - Bundless [
|
|
23
|
-
[35mevent[39m - Bundless [90mFullScreen.tsx[39m to [90mdist/creek-layout/ActionRender/FullScreen.js[39m (with declaration)
|
|
24
|
-
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-layout/index.js[39m (with declaration)
|
|
25
|
-
[35mevent[39m - Bundless [90museLayoutSettingsStore.ts[39m to [90mdist/creek-layout/useLayoutSettingsStore.js[39m (with declaration)
|
|
23
|
+
[35mevent[39m - Bundless [90mNotFound.tsx[39m to [90mdist/creek-layout/Exception/NotFound.js[39m (with declaration)
|
|
26
24
|
[35mevent[39m - Bundless [90mLayoutSettings.tsx[39m to [90mdist/creek-layout/ActionRender/LayoutSettings.js[39m (with declaration)
|
|
27
25
|
[35mevent[39m - Bundless [90mCollapseButton.tsx[39m to [90mdist/creek-layout/CollapseButton.js[39m (with declaration)
|
|
28
|
-
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-page-container/index.js[39m (with declaration)
|
|
29
|
-
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-locale-button/index.js[39m (with declaration)
|
|
30
26
|
[35mevent[39m - Bundless [90mindex.ts[39m to [90mdist/creek-style/index.js[39m (with declaration)
|
|
27
|
+
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-locale-button/index.js[39m (with declaration)
|
|
28
|
+
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-page-container/index.js[39m (with declaration)
|
|
31
29
|
[35mevent[39m - Bundless [90mscrollbar.ts[39m to [90mdist/creek-style/scrollbar.js[39m (with declaration)
|
|
32
|
-
[35mevent[39m - Bundless [
|
|
33
|
-
[35mevent[39m - Bundless [
|
|
30
|
+
[35mevent[39m - Bundless [90museLayoutSettingsStore.ts[39m to [90mdist/creek-layout/useLayoutSettingsStore.js[39m (with declaration)
|
|
31
|
+
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-loading/index.js[39m (with declaration)
|
|
34
32
|
[35mevent[39m - Bundless [90mDensityIcon.tsx[39m to [90mdist/creek-table/components/DensityIcon.js[39m (with declaration)
|
|
33
|
+
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-layout/index.js[39m (with declaration)
|
|
35
34
|
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-table/components/index.js[39m (with declaration)
|
|
36
|
-
[35mevent[39m - Bundless [
|
|
35
|
+
[35mevent[39m - Bundless [90mEllipsisTooltip.tsx[39m to [90mdist/creek-table/components/EllipsisTooltip.js[39m (with declaration)
|
|
36
|
+
[35mevent[39m - Bundless [90mNotFoundPage.tsx[39m to [90mdist/creek-layout/Exception/NotFoundPage.js[39m (with declaration)
|
|
37
37
|
[35mevent[39m - Bundless [90mindex.ts[39m to [90mdist/creek-table/hooks/index.js[39m (with declaration)
|
|
38
|
+
[35mevent[39m - Bundless [90museAdaptiveToolBar.tsx[39m to [90mdist/creek-table/hooks/useAdaptiveToolBar.js[39m (with declaration)
|
|
38
39
|
[35mevent[39m - Bundless [90museEllipsisColumns.tsx[39m to [90mdist/creek-table/hooks/useEllipsisColumns.js[39m (with declaration)
|
|
39
|
-
[35mevent[39m - Bundless [90museElementDistance.tsx[39m to [90mdist/creek-table/hooks/useElementDistance.js[39m (with declaration)
|
|
40
|
-
[35mevent[39m - Bundless [90museAutoWidthColumns.tsx[39m to [90mdist/creek-table/hooks/useAutoWidthColumns.js[39m (with declaration)
|
|
41
40
|
[35mevent[39m - Bundless [90museResizableColumns.tsx[39m to [90mdist/creek-table/hooks/useResizableColumns.js[39m (with declaration)
|
|
41
|
+
[35mevent[39m - Bundless [90museAutoWidthColumns.tsx[39m to [90mdist/creek-table/hooks/useAutoWidthColumns.js[39m (with declaration)
|
|
42
|
+
[35mevent[39m - Bundless [90museTableOptions.tsx[39m to [90mdist/creek-table/hooks/useTableOptions.js[39m (with declaration)
|
|
42
43
|
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-table/index.js[39m (with declaration)
|
|
43
|
-
[35mevent[39m - Bundless [
|
|
44
|
+
[35mevent[39m - Bundless [90museIndexColumn.tsx[39m to [90mdist/creek-table/hooks/useIndexColumn.js[39m (with declaration)
|
|
44
45
|
[35mevent[39m - Bundless [90museTableScrollHeight.tsx[39m to [90mdist/creek-table/hooks/useTableScrollHeight.js[39m (with declaration)
|
|
46
|
+
[35mevent[39m - Bundless [90museElementDistance.tsx[39m to [90mdist/creek-table/hooks/useElementDistance.js[39m (with declaration)
|
|
47
|
+
[35mevent[39m - Bundless [90museStatusColumns.tsx[39m to [90mdist/creek-table/hooks/useStatusColumns.js[39m (with declaration)
|
|
45
48
|
[35mevent[39m - Bundless [90mtype.ts[39m to [90mdist/creek-table/type.js[39m (with declaration)
|
|
46
|
-
[35mevent[39m - Bundless [90mSearchTable.tsx[39m to [90mdist/creek-table/SearchTable.js[39m (with declaration)
|
|
47
49
|
[35mevent[39m - Bundless [90mzh-CN.ts[39m to [90mdist/locales/zh-CN.js[39m (with declaration)
|
|
48
|
-
[35mevent[39m - Bundless [90museTableOptions.tsx[39m to [90mdist/creek-table/hooks/useTableOptions.js[39m (with declaration)
|
|
49
|
-
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-layout/ActionRender/index.js[39m (with declaration)
|
|
50
|
-
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/creek-loading/index.js[39m (with declaration)
|
|
51
|
-
[35mevent[39m - Bundless [90mi18n.ts[39m to [90mdist/utils/i18n.js[39m (with declaration)
|
|
52
|
-
[35mevent[39m - Bundless [90men-US.ts[39m to [90mdist/locales/en-US.js[39m (with declaration)
|
|
53
50
|
[35mevent[39m - Bundless [90mindex.tsx[39m to [90mdist/index.js[39m (with declaration)
|
|
51
|
+
[35mevent[39m - Bundless [90mSearchTable.tsx[39m to [90mdist/creek-table/SearchTable.js[39m (with declaration)
|
|
52
|
+
[35mevent[39m - Bundless [90men-US.ts[39m to [90mdist/locales/en-US.js[39m (with declaration)
|
|
53
|
+
[35mevent[39m - Bundless [90mi18n.ts[39m to [90mdist/utils/i18n.js[39m (with declaration)
|
|
54
54
|
[35mevent[39m - Generate declaration files...
|
|
55
|
-
[35mevent[39m - Transformed successfully in
|
|
55
|
+
[35mevent[39m - Transformed successfully in 8670 ms (46 files)
|
package/README.md
CHANGED
|
@@ -43,6 +43,19 @@ function App() {
|
|
|
43
43
|
}
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
**新增 API 属性**:
|
|
47
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
48
|
+
| --- | --- | --- | --- |
|
|
49
|
+
| `runtimeConfig` | 运行时布局配置 | `ProLayoutProps` | 必填 |
|
|
50
|
+
| `userConfig` | 用户自定义布局配置 | `ProLayoutProps` | - |
|
|
51
|
+
| `navigate` | 路由跳转方法 | `(path?: string \| number) => void` | - |
|
|
52
|
+
| `showFullScreen` | 是否展示顶部全屏切换按钮 | `boolean` | `false` |
|
|
53
|
+
| `showLocaleButton` | 是否展示顶部国际化切换按钮 | `boolean` | `true` |
|
|
54
|
+
| `showSettingsButton` | 是否展示顶部系统设置按钮 | `boolean` | `true` |
|
|
55
|
+
| `keepAlive` | 是否开启多标签页缓存能力 | `boolean \| CreekKeepAliveProps` | `true` |
|
|
56
|
+
| `initialInfo` | 初始化信息 (如 Umi 的 initialState) | `{ initialState: any; loading: boolean; setInitialState: () => void }` | - |
|
|
57
|
+
| `extraActions` | 顶部右侧额外注入的操作区域节点 | `React.ReactNode[]` | `[]` |
|
|
58
|
+
|
|
46
59
|
**特性**:
|
|
47
60
|
- 响应式布局 & 侧边栏折叠
|
|
48
61
|
- 面包屑导航与页面保活 (`CreekKeepAlive`)
|
|
@@ -61,61 +74,13 @@ import { BgCenter } from '@creekjs/web-components';
|
|
|
61
74
|
</BgCenter>
|
|
62
75
|
```
|
|
63
76
|
|
|
64
|
-
### 🔍 搜索组件
|
|
65
|
-
|
|
66
|
-
#### CreekSearch
|
|
67
|
-
高级搜索组件,支持多种搜索条件和筛选器。
|
|
68
|
-
|
|
69
|
-
```tsx
|
|
70
|
-
import { CreekSearch } from '@creekjs/web-components';
|
|
71
|
-
|
|
72
|
-
const searchConfig = {
|
|
73
|
-
fields: [
|
|
74
|
-
{
|
|
75
|
-
name: 'keyword',
|
|
76
|
-
label: '关键词',
|
|
77
|
-
type: 'input'
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: 'status',
|
|
81
|
-
label: '状态',
|
|
82
|
-
type: 'select',
|
|
83
|
-
options: [
|
|
84
|
-
{ label: '启用', value: 'active' },
|
|
85
|
-
{ label: '禁用', value: 'inactive' }
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
]
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
function SearchDemo() {
|
|
92
|
-
const handleSearch = (values) => {
|
|
93
|
-
console.log('搜索条件:', values);
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<CreekSearch
|
|
98
|
-
config={searchConfig}
|
|
99
|
-
onSearch={handleSearch}
|
|
100
|
-
/>
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
**特性**:
|
|
106
|
-
- 多种搜索字段类型
|
|
107
|
-
- 搜索条件显示
|
|
108
|
-
- 值选择器
|
|
109
|
-
- 搜索输入框
|
|
110
|
-
- 筛选器显示
|
|
111
|
-
|
|
112
77
|
### 📊 表格组件
|
|
113
78
|
|
|
114
|
-
####
|
|
79
|
+
#### CreekTable
|
|
115
80
|
基于 Ant Design ProTable 的增强型业务表格组件。它在 `ProTable` 的基础上解决了高度计算、列宽自适应、表头溢出、列宽拖拽等常见痛点,真正做到开箱即用。
|
|
116
81
|
|
|
117
82
|
```tsx
|
|
118
|
-
import {
|
|
83
|
+
import { CreekTable } from '@creekjs/web-components';
|
|
119
84
|
|
|
120
85
|
const columns = [
|
|
121
86
|
{
|
|
@@ -142,7 +107,7 @@ const columns = [
|
|
|
142
107
|
|
|
143
108
|
function TableDemo() {
|
|
144
109
|
return (
|
|
145
|
-
<
|
|
110
|
+
<CreekTable
|
|
146
111
|
columns={columns}
|
|
147
112
|
request={async (params) => {
|
|
148
113
|
// 请求数据
|
|
@@ -163,6 +128,15 @@ function TableDemo() {
|
|
|
163
128
|
}
|
|
164
129
|
```
|
|
165
130
|
|
|
131
|
+
**新增 API 属性**:
|
|
132
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
133
|
+
| --- | --- | --- | --- |
|
|
134
|
+
| `pageFixedBottom` | 是否自动计算高度并将分页器固定在底部 | `boolean` | `true` |
|
|
135
|
+
| `pageFixedBottomConfig` | 固定在底部时的细粒度配置(如额外保留底部空间) | `{ bottomFix?: number }` | - |
|
|
136
|
+
| `showIndex` | 是否自动生成全局连续的序号列 | `boolean` | `true` |
|
|
137
|
+
| `resizable` | 是否支持拖拽调整列宽(需在 column 配置 width) | `boolean` | `true` |
|
|
138
|
+
| `scrollbarColumn` | 是否自动追加一个滚动条占位列,防止滚动条遮挡内容 | `boolean \| number` | `true` (宽度 17px) |
|
|
139
|
+
|
|
166
140
|
**增强特性**:
|
|
167
141
|
- **自动高度计算 (`useTableScrollHeight`)**:根据页面剩余空间自动计算表格内容区域高度 (`scroll.y`),确保分页器固定在底部 (`pageFixedBottom: true`),页面不会出现双滚动条。
|
|
168
142
|
- **自动列宽计算 (`useAutoWidthColumns`)**:智能测量并分配操作列或动态内容列的宽度,防止内容被截断或挤压。
|
|
@@ -368,6 +342,4 @@ pnpm run father:build
|
|
|
368
342
|
2. **文件结构**:每个组件一个文件夹
|
|
369
343
|
3. **类型定义**:使用 TypeScript 严格模式
|
|
370
344
|
4. **样式方案**:使用 `antd-style`
|
|
371
|
-
5. **状态管理**:使用 `zustand`
|
|
372
|
-
|
|
373
|
-
### 组件结构示例
|
|
345
|
+
5. **状态管理**:使用 `zustand`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/creek-layout/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,cAAc,EAAE,MAAM,4BAA4B,CAAC;AASvE,OAAO,EAAkB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAQ1E,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG;IACzC,aAAa,EAAE,cAAc,CAAC;IAC9B,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE;QACZ,YAAY,EAAE,GAAG,CAAC;QAClB,OAAO,EAAE,OAAO,CAAC;QACjB,eAAe,EAAE,MAAM,IAAI,CAAC;KAC7B,CAAC;IACF,SAAS,CAAC,EAAE,OAAO,GAAG,mBAAmB,CAAC;IAC1C,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;CAClC,CAAC;AAQF,eAAO,MAAM,WAAW,UAAW,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/creek-layout/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,cAAc,EAAE,MAAM,4BAA4B,CAAC;AASvE,OAAO,EAAkB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAQ1E,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG;IACzC,aAAa,EAAE,cAAc,CAAC;IAC9B,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE;QACZ,YAAY,EAAE,GAAG,CAAC;QAClB,OAAO,EAAE,OAAO,CAAC;QACjB,eAAe,EAAE,MAAM,IAAI,CAAC;KAC7B,CAAC;IACF,SAAS,CAAC,EAAE,OAAO,GAAG,mBAAmB,CAAC;IAC1C,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;CAClC,CAAC;AAQF,eAAO,MAAM,WAAW,UAAW,WAAW,4CAqI7C,CAAC;AAEF,cAAc,aAAa,CAAC"}
|
|
@@ -54,15 +54,29 @@ var MenuName = ({ name, path }) => {
|
|
|
54
54
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: t(key, name) });
|
|
55
55
|
};
|
|
56
56
|
var CreekLayout = (props) => {
|
|
57
|
-
const {
|
|
57
|
+
const {
|
|
58
|
+
route,
|
|
59
|
+
userConfig,
|
|
60
|
+
runtimeConfig,
|
|
61
|
+
children,
|
|
62
|
+
location,
|
|
63
|
+
navigate,
|
|
64
|
+
showFullScreen = false,
|
|
65
|
+
showLocaleButton = false,
|
|
66
|
+
showSettingsButton = false,
|
|
67
|
+
keepAlive = false,
|
|
68
|
+
extraActions = [],
|
|
69
|
+
...more
|
|
70
|
+
} = props;
|
|
58
71
|
const { useToken } = import_antd.theme;
|
|
59
72
|
const { token } = useToken();
|
|
60
73
|
const { collapsed } = (0, import_CollapseButton.useCollapsedStore)();
|
|
61
74
|
const settingsStore = (0, import_useLayoutSettingsStore.useLayoutSettingsStore)();
|
|
62
|
-
const actualShowFullScreen = settingsStore.showFullScreen ?? showFullScreen
|
|
63
|
-
const actualShowLocaleButton = settingsStore.showLocaleButton ?? showLocaleButton
|
|
75
|
+
const actualShowFullScreen = settingsStore.showFullScreen ?? showFullScreen;
|
|
76
|
+
const actualShowLocaleButton = settingsStore.showLocaleButton ?? showLocaleButton;
|
|
64
77
|
const colorPrimary = settingsStore.colorPrimary || token.colorPrimary;
|
|
65
|
-
const actualKeepAlive = settingsStore.keepAlive ?? keepAlive
|
|
78
|
+
const actualKeepAlive = settingsStore.keepAlive ?? keepAlive;
|
|
79
|
+
console.log(actualKeepAlive, "actualKeepAlive");
|
|
66
80
|
const menuDataRender = (0, import_ahooks.useMemoizedFn)((menuData) => {
|
|
67
81
|
const mapMenu = (items) => {
|
|
68
82
|
return items.map((item) => {
|
|
@@ -111,17 +125,7 @@ var CreekLayout = (props) => {
|
|
|
111
125
|
actions.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_creek_locale_button.CreekLocaleButton, {}, "locale-button"));
|
|
112
126
|
}
|
|
113
127
|
if (showSettingsButton) {
|
|
114
|
-
actions.push(
|
|
115
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
116
|
-
import_ActionRender.LayoutSettings,
|
|
117
|
-
{
|
|
118
|
-
defaultShowFullScreen: showFullScreen,
|
|
119
|
-
defaultShowLocaleButton: showLocaleButton,
|
|
120
|
-
defaultKeepAlive: import_lodash.default.isBoolean(keepAlive) ? keepAlive : true
|
|
121
|
-
},
|
|
122
|
-
"settings"
|
|
123
|
-
)
|
|
124
|
-
);
|
|
128
|
+
actions.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ActionRender.LayoutSettings, { defaultShowFullScreen: showFullScreen, defaultShowLocaleButton: showLocaleButton, defaultKeepAlive: import_lodash.default.isBoolean(keepAlive) ? keepAlive : true }, "settings"));
|
|
125
129
|
}
|
|
126
130
|
const keepAliveProps = import_lodash.default.isBoolean(keepAlive) ? {} : keepAlive;
|
|
127
131
|
const _userConfig = { ...userConfig, ...runtimeConfig };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/creek-layout/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { ProLayout, ProLayoutProps } from '@ant-design/pro-components';\nimport { useMemoizedFn } from 'ahooks';\nimport { theme } from 'antd';\nimport _ from 'lodash';\n\nimport classnames from 'classnames';\n\nimport { useT } from '@creekjs/i18n/react';\n\nimport { CreekKeepAlive, CreekKeepAliveProps } from '../creek-keep-alive';\nimport { CreekLocaleButton } from '../creek-locale-button';\nimport { GlobalScrollbarStyle } from '../creek-style/scrollbar';\nimport { FullScreen, LayoutSettings } from './ActionRender';\nimport { CollapsedButton, useCollapsedStore } from './CollapseButton';\nimport { Exception } from './Exception';\nimport { useLayoutSettingsStore } from './useLayoutSettingsStore';\n\nexport type LayoutProps = ProLayoutProps & {\n runtimeConfig: ProLayoutProps;\n userConfig?: ProLayoutProps;\n navigate?: (path?: string | number) => void;\n showFullScreen?: boolean;\n showLocaleButton?: boolean;\n showSettingsButton?: boolean;\n initialInfo?: {\n initialState: any;\n loading: boolean;\n setInitialState: () => void;\n };\n keepAlive?: boolean | CreekKeepAliveProps;\n extraActions?: React.ReactNode[];\n};\n\nconst MenuName = ({ name, path }: { name: string; path?: string }) => {\n const t = useT();\n const key = !path || path === '/' ? 'menu.home' : `menu${path.replace(/\\//g, '.')}`;\n return <>{t(key, name)}</>;\n};\n\nexport const CreekLayout = (props: LayoutProps) => {\n const {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAA0C;AAC1C,oBAA8B;AAC9B,kBAAsB;AACtB,oBAAc;AAEd,wBAAuB;AAEvB,mBAAqB;AAErB,8BAAoD;AACpD,iCAAkC;AAClC,uBAAqC;AACrC,0BAA2C;AAC3C,4BAAmD;AACnD,uBAA0B;AAC1B,oCAAuC;
|
|
4
|
+
"sourcesContent": ["import { ProLayout, ProLayoutProps } from '@ant-design/pro-components';\nimport { useMemoizedFn } from 'ahooks';\nimport { theme } from 'antd';\nimport _ from 'lodash';\n\nimport classnames from 'classnames';\n\nimport { useT } from '@creekjs/i18n/react';\n\nimport { CreekKeepAlive, CreekKeepAliveProps } from '../creek-keep-alive';\nimport { CreekLocaleButton } from '../creek-locale-button';\nimport { GlobalScrollbarStyle } from '../creek-style/scrollbar';\nimport { FullScreen, LayoutSettings } from './ActionRender';\nimport { CollapsedButton, useCollapsedStore } from './CollapseButton';\nimport { Exception } from './Exception';\nimport { useLayoutSettingsStore } from './useLayoutSettingsStore';\n\nexport type LayoutProps = ProLayoutProps & {\n runtimeConfig: ProLayoutProps;\n userConfig?: ProLayoutProps;\n navigate?: (path?: string | number) => void;\n showFullScreen?: boolean;\n showLocaleButton?: boolean;\n showSettingsButton?: boolean;\n initialInfo?: {\n initialState: any;\n loading: boolean;\n setInitialState: () => void;\n };\n keepAlive?: boolean | CreekKeepAliveProps;\n extraActions?: React.ReactNode[];\n};\n\nconst MenuName = ({ name, path }: { name: string; path?: string }) => {\n const t = useT();\n const key = !path || path === '/' ? 'menu.home' : `menu${path.replace(/\\//g, '.')}`;\n return <>{t(key, name)}</>;\n};\n\nexport const CreekLayout = (props: LayoutProps) => {\n const {\n route,\n userConfig,\n runtimeConfig,\n children,\n location,\n navigate,\n showFullScreen = false,\n showLocaleButton = false,\n showSettingsButton = false,\n keepAlive = false,\n extraActions = [],\n ...more\n } = props;\n\n const { useToken } = theme;\n const { token } = useToken();\n\n const { collapsed } = useCollapsedStore();\n const settingsStore = useLayoutSettingsStore();\n\n const actualShowFullScreen = settingsStore.showFullScreen ?? showFullScreen;\n const actualShowLocaleButton = settingsStore.showLocaleButton ?? showLocaleButton;\n const colorPrimary = settingsStore.colorPrimary || token.colorPrimary;\n const actualKeepAlive = settingsStore.keepAlive ?? keepAlive;\n\n console.log(actualKeepAlive, 'actualKeepAlive');\n\n const menuDataRender = useMemoizedFn((menuData: any[]) => {\n const mapMenu = (items: any[]): any[] => {\n return items.map((item) => {\n return {\n ...item,\n name: <MenuName name={item.name} path={item.path} />,\n children: item.children ? mapMenu(item.children) : undefined,\n };\n });\n };\n return mapMenu(menuData);\n });\n\n const menuItemRender: ProLayoutProps['menuItemRender'] = useMemoizedFn((itemProps, defaultDom) => {\n return (\n <span\n onClick={() => {\n if (navigate) {\n navigate(itemProps.path);\n }\n }}\n >\n {defaultDom}\n </span>\n );\n });\n\n const getTabTitle = useMemoizedFn((pathname: string) => {\n const findTitle = (routes: any[]): string | React.ReactNode | undefined => {\n for (const r of routes) {\n if (r.path === pathname) return r.name || r.title;\n if (r.children) {\n const found = findTitle(r.children);\n if (found) return found;\n }\n }\n return undefined;\n };\n return findTitle(route?.routes || []) || pathname;\n });\n\n const actions: React.ReactNode[] = [...extraActions];\n\n if (actualShowFullScreen) {\n actions.push(<FullScreen key=\"full-screen\" />);\n }\n\n if (actualShowLocaleButton) {\n actions.push(<CreekLocaleButton key=\"locale-button\" />);\n }\n\n if (showSettingsButton) {\n actions.push(<LayoutSettings key=\"settings\" defaultShowFullScreen={showFullScreen} defaultShowLocaleButton={showLocaleButton} defaultKeepAlive={_.isBoolean(keepAlive) ? keepAlive : true} />);\n }\n\n const keepAliveProps = _.isBoolean(keepAlive) ? {} : keepAlive;\n\n const _userConfig = { ...userConfig, ...runtimeConfig };\n\n const layoutContent = (\n <ProLayout\n className={classnames('creek-layout-container', _userConfig?.className)}\n route={route}\n title={_userConfig?.title}\n siderWidth={200}\n location={location}\n menuDataRender={menuDataRender}\n menuItemRender={menuItemRender}\n actionsRender={() => actions}\n token={{\n header: {\n colorBgHeader: '#fff',\n colorHeaderTitle: 'rgba(0, 0, 0, 0.80);',\n colorTextMenuSelected: colorPrimary,\n heightLayoutHeader: 48,\n },\n sider: {\n colorMenuBackground: '#f7f8fa',\n colorBgMenuItemSelected: 'transparent',\n colorTextMenuActive: colorPrimary,\n colorTextMenuSelected: colorPrimary,\n colorTextMenuItemHover: colorPrimary,\n colorTextMenu: '#333',\n },\n pageContainer: {\n paddingBlockPageContainerContent: 0,\n paddingInlinePageContainerContent: 0,\n colorBgPageContainer: 'linear-gradient(180deg, #F7F9FF 0%, #FFF 45.59%);',\n },\n }}\n fixSiderbar\n fixedHeader\n collapsed={collapsed}\n collapsedButtonRender={(collapsed) => {\n return <CollapsedButton collapsed={collapsed} />;\n }}\n {...more}\n >\n <GlobalScrollbarStyle />\n <Exception>{actualKeepAlive ? <CreekKeepAlive getTabTitle={getTabTitle} {...keepAliveProps} /> : children}</Exception>\n </ProLayout>\n );\n\n return layoutContent;\n};\n\nexport * from './Exception';\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["_", "classnames", "collapsed"]
|
|
7
7
|
}
|
|
@@ -28,9 +28,9 @@ var useLayoutSettingsStore = (0, import_zustand.create)()(
|
|
|
28
28
|
(0, import_middleware.persist)(
|
|
29
29
|
(set) => ({
|
|
30
30
|
colorPrimary: void 0,
|
|
31
|
-
showFullScreen:
|
|
32
|
-
showLocaleButton:
|
|
33
|
-
keepAlive:
|
|
31
|
+
showFullScreen: false,
|
|
32
|
+
showLocaleButton: false,
|
|
33
|
+
keepAlive: false,
|
|
34
34
|
setSettings: (settings) => set((state) => ({ ...state, ...settings }))
|
|
35
35
|
}),
|
|
36
36
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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:
|
|
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: false,\n showLocaleButton: false,\n keepAlive: false,\n setSettings: (settings) => set((state) => ({ ...state, ...settings })),\n }),\n {\n name: 'creek-layout-settings',\n }\n )\n);\n"],
|
|
5
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
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@creekjs/web-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"father:build": "father build",
|
|
8
|
-
"father:dev": "father dev --no-clean",
|
|
9
|
-
"i18n-extract": "creek-i18n extract"
|
|
10
|
-
},
|
|
11
6
|
"keywords": [],
|
|
12
7
|
"author": "",
|
|
13
8
|
"license": "ISC",
|
|
14
9
|
"dependencies": {
|
|
15
10
|
"@ant-design/icons": "^5.5.1",
|
|
16
11
|
"@ant-design/pro-components": "^2.8.10",
|
|
17
|
-
"@creekjs/i18n": "workspace:^",
|
|
18
12
|
"antd-style": "^3.7.1",
|
|
19
13
|
"lodash": "^4.17.23",
|
|
20
14
|
"react-resizable": "^3.1.3",
|
|
21
15
|
"react-router-dom": "^7.13.0",
|
|
22
|
-
"zustand": "^5.0.1"
|
|
16
|
+
"zustand": "^5.0.1",
|
|
17
|
+
"@creekjs/i18n": "^1.0.0"
|
|
23
18
|
},
|
|
24
19
|
"devDependencies": {
|
|
25
|
-
"@creekjs/i18n-extract": "workspace:^",
|
|
26
20
|
"@types/lodash": "^4.17.20",
|
|
27
21
|
"@types/react-resizable": "^3.0.8",
|
|
28
|
-
"react-intl": "^6.0.0"
|
|
22
|
+
"react-intl": "^6.0.0",
|
|
23
|
+
"@creekjs/i18n-extract": "^1.0.0"
|
|
29
24
|
},
|
|
30
25
|
"peerDependencies": {
|
|
31
26
|
"react-intl": ">=3.0.0"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"father:build": "father build",
|
|
30
|
+
"father:dev": "father dev --no-clean",
|
|
31
|
+
"i18n-extract": "creek-i18n extract"
|
|
32
32
|
}
|
|
33
|
-
}
|
|
33
|
+
}
|
|
@@ -38,7 +38,20 @@ const MenuName = ({ name, path }: { name: string; path?: string }) => {
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
export const CreekLayout = (props: LayoutProps) => {
|
|
41
|
-
const {
|
|
41
|
+
const {
|
|
42
|
+
route,
|
|
43
|
+
userConfig,
|
|
44
|
+
runtimeConfig,
|
|
45
|
+
children,
|
|
46
|
+
location,
|
|
47
|
+
navigate,
|
|
48
|
+
showFullScreen = false,
|
|
49
|
+
showLocaleButton = false,
|
|
50
|
+
showSettingsButton = false,
|
|
51
|
+
keepAlive = false,
|
|
52
|
+
extraActions = [],
|
|
53
|
+
...more
|
|
54
|
+
} = props;
|
|
42
55
|
|
|
43
56
|
const { useToken } = theme;
|
|
44
57
|
const { token } = useToken();
|
|
@@ -46,10 +59,12 @@ export const CreekLayout = (props: LayoutProps) => {
|
|
|
46
59
|
const { collapsed } = useCollapsedStore();
|
|
47
60
|
const settingsStore = useLayoutSettingsStore();
|
|
48
61
|
|
|
49
|
-
const actualShowFullScreen = settingsStore.showFullScreen ?? showFullScreen
|
|
50
|
-
const actualShowLocaleButton = settingsStore.showLocaleButton ?? showLocaleButton
|
|
62
|
+
const actualShowFullScreen = settingsStore.showFullScreen ?? showFullScreen;
|
|
63
|
+
const actualShowLocaleButton = settingsStore.showLocaleButton ?? showLocaleButton;
|
|
51
64
|
const colorPrimary = settingsStore.colorPrimary || token.colorPrimary;
|
|
52
|
-
const actualKeepAlive = settingsStore.keepAlive ?? keepAlive
|
|
65
|
+
const actualKeepAlive = settingsStore.keepAlive ?? keepAlive;
|
|
66
|
+
|
|
67
|
+
console.log(actualKeepAlive, 'actualKeepAlive');
|
|
53
68
|
|
|
54
69
|
const menuDataRender = useMemoizedFn((menuData: any[]) => {
|
|
55
70
|
const mapMenu = (items: any[]): any[] => {
|
|
@@ -103,14 +118,7 @@ export const CreekLayout = (props: LayoutProps) => {
|
|
|
103
118
|
}
|
|
104
119
|
|
|
105
120
|
if (showSettingsButton) {
|
|
106
|
-
actions.push(
|
|
107
|
-
<LayoutSettings
|
|
108
|
-
key="settings"
|
|
109
|
-
defaultShowFullScreen={showFullScreen}
|
|
110
|
-
defaultShowLocaleButton={showLocaleButton}
|
|
111
|
-
defaultKeepAlive={_.isBoolean(keepAlive) ? keepAlive : true}
|
|
112
|
-
/>
|
|
113
|
-
);
|
|
121
|
+
actions.push(<LayoutSettings key="settings" defaultShowFullScreen={showFullScreen} defaultShowLocaleButton={showLocaleButton} defaultKeepAlive={_.isBoolean(keepAlive) ? keepAlive : true} />);
|
|
114
122
|
}
|
|
115
123
|
|
|
116
124
|
const keepAliveProps = _.isBoolean(keepAlive) ? {} : keepAlive;
|
|
@@ -13,9 +13,9 @@ export const useLayoutSettingsStore = create<LayoutSettingsStore>()(
|
|
|
13
13
|
persist(
|
|
14
14
|
(set) => ({
|
|
15
15
|
colorPrimary: undefined,
|
|
16
|
-
showFullScreen:
|
|
17
|
-
showLocaleButton:
|
|
18
|
-
keepAlive:
|
|
16
|
+
showFullScreen: false,
|
|
17
|
+
showLocaleButton: false,
|
|
18
|
+
keepAlive: false,
|
|
19
19
|
setSettings: (settings) => set((state) => ({ ...state, ...settings })),
|
|
20
20
|
}),
|
|
21
21
|
{
|