@aplus-frontend/ui 0.0.32 → 0.0.34
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 +217 -215
- package/es/src/ap-field/select/index.vue.mjs +36 -32
- package/es/src/ap-form/ap-form-item-group/helper.d.ts +7 -0
- package/es/src/ap-form/ap-form-item-group/helper.mjs +30 -25
- package/es/src/ap-form/ap-form-item-group/index.vue.mjs +30 -31
- package/es/src/ap-form/ap-form.vue2.mjs +11 -11
- package/es/src/ap-form/modal-form/index.vue.d.ts +2 -1
- package/es/src/ap-form/modal-form/index.vue.mjs +43 -39
- package/es/src/ap-form/search-form/index.vue.mjs +79 -78
- package/es/src/ap-modal/utils/createModal.mjs +34 -31
- package/es/src/ap-table/ap-table.vue.d.ts +54 -11
- package/es/src/ap-table/ap-table.vue.mjs +171 -148
- package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/es/src/ap-table/hooks/use-table-paging.mjs +47 -46
- package/es/src/ap-table/hooks/use-table-row-selection.d.ts +60 -0
- package/es/src/ap-table/hooks/use-table-row-selection.mjs +62 -0
- package/es/src/ap-table/interface.d.ts +14 -2
- package/es/src/ap-table/style/ap-table.css +2 -0
- package/es/src/ap-tag/ap-tag-group.vue.d.ts +16 -6
- package/es/src/ap-tag/ap-tag-group.vue.mjs +81 -61
- package/es/src/ap-tag/interface.d.ts +24 -0
- package/es/src/ap-tag/style/ap-tag-group.css +8 -0
- package/es/src/ap-upload/apUpload.vue.d.ts +3 -3
- package/es/src/ap-upload/hooks/useOss.d.ts +3 -3
- package/es/src/business/ap-select-layout/index.css +117 -0
- package/es/src/business/ap-select-layout/index.d.ts +4 -0
- package/es/src/business/ap-select-layout/interface.d.ts +9 -0
- package/es/src/business/ap-select-layout/select-layout.vue.d.ts +76 -0
- package/es/src/business/ap-select-layout/select-layout.vue.mjs +4 -0
- package/es/src/business/ap-select-layout/select-layout.vue2.mjs +145 -0
- package/es/src/business/index.d.ts +76 -1
- package/es/src/business/index.mjs +9 -6
- package/es/src/config-provider/config-provider.d.ts +144 -1
- package/es/src/config-provider/config-provider.mjs +35 -29
- package/es/src/config-provider/index.mjs +22 -20
- package/es/src/design-token/index.mjs +6 -2
- package/es/src/editable-table/form-item.vue.d.ts +7 -7
- package/es/src/editable-table/form-item.vue.mjs +2 -2
- package/es/src/editable-table/index.vue.d.ts +7 -7
- package/es/src/editable-table/index.vue.mjs +10 -10
- package/es/src/editable-table/interface.d.ts +1 -1
- package/es/src/index.mjs +188 -186
- package/es/src/theme/ap-select-layout/ap-select-layout.css +117 -0
- package/es/src/theme/ap-table/ap-table.css +2 -0
- package/es/src/theme/ap-tag/ap-tag-group.css +8 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form-item-group/helper.d.ts +7 -0
- package/lib/src/ap-form/ap-form-item-group/helper.js +1 -1
- package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +2 -1
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-modal/utils/createModal.js +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +54 -11
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-table/hooks/use-table-row-selection.d.ts +60 -0
- package/lib/src/ap-table/hooks/use-table-row-selection.js +1 -0
- package/lib/src/ap-table/interface.d.ts +14 -2
- package/lib/src/ap-table/style/ap-table.css +2 -0
- package/lib/src/ap-tag/ap-tag-group.vue.d.ts +16 -6
- package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
- package/lib/src/ap-tag/interface.d.ts +24 -0
- package/lib/src/ap-tag/style/ap-tag-group.css +8 -0
- package/lib/src/ap-upload/apUpload.vue.d.ts +3 -3
- package/lib/src/ap-upload/hooks/useOss.d.ts +3 -3
- package/lib/src/business/ap-select-layout/index.css +117 -0
- package/lib/src/business/ap-select-layout/index.d.ts +4 -0
- package/lib/src/business/ap-select-layout/interface.d.ts +9 -0
- package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +76 -0
- package/lib/src/business/ap-select-layout/select-layout.vue.js +1 -0
- package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -0
- package/lib/src/business/index.d.ts +76 -1
- package/lib/src/business/index.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +144 -1
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/index.js +1 -1
- package/lib/src/design-token/index.js +1 -1
- package/lib/src/editable-table/form-item.vue.d.ts +7 -7
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.d.ts +7 -7
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/interface.d.ts +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/theme/ap-select-layout/ap-select-layout.css +117 -0
- package/lib/src/theme/ap-table/ap-table.css +2 -0
- package/lib/src/theme/ap-tag/ap-tag-group.css +8 -0
- package/package.json +2 -2
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { TableRowSelection } from 'ant-design-vue/lib/table/interface';
|
|
2
|
+
import { ComputedRef, Ref } from 'vue';
|
|
3
|
+
import { ApTableProps, ApTableRowSelection } from '../interface';
|
|
4
|
+
import { Recordable } from '../../type';
|
|
5
|
+
|
|
6
|
+
export interface RowSelectionReturnType<RecordType = any> {
|
|
7
|
+
rowSelection: ComputedRef<TableRowSelection<RecordType>>;
|
|
8
|
+
selectedRows: Ref<RecordType[]>;
|
|
9
|
+
/**
|
|
10
|
+
* 选中某行
|
|
11
|
+
* @param item
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
select: (item: RecordType) => void;
|
|
15
|
+
/**
|
|
16
|
+
* 取消选中某行
|
|
17
|
+
* @param item
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
unSelect: (item: RecordType) => void;
|
|
21
|
+
/**
|
|
22
|
+
* 某行是否被选中
|
|
23
|
+
* @param item
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
isSelected: (item: RecordType) => boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 选中当前所有数据
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
selectAll: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* 取消选中当前所有数据
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
unSelectAll: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* 清空所有选中
|
|
39
|
+
* @returns
|
|
40
|
+
*/
|
|
41
|
+
clearAll: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* 切换某行的选中状态
|
|
44
|
+
* @param item
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
toggleSelect: (item: RecordType) => void;
|
|
48
|
+
}
|
|
49
|
+
type RowSelectionParams<T> = ApTableRowSelection<T> & {
|
|
50
|
+
/**
|
|
51
|
+
* 数据源(如果是后端分页,则表示当页数据,否则是全量数据)
|
|
52
|
+
*/
|
|
53
|
+
dataSource: Ref<T[]>;
|
|
54
|
+
/**
|
|
55
|
+
* 同Table的rowkey
|
|
56
|
+
*/
|
|
57
|
+
rowKey: ApTableProps['rowKey'];
|
|
58
|
+
};
|
|
59
|
+
declare const useTableRowSelection: <RecordType = Recordable>(props: RowSelectionParams<RecordType>) => RowSelectionReturnType<RecordType>;
|
|
60
|
+
export default useTableRowSelection;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ref as h, computed as s, unref as c } from "vue";
|
|
2
|
+
import { isFunction as x } from "lodash-unified";
|
|
3
|
+
const g = (o) => {
|
|
4
|
+
const n = h([]);
|
|
5
|
+
function r(e, t) {
|
|
6
|
+
n.value = t;
|
|
7
|
+
}
|
|
8
|
+
const l = (e) => x(o.rowKey) ? o.rowKey(e) : e[o.rowKey], a = s(() => {
|
|
9
|
+
const e = /* @__PURE__ */ new Map();
|
|
10
|
+
return c(n).forEach((t) => {
|
|
11
|
+
e.set(l(t), t);
|
|
12
|
+
}), e;
|
|
13
|
+
});
|
|
14
|
+
function f(e) {
|
|
15
|
+
return c(a).has(l(e));
|
|
16
|
+
}
|
|
17
|
+
function d(e) {
|
|
18
|
+
const t = c(a);
|
|
19
|
+
t.set(l(e), e), n.value = [...t.values()];
|
|
20
|
+
}
|
|
21
|
+
function S(e) {
|
|
22
|
+
const t = c(a);
|
|
23
|
+
t.delete(l(e)), n.value = [...t.values()];
|
|
24
|
+
}
|
|
25
|
+
function i() {
|
|
26
|
+
const e = c(a);
|
|
27
|
+
c(o.dataSource).forEach((t) => {
|
|
28
|
+
e.set(l(t), t);
|
|
29
|
+
}), n.value = [...e.values()];
|
|
30
|
+
}
|
|
31
|
+
function v(e) {
|
|
32
|
+
const t = c(a), u = l(e);
|
|
33
|
+
t.has(u) ? t.delete(u) : t.set(u, e), n.value = [...t.values()];
|
|
34
|
+
}
|
|
35
|
+
function w() {
|
|
36
|
+
const e = c(a);
|
|
37
|
+
c(o.dataSource).forEach((t) => {
|
|
38
|
+
e.delete(l(t));
|
|
39
|
+
}), n.value = [...e.values()];
|
|
40
|
+
}
|
|
41
|
+
function M() {
|
|
42
|
+
n.value = [];
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
select: d,
|
|
46
|
+
unSelect: S,
|
|
47
|
+
isSelected: f,
|
|
48
|
+
selectAll: i,
|
|
49
|
+
unSelectAll: w,
|
|
50
|
+
clearAll: M,
|
|
51
|
+
toggleSelect: v,
|
|
52
|
+
selectedRows: n,
|
|
53
|
+
rowSelection: s(() => ({
|
|
54
|
+
...o,
|
|
55
|
+
onChange: r,
|
|
56
|
+
selectedRowKeys: c(n).map((e) => l(e))
|
|
57
|
+
}))
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
g as default
|
|
62
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ColumnType, TableProps } from 'ant-design-vue/es/table';
|
|
2
|
-
import { CompareFn, SortOrder } from 'ant-design-vue/es/table/interface';
|
|
2
|
+
import { CompareFn, SortOrder, TableRowSelection } from 'ant-design-vue/es/table/interface';
|
|
3
3
|
import { ApFormSearchFormProps } from '../ap-form';
|
|
4
4
|
import { ApFormItemCheckboxProps, ApFormItemDateProps, ApFormItemDateRangeProps, ApFormItemNumberProps, ApFormItemRadioProps, ApFormItemSelectProps, ApFormItemSwitchProps, ApFormItemTextAreaProps, ApFormItemTextPasswordProps, ApFormItemTextProps } from '../ap-form/items/interface';
|
|
5
5
|
import { Recordable } from '../type';
|
|
@@ -7,6 +7,7 @@ import { ComputedRef, CSSProperties, VNode } from 'vue';
|
|
|
7
7
|
import { ApActionGroupProps } from '../ap-action';
|
|
8
8
|
import { ApTableIndexProps } from './components/interface';
|
|
9
9
|
import { EllipsisConfig } from 'ant-design-vue/es/typography/Base';
|
|
10
|
+
import { RowSelectionReturnType } from './hooks/use-table-row-selection';
|
|
10
11
|
|
|
11
12
|
export type ValueEnumType = {
|
|
12
13
|
text: string;
|
|
@@ -64,6 +65,7 @@ export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children' | 'filters' |
|
|
|
64
65
|
multiple?: number;
|
|
65
66
|
};
|
|
66
67
|
};
|
|
68
|
+
export type ApTableRowSelection<RecordType = any> = Omit<TableRowSelection<RecordType>, 'selectedRowKeys' | 'onChange' | 'onSelect' | 'onSelectAll' | 'onSelectInvert' | 'onSelectNone'>;
|
|
67
69
|
export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes = ApTableValueTypes> = ValueType extends ApTableValueTypes ? ExtraProColumnType<RecordType> & {
|
|
68
70
|
children?: ApColumnType<RecordType, ValueType>[];
|
|
69
71
|
/**
|
|
@@ -141,11 +143,15 @@ export type RequestData<T> = {
|
|
|
141
143
|
data: T[] | undefined;
|
|
142
144
|
total: number;
|
|
143
145
|
} & Record<string, any>;
|
|
144
|
-
export type ApTableProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size'> & {
|
|
146
|
+
export type ApTableProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection'> & {
|
|
145
147
|
/**
|
|
146
148
|
* 列配置
|
|
147
149
|
*/
|
|
148
150
|
columns?: ApColumnType<RecordType, any>[];
|
|
151
|
+
/**
|
|
152
|
+
* 行选中配置
|
|
153
|
+
*/
|
|
154
|
+
rowSelection?: true | ApTableRowSelection<RecordType>;
|
|
149
155
|
/**
|
|
150
156
|
* 是否启用卡片样式
|
|
151
157
|
*/
|
|
@@ -252,4 +258,10 @@ export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
252
258
|
* 表格数据源
|
|
253
259
|
*/
|
|
254
260
|
dataSource: ComputedRef<RecordType>;
|
|
261
|
+
/**
|
|
262
|
+
* 行选中相关的数据和API
|
|
263
|
+
*/
|
|
264
|
+
rowSelection?: Omit<RowSelectionReturnType<RecordType>, 'rowSelection'> & {
|
|
265
|
+
selectedRows: ComputedRef<RecordType[]>;
|
|
266
|
+
};
|
|
255
267
|
};
|
|
@@ -90,12 +90,14 @@
|
|
|
90
90
|
}
|
|
91
91
|
.aplus-ap-table .ant-table-column-sorters {
|
|
92
92
|
justify-content: unset;
|
|
93
|
+
display: inline-flex;
|
|
93
94
|
}
|
|
94
95
|
.aplus-ap-table .ant-table-column-sorters .ant-table-column-title {
|
|
95
96
|
flex: unset;
|
|
96
97
|
}
|
|
97
98
|
.aplus-ap-table .ant-table-filter-column {
|
|
98
99
|
justify-content: unset;
|
|
100
|
+
display: inline-flex;
|
|
99
101
|
}
|
|
100
102
|
.aplus-ap-table .ant-table-filter-column .ant-table-column-title {
|
|
101
103
|
flex: unset;
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { ApTagGroupProps, ApTagProps } from './interface';
|
|
1
|
+
import { ApTagGroupProps, ApTagProps, EllipsisProps } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type ApTagGroupSlots = {
|
|
5
|
+
tooltip?: (props: {
|
|
6
|
+
tags: ApTagProps[];
|
|
7
|
+
}) => void;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTagGroupProps>, {
|
|
5
10
|
list: () => ApTagProps[];
|
|
6
11
|
space: number;
|
|
7
|
-
|
|
12
|
+
ellipsis: () => {};
|
|
8
13
|
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTagGroupProps>, {
|
|
9
14
|
list: () => ApTagProps[];
|
|
10
15
|
space: number;
|
|
11
|
-
|
|
16
|
+
ellipsis: () => {};
|
|
12
17
|
}>>>, {
|
|
18
|
+
ellipsis: EllipsisProps;
|
|
13
19
|
space: number;
|
|
14
20
|
list: ApTagProps[];
|
|
15
|
-
|
|
16
|
-
}, {}>;
|
|
21
|
+
}, {}>, Readonly<ApTagGroupSlots> & ApTagGroupSlots>;
|
|
17
22
|
export default _default;
|
|
18
23
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
24
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -32,3 +37,8 @@ type __VLS_WithDefaults<P, D> = {
|
|
|
32
37
|
type __VLS_Prettify<T> = {
|
|
33
38
|
[K in keyof T]: T[K];
|
|
34
39
|
} & {};
|
|
40
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
41
|
+
new (): {
|
|
42
|
+
$slots: S;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { createElementVNode as
|
|
2
|
-
import { Tooltip as
|
|
3
|
-
import
|
|
1
|
+
import { createElementVNode as t, defineComponent as N, ref as v, computed as s, unref as o, nextTick as g, watch as P, onMounted as S, onUnmounted as j, openBlock as u, createBlock as h, mergeProps as _, withCtx as y, renderSlot as q, createTextVNode as G, toDisplayString as k, normalizeClass as b, normalizeStyle as E, createElementBlock as B, Fragment as R, renderList as I, createCommentVNode as U } from "vue";
|
|
2
|
+
import { Tooltip as H } from "ant-design-vue";
|
|
3
|
+
import J from "@ant-design/icons-vue";
|
|
4
4
|
import "./ap-tag.vue2.mjs";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
+
import { omit as K } from "lodash-unified";
|
|
6
7
|
import "./style/ap-tag-group.css";
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
8
|
+
import { useLocale as O } from "../config-provider/hooks/use-locale.mjs";
|
|
9
|
+
import { useGlobalConfig as Q } from "../config-provider/hooks/use-global-config.mjs";
|
|
10
|
+
import { useNamespace as X } from "../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
import Y from "./ap-tag.vue.mjs";
|
|
12
|
+
const Z = /* @__PURE__ */ t("svg", {
|
|
10
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11
14
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
12
15
|
fill: "none",
|
|
@@ -15,9 +18,9 @@ const I = /* @__PURE__ */ e("svg", {
|
|
|
15
18
|
height: "16",
|
|
16
19
|
viewBox: "0 0 16 16"
|
|
17
20
|
}, [
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ t("defs", null, [
|
|
22
|
+
/* @__PURE__ */ t("clipPath", { id: "master_svg0_1133_24991" }, [
|
|
23
|
+
/* @__PURE__ */ t("rect", {
|
|
21
24
|
x: "0",
|
|
22
25
|
y: "0",
|
|
23
26
|
width: "16",
|
|
@@ -26,9 +29,9 @@ const I = /* @__PURE__ */ e("svg", {
|
|
|
26
29
|
})
|
|
27
30
|
])
|
|
28
31
|
]),
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ t("g", { "clip-path": "url(#master_svg0_1133_24991)" }, [
|
|
33
|
+
/* @__PURE__ */ t("g", null, [
|
|
34
|
+
/* @__PURE__ */ t("ellipse", {
|
|
32
35
|
cx: "8",
|
|
33
36
|
cy: "8",
|
|
34
37
|
rx: "1",
|
|
@@ -37,8 +40,8 @@ const I = /* @__PURE__ */ e("svg", {
|
|
|
37
40
|
"fill-opacity": "1"
|
|
38
41
|
})
|
|
39
42
|
]),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ t("g", null, [
|
|
44
|
+
/* @__PURE__ */ t("ellipse", {
|
|
42
45
|
cx: "3.25",
|
|
43
46
|
cy: "8",
|
|
44
47
|
rx: "1",
|
|
@@ -47,8 +50,8 @@ const I = /* @__PURE__ */ e("svg", {
|
|
|
47
50
|
"fill-opacity": "1"
|
|
48
51
|
})
|
|
49
52
|
]),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ t("g", null, [
|
|
54
|
+
/* @__PURE__ */ t("ellipse", {
|
|
52
55
|
cx: "12.75",
|
|
53
56
|
cy: "8",
|
|
54
57
|
rx: "1",
|
|
@@ -58,80 +61,97 @@ const I = /* @__PURE__ */ e("svg", {
|
|
|
58
61
|
})
|
|
59
62
|
])
|
|
60
63
|
])
|
|
61
|
-
], -1),
|
|
64
|
+
], -1), pe = /* @__PURE__ */ N({
|
|
62
65
|
__name: "ap-tag-group",
|
|
63
66
|
props: {
|
|
64
67
|
list: { default: () => [] },
|
|
65
68
|
space: { default: 4 },
|
|
66
|
-
ellipsisColor: {
|
|
69
|
+
ellipsisColor: {},
|
|
70
|
+
ellipsis: { default: () => ({}) }
|
|
67
71
|
},
|
|
68
|
-
setup(
|
|
69
|
-
const
|
|
70
|
-
|
|
72
|
+
setup(T) {
|
|
73
|
+
const { t: V } = O(), l = T, z = Q("uiMode"), { b: L, bm: x } = X("tag-group"), c = v(), r = s(() => ({
|
|
74
|
+
...{
|
|
75
|
+
iconColor: "#34B77C",
|
|
76
|
+
symbol: "icon",
|
|
77
|
+
text: V("ap.common.more")
|
|
78
|
+
},
|
|
79
|
+
...l.ellipsis
|
|
80
|
+
})), M = s(() => r.value.tooltip && typeof r.value.tooltip == "object" ? K(r.value.tooltip, ["trigger", "title"]) : {}), d = s(() => o(n) < l.list.length), $ = s(() => l.list.slice(0, o(n))), n = v(0), p = v(0), m = v(l.list.length), W = s(() => l.list.map((e) => e.text).join("、")), A = s(() => [L()].filter(Boolean)), D = s(() => z.value === "aplus" ? [x("ellipsis-text", "aplus")] : [x("ellipsis-text", "admin")]), f = () => {
|
|
81
|
+
if (!c.value)
|
|
71
82
|
return;
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
requestAnimationFrame(
|
|
83
|
+
const e = c.value.scrollWidth, i = c.value.clientWidth;
|
|
84
|
+
if (o(p) <= o(m)) {
|
|
85
|
+
const a = Math.floor((o(p) + o(m)) / 2);
|
|
86
|
+
e <= i ? (n.value = a, p.value = a + 1) : m.value = a - 1, g(() => {
|
|
87
|
+
requestAnimationFrame(f);
|
|
77
88
|
});
|
|
78
89
|
} else
|
|
79
|
-
|
|
80
|
-
requestAnimationFrame(
|
|
90
|
+
e > i && (n.value = n.value - 1, g(() => {
|
|
91
|
+
requestAnimationFrame(f);
|
|
81
92
|
}));
|
|
82
|
-
},
|
|
83
|
-
|
|
93
|
+
}, w = () => {
|
|
94
|
+
p.value = 0, m.value = l.list.length, n.value = 0;
|
|
84
95
|
};
|
|
85
|
-
|
|
86
|
-
() =>
|
|
87
|
-
(
|
|
88
|
-
|
|
96
|
+
P(
|
|
97
|
+
() => l.list,
|
|
98
|
+
(e, i) => {
|
|
99
|
+
e !== i && (w(), g(() => f()));
|
|
89
100
|
},
|
|
90
101
|
{
|
|
91
102
|
immediate: !0
|
|
92
103
|
}
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
);
|
|
105
|
+
const C = () => {
|
|
106
|
+
w(), f();
|
|
107
|
+
};
|
|
108
|
+
return S(() => {
|
|
109
|
+
[["ellipsisColor", "ellipse.color"]].forEach(([e, i]) => {
|
|
110
|
+
l[e] && console.error(
|
|
111
|
+
`[ApTagGroup]: \`${e}\` is deprecated, please use \`${i}\` instead.`
|
|
112
|
+
);
|
|
113
|
+
}), window.addEventListener("resize", C);
|
|
114
|
+
}), j(() => {
|
|
115
|
+
window.removeEventListener("resize", C);
|
|
116
|
+
}), (e, i) => (u(), h(o(H), _({ trigger: "hover" }, M.value), {
|
|
117
|
+
title: y(() => [
|
|
118
|
+
q(e.$slots, "tooltip", { tags: e.list }, () => [
|
|
119
|
+
G(k(W.value), 1)
|
|
120
|
+
])
|
|
121
|
+
]),
|
|
105
122
|
default: y(() => [
|
|
106
|
-
|
|
107
|
-
class:
|
|
123
|
+
t("div", {
|
|
124
|
+
class: b(A.value),
|
|
108
125
|
ref_key: "container",
|
|
109
|
-
ref:
|
|
110
|
-
style:
|
|
111
|
-
pointerEvents:
|
|
126
|
+
ref: c,
|
|
127
|
+
style: E({
|
|
128
|
+
pointerEvents: d.value ? "auto" : "none"
|
|
112
129
|
})
|
|
113
130
|
}, [
|
|
114
|
-
(
|
|
115
|
-
key:
|
|
131
|
+
(u(!0), B(R, null, I($.value, (a, F) => (u(), h(Y, _({ ref_for: !0 }, a, {
|
|
132
|
+
key: F,
|
|
116
133
|
style: {
|
|
117
|
-
marginRight: `${
|
|
134
|
+
marginRight: `${e.space}px`
|
|
118
135
|
}
|
|
119
136
|
}), null, 16, ["style"]))), 128)),
|
|
120
|
-
|
|
137
|
+
d.value && r.value.symbol === "icon" ? (u(), h(o(J), {
|
|
121
138
|
key: 0,
|
|
122
|
-
style:
|
|
139
|
+
style: E({ color: e.ellipsisColor || r.value.iconColor })
|
|
123
140
|
}, {
|
|
124
141
|
component: y(() => [
|
|
125
|
-
|
|
142
|
+
Z
|
|
126
143
|
]),
|
|
127
144
|
_: 1
|
|
128
|
-
}, 8, ["style"])) :
|
|
145
|
+
}, 8, ["style"])) : d.value && r.value.symbol === "text" ? (u(), B("span", {
|
|
146
|
+
key: 1,
|
|
147
|
+
class: b(D.value)
|
|
148
|
+
}, k(r.value.text), 3)) : U("", !0)
|
|
129
149
|
], 6)
|
|
130
150
|
]),
|
|
131
|
-
_:
|
|
132
|
-
},
|
|
151
|
+
_: 3
|
|
152
|
+
}, 16));
|
|
133
153
|
}
|
|
134
154
|
});
|
|
135
155
|
export {
|
|
136
|
-
|
|
156
|
+
pe as default
|
|
137
157
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { TooltipProps } from 'ant-design-vue/es/tooltip';
|
|
2
|
+
|
|
1
3
|
export interface ApTagProps {
|
|
2
4
|
/**
|
|
3
5
|
* 标签内容
|
|
@@ -17,6 +19,27 @@ export interface ApTagProps {
|
|
|
17
19
|
*/
|
|
18
20
|
disabled?: boolean;
|
|
19
21
|
}
|
|
22
|
+
export type EllipsisProps = {
|
|
23
|
+
/**
|
|
24
|
+
* 省略号标志
|
|
25
|
+
* @default 'icon' - 内置图标不能自定义
|
|
26
|
+
* @type 'icon' | 'text'
|
|
27
|
+
*/
|
|
28
|
+
symbol?: 'icon' | 'text';
|
|
29
|
+
/**
|
|
30
|
+
* 省略号文本 - symbol为text时生效
|
|
31
|
+
*/
|
|
32
|
+
text?: string;
|
|
33
|
+
/**
|
|
34
|
+
* 省略号颜色 - symbol为icon时生效
|
|
35
|
+
* @default #34B77C
|
|
36
|
+
*/
|
|
37
|
+
iconColor?: string;
|
|
38
|
+
/**
|
|
39
|
+
* 省略号气泡内容
|
|
40
|
+
*/
|
|
41
|
+
tooltip?: Omit<TooltipProps, 'trigger' | 'title'>;
|
|
42
|
+
};
|
|
20
43
|
export interface ApTagGroupProps {
|
|
21
44
|
/**
|
|
22
45
|
* 标签组内容
|
|
@@ -32,4 +55,5 @@ export interface ApTagGroupProps {
|
|
|
32
55
|
* @default #34B77C
|
|
33
56
|
*/
|
|
34
57
|
ellipsisColor?: string;
|
|
58
|
+
ellipsis?: EllipsisProps;
|
|
35
59
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropType, VNode, DefineComponent, ComputedRef, ComponentOptionsMixin, PublicProps, ExtractPropTypes, RendererNode, RendererElement } from 'vue';
|
|
2
2
|
import { FileUploadType, BeforeUpload, CustomRequest } from './apUploadTypes';
|
|
3
|
-
import {
|
|
3
|
+
import { GetOssAccess } from './hooks/useOss';
|
|
4
4
|
|
|
5
5
|
declare function clear(): void;
|
|
6
6
|
declare const _default: DefineComponent<{
|
|
@@ -42,7 +42,7 @@ declare const _default: DefineComponent<{
|
|
|
42
42
|
type: PropType<CustomRequest>;
|
|
43
43
|
};
|
|
44
44
|
getOssAccess: {
|
|
45
|
-
type: PropType<
|
|
45
|
+
type: PropType<GetOssAccess>;
|
|
46
46
|
};
|
|
47
47
|
}, {
|
|
48
48
|
done: ComputedRef<boolean>;
|
|
@@ -88,7 +88,7 @@ declare const _default: DefineComponent<{
|
|
|
88
88
|
type: PropType<CustomRequest>;
|
|
89
89
|
};
|
|
90
90
|
getOssAccess: {
|
|
91
|
-
type: PropType<
|
|
91
|
+
type: PropType<GetOssAccess>;
|
|
92
92
|
};
|
|
93
93
|
}>> & {
|
|
94
94
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { accessCreate, Oss } from '@aplus-frontend/oss';
|
|
2
2
|
import { Translator } from '../../config-provider';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
4
|
|
|
5
5
|
export type { Oss } from '@aplus-frontend/oss';
|
|
6
|
-
export type GetOssAccess =
|
|
6
|
+
export type GetOssAccess = () => Promise<accessCreate>;
|
|
7
7
|
export declare function injectLocaleToOss(tValue: Translator, langValue: Ref<string>): void;
|
|
8
8
|
declare function put({ file, dirName, oss, successCallBack, errorCallBack, progressCallBack }: {
|
|
9
9
|
file: File;
|
|
@@ -21,4 +21,4 @@ export declare function useOssInit(getOssAccess: GetOssAccess): Promise<{
|
|
|
21
21
|
client: Oss;
|
|
22
22
|
put: typeof put;
|
|
23
23
|
}>;
|
|
24
|
-
export declare function getOssInstance(getOssAccess:
|
|
24
|
+
export declare function getOssInstance(getOssAccess: GetOssAccess): Promise<Oss>;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
.aplus-ap-select-layout {
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
.aplus-ap-select-layout .v-enter-active,
|
|
7
|
+
.aplus-ap-select-layout .v-leave-active {
|
|
8
|
+
transition: all 0.2s, background 0s;
|
|
9
|
+
}
|
|
10
|
+
.aplus-ap-select-layout .v-enter-from,
|
|
11
|
+
.aplus-ap-select-layout .v-leave-to {
|
|
12
|
+
width: 0;
|
|
13
|
+
min-width: 0;
|
|
14
|
+
max-width: 0;
|
|
15
|
+
margin-right: 0;
|
|
16
|
+
}
|
|
17
|
+
.aplus-ap-select-layout-side {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
width: 214px;
|
|
21
|
+
min-width: 214px;
|
|
22
|
+
max-width: 214px;
|
|
23
|
+
margin-right: 16px;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
background-color: #fff;
|
|
26
|
+
}
|
|
27
|
+
.aplus-ap-select-layout-side__header {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
padding: 12px 16px;
|
|
32
|
+
border-bottom: 1px solid #e9e9e9;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
}
|
|
36
|
+
.aplus-ap-select-layout-side__header > h3 {
|
|
37
|
+
margin: 0;
|
|
38
|
+
color: #333;
|
|
39
|
+
font-size: 16px;
|
|
40
|
+
font-weight: bold;
|
|
41
|
+
line-height: 18px;
|
|
42
|
+
}
|
|
43
|
+
.aplus-ap-select-layout-side__header--imgWrap {
|
|
44
|
+
border-radius: 2px;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
font-size: 24px;
|
|
47
|
+
}
|
|
48
|
+
.aplus-ap-select-layout-side__header--imgWrap:hover {
|
|
49
|
+
background: #f5f5f5;
|
|
50
|
+
}
|
|
51
|
+
.aplus-ap-select-layout-side__header--imgWrap > img {
|
|
52
|
+
width: 24px;
|
|
53
|
+
height: 24px;
|
|
54
|
+
}
|
|
55
|
+
.aplus-ap-select-layout-side__body {
|
|
56
|
+
position: relative;
|
|
57
|
+
flex: 1;
|
|
58
|
+
}
|
|
59
|
+
.aplus-ap-select-layout-side__body--search {
|
|
60
|
+
margin: 10px 0;
|
|
61
|
+
padding: 0 16px;
|
|
62
|
+
}
|
|
63
|
+
.aplus-ap-select-layout-side__body--scroll {
|
|
64
|
+
position: absolute;
|
|
65
|
+
inset: 52px 0 0;
|
|
66
|
+
overflow-y: auto;
|
|
67
|
+
padding: 0 16px;
|
|
68
|
+
}
|
|
69
|
+
.aplus-ap-select-layout-side__body--scroll-item {
|
|
70
|
+
margin-bottom: 8px;
|
|
71
|
+
padding: 8px 12px;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
color: #333;
|
|
74
|
+
line-height: 22px;
|
|
75
|
+
width: calc(214px - 32px);
|
|
76
|
+
text-overflow: ellipsis;
|
|
77
|
+
text-wrap: nowrap;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
border-radius: 4px;
|
|
80
|
+
}
|
|
81
|
+
.aplus-ap-select-layout-side__body--scroll-item:hover {
|
|
82
|
+
background: #f5f5f5;
|
|
83
|
+
}
|
|
84
|
+
.aplus-ap-select-layout-side__body--scroll-item.active {
|
|
85
|
+
background-color: #e4faf1;
|
|
86
|
+
color: #34b77c;
|
|
87
|
+
font-weight: bold;
|
|
88
|
+
}
|
|
89
|
+
.aplus-ap-select-layout-content {
|
|
90
|
+
flex: 1;
|
|
91
|
+
overflow-x: hidden;
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
}
|
|
95
|
+
.aplus-ap-select-layout-content__header {
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
height: 32px;
|
|
99
|
+
padding: 16px 16px 0;
|
|
100
|
+
box-sizing: content-box;
|
|
101
|
+
background: #fff;
|
|
102
|
+
}
|
|
103
|
+
.aplus-ap-select-layout-content__header--imgWrap {
|
|
104
|
+
margin-right: 10px;
|
|
105
|
+
border-radius: 2px;
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
font-size: 24px;
|
|
108
|
+
}
|
|
109
|
+
.aplus-ap-select-layout-content__header--imgWrap:hover {
|
|
110
|
+
background: #f5f5f5;
|
|
111
|
+
}
|
|
112
|
+
.aplus-ap-select-layout-content__header--title {
|
|
113
|
+
margin: 0;
|
|
114
|
+
font-size: 16px;
|
|
115
|
+
font-weight: bold;
|
|
116
|
+
line-height: 32px;
|
|
117
|
+
}
|