@vrojs/element-plus 0.0.19 → 0.0.20
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/dist/index.js +21 -19
- package/dist/vro-el-table/types.d.ts +8 -1
- package/dist/vro-el-table/useVroElTable.d.ts +3 -8
- package/dist/vro-el-table/useVroElTable.js +23 -25
- package/dist/vro-el-table-column-group/defineVroElTableColumns.d.ts +2 -0
- package/dist/vro-el-table-column-group/defineVroElTableColumns.js +7 -0
- package/dist/vro-el-table-column-group/index.d.ts +1 -0
- package/dist/vro-el-table-column-group/index.js +11 -9
- package/dist/vro-el-table-column-group/useVroElTableColumnGroup.d.ts +1 -1
- package/dist/vro-el-table-column-group/useVroElTableColumnGroup.js +3 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { default as m } from "./locale/lang/zh-cn.js";
|
|
|
3
3
|
import { useLocale as t } from "./locale/useLocale.js";
|
|
4
4
|
import { datePickerValueFormat as f } from "./utils/datePickerValueFormat.js";
|
|
5
5
|
import { elTableColumnProps as E } from "./utils/elTableColumnProps.js";
|
|
6
|
-
import { parseType as
|
|
6
|
+
import { parseType as n } from "@vrojs/base";
|
|
7
7
|
import { VroElCheckboxGroup as V } from "./vro-el-checkbox-group/index.js";
|
|
8
8
|
import { VroElConfigProvider as g } from "./vro-el-config-provider/index.js";
|
|
9
9
|
import { VroElFileUpload as v } from "./vro-el-file-upload/index.js";
|
|
@@ -28,7 +28,7 @@ import { vroElCheckboxGroupProps as oo } from "./vro-el-checkbox-group/types.js"
|
|
|
28
28
|
import { provideVroElConfig as eo, setVroElGlobalConfig as lo, useVroElConfig as mo, useVroElGlobalConfig as po, vroElConfigContextKey as to } from "./vro-el-config-provider/config.js";
|
|
29
29
|
import { vroElConfigProviderProps as fo } from "./vro-el-config-provider/types.js";
|
|
30
30
|
import { vroElFileUploadProps as Eo } from "./vro-el-file-upload/types.js";
|
|
31
|
-
import { getVroElFileUploadOptions as
|
|
31
|
+
import { getVroElFileUploadOptions as no, setVroElFileUploadOptions as io } from "./vro-el-file-upload/utils.js";
|
|
32
32
|
import { vroElIconProps as co } from "./vro-el-icon/types.js";
|
|
33
33
|
import { vroElImageProps as uo } from "./vro-el-image/types.js";
|
|
34
34
|
import { getVroElImageOptions as Fo, setVroElImageOptions as ho } from "./vro-el-image/utils.js";
|
|
@@ -52,15 +52,16 @@ import { useVroElSchemaFormDrawer as mr } from "./vro-el-schema-form-drawer/useV
|
|
|
52
52
|
import { vroElSelectProps as tr } from "./vro-el-select/types.js";
|
|
53
53
|
import { vroElSkeletonProps as fr } from "./vro-el-skeleton/types.js";
|
|
54
54
|
import { vroElTableProps as Er } from "./vro-el-table/types.js";
|
|
55
|
-
import { useVroElTable as
|
|
55
|
+
import { useVroElTable as nr } from "./vro-el-table/useVroElTable.js";
|
|
56
56
|
import { vroElTableActionsColumnProps as Vr } from "./vro-el-table-actions-column/types.js";
|
|
57
57
|
import { vroElTableColumnProps as gr } from "./vro-el-table-column/types.js";
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
58
|
+
import { defineVroElTableColumns as vr } from "./vro-el-table-column-group/defineVroElTableColumns.js";
|
|
59
|
+
import { vroElTableColumnGroupProps as hr } from "./vro-el-table-column-group/types.js";
|
|
60
|
+
import { useVroElTableColumnGroup as Pr } from "./vro-el-table-column-group/useVroElTableColumnGroup.js";
|
|
61
|
+
import { vroElTableColumnGroupColumnManager as dr } from "./vro-el-table-column-group/vroElTableColumnGroupColumnManager.js";
|
|
62
|
+
import { vroElTagsProps as br } from "./vro-el-tags/types.js";
|
|
63
|
+
import { vroElTreeProps as Dr } from "./vro-el-tree/types.js";
|
|
64
|
+
import { vroElWithConfigProps as wr } from "./vro-el-with-config/types.js";
|
|
64
65
|
export {
|
|
65
66
|
V as VroElCheckboxGroup,
|
|
66
67
|
g as VroElConfigProvider,
|
|
@@ -85,14 +86,15 @@ export {
|
|
|
85
86
|
f as datePickerValueFormat,
|
|
86
87
|
Oo as defineVroElSchemaFormCreateField,
|
|
87
88
|
yo as defineVroElSchemaFormFieldTrigger,
|
|
89
|
+
vr as defineVroElTableColumns,
|
|
88
90
|
E as elTableColumnProps,
|
|
89
91
|
e as en,
|
|
90
|
-
|
|
92
|
+
no as getVroElFileUploadOptions,
|
|
91
93
|
Fo as getVroElImageOptions,
|
|
92
94
|
To as getVroElImageUploadOptions,
|
|
93
|
-
|
|
95
|
+
n as parseType,
|
|
94
96
|
eo as provideVroElConfig,
|
|
95
|
-
|
|
97
|
+
io as setVroElFileUploadOptions,
|
|
96
98
|
lo as setVroElGlobalConfig,
|
|
97
99
|
ho as setVroElImageOptions,
|
|
98
100
|
bo as setVroElImageUploadOptions,
|
|
@@ -106,8 +108,8 @@ export {
|
|
|
106
108
|
qo as useVroElSchemaFormDialogInstance,
|
|
107
109
|
mr as useVroElSchemaFormDrawer,
|
|
108
110
|
$o as useVroElSchemaFormDrawerInstance,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
nr as useVroElTable,
|
|
112
|
+
Pr as useVroElTableColumnGroup,
|
|
111
113
|
oo as vroElCheckboxGroupProps,
|
|
112
114
|
to as vroElConfigContextKey,
|
|
113
115
|
fo as vroElConfigProviderProps,
|
|
@@ -126,12 +128,12 @@ export {
|
|
|
126
128
|
tr as vroElSelectProps,
|
|
127
129
|
fr as vroElSkeletonProps,
|
|
128
130
|
Vr as vroElTableActionsColumnProps,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
dr as vroElTableColumnGroupColumnManager,
|
|
132
|
+
hr as vroElTableColumnGroupProps,
|
|
131
133
|
gr as vroElTableColumnProps,
|
|
132
134
|
Er as vroElTableProps,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
br as vroElTagsProps,
|
|
136
|
+
Dr as vroElTreeProps,
|
|
137
|
+
wr as vroElWithConfigProps,
|
|
136
138
|
m as zhCN
|
|
137
139
|
};
|
|
@@ -16,8 +16,15 @@ export type VroElTableRequestParams = [currentPage: number, pageSize: number];
|
|
|
16
16
|
* 请求函数的查询参数。
|
|
17
17
|
*/
|
|
18
18
|
export type VroElTableRequestQuery = Record<string, any>;
|
|
19
|
+
/**
|
|
20
|
+
* 请求函数的返回值:`[列表, 总数]`。
|
|
21
|
+
*
|
|
22
|
+
* 额外接受普通数组写法(`Array<T[] | number>`):调用方写成 `async () => [[], 1]`
|
|
23
|
+
* 时数组字面量不一定被推断成元组,只按元组校验会误报。
|
|
24
|
+
*/
|
|
25
|
+
export type VroElTableRequestResult<T> = [T[], number] | Array<T[] | number>;
|
|
19
26
|
export interface VroElTableRequest<T = any> {
|
|
20
|
-
(state: VroElTableRequestParams, query: VroElTableRequestQuery): Promise<
|
|
27
|
+
(state: VroElTableRequestParams, query: VroElTableRequestQuery): Promise<VroElTableRequestResult<T>>;
|
|
21
28
|
}
|
|
22
29
|
export interface VroElTableEmits {
|
|
23
30
|
request: [payload?: VroElTableRequestPayload];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { UseAsyncTaskOptions } from '@vrojs/use';
|
|
2
2
|
import { ComputedRef, Ref } from 'vue';
|
|
3
3
|
import { VroElSchemaFormSchema, VroElSchemaFormSchemaFieldBase } from '../vro-el-schema-form';
|
|
4
|
-
import { VroElTableColumnGroupColumns } from '../vro-el-table-column-group';
|
|
5
4
|
import { VroElTableRequest } from './types';
|
|
6
5
|
export interface UseVroElTableOptions<Row extends Record<string, any> = any> extends Pick<UseAsyncTaskOptions<any>, 'activated' | 'immediate' | 'throwError' | 'onError'> {
|
|
7
6
|
query?: Ref<Record<string, any>>;
|
|
@@ -23,7 +22,6 @@ export interface UseVroElTablePagination {
|
|
|
23
22
|
export interface UseVroElTableTableProps<Row extends Record<string, any> = any, R extends VroElSchemaFormSchema = never> {
|
|
24
23
|
schema: UseVroElTableSchema<R> | undefined;
|
|
25
24
|
loading: boolean;
|
|
26
|
-
columns: VroElTableColumnGroupColumns<Row>;
|
|
27
25
|
data: Row[];
|
|
28
26
|
pagination: UseVroElTablePagination;
|
|
29
27
|
}
|
|
@@ -35,7 +33,6 @@ export interface UseVroElTableReturn<Row extends Record<string, any> = any, R ex
|
|
|
35
33
|
tableProps: ComputedRef<UseVroElTableTableProps<Row, R>>;
|
|
36
34
|
query: Ref<Record<string, any> | undefined>;
|
|
37
35
|
schema: UseVroElTableSchemaResult<R>;
|
|
38
|
-
columns: VroElTableColumnGroupColumns<Row>;
|
|
39
36
|
trigger: (params?: UseVroElTableAsyncTaskParams) => Promise<Row[]>;
|
|
40
37
|
data: Ref<Row[]>;
|
|
41
38
|
loading: Ref<boolean>;
|
|
@@ -44,10 +41,8 @@ export interface UseVroElTableReturn<Row extends Record<string, any> = any, R ex
|
|
|
44
41
|
/**
|
|
45
42
|
* 表格请求状态管理。
|
|
46
43
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
44
|
+
* 只负责筛选、分页、请求和 loading 状态,不接管列配置;
|
|
45
|
+
* 列配置请用 `defineVroElTableColumns<Row>()` 单独定义后传给表格组件。
|
|
49
46
|
*/
|
|
50
|
-
export declare function useVroElTable<Row extends Record<string, any>, R extends VroElSchemaFormSchema = VroElSchemaFormSchema>(rowSchema: R, request: VroElTableRequest<Row>, rawColumns: VroElTableColumnGroupColumns<Row>, options?: UseVroElTableOptions<Row>): UseVroElTableReturn<Row, R>;
|
|
51
|
-
export declare function useVroElTable<Row extends Record<string, any>>(request: VroElTableRequest<Row>, rawColumns: VroElTableColumnGroupColumns<Row>, options?: UseVroElTableOptions<Row>): UseVroElTableReturn<Row, never>;
|
|
52
|
-
export declare function useVroElTable<Row extends Record<string, any>, R extends VroElSchemaFormSchema = VroElSchemaFormSchema>(rowSchema: R, request: VroElTableRequest<Row>, options?: UseVroElTableOptions<Row>): UseVroElTableReturn<Row, R>;
|
|
53
47
|
export declare function useVroElTable<Row extends Record<string, any>>(request: VroElTableRequest<Row>, options?: UseVroElTableOptions<Row>): UseVroElTableReturn<Row, never>;
|
|
48
|
+
export declare function useVroElTable<Row extends Record<string, any>, R extends VroElSchemaFormSchema = VroElSchemaFormSchema>(rowSchema: R, request: VroElTableRequest<Row>, options?: UseVroElTableOptions<Row>): UseVroElTableReturn<Row, R>;
|
|
@@ -1,44 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { isNumber as
|
|
3
|
-
import { useAsyncTask as
|
|
4
|
-
import { reactive as
|
|
5
|
-
function
|
|
6
|
-
const i =
|
|
1
|
+
import S from "../node_modules/.pnpm/@ajuanjs_banana@0.0.3/node_modules/@ajuanjs/banana/dist/index.js";
|
|
2
|
+
import { isNumber as h, filterEmptyValue as x } from "@daysnap/utils";
|
|
3
|
+
import { useAsyncTask as z } from "@vrojs/use";
|
|
4
|
+
import { reactive as g, ref as E, computed as T } from "vue";
|
|
5
|
+
function N(r, n, d) {
|
|
6
|
+
const i = typeof r != "function", u = i ? r : void 0, p = i ? n : r, y = (i ? d : n) ?? {}, a = u ? g(u) : void 0, { query: m, ...v } = y, o = m ?? E(), t = g({
|
|
7
7
|
currentPage: 1,
|
|
8
8
|
pageSize: 10,
|
|
9
9
|
total: 0
|
|
10
|
-
}), { trigger:
|
|
11
|
-
async (
|
|
12
|
-
|
|
13
|
-
const { currentPage:
|
|
14
|
-
|
|
15
|
-
const [
|
|
16
|
-
return t.total =
|
|
10
|
+
}), { trigger: P, data: c, loading: l } = z(
|
|
11
|
+
async (e) => {
|
|
12
|
+
h(e) && (e = { currentPage: e });
|
|
13
|
+
const { currentPage: s, pageSize: f } = Object.assign({}, t, e);
|
|
14
|
+
e?.query && (o.value = e.query), o.value || (o.value = a ? x(await S.extract(a), !0) : {}), t.currentPage = s, t.pageSize = f;
|
|
15
|
+
const [b, w] = await p([s, f], o.value);
|
|
16
|
+
return t.total = w, b || [];
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
immediate: !0,
|
|
20
20
|
throwError: !0,
|
|
21
21
|
initialValue: [],
|
|
22
|
-
...
|
|
22
|
+
...v
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
25
|
return {
|
|
26
|
-
tableProps:
|
|
27
|
-
schema:
|
|
28
|
-
loading:
|
|
29
|
-
|
|
30
|
-
data: y.value,
|
|
26
|
+
tableProps: T(() => ({
|
|
27
|
+
schema: a,
|
|
28
|
+
loading: l.value,
|
|
29
|
+
data: c.value,
|
|
31
30
|
pagination: t
|
|
32
31
|
})),
|
|
33
32
|
query: o,
|
|
34
|
-
schema:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
loading: g,
|
|
33
|
+
schema: a,
|
|
34
|
+
trigger: P,
|
|
35
|
+
data: c,
|
|
36
|
+
loading: l,
|
|
39
37
|
pagination: t
|
|
40
38
|
};
|
|
41
39
|
}
|
|
42
40
|
export {
|
|
43
|
-
|
|
41
|
+
N as useVroElTable
|
|
44
42
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { withInstall as o } from "@vrojs/base";
|
|
2
2
|
import r from "./vro-el-table-column-group.vue.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
3
|
+
import { defineVroElTableColumns as a } from "./defineVroElTableColumns.js";
|
|
4
|
+
import { vroElTableColumnGroupProps as t } from "./types.js";
|
|
5
|
+
import { useVroElTableColumnGroup as s } from "./useVroElTableColumnGroup.js";
|
|
6
|
+
import { vroElTableColumnGroupColumnManager as b } from "./vroElTableColumnGroupColumnManager.js";
|
|
7
|
+
const m = o(r);
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
s as
|
|
12
|
-
|
|
9
|
+
m as VroElTableColumnGroup,
|
|
10
|
+
m as default,
|
|
11
|
+
a as defineVroElTableColumns,
|
|
12
|
+
s as useVroElTableColumnGroup,
|
|
13
|
+
b as vroElTableColumnGroupColumnManager,
|
|
14
|
+
t as vroElTableColumnGroupProps
|
|
13
15
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { VroElTableColumnGroupColumns } from './types';
|
|
2
|
-
export declare function useVroElTableColumnGroup<T extends Record<string, any> = any>(
|
|
2
|
+
export declare function useVroElTableColumnGroup<T extends Record<string, any> = any>(columns: VroElTableColumnGroupColumns<T> | (() => VroElTableColumnGroupColumns<T>)): import('vue').Reactive<VroElTableColumnGroupColumns<T>>;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { reactive as r } from "vue";
|
|
2
|
+
import { defineVroElTableColumns as e } from "./defineVroElTableColumns.js";
|
|
3
3
|
function n(o) {
|
|
4
|
-
return
|
|
5
|
-
r(o) ? o() : o
|
|
6
|
-
);
|
|
4
|
+
return r(e(o));
|
|
7
5
|
}
|
|
8
6
|
export {
|
|
9
7
|
n as useVroElTableColumnGroup
|