@aplus-frontend/ui 0.0.33 → 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 (73) 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/index.vue.mjs +27 -26
  4. package/es/src/ap-form/ap-form.vue2.mjs +11 -11
  5. package/es/src/ap-form/search-form/index.vue.mjs +79 -78
  6. package/es/src/ap-modal/utils/createModal.mjs +34 -31
  7. package/es/src/ap-table/ap-table.vue.d.ts +54 -11
  8. package/es/src/ap-table/ap-table.vue.mjs +171 -148
  9. package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -0
  10. package/es/src/ap-table/hooks/use-table-paging.mjs +47 -46
  11. package/es/src/ap-table/hooks/use-table-row-selection.d.ts +60 -0
  12. package/es/src/ap-table/hooks/use-table-row-selection.mjs +62 -0
  13. package/es/src/ap-table/interface.d.ts +14 -2
  14. package/es/src/ap-table/style/ap-table.css +2 -0
  15. package/es/src/ap-upload/apUpload.vue.d.ts +3 -3
  16. package/es/src/ap-upload/hooks/useOss.d.ts +3 -3
  17. package/es/src/business/ap-select-layout/index.css +117 -0
  18. package/es/src/business/ap-select-layout/index.d.ts +4 -0
  19. package/es/src/business/ap-select-layout/interface.d.ts +9 -0
  20. package/es/src/business/ap-select-layout/select-layout.vue.d.ts +76 -0
  21. package/es/src/business/ap-select-layout/select-layout.vue.mjs +4 -0
  22. package/es/src/business/ap-select-layout/select-layout.vue2.mjs +145 -0
  23. package/es/src/business/index.d.ts +76 -1
  24. package/es/src/business/index.mjs +9 -6
  25. package/es/src/config-provider/config-provider.d.ts +144 -1
  26. package/es/src/config-provider/config-provider.mjs +35 -29
  27. package/es/src/config-provider/index.mjs +22 -20
  28. package/es/src/design-token/index.mjs +1 -1
  29. package/es/src/editable-table/form-item.vue.d.ts +7 -7
  30. package/es/src/editable-table/form-item.vue.mjs +2 -2
  31. package/es/src/editable-table/index.vue.d.ts +7 -7
  32. package/es/src/editable-table/index.vue.mjs +10 -10
  33. package/es/src/editable-table/interface.d.ts +1 -1
  34. package/es/src/index.mjs +188 -186
  35. package/es/src/theme/ap-select-layout/ap-select-layout.css +117 -0
  36. package/es/src/theme/ap-table/ap-table.css +2 -0
  37. package/lib/index.js +1 -1
  38. package/lib/src/ap-field/select/index.vue.js +1 -1
  39. package/lib/src/ap-form/ap-form-item-group/index.vue.js +1 -1
  40. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  41. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  42. package/lib/src/ap-modal/utils/createModal.js +1 -1
  43. package/lib/src/ap-table/ap-table.vue.d.ts +54 -11
  44. package/lib/src/ap-table/ap-table.vue.js +1 -1
  45. package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -0
  46. package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
  47. package/lib/src/ap-table/hooks/use-table-row-selection.d.ts +60 -0
  48. package/lib/src/ap-table/hooks/use-table-row-selection.js +1 -0
  49. package/lib/src/ap-table/interface.d.ts +14 -2
  50. package/lib/src/ap-table/style/ap-table.css +2 -0
  51. package/lib/src/ap-upload/apUpload.vue.d.ts +3 -3
  52. package/lib/src/ap-upload/hooks/useOss.d.ts +3 -3
  53. package/lib/src/business/ap-select-layout/index.css +117 -0
  54. package/lib/src/business/ap-select-layout/index.d.ts +4 -0
  55. package/lib/src/business/ap-select-layout/interface.d.ts +9 -0
  56. package/lib/src/business/ap-select-layout/select-layout.vue.d.ts +76 -0
  57. package/lib/src/business/ap-select-layout/select-layout.vue.js +1 -0
  58. package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -0
  59. package/lib/src/business/index.d.ts +76 -1
  60. package/lib/src/business/index.js +1 -1
  61. package/lib/src/config-provider/config-provider.d.ts +144 -1
  62. package/lib/src/config-provider/config-provider.js +1 -1
  63. package/lib/src/config-provider/index.js +1 -1
  64. package/lib/src/design-token/index.js +1 -1
  65. package/lib/src/editable-table/form-item.vue.d.ts +7 -7
  66. package/lib/src/editable-table/form-item.vue.js +1 -1
  67. package/lib/src/editable-table/index.vue.d.ts +7 -7
  68. package/lib/src/editable-table/index.vue.js +1 -1
  69. package/lib/src/editable-table/interface.d.ts +1 -1
  70. package/lib/src/index.js +1 -1
  71. package/lib/src/theme/ap-select-layout/ap-select-layout.css +117 -0
  72. package/lib/src/theme/ap-table/ap-table.css +2 -0
  73. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { ref as v, nextTick as N, unref as r, onMounted as U, computed as $ } from "vue";
1
+ import { ref as v, nextTick as N, unref as o, onMounted as U, computed as S } from "vue";
2
2
  import { parseFieldValue as W, dataIndexToStr as X } from "../utils.mjs";
3
3
  import { isArray as Y } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
@@ -6,23 +6,23 @@ import { useLocale as Z } from "../../config-provider/hooks/use-locale.mjs";
6
6
  const oe = ({
7
7
  manual: j = !1,
8
8
  defaultCurrent: y = 1,
9
- defaultPageSize: S = 10,
9
+ defaultPageSize: T = 10,
10
10
  request: D,
11
11
  defaultParams: R = {},
12
12
  defaultData: A = [],
13
- formatParams: T,
14
- paramsValueTypeMap: z,
15
- resetFieldsIgnores: P,
13
+ formatParams: z,
14
+ paramsValueTypeMap: P,
15
+ resetFieldsIgnores: V,
16
16
  filterFields: B = [],
17
17
  sortFields: E = []
18
18
  }) => {
19
19
  let F = 0, f = {};
20
- const L = (e) => T ? T(e) : e, l = v(), i = v(y), g = v(S), { t: V } = Z(), n = v({
20
+ const L = (e) => z ? z(e) : e, l = v(), i = v(y), g = v(T), { t: b } = Z(), n = v({
21
21
  total: 0,
22
22
  records: A,
23
23
  loading: !1
24
- }), b = async (e) => {
25
- var o;
24
+ }), w = async (e) => {
25
+ var r;
26
26
  const a = L(e), t = Date.now();
27
27
  F = t, n.value.loading = !0;
28
28
  try {
@@ -30,57 +30,57 @@ const oe = ({
30
30
  ...R,
31
31
  ...a
32
32
  });
33
- F === t && (n.value.total = s.total || ((o = s.data) == null ? void 0 : o.length) || 0, n.value.records = [...s.data || []]);
33
+ F === t && (n.value.total = s.total || ((r = s.data) == null ? void 0 : r.length) || 0, n.value.records = [...s.data || []]);
34
34
  } catch {
35
35
  F === t && (n.value.records = [], n.value.total = 0);
36
36
  } finally {
37
37
  n.value.loading = !1;
38
38
  }
39
- }, w = (e) => {
39
+ }, C = (e) => {
40
40
  const a = {};
41
- return Object.entries(e).forEach(([t, o]) => {
42
- if (a[t] = o, z && o) {
43
- const s = z[t];
44
- s && (a[t] = W(s, o));
41
+ return Object.entries(e).forEach(([t, r]) => {
42
+ if (a[t] = r, P && r) {
43
+ const s = P[t];
44
+ s && (a[t] = W(s, r));
45
45
  }
46
46
  }), a;
47
47
  }, M = (e) => {
48
- var o, s, d, p, m, u, c;
49
- const a = ((s = (o = l.value) == null ? void 0 : o.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
50
- Object.entries(a).forEach(([O, K]) => {
51
- P && P.indexOf(O) > -1 && (t[O] = K);
48
+ var r, s, d, p, m, u, c;
49
+ const a = ((s = (r = l.value) == null ? void 0 : r.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
50
+ Object.entries(a).forEach(([$, K]) => {
51
+ V && V.indexOf($) > -1 && (t[$] = K);
52
52
  }), (p = (d = l.value) == null ? void 0 : d.apForm) == null || p.resetFields(), (c = (u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || c.call(u, t), N(() => {
53
53
  e == null || e();
54
54
  });
55
55
  }, h = (e) => {
56
56
  f = e;
57
- const a = w(e);
58
- b(a);
57
+ const a = C(e);
58
+ w(a);
59
59
  }, q = (e) => {
60
60
  h({
61
61
  ...f,
62
62
  ...e
63
63
  });
64
- }, C = () => {
64
+ }, x = () => {
65
65
  var a, t;
66
66
  const e = ((t = (a = l.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
67
67
  i.value = 1, h({
68
68
  ...e,
69
69
  current: 1,
70
- pageSize: f.pageSize || S
70
+ pageSize: f.pageSize || T
71
71
  });
72
72
  }, J = () => {
73
- M(C);
73
+ M(x);
74
74
  }, Q = () => {
75
75
  h(f);
76
76
  }, G = (e) => {
77
- const a = r(n).total - e, t = Math.ceil(a / r(g)), o = r(i) > t ? t : r(i);
77
+ const a = o(n).total - e, t = Math.ceil(a / o(g)), r = o(i) > t ? t : o(i);
78
78
  q({
79
- current: o > 0 ? o : 1
79
+ current: r > 0 ? r : 1
80
80
  });
81
- }, x = (e, a, t) => {
81
+ }, O = (e, a, t) => {
82
82
  var m, u;
83
- const o = ((u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.getFieldsValue(!0)) || {};
83
+ const r = ((u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.getFieldsValue(!0)) || {};
84
84
  i.value = e.current, g.value = e.pageSize;
85
85
  const s = Y(t) ? [...t] : [t], d = {};
86
86
  for (const c of s)
@@ -89,7 +89,7 @@ const oe = ({
89
89
  for (const c of Object.keys(a))
90
90
  B.includes(c) && (p[c] = a[c]);
91
91
  h({
92
- ...o,
92
+ ...r,
93
93
  filter: p,
94
94
  sort: d,
95
95
  current: e.current,
@@ -100,43 +100,44 @@ const oe = ({
100
100
  var a, t;
101
101
  const e = ((t = (a = l.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
102
102
  if (f = {
103
- current: r(i),
104
- pageSize: r(g),
103
+ current: o(i),
104
+ pageSize: o(g),
105
105
  ...e
106
106
  }, !j) {
107
- const o = w(f);
108
- b(o);
107
+ const r = C(f);
108
+ w(r);
109
109
  }
110
110
  });
111
- const H = $(() => r(n).total === 0 ? "-" : `${r(i.value)}/${Math.ceil(
112
- r(n).total / r(g)
113
- )}`), I = $(() => ({
114
- loading: r(n).loading,
111
+ const H = S(() => o(n).total === 0 ? "-" : `${o(i.value)}/${Math.ceil(
112
+ o(n).total / o(g)
113
+ )}`), I = S(() => ({
114
+ loading: o(n).loading,
115
115
  pagination: {
116
- current: r(i),
117
- pageSize: r(g),
118
- total: r(n).total,
116
+ current: o(i),
117
+ pageSize: o(g),
118
+ total: o(n).total,
119
119
  showSizeChanger: !0,
120
120
  showQuickJumper: !0,
121
- showTotal: (e) => `${V("ap.apTable.pagination.totalLeft", { total: e })} ${V(
121
+ showTotal: (e) => `${b("ap.apTable.pagination.totalLeft", { total: e })} ${b(
122
122
  "ap.apTable.pagination.totalRight",
123
- { page: r(H) }
123
+ { page: o(H) }
124
124
  )}`
125
125
  },
126
- onChange: x,
127
- dataSource: r(n).records
126
+ onChange: O,
127
+ dataSource: o(n).records
128
128
  }));
129
129
  return {
130
130
  formRef: l,
131
- submit: C,
131
+ submit: x,
132
132
  reset: J,
133
133
  refresh: Q,
134
134
  refreshByDelete: G,
135
135
  data: n,
136
136
  current: i,
137
137
  pageSize: g,
138
- handleTableChange: x,
139
- tableProps: I
138
+ handleTableChange: O,
139
+ tableProps: I,
140
+ dataSource: S(() => o(n).records)
140
141
  };
141
142
  };
142
143
  export {
@@ -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,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
+ }
@@ -0,0 +1,76 @@
1
+ import { ApSelectItem } from './interface';
2
+ import { VNodeProps, AllowedComponentProps, ComponentCustomProps, ShallowUnwrapRef, VNode, RendererNode, RendererElement } from 'vue';
3
+
4
+ declare const _default: <T extends ApSelectItem>(__VLS_props: {
5
+ onAfterEnter?: ((el: Element) => any) | undefined;
6
+ onAfterLeave?: ((el: Element) => any) | undefined;
7
+ title: string;
8
+ request: () => Promise<T[]>;
9
+ onOnSelect?: ((value: T) => any) | undefined;
10
+ defaultFold?: boolean | undefined;
11
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps, __VLS_ctx?: {
12
+ attrs: any;
13
+ slots: {
14
+ itemRender?(_: {
15
+ item: T;
16
+ }): any;
17
+ default?(_: {}): any;
18
+ };
19
+ emit: {
20
+ (event: 'onSelect', value: T): void;
21
+ (event: 'afterEnter', el: Element): void;
22
+ (event: 'afterLeave', el: Element): void;
23
+ };
24
+ } | undefined, __VLS_expose?: ((exposed: ShallowUnwrapRef<{}>) => void) | undefined, __VLS_setup?: Promise<{
25
+ props: {
26
+ onAfterEnter?: ((el: Element) => any) | undefined;
27
+ onAfterLeave?: ((el: Element) => any) | undefined;
28
+ title: string;
29
+ request: () => Promise<T[]>;
30
+ onOnSelect?: ((value: T) => any) | undefined;
31
+ defaultFold?: boolean | undefined;
32
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
33
+ expose(exposed: ShallowUnwrapRef<{}>): void;
34
+ attrs: any;
35
+ slots: {
36
+ itemRender?(_: {
37
+ item: T;
38
+ }): any;
39
+ default?(_: {}): any;
40
+ };
41
+ emit: {
42
+ (event: 'onSelect', value: T): void;
43
+ (event: 'afterEnter', el: Element): void;
44
+ (event: 'afterLeave', el: Element): void;
45
+ };
46
+ }>) => VNode<RendererNode, RendererElement, {
47
+ [key: string]: any;
48
+ }> & {
49
+ __ctx?: {
50
+ props: {
51
+ onAfterEnter?: ((el: Element) => any) | undefined;
52
+ onAfterLeave?: ((el: Element) => any) | undefined;
53
+ title: string;
54
+ request: () => Promise<T[]>;
55
+ onOnSelect?: ((value: T) => any) | undefined;
56
+ defaultFold?: boolean | undefined;
57
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps;
58
+ expose(exposed: ShallowUnwrapRef<{}>): void;
59
+ attrs: any;
60
+ slots: {
61
+ itemRender?(_: {
62
+ item: T;
63
+ }): any;
64
+ default?(_: {}): any;
65
+ };
66
+ emit: {
67
+ (event: 'onSelect', value: T): void;
68
+ (event: 'afterEnter', el: Element): void;
69
+ (event: 'afterLeave', el: Element): void;
70
+ };
71
+ } | undefined;
72
+ };
73
+ export default _default;
74
+ type __VLS_Prettify<T> = {
75
+ [K in keyof T]: T[K];
76
+ } & {};
@@ -0,0 +1,4 @@
1
+ import f from "./select-layout.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };