@yuku123/z-frontend-common 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/dist/{ComponentDoc-C4XFElke.js → ComponentDoc-22ujWxLE.js} +433 -350
- package/dist/index.js +80 -76
- package/dist/ui.js +25 -21
- package/package.json +1 -1
- package/src/components/ui/ListTable.jsx +107 -0
- package/src/components/ui/index.js +4 -0
- package/src/components/ui/useListFilter.js +74 -0
package/README.md
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
> z-opc-foundation 全仓共享前端基座 —— lead 008《前端开发规范》§1-§16 的唯一承载仓。
|
|
4
4
|
|
|
5
5
|
工作区内 **41** 个 `*-suit` 工程通过同一份 AppLayout / LoginPage 获得一致的
|
|
6
|
-
左菜单架子、登录流程与右上角用户组件;**
|
|
7
|
-
(其中 **
|
|
6
|
+
左菜单架子、登录流程与右上角用户组件;**35** 个 `*-component` 工程声明依赖本包
|
|
7
|
+
(其中 **34** 个在源码里真的 import)。
|
|
8
8
|
**改一处,全仓同步**。
|
|
9
9
|
|
|
10
10
|
---
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|------|-----|
|
|
16
16
|
| 仓 | `z-opc-foundation/z-frontend-common`(本仓) |
|
|
17
17
|
| npm 包 | `@yuku123/z-frontend-common`(scope 沿用 yuku123,与 0.1.x/0.2.x 旧线连续) |
|
|
18
|
-
| 当前版本 | `1.1.
|
|
18
|
+
| 当前版本 | `1.1.4` —— 1.0 语义:§1-§16 规范化起点;1.1.x 在其上追加扁平 ui 组件桶。0.1.x 是 pre-§16 形态;0.2.x 内嵌 react-dom 已废弃 |
|
|
19
19
|
| 技术栈 | React 19 + antd 6 + react-router-dom 7 + Vite 6(lead 005 §3.0 版本线单一尺子) |
|
|
20
20
|
| 产物 | ESM **3 入口**(`formats: ['es']`):`dist/index.js`(主桶)+ `dist/ui.js`(扁平 ui 桶)+ `dist/ui-echarts.js`(`ui/echarts` 子路径) |
|
|
21
21
|
| 打包策略 | external 精确 **9** 个包 + **1** 条前缀规则(`echarts/*`):react / react-dom / react-dom/client / react/jsx-runtime / react-router-dom / antd / @ant-design/icons / axios / echarts |
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
| `EmptyState` | **已实装**:`src/components/ui/EmptyState.jsx`(44×44 触控目标、默认标题「暂无数据」、可选 action 按钮),由扁平 ui 桶导出 |
|
|
31
31
|
| `StatusTag` / `defaultStatusMap` | 0.1.1 契约原样保留 |
|
|
32
32
|
| `ErrorBoundary` | 0.1.1 契约原样保留(antd Result 形态重绘) |
|
|
33
|
-
| `createRequest(options)` | axios 实例工厂:`{baseURL='/api', timeout=10000, tokenKey='token', userInfoKey='userInfo', unauthorizedRedirect='/login'}`;
|
|
33
|
+
| `createRequest(options)` | axios 实例工厂:`{baseURL='/api', timeout=10000, tokenKey='token', userInfoKey='userInfo', unauthorizedRedirect='/login'}`;35 个 `*-component` 工程声明依赖本包 |
|
|
34
34
|
| `request` / `authRequest` | 预建实例(`createRequest()` 双份,0.1.1 契约) |
|
|
35
35
|
| `setupInterceptors` | 拦截器装配(Bearer token 注入 + 401 清凭跳登录 + 响应解包) |
|
|
36
36
|
| `unwrapResponse` | **新增显式导出**:`{code, data}` 包装解包 / 裸数据透传(z-opc Spring MVC 统一返回体兼容) |
|
|
37
|
-
| `ui` 扁平桶(`export *`) | **1.1.x 追加**:
|
|
37
|
+
| `ui` 扁平桶(`export *`) | **1.1.x 追加**:16 个 UI 组件文件导出 **19** 个具名(`TableToolbar` 同时导出 `RefreshButton`;`useListFilter` 同时导出纯函数 `filterRows`)+ **9** 个 design token(`brand` / `palette` / `neutral` / `radius` / `shadow` / `lift` / `space` / `fontSize` / `antdTheme`)= **28** 个具名导出 |
|
|
38
38
|
| `EChartsChart` | 走子路径 `@yuku123/z-frontend-common/ui/echarts`(不进扁平桶:让不画图的域解析 `echarts/core` 会构建失败) |
|
|
39
39
|
| `default`(桶) | `{AppLayout, StatusTag, defaultStatusMap, LoginPage, ErrorBoundary, request, authRequest, createRequest}` —— 0.1.1 形状原样,**8** 个成员 |
|
|
40
40
|
|
|
@@ -82,3 +82,5 @@ const MOCK_AUTH = { username: 'admin', password: '123456', user: { name: 'admin'
|
|
|
82
82
|
- `1.0.0`:独立仓首版 —— 源码自 vendoring 迁入,API 契约兼容 0.1.1,AppLayout/LoginPage 升级 §1-§16 规范版
|
|
83
83
|
- `1.1.1`:在 1.0.0 之上追加扁平 ui 组件桶(13 个 UI 组件 + design token)与 `ui/echarts` 子路径
|
|
84
84
|
- `1.1.2`:ui 桶追加 `ComponentDoc`(§7 组件文档页:240px TOC + 正文两栏、滚动联动、锚点跳转、自带零依赖 markdown 引擎,宿主可注册 react-markdown 三件套升级为 GFM + Prism 高亮)
|
|
85
|
+
- `1.1.4`:ui 桶的 `ListTable` 支持 `cardExtra`(Card 动作按钮)与 `searchKeys`(过滤框)**并排**渲染 —— 原实现二选一,会把其中一个静默吞掉(页面同时有「搜索」和「新增」按钮时按钮消失)。
|
|
86
|
+
- `1.1.3`:ui 桶追加 `useListFilter` / `filterRows`(§2 强制规则 3 的客户端过滤口径统一收在基座:大小写不敏感、多字段「或」匹配、null 字段不参与匹配、空关键字原样返回)与 `ListTable`(§2 规则 2/3/4 的成品件:分页三件套 + Card extra 过滤框 + EmptyState 空态一次到位)
|