@aplus-frontend/ui 0.0.11 → 0.0.13
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 +166 -158
- package/es/src/ap-action/item/index.vue2.mjs +21 -20
- package/es/src/ap-action/style/item.css +20 -5
- package/es/src/ap-form/ap-form.vue2.mjs +42 -42
- package/es/src/ap-form/modal-form/index.vue.mjs +104 -104
- package/es/src/ap-form/style/modal-form.css +5 -1
- package/es/src/ap-table/ap-table.vue.d.ts +5 -1
- package/es/src/business/index.d.ts +126 -0
- package/es/src/business/index.mjs +8 -0
- package/es/src/business/title/ApTitle.vue.d.ts +45 -0
- package/es/src/business/title/ApTitle.vue.mjs +50 -0
- package/es/src/business/title/ApTitle.vue2.mjs +4 -0
- package/es/src/business/title/interface.d.ts +21 -0
- package/es/src/business/title/style.css +39 -0
- package/es/src/components.d.ts +1 -0
- package/es/src/editable-table/form-item.vue.d.ts +304 -0
- package/es/src/editable-table/form-item.vue.mjs +189 -0
- package/es/src/editable-table/form-item.vue2.mjs +4 -0
- package/es/src/editable-table/hooks/use-get-columns.d.ts +5 -0
- package/es/src/editable-table/hooks/use-get-columns.mjs +76 -0
- package/es/src/editable-table/index.d.ts +5 -0
- package/es/src/editable-table/index.mjs +3 -0
- package/es/src/editable-table/index.vue.d.ts +196 -0
- package/es/src/editable-table/index.vue.mjs +209 -0
- package/es/src/editable-table/index.vue2.mjs +4 -0
- package/es/src/editable-table/interface.d.ts +72 -5
- package/es/src/editable-table/interface.mjs +1 -0
- package/es/src/editable-table/style/index.css +40 -1
- package/es/src/editable-table/utils.mjs +10 -0
- package/es/src/index.d.ts +2 -0
- package/es/src/index.mjs +229 -220
- package/es/src/pro-form/components/form-action.vue2.mjs +8 -8
- package/es/src/theme/antd-global-overwrite/admin/index.css +8 -0
- package/es/src/theme/antd-global-overwrite/admin/table.css +8 -0
- package/es/src/theme/ap-action/item.css +20 -5
- package/es/src/theme/ap-form/modal-form.css +5 -1
- package/es/src/theme/ap-title/ap-title.css +39 -0
- package/es/src/theme/editable-table/index.css +40 -1
- package/lib/index.js +1 -1
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-action/style/item.css +20 -5
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/style/modal-form.css +5 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +5 -1
- package/lib/src/business/index.d.ts +126 -0
- package/lib/src/business/index.js +1 -0
- package/lib/src/business/title/ApTitle.vue.d.ts +45 -0
- package/lib/src/business/title/ApTitle.vue.js +1 -0
- package/lib/src/business/title/ApTitle.vue2.js +1 -0
- package/lib/src/business/title/interface.d.ts +21 -0
- package/lib/src/business/title/style.css +39 -0
- package/lib/src/components.d.ts +1 -0
- package/lib/src/editable-table/form-item.vue.d.ts +304 -0
- package/lib/src/editable-table/form-item.vue.js +1 -0
- package/lib/src/editable-table/form-item.vue2.js +1 -0
- package/lib/src/editable-table/hooks/use-get-columns.d.ts +5 -0
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -0
- package/lib/src/editable-table/index.d.ts +5 -0
- package/lib/src/editable-table/index.js +1 -0
- package/lib/src/editable-table/index.vue.d.ts +196 -0
- package/lib/src/editable-table/index.vue.js +1 -0
- package/lib/src/editable-table/index.vue2.js +1 -0
- package/lib/src/editable-table/interface.d.ts +72 -5
- package/lib/src/editable-table/interface.js +1 -0
- package/lib/src/editable-table/style/index.css +40 -1
- package/lib/src/editable-table/utils.js +1 -0
- package/lib/src/index.d.ts +2 -0
- package/lib/src/index.js +1 -1
- package/lib/src/pro-form/components/form-action.vue2.js +1 -1
- package/lib/src/theme/antd-global-overwrite/admin/index.css +8 -0
- package/lib/src/theme/antd-global-overwrite/admin/table.css +8 -0
- package/lib/src/theme/ap-action/item.css +20 -5
- package/lib/src/theme/ap-form/modal-form.css +5 -1
- package/lib/src/theme/ap-title/ap-title.css +39 -0
- package/lib/src/theme/editable-table/index.css +40 -1
- package/package.json +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineComponent as f, openBlock as r, createElementBlock as s, normalizeClass as l, unref as t, createElementVNode as o, renderSlot as a, Fragment as u, toDisplayString as d, createBlock as c, withCtx as g, createVNode as h, createCommentVNode as k } from "vue";
|
|
2
|
+
import { Tooltip as C } from "ant-design-vue";
|
|
3
|
+
import { QuestionCircleOutlined as M } from "@ant-design/icons-vue";
|
|
4
|
+
import "../../config-provider/index.mjs";
|
|
5
|
+
import "./style.css";
|
|
6
|
+
import { useNamespace as v } from "../../config-provider/hooks/use-namespace.mjs";
|
|
7
|
+
import { useGlobalConfig as y } from "../../config-provider/hooks/use-global-config.mjs";
|
|
8
|
+
const w = /* @__PURE__ */ f({
|
|
9
|
+
name: "ApTitle",
|
|
10
|
+
__name: "ApTitle",
|
|
11
|
+
props: {
|
|
12
|
+
title: { default: "" },
|
|
13
|
+
helpMessage: { default: "" },
|
|
14
|
+
placement: { default: "top" },
|
|
15
|
+
trigger: { default: "hover" }
|
|
16
|
+
},
|
|
17
|
+
setup(N) {
|
|
18
|
+
const { b: p, e: i, m: n } = v("ap-title"), m = y("uiMode", "aplus");
|
|
19
|
+
return (e, $) => (r(), s("div", {
|
|
20
|
+
class: l([t(p)(), `${t(n)(t(m))}`])
|
|
21
|
+
}, [
|
|
22
|
+
o("div", {
|
|
23
|
+
class: l(t(i)("prefix"))
|
|
24
|
+
}, [
|
|
25
|
+
e.$slots.prefix ? a(e.$slots, "prefix", { key: 0 }) : (r(), s(u, { key: 1 }, [
|
|
26
|
+
o("span", null, d(e.title), 1),
|
|
27
|
+
e.helpMessage ? (r(), c(t(C), {
|
|
28
|
+
key: 0,
|
|
29
|
+
title: e.helpMessage,
|
|
30
|
+
placement: e.placement,
|
|
31
|
+
trigger: e.trigger
|
|
32
|
+
}, {
|
|
33
|
+
default: g(() => [
|
|
34
|
+
h(t(M))
|
|
35
|
+
]),
|
|
36
|
+
_: 1
|
|
37
|
+
}, 8, ["title", "placement", "trigger"])) : k("", !0)
|
|
38
|
+
], 64))
|
|
39
|
+
], 2),
|
|
40
|
+
o("div", {
|
|
41
|
+
class: l(t(i)("suffix"))
|
|
42
|
+
}, [
|
|
43
|
+
a(e.$slots, "suffix")
|
|
44
|
+
], 2)
|
|
45
|
+
], 2));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
export {
|
|
49
|
+
w as default
|
|
50
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ApTitle Props 属性类型声明
|
|
3
|
+
*/
|
|
4
|
+
export interface ApTitleProps {
|
|
5
|
+
/**
|
|
6
|
+
* 小标题
|
|
7
|
+
*/
|
|
8
|
+
title: string;
|
|
9
|
+
/**
|
|
10
|
+
* 帮助消息
|
|
11
|
+
*/
|
|
12
|
+
helpMessage: string;
|
|
13
|
+
/**
|
|
14
|
+
* 气泡框位置 默认top
|
|
15
|
+
*/
|
|
16
|
+
placement: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
17
|
+
/**
|
|
18
|
+
* 气泡触发行为 默认hover
|
|
19
|
+
*/
|
|
20
|
+
trigger: 'hover' | 'focus' | 'click' | 'contextmenu';
|
|
21
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.aplus-ap-title {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 32px;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
padding-left: 11px;
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
}
|
|
11
|
+
.aplus-ap-title::before {
|
|
12
|
+
position: absolute;
|
|
13
|
+
content: '';
|
|
14
|
+
left: 0;
|
|
15
|
+
top: 6px;
|
|
16
|
+
width: 3px;
|
|
17
|
+
height: 20px;
|
|
18
|
+
background: #0070ff;
|
|
19
|
+
border-radius: 0px 4px 4px 0px;
|
|
20
|
+
}
|
|
21
|
+
.aplus-ap-title--aplus::before {
|
|
22
|
+
background: #0070ff;
|
|
23
|
+
}
|
|
24
|
+
.aplus-ap-title--admin::before {
|
|
25
|
+
background: #34b77c;
|
|
26
|
+
}
|
|
27
|
+
.aplus-ap-title__prefix {
|
|
28
|
+
font-weight: bold;
|
|
29
|
+
color: #182948;
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
}
|
|
33
|
+
.aplus-ap-title__prefix .anticon-question-circle {
|
|
34
|
+
margin-left: 5px;
|
|
35
|
+
color: #8896b0;
|
|
36
|
+
}
|
|
37
|
+
.aplus-ap-title__suffix {
|
|
38
|
+
color: #526a90;
|
|
39
|
+
}
|
package/es/src/components.d.ts
CHANGED
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { EditableColumnType, EditableTableFormItemProps } from './interface';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType, CSSProperties, HTMLAttributes } from 'vue';
|
|
3
|
+
import { SpinSize } from 'ant-design-vue/es/spin/Spin';
|
|
4
|
+
import { VueTypeValidableDef, VueTypeDef } from '../../node_modules/vue-types';
|
|
5
|
+
import { TablePaginationConfig } from 'ant-design-vue';
|
|
6
|
+
import { TableLayout, GetRowKey } from 'ant-design-vue/es/vc-table/interface';
|
|
7
|
+
import { SortOrder } from 'ant-design-vue/es/table/interface';
|
|
8
|
+
import { TriggerType } from 'ant-design-vue/es/tooltip/abstractTooltipProps';
|
|
9
|
+
import { TooltipPlacement, AdjustOverflow } from 'ant-design-vue/es/tooltip';
|
|
10
|
+
import { LiteralUnion } from 'ant-design-vue/es/_util/type';
|
|
11
|
+
import { PresetColorType } from 'ant-design-vue/es/_util/colors';
|
|
12
|
+
import { AlignType, BuildInPlacements } from 'ant-design-vue/es/vc-trigger/interface';
|
|
13
|
+
import { ColSize } from 'ant-design-vue/es/grid';
|
|
14
|
+
import { FormLabelAlign } from 'ant-design-vue/es/form/interface';
|
|
15
|
+
import { RuleObject } from 'ant-design-vue/es/form';
|
|
16
|
+
|
|
17
|
+
type EditableTableFormItemSlots = {
|
|
18
|
+
default: any;
|
|
19
|
+
emptyText?: any;
|
|
20
|
+
expandIcon?: any;
|
|
21
|
+
title?: any;
|
|
22
|
+
footer?: any;
|
|
23
|
+
summary?: any;
|
|
24
|
+
expandedRowRender?: any;
|
|
25
|
+
expandColumnTitle?: any;
|
|
26
|
+
customFilterIcon?: any;
|
|
27
|
+
customFilterDropdown?: any;
|
|
28
|
+
headerCell?: (props: {
|
|
29
|
+
title: any;
|
|
30
|
+
column: EditableColumnType;
|
|
31
|
+
}) => void;
|
|
32
|
+
};
|
|
33
|
+
declare function add(defaultValue?: any): void;
|
|
34
|
+
declare function remove(index: number): void;
|
|
35
|
+
declare function getRowsData(): any[];
|
|
36
|
+
declare function getRowData(index: number): any;
|
|
37
|
+
declare function setRowData(index: number, payload: any): void;
|
|
38
|
+
declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<EditableTableFormItemProps<any>>, {
|
|
39
|
+
bordered: boolean;
|
|
40
|
+
childrenColumnName: string;
|
|
41
|
+
defaultExpandAllRows: boolean;
|
|
42
|
+
expandFixed: boolean;
|
|
43
|
+
expandRowByClick: boolean;
|
|
44
|
+
indentSize: number;
|
|
45
|
+
rowKey: string;
|
|
46
|
+
showExpandColumn: boolean;
|
|
47
|
+
showHeader: boolean;
|
|
48
|
+
showSorterTooltip: boolean;
|
|
49
|
+
size: string;
|
|
50
|
+
sortDirections: () => string[];
|
|
51
|
+
pagination: boolean;
|
|
52
|
+
loading: undefined;
|
|
53
|
+
tableLayout: string;
|
|
54
|
+
formItem: () => {};
|
|
55
|
+
}>, {
|
|
56
|
+
add: typeof add;
|
|
57
|
+
remove: typeof remove;
|
|
58
|
+
getRowData: typeof getRowData;
|
|
59
|
+
getRowsData: typeof getRowsData;
|
|
60
|
+
setRowData: typeof setRowData;
|
|
61
|
+
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<EditableTableFormItemProps<any>>, {
|
|
62
|
+
bordered: boolean;
|
|
63
|
+
childrenColumnName: string;
|
|
64
|
+
defaultExpandAllRows: boolean;
|
|
65
|
+
expandFixed: boolean;
|
|
66
|
+
expandRowByClick: boolean;
|
|
67
|
+
indentSize: number;
|
|
68
|
+
rowKey: string;
|
|
69
|
+
showExpandColumn: boolean;
|
|
70
|
+
showHeader: boolean;
|
|
71
|
+
showSorterTooltip: boolean;
|
|
72
|
+
size: string;
|
|
73
|
+
sortDirections: () => string[];
|
|
74
|
+
pagination: boolean;
|
|
75
|
+
loading: undefined;
|
|
76
|
+
tableLayout: string;
|
|
77
|
+
formItem: () => {};
|
|
78
|
+
}>>>, {
|
|
79
|
+
loading: boolean | Partial< ExtractPropTypes<{
|
|
80
|
+
prefixCls: StringConstructor;
|
|
81
|
+
spinning: {
|
|
82
|
+
type: BooleanConstructor;
|
|
83
|
+
default: any;
|
|
84
|
+
};
|
|
85
|
+
size: PropType<SpinSize>;
|
|
86
|
+
wrapperClassName: StringConstructor;
|
|
87
|
+
tip: VueTypeValidableDef<any>;
|
|
88
|
+
delay: NumberConstructor;
|
|
89
|
+
indicator: VueTypeValidableDef<any>;
|
|
90
|
+
}>>;
|
|
91
|
+
size: "small" | "middle" | "large";
|
|
92
|
+
pagination: false | TablePaginationConfig;
|
|
93
|
+
bordered: boolean;
|
|
94
|
+
tableLayout: TableLayout;
|
|
95
|
+
rowKey: string | GetRowKey<any>;
|
|
96
|
+
sortDirections: SortOrder[];
|
|
97
|
+
showSorterTooltip: boolean | Partial< ExtractPropTypes<{
|
|
98
|
+
title: VueTypeValidableDef<any>;
|
|
99
|
+
trigger: PropType< TriggerType | TriggerType[]>;
|
|
100
|
+
open: {
|
|
101
|
+
type: BooleanConstructor;
|
|
102
|
+
default: any;
|
|
103
|
+
};
|
|
104
|
+
visible: {
|
|
105
|
+
type: BooleanConstructor;
|
|
106
|
+
default: any;
|
|
107
|
+
};
|
|
108
|
+
placement: PropType<TooltipPlacement>;
|
|
109
|
+
color: PropType<LiteralUnion<PresetColorType>>;
|
|
110
|
+
transitionName: StringConstructor;
|
|
111
|
+
overlayStyle: {
|
|
112
|
+
type: PropType<CSSProperties>;
|
|
113
|
+
default: CSSProperties;
|
|
114
|
+
};
|
|
115
|
+
overlayInnerStyle: {
|
|
116
|
+
type: PropType<CSSProperties>;
|
|
117
|
+
default: CSSProperties;
|
|
118
|
+
};
|
|
119
|
+
overlayClassName: StringConstructor;
|
|
120
|
+
openClassName: StringConstructor;
|
|
121
|
+
prefixCls: StringConstructor;
|
|
122
|
+
mouseEnterDelay: NumberConstructor;
|
|
123
|
+
mouseLeaveDelay: NumberConstructor;
|
|
124
|
+
getPopupContainer: PropType<(triggerNode: HTMLElement) => HTMLElement>;
|
|
125
|
+
arrowPointAtCenter: {
|
|
126
|
+
type: BooleanConstructor;
|
|
127
|
+
default: any;
|
|
128
|
+
};
|
|
129
|
+
arrow: {
|
|
130
|
+
type: PropType<boolean | {
|
|
131
|
+
pointAtCenter?: boolean | undefined;
|
|
132
|
+
}>;
|
|
133
|
+
default: boolean | {
|
|
134
|
+
pointAtCenter?: boolean | undefined;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
autoAdjustOverflow: {
|
|
138
|
+
type: PropType<boolean | AdjustOverflow>;
|
|
139
|
+
default: boolean | AdjustOverflow;
|
|
140
|
+
};
|
|
141
|
+
destroyTooltipOnHide: {
|
|
142
|
+
type: BooleanConstructor;
|
|
143
|
+
default: any;
|
|
144
|
+
};
|
|
145
|
+
align: {
|
|
146
|
+
type: PropType<AlignType>;
|
|
147
|
+
default: AlignType;
|
|
148
|
+
};
|
|
149
|
+
builtinPlacements: {
|
|
150
|
+
type: PropType<BuildInPlacements>;
|
|
151
|
+
default: BuildInPlacements;
|
|
152
|
+
};
|
|
153
|
+
children: ArrayConstructor;
|
|
154
|
+
onVisibleChange: PropType<(vis: boolean) => void>;
|
|
155
|
+
'onUpdate:visible': PropType<(vis: boolean) => void>;
|
|
156
|
+
onOpenChange: PropType<(vis: boolean) => void>;
|
|
157
|
+
'onUpdate:open': PropType<(vis: boolean) => void>;
|
|
158
|
+
}>>;
|
|
159
|
+
showHeader: boolean;
|
|
160
|
+
expandFixed: boolean | "left" | "right";
|
|
161
|
+
expandRowByClick: boolean;
|
|
162
|
+
defaultExpandAllRows: boolean;
|
|
163
|
+
indentSize: number;
|
|
164
|
+
showExpandColumn: boolean;
|
|
165
|
+
childrenColumnName: string;
|
|
166
|
+
formItem: Partial<Omit<Partial< ExtractPropTypes<{
|
|
167
|
+
htmlFor: StringConstructor;
|
|
168
|
+
prefixCls: StringConstructor;
|
|
169
|
+
label: VueTypeValidableDef<any>;
|
|
170
|
+
help: VueTypeValidableDef<any>;
|
|
171
|
+
extra: VueTypeValidableDef<any>;
|
|
172
|
+
labelCol: {
|
|
173
|
+
type: PropType<Partial< ExtractPropTypes<{
|
|
174
|
+
span: (StringConstructor | NumberConstructor)[];
|
|
175
|
+
order: (StringConstructor | NumberConstructor)[];
|
|
176
|
+
offset: (StringConstructor | NumberConstructor)[];
|
|
177
|
+
push: (StringConstructor | NumberConstructor)[];
|
|
178
|
+
pull: (StringConstructor | NumberConstructor)[];
|
|
179
|
+
xs: {
|
|
180
|
+
type: PropType<string | number | ColSize>;
|
|
181
|
+
default: string | number | ColSize;
|
|
182
|
+
};
|
|
183
|
+
sm: {
|
|
184
|
+
type: PropType<string | number | ColSize>;
|
|
185
|
+
default: string | number | ColSize;
|
|
186
|
+
};
|
|
187
|
+
md: {
|
|
188
|
+
type: PropType<string | number | ColSize>;
|
|
189
|
+
default: string | number | ColSize;
|
|
190
|
+
};
|
|
191
|
+
lg: {
|
|
192
|
+
type: PropType<string | number | ColSize>;
|
|
193
|
+
default: string | number | ColSize;
|
|
194
|
+
};
|
|
195
|
+
xl: {
|
|
196
|
+
type: PropType<string | number | ColSize>;
|
|
197
|
+
default: string | number | ColSize;
|
|
198
|
+
};
|
|
199
|
+
xxl: {
|
|
200
|
+
type: PropType<string | number | ColSize>;
|
|
201
|
+
default: string | number | ColSize;
|
|
202
|
+
};
|
|
203
|
+
prefixCls: StringConstructor;
|
|
204
|
+
flex: (StringConstructor | NumberConstructor)[];
|
|
205
|
+
}>> & HTMLAttributes>;
|
|
206
|
+
};
|
|
207
|
+
wrapperCol: {
|
|
208
|
+
type: PropType<Partial< ExtractPropTypes<{
|
|
209
|
+
span: (StringConstructor | NumberConstructor)[];
|
|
210
|
+
order: (StringConstructor | NumberConstructor)[];
|
|
211
|
+
offset: (StringConstructor | NumberConstructor)[];
|
|
212
|
+
push: (StringConstructor | NumberConstructor)[];
|
|
213
|
+
pull: (StringConstructor | NumberConstructor)[];
|
|
214
|
+
xs: {
|
|
215
|
+
type: PropType<string | number | ColSize>;
|
|
216
|
+
default: string | number | ColSize;
|
|
217
|
+
};
|
|
218
|
+
sm: {
|
|
219
|
+
type: PropType<string | number | ColSize>;
|
|
220
|
+
default: string | number | ColSize;
|
|
221
|
+
};
|
|
222
|
+
md: {
|
|
223
|
+
type: PropType<string | number | ColSize>;
|
|
224
|
+
default: string | number | ColSize;
|
|
225
|
+
};
|
|
226
|
+
lg: {
|
|
227
|
+
type: PropType<string | number | ColSize>;
|
|
228
|
+
default: string | number | ColSize;
|
|
229
|
+
};
|
|
230
|
+
xl: {
|
|
231
|
+
type: PropType<string | number | ColSize>;
|
|
232
|
+
default: string | number | ColSize;
|
|
233
|
+
};
|
|
234
|
+
xxl: {
|
|
235
|
+
type: PropType<string | number | ColSize>;
|
|
236
|
+
default: string | number | ColSize;
|
|
237
|
+
};
|
|
238
|
+
prefixCls: StringConstructor;
|
|
239
|
+
flex: (StringConstructor | NumberConstructor)[];
|
|
240
|
+
}>> & HTMLAttributes>;
|
|
241
|
+
};
|
|
242
|
+
hasFeedback: {
|
|
243
|
+
type: BooleanConstructor;
|
|
244
|
+
default: boolean;
|
|
245
|
+
};
|
|
246
|
+
colon: {
|
|
247
|
+
type: BooleanConstructor;
|
|
248
|
+
default: any;
|
|
249
|
+
};
|
|
250
|
+
labelAlign: PropType<FormLabelAlign>;
|
|
251
|
+
prop: {
|
|
252
|
+
type: PropType<string | number | (string | number)[]>;
|
|
253
|
+
};
|
|
254
|
+
name: {
|
|
255
|
+
type: PropType<string | number | (string | number)[]>;
|
|
256
|
+
};
|
|
257
|
+
rules: PropType< RuleObject | RuleObject[]>;
|
|
258
|
+
autoLink: {
|
|
259
|
+
type: BooleanConstructor;
|
|
260
|
+
default: boolean;
|
|
261
|
+
};
|
|
262
|
+
required: {
|
|
263
|
+
type: BooleanConstructor;
|
|
264
|
+
default: any;
|
|
265
|
+
};
|
|
266
|
+
validateFirst: {
|
|
267
|
+
type: BooleanConstructor;
|
|
268
|
+
default: any;
|
|
269
|
+
};
|
|
270
|
+
validateStatus: VueTypeDef<string>;
|
|
271
|
+
validateTrigger: {
|
|
272
|
+
type: PropType<string | string[]>;
|
|
273
|
+
};
|
|
274
|
+
messageVariables: {
|
|
275
|
+
type: PropType<Record<string, string>>;
|
|
276
|
+
};
|
|
277
|
+
hidden: BooleanConstructor;
|
|
278
|
+
noStyle: BooleanConstructor;
|
|
279
|
+
tooltip: StringConstructor;
|
|
280
|
+
}>>, "name" | "label">>;
|
|
281
|
+
}, {}>, Readonly<EditableTableFormItemSlots> & EditableTableFormItemSlots>;
|
|
282
|
+
export default _default;
|
|
283
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
284
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
285
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
286
|
+
type: PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
287
|
+
} : {
|
|
288
|
+
type: PropType<T[K]>;
|
|
289
|
+
required: true;
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
type __VLS_WithDefaults<P, D> = {
|
|
293
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
294
|
+
default: D[K];
|
|
295
|
+
}> : P[K];
|
|
296
|
+
};
|
|
297
|
+
type __VLS_Prettify<T> = {
|
|
298
|
+
[K in keyof T]: T[K];
|
|
299
|
+
} & {};
|
|
300
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
301
|
+
new (): {
|
|
302
|
+
$slots: S;
|
|
303
|
+
};
|
|
304
|
+
};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { defineComponent as P, ref as L, unref as o, useSlots as V, watch as j, openBlock as f, createBlock as z, mergeProps as c, withCtx as i, createVNode as _, createSlots as O, createElementBlock as T, Fragment as K, createElementVNode as x, normalizeClass as q, toDisplayString as A, createCommentVNode as G, renderList as H, renderSlot as M, normalizeProps as W, guardReactiveProps as U } from "vue";
|
|
2
|
+
import { Table as $ } from "ant-design-vue";
|
|
3
|
+
import { ApForm as C } from "../ap-form/index.mjs";
|
|
4
|
+
import { cloneDeep as g, omit as J } from "lodash-unified";
|
|
5
|
+
import "../config-provider/index.mjs";
|
|
6
|
+
import { useInjectForm as Q } from "../ap-form/context.mjs";
|
|
7
|
+
import "./style/index.css";
|
|
8
|
+
import { isDef as X } from "../utils/index.mjs";
|
|
9
|
+
import Y from "./hooks/use-get-columns.mjs";
|
|
10
|
+
import { useNamespace as Z } from "../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
import { useGlobalConfig as I } from "../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
const pe = /* @__PURE__ */ P({
|
|
13
|
+
name: "EditableTableInner",
|
|
14
|
+
__name: "form-item",
|
|
15
|
+
props: {
|
|
16
|
+
dropdownPrefixCls: {},
|
|
17
|
+
pagination: {
|
|
18
|
+
type: [Boolean, Object],
|
|
19
|
+
default: !1
|
|
20
|
+
},
|
|
21
|
+
loading: {
|
|
22
|
+
type: [Boolean, Object],
|
|
23
|
+
default: void 0
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
default: "middle"
|
|
27
|
+
},
|
|
28
|
+
bordered: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
},
|
|
32
|
+
locale: {},
|
|
33
|
+
onChange: {},
|
|
34
|
+
onResizeColumn: {},
|
|
35
|
+
rowSelection: {},
|
|
36
|
+
getPopupContainer: {},
|
|
37
|
+
scroll: {},
|
|
38
|
+
sortDirections: {
|
|
39
|
+
default: () => ["ascend", "descend"]
|
|
40
|
+
},
|
|
41
|
+
showSorterTooltip: {
|
|
42
|
+
type: [Boolean, Object],
|
|
43
|
+
default: !0
|
|
44
|
+
},
|
|
45
|
+
prefixCls: {},
|
|
46
|
+
rowKey: {
|
|
47
|
+
default: "key"
|
|
48
|
+
},
|
|
49
|
+
tableLayout: {
|
|
50
|
+
default: "fixed"
|
|
51
|
+
},
|
|
52
|
+
rowClassName: {},
|
|
53
|
+
title: {},
|
|
54
|
+
footer: {},
|
|
55
|
+
id: {},
|
|
56
|
+
showHeader: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: !0
|
|
59
|
+
},
|
|
60
|
+
components: {},
|
|
61
|
+
customRow: {},
|
|
62
|
+
customHeaderRow: {},
|
|
63
|
+
direction: {},
|
|
64
|
+
expandFixed: {
|
|
65
|
+
type: [String, Boolean],
|
|
66
|
+
default: !1
|
|
67
|
+
},
|
|
68
|
+
expandColumnWidth: {},
|
|
69
|
+
expandedRowKeys: {},
|
|
70
|
+
defaultExpandedRowKeys: {},
|
|
71
|
+
expandedRowRender: {},
|
|
72
|
+
expandRowByClick: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: !1
|
|
75
|
+
},
|
|
76
|
+
expandIcon: {},
|
|
77
|
+
onExpand: {},
|
|
78
|
+
onExpandedRowsChange: {},
|
|
79
|
+
defaultExpandAllRows: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: !1
|
|
82
|
+
},
|
|
83
|
+
indentSize: {
|
|
84
|
+
default: 15
|
|
85
|
+
},
|
|
86
|
+
expandIconColumnIndex: {},
|
|
87
|
+
showExpandColumn: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: !0
|
|
90
|
+
},
|
|
91
|
+
expandedRowClassName: {},
|
|
92
|
+
childrenColumnName: {
|
|
93
|
+
default: "children"
|
|
94
|
+
},
|
|
95
|
+
rowExpandable: {},
|
|
96
|
+
sticky: {
|
|
97
|
+
type: [Boolean, Object]
|
|
98
|
+
},
|
|
99
|
+
transformCellText: {},
|
|
100
|
+
columns: {},
|
|
101
|
+
value: {},
|
|
102
|
+
defaultValue: {},
|
|
103
|
+
"onUpdate:value": {},
|
|
104
|
+
maxLength: {},
|
|
105
|
+
onFieldChange: {},
|
|
106
|
+
label: {},
|
|
107
|
+
name: {},
|
|
108
|
+
formItem: {
|
|
109
|
+
default: () => ({})
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
setup(h, {
|
|
113
|
+
expose: w
|
|
114
|
+
}) {
|
|
115
|
+
var p;
|
|
116
|
+
const n = h, {
|
|
117
|
+
formInstance: t,
|
|
118
|
+
model: b
|
|
119
|
+
} = Q(), d = L(((p = o(b)) == null ? void 0 : p[n.name]) || []), y = V(), R = C.useWatch(n.name);
|
|
120
|
+
j(() => R.value, (a) => {
|
|
121
|
+
var l;
|
|
122
|
+
d.value = a, (l = n.onChange) == null || l.call(n, a);
|
|
123
|
+
});
|
|
124
|
+
const {
|
|
125
|
+
b: u,
|
|
126
|
+
em: B
|
|
127
|
+
} = Z("editable-table"), D = I("uiMode", "aplus"), E = Y(n);
|
|
128
|
+
function F(a) {
|
|
129
|
+
var e, r;
|
|
130
|
+
const l = ((e = o(d)) == null ? void 0 : e.length) || 0;
|
|
131
|
+
X(n.maxLength) && l >= n.maxLength || (r = t == null ? void 0 : t.setFieldValue) == null || r.call(t, n.name, [...o(d) || [], a || {}]);
|
|
132
|
+
}
|
|
133
|
+
function v(a) {
|
|
134
|
+
var e;
|
|
135
|
+
const l = g(o(d) || []);
|
|
136
|
+
l.splice(a, 1), (e = t == null ? void 0 : t.setFieldValue) == null || e.call(t, n.name, [...l]);
|
|
137
|
+
}
|
|
138
|
+
function S() {
|
|
139
|
+
return o(d);
|
|
140
|
+
}
|
|
141
|
+
function k(a) {
|
|
142
|
+
var l;
|
|
143
|
+
return (l = o(d)) == null ? void 0 : l[a];
|
|
144
|
+
}
|
|
145
|
+
function N(a, l) {
|
|
146
|
+
var r;
|
|
147
|
+
const e = g(o(d));
|
|
148
|
+
e[a] && (e[a] = {
|
|
149
|
+
...e[a],
|
|
150
|
+
...l
|
|
151
|
+
}, (r = t == null ? void 0 : t.setFieldValue) == null || r.call(t, n.name, [...e]));
|
|
152
|
+
}
|
|
153
|
+
return w({
|
|
154
|
+
add: F,
|
|
155
|
+
remove: v,
|
|
156
|
+
getRowData: k,
|
|
157
|
+
getRowsData: S,
|
|
158
|
+
setRowData: N
|
|
159
|
+
}), (a, l) => (f(), z(o(C).FormItem, c(a.formItem, {
|
|
160
|
+
name: a.name,
|
|
161
|
+
label: a.label
|
|
162
|
+
}), {
|
|
163
|
+
default: i(() => [_(o($), c(o(J)(n, ["name", "maxLength"]), {
|
|
164
|
+
class: [o(u)(), o(D) === "admin" ? o(u)("admin") : null],
|
|
165
|
+
columns: o(E),
|
|
166
|
+
"data-source": d.value
|
|
167
|
+
}), O({
|
|
168
|
+
headerCell: i(({
|
|
169
|
+
column: e
|
|
170
|
+
}) => {
|
|
171
|
+
var r, s, m;
|
|
172
|
+
return [(r = e == null ? void 0 : e.fieldProps) != null && r.required || (m = (s = e == null ? void 0 : e.fieldProps) == null ? void 0 : s.rules) != null && m.length ? (f(), T(K, {
|
|
173
|
+
key: 0
|
|
174
|
+
}, [x("span", {
|
|
175
|
+
class: q(o(B)("header-cell", "required"))
|
|
176
|
+
}, "*", 2), x("span", null, A(e.title), 1)], 64)) : G("", !0)];
|
|
177
|
+
}),
|
|
178
|
+
_: 2
|
|
179
|
+
}, [H(y, (e, r) => ({
|
|
180
|
+
name: r,
|
|
181
|
+
fn: i((s) => [M(a.$slots, r, W(U(s || {})))])
|
|
182
|
+
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
183
|
+
_: 3
|
|
184
|
+
}, 16, ["name", "label"]));
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
export {
|
|
188
|
+
pe as default
|
|
189
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EditableTableFormItemProps, EditableTableProps, EditableColumnType } from '../interface';
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
|
+
|
|
4
|
+
declare const useGetColumns: (props: EditableTableProps | EditableTableFormItemProps) => ComputedRef< EditableColumnType<any, any>[]>;
|
|
5
|
+
export default useGetColumns;
|