@aplus-frontend/ui 7.13.9 → 7.13.10
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/src/ag-grid/hooks/use-columns.d.ts +2 -0
- package/es/src/ag-grid/hooks/use-columns.mjs +35 -17
- package/es/src/ag-grid/index.vue.mjs +323 -292
- package/es/src/ap-field/date-range/index.vue.mjs +18 -18
- package/es/src/ap-field/date-range/read.vue2.mjs +3 -3
- package/es/src/ap-field/hooks/use-default-presets.mjs +59 -16
- package/es/src/ap-field/interface.d.ts +46 -1
- package/es/src/ap-table/hooks/use-sorted-filtered.d.ts +18 -2
- package/es/src/ap-table/hooks/use-sorted-filtered.mjs +13 -11
- package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +17 -2
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +148 -142
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +119 -112
- package/es/src/business/ap-export-group/handleExportDownload.d.ts +1 -1
- package/es/src/business/ap-export-group/handleExportDownload.mjs +2 -2
- package/es/src/business/ap-export-group/interface.d.ts +9 -0
- package/es/src/config-provider/config-provider-props.d.ts +1 -1
- package/es/src/config-provider/config-provider.d.ts +3 -0
- package/es/src/config-provider/hooks/use-global-config.d.ts +1 -0
- package/es/src/config-provider/index.d.ts +6 -0
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/hooks/use-columns.d.ts +2 -0
- package/lib/src/ag-grid/hooks/use-columns.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/read.vue2.js +1 -1
- package/lib/src/ap-field/hooks/use-default-presets.js +1 -1
- package/lib/src/ap-field/interface.d.ts +46 -1
- package/lib/src/ap-table/hooks/use-sorted-filtered.d.ts +18 -2
- package/lib/src/ap-table/hooks/use-sorted-filtered.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +17 -2
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/business/ap-export-group/handleExportDownload.d.ts +1 -1
- package/lib/src/business/ap-export-group/handleExportDownload.js +1 -1
- package/lib/src/business/ap-export-group/interface.d.ts +9 -0
- package/lib/src/config-provider/config-provider-props.d.ts +1 -1
- package/lib/src/config-provider/config-provider.d.ts +3 -0
- package/lib/src/config-provider/hooks/use-global-config.d.ts +1 -0
- package/lib/src/config-provider/index.d.ts +6 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Ref, ComputedRef } from 'vue';
|
|
2
|
+
import { DefaultSortOrderType } from '../../ap-table/hooks/use-sorted-filtered';
|
|
2
3
|
import { AgGridColumnType, AgGridProps } from '../interface';
|
|
3
4
|
/**
|
|
4
5
|
* 维护/更新表格将要显示的类
|
|
@@ -8,4 +9,5 @@ export declare const useColumns: <RecordType>(props: AgGridProps<RecordType>) =>
|
|
|
8
9
|
shownColumns: Ref<AgGridColumnType<RecordType>[], AgGridColumnType<RecordType>[]>;
|
|
9
10
|
columnKeys: ComputedRef<string[]>;
|
|
10
11
|
getTargetColumnByKey: (key?: string) => AgGridColumnType<RecordType> | undefined;
|
|
12
|
+
defaultSortOrder: ComputedRef<DefaultSortOrderType | undefined>;
|
|
11
13
|
};
|
|
@@ -1,31 +1,49 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { getStringKey as
|
|
3
|
-
const g = (
|
|
4
|
-
const
|
|
1
|
+
import { ref as c, computed as s, watch as y } from "vue";
|
|
2
|
+
import { getStringKey as i } from "../utils.mjs";
|
|
3
|
+
const g = (r) => {
|
|
4
|
+
const o = c([]), u = c([]);
|
|
5
5
|
function m() {
|
|
6
|
-
return
|
|
6
|
+
return r.columns?.filter((e) => !e.hideInTable) || [];
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return
|
|
8
|
+
function d(e) {
|
|
9
|
+
return o.value.find((n) => i(n.key) === e);
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
() =>
|
|
11
|
+
const f = s(
|
|
12
|
+
() => o.value.map((e) => i(e.key)).filter(Boolean)
|
|
13
13
|
);
|
|
14
|
-
|
|
15
|
-
() =>
|
|
14
|
+
y(
|
|
15
|
+
() => r.columns,
|
|
16
16
|
() => {
|
|
17
17
|
const e = m();
|
|
18
|
-
|
|
18
|
+
o.value = e, u.value = e, r.onShownColumnsChange?.(e);
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
deep: !0,
|
|
22
22
|
immediate: !0
|
|
23
23
|
}
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
);
|
|
25
|
+
function l(e) {
|
|
26
|
+
for (const n of e)
|
|
27
|
+
if (n.children) {
|
|
28
|
+
const t = l(n.children);
|
|
29
|
+
if (t)
|
|
30
|
+
return t;
|
|
31
|
+
} else if (n.defaultSortOrder) {
|
|
32
|
+
const t = n.field ?? n.dataIndex ?? n.key;
|
|
33
|
+
return {
|
|
34
|
+
colKey: n.key,
|
|
35
|
+
field: t,
|
|
36
|
+
order: n.defaultSortOrder
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const a = s(() => l(o.value));
|
|
41
|
+
return {
|
|
42
|
+
columns: o,
|
|
43
|
+
shownColumns: u,
|
|
44
|
+
columnKeys: f,
|
|
45
|
+
getTargetColumnByKey: d,
|
|
46
|
+
defaultSortOrder: a
|
|
29
47
|
};
|
|
30
48
|
};
|
|
31
49
|
export {
|