@aplus-frontend/ui 6.36.0 → 6.38.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/es/index.mjs +224 -231
- package/es/src/ag-grid/components/row/index.vue.d.ts +6 -0
- package/es/src/ag-grid/components/row/index.vue.mjs +4 -0
- package/es/src/ag-grid/components/row/index.vue2.mjs +14 -0
- package/es/src/ag-grid/editable/form-item.vue.mjs +10 -9
- package/es/src/ag-grid/editable/index.vue.mjs +17 -16
- package/es/src/ag-grid/hooks/use-row-selection.d.ts +1 -1
- package/es/src/ag-grid/hooks/use-row-selection.mjs +81 -68
- package/es/src/ag-grid/index.vue.d.ts +4 -31
- package/es/src/ag-grid/index.vue.mjs +256 -232
- package/es/src/ag-grid/interface.d.ts +55 -3
- package/es/src/ap-action/group/index.vue.mjs +45 -35
- package/es/src/ap-action/interface.d.ts +17 -0
- package/es/src/ap-action/item/index.vue2.mjs +42 -25
- package/es/src/ap-action/item-dropdown/index.vue.mjs +22 -20
- package/es/src/ap-action/item-modal/index.vue.mjs +14 -12
- package/es/src/ap-action/item-popconfirm/index.vue.mjs +13 -11
- package/es/src/index.d.ts +0 -1
- package/es/src/index.mjs +280 -288
- package/es/src/path-map.mjs +0 -1
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ag-grid/components/row/index.vue.d.ts +6 -0
- package/lib/src/ag-grid/components/row/index.vue.js +1 -0
- package/lib/src/ag-grid/components/row/index.vue2.js +1 -0
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/hooks/use-row-selection.d.ts +1 -1
- package/lib/src/ag-grid/hooks/use-row-selection.js +1 -1
- package/lib/src/ag-grid/index.vue.d.ts +4 -31
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +55 -3
- package/lib/src/ap-action/group/index.vue.js +1 -1
- package/lib/src/ap-action/interface.d.ts +17 -0
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
- package/lib/src/ap-action/item-modal/index.vue.js +1 -1
- package/lib/src/ap-action/item-popconfirm/index.vue.js +1 -1
- package/lib/src/index.d.ts +0 -1
- package/lib/src/index.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
- package/theme/ag-grid/index.css +6 -0
- package/theme/ap-action/item.css +6 -0
- package/theme/ap-action/item.less +9 -0
- package/theme/ap-grid/index.css +6 -0
- package/theme/ap-table/ap-table.css +6 -0
- package/theme/ap-table-modal/index.css +6 -0
- package/theme/editable-table/index.css +6 -0
- package/theme/index.css +6 -3
- package/theme/index.less +0 -1
- package/es/src/work-order-modal/createWorkOrder.d.ts +0 -3
- package/es/src/work-order-modal/createWorkOrder.mjs +0 -32
- package/es/src/work-order-modal/help-message.vue.d.ts +0 -3
- package/es/src/work-order-modal/help-message.vue.mjs +0 -4
- package/es/src/work-order-modal/help-message.vue2.mjs +0 -36
- package/es/src/work-order-modal/index.d.ts +0 -4
- package/es/src/work-order-modal/index.mjs +0 -8
- package/es/src/work-order-modal/interfaces.d.ts +0 -31
- package/es/src/work-order-modal/interfaces.mjs +0 -9
- package/es/src/work-order-modal/style/css.d.ts +0 -0
- package/es/src/work-order-modal/style/css.js +0 -4
- package/es/src/work-order-modal/style/index.d.ts +0 -0
- package/es/src/work-order-modal/style/index.js +0 -4
- package/es/src/work-order-modal/work-order-modal.vue.d.ts +0 -846
- package/es/src/work-order-modal/work-order-modal.vue.mjs +0 -192
- package/es/src/work-order-modal/work-order-modal.vue2.mjs +0 -4
- package/lib/src/work-order-modal/createWorkOrder.d.ts +0 -3
- package/lib/src/work-order-modal/createWorkOrder.js +0 -1
- package/lib/src/work-order-modal/help-message.vue.d.ts +0 -3
- package/lib/src/work-order-modal/help-message.vue.js +0 -1
- package/lib/src/work-order-modal/help-message.vue2.js +0 -1
- package/lib/src/work-order-modal/index.d.ts +0 -4
- package/lib/src/work-order-modal/index.js +0 -1
- package/lib/src/work-order-modal/interfaces.d.ts +0 -31
- package/lib/src/work-order-modal/interfaces.js +0 -1
- package/lib/src/work-order-modal/style/css.cjs +0 -4
- package/lib/src/work-order-modal/style/css.d.ts +0 -0
- package/lib/src/work-order-modal/style/index.cjs +0 -4
- package/lib/src/work-order-modal/style/index.d.ts +0 -0
- package/lib/src/work-order-modal/work-order-modal.vue.d.ts +0 -846
- package/lib/src/work-order-modal/work-order-modal.vue.js +0 -1
- package/lib/src/work-order-modal/work-order-modal.vue2.js +0 -1
|
@@ -4,7 +4,7 @@ import { TableProps } from '@aplus-frontend/antdv';
|
|
|
4
4
|
import { ApFormSearchFormPopoverSorterItem, ApFormSearchFormProps } from '../ap-form/interface';
|
|
5
5
|
import { Recordable } from '../type';
|
|
6
6
|
import { SortOrder, TableRowSelection } from '@aplus-frontend/antdv/es/table/interface';
|
|
7
|
-
import { ColDef, GridApi, ICellRendererParams, IRowNode, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowPinnedType, ScrollDirection } from 'ag-grid-community';
|
|
7
|
+
import { ColDef, GridApi, ICellRendererParams, IRowNode, IsFullWidthRowParams, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowHeightParams, RowPinnedType, ScrollDirection } from 'ag-grid-community';
|
|
8
8
|
import { InternalPagingType } from '../ap-table/hooks/use-table-paging-ng';
|
|
9
9
|
export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ExtraProColumnType<RecordType>, 'sorter' | 'rowSpan' | 'customCell' | 'customHeaderCell' | 'minWidth' | 'width' | 'maxWidth' | 'className' | 'class' | 'colSpan'> & {
|
|
10
10
|
children?: AgGridColumnType<RecordType, ExtraValueType, ValueType>[];
|
|
@@ -123,6 +123,10 @@ export type AgGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>,
|
|
|
123
123
|
* 是否隐藏不可选中的元素
|
|
124
124
|
*/
|
|
125
125
|
hideDisabled?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* 默认选中的行数据(如果没有rowKey将会被过滤掉,如果和defaultSelectedRowKeys同时使用,优先级更低)
|
|
128
|
+
*/
|
|
129
|
+
defaultSelectedRows?: RecordType[];
|
|
126
130
|
};
|
|
127
131
|
export type AgGridVirtualConfig = {
|
|
128
132
|
row?: boolean;
|
|
@@ -135,7 +139,20 @@ export type AgGridSummaryType<RecordType = any> = {
|
|
|
135
139
|
cellClassName?: string | string[] | ((data: RecordType, column: ColDef<RecordType>, pinned: RowPinnedType, rowIndex: number) => string | string[]);
|
|
136
140
|
rowClassName?: string | string[] | ((data: RecordType, rowIndex: number, pinned: RowPinnedType) => string | string[]);
|
|
137
141
|
};
|
|
138
|
-
export type
|
|
142
|
+
export type AgGridCustomRowConfig<RecordType = any> = {
|
|
143
|
+
/**
|
|
144
|
+
* 判断哪些行是自定义渲染行
|
|
145
|
+
* @param params
|
|
146
|
+
* @returns
|
|
147
|
+
*/
|
|
148
|
+
isCustomRow: (params: IsFullWidthRowParams<RecordType>) => boolean;
|
|
149
|
+
/**
|
|
150
|
+
* 行自定义渲染函数
|
|
151
|
+
* @returns
|
|
152
|
+
*/
|
|
153
|
+
render: (params: any) => any;
|
|
154
|
+
};
|
|
155
|
+
export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowClassName' | 'footer' | 'loading' | 'sticky' | 'customRow'> & {
|
|
139
156
|
/**
|
|
140
157
|
* 列配置
|
|
141
158
|
*/
|
|
@@ -239,6 +256,13 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
239
256
|
* 指定每一行占据的高度(大量数据展示时的性能优化)
|
|
240
257
|
*/
|
|
241
258
|
rowHeight?: number;
|
|
259
|
+
/**
|
|
260
|
+
* 指定一行占据的高度
|
|
261
|
+
* @since 6.38.0
|
|
262
|
+
* @param params
|
|
263
|
+
* @returns
|
|
264
|
+
*/
|
|
265
|
+
getRowHeight?: (params: RowHeightParams<RecordType>) => number | null | undefined;
|
|
242
266
|
/**
|
|
243
267
|
* 是否使用另外一种渲染器来渲染单元格
|
|
244
268
|
*/
|
|
@@ -282,6 +306,11 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
282
306
|
* @returns
|
|
283
307
|
*/
|
|
284
308
|
onUpdate?: () => void;
|
|
309
|
+
/**
|
|
310
|
+
* 自定义行渲染配置
|
|
311
|
+
* @since 6.37.0
|
|
312
|
+
*/
|
|
313
|
+
customRow?: AgGridCustomRowConfig;
|
|
285
314
|
};
|
|
286
315
|
export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
287
316
|
/**
|
|
@@ -328,11 +357,19 @@ export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
328
357
|
rowSelection: {
|
|
329
358
|
selectedRows: ComputedRef<RecordType[]>;
|
|
330
359
|
/**
|
|
331
|
-
* 通过
|
|
360
|
+
* 通过rowKey来选中行
|
|
361
|
+
* 如果是单选模式,只会选择数组中的第一个元素做选中操作
|
|
332
362
|
* @param keys
|
|
333
363
|
* @returns
|
|
334
364
|
*/
|
|
335
365
|
setSelectedRowKeys: (keys: (string | number)[]) => void;
|
|
366
|
+
/**
|
|
367
|
+
* 通过整行数据来选中行
|
|
368
|
+
* 如果是单选模式,只会选择数组中的第一个元素做选中操作
|
|
369
|
+
* @param rows
|
|
370
|
+
* @returns
|
|
371
|
+
*/
|
|
372
|
+
setSelectedRows: (rows: RecordType[]) => void;
|
|
336
373
|
clearAll: () => void;
|
|
337
374
|
};
|
|
338
375
|
/**
|
|
@@ -392,3 +429,18 @@ export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
392
429
|
*/
|
|
393
430
|
_internalGridApi?: GridApi | undefined;
|
|
394
431
|
};
|
|
432
|
+
export type AgGridSlots<RecordType> = {
|
|
433
|
+
/**
|
|
434
|
+
* 自定义查询表单额外的区域
|
|
435
|
+
*/
|
|
436
|
+
searchFormExtra?: any;
|
|
437
|
+
/**
|
|
438
|
+
* 自定义表格上部查询表单下部分区域的渲染
|
|
439
|
+
*/
|
|
440
|
+
title?: (params: {
|
|
441
|
+
selectedRows: RecordType[];
|
|
442
|
+
selectedRowKeys: (string | number)[];
|
|
443
|
+
shownColumns: AgGridColumnType<RecordType>[];
|
|
444
|
+
clearAll: () => void;
|
|
445
|
+
}) => any;
|
|
446
|
+
};
|
|
@@ -1,67 +1,77 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Space as
|
|
1
|
+
import { defineComponent as k, computed as m, unref as c, createBlock as n, openBlock as o, withCtx as A, createElementBlock as a, createCommentVNode as y, Fragment as p, renderList as v, mergeProps as s } from "vue";
|
|
2
|
+
import { Space as w } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../item/index.vue.mjs";
|
|
4
4
|
import "../item-modal/index.vue2.mjs";
|
|
5
5
|
import "../item-popconfirm/index.vue2.mjs";
|
|
6
6
|
import "../item-dropdown/index.vue2.mjs";
|
|
7
7
|
import "../../config-provider/index.mjs";
|
|
8
|
-
import { isUndefined as
|
|
8
|
+
import { isUndefined as F } from "lodash-unified";
|
|
9
9
|
import { useLocale as x } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
const q = /* @__PURE__ */
|
|
10
|
+
import f from "../item-dropdown/index.vue.mjs";
|
|
11
|
+
import B from "../item-modal/index.vue.mjs";
|
|
12
|
+
import $ from "../item-popconfirm/index.vue.mjs";
|
|
13
|
+
import b from "../item/index.vue2.mjs";
|
|
14
|
+
const q = /* @__PURE__ */ k({
|
|
15
15
|
name: "ApActionGroup",
|
|
16
16
|
__name: "index",
|
|
17
17
|
props: {
|
|
18
18
|
count: { default: 3 },
|
|
19
19
|
trigger: { default: () => ["hover"] },
|
|
20
20
|
placement: { default: "bottomRight" },
|
|
21
|
-
actions: { default: () => [] }
|
|
21
|
+
actions: { default: () => [] },
|
|
22
|
+
iconFirst: { type: Boolean }
|
|
22
23
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
() =>
|
|
26
|
-
(
|
|
24
|
+
setup(_) {
|
|
25
|
+
const r = _, { t: g } = x(), l = m(
|
|
26
|
+
() => r.actions.filter(
|
|
27
|
+
(t) => t.visible || F(t.visible)
|
|
27
28
|
)
|
|
28
|
-
),
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
), d = m(() => c(l).length > r.count), u = m(() => {
|
|
30
|
+
const t = c(l);
|
|
31
|
+
if (t.length <= r.count)
|
|
32
|
+
return {
|
|
33
|
+
showActions: t.map((e) => ({
|
|
34
|
+
...e,
|
|
35
|
+
iconFirst: !0
|
|
36
|
+
})),
|
|
37
|
+
menuActions: []
|
|
38
|
+
};
|
|
39
|
+
let i = t.slice(0, r.count - 1);
|
|
40
|
+
return r.iconFirst && (i = i.map((e) => ({
|
|
41
|
+
...e,
|
|
42
|
+
iconFirst: !0
|
|
43
|
+
}))), {
|
|
44
|
+
showActions: i,
|
|
45
|
+
menuActions: t.slice(r.count - 1)
|
|
36
46
|
};
|
|
37
47
|
});
|
|
38
|
-
return (
|
|
48
|
+
return (t, i) => (o(), n(c(w), {
|
|
39
49
|
size: 16,
|
|
40
50
|
align: "center"
|
|
41
51
|
}, {
|
|
42
|
-
default:
|
|
43
|
-
(
|
|
44
|
-
|
|
52
|
+
default: A(() => [
|
|
53
|
+
(o(!0), a(p, null, v(u.value.showActions, (e, h) => (o(), a(p, { key: h }, [
|
|
54
|
+
e.actions ? (o(), n(f, s({
|
|
45
55
|
key: 0,
|
|
46
56
|
ref_for: !0
|
|
47
|
-
},
|
|
57
|
+
}, e), null, 16)) : e.modalProps ? (o(), n(B, s({
|
|
48
58
|
key: 1,
|
|
49
59
|
ref_for: !0
|
|
50
|
-
},
|
|
60
|
+
}, e), null, 16)) : e.popconfirmProps ? (o(), n($, s({
|
|
51
61
|
key: 2,
|
|
52
62
|
ref_for: !0
|
|
53
|
-
},
|
|
63
|
+
}, e), null, 16)) : (o(), n(b, s({
|
|
54
64
|
key: 3,
|
|
55
65
|
ref_for: !0
|
|
56
|
-
},
|
|
66
|
+
}, e), null, 16))
|
|
57
67
|
], 64))), 128)),
|
|
58
|
-
|
|
68
|
+
d.value ? (o(), n(f, {
|
|
59
69
|
key: 0,
|
|
60
|
-
actions:
|
|
61
|
-
placement:
|
|
62
|
-
trigger:
|
|
63
|
-
text: c(
|
|
64
|
-
}, null, 8, ["actions", "placement", "trigger", "text"])) :
|
|
70
|
+
actions: u.value.menuActions,
|
|
71
|
+
placement: t.placement,
|
|
72
|
+
trigger: t.trigger,
|
|
73
|
+
text: c(g)("ap.common.more")
|
|
74
|
+
}, null, 8, ["actions", "placement", "trigger", "text"])) : y("", !0)
|
|
65
75
|
]),
|
|
66
76
|
_: 1
|
|
67
77
|
}));
|
|
@@ -34,6 +34,15 @@ export type ApActionItemProps = {
|
|
|
34
34
|
* 是否显示loading效果
|
|
35
35
|
*/
|
|
36
36
|
loading?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 配置左侧显示的图标
|
|
39
|
+
* @since 6.37.0
|
|
40
|
+
*/
|
|
41
|
+
icon?: any;
|
|
42
|
+
/**
|
|
43
|
+
* 是否优先显示图标
|
|
44
|
+
*/
|
|
45
|
+
iconFirst?: boolean;
|
|
37
46
|
};
|
|
38
47
|
export type MixedActionTypes = ApActionItemProps | ApActionItemModalProps | ApActionItemPopconfirmProps;
|
|
39
48
|
export type GroupActionTypes = MixedActionTypes | ApActionItemDropdownProps;
|
|
@@ -69,6 +78,10 @@ export type ApActionGroupProps = {
|
|
|
69
78
|
* 菜单项配置
|
|
70
79
|
*/
|
|
71
80
|
actions?: GroupActionTypes[];
|
|
81
|
+
/**
|
|
82
|
+
* 对于平铺Action,优先显示图标
|
|
83
|
+
*/
|
|
84
|
+
iconFirst?: boolean;
|
|
72
85
|
};
|
|
73
86
|
export type ApActionItemModalProps = ApActionItemProps & {
|
|
74
87
|
/**
|
|
@@ -89,4 +102,8 @@ export type ApActionItemSlots = {
|
|
|
89
102
|
disabled: boolean;
|
|
90
103
|
onClick: (e: MouseEvent) => void;
|
|
91
104
|
}) => any;
|
|
105
|
+
/**
|
|
106
|
+
* 自定义左侧图标
|
|
107
|
+
*/
|
|
108
|
+
icon?: any;
|
|
92
109
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as C, useSlots as B, createPropsRestProxy as h, ref as A, computed as u, unref as n, renderSlot as y, createElementBlock as f, createCommentVNode as a, openBlock as t, mergeProps as F, createBlock as m, normalizeClass as N, createVNode as L, withCtx as P, resolveDynamicComponent as g, isVNode as S, toDisplayString as V } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import $ from "@aplus-frontend/antdv/es/button/LoadingIcon";
|
|
4
|
+
import { Tooltip as w } from "@aplus-frontend/antdv";
|
|
5
|
+
import { useNamespace as x } from "../../config-provider/hooks/use-namespace.mjs";
|
|
6
|
+
const D = { key: 1 }, q = /* @__PURE__ */ C({
|
|
6
7
|
name: "ApActionItem",
|
|
7
8
|
__name: "index",
|
|
8
9
|
props: {
|
|
@@ -12,41 +13,57 @@ const N = { key: 1 }, I = /* @__PURE__ */ y({
|
|
|
12
13
|
visible: { type: Boolean, default: !0 },
|
|
13
14
|
onAction: { type: Function },
|
|
14
15
|
onClick: { type: Function },
|
|
15
|
-
loading: { type: Boolean, default: !1 }
|
|
16
|
+
loading: { type: Boolean, default: !1 },
|
|
17
|
+
icon: {},
|
|
18
|
+
iconFirst: { type: Boolean, default: !1 }
|
|
16
19
|
},
|
|
17
20
|
setup(o) {
|
|
18
|
-
const
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
+
const s = B(), r = h(o, ["color", "disabled", "visible", "loading", "iconFirst", "icon"]), { b: k, m: l, e: v } = x("action-item"), c = A(!1), d = u(() => o.iconFirst && (o.icon || s.icon));
|
|
22
|
+
function p(e) {
|
|
23
|
+
n(i) || o.disabled || (r.onClick?.(e), r.onAction && (c.value = !0, r.onAction(e).finally(() => c.value = !1)));
|
|
21
24
|
}
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const i = u(() => o.loading || n(c)), b = u(() => [
|
|
26
|
+
k(),
|
|
27
|
+
l(o.color),
|
|
28
|
+
d.value ? l("icon-first") : null,
|
|
29
|
+
o.disabled ? l("disabled") : null,
|
|
30
|
+
i.value ? l("loading") : null
|
|
27
31
|
].filter(Boolean));
|
|
28
|
-
return (e,
|
|
29
|
-
loading:
|
|
32
|
+
return (e, I) => y(e.$slots, "trigger", {
|
|
33
|
+
loading: i.value,
|
|
30
34
|
disabled: e.disabled,
|
|
31
|
-
onClick:
|
|
35
|
+
onClick: p
|
|
32
36
|
}, () => [
|
|
33
|
-
e.visible ? (
|
|
34
|
-
class:
|
|
35
|
-
onClick:
|
|
37
|
+
e.visible ? (t(), f("span", F({ key: 0 }, e.$attrs, {
|
|
38
|
+
class: b.value,
|
|
39
|
+
onClick: p
|
|
36
40
|
}), [
|
|
37
|
-
|
|
41
|
+
i.value ? (t(), m(n($), {
|
|
38
42
|
key: 0,
|
|
39
43
|
"prefix-cls": "btn",
|
|
40
44
|
"exist-icon": !1,
|
|
41
45
|
loading: ""
|
|
42
|
-
})) :
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
})) : a("", !0),
|
|
47
|
+
e.icon || s.icon ? (t(), f("span", {
|
|
48
|
+
key: 1,
|
|
49
|
+
class: N(n(v)("icon-wrapper"))
|
|
50
|
+
}, [
|
|
51
|
+
L(n(w), {
|
|
52
|
+
title: d.value ? e.text : null
|
|
53
|
+
}, {
|
|
54
|
+
default: P(() => [
|
|
55
|
+
(t(), m(g(e.icon || s.icon)))
|
|
56
|
+
]),
|
|
57
|
+
_: 1
|
|
58
|
+
}, 8, ["title"])
|
|
59
|
+
], 2)) : a("", !0),
|
|
60
|
+
d.value ? a("", !0) : y(e.$slots, "default", { key: 2 }, () => [
|
|
61
|
+
S(e.text) ? (t(), m(g(e.text), { key: 0 })) : (t(), f("span", D, V(e.text || ""), 1))
|
|
45
62
|
])
|
|
46
|
-
], 16)) :
|
|
63
|
+
], 16)) : a("", !0)
|
|
47
64
|
]);
|
|
48
65
|
}
|
|
49
66
|
});
|
|
50
67
|
export {
|
|
51
|
-
|
|
68
|
+
q as default
|
|
52
69
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as _, ref as v, computed as k, createBlock as n, openBlock as
|
|
1
|
+
import { defineComponent as _, ref as v, computed as k, createBlock as n, openBlock as r, unref as o, withCtx as l, createElementVNode as w, normalizeClass as s, createVNode as u, createCommentVNode as B, normalizeProps as A, guardReactiveProps as b, renderSlot as C, createElementBlock as I, Fragment as P, renderList as D, mergeProps as m } from "vue";
|
|
2
2
|
import { Dropdown as N, Menu as $, MenuItem as h } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../item/index.vue.mjs";
|
|
4
4
|
import "../item-modal/index.vue2.mjs";
|
|
@@ -8,8 +8,8 @@ import "../../config-provider/index.mjs";
|
|
|
8
8
|
import { isUndefined as V, omit as z } from "lodash-unified";
|
|
9
9
|
import { useNamespace as E } from "../../config-provider/hooks/use-namespace.mjs";
|
|
10
10
|
import c from "../item/index.vue2.mjs";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
11
|
+
import F from "../item-modal/index.vue.mjs";
|
|
12
|
+
import M from "../item-popconfirm/index.vue.mjs";
|
|
13
13
|
const T = /* @__PURE__ */ _({
|
|
14
14
|
name: "ApActionItemDropDown",
|
|
15
15
|
__name: "index",
|
|
@@ -23,43 +23,45 @@ const T = /* @__PURE__ */ _({
|
|
|
23
23
|
disabled: { type: Boolean, default: !1 },
|
|
24
24
|
visible: { type: Boolean, default: !0 },
|
|
25
25
|
onClick: {},
|
|
26
|
-
loading: { type: Boolean, default: !1 }
|
|
26
|
+
loading: { type: Boolean, default: !1 },
|
|
27
|
+
icon: {},
|
|
28
|
+
iconFirst: { type: Boolean }
|
|
27
29
|
},
|
|
28
30
|
setup(d) {
|
|
29
|
-
const f = d,
|
|
31
|
+
const f = d, i = v(!1), { e: p } = E("action-item-dropdown"), g = k(() => f.actions.filter((e) => e.visible || V(e.visible)).map((e) => ({
|
|
30
32
|
...e,
|
|
31
33
|
onAction: async (a) => {
|
|
32
34
|
try {
|
|
33
35
|
await e.onAction?.(a);
|
|
34
36
|
} finally {
|
|
35
|
-
|
|
37
|
+
i.value = !1;
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
})));
|
|
39
|
-
return (e, a) => (
|
|
40
|
-
open:
|
|
41
|
-
"onUpdate:open": a[0] || (a[0] = (
|
|
41
|
+
return (e, a) => (r(), n(o(N), {
|
|
42
|
+
open: i.value,
|
|
43
|
+
"onUpdate:open": a[0] || (a[0] = (t) => i.value = t),
|
|
42
44
|
trigger: e.trigger,
|
|
43
45
|
placement: e.placement
|
|
44
46
|
}, {
|
|
45
47
|
overlay: l(() => [
|
|
46
48
|
u(o($), null, {
|
|
47
49
|
default: l(() => [
|
|
48
|
-
(
|
|
50
|
+
(r(!0), I(P, null, D(g.value, (t, y) => (r(), n(o(h), {
|
|
49
51
|
key: y,
|
|
50
|
-
class:
|
|
52
|
+
class: s(o(p)("item"))
|
|
51
53
|
}, {
|
|
52
54
|
default: l(() => [
|
|
53
|
-
|
|
55
|
+
t.modalProps ? (r(), n(F, m({
|
|
54
56
|
key: 0,
|
|
55
57
|
ref_for: !0
|
|
56
|
-
},
|
|
58
|
+
}, t), null, 16)) : t.popconfirmProps ? (r(), n(M, m({
|
|
57
59
|
key: 1,
|
|
58
60
|
ref_for: !0
|
|
59
|
-
},
|
|
61
|
+
}, t), null, 16)) : (r(), n(c, m({
|
|
60
62
|
key: 2,
|
|
61
63
|
ref_for: !0
|
|
62
|
-
},
|
|
64
|
+
}, t), null, 16))
|
|
63
65
|
]),
|
|
64
66
|
_: 2
|
|
65
67
|
}, 1032, ["class"]))), 128))
|
|
@@ -69,18 +71,18 @@ const T = /* @__PURE__ */ _({
|
|
|
69
71
|
]),
|
|
70
72
|
default: l(() => [
|
|
71
73
|
w("span", {
|
|
72
|
-
class:
|
|
74
|
+
class: s(o(p)("wrapper"))
|
|
73
75
|
}, [
|
|
74
|
-
u(c,
|
|
76
|
+
u(c, A(b(o(z)(f, ["actions", "trigger", "placement"]))), {
|
|
75
77
|
default: l(() => [
|
|
76
78
|
C(e.$slots, "default")
|
|
77
79
|
]),
|
|
78
80
|
_: 3
|
|
79
81
|
}, 16),
|
|
80
|
-
e.showIcon ? (
|
|
82
|
+
e.showIcon ? (r(), n(o(L), {
|
|
81
83
|
key: 0,
|
|
82
|
-
class:
|
|
83
|
-
}, null, 8, ["class"])) :
|
|
84
|
+
class: s(o(p)("icon"))
|
|
85
|
+
}, null, 8, ["class"])) : B("", !0)
|
|
84
86
|
], 2)
|
|
85
87
|
]),
|
|
86
88
|
_: 3
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Modal as
|
|
1
|
+
import { defineComponent as i, useSlots as s, createBlock as c, openBlock as p, mergeProps as m, unref as d, createSlots as f, renderList as u, withCtx as _, renderSlot as y, normalizeProps as A, guardReactiveProps as P } from "vue";
|
|
2
|
+
import { Modal as B } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../item/index.vue.mjs";
|
|
4
|
-
import { omit as
|
|
5
|
-
import
|
|
6
|
-
const z = /* @__PURE__ */
|
|
4
|
+
import { omit as k } from "lodash-unified";
|
|
5
|
+
import x from "../item/index.vue2.mjs";
|
|
6
|
+
const z = /* @__PURE__ */ i({
|
|
7
7
|
name: "ApActionItemModal",
|
|
8
8
|
__name: "index",
|
|
9
9
|
props: {
|
|
@@ -14,12 +14,14 @@ const z = /* @__PURE__ */ s({
|
|
|
14
14
|
onAction: {},
|
|
15
15
|
onClick: {},
|
|
16
16
|
loading: { type: Boolean, default: !1 },
|
|
17
|
+
icon: {},
|
|
18
|
+
iconFirst: { type: Boolean },
|
|
17
19
|
modalProps: { default: () => ({}) }
|
|
18
20
|
},
|
|
19
|
-
setup(
|
|
20
|
-
const r =
|
|
21
|
+
setup(t) {
|
|
22
|
+
const r = s(), o = t;
|
|
21
23
|
async function a(e) {
|
|
22
|
-
|
|
24
|
+
B.confirm({
|
|
23
25
|
...o.modalProps,
|
|
24
26
|
zIndex: 1060,
|
|
25
27
|
onOk: async () => {
|
|
@@ -27,11 +29,11 @@ const z = /* @__PURE__ */ s({
|
|
|
27
29
|
}
|
|
28
30
|
});
|
|
29
31
|
}
|
|
30
|
-
return (e, g) => (
|
|
31
|
-
u(r, (h,
|
|
32
|
-
name:
|
|
32
|
+
return (e, g) => (p(), c(x, m(d(k)(o, ["modalProps", "onAction"]), { onAction: a }), f({ _: 2 }, [
|
|
33
|
+
u(r, (h, n) => ({
|
|
34
|
+
name: n,
|
|
33
35
|
fn: _((l) => [
|
|
34
|
-
|
|
36
|
+
y(e.$slots, n, A(P(l || {})))
|
|
35
37
|
])
|
|
36
38
|
}))
|
|
37
39
|
]), 1040));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Popconfirm as
|
|
1
|
+
import { defineComponent as f, useSlots as m, createBlock as d, openBlock as u, unref as r, mergeProps as P, withCtx as t, createVNode as _, normalizeProps as i, guardReactiveProps as p, createSlots as y, renderList as B, renderSlot as C } from "vue";
|
|
2
|
+
import { Popconfirm as x } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../item/index.vue.mjs";
|
|
4
|
-
import { omit as
|
|
4
|
+
import { omit as A } from "lodash-unified";
|
|
5
5
|
import b from "../item/index.vue2.mjs";
|
|
6
|
-
const I = /* @__PURE__ */
|
|
6
|
+
const I = /* @__PURE__ */ f({
|
|
7
7
|
name: "ApActionItemPopconfirm",
|
|
8
8
|
__name: "index",
|
|
9
9
|
props: {
|
|
@@ -14,24 +14,26 @@ const I = /* @__PURE__ */ m({
|
|
|
14
14
|
onAction: {},
|
|
15
15
|
onClick: {},
|
|
16
16
|
loading: { type: Boolean, default: !1 },
|
|
17
|
+
icon: {},
|
|
18
|
+
iconFirst: { type: Boolean },
|
|
17
19
|
popconfirmProps: { default: () => ({}) }
|
|
18
20
|
},
|
|
19
21
|
setup(a) {
|
|
20
|
-
const s =
|
|
22
|
+
const s = m(), o = a;
|
|
21
23
|
async function l(e) {
|
|
22
24
|
o.popconfirmProps.onConfirm?.(e), await o.onAction?.(e);
|
|
23
25
|
}
|
|
24
|
-
return (e, g) => (u(), d(
|
|
26
|
+
return (e, g) => (u(), d(r(x), P(o.popconfirmProps, {
|
|
25
27
|
disabled: !o.popconfirmProps,
|
|
26
28
|
"overlay-style": { zIndex: 1060 },
|
|
27
29
|
onConfirm: l
|
|
28
30
|
}), {
|
|
29
31
|
default: t(() => [
|
|
30
|
-
_(b, p(
|
|
31
|
-
|
|
32
|
-
name:
|
|
33
|
-
fn: t((
|
|
34
|
-
|
|
32
|
+
_(b, i(p(r(A)(o, ["popconfirmProps", "onAction"]))), y({ _: 2 }, [
|
|
33
|
+
B(s, (h, n) => ({
|
|
34
|
+
name: n,
|
|
35
|
+
fn: t((c) => [
|
|
36
|
+
C(e.$slots, n, i(p(c || {})))
|
|
35
37
|
])
|
|
36
38
|
}))
|
|
37
39
|
]), 1040)
|
package/es/src/index.d.ts
CHANGED