@aplus-frontend/ui 0.4.34 → 0.5.0-beta.1

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 (101) hide show
  1. package/es/index.mjs +14 -12
  2. package/es/src/ap-grid/constants.d.ts +9 -0
  3. package/es/src/ap-grid/constants.mjs +12 -0
  4. package/es/src/ap-grid/hooks/use-inner-params.d.ts +10 -0
  5. package/es/src/ap-grid/hooks/use-inner-params.mjs +41 -0
  6. package/es/src/ap-grid/hooks/use-render-columns.d.ts +6 -0
  7. package/es/src/ap-grid/hooks/use-render-columns.mjs +29 -0
  8. package/es/src/ap-grid/index.d.ts +3 -0
  9. package/es/src/ap-grid/index.mjs +2 -0
  10. package/es/src/ap-grid/index.vue.d.ts +44 -0
  11. package/es/src/ap-grid/index.vue.mjs +356 -0
  12. package/es/src/ap-grid/index.vue2.mjs +4 -0
  13. package/es/src/ap-grid/interface.d.ts +264 -0
  14. package/es/src/ap-grid/interface.mjs +1 -0
  15. package/es/src/ap-grid/style/css.d.ts +0 -0
  16. package/es/src/ap-grid/style/css.js +1 -0
  17. package/es/src/ap-grid/style/index.d.ts +0 -0
  18. package/es/src/ap-grid/style/index.js +1 -0
  19. package/es/src/ap-grid/utils/col.d.ts +20 -0
  20. package/es/src/ap-grid/utils/col.mjs +106 -0
  21. package/es/src/ap-grid/utils/renderer.d.ts +3 -0
  22. package/es/src/ap-grid/utils/renderer.mjs +21 -0
  23. package/es/src/ap-grid/utils/table.d.ts +13 -0
  24. package/es/src/ap-grid/utils/table.mjs +64 -0
  25. package/es/src/ap-table/ap-table.vue.d.ts +2 -0
  26. package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +38 -38
  27. package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +9 -9
  28. package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +21 -21
  29. package/es/src/ap-table/components/setting/utils.d.ts +15 -3
  30. package/es/src/ap-table/components/setting/utils.mjs +49 -38
  31. package/es/src/ap-table/context.d.ts +2 -1
  32. package/es/src/ap-table/context.mjs +8 -7
  33. package/es/src/ap-table/hooks/use-table-column-state.mjs +79 -70
  34. package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +8 -2
  35. package/es/src/ap-table/hooks/use-table-paging-ng.mjs +43 -40
  36. package/es/src/ap-table/hooks/use-table-row-selection.d.ts +12 -0
  37. package/es/src/ap-table/hooks/use-table-row-selection.mjs +41 -27
  38. package/es/src/ap-table/interface.d.ts +4 -0
  39. package/es/src/ap-table/utils.d.ts +1 -1
  40. package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +2 -0
  41. package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +2 -0
  42. package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +2 -0
  43. package/es/src/business/ap-table-modal/index.d.ts +8 -0
  44. package/es/src/business/ap-table-modal/table-modal.vue.d.ts +4 -0
  45. package/es/src/business/hooks/usePageListApTable.d.ts +2 -0
  46. package/es/src/index.d.ts +1 -0
  47. package/es/src/index.mjs +244 -241
  48. package/es/src/path-map.mjs +2 -1
  49. package/lib/index.js +1 -1
  50. package/lib/src/ap-grid/constants.d.ts +9 -0
  51. package/lib/src/ap-grid/constants.js +1 -0
  52. package/lib/src/ap-grid/hooks/use-inner-params.d.ts +10 -0
  53. package/lib/src/ap-grid/hooks/use-inner-params.js +1 -0
  54. package/lib/src/ap-grid/hooks/use-render-columns.d.ts +6 -0
  55. package/lib/src/ap-grid/hooks/use-render-columns.js +1 -0
  56. package/lib/src/ap-grid/index.d.ts +3 -0
  57. package/lib/src/ap-grid/index.js +1 -0
  58. package/lib/src/ap-grid/index.vue.d.ts +44 -0
  59. package/lib/src/ap-grid/index.vue.js +1 -0
  60. package/lib/src/ap-grid/index.vue2.js +1 -0
  61. package/lib/src/ap-grid/interface.d.ts +264 -0
  62. package/lib/src/ap-grid/interface.js +1 -0
  63. package/lib/src/ap-grid/style/css.cjs +1 -0
  64. package/lib/src/ap-grid/style/css.d.ts +0 -0
  65. package/lib/src/ap-grid/style/index.cjs +1 -0
  66. package/lib/src/ap-grid/style/index.d.ts +0 -0
  67. package/lib/src/ap-grid/utils/col.d.ts +20 -0
  68. package/lib/src/ap-grid/utils/col.js +1 -0
  69. package/lib/src/ap-grid/utils/renderer.d.ts +3 -0
  70. package/lib/src/ap-grid/utils/renderer.js +1 -0
  71. package/lib/src/ap-grid/utils/table.d.ts +13 -0
  72. package/lib/src/ap-grid/utils/table.js +1 -0
  73. package/lib/src/ap-table/ap-table.vue.d.ts +2 -0
  74. package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -1
  75. package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -1
  76. package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -1
  77. package/lib/src/ap-table/components/setting/utils.d.ts +15 -3
  78. package/lib/src/ap-table/components/setting/utils.js +1 -1
  79. package/lib/src/ap-table/context.d.ts +2 -1
  80. package/lib/src/ap-table/context.js +1 -1
  81. package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
  82. package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +8 -2
  83. package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
  84. package/lib/src/ap-table/hooks/use-table-row-selection.d.ts +12 -0
  85. package/lib/src/ap-table/hooks/use-table-row-selection.js +1 -1
  86. package/lib/src/ap-table/interface.d.ts +4 -0
  87. package/lib/src/ap-table/utils.d.ts +1 -1
  88. package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +2 -0
  89. package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +2 -0
  90. package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +2 -0
  91. package/lib/src/business/ap-table-modal/index.d.ts +8 -0
  92. package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +4 -0
  93. package/lib/src/business/hooks/usePageListApTable.d.ts +2 -0
  94. package/lib/src/index.d.ts +1 -0
  95. package/lib/src/index.js +1 -1
  96. package/lib/src/path-map.js +1 -1
  97. package/package.json +3 -1
  98. package/theme/ap-grid/index.css +302 -0
  99. package/theme/ap-grid/index.less +65 -0
  100. package/theme/index.css +51 -0
  101. package/theme/index.less +1 -0
package/es/index.mjs CHANGED
@@ -113,12 +113,13 @@ import { default as Nt } from "./src/scroll-view/index.vue.mjs";
113
113
  import { default as wt } from "./src/portal/index.vue.mjs";
114
114
  import { default as Bt } from "./src/full-screen/index.vue.mjs";
115
115
  import { default as Kt } from "./src/resize-observer/index.vue.mjs";
116
- import { useMessage as Ut } from "./src/hooks/useMessage.mjs";
117
- import { useControllableValue as Vt } from "./src/hooks/useControllableValue.mjs";
118
- import { useManualRef as _t } from "./src/hooks/useManualRef.mjs";
119
- import { useThrottleRef as $t } from "./src/hooks/useThrottleRef.mjs";
120
- import { useFullScreen as qt } from "./src/hooks/useFullScreen.mjs";
121
- import { useResize as Qt } from "./src/hooks/useResize.mjs";
116
+ import { default as Ut } from "./src/ap-grid/index.vue.mjs";
117
+ import { useMessage as Vt } from "./src/hooks/useMessage.mjs";
118
+ import { useControllableValue as _t } from "./src/hooks/useControllableValue.mjs";
119
+ import { useManualRef as $t } from "./src/hooks/useManualRef.mjs";
120
+ import { useThrottleRef as qt } from "./src/hooks/useThrottleRef.mjs";
121
+ import { useFullScreen as Qt } from "./src/hooks/useFullScreen.mjs";
122
+ import { useResize as Yt } from "./src/hooks/useResize.mjs";
122
123
  const a = {
123
124
  install: (r) => {
124
125
  for (const t in o) {
@@ -188,6 +189,7 @@ export {
188
189
  ge as ApFormProvider,
189
190
  de as ApFormSearchForm,
190
191
  ce as ApFormSet,
192
+ Ut as ApGrid,
191
193
  at as ApGroupSearch,
192
194
  hr as ApImage,
193
195
  ho as ApInfoLayout,
@@ -254,19 +256,19 @@ export {
254
256
  l as pathMap,
255
257
  F as provideGlobalConfig,
256
258
  D as translate,
257
- Vt as useControllableValue,
258
- qt as useFullScreen,
259
+ _t as useControllableValue,
260
+ Qt as useFullScreen,
259
261
  R as useGetDerivedNamespace,
260
262
  I as useGlobalConfig,
261
263
  g as useLocale,
262
- _t as useManualRef,
263
- Ut as useMessage,
264
+ $t as useManualRef,
265
+ Vt as useMessage,
264
266
  M as useNamespace,
265
267
  Wr as usePageListApTable,
266
- Qt as useResize,
268
+ Yt as useResize,
267
269
  or as useTableModal,
268
270
  ct as useTablePaging,
269
271
  Hr as useTableRefresh,
270
272
  tr as useTableSelectModal,
271
- $t as useThrottleRef
273
+ qt as useThrottleRef
272
274
  };
@@ -0,0 +1,9 @@
1
+ export declare const sizeMap: {
2
+ readonly mini: undefined;
3
+ readonly small: "small";
4
+ readonly medium: "middle";
5
+ };
6
+ export declare const sizeReverseMap: {
7
+ readonly small: "small";
8
+ readonly middle: "medium";
9
+ };
@@ -0,0 +1,12 @@
1
+ const m = {
2
+ mini: void 0,
3
+ small: "small",
4
+ medium: "middle"
5
+ }, e = {
6
+ small: "small",
7
+ middle: "medium"
8
+ };
9
+ export {
10
+ m as sizeMap,
11
+ e as sizeReverseMap
12
+ };
@@ -0,0 +1,10 @@
1
+ import { ApGridProps } from '../interface';
2
+ import { VxeTableEvents } from 'vxe-table';
3
+ /**
4
+ * 用于管理内部生成的查询参数(排序/筛选/分页等)
5
+ */
6
+ export declare const useInnerParams: <RecordType>(tableChangeCallback: ApGridProps["onChange"]) => {
7
+ sortChangeEvent: VxeTableEvents.SortChange<RecordType>;
8
+ filterChangeEvent: VxeTableEvents.FilterChange<RecordType>;
9
+ paginationChangeEvent: (page: number, pageSize: number) => void;
10
+ };
@@ -0,0 +1,41 @@
1
+ import { DEFAULT_PAGE_SIZE as g, DEFAULT_CURRENT as E } from "../../ap-table/hooks/use-table-paging-ng.mjs";
2
+ const a = {
3
+ asc: "ascend",
4
+ desc: "descend"
5
+ }, v = (o) => {
6
+ const t = {};
7
+ let c = {};
8
+ const s = {
9
+ current: E,
10
+ pageSize: g
11
+ };
12
+ function i(n) {
13
+ o == null || o(s, c, t, {
14
+ currentDataSource: [],
15
+ action: n
16
+ });
17
+ }
18
+ return {
19
+ sortChangeEvent: ({
20
+ field: n,
21
+ order: e,
22
+ column: r
23
+ }) => {
24
+ t.column = r, t.order = e ? a[e] : null, t.field = n, i("sort");
25
+ },
26
+ filterChangeEvent: ({
27
+ filterList: n
28
+ }) => {
29
+ const e = {};
30
+ for (const r of n)
31
+ e[r.field] = r.values;
32
+ c = e, i("filter");
33
+ },
34
+ paginationChangeEvent: (n, e) => {
35
+ s.current = n, s.pageSize = e, i("paginate");
36
+ }
37
+ };
38
+ };
39
+ export {
40
+ v as useInnerParams
41
+ };
@@ -0,0 +1,6 @@
1
+ import { Ref, ComputedRef } from 'vue';
2
+ import { ApGridColumnType } from '../interface';
3
+ export declare const useRenderColumns: <RecordType>(columns: Ref<ApGridColumnType<RecordType>[]>) => {
4
+ renderConfig: ComputedRef<import("vue/jsx-runtime").JSX.Element[]>;
5
+ updateSignal: Ref<number, number>;
6
+ };
@@ -0,0 +1,29 @@
1
+ import { ref as a, watch as u, computed as m, unref as p } from "vue";
2
+ import { useToken as i } from "@aplus-frontend/antdv/es/theme/internal";
3
+ import "../../config-provider/index.mjs";
4
+ import { renderWithColumns as l } from "../utils/renderer.mjs";
5
+ import { useNamespace as s } from "../../config-provider/hooks/use-namespace.mjs";
6
+ import { useGlobalConfig as f } from "../../config-provider/hooks/use-global-config.mjs";
7
+ const w = (e) => {
8
+ const [, o] = i(), { be: t } = s("ap-grid"), n = f("valueTypeMap"), r = a(Date.now());
9
+ return u(
10
+ () => e.value,
11
+ () => {
12
+ r.value = Date.now();
13
+ },
14
+ {
15
+ deep: !0
16
+ }
17
+ ), {
18
+ renderConfig: m(() => l(
19
+ e.value,
20
+ o.value.colorPrimary,
21
+ t("table-header", "title"),
22
+ p(n)
23
+ )),
24
+ updateSignal: r
25
+ };
26
+ };
27
+ export {
28
+ w as useRenderColumns
29
+ };
@@ -0,0 +1,3 @@
1
+ import { default as ApGrid } from './index.vue';
2
+ export { ApGrid };
3
+ export * from './interface';
@@ -0,0 +1,2 @@
1
+ import "./index.vue2.mjs";
2
+ import "./interface.mjs";
@@ -0,0 +1,44 @@
1
+ import { VxeTableSlots } from 'vxe-table';
2
+ import { ApGridColumnType, ApGridExpose, ApGridProps } from './interface';
3
+ import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
4
+ declare const _default: <RecordType>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
5
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & ApGridProps<RecordType> & Partial<{}>> & PublicProps;
6
+ expose(exposed: ShallowUnwrapRef<ApGridExpose>): void;
7
+ attrs: any;
8
+ slots: Readonly<VxeTableSlots<RecordType> & {
9
+ /**
10
+ * 自定义查询表单额外的区域
11
+ */
12
+ searchFormExtra?: any;
13
+ /**
14
+ * 自定义表格上部查询表单下部分区域的渲染
15
+ */
16
+ title?: (params: {
17
+ selectedRows: RecordType[];
18
+ selectedRowKeys: (string | number)[];
19
+ shownColumns: ApGridColumnType<RecordType>[];
20
+ clearAll: () => void;
21
+ }) => any;
22
+ }> & VxeTableSlots<RecordType> & {
23
+ /**
24
+ * 自定义查询表单额外的区域
25
+ */
26
+ searchFormExtra?: any;
27
+ /**
28
+ * 自定义表格上部查询表单下部分区域的渲染
29
+ */
30
+ title?: (params: {
31
+ selectedRows: RecordType[];
32
+ selectedRowKeys: (string | number)[];
33
+ shownColumns: ApGridColumnType<RecordType>[];
34
+ clearAll: () => void;
35
+ }) => any;
36
+ };
37
+ emit: {};
38
+ }>) => VNode & {
39
+ __ctx?: Awaited<typeof __VLS_setup>;
40
+ };
41
+ export default _default;
42
+ type __VLS_PrettifyLocal<T> = {
43
+ [K in keyof T]: T[K];
44
+ } & {};
@@ -0,0 +1,356 @@
1
+ import { defineComponent as ye, getCurrentInstance as Se, useSlots as we, ref as w, computed as n, unref as a, watchEffect as ve, watch as $, createElementBlock as v, openBlock as s, normalizeClass as b, createCommentVNode as R, createElementVNode as H, normalizeStyle as U, createVNode as be, mergeProps as c, createSlots as q, withCtx as f, Fragment as M, renderList as P, createBlock as u, resolveDynamicComponent as E, renderSlot as N, normalizeProps as Re, guardReactiveProps as xe } from "vue";
2
+ import { VxeTable as Fe, VxeColumn as G } from "vxe-table";
3
+ import ke from "vxe-pc-ui";
4
+ import "vxe-table/lib/style.css";
5
+ import "vxe-pc-ui/lib/style.css";
6
+ import { isUndefined as x, omit as Be } from "lodash-unified";
7
+ import { ApForm as Ie } from "../ap-form/index.mjs";
8
+ import "../config-provider/index.mjs";
9
+ import { noRenderAsFormItemValueList as Pe } from "../ap-table/constants.mjs";
10
+ import { getColumnOrder as X, updateFormProps as Ee, getFieldProps as Ne, getSearchFormItemRenderNode as ze, recursionApColumns as J } from "../ap-table/utils.mjs";
11
+ import { useTablePaging as Te } from "../ap-table/hooks/use-table-paging-ng.mjs";
12
+ import { Pagination as Ve } from "@aplus-frontend/antdv";
13
+ import { useInnerParams as _e } from "./hooks/use-inner-params.mjs";
14
+ import { toVxeProps as Ae, getRowExpandProps as Oe, getRowSelectionProps as Le } from "./utils/table.mjs";
15
+ import De from "../ap-table/hooks/use-table-row-selection.mjs";
16
+ import { useProvideApTable as Ke } from "../ap-table/context.mjs";
17
+ import { sizeReverseMap as je, sizeMap as We } from "./constants.mjs";
18
+ import { useRenderColumns as $e } from "./hooks/use-render-columns.mjs";
19
+ import { useToken as He } from "@aplus-frontend/antdv/es/theme/internal";
20
+ import { useNamespace as Ue } from "../config-provider/hooks/use-namespace.mjs";
21
+ import { useGlobalConfig as qe } from "../config-provider/hooks/use-global-config.mjs";
22
+ const ga = /* @__PURE__ */ ye({
23
+ name: "ApGrid",
24
+ __name: "index",
25
+ props: {
26
+ dropdownPrefixCls: {},
27
+ loading: { type: [Boolean, Object], default: void 0 },
28
+ bordered: { type: Boolean, default: !1 },
29
+ locale: {},
30
+ onChange: {},
31
+ onResizeColumn: {},
32
+ getPopupContainer: {},
33
+ scroll: {},
34
+ sortDirections: { default: () => ["ascend", "descend"] },
35
+ showSorterTooltip: { type: [Boolean, Object], default: !1 },
36
+ prefixCls: {},
37
+ tableLayout: {},
38
+ title: {},
39
+ id: {},
40
+ showHeader: { type: Boolean, default: !0 },
41
+ components: {},
42
+ customRow: {},
43
+ customHeaderRow: {},
44
+ direction: {},
45
+ expandFixed: { type: [String, Boolean], default: !1 },
46
+ expandColumnWidth: {},
47
+ expandedRowKeys: {},
48
+ defaultExpandedRowKeys: {},
49
+ expandedRowRender: {},
50
+ expandRowByClick: { type: Boolean, default: !1 },
51
+ expandIcon: {},
52
+ onExpand: {},
53
+ onExpandedRowsChange: {},
54
+ defaultExpandAllRows: { type: Boolean, default: !1 },
55
+ indentSize: { default: 15 },
56
+ expandIconColumnIndex: {},
57
+ showExpandColumn: { type: Boolean, default: !0 },
58
+ expandedRowClassName: {},
59
+ childrenColumnName: { default: "children" },
60
+ rowExpandable: {},
61
+ sticky: { type: [Boolean, Object] },
62
+ transformCellText: {},
63
+ rowClassName: {},
64
+ stripe: { type: Boolean },
65
+ headerRowClassName: {},
66
+ footerRowClassName: {},
67
+ cellClassName: {},
68
+ headerCellClassName: {},
69
+ footerCellClassName: {},
70
+ rowStyle: {},
71
+ headerRowStyle: {},
72
+ footerRowStyle: {},
73
+ cellStyle: {},
74
+ headerCellStyle: {},
75
+ footerCellStyle: {},
76
+ height: {},
77
+ minHeight: {},
78
+ maxHeight: {},
79
+ mergeCells: {},
80
+ mergeFooterItems: {},
81
+ cellConfig: {},
82
+ columns: {},
83
+ rowSelection: { type: Boolean },
84
+ card: { type: Boolean, default: !1 },
85
+ params: {},
86
+ request: {},
87
+ defaultData: {},
88
+ dataSource: {},
89
+ onLoadingChange: {},
90
+ searchForm: { type: [Boolean, Object], default: void 0 },
91
+ beforeSearchSubmit: {},
92
+ pagination: { type: [Boolean, Object], default: void 0 },
93
+ searchFormWrapperStyle: {},
94
+ tableWrapperStyle: {},
95
+ manual: { type: Boolean, default: !1 },
96
+ size: { default: "medium" },
97
+ adaptive: { type: Boolean, default: !1 },
98
+ columnResizable: { type: [Boolean, Object], default: !1 },
99
+ rowKey: { default: "key" },
100
+ footer: {},
101
+ virtual: { type: [Boolean, Object], default: void 0 },
102
+ expandable: {}
103
+ },
104
+ setup(Q, { expose: Y }) {
105
+ var W;
106
+ const m = (W = Se()) == null ? void 0 : W.appContext.app;
107
+ m && !m.__VXE_PC_UI_INSTALLED__ && (m.use(ke), m.__VXE_PC_UI_INSTALLED__ = !0);
108
+ const z = we(), o = Q, { e: F, b: g, be: Z } = Ue("ap-grid"), ee = qe("valueTypeMap"), d = w([]), T = w([]), h = w(), k = w(o.size), [, ae] = He(), { renderConfig: oe, updateSignal: te } = $e(d);
109
+ let V = 0;
110
+ const _ = n(() => {
111
+ var e, l, r;
112
+ return V++, ((r = (l = (e = o.columns) == null ? void 0 : e.filter(
113
+ (t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !Pe.includes(t.valueType)
114
+ )) == null ? void 0 : l.sort((t, i) => {
115
+ let p = X(t.order);
116
+ return X(i.order) - p;
117
+ })) == null ? void 0 : r.map((t) => {
118
+ const i = Ee(
119
+ t,
120
+ Ne(t.fieldProps, {})
121
+ ), p = {
122
+ ...t,
123
+ fieldProps: {
124
+ label: t.title,
125
+ name: t.dataIndex,
126
+ ...i || {},
127
+ _signal: V
128
+ },
129
+ renderNode: void 0
130
+ };
131
+ return p.renderNode = ze(
132
+ p,
133
+ a(ee)
134
+ ), p;
135
+ })) || [];
136
+ }), re = n(() => [g(), o.card ? null : g("wrapper")].filter(Boolean)), A = n(() => J(a(d), (e) => {
137
+ if (e.sorter === !0)
138
+ return e.key || e.dataIndex;
139
+ }).filter(Boolean)), O = n(() => J(a(d), (e) => {
140
+ if (e.filters && !e.onFilter)
141
+ return e.key || e.dataIndex;
142
+ }).filter(Boolean)), {
143
+ formRef: B,
144
+ submit: L,
145
+ reset: D,
146
+ refresh: le,
147
+ data: C,
148
+ tableProps: ne,
149
+ setDataSource: se,
150
+ handleTableChange: de
151
+ } = Te({
152
+ async request(e) {
153
+ var r;
154
+ if (!S.value.preserveSelectedRowKeys && x(o.dataSource) && I(), !x(o.dataSource)) {
155
+ const t = e.pageSize * (e.current - 1);
156
+ return {
157
+ data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(t, t + e.pageSize)) || [],
158
+ total: o.dataSource.length || 0
159
+ };
160
+ }
161
+ const l = await ((r = o.request) == null ? void 0 : r.call(o, e));
162
+ return {
163
+ data: (l == null ? void 0 : l.data) || [],
164
+ total: (l == null ? void 0 : l.total) || 0
165
+ };
166
+ },
167
+ namespace: "ap-grid",
168
+ filterFields: O,
169
+ sortFields: A,
170
+ defaultParams: o.params,
171
+ defaultData: o.defaultData,
172
+ manual: o.manual,
173
+ formatParams: o.beforeSearchSubmit,
174
+ pagination: o.pagination
175
+ }), { sortChangeEvent: ie, filterChangeEvent: ue, paginationChangeEvent: ce } = _e(de);
176
+ Ke({
177
+ columns: n(() => d.value),
178
+ columnsBackup: n(() => T.value),
179
+ size: n(() => We[k.value]),
180
+ updateColumns(e) {
181
+ d.value = e;
182
+ },
183
+ updateSize(e) {
184
+ k.value = je[e];
185
+ },
186
+ renderConfig: n(() => ({
187
+ className: Z("table-header", "title"),
188
+ color: ae.value.colorPrimary
189
+ }))
190
+ });
191
+ const K = n(
192
+ () => d.value.some(
193
+ (e) => e.fixed === "left" || e.fixed === !0
194
+ ) ? "left" : void 0
195
+ ), pe = n(
196
+ () => x(o.dataSource) ? C.records : o.dataSource
197
+ ), { selectedRows: y, rowSelection: S, ...fe } = De({
198
+ ...o.rowSelection === !0 ? {} : o.rowSelection,
199
+ dataSource: pe,
200
+ rowKey: o.rowKey
201
+ }), j = () => {
202
+ const e = h.value;
203
+ e && (y.value = [
204
+ ...e.getCheckboxReserveRecords(),
205
+ ...e.getCheckboxRecords()
206
+ ]);
207
+ }, me = () => {
208
+ const e = h.value;
209
+ e && (y.value = [e.getRadioRecord()]);
210
+ };
211
+ function ge() {
212
+ var e;
213
+ return ((e = o.columns) == null ? void 0 : e.filter((l) => !l.hideInTable)) || [];
214
+ }
215
+ function he(e) {
216
+ var l, r, t;
217
+ (t = (r = (l = B.value) == null ? void 0 : l.apForm) == null ? void 0 : r.setFieldsValue) == null || t.call(r, e);
218
+ }
219
+ function Ce(e = !1) {
220
+ var r, t, i;
221
+ const l = e ? "getFieldsValueTransformed" : "getFieldsValue";
222
+ return (i = (t = (r = B.value) == null ? void 0 : r.apForm) == null ? void 0 : t[l]) == null ? void 0 : i.call(t, !0);
223
+ }
224
+ function I() {
225
+ fe.clearAll();
226
+ const e = h.value;
227
+ e && (S.value.type === "radio" ? (e.clearRadioRow(), e.clearRadioReserve()) : (e.clearCheckboxRow(), e.clearCheckboxReserve()));
228
+ }
229
+ return ve(() => {
230
+ const e = ge();
231
+ d.value = e, T.value = e;
232
+ }), $(
233
+ () => o.dataSource,
234
+ (e) => {
235
+ se(e);
236
+ },
237
+ { immediate: !0 }
238
+ ), $(
239
+ () => a(C).loading,
240
+ (e) => {
241
+ var l;
242
+ (l = o.onLoadingChange) == null || l.call(o, e);
243
+ }
244
+ ), Y({
245
+ submit: L,
246
+ reset: D,
247
+ refresh: le,
248
+ setSearchFormValues: he,
249
+ getSearchFormValues: Ce,
250
+ getShowColumns: () => a(d),
251
+ rowSelection: {
252
+ selectedRows: n(() => y.value),
253
+ clearAll: I
254
+ }
255
+ }), (e, l) => (s(), v("div", {
256
+ class: b(re.value)
257
+ }, [
258
+ a(x)(e.dataSource) && e.searchForm !== !1 && _.value.length > 0 ? (s(), v("div", {
259
+ key: 0,
260
+ class: b(e.card ? a(F)("search-wrapper") : null),
261
+ style: U(e.searchFormWrapperStyle)
262
+ }, [
263
+ be(a(Ie).SearchForm, c(e.searchForm || {}, {
264
+ ref_key: "formRef",
265
+ ref: B,
266
+ "custom-reset": "",
267
+ "submit-loading": !1,
268
+ onSubmit: a(L),
269
+ onReset: a(D)
270
+ }), q({
271
+ default: f(() => [
272
+ (s(!0), v(M, null, P(_.value, (r) => (s(), u(E(r.renderNode.Comp), c({
273
+ key: r.dataIndex,
274
+ item: r,
275
+ ref_for: !0
276
+ }, r.fieldProps || {}, {
277
+ span: r.span,
278
+ "custom-render": r.renderNode.render
279
+ }), null, 16, ["item", "span", "custom-render"]))), 128))
280
+ ]),
281
+ _: 2
282
+ }, [
283
+ z.searchFormExtra ? {
284
+ name: "extra",
285
+ fn: f(() => [
286
+ N(e.$slots, "searchFormExtra")
287
+ ]),
288
+ key: "0"
289
+ } : void 0
290
+ ]), 1040, ["onSubmit", "onReset"])
291
+ ], 6)) : R("", !0),
292
+ H("div", {
293
+ class: b([a(F)("table-wrapper"), e.card ? a(F)("table-wrapper-card") : null]),
294
+ style: U(e.tableWrapperStyle)
295
+ }, [
296
+ H("div", {
297
+ class: b(a(g)("header-wrapper"))
298
+ }, [
299
+ N(e.$slots, "title", {
300
+ selectedRows: a(y),
301
+ selectedRowKeys: a(S).selectedRowKeys,
302
+ shownColumns: d.value,
303
+ clearAll: I
304
+ })
305
+ ], 2),
306
+ (s(), u(a(Fe), c(a(Ae)(o), {
307
+ ref_key: "tableRef",
308
+ ref: h,
309
+ key: a(te),
310
+ data: a(C).records,
311
+ "sort-config": { remote: A.value.length > 0 },
312
+ "filter-config": { remote: O.value.length > 0 },
313
+ loading: a(C).loading,
314
+ "row-config": {
315
+ isHover: !0,
316
+ keyField: o.rowKey
317
+ },
318
+ size: k.value,
319
+ onSortChange: a(ie),
320
+ onFilterChange: a(ue),
321
+ onCheckboxChange: j,
322
+ onCheckboxAll: j,
323
+ onRadioChange: me
324
+ }), q({
325
+ default: f(() => [
326
+ o.expandable ? (s(), u(a(G), c({ key: 0 }, a(Oe)(e.expandable), { fixed: K.value }), {
327
+ content: f((r) => [
328
+ (s(), u(E(o.expandable.renderContent(r))))
329
+ ]),
330
+ _: 1
331
+ }, 16, ["fixed"])) : R("", !0),
332
+ o.rowSelection ? (s(), u(a(G), c({ key: 1 }, a(Le)(a(S)), { fixed: K.value }), null, 16, ["fixed"])) : R("", !0),
333
+ (s(!0), v(M, null, P(a(oe), (r) => (s(), u(E(r), {
334
+ key: r.props.colId
335
+ }))), 128))
336
+ ]),
337
+ _: 2
338
+ }, [
339
+ P(a(Be)(z, ["searchFormExtra"]), (r, t) => ({
340
+ name: t,
341
+ fn: f((i) => [
342
+ N(e.$slots, t, Re(xe(i || {})))
343
+ ])
344
+ }))
345
+ ]), 1040, ["data", "sort-config", "filter-config", "loading", "row-config", "size", "onSortChange", "onFilterChange"])),
346
+ e.pagination !== !1 ? (s(), u(a(Ve), c({
347
+ key: 0,
348
+ class: a(g)("pagination")
349
+ }, a(ne).pagination, { onChange: a(ce) }), null, 16, ["class", "onChange"])) : R("", !0)
350
+ ], 6)
351
+ ], 2));
352
+ }
353
+ });
354
+ export {
355
+ ga as default
356
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue.mjs";
2
+ export {
3
+ f as default
4
+ };