@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.
Files changed (91) hide show
  1. package/es/index.mjs +217 -215
  2. package/es/src/ap-field/select/index.vue.mjs +36 -32
  3. package/es/src/ap-form/ap-form-item-group/helper.d.ts +7 -0
  4. package/es/src/ap-form/ap-form-item-group/helper.mjs +30 -25
  5. package/es/src/ap-form/ap-form-item-group/index.vue.mjs +30 -31
  6. package/es/src/ap-form/ap-form.vue2.mjs +11 -11
  7. package/es/src/ap-form/modal-form/index.vue.d.ts +2 -1
  8. package/es/src/ap-form/modal-form/index.vue.mjs +43 -39
  9. package/es/src/ap-form/search-form/index.vue.mjs +79 -78
  10. package/es/src/ap-modal/utils/createModal.mjs +34 -31
  11. package/es/src/ap-table/ap-table.vue.d.ts +54 -11
  12. package/es/src/ap-table/ap-table.vue.mjs +171 -148
  13. package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -0
  14. package/es/src/ap-table/hooks/use-table-paging.mjs +47 -46
  15. package/es/src/ap-table/hooks/use-table-row-selection.d.ts +60 -0
  16. package/es/src/ap-table/hooks/use-table-row-selection.mjs +62 -0
  17. package/es/src/ap-table/interface.d.ts +14 -2
  18. package/es/src/ap-table/style/ap-table.css +2 -0
  19. package/es/src/ap-tag/ap-tag-group.vue.d.ts +16 -6
  20. package/es/src/ap-tag/ap-tag-group.vue.mjs +81 -61
  21. package/es/src/ap-tag/interface.d.ts +24 -0
  22. package/es/src/ap-tag/style/ap-tag-group.css +8 -0
  23. package/es/src/ap-upload/apUpload.vue.d.ts +3 -3
  24. package/es/src/ap-upload/hooks/useOss.d.ts +3 -3
  25. package/es/src/business/ap-select-layout/index.css +117 -0
  26. package/es/src/business/ap-select-layout/index.d.ts +4 -0
  27. package/es/src/business/ap-select-layout/interface.d.ts +9 -0
  28. package/es/src/business/ap-select-layout/select-layout.vue.d.ts +76 -0
  29. package/es/src/business/ap-select-layout/select-layout.vue.mjs +4 -0
  30. package/es/src/business/ap-select-layout/select-layout.vue2.mjs +145 -0
  31. package/es/src/business/index.d.ts +76 -1
  32. package/es/src/business/index.mjs +9 -6
  33. package/es/src/config-provider/config-provider.d.ts +144 -1
  34. package/es/src/config-provider/config-provider.mjs +35 -29
  35. package/es/src/config-provider/index.mjs +22 -20
  36. package/es/src/design-token/index.mjs +6 -2
  37. package/es/src/editable-table/form-item.vue.d.ts +7 -7
  38. package/es/src/editable-table/form-item.vue.mjs +2 -2
  39. package/es/src/editable-table/index.vue.d.ts +7 -7
  40. package/es/src/editable-table/index.vue.mjs +10 -10
  41. package/es/src/editable-table/interface.d.ts +1 -1
  42. package/es/src/index.mjs +188 -186
  43. package/es/src/theme/ap-select-layout/ap-select-layout.css +117 -0
  44. package/es/src/theme/ap-table/ap-table.css +2 -0
  45. package/es/src/theme/ap-tag/ap-tag-group.css +8 -0
  46. package/lib/index.js +1 -1
  47. package/lib/src/ap-field/select/index.vue.js +1 -1
  48. package/lib/src/ap-form/ap-form-item-group/helper.d.ts +7 -0
  49. package/lib/src/ap-form/ap-form-item-group/helper.js +1 -1
  50. package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
  51. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  52. package/lib/src/ap-form/modal-form/index.vue.d.ts +2 -1
  53. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  54. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  55. package/lib/src/ap-modal/utils/createModal.js +1 -1
  56. package/lib/src/ap-table/ap-table.vue.d.ts +54 -11
  57. package/lib/src/ap-table/ap-table.vue.js +1 -1
  58. package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -0
  59. package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
  60. package/lib/src/ap-table/hooks/use-table-row-selection.d.ts +60 -0
  61. package/lib/src/ap-table/hooks/use-table-row-selection.js +1 -0
  62. package/lib/src/ap-table/interface.d.ts +14 -2
  63. package/lib/src/ap-table/style/ap-table.css +2 -0
  64. package/lib/src/ap-tag/ap-tag-group.vue.d.ts +16 -6
  65. package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
  66. package/lib/src/ap-tag/interface.d.ts +24 -0
  67. package/lib/src/ap-tag/style/ap-tag-group.css +8 -0
  68. package/lib/src/ap-upload/apUpload.vue.d.ts +3 -3
  69. package/lib/src/ap-upload/hooks/useOss.d.ts +3 -3
  70. package/lib/src/business/ap-select-layout/index.css +117 -0
  71. package/lib/src/business/ap-select-layout/index.d.ts +4 -0
  72. package/lib/src/business/ap-select-layout/interface.d.ts +9 -0
  73. package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +76 -0
  74. package/lib/src/business/ap-select-layout/select-layout.vue.js +1 -0
  75. package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -0
  76. package/lib/src/business/index.d.ts +76 -1
  77. package/lib/src/business/index.js +1 -1
  78. package/lib/src/config-provider/config-provider.d.ts +144 -1
  79. package/lib/src/config-provider/config-provider.js +1 -1
  80. package/lib/src/config-provider/index.js +1 -1
  81. package/lib/src/design-token/index.js +1 -1
  82. package/lib/src/editable-table/form-item.vue.d.ts +7 -7
  83. package/lib/src/editable-table/form-item.vue.js +1 -1
  84. package/lib/src/editable-table/index.vue.d.ts +7 -7
  85. package/lib/src/editable-table/index.vue.js +1 -1
  86. package/lib/src/editable-table/interface.d.ts +1 -1
  87. package/lib/src/index.js +1 -1
  88. package/lib/src/theme/ap-select-layout/ap-select-layout.css +117 -0
  89. package/lib/src/theme/ap-table/ap-table.css +2 -0
  90. package/lib/src/theme/ap-tag/ap-tag-group.css +8 -0
  91. 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
- declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTagGroupProps>, {
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
- ellipsisColor: string;
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
- ellipsisColor: string;
16
+ ellipsis: () => {};
12
17
  }>>>, {
18
+ ellipsis: EllipsisProps;
13
19
  space: number;
14
20
  list: ApTagProps[];
15
- ellipsisColor: string;
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 e, defineComponent as z, ref as p, computed as m, unref as l, nextTick as g, watch as L, onMounted as W, onUnmounted as b, openBlock as f, createBlock as v, withCtx as y, normalizeClass as F, normalizeStyle as w, createElementBlock as N, Fragment as T, renderList as q, mergeProps as A, createCommentVNode as M } from "vue";
2
- import { Tooltip as P } from "ant-design-vue";
3
- import V from "@ant-design/icons-vue";
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 { useNamespace as $ } from "../config-provider/hooks/use-namespace.mjs";
8
- import j from "./ap-tag.vue.mjs";
9
- const I = /* @__PURE__ */ e("svg", {
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__ */ e("defs", null, [
19
- /* @__PURE__ */ e("clipPath", { id: "master_svg0_1133_24991" }, [
20
- /* @__PURE__ */ e("rect", {
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__ */ e("g", { "clip-path": "url(#master_svg0_1133_24991)" }, [
30
- /* @__PURE__ */ e("g", null, [
31
- /* @__PURE__ */ e("ellipse", {
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__ */ e("g", null, [
41
- /* @__PURE__ */ e("ellipse", {
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__ */ e("g", null, [
51
- /* @__PURE__ */ e("ellipse", {
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), O = /* @__PURE__ */ z({
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: { default: "#34B77C" }
69
+ ellipsisColor: {},
70
+ ellipsis: { default: () => ({}) }
67
71
  },
68
- setup(_) {
69
- const r = _, { b: x } = $("tag-group"), a = p(), h = m(() => l(o) < r.list.length), C = m(() => r.list.slice(0, l(o))), o = p(0), c = p(0), u = p(r.list.length), k = m(() => r.list.map((t) => t.text).join("、")), B = m(() => [x()].filter(Boolean)), i = () => {
70
- if (!a.value)
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 t = a.value.scrollWidth, n = a.value.clientWidth;
73
- if (l(c) <= l(u)) {
74
- const s = Math.floor((l(c) + l(u)) / 2);
75
- t <= n ? (o.value = s, c.value = s + 1) : u.value = s - 1, g(() => {
76
- requestAnimationFrame(i);
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
- t > n && (o.value = o.value - 1, g(() => {
80
- requestAnimationFrame(i);
90
+ e > i && (n.value = n.value - 1, g(() => {
91
+ requestAnimationFrame(f);
81
92
  }));
82
- }, d = () => {
83
- c.value = 0, u.value = r.list.length, o.value = 0;
93
+ }, w = () => {
94
+ p.value = 0, m.value = l.list.length, n.value = 0;
84
95
  };
85
- return L(
86
- () => r.list,
87
- (t, n) => {
88
- t !== n && (d(), g(() => i()));
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
- ), W(() => {
94
- window.addEventListener("resize", () => {
95
- d(), i();
96
- });
97
- }), b(() => {
98
- window.removeEventListener("resize", () => {
99
- d(), i();
100
- });
101
- }), (t, n) => (f(), v(l(P), {
102
- title: k.value,
103
- trigger: "hover"
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
- e("div", {
107
- class: F(B.value),
123
+ t("div", {
124
+ class: b(A.value),
108
125
  ref_key: "container",
109
- ref: a,
110
- style: w({
111
- pointerEvents: h.value ? "auto" : "none"
126
+ ref: c,
127
+ style: E({
128
+ pointerEvents: d.value ? "auto" : "none"
112
129
  })
113
130
  }, [
114
- (f(!0), N(T, null, q(C.value, (s, E) => (f(), v(j, A({ ref_for: !0 }, s, {
115
- key: E,
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: `${t.space}px`
134
+ marginRight: `${e.space}px`
118
135
  }
119
136
  }), null, 16, ["style"]))), 128)),
120
- h.value ? (f(), v(l(V), {
137
+ d.value && r.value.symbol === "icon" ? (u(), h(o(J), {
121
138
  key: 0,
122
- style: w({ color: t.ellipsisColor })
139
+ style: E({ color: e.ellipsisColor || r.value.iconColor })
123
140
  }, {
124
141
  component: y(() => [
125
- I
142
+ Z
126
143
  ]),
127
144
  _: 1
128
- }, 8, ["style"])) : M("", !0)
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
- _: 1
132
- }, 8, ["title"]));
151
+ _: 3
152
+ }, 16));
133
153
  }
134
154
  });
135
155
  export {
136
- O as default
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
  }
@@ -5,3 +5,11 @@
5
5
  white-space: nowrap;
6
6
  align-items: center;
7
7
  }
8
+ .aplus-tag-group-ellipsis-text--admin {
9
+ font-size: 12px;
10
+ color: #1890FF;
11
+ }
12
+ .aplus-tag-group-ellipsis-text--aplus {
13
+ font-size: 12px;
14
+ color: #0070FF;
15
+ }
@@ -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 { accessCreate } from '@aplus-frontend/oss';
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<() => Promise< accessCreate>>;
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<() => Promise< accessCreate>>;
91
+ type: PropType<GetOssAccess>;
92
92
  };
93
93
  }>> & {
94
94
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
@@ -1,9 +1,9 @@
1
- import { client, Oss } from '@aplus-frontend/oss';
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 = Parameters<typeof client.initOssClient>[0]['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: Parameters<typeof client.initOssClient>[0]['getOssAccess']): Promise<Oss>;
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
+ }
@@ -0,0 +1,4 @@
1
+ import { default as SelectLayout } from './select-layout.vue';
2
+
3
+ export * from './interface';
4
+ export { SelectLayout };
@@ -0,0 +1,9 @@
1
+ export interface ApSelectItem {
2
+ name: string;
3
+ value: string;
4
+ }
5
+ export interface ApSelectLayoutProps<T extends ApSelectItem> {
6
+ title: string;
7
+ request: () => Promise<T[]>;
8
+ defaultFold?: boolean;
9
+ }