@aplus-frontend/ui 0.0.1-beta.39 → 0.0.1-beta.40
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 +104 -98
- package/es/src/ap-action/item-popconfirm/index.vue.d.ts +343 -0
- package/es/src/ap-custom-column/column-select.vue.mjs +19 -19
- package/es/src/ap-field/select/index.vue.d.ts +235 -0
- package/es/src/ap-form/interface.d.ts +1 -0
- package/es/src/ap-form/items/checkbox/index.vue.d.ts +47 -0
- package/es/src/ap-form/items/checkbox/index.vue.mjs +61 -0
- package/es/src/ap-form/items/checkbox/index.vue2.mjs +4 -0
- package/es/src/ap-form/items/index.d.ts +2 -1
- package/es/src/ap-form/items/index.mjs +1 -0
- package/es/src/ap-form/items/interface.d.ts +5 -1
- package/es/src/ap-form/modal-form/index.vue.d.ts +378 -0
- package/es/src/ap-form/search-form/index.vue.mjs +48 -44
- package/es/src/ap-table/ap-table.vue.d.ts +184 -0
- package/es/src/ap-table/ap-table.vue.mjs +258 -0
- package/es/src/ap-table/ap-table.vue2.mjs +4 -0
- package/es/src/ap-table/components/index/index.vue.d.ts +28 -0
- package/es/src/ap-table/components/index/index.vue.mjs +4 -0
- package/es/src/ap-table/components/index/index.vue2.mjs +21 -0
- package/es/src/ap-table/components/interface.d.ts +10 -0
- package/es/src/ap-table/components/style/index.css +12 -0
- package/es/src/ap-table/constants.d.ts +11075 -0
- package/es/src/ap-table/constants.mjs +55 -0
- package/es/src/ap-table/hooks/use-table-paging.d.ts +5 -1
- package/es/src/ap-table/hooks/use-table-paging.mjs +142 -0
- package/es/src/ap-table/index.d.ts +5 -0
- package/es/src/ap-table/index.mjs +6 -0
- package/es/src/ap-table/interface.d.ts +41 -14
- package/es/src/ap-table/interface.mjs +1 -0
- package/es/src/ap-table/style/ap-table.css +26 -0
- package/es/src/ap-table/utils.mjs +35 -0
- package/es/src/config-provider/config-provider-props.d.ts +152 -0
- package/es/src/config-provider/config-provider.d.ts +323 -0
- package/es/src/config-provider/config-provider.mjs +26 -34
- package/es/src/config-provider/hooks/use-global-config.d.ts +154 -0
- package/es/src/config-provider/index.d.ts +691 -0
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +206 -199
- package/es/src/modal/basic.vue.d.ts +464 -0
- package/es/src/modal/components/modal-footer.vue.d.ts +457 -0
- package/es/src/modal/components/modal.d.ts +443 -0
- package/es/src/modal/index.d.ts +963 -0
- package/es/src/modal/props.d.ts +283 -0
- package/es/src/pro-form/hooks/use-label-width.d.ts +312 -0
- package/es/src/pro-table/components/editable/editable-cell.vue.d.ts +82 -2
- package/es/src/theme/ap-table/ap-table-index.css +12 -0
- package/es/src/theme/ap-table/ap-table.css +26 -0
- package/es/src/theme/work-order-modal/index.css +2 -2
- package/es/src/work-order-modal/style/index.css +2 -2
- package/es/src/work-order-modal/work-order-modal.vue.mjs +35 -25
- package/lib/index.js +1 -1
- package/lib/src/ap-action/item-popconfirm/index.vue.d.ts +343 -0
- package/lib/src/ap-custom-column/column-select.vue.js +1 -1
- package/lib/src/ap-field/select/index.vue.d.ts +235 -0
- package/lib/src/ap-form/interface.d.ts +1 -0
- package/lib/src/ap-form/items/checkbox/index.vue.d.ts +47 -0
- package/lib/src/ap-form/items/checkbox/index.vue.js +1 -0
- package/lib/src/ap-form/items/checkbox/index.vue2.js +1 -0
- package/lib/src/ap-form/items/index.d.ts +2 -1
- package/lib/src/ap-form/items/index.js +1 -1
- package/lib/src/ap-form/items/interface.d.ts +5 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +378 -0
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +184 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -0
- package/lib/src/ap-table/ap-table.vue2.js +1 -0
- package/lib/src/ap-table/components/index/index.vue.d.ts +28 -0
- package/lib/src/ap-table/components/index/index.vue.js +1 -0
- package/lib/src/ap-table/components/index/index.vue2.js +1 -0
- package/lib/src/ap-table/components/interface.d.ts +10 -0
- package/lib/src/ap-table/components/style/index.css +12 -0
- package/lib/src/ap-table/constants.d.ts +11075 -0
- package/lib/src/ap-table/constants.js +1 -0
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +5 -1
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -0
- package/lib/src/ap-table/index.d.ts +5 -0
- package/lib/src/ap-table/index.js +1 -0
- package/lib/src/ap-table/interface.d.ts +41 -14
- package/lib/src/ap-table/interface.js +1 -0
- package/lib/src/ap-table/style/ap-table.css +26 -0
- package/lib/src/ap-table/utils.js +1 -0
- package/lib/src/config-provider/config-provider-props.d.ts +152 -0
- package/lib/src/config-provider/config-provider.d.ts +323 -0
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/hooks/use-global-config.d.ts +154 -0
- package/lib/src/config-provider/index.d.ts +691 -0
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/modal/basic.vue.d.ts +464 -0
- package/lib/src/modal/components/modal-footer.vue.d.ts +457 -0
- package/lib/src/modal/components/modal.d.ts +443 -0
- package/lib/src/modal/index.d.ts +963 -0
- package/lib/src/modal/props.d.ts +283 -0
- package/lib/src/pro-form/hooks/use-label-width.d.ts +312 -0
- package/lib/src/pro-table/components/editable/editable-cell.vue.d.ts +82 -2
- package/lib/src/theme/ap-table/ap-table-index.css +12 -0
- package/lib/src/theme/ap-table/ap-table.css +26 -0
- package/lib/src/theme/work-order-modal/index.css +2 -2
- package/lib/src/work-order-modal/style/index.css +2 -2
- package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { ApTableProps } from './interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType, CSSProperties } from 'vue';
|
|
3
|
+
import { SpinSize } from 'ant-design-vue/es/spin/Spin';
|
|
4
|
+
import { VueTypeValidableDef } from '../../node_modules/vue-types';
|
|
5
|
+
import { GetRowKey } from 'ant-design-vue/es/vc-table/interface';
|
|
6
|
+
import { SortOrder } from 'ant-design-vue/es/table/interface';
|
|
7
|
+
import { TriggerType } from 'ant-design-vue/es/tooltip/abstractTooltipProps';
|
|
8
|
+
import { TooltipPlacement, AdjustOverflow } from 'ant-design-vue/es/tooltip';
|
|
9
|
+
import { LiteralUnion } from 'ant-design-vue/es/_util/type';
|
|
10
|
+
import { PresetColorType } from 'ant-design-vue/es/_util/colors';
|
|
11
|
+
import { AlignType, BuildInPlacements } from 'ant-design-vue/es/vc-trigger/interface';
|
|
12
|
+
import { ApFormSearchFormProps } from '../ap-form';
|
|
13
|
+
|
|
14
|
+
type ApTableSlots = {
|
|
15
|
+
default: any;
|
|
16
|
+
emptyText?: any;
|
|
17
|
+
expandIcon?: any;
|
|
18
|
+
title?: any;
|
|
19
|
+
footer?: any;
|
|
20
|
+
summary?: any;
|
|
21
|
+
expandedRowRender?: any;
|
|
22
|
+
expandColumnTitle?: any;
|
|
23
|
+
customFilterIcon?: any;
|
|
24
|
+
customFilterDropdown?: any;
|
|
25
|
+
};
|
|
26
|
+
declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTableProps<any, any, "text">>, {
|
|
27
|
+
bordered: boolean;
|
|
28
|
+
childrenColumnName: string;
|
|
29
|
+
defaultExpandAllRows: boolean;
|
|
30
|
+
expandFixed: boolean;
|
|
31
|
+
expandRowByClick: boolean;
|
|
32
|
+
indentSize: number;
|
|
33
|
+
rowKey: string;
|
|
34
|
+
showExpandColumn: boolean;
|
|
35
|
+
showHeader: boolean;
|
|
36
|
+
showSorterTooltip: boolean;
|
|
37
|
+
size: string;
|
|
38
|
+
sortDirections: () => string[];
|
|
39
|
+
card: boolean;
|
|
40
|
+
pagination: undefined;
|
|
41
|
+
searchForm: undefined;
|
|
42
|
+
loading: undefined;
|
|
43
|
+
manual: boolean;
|
|
44
|
+
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTableProps<any, any, "text">>, {
|
|
45
|
+
bordered: boolean;
|
|
46
|
+
childrenColumnName: string;
|
|
47
|
+
defaultExpandAllRows: boolean;
|
|
48
|
+
expandFixed: boolean;
|
|
49
|
+
expandRowByClick: boolean;
|
|
50
|
+
indentSize: number;
|
|
51
|
+
rowKey: string;
|
|
52
|
+
showExpandColumn: boolean;
|
|
53
|
+
showHeader: boolean;
|
|
54
|
+
showSorterTooltip: boolean;
|
|
55
|
+
size: string;
|
|
56
|
+
sortDirections: () => string[];
|
|
57
|
+
card: boolean;
|
|
58
|
+
pagination: undefined;
|
|
59
|
+
searchForm: undefined;
|
|
60
|
+
loading: undefined;
|
|
61
|
+
manual: boolean;
|
|
62
|
+
}>>>, {
|
|
63
|
+
loading: boolean | Partial< ExtractPropTypes<{
|
|
64
|
+
prefixCls: StringConstructor;
|
|
65
|
+
spinning: {
|
|
66
|
+
type: BooleanConstructor;
|
|
67
|
+
default: any;
|
|
68
|
+
};
|
|
69
|
+
size: PropType<SpinSize>;
|
|
70
|
+
wrapperClassName: StringConstructor;
|
|
71
|
+
tip: VueTypeValidableDef<any>;
|
|
72
|
+
delay: NumberConstructor;
|
|
73
|
+
indicator: VueTypeValidableDef<any>;
|
|
74
|
+
}>>;
|
|
75
|
+
size: "small" | "middle";
|
|
76
|
+
pagination: false | {
|
|
77
|
+
defaultCurrent?: number | undefined;
|
|
78
|
+
defaultPageSize?: number | undefined;
|
|
79
|
+
};
|
|
80
|
+
bordered: boolean;
|
|
81
|
+
manual: boolean;
|
|
82
|
+
rowKey: string | GetRowKey<any>;
|
|
83
|
+
sortDirections: SortOrder[];
|
|
84
|
+
showSorterTooltip: boolean | Partial< ExtractPropTypes<{
|
|
85
|
+
title: VueTypeValidableDef<any>;
|
|
86
|
+
trigger: PropType< TriggerType | TriggerType[]>;
|
|
87
|
+
open: {
|
|
88
|
+
type: BooleanConstructor;
|
|
89
|
+
default: any;
|
|
90
|
+
};
|
|
91
|
+
visible: {
|
|
92
|
+
type: BooleanConstructor;
|
|
93
|
+
default: any;
|
|
94
|
+
};
|
|
95
|
+
placement: PropType<TooltipPlacement>;
|
|
96
|
+
color: PropType<LiteralUnion<PresetColorType>>;
|
|
97
|
+
transitionName: StringConstructor;
|
|
98
|
+
overlayStyle: {
|
|
99
|
+
type: PropType<CSSProperties>;
|
|
100
|
+
default: CSSProperties;
|
|
101
|
+
};
|
|
102
|
+
overlayInnerStyle: {
|
|
103
|
+
type: PropType<CSSProperties>;
|
|
104
|
+
default: CSSProperties;
|
|
105
|
+
};
|
|
106
|
+
overlayClassName: StringConstructor;
|
|
107
|
+
openClassName: StringConstructor;
|
|
108
|
+
prefixCls: StringConstructor;
|
|
109
|
+
mouseEnterDelay: NumberConstructor;
|
|
110
|
+
mouseLeaveDelay: NumberConstructor;
|
|
111
|
+
getPopupContainer: PropType<(triggerNode: HTMLElement) => HTMLElement>;
|
|
112
|
+
arrowPointAtCenter: {
|
|
113
|
+
type: BooleanConstructor;
|
|
114
|
+
default: any;
|
|
115
|
+
};
|
|
116
|
+
arrow: {
|
|
117
|
+
type: PropType<boolean | {
|
|
118
|
+
pointAtCenter?: boolean | undefined;
|
|
119
|
+
}>;
|
|
120
|
+
default: boolean | {
|
|
121
|
+
pointAtCenter?: boolean | undefined;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
autoAdjustOverflow: {
|
|
125
|
+
type: PropType<boolean | AdjustOverflow>;
|
|
126
|
+
default: boolean | AdjustOverflow;
|
|
127
|
+
};
|
|
128
|
+
destroyTooltipOnHide: {
|
|
129
|
+
type: BooleanConstructor;
|
|
130
|
+
default: any; /**
|
|
131
|
+
* tips
|
|
132
|
+
* 通常情况下,表格渲染是不需要请求网络数据的,因此这里删掉request,
|
|
133
|
+
* 如果需要做映射,可以在外部发起一次网络请求,然后使用valueEnum设置匹配枚举。
|
|
134
|
+
*/
|
|
135
|
+
};
|
|
136
|
+
align: {
|
|
137
|
+
type: PropType<AlignType>;
|
|
138
|
+
default: AlignType;
|
|
139
|
+
};
|
|
140
|
+
builtinPlacements: {
|
|
141
|
+
type: PropType<BuildInPlacements>;
|
|
142
|
+
default: BuildInPlacements;
|
|
143
|
+
};
|
|
144
|
+
children: ArrayConstructor;
|
|
145
|
+
onVisibleChange: PropType<(vis: boolean) => void>;
|
|
146
|
+
'onUpdate:visible': PropType<(vis: boolean) => void>;
|
|
147
|
+
onOpenChange: PropType<(vis: boolean) => void>;
|
|
148
|
+
'onUpdate:open': PropType<(vis: boolean) => void>;
|
|
149
|
+
}>>;
|
|
150
|
+
showHeader: boolean;
|
|
151
|
+
expandFixed: boolean | "left" | "right";
|
|
152
|
+
expandRowByClick: boolean;
|
|
153
|
+
defaultExpandAllRows: boolean;
|
|
154
|
+
indentSize: number;
|
|
155
|
+
showExpandColumn: boolean;
|
|
156
|
+
childrenColumnName: string;
|
|
157
|
+
card: boolean;
|
|
158
|
+
searchForm: false | ApFormSearchFormProps;
|
|
159
|
+
}, {}>, Partial<Record<NonNullable<keyof ApTableSlots>, (_: any) => any>> & {
|
|
160
|
+
title?(_: {}): any;
|
|
161
|
+
}>;
|
|
162
|
+
export default _default;
|
|
163
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
164
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
165
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
166
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
167
|
+
} : {
|
|
168
|
+
type: PropType<T[K]>;
|
|
169
|
+
required: true;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
type __VLS_WithDefaults<P, D> = {
|
|
173
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
174
|
+
default: D[K];
|
|
175
|
+
}> : P[K];
|
|
176
|
+
};
|
|
177
|
+
type __VLS_Prettify<T> = {
|
|
178
|
+
[K in keyof T]: T[K];
|
|
179
|
+
} & {};
|
|
180
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
181
|
+
new (): {
|
|
182
|
+
$slots: S;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { defineComponent as V, computed as d, createVNode as r, mergeProps as u, unref as t, openBlock as s, createElementBlock as f, normalizeClass as g, normalizeStyle as S, withCtx as c, Fragment as _, renderList as w, createBlock as K, resolveDynamicComponent as $, createCommentVNode as x, createElementVNode as R, renderSlot as F, createSlots as H, toDisplayString as G, normalizeProps as Q, guardReactiveProps as U } from "vue";
|
|
2
|
+
import { Typography as J, Table as X, Tooltip as Y } from "ant-design-vue";
|
|
3
|
+
import { ApForm as Z } from "../ap-form/index.mjs";
|
|
4
|
+
import { apTableRenderItemMap as ee, noRenderAsFormItemValueList as T, apTableFormItemMap as ae } from "./constants.mjs";
|
|
5
|
+
import "../config-provider/index.mjs";
|
|
6
|
+
import { useTablePaging as te } from "./hooks/use-table-paging.mjs";
|
|
7
|
+
import { omit as B, isUndefined as oe } from "lodash-unified";
|
|
8
|
+
import "./style/ap-table.css";
|
|
9
|
+
import { QuestionCircleOutlined as ne } from "@ant-design/icons-vue";
|
|
10
|
+
import { useNamespace as le } from "../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
import { useGlobalConfig as re } from "../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
const de = {
|
|
13
|
+
key: 0
|
|
14
|
+
}, Ce = /* @__PURE__ */ V({
|
|
15
|
+
name: "ApTable",
|
|
16
|
+
__name: "ap-table",
|
|
17
|
+
props: {
|
|
18
|
+
dropdownPrefixCls: {},
|
|
19
|
+
loading: {
|
|
20
|
+
type: [Boolean, Object],
|
|
21
|
+
default: void 0
|
|
22
|
+
},
|
|
23
|
+
bordered: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1
|
|
26
|
+
},
|
|
27
|
+
locale: {},
|
|
28
|
+
onChange: {},
|
|
29
|
+
onResizeColumn: {},
|
|
30
|
+
rowSelection: {},
|
|
31
|
+
getPopupContainer: {},
|
|
32
|
+
scroll: {},
|
|
33
|
+
sortDirections: {
|
|
34
|
+
default: () => ["ascend", "descend"]
|
|
35
|
+
},
|
|
36
|
+
showSorterTooltip: {
|
|
37
|
+
type: [Boolean, Object],
|
|
38
|
+
default: !0
|
|
39
|
+
},
|
|
40
|
+
prefixCls: {},
|
|
41
|
+
rowKey: {
|
|
42
|
+
default: "key"
|
|
43
|
+
},
|
|
44
|
+
tableLayout: {},
|
|
45
|
+
rowClassName: {},
|
|
46
|
+
title: {},
|
|
47
|
+
footer: {},
|
|
48
|
+
id: {},
|
|
49
|
+
showHeader: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !0
|
|
52
|
+
},
|
|
53
|
+
components: {},
|
|
54
|
+
customRow: {},
|
|
55
|
+
customHeaderRow: {},
|
|
56
|
+
direction: {},
|
|
57
|
+
expandFixed: {
|
|
58
|
+
type: [String, Boolean],
|
|
59
|
+
default: !1
|
|
60
|
+
},
|
|
61
|
+
expandColumnWidth: {},
|
|
62
|
+
expandedRowKeys: {},
|
|
63
|
+
defaultExpandedRowKeys: {},
|
|
64
|
+
expandedRowRender: {},
|
|
65
|
+
expandRowByClick: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: !1
|
|
68
|
+
},
|
|
69
|
+
expandIcon: {},
|
|
70
|
+
onExpand: {},
|
|
71
|
+
onExpandedRowsChange: {},
|
|
72
|
+
defaultExpandAllRows: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: !1
|
|
75
|
+
},
|
|
76
|
+
indentSize: {
|
|
77
|
+
default: 15
|
|
78
|
+
},
|
|
79
|
+
expandIconColumnIndex: {},
|
|
80
|
+
showExpandColumn: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: !0
|
|
83
|
+
},
|
|
84
|
+
expandedRowClassName: {},
|
|
85
|
+
childrenColumnName: {
|
|
86
|
+
default: "children"
|
|
87
|
+
},
|
|
88
|
+
rowExpandable: {},
|
|
89
|
+
sticky: {
|
|
90
|
+
type: [Boolean, Object]
|
|
91
|
+
},
|
|
92
|
+
transformCellText: {},
|
|
93
|
+
columns: {},
|
|
94
|
+
card: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: !1
|
|
97
|
+
},
|
|
98
|
+
params: {},
|
|
99
|
+
searchFormRender: {},
|
|
100
|
+
request: {},
|
|
101
|
+
onLoad: {},
|
|
102
|
+
defaultData: {},
|
|
103
|
+
onLoadingChange: {},
|
|
104
|
+
searchForm: {
|
|
105
|
+
type: [Boolean, Object],
|
|
106
|
+
default: void 0
|
|
107
|
+
},
|
|
108
|
+
beforeSearchSubmit: {},
|
|
109
|
+
pagination: {
|
|
110
|
+
type: [Boolean, Object],
|
|
111
|
+
default: void 0
|
|
112
|
+
},
|
|
113
|
+
searchFormWrapperStyle: {},
|
|
114
|
+
tableWrapperStyle: {},
|
|
115
|
+
manual: {
|
|
116
|
+
type: Boolean,
|
|
117
|
+
default: !1
|
|
118
|
+
},
|
|
119
|
+
size: {
|
|
120
|
+
default: "middle"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
setup(P) {
|
|
124
|
+
const o = P, {
|
|
125
|
+
e: b,
|
|
126
|
+
b: m
|
|
127
|
+
} = le("ap-table"), I = re("uiMode"), y = d(() => {
|
|
128
|
+
var n;
|
|
129
|
+
let a = ((n = o.columns) == null ? void 0 : n.filter((e) => !e.hideInTable)) || [];
|
|
130
|
+
return a = a.map((e) => ({
|
|
131
|
+
...e,
|
|
132
|
+
customRender({
|
|
133
|
+
value: l,
|
|
134
|
+
...p
|
|
135
|
+
}) {
|
|
136
|
+
var C;
|
|
137
|
+
if (e.customRender)
|
|
138
|
+
return e.customRender({
|
|
139
|
+
value: l,
|
|
140
|
+
...p,
|
|
141
|
+
column: e
|
|
142
|
+
});
|
|
143
|
+
const L = ee[e.valueType || "text"], W = ((C = e.fieldProps) == null ? void 0 : C.field) || e.fieldProps || {}, q = e.valueType === "switch", A = e.valueType === "index", M = q ? {
|
|
144
|
+
checked: l
|
|
145
|
+
} : {
|
|
146
|
+
value: A ? p.index + 1 : l
|
|
147
|
+
};
|
|
148
|
+
return j(e, l, r(L, u(B(W, ["request"]), M, {
|
|
149
|
+
mode: "read"
|
|
150
|
+
}), null));
|
|
151
|
+
}
|
|
152
|
+
})), a;
|
|
153
|
+
}), h = d(() => {
|
|
154
|
+
var a, n;
|
|
155
|
+
return ((n = (a = o.columns) == null ? void 0 : a.filter((e) => !e.hideInSearch && e.dataIndex && e.valueType && !T.includes(e.valueType))) == null ? void 0 : n.map((e) => ({
|
|
156
|
+
...e,
|
|
157
|
+
fieldProps: {
|
|
158
|
+
...e.fieldProps || {},
|
|
159
|
+
label: e.title,
|
|
160
|
+
name: e.dataIndex
|
|
161
|
+
}
|
|
162
|
+
}))) || [];
|
|
163
|
+
}), v = d(() => t(y).filter((a) => a.sorter === !0).map((a) => a.dataIndex)), k = d(() => t(y).filter((a) => a.filters && !a.onFilter).map((a) => a.dataIndex)), {
|
|
164
|
+
formRef: z,
|
|
165
|
+
submit: E,
|
|
166
|
+
reset: N,
|
|
167
|
+
tableProps: i,
|
|
168
|
+
handleTableChange: D
|
|
169
|
+
} = te({
|
|
170
|
+
async request(a) {
|
|
171
|
+
var e;
|
|
172
|
+
const n = await ((e = o.request) == null ? void 0 : e.call(o, a));
|
|
173
|
+
return {
|
|
174
|
+
data: (n == null ? void 0 : n.data) || [],
|
|
175
|
+
total: (n == null ? void 0 : n.total) || 0
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
filterFields: t(k),
|
|
179
|
+
sortFields: t(v),
|
|
180
|
+
defaultParams: o.params,
|
|
181
|
+
defaultData: o.defaultData,
|
|
182
|
+
manual: o.manual,
|
|
183
|
+
defaultCurrent: o.pagination ? o.pagination.defaultCurrent : void 0,
|
|
184
|
+
defaultPageSize: o.pagination ? o.pagination.defaultPageSize : void 0,
|
|
185
|
+
formatParams: o.beforeSearchSubmit
|
|
186
|
+
}), O = d(() => ({
|
|
187
|
+
...o,
|
|
188
|
+
...t(i),
|
|
189
|
+
loading: oe(o.loading) ? t(i).loading : o.loading,
|
|
190
|
+
pagination: o.pagination === !1 ? !1 : t(i).pagination
|
|
191
|
+
}));
|
|
192
|
+
function j(a, n, e) {
|
|
193
|
+
return T.includes(a.valueType) ? e : a.copyable || a.ellipsis ? r(J.Text, {
|
|
194
|
+
copyable: {
|
|
195
|
+
text: n,
|
|
196
|
+
tooltip: !1
|
|
197
|
+
},
|
|
198
|
+
ellipsis: {
|
|
199
|
+
tooltip: n
|
|
200
|
+
},
|
|
201
|
+
content: e
|
|
202
|
+
}, null) : e;
|
|
203
|
+
}
|
|
204
|
+
return (a, n) => (s(), f("div", {
|
|
205
|
+
class: g(a.card ? null : t(m)("wrapper"))
|
|
206
|
+
}, [a.searchForm !== !1 && h.value.length > 0 ? (s(), f("div", {
|
|
207
|
+
key: 0,
|
|
208
|
+
class: g(a.card ? t(b)("search-wrapper") : null),
|
|
209
|
+
style: S(a.searchFormWrapperStyle)
|
|
210
|
+
}, [r(t(Z).SearchForm, u(a.searchForm || {}, {
|
|
211
|
+
ref_key: "formRef",
|
|
212
|
+
ref: z,
|
|
213
|
+
"custom-reset": "",
|
|
214
|
+
onSubmit: t(E),
|
|
215
|
+
onReset: t(N),
|
|
216
|
+
"submit-loading": t(i).loading
|
|
217
|
+
}), {
|
|
218
|
+
default: c(() => [(s(!0), f(_, null, w(h.value, (e) => (s(), K($(e.customRenderFormItem ? e.customRenderFormItem(e) : t(ae)[e.valueType || "text"]), u({
|
|
219
|
+
key: e.dataIndex,
|
|
220
|
+
ref_for: !0
|
|
221
|
+
}, e.fieldProps || {}, {
|
|
222
|
+
span: e.span
|
|
223
|
+
}), null, 16, ["span"]))), 128))]),
|
|
224
|
+
_: 1
|
|
225
|
+
}, 16, ["onSubmit", "onReset", "submit-loading"])], 6)) : x("", !0), R("div", {
|
|
226
|
+
class: g(a.card ? t(b)("table-wrapper") : null),
|
|
227
|
+
style: S(a.tableWrapperStyle)
|
|
228
|
+
}, [F(a.$slots, "title"), r(t(X), u({
|
|
229
|
+
class: t(I) === "admin" ? t(m)("table-admin") : t(m)("table")
|
|
230
|
+
}, O.value, {
|
|
231
|
+
onChange: t(D),
|
|
232
|
+
columns: y.value
|
|
233
|
+
}), H({
|
|
234
|
+
headerCell: c(({
|
|
235
|
+
column: e,
|
|
236
|
+
title: l
|
|
237
|
+
}) => [e.tooltip ? (s(), f("span", de, [R("span", null, G(l), 1), r(t(Y), {
|
|
238
|
+
title: e.tooltip,
|
|
239
|
+
placement: "bottom"
|
|
240
|
+
}, {
|
|
241
|
+
default: c(() => [r(t(ne), {
|
|
242
|
+
style: {
|
|
243
|
+
color: "#0070ff",
|
|
244
|
+
"padding-left": "4px"
|
|
245
|
+
}
|
|
246
|
+
})]),
|
|
247
|
+
_: 2
|
|
248
|
+
}, 1032, ["title"])])) : x("", !0)]),
|
|
249
|
+
_: 2
|
|
250
|
+
}, [w(t(B)(a.$slots, "title"), (e, l) => ({
|
|
251
|
+
name: l,
|
|
252
|
+
fn: c((p) => [F(a.$slots, l, Q(U(p || {})))])
|
|
253
|
+
}))]), 1040, ["class", "onChange", "columns"])], 6)], 2));
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
export {
|
|
257
|
+
Ce as default
|
|
258
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ApTableIndexProps } from '../interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTableIndexProps>, {
|
|
5
|
+
bordered: boolean;
|
|
6
|
+
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApTableIndexProps>, {
|
|
7
|
+
bordered: boolean;
|
|
8
|
+
}>>>, {
|
|
9
|
+
bordered: boolean;
|
|
10
|
+
}, {}>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
13
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
14
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
15
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
16
|
+
} : {
|
|
17
|
+
type: PropType<T[K]>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
type __VLS_WithDefaults<P, D> = {
|
|
22
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
23
|
+
default: D[K];
|
|
24
|
+
}> : P[K];
|
|
25
|
+
};
|
|
26
|
+
type __VLS_Prettify<T> = {
|
|
27
|
+
[K in keyof T]: T[K];
|
|
28
|
+
} & {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as n, computed as l, openBlock as s, createElementBlock as p, normalizeClass as m, toDisplayString as d } from "vue";
|
|
2
|
+
import "../style/index.css";
|
|
3
|
+
import "../../../config-provider/index.mjs";
|
|
4
|
+
import { useNamespace as c } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
5
|
+
const v = /* @__PURE__ */ n({
|
|
6
|
+
name: "_ApTableIndex",
|
|
7
|
+
__name: "index",
|
|
8
|
+
props: {
|
|
9
|
+
bordered: { type: Boolean, default: !1 },
|
|
10
|
+
value: {}
|
|
11
|
+
},
|
|
12
|
+
setup(e) {
|
|
13
|
+
const o = e, { m: r } = c("ap-table-index"), t = l(() => [o.bordered ? r("bordered") : null].filter(Boolean));
|
|
14
|
+
return (a, i) => (s(), p("div", {
|
|
15
|
+
class: m(t.value)
|
|
16
|
+
}, d(a.value), 3));
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
v as default
|
|
21
|
+
};
|
|
@@ -8,3 +8,13 @@ export type ApTablePaginationProps = {
|
|
|
8
8
|
pageSize?: number;
|
|
9
9
|
'onUpdate:pageSize'?: (pageSize: number) => void;
|
|
10
10
|
};
|
|
11
|
+
export type ApTableIndexProps = {
|
|
12
|
+
/**
|
|
13
|
+
* 是否显示有边框的样式
|
|
14
|
+
*/
|
|
15
|
+
bordered?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 当前的索引(内部使用,请不要传入)
|
|
18
|
+
*/
|
|
19
|
+
value?: any;
|
|
20
|
+
};
|