@zl-ui-kit/components 0.18.7 → 0.19.0
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 +298 -13
- package/dist/components/ZlLoading/index.css +1 -0
- package/dist/components/ZlLoading/index.vue.d.ts +27 -0
- package/dist/components/ZlLoading/index.vue.mjs +8 -0
- package/dist/components/ZlLoading/index2.vue.mjs +30 -0
- package/dist/components/ZlMenu/ZlMenuItem.vue.d.ts +7 -0
- package/dist/components/ZlMenu/ZlMenuItem.vue.mjs +53 -0
- package/dist/components/ZlMenu/ZlMenuItem2.vue.mjs +5 -0
- package/dist/components/ZlMenu/index.vue.d.ts +37 -0
- package/dist/components/ZlMenu/index.vue.mjs +58 -0
- package/dist/components/ZlMenu/index3.vue.mjs +6 -0
- package/dist/components/ZlMenu/types.d.ts +14 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +108 -101
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -18,13 +18,13 @@ ZL UI 业务组件库 —— Element Plus 体系,`Zl` 前缀,56 个业务组
|
|
|
18
18
|
- [2.2 启动 playground(组件示例与联调)](#22-启动-playground组件示例与联调)
|
|
19
19
|
- [2.3 主题快速接入(宿主项目)](#23-主题快速接入宿主项目)
|
|
20
20
|
- [2.4 示例页面索引](#24-示例页面索引)
|
|
21
|
-
- [3. 组件总览(
|
|
21
|
+
- [3. 组件总览(58 个业务组件)](#3-组件总览58-个业务组件)
|
|
22
22
|
- [3.1 通用展示组件](#31-通用展示组件)
|
|
23
23
|
- [3.2 数据型组件](#32-数据型组件)
|
|
24
24
|
- [3.3 表单与交互组件](#33-表单与交互组件)
|
|
25
25
|
- [3.4 布局与权限](#34-布局与权限)
|
|
26
26
|
- [3.5 文件与编辑](#35-文件与编辑)
|
|
27
|
-
- [3.6 国际化基础设施(独立于
|
|
27
|
+
- [3.6 国际化基础设施(独立于 58 个业务组件)](#36-国际化基础设施独立于-58-个业务组件)
|
|
28
28
|
- [3.7 内部子组件(不对外导出,随父组件使用)](#37-内部子组件不对外导出随父组件使用)
|
|
29
29
|
- [4. 图标组件 `ZlIcon`](#4-图标组件-zlicon)
|
|
30
30
|
- [4.1 必须先注册图标集(否则一个图标都不显示)](#41-必须先注册图标集否则一个图标都不显示)
|
|
@@ -52,6 +52,7 @@ ZL UI 业务组件库 —— Element Plus 体系,`Zl` 前缀,56 个业务组
|
|
|
52
52
|
- [ZlTree —— 树形控件(多选 / 暴露方法)](#zltree-树形控件多选-暴露方法)
|
|
53
53
|
- [8. 布局与权限](#8-布局与权限)
|
|
54
54
|
- [ZlAppLayout / ZlAppMenu](#zlapplayout-zlappmenu)
|
|
55
|
+
- [ZlMenu — 通用菜单](#zlmenu-通用菜单)
|
|
55
56
|
- [ZlPermission](#zlpermission)
|
|
56
57
|
- [ZlHorizontalTable](#zlhorizontaltable)
|
|
57
58
|
- [9. 文件与编辑](#9-文件与编辑)
|
|
@@ -458,9 +459,9 @@ defineTheme({
|
|
|
458
459
|
|
|
459
460
|
---
|
|
460
461
|
|
|
461
|
-
## 3. 组件总览(
|
|
462
|
+
## 3. 组件总览(58 个业务组件)
|
|
462
463
|
|
|
463
|
-
> 口径:主入口 `@zl-ui-kit/components` 导出 **
|
|
464
|
+
> 口径:主入口 `@zl-ui-kit/components` 导出 **54 个**组件,另有 **5 个**重型组件走子路径入口(`/chart`、`/editor`、`/file-preview`),合计 **59 个对外组件**(§14 逐条覆盖这 59 个);其中 `ZlI18nProvider` 是国际化基础设施,故**业务组件为 58 个**(playground 的 `/gallery` 逐个渲染的就是这 58 个)。组件目录共 51 个(一个目录可产出多个导出符号,如 `ZlTag` 目录同时产出 `ZlTag` / `ZlCornerTag`)。§3.1~§3.5 按功能分组列出业务组件,其中混列了 4 个**不对外导出**的内部子组件(`ZlHorizontalLayout` / `ZlVerticalLayout` / `ZlAppMenuItem` / `ZlFileFetchError`,见 §3.7),去掉这 4 个后正好 58 个。
|
|
464
465
|
|
|
465
466
|
> **要查精确的 props / 事件 / 插槽 / 暴露方法 / schema 类型?** 直接看 **[§14 组件 API 参考](#14-组件-api-参考自动生成)**——逐个组件给出 `import`、可直接照抄的 **用法示例**(props 怎么写)与 **插槽用法**(`<template #name>` 怎么写),再用表格列出 TS 类型表达式、默认值、是否必填,**且每个 prop / 每个插槽都带一列「示例」**(能直接粘到标签上的写法),以及 `TableColumn` / `FormItem` / `SearchItem` / `ActionItem` 等 schema 类型的字段表。本章及 §4~§9 讲的是**场景化用法**,§14 是**逐字段的契约 + 可粘贴代码**。
|
|
466
467
|
|
|
@@ -486,7 +487,7 @@ defineTheme({
|
|
|
486
487
|
|
|
487
488
|
> 页签/微前端类组件(`ZlMicroPage`/`ZlAppTabs`/`ZlPageTabs`/`ZlDevMenu`)与配套 composables(`usePageTabs` 等)均已移除,`0.5.0` 起组件库不含任何微前端能力。
|
|
488
489
|
|
|
489
|
-
### 3.6 国际化基础设施(独立于
|
|
490
|
+
### 3.6 国际化基础设施(独立于 58 个业务组件)
|
|
490
491
|
|
|
491
492
|
`ZlI18nProvider` —— 国际化根容器,将 Element Plus 语言包经 `<el-config-provider>` 挂载到 Element Plus(详见第 13 章)。
|
|
492
493
|
|
|
@@ -803,6 +804,16 @@ presetIconifyIcon(icons)
|
|
|
803
804
|
|
|
804
805
|
来源:`@zl-ui-kit/composables`。`service` 统一签名:`(...args) => Promise<R>`。
|
|
805
806
|
|
|
807
|
+
四个 hook 共享同一套状态与方法(`loading` / `data` / `error` / `status` / `run` / `runAsync` /
|
|
808
|
+
`refresh` / `refreshAsync` / `cancel` / `mutate`),差别只在 `data` 怎么取:
|
|
809
|
+
|
|
810
|
+
| Hook | 适用的接口响应 | `data` 内容 |
|
|
811
|
+
| ---------------------- | ------------------------------------ | --------------------------------------------------------------------------- |
|
|
812
|
+
| `useRequest` | 任意 | 原始响应 `R` |
|
|
813
|
+
| `useDataRequest` | 信封对象(如 `{ code, msg, data }`) | 解包后的 `响应[dataKey]`,取不到时回落到 `initialData` |
|
|
814
|
+
| `usePageableRequest` | 数组 **或** 分页对象 | 数组原样返回;对象则 `{ ...响应, pageNum, pageSize }`(页码取本次请求入参) |
|
|
815
|
+
| `usePaginationRequest` | 分页对象 | 行数组,另给 `total` / `current` / `pageSize` / `change*` |
|
|
816
|
+
|
|
806
817
|
#### `useRequest(service, options?, plugins?)` —— 基础形态
|
|
807
818
|
|
|
808
819
|
```ts
|
|
@@ -825,13 +836,82 @@ const { loading, data, error, status, run, runAsync, refresh, refreshAsync, canc
|
|
|
825
836
|
| `options.onBefore/onSuccess/onError/onFinally` | 生命周期回调 |
|
|
826
837
|
| `options.loadingDelay` / `refreshDeps` | 延迟 loading / 依赖变更刷新 |
|
|
827
838
|
|
|
828
|
-
#### `useDataRequest(service, { dataKey = 'data' })` ——
|
|
839
|
+
#### `useDataRequest(service, { dataKey = 'data' })` —— 解包信封响应
|
|
840
|
+
|
|
841
|
+
适用:后端统一返回 `{ code, msg, data }` 这类信封,页面只关心内层业务数据。
|
|
842
|
+
|
|
843
|
+
```ts
|
|
844
|
+
const { data, loading, run, runAsync, refresh } = useDataRequest(getDetailApi)
|
|
845
|
+
// data.value === 响应.data
|
|
846
|
+
```
|
|
847
|
+
|
|
848
|
+
| 选项 | 说明 |
|
|
849
|
+
| ------------- | --------------------------------------------------------------------------------- |
|
|
850
|
+
| `dataKey` | 信封里承载业务数据的字段名,默认 `data` |
|
|
851
|
+
| `initialData` | 解包结果为空(未请求 / 该 key 不存在)时的兜底值,**按解包后的数据形态传** |
|
|
852
|
+
| `manual` | `true` 时挂载不请求,需 `run` / `runAsync` 触发;其余选项与 `useRequest` 完全一致 |
|
|
853
|
+
|
|
854
|
+
真实页面里最常见的三种写法:
|
|
829
855
|
|
|
830
856
|
```ts
|
|
831
|
-
|
|
832
|
-
|
|
857
|
+
// 1) 自动请求 + 兜底:模板可直接渲染,不必到处判空
|
|
858
|
+
const { data: detail, loading } = useDataRequest(getDetailApi, { initialData: {} })
|
|
859
|
+
|
|
860
|
+
// 2) 手动触发:点击按钮 / 打开抽屉时再查
|
|
861
|
+
const { data: detail, loading, runAsync } = useDataRequest(getDetailApi, { manual: true })
|
|
862
|
+
async function open(row: { id: number }) {
|
|
863
|
+
const res = await runAsync({ id: row.id }) // res 是原始信封,不是解包后的 data
|
|
864
|
+
// 需要解包值请读 detail.value
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
// 3) service 用闭包读取 props(详情组件按 id 查询)
|
|
868
|
+
const { data: detail, run: fetchDetail } = useDataRequest(() => getDetailApi({ id: props.id }))
|
|
869
|
+
// props.id 变化后需自行 refresh() / run(),或把变化源放进 refreshDeps
|
|
833
870
|
```
|
|
834
871
|
|
|
872
|
+
> 注意:`useDataRequest` 只适合**对象信封**。接口直接返回数组时 `rawData[dataKey]` 取不到值,
|
|
873
|
+
> `data` 会恒等于 `initialData`——数组 / 分页响应请改用 `usePageableRequest` 或 `useRequest`。
|
|
874
|
+
> 另外 `onSuccess(data, params)` 与 `runAsync()` 拿到的都是**原始响应 `R`**,不是解包后的值。
|
|
875
|
+
|
|
876
|
+
#### `usePageableRequest(service, options?, plugins?)` —— 列表 / 分页响应适配
|
|
877
|
+
|
|
878
|
+
适用:把「数组响应」和「分页对象响应」统一成同一份 `data`,供 `ZlSearchTable` / `ZlCardPage`
|
|
879
|
+
或自定义列表使用。返回值与 `useRequest` 相同,只改写了 `data`:
|
|
880
|
+
|
|
881
|
+
| 接口响应 | `data.value` |
|
|
882
|
+
| ------------------------------------------- | -------------------------------------------------------------------- |
|
|
883
|
+
| `TreeNode[]` 等数组 | 原样返回数组 |
|
|
884
|
+
| `{ rows, total, pageNum, pageSize }` 等对象 | `{ ...响应, pageNum, pageSize }`(响应没回页码时用本次请求入参补齐) |
|
|
885
|
+
|
|
886
|
+
```ts
|
|
887
|
+
// 后端直接返回数组:data 就是数组,initialData 兜底空列表
|
|
888
|
+
const { data: treeData, loading } = usePageableRequest(getTreeApi, { initialData: [] })
|
|
889
|
+
|
|
890
|
+
// 后端返回分页对象:data.rows 是行数据,data.pageNum / data.pageSize 已被补齐
|
|
891
|
+
const { data: pageData, loading, run } = usePageableRequest(getPageApi, { manual: true })
|
|
892
|
+
run({ pageNum: 2, pageSize: 20 })
|
|
893
|
+
// pageData.value.rows / total / pageNum / pageSize
|
|
894
|
+
```
|
|
895
|
+
|
|
896
|
+
**它不提供 `total` / `current` / `pageSize` / 翻页方法**——需要自己控制分页器时用
|
|
897
|
+
`usePaginationRequest`;只是给组件喂数据、或读取 `loading` / `refresh` 时用 `usePageableRequest`。
|
|
898
|
+
|
|
899
|
+
**实例形态直传组件**(页面侧要接管 `loading` / `refresh` 时):
|
|
900
|
+
|
|
901
|
+
```ts
|
|
902
|
+
const cardRequest = usePageableRequest(getPageApi, { manual: true, initialData: [] })
|
|
903
|
+
// 组件内部的搜索 / 翻页仍调用同一实例的 run,loading / data 与页面共享
|
|
904
|
+
```
|
|
905
|
+
|
|
906
|
+
```vue
|
|
907
|
+
<ZlCardPage :request="cardRequest" card-min-width="200px" :pagination="{ pageSize: 6 }">
|
|
908
|
+
<template #default="{ data }">…</template>
|
|
909
|
+
</ZlCardPage>
|
|
910
|
+
```
|
|
911
|
+
|
|
912
|
+
> `ZlSearchTable` / `ZlCardPage` 默认在内部自行创建 `usePageableRequest`,**页面直接传 service 即可**;
|
|
913
|
+
> 只有需要在页面里读取同一份 `loading` / `data` / `refresh` 时才传实例(见 §6.3 ⑨)。
|
|
914
|
+
|
|
835
915
|
#### `usePaginationRequest(service, { pagination })` —— 分页专用
|
|
836
916
|
|
|
837
917
|
额外返回 `data`(行数组) / `total` / `current` / `pageSize` / `changeCurrent` / `changePageSize` / `changePagination`,分页键名(`pageNum/pageSize/total/rows`)可配置,与后端契约对齐时通过 `pagination` 选项或 `setGlobalOptions` 调整。
|
|
@@ -1150,9 +1230,10 @@ const { data: treeData, loading: treeLoading } = treeReq
|
|
|
1150
1230
|
`ZlChart` 显式 prop 为 `series`,其余配置(title/xAxis/yAxis/tooltip/grid)经 attrs 透传,故用 `v-bind` 传完整 echarts option:
|
|
1151
1231
|
|
|
1152
1232
|
```ts
|
|
1153
|
-
const chartReq = useDataRequest(getChartDataApi
|
|
1233
|
+
const chartReq = useDataRequest(getChartDataApi) // 默认 dataKey='data'
|
|
1234
|
+
const { data: chartData, loading: chartLoading } = chartReq // 顶层 ref 才会在模板自动解包
|
|
1154
1235
|
const chartOption = computed(() => {
|
|
1155
|
-
const d =
|
|
1236
|
+
const d = chartData.value
|
|
1156
1237
|
if (!d) return {}
|
|
1157
1238
|
return {
|
|
1158
1239
|
tooltip: { trigger: 'axis' },
|
|
@@ -1164,7 +1245,8 @@ const chartOption = computed(() => {
|
|
|
1164
1245
|
```
|
|
1165
1246
|
|
|
1166
1247
|
```vue
|
|
1167
|
-
<
|
|
1248
|
+
<el-skeleton v-if="chartLoading" :rows="5" />
|
|
1249
|
+
<ZlChart v-else v-bind="chartOption" />
|
|
1168
1250
|
```
|
|
1169
1251
|
|
|
1170
1252
|
| Prop | 类型 | 说明 |
|
|
@@ -1174,7 +1256,44 @@ const chartOption = computed(() => {
|
|
|
1174
1256
|
|
|
1175
1257
|
> 暴露方法:`clear()`(模板 ref 调用)。尺寸自适应由 `useResizeObserver` 负责,容器需有明确高度。
|
|
1176
1258
|
|
|
1177
|
-
|
|
1259
|
+
需要「点击后再拉取」时用 `manual + runAsync`;`runAsync()` 返回原始信封,解包后的值仍看 `data`:
|
|
1260
|
+
|
|
1261
|
+
```ts
|
|
1262
|
+
const { data: chartData, runAsync: fetchChartAsync } = useDataRequest(getChartDataApi, {
|
|
1263
|
+
manual: true,
|
|
1264
|
+
})
|
|
1265
|
+
async function fetchChart() {
|
|
1266
|
+
const res = await fetchChartAsync() // res: { code, msg, data }
|
|
1267
|
+
console.log(res.code, chartData.value)
|
|
1268
|
+
}
|
|
1269
|
+
```
|
|
1270
|
+
|
|
1271
|
+
#### ⑨ `usePageableRequest` —— 数组 / 分页对象 / 实例直传
|
|
1272
|
+
|
|
1273
|
+
接口返回数组或分页对象都能用;组件需要自己接管 `loading` / `refresh` 时,直接传实例:
|
|
1274
|
+
|
|
1275
|
+
```ts
|
|
1276
|
+
// 数组响应:data 原样是数组
|
|
1277
|
+
const { data: treeData, loading } = usePageableRequest(getTreeApi, { initialData: [] })
|
|
1278
|
+
|
|
1279
|
+
// 分页对象响应:data.rows 是行数据,pageNum / pageSize 已用本次入参补齐
|
|
1280
|
+
const { data: pageData, loading, run } = usePageableRequest(getPageApi, { manual: true })
|
|
1281
|
+
run({ pageNum: 1, pageSize: 20 })
|
|
1282
|
+
|
|
1283
|
+
// 实例形态直传 ZlCardPage:组件的搜索 / 翻页复用同一实例
|
|
1284
|
+
const cardRequest = usePageableRequest(getPageApi, { manual: true, initialData: [] })
|
|
1285
|
+
```
|
|
1286
|
+
|
|
1287
|
+
```vue
|
|
1288
|
+
<ZlCardPage :request="cardRequest" card-min-width="200px" :pagination="{ pageSize: 6 }">
|
|
1289
|
+
<template #default="{ data }">{{ data.name }}</template>
|
|
1290
|
+
</ZlCardPage>
|
|
1291
|
+
```
|
|
1292
|
+
|
|
1293
|
+
> 与 `usePaginationRequest` 的区别:`usePageableRequest` 只改写 `data`、不提供 `total` / 翻页方法,
|
|
1294
|
+
> 用于给组件喂数据;页面要自己渲染分页器时用 `usePaginationRequest`(见 ③ / ④)。
|
|
1295
|
+
|
|
1296
|
+
#### ⑩ `useRequest` 生命周期面板
|
|
1178
1297
|
|
|
1179
1298
|
```ts
|
|
1180
1299
|
const req = useRequest(getResourcePageMaybeFail, { defaultParams: [{ pageNum: 1, pageSize: 5 }] })
|
|
@@ -1721,6 +1840,61 @@ treeRef.value.getCheckedKeys(true)
|
|
|
1721
1840
|
插槽为 `logo` / `menu` / `header` / `breadcrumb` / `footer` / 默认(详见 §3.7),vertical 形态自带折叠按钮(`el-button circle`)。
|
|
1722
1841
|
- `ZlAppMenu`(+Item):`el-menu` 重写(index=menu.name),主题经 `--zl-menu-*` CSS 变量对接 `--el-menu-*`。
|
|
1723
1842
|
|
|
1843
|
+
### ZlMenu — 通用菜单
|
|
1844
|
+
|
|
1845
|
+
`el-menu` 的 schema 封装:`items` 递归渲染多级菜单,`v-model:selected` 双向绑定选中项。
|
|
1846
|
+
与 `ZlAppMenu`(应用布局专用)不同,它不依赖布局,选中态、折叠、水平/垂直、跳转回调都可独立使用。
|
|
1847
|
+
|
|
1848
|
+
```vue
|
|
1849
|
+
<script setup lang="ts">
|
|
1850
|
+
import { ref } from 'vue'
|
|
1851
|
+
import type { MenuOption } from '@zl-ui-kit/components'
|
|
1852
|
+
|
|
1853
|
+
const selected = ref('datasource')
|
|
1854
|
+
const items: MenuOption[] = [
|
|
1855
|
+
{ key: 'datasource', label: '数据源', icon: 'zl:database' },
|
|
1856
|
+
{
|
|
1857
|
+
key: 'dataset',
|
|
1858
|
+
label: '数据集',
|
|
1859
|
+
icon: 'zl:folder',
|
|
1860
|
+
children: [
|
|
1861
|
+
{ key: 'dataset-list', label: '数据集列表' },
|
|
1862
|
+
{ key: 'dataset-auth', label: '数据集授权', disabled: true },
|
|
1863
|
+
],
|
|
1864
|
+
},
|
|
1865
|
+
]
|
|
1866
|
+
</script>
|
|
1867
|
+
|
|
1868
|
+
<template>
|
|
1869
|
+
<ZlMenu v-model:selected="selected" :items="items" @select="(key) => console.log(key)" />
|
|
1870
|
+
|
|
1871
|
+
<!-- 侧栏折叠 + 路由跳转 -->
|
|
1872
|
+
<ZlMenu
|
|
1873
|
+
v-model:selected="selected"
|
|
1874
|
+
:items="items"
|
|
1875
|
+
:collapsed="collapsed"
|
|
1876
|
+
:navigate="(item) => router.push({ name: item.key })"
|
|
1877
|
+
/>
|
|
1878
|
+
|
|
1879
|
+
<!-- 顶部横向 -->
|
|
1880
|
+
<ZlMenu v-model:selected="selected" :items="items" mode="horizontal" />
|
|
1881
|
+
</template>
|
|
1882
|
+
```
|
|
1883
|
+
|
|
1884
|
+
| prop | 类型 | 默认 | 说明 |
|
|
1885
|
+
| -------------------- | ---------------------------- | ---------- | ---------------------------------------- |
|
|
1886
|
+
| `items` | `MenuOption[]` | `[]` | 菜单项配置,`children` 递归 |
|
|
1887
|
+
| `selected` | `string` | `''` | 选中项 key,支持 `v-model:selected` |
|
|
1888
|
+
| `collapsed` | `boolean` | false | 是否收起为图标 |
|
|
1889
|
+
| `mode` | `'vertical' \| 'horizontal'` | `vertical` | 菜单方向 |
|
|
1890
|
+
| `uniqueOpened` | `boolean` | false | 是否只展开一个子菜单 |
|
|
1891
|
+
| `defaultOpeneds` | `string[]` | `[]` | 默认展开的子菜单 key |
|
|
1892
|
+
| `collapseTransition` | `boolean` | false | 折叠动画 |
|
|
1893
|
+
| `navigate` | `(item: MenuOption) => void` | — | 点击后的跳转回调(通常传 `router.push`) |
|
|
1894
|
+
|
|
1895
|
+
`MenuOption` 字段:`key`(唯一标识)/ `label`(文案)/ `icon?`(`zl:*` 图标名)/ `disabled?` / `children?`。
|
|
1896
|
+
主题变量:`--zl-menu-text-color` / `--zl-menu-hover-bg`(与 `ZlAppMenu` 同口径)。
|
|
1897
|
+
|
|
1724
1898
|
### ZlPermission
|
|
1725
1899
|
|
|
1726
1900
|
配合 `usePermissionProvider` 提供权限上下文,`usePermission` 校验;样例见 `/general`。
|
|
@@ -3843,8 +4017,10 @@ const { i18n } = useLocale({ messages })
|
|
|
3843
4017
|
| [`ZlDrawer`](#zldrawer) | 主入口 | 7 | 1 | 2 | 0 |
|
|
3844
4018
|
| [`ZlDynamicComponent`](#zldynamiccomponent) | 主入口 | 3 | 2 | 0 | 0 |
|
|
3845
4019
|
| [`ZlPdfViewer`](#zlpdfviewer) | 主入口 | 2 | 0 | 0 | 0 |
|
|
4020
|
+
| [`ZlLoading`](#zlloading) | 主入口 | 2 | 0 | 1 | 0 |
|
|
3846
4021
|
| [`ZlLogin`](#zllogin) | 主入口 | 2 | 0 | 2 | 0 |
|
|
3847
4022
|
| [`ZlLoginForm`](#zlloginform) | 主入口 | 1 | 0 | 1 | 0 |
|
|
4023
|
+
| [`ZlMenu`](#zlmenu) | 主入口 | 8 | 2 | 0 | 0 |
|
|
3848
4024
|
| [`ZlEmpty`](#zlempty) | 主入口 | 2 | 0 | 0 | 0 |
|
|
3849
4025
|
| [`ZlForm`](#zlform) | 主入口 | 3 | 0 | 3 | 9 |
|
|
3850
4026
|
| [`ZlFormChild`](#zlformchild) | 主入口 | 1 | 0 | 0 | 0 |
|
|
@@ -4846,6 +5022,49 @@ import { ZlPdfViewer } from '@zl-ui-kit/components'
|
|
|
4846
5022
|
| `url` | `string` | — | 否 | `url="https://example.com/file.pdf"` | PDF 文件地址,渲染时自动隐藏内置工具栏 |
|
|
4847
5023
|
| `width` | `number \| string` | — | 否 | `:width="width"` | 预览区宽度,直接透传给 object 元素 |
|
|
4848
5024
|
|
|
5025
|
+
#### `ZlLoading`
|
|
5026
|
+
|
|
5027
|
+
<sub>入口 `@zl-ui-kit/components` · 源码 `packages/components/src/components/ZlLoading/index.vue`</sub>
|
|
5028
|
+
|
|
5029
|
+
**简介**:ZlLoading —— 带首次渲染保护的加载容器 首次加载完成前不渲染默认插槽,避免接口未回来时先闪一下空状态 / 空表格; 之后即使再次 loading,内容也保持挂载,只叠加载遮罩。
|
|
5030
|
+
|
|
5031
|
+
**接口概览**:2 props · 1 插槽
|
|
5032
|
+
|
|
5033
|
+
**用法示例**
|
|
5034
|
+
|
|
5035
|
+
```vue
|
|
5036
|
+
<script setup lang="ts">
|
|
5037
|
+
import { ZlLoading } from '@zl-ui-kit/components'
|
|
5038
|
+
</script>
|
|
5039
|
+
|
|
5040
|
+
<template>
|
|
5041
|
+
<ZlLoading :loading="false" />
|
|
5042
|
+
</template>
|
|
5043
|
+
```
|
|
5044
|
+
|
|
5045
|
+
**插槽用法**
|
|
5046
|
+
|
|
5047
|
+
```vue
|
|
5048
|
+
<template>
|
|
5049
|
+
<ZlLoading>
|
|
5050
|
+
<template #default>…</template>
|
|
5051
|
+
</ZlLoading>
|
|
5052
|
+
</template>
|
|
5053
|
+
```
|
|
5054
|
+
|
|
5055
|
+
**props**
|
|
5056
|
+
|
|
5057
|
+
| 属性 | 类型 | 默认值 | 必填 | 示例 | 说明 |
|
|
5058
|
+
| ------------- | --------- | ------- | ---- | -------------- | ----------------------------------------------------- |
|
|
5059
|
+
| `loading` | `boolean` | `false` | 否 | `loading` | 是否处于加载中 |
|
|
5060
|
+
| `forceRender` | `boolean` | `false` | 否 | `force-render` | 是否首屏就渲染内容(默认等首次 loading 结束后再挂载) |
|
|
5061
|
+
|
|
5062
|
+
**插槽(slots)**
|
|
5063
|
+
|
|
5064
|
+
| 插槽 | 作用域参数 | 示例 | 说明 |
|
|
5065
|
+
| --------- | ---------- | --------------------------------- | ---- |
|
|
5066
|
+
| `default` | — | `<template #default>…</template>` | — |
|
|
5067
|
+
|
|
4849
5068
|
#### `ZlLogin`
|
|
4850
5069
|
|
|
4851
5070
|
<sub>入口 `@zl-ui-kit/components` · 源码 `packages/components/src/components/ZlLogin/index.vue`</sub>
|
|
@@ -4943,6 +5162,58 @@ import { ZlLoginForm } from '@zl-ui-kit/components'
|
|
|
4943
5162
|
| -------- | ---------- | -------------------------------- | ------------------------ |
|
|
4944
5163
|
| `action` | — | `<template #action>…</template>` | 登录按钮下方的扩展操作区 |
|
|
4945
5164
|
|
|
5165
|
+
#### `ZlMenu`
|
|
5166
|
+
|
|
5167
|
+
<sub>入口 `@zl-ui-kit/components` · 源码 `packages/components/src/components/ZlMenu/index.vue`</sub>
|
|
5168
|
+
|
|
5169
|
+
**简介**:ZlMenu —— 通用 el-menu 封装 与 ZlAppMenu(应用布局专用)的区别:items 数据驱动 + v-model:selected 选中态, 可选 navigate 回调做路由跳转,适用于侧栏 / 顶部导航等任意菜单场景。
|
|
5170
|
+
|
|
5171
|
+
**接口概览**:8 props · 2 事件
|
|
5172
|
+
|
|
5173
|
+
**用法示例**
|
|
5174
|
+
|
|
5175
|
+
```vue
|
|
5176
|
+
<script setup lang="ts">
|
|
5177
|
+
import { ZlMenu } from '@zl-ui-kit/components'
|
|
5178
|
+
</script>
|
|
5179
|
+
|
|
5180
|
+
<template>
|
|
5181
|
+
<ZlMenu v-model:selected="value" :items="items" />
|
|
5182
|
+
</template>
|
|
5183
|
+
```
|
|
5184
|
+
|
|
5185
|
+
> 示例中的 `items` 是数组 / 对象 / 函数等非字面量入参,由调用方提供数据;其余属性写法可直接照搬。
|
|
5186
|
+
|
|
5187
|
+
**props**
|
|
5188
|
+
|
|
5189
|
+
| 属性 | 类型 | 默认值 | 必填 | 示例 | 说明 |
|
|
5190
|
+
| -------------------- | ----------------------------------------- | ------------ | ---- | -------------------------- | ----------------------------------------------------------------- |
|
|
5191
|
+
| `selected` | `string` | `''` | 否 | `v-model:selected="value"` | 当前选中项 key,支持 v-model:selected |
|
|
5192
|
+
| `items` | `MenuOption[]`<br>— 条目字段见下「items」 | `() => []` | 否 | `:items="items"` | 菜单项配置(支持 children 递归) |
|
|
5193
|
+
| `collapsed` | `boolean` | `false` | 否 | `collapsed` | 是否收起为图标 |
|
|
5194
|
+
| `mode` | `'vertical' \| 'horizontal'` | `'vertical'` | 否 | `mode="vertical"` | 菜单方向:vertical / horizontal |
|
|
5195
|
+
| `uniqueOpened` | `boolean` | `false` | 否 | `unique-opened` | 是否只展开一个子菜单 |
|
|
5196
|
+
| `defaultOpeneds` | `string[]` | `() => []` | 否 | `:default-openeds="[]"` | 默认展开的子菜单 key 列表 |
|
|
5197
|
+
| `collapseTransition` | `boolean` | `false` | 否 | `collapse-transition` | 折叠动画(默认关闭,避免布局抖动) |
|
|
5198
|
+
| `navigate` | `(item: MenuOption) => void` | — | 否 | `:navigate="() => {}"` | 点击菜单项后的跳转回调(通常传 router.push),不传则只触发 select |
|
|
5199
|
+
|
|
5200
|
+
**`items` 条目字段(`MenuOption`)**
|
|
5201
|
+
|
|
5202
|
+
| 字段 | 类型 | 必填 | 说明 |
|
|
5203
|
+
| ---------- | -------------- | ---- | ------------------------------------------------- |
|
|
5204
|
+
| `key` | `string` | 是 | 唯一标识:选中态、select 事件、路由跳转都以它为准 |
|
|
5205
|
+
| `label` | `string` | 是 | 菜单文案 |
|
|
5206
|
+
| `icon` | `string` | 否 | 图标名(@zl-ui-kit/icons 中的 `zl:*` 图标) |
|
|
5207
|
+
| `disabled` | `boolean` | 否 | 是否禁用 |
|
|
5208
|
+
| `children` | `MenuOption[]` | 否 | 子菜单 |
|
|
5209
|
+
|
|
5210
|
+
**事件(emits)**
|
|
5211
|
+
|
|
5212
|
+
| 事件 | 参数 | 说明 |
|
|
5213
|
+
| ----------------- | -------------------- | -------------------- |
|
|
5214
|
+
| `update:selected` | `string` | `v-model` 更新 |
|
|
5215
|
+
| `select` | `string, MenuOption` | 选中叶子菜单项时触发 |
|
|
5216
|
+
|
|
4946
5217
|
#### `ZlEmpty`
|
|
4947
5218
|
|
|
4948
5219
|
<sub>入口 `@zl-ui-kit/components` · 源码 `packages/components/src/components/ZlEmpty/index.vue`</sub>
|
|
@@ -4957,7 +5228,7 @@ import { ZlEmpty } from '@zl-ui-kit/components'
|
|
|
4957
5228
|
</script>
|
|
4958
5229
|
|
|
4959
5230
|
<template>
|
|
4960
|
-
<ZlEmpty />
|
|
5231
|
+
<ZlEmpty text="内容已加载" />
|
|
4961
5232
|
</template>
|
|
4962
5233
|
```
|
|
4963
5234
|
|
|
@@ -6988,6 +7259,20 @@ ZlGrid 子项 schema
|
|
|
6988
7259
|
| `slot` | `boolean` | 否 | 是否启用具名插槽(#key)渲染 |
|
|
6989
7260
|
| `ellipsis` | `number \| boolean` | 否 | 溢出省略行数(悬浮提示) |
|
|
6990
7261
|
|
|
7262
|
+
#### `MenuOption`
|
|
7263
|
+
|
|
7264
|
+
<sub>源码 `packages/components/src/components/ZlMenu/types.ts`</sub>
|
|
7265
|
+
|
|
7266
|
+
ZlMenu 菜单项配置
|
|
7267
|
+
|
|
7268
|
+
| 字段 | 类型 | 必填 | 说明 |
|
|
7269
|
+
| ---------- | -------------- | ---- | ------------------------------------------------- |
|
|
7270
|
+
| `key` | `string` | 是 | 唯一标识:选中态、select 事件、路由跳转都以它为准 |
|
|
7271
|
+
| `label` | `string` | 是 | 菜单文案 |
|
|
7272
|
+
| `icon` | `string` | 否 | 图标名(@zl-ui-kit/icons 中的 `zl:*` 图标) |
|
|
7273
|
+
| `disabled` | `boolean` | 否 | 是否禁用 |
|
|
7274
|
+
| `children` | `MenuOption[]` | 否 | 子菜单 |
|
|
7275
|
+
|
|
6991
7276
|
#### `TableColumn`
|
|
6992
7277
|
|
|
6993
7278
|
<sub>源码 `packages/components/src/types.ts`</sub>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.zl-loading[data-v-2a50177b]{width:100%;height:100%;flex:1;min-width:1px;min-height:1px}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** 是否处于加载中 */
|
|
3
|
+
loading?: boolean;
|
|
4
|
+
/** 是否首屏就渲染内容(默认等首次 loading 结束后再挂载) */
|
|
5
|
+
forceRender?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: {
|
|
10
|
+
default?(_: {}): any;
|
|
11
|
+
};
|
|
12
|
+
refs: {};
|
|
13
|
+
rootEl: HTMLDivElement;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
17
|
+
loading: boolean;
|
|
18
|
+
forceRender: boolean;
|
|
19
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
20
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=index.vue.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import o from "./index2.vue.mjs";
|
|
2
|
+
import './index.css';/* empty css */
|
|
3
|
+
import t from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2a50177b"]]);
|
|
5
|
+
export {
|
|
6
|
+
p as default
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineComponent as r, ref as l, watch as d, resolveDirective as i, withDirectives as c, openBlock as s, createElementBlock as f, renderSlot as u, createCommentVNode as m } from "vue";
|
|
2
|
+
const p = { class: "zl-loading" }, _ = /* @__PURE__ */ r({
|
|
3
|
+
name: "ZlLoading",
|
|
4
|
+
__name: "index",
|
|
5
|
+
props: {
|
|
6
|
+
loading: { type: Boolean, default: !1 },
|
|
7
|
+
forceRender: { type: Boolean, default: !1 }
|
|
8
|
+
},
|
|
9
|
+
setup(o) {
|
|
10
|
+
const t = o, n = l(t.forceRender);
|
|
11
|
+
return d(
|
|
12
|
+
() => t.loading,
|
|
13
|
+
(e) => {
|
|
14
|
+
e || (n.value = !0);
|
|
15
|
+
},
|
|
16
|
+
{ immediate: !0 }
|
|
17
|
+
), (e, v) => {
|
|
18
|
+
const a = i("loading");
|
|
19
|
+
return c((s(), f("div", p, [
|
|
20
|
+
n.value ? u(e.$slots, "default", {}, void 0, !0, 0) : m("", !0)
|
|
21
|
+
])), [
|
|
22
|
+
[a, o.loading]
|
|
23
|
+
]);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
_ as default
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=index2.vue.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MenuOption } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
item: MenuOption;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
export default _default;
|
|
7
|
+
//# sourceMappingURL=ZlMenuItem.vue.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineComponent as k, resolveComponent as l, openBlock as t, createBlock as n, withCtx as i, createElementBlock as b, Fragment as s, renderList as y, createCommentVNode as c, createElementVNode as x, toDisplayString as o, createTextVNode as f } from "vue";
|
|
2
|
+
import u from "../ZlIcon/index.vue.mjs";
|
|
3
|
+
const M = /* @__PURE__ */ k({
|
|
4
|
+
name: "ZlMenuItem",
|
|
5
|
+
__name: "ZlMenuItem",
|
|
6
|
+
props: {
|
|
7
|
+
item: {}
|
|
8
|
+
},
|
|
9
|
+
setup(e) {
|
|
10
|
+
return (I, Z) => {
|
|
11
|
+
const d = l("ZlMenuItem", !0), a = l("el-sub-menu"), r = l("el-menu-item");
|
|
12
|
+
return e.item.children?.length ? (t(), n(a, {
|
|
13
|
+
key: 0,
|
|
14
|
+
index: e.item.key,
|
|
15
|
+
disabled: e.item.disabled
|
|
16
|
+
}, {
|
|
17
|
+
title: i(() => [
|
|
18
|
+
e.item.icon ? (t(), n(u, {
|
|
19
|
+
key: 0,
|
|
20
|
+
icon: e.item.icon
|
|
21
|
+
}, null, 8, ["icon"])) : c("", !0),
|
|
22
|
+
x("span", null, o(e.item.label), 1)
|
|
23
|
+
]),
|
|
24
|
+
default: i(() => [
|
|
25
|
+
(t(!0), b(s, null, y(e.item.children, (m) => (t(), n(d, {
|
|
26
|
+
key: m.key,
|
|
27
|
+
item: m
|
|
28
|
+
}, null, 8, ["item"]))), 128))
|
|
29
|
+
]),
|
|
30
|
+
_: 1
|
|
31
|
+
}, 8, ["index", "disabled"])) : (t(), n(r, {
|
|
32
|
+
key: 1,
|
|
33
|
+
index: e.item.key,
|
|
34
|
+
disabled: e.item.disabled
|
|
35
|
+
}, {
|
|
36
|
+
title: i(() => [
|
|
37
|
+
f(o(e.item.label), 1)
|
|
38
|
+
]),
|
|
39
|
+
default: i(() => [
|
|
40
|
+
e.item.icon ? (t(), n(u, {
|
|
41
|
+
key: 0,
|
|
42
|
+
icon: e.item.icon
|
|
43
|
+
}, null, 8, ["icon"])) : c("", !0)
|
|
44
|
+
]),
|
|
45
|
+
_: 1
|
|
46
|
+
}, 8, ["index", "disabled"]));
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
export {
|
|
51
|
+
M as default
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=ZlMenuItem.vue.mjs.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MenuOption } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 菜单项配置(支持 children 递归) */
|
|
4
|
+
items?: MenuOption[];
|
|
5
|
+
/** 是否收起为图标 */
|
|
6
|
+
collapsed?: boolean;
|
|
7
|
+
/** 菜单方向:vertical / horizontal */
|
|
8
|
+
mode?: 'vertical' | 'horizontal';
|
|
9
|
+
/** 是否只展开一个子菜单 */
|
|
10
|
+
uniqueOpened?: boolean;
|
|
11
|
+
/** 默认展开的子菜单 key 列表 */
|
|
12
|
+
defaultOpeneds?: string[];
|
|
13
|
+
/** 折叠动画(默认关闭,避免布局抖动) */
|
|
14
|
+
collapseTransition?: boolean;
|
|
15
|
+
/** 点击菜单项后的跳转回调(通常传 router.push),不传则只触发 select */
|
|
16
|
+
navigate?: (item: MenuOption) => void;
|
|
17
|
+
};
|
|
18
|
+
type __VLS_PublicProps = {
|
|
19
|
+
'selected'?: string;
|
|
20
|
+
} & __VLS_Props;
|
|
21
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
|
+
"update:selected": (value: string) => any;
|
|
23
|
+
} & {
|
|
24
|
+
select: (key: string, item: MenuOption) => any;
|
|
25
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
26
|
+
onSelect?: ((key: string, item: MenuOption) => any) | undefined;
|
|
27
|
+
"onUpdate:selected"?: ((value: string) => any) | undefined;
|
|
28
|
+
}>, {
|
|
29
|
+
mode: "vertical" | "horizontal";
|
|
30
|
+
collapsed: boolean;
|
|
31
|
+
collapseTransition: boolean;
|
|
32
|
+
items: MenuOption[];
|
|
33
|
+
uniqueOpened: boolean;
|
|
34
|
+
defaultOpeneds: string[];
|
|
35
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
export default _default;
|
|
37
|
+
//# sourceMappingURL=index.vue.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineComponent as p, useModel as v, resolveComponent as B, openBlock as o, createBlock as u, withCtx as h, createElementBlock as g, Fragment as q, renderList as x, mergeModels as c } from "vue";
|
|
2
|
+
import M from "./ZlMenuItem.vue.mjs";
|
|
3
|
+
const y = /* @__PURE__ */ p({
|
|
4
|
+
name: "ZlMenu",
|
|
5
|
+
__name: "index",
|
|
6
|
+
props: /* @__PURE__ */ c({
|
|
7
|
+
items: { default: () => [] },
|
|
8
|
+
collapsed: { type: Boolean, default: !1 },
|
|
9
|
+
mode: { default: "vertical" },
|
|
10
|
+
uniqueOpened: { type: Boolean, default: !1 },
|
|
11
|
+
defaultOpeneds: { default: () => [] },
|
|
12
|
+
collapseTransition: { type: Boolean, default: !1 },
|
|
13
|
+
navigate: {}
|
|
14
|
+
}, {
|
|
15
|
+
selected: { default: "" },
|
|
16
|
+
selectedModifiers: {}
|
|
17
|
+
}),
|
|
18
|
+
emits: /* @__PURE__ */ c(["select"], ["update:selected"]),
|
|
19
|
+
setup(e, { emit: f }) {
|
|
20
|
+
const d = e, i = v(e, "selected"), r = f;
|
|
21
|
+
function s(n, t) {
|
|
22
|
+
for (const l of n) {
|
|
23
|
+
if (l.key === t) return l;
|
|
24
|
+
const a = l.children && s(l.children, t);
|
|
25
|
+
if (a) return a;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function m(n) {
|
|
29
|
+
const t = s(d.items, n);
|
|
30
|
+
!t || t.disabled || (i.value = n, r("select", n, t), d.navigate?.(t));
|
|
31
|
+
}
|
|
32
|
+
return (n, t) => {
|
|
33
|
+
const l = B("el-menu");
|
|
34
|
+
return o(), u(l, {
|
|
35
|
+
class: "zl-menu",
|
|
36
|
+
"default-active": i.value,
|
|
37
|
+
collapse: e.collapsed,
|
|
38
|
+
mode: e.mode,
|
|
39
|
+
"unique-opened": e.uniqueOpened,
|
|
40
|
+
"default-openeds": e.defaultOpeneds,
|
|
41
|
+
"collapse-transition": e.collapseTransition,
|
|
42
|
+
onSelect: m
|
|
43
|
+
}, {
|
|
44
|
+
default: h(() => [
|
|
45
|
+
(o(!0), g(q, null, x(e.items, (a) => (o(), u(M, {
|
|
46
|
+
key: a.key,
|
|
47
|
+
item: a
|
|
48
|
+
}, null, 8, ["item"]))), 128))
|
|
49
|
+
]),
|
|
50
|
+
_: 1
|
|
51
|
+
}, 8, ["default-active", "collapse", "mode", "unique-opened", "default-openeds", "collapse-transition"]);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
y as default
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** ZlMenu 菜单项配置 */
|
|
2
|
+
export interface MenuOption {
|
|
3
|
+
/** 唯一标识:选中态、select 事件、路由跳转都以它为准 */
|
|
4
|
+
key: string;
|
|
5
|
+
/** 菜单文案 */
|
|
6
|
+
label: string;
|
|
7
|
+
/** 图标名(@zl-ui-kit/icons 中的 `zl:*` 图标) */
|
|
8
|
+
icon?: string;
|
|
9
|
+
/** 是否禁用 */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** 子菜单 */
|
|
12
|
+
children?: MenuOption[];
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -19,8 +19,10 @@ export { default as ZlDictTag } from './components/ZlDictTag/index.vue';
|
|
|
19
19
|
export { default as ZlDrawer } from './components/ZlDrawer/index.vue';
|
|
20
20
|
export { default as ZlDynamicComponent } from './components/ZlDynamicComponent/index.vue';
|
|
21
21
|
export { default as ZlPdfViewer } from './components/ZlPdfViewer/index.vue';
|
|
22
|
+
export { default as ZlLoading } from './components/ZlLoading/index.vue';
|
|
22
23
|
export { default as ZlLogin } from './components/ZlLogin/index.vue';
|
|
23
24
|
export { default as ZlLoginForm } from './components/ZlLogin/components/LoginForm.vue';
|
|
25
|
+
export { default as ZlMenu } from './components/ZlMenu/index.vue';
|
|
24
26
|
export { default as ZlEmpty } from './components/ZlEmpty/index.vue';
|
|
25
27
|
export { default as ZlForm } from './components/ZlForm/index.vue';
|
|
26
28
|
export { default as ZlFormChild } from './components/ZlForm/ZlFormChild.vue';
|
|
@@ -60,6 +62,7 @@ export { usePagination } from './components/ZlPagination/usePagination';
|
|
|
60
62
|
export { useTablePagination } from './components/ZlTable/useTablePagination';
|
|
61
63
|
export { usePermission, usePermissionProvider } from './components/ZlPermission/usePermission';
|
|
62
64
|
export type { MenuItem } from './components/ZlAppMenu/AppMenu.vue';
|
|
65
|
+
export type { MenuOption } from './components/ZlMenu/types';
|
|
63
66
|
export type { StepItem } from './components/ZlStep/index.vue';
|
|
64
67
|
export type { ActionItem, FormItem, SearchItem, TableColumn } from './types';
|
|
65
68
|
export type { IGridItem } from './components/ZlGrid/types';
|
package/dist/index.mjs
CHANGED
|
@@ -37,55 +37,58 @@ import I from "./components/ZlGrid/index.vue.mjs";
|
|
|
37
37
|
/* empty css */
|
|
38
38
|
import L from "./components/ZlHorizontalTable/index.vue.mjs";
|
|
39
39
|
import D from "./components/ZlIcon/index.vue.mjs";
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
40
|
+
import y from "./components/ZlI18nProvider/index.vue.mjs";
|
|
41
|
+
import v from "./components/ZlIconHover/index.vue.mjs";
|
|
42
|
+
import w from "./components/ZlIconLabel/index.vue.mjs";
|
|
43
43
|
/* empty css */
|
|
44
|
-
import
|
|
44
|
+
import M from "./components/ZlLayoutSwitch/index.vue.mjs";
|
|
45
|
+
import F from "./components/ZlLoading/index.vue.mjs";
|
|
45
46
|
import G from "./components/ZlLogin/index.vue.mjs";
|
|
46
47
|
/* empty css */
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
|
|
50
|
-
import E from "./components/
|
|
48
|
+
import k from "./components/ZlLogin/components/LoginForm.vue.mjs";
|
|
49
|
+
import z from "./components/ZlMenu/index.vue.mjs";
|
|
50
|
+
/* empty css */
|
|
51
|
+
import E from "./components/ZlPageContainer/index.vue.mjs";
|
|
52
|
+
import H from "./components/ZlPagination/index.vue.mjs";
|
|
53
|
+
import j from "./components/ZlPdfViewer/index.vue.mjs";
|
|
51
54
|
/* empty css */
|
|
52
|
-
import
|
|
53
|
-
import
|
|
55
|
+
import R from "./components/ZlPermission/index.vue.mjs";
|
|
56
|
+
import V from "./components/ZlPopconfirm/index.vue.mjs";
|
|
54
57
|
/* empty css */
|
|
55
|
-
import
|
|
58
|
+
import q from "./components/ZlRadioTag/index.vue.mjs";
|
|
56
59
|
/* empty css */
|
|
57
|
-
import
|
|
60
|
+
import O from "./components/ZlSearch/index.vue.mjs";
|
|
58
61
|
/* empty css */
|
|
59
|
-
import
|
|
62
|
+
import U from "./components/ZlSearchTable/index.vue.mjs";
|
|
60
63
|
/* empty css */
|
|
61
|
-
import
|
|
64
|
+
import B from "./components/ZlSection/index.vue.mjs";
|
|
62
65
|
/* empty css */
|
|
63
|
-
import
|
|
64
|
-
import
|
|
65
|
-
import
|
|
66
|
-
import
|
|
66
|
+
import J from "./components/ZlSorter/index.vue.mjs";
|
|
67
|
+
import K from "./components/ZlSorter/ZlSorterList.vue.mjs";
|
|
68
|
+
import N from "./components/ZlStep/index.vue.mjs";
|
|
69
|
+
import Q from "./components/ZlSwitch/index.vue.mjs";
|
|
67
70
|
/* empty css */
|
|
68
|
-
import
|
|
71
|
+
import W from "./components/ZlTable/index.vue.mjs";
|
|
69
72
|
/* empty css */
|
|
70
|
-
import
|
|
73
|
+
import X from "./components/ZlTabs/index.vue.mjs";
|
|
71
74
|
/* empty css */
|
|
72
|
-
import
|
|
75
|
+
import Y from "./components/ZlTag/index.vue.mjs";
|
|
73
76
|
/* empty css */
|
|
74
|
-
import
|
|
75
|
-
import
|
|
76
|
-
import
|
|
77
|
+
import oo from "./components/ZlText/index.vue.mjs";
|
|
78
|
+
import ro from "./components/ZlTitle/index.vue.mjs";
|
|
79
|
+
import mo from "./components/ZlTree/index.vue.mjs";
|
|
77
80
|
/* empty css */
|
|
78
|
-
import
|
|
79
|
-
import
|
|
80
|
-
import { presetIconifyIcon as
|
|
81
|
-
import { usePagination as
|
|
82
|
-
import { useTablePagination as
|
|
83
|
-
import { usePermission as
|
|
84
|
-
import { createZlI18n as
|
|
85
|
-
import { default as
|
|
86
|
-
import { zlMessages as
|
|
87
|
-
import { default as
|
|
88
|
-
const
|
|
81
|
+
import io from "./components/ZlTreeSelect/index.vue.mjs";
|
|
82
|
+
import to from "./components/ZlUpload/index.vue.mjs";
|
|
83
|
+
import { presetIconifyIcon as Hr } from "./components/ZlIcon/presetIconifyIcon.mjs";
|
|
84
|
+
import { usePagination as Rr } from "./components/ZlPagination/usePagination.mjs";
|
|
85
|
+
import { useTablePagination as qr } from "./components/ZlTable/useTablePagination.mjs";
|
|
86
|
+
import { usePermission as Ur, usePermissionProvider as Br } from "./components/ZlPermission/usePermission.mjs";
|
|
87
|
+
import { createZlI18n as Kr } from "./locales/createZlI18n.mjs";
|
|
88
|
+
import { default as Qr } from "./locales/en.mjs";
|
|
89
|
+
import { zlMessages as Xr } from "./locales/messages.mjs";
|
|
90
|
+
import { default as om } from "./locales/zh-cn.mjs";
|
|
91
|
+
const ao = {
|
|
89
92
|
ZlAction: i,
|
|
90
93
|
ZlActionList: t,
|
|
91
94
|
ZlAddSub: a,
|
|
@@ -112,41 +115,43 @@ const io = {
|
|
|
112
115
|
ZlGrid: I,
|
|
113
116
|
ZlHorizontalTable: L,
|
|
114
117
|
ZlIcon: D,
|
|
115
|
-
ZlI18nProvider:
|
|
116
|
-
ZlIconHover:
|
|
117
|
-
ZlIconLabel:
|
|
118
|
+
ZlI18nProvider: y,
|
|
119
|
+
ZlIconHover: v,
|
|
120
|
+
ZlIconLabel: w,
|
|
118
121
|
ZlCornerTag: g,
|
|
119
|
-
ZlLayoutSwitch:
|
|
122
|
+
ZlLayoutSwitch: M,
|
|
123
|
+
ZlLoading: F,
|
|
120
124
|
ZlLogin: G,
|
|
121
|
-
ZlLoginForm:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
125
|
+
ZlLoginForm: k,
|
|
126
|
+
ZlMenu: z,
|
|
127
|
+
ZlPageContainer: E,
|
|
128
|
+
ZlPagination: H,
|
|
129
|
+
ZlPdfViewer: j,
|
|
130
|
+
ZlPermission: R,
|
|
131
|
+
ZlPopconfirm: V,
|
|
132
|
+
ZlRadioTag: q,
|
|
133
|
+
ZlSearch: O,
|
|
134
|
+
ZlSearchTable: U,
|
|
135
|
+
ZlSection: B,
|
|
136
|
+
ZlSorter: J,
|
|
137
|
+
ZlSorterList: K,
|
|
138
|
+
ZlStep: N,
|
|
139
|
+
ZlSwitch: Q,
|
|
140
|
+
ZlTable: W,
|
|
141
|
+
ZlTabs: X,
|
|
142
|
+
ZlTag: Y,
|
|
143
|
+
ZlText: oo,
|
|
144
|
+
ZlTitle: ro,
|
|
145
|
+
ZlUpload: to,
|
|
146
|
+
ZlTree: mo,
|
|
147
|
+
ZlTreeSelect: io
|
|
143
148
|
};
|
|
144
|
-
function
|
|
145
|
-
Object.entries(
|
|
149
|
+
function lo(o) {
|
|
150
|
+
Object.entries(ao).forEach(([r, m]) => {
|
|
146
151
|
o.component(r, m);
|
|
147
152
|
});
|
|
148
153
|
}
|
|
149
|
-
const
|
|
154
|
+
const kr = { install: lo };
|
|
150
155
|
export {
|
|
151
156
|
i as ZlAction,
|
|
152
157
|
t as ZlActionList,
|
|
@@ -174,44 +179,46 @@ export {
|
|
|
174
179
|
I as ZlGrid,
|
|
175
180
|
x as ZlGridItem,
|
|
176
181
|
L as ZlHorizontalTable,
|
|
177
|
-
|
|
182
|
+
y as ZlI18nProvider,
|
|
178
183
|
D as ZlIcon,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
184
|
+
v as ZlIconHover,
|
|
185
|
+
w as ZlIconLabel,
|
|
186
|
+
M as ZlLayoutSwitch,
|
|
187
|
+
F as ZlLoading,
|
|
182
188
|
G as ZlLogin,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
189
|
+
k as ZlLoginForm,
|
|
190
|
+
z as ZlMenu,
|
|
191
|
+
E as ZlPageContainer,
|
|
192
|
+
H as ZlPagination,
|
|
193
|
+
j as ZlPdfViewer,
|
|
194
|
+
R as ZlPermission,
|
|
195
|
+
V as ZlPopconfirm,
|
|
196
|
+
q as ZlRadioTag,
|
|
197
|
+
O as ZlSearch,
|
|
198
|
+
U as ZlSearchTable,
|
|
199
|
+
B as ZlSection,
|
|
200
|
+
J as ZlSorter,
|
|
201
|
+
K as ZlSorterList,
|
|
202
|
+
N as ZlStep,
|
|
203
|
+
Q as ZlSwitch,
|
|
204
|
+
W as ZlTable,
|
|
205
|
+
X as ZlTabs,
|
|
206
|
+
Y as ZlTag,
|
|
207
|
+
oo as ZlText,
|
|
208
|
+
ro as ZlTitle,
|
|
209
|
+
mo as ZlTree,
|
|
210
|
+
io as ZlTreeSelect,
|
|
211
|
+
to as ZlUpload,
|
|
212
|
+
Kr as createZlI18n,
|
|
213
|
+
kr as default,
|
|
214
|
+
lo as install,
|
|
215
|
+
Hr as presetIconifyIcon,
|
|
216
|
+
Rr as usePagination,
|
|
217
|
+
Ur as usePermission,
|
|
218
|
+
Br as usePermissionProvider,
|
|
219
|
+
qr as useTablePagination,
|
|
220
|
+
Qr as zlEnMessages,
|
|
221
|
+
Xr as zlMessages,
|
|
222
|
+
om as zlZhMessages
|
|
216
223
|
};
|
|
217
224
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zl-ui-kit/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "ZL UI 业务组件库(Element Plus 体系,Zl 前缀)——首批:Icon/AutoTooltip/Tag/CornerTag/Text/Title/Copy/Empty/Pagination/DictTag",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"file-type": "^20.4.1",
|
|
40
40
|
"dt-sql-parser": "^4.3.1",
|
|
41
41
|
"sql-formatter": "^15.4.2",
|
|
42
|
-
"@zl-ui-kit/
|
|
43
|
-
"@zl-ui-kit/
|
|
44
|
-
"@zl-ui-kit/utils": "0.
|
|
42
|
+
"@zl-ui-kit/icons": "0.19.0",
|
|
43
|
+
"@zl-ui-kit/composables": "0.19.0",
|
|
44
|
+
"@zl-ui-kit/utils": "0.19.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@vueuse/core": "^12.3.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
|
|
@@ -98,10 +98,10 @@
|
|
|
98
98
|
"@vue-office/pdf": "^2.0.10",
|
|
99
99
|
"@vue-office/pptx": "1.0.1",
|
|
100
100
|
"echarts": "^5.6.0",
|
|
101
|
+
"@jichuang/vite-config": "1.0.0",
|
|
101
102
|
"@jichuang/eslint-config": "1.0.0",
|
|
102
103
|
"@jichuang/tsconfig": "1.0.0",
|
|
103
|
-
"@
|
|
104
|
-
"@zl-ui-kit/theme": "0.18.7"
|
|
104
|
+
"@zl-ui-kit/theme": "0.19.0"
|
|
105
105
|
},
|
|
106
106
|
"repository": {
|
|
107
107
|
"type": "git",
|