@qin-ui/antdv-next-pro 1.1.10 → 1.1.12
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/AI-CONTEXT.md +37 -0
- package/README.md +139 -130
- package/api.json +213 -0
- package/es/antdv-next-pro.css +9 -9
- package/es/component-provider/index-Daiw7IxY.js +186 -0
- package/es/component-provider/index.js +2 -184
- package/es/core/{index-C98RSrpN.js → index-ghYuQ3Sy.js} +29 -29
- package/es/form/{index-CyMXEA_9.js → index-7clzY8ZD.js} +67 -73
- package/es/form/index.js +10 -16
- package/es/index.d.ts +670 -135
- package/es/index.js +25 -22
- package/es/table/index.js +8 -7
- package/package.json +5 -2
package/es/antdv-next-pro.css
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
.pro-table_search-form[data-v-
|
|
1
|
+
.pro-table_search-form[data-v-6dbd8950] [class*='-form-item'] {
|
|
2
2
|
margin: 0;
|
|
3
3
|
}
|
|
4
|
-
.pro-table_search-form_expand-toggle-button[data-v-
|
|
4
|
+
.pro-table_search-form_expand-toggle-button[data-v-6dbd8950] {
|
|
5
5
|
display: flex;
|
|
6
6
|
align-items: center;
|
|
7
7
|
padding: 0;
|
|
8
8
|
padding-left: 4px;
|
|
9
9
|
}
|
|
10
|
-
.pro-table_search-form .transition[data-v-
|
|
10
|
+
.pro-table_search-form .transition[data-v-6dbd8950] {
|
|
11
11
|
transition: all 0.25s;
|
|
12
12
|
}
|
|
13
13
|
.pro-table_search-form-container[data-v-f115fbbe] {
|
|
@@ -36,23 +36,23 @@
|
|
|
36
36
|
.pro-table_column-control_button[data-v-246b0faf] svg {
|
|
37
37
|
transform: scale(1.2, 1.4);
|
|
38
38
|
}
|
|
39
|
-
.pro-table_header[data-v-
|
|
39
|
+
.pro-table_header[data-v-060985c7] {
|
|
40
40
|
display: flex;
|
|
41
41
|
align-items: center;
|
|
42
42
|
justify-content: flex-end;
|
|
43
43
|
}
|
|
44
|
-
.pro-table_header[data-v-
|
|
44
|
+
.pro-table_header[data-v-060985c7]:empty {
|
|
45
45
|
display: none;
|
|
46
46
|
}
|
|
47
|
-
.pro-table_header + .pro-table_header_content[data-v-
|
|
47
|
+
.pro-table_header + .pro-table_header_content[data-v-060985c7] {
|
|
48
48
|
margin-top: 16px;
|
|
49
49
|
}
|
|
50
|
-
.pro-table_header_button-bar[data-v-
|
|
50
|
+
.pro-table_header_button-bar[data-v-060985c7] {
|
|
51
51
|
flex: 1;
|
|
52
52
|
}
|
|
53
|
-
.pro-table_header_toolbar[data-v-
|
|
53
|
+
.pro-table_header_toolbar[data-v-060985c7] {
|
|
54
54
|
margin-left: 12px;
|
|
55
55
|
}
|
|
56
|
-
.pro-table[data-v-
|
|
56
|
+
.pro-table[data-v-060985c7] [class*='-pagination'] [class*='-pagination-total-text'] {
|
|
57
57
|
flex: 1;
|
|
58
58
|
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { defineComponent, provide, renderSlot } from "vue";
|
|
2
|
+
import { g as getObject } from "../core/index-ghYuQ3Sy.js";
|
|
3
|
+
const getPopupContainer = (triggerNode) => triggerNode.closest("form[class*='-form']");
|
|
4
|
+
const INJECT_CONFIG = {
|
|
5
|
+
"pro-table": {
|
|
6
|
+
injectionKey: Symbol(""),
|
|
7
|
+
default: {
|
|
8
|
+
pagination: {
|
|
9
|
+
showTotal: (total) => `共 ${total} 条`,
|
|
10
|
+
showSizeChanger: true,
|
|
11
|
+
pageSizeOptions: ["10", "20", "30", "40", "50", "100"],
|
|
12
|
+
showQuickJumper: true
|
|
13
|
+
},
|
|
14
|
+
searchFormConfig: {
|
|
15
|
+
layout: "grid",
|
|
16
|
+
expand: { minExpandRows: 2, expandStatus: false }
|
|
17
|
+
},
|
|
18
|
+
control: true,
|
|
19
|
+
addIndexColumn: true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"pro-form": {
|
|
23
|
+
injectionKey: Symbol(""),
|
|
24
|
+
default: { grid: { gutter: { xs: 8, sm: 16, md: 16, lg: 24 } } }
|
|
25
|
+
},
|
|
26
|
+
"pro-form-item": {
|
|
27
|
+
injectionKey: Symbol(""),
|
|
28
|
+
default: { validateFirst: true, span: 8 }
|
|
29
|
+
},
|
|
30
|
+
// field
|
|
31
|
+
input: {
|
|
32
|
+
injectionKey: Symbol(""),
|
|
33
|
+
default: { maxlength: 100, allowClear: true, placeholder: "请输入" }
|
|
34
|
+
},
|
|
35
|
+
textarea: {
|
|
36
|
+
injectionKey: Symbol(""),
|
|
37
|
+
default: {
|
|
38
|
+
maxlength: 200,
|
|
39
|
+
autoSize: { minRows: 3, maxRows: 6 },
|
|
40
|
+
showCount: true,
|
|
41
|
+
allowClear: true,
|
|
42
|
+
placeholder: "请输入"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"input-password": {
|
|
46
|
+
injectionKey: Symbol(""),
|
|
47
|
+
default: { maxlength: 100, allowClear: true, placeholder: "请输入" }
|
|
48
|
+
},
|
|
49
|
+
"input-search": {
|
|
50
|
+
injectionKey: Symbol(""),
|
|
51
|
+
default: {}
|
|
52
|
+
},
|
|
53
|
+
"input-number": {
|
|
54
|
+
injectionKey: Symbol(""),
|
|
55
|
+
default: {
|
|
56
|
+
max: 10 ** 15 - 1,
|
|
57
|
+
min: -1000000000000001,
|
|
58
|
+
controls: false,
|
|
59
|
+
placeholder: "请输入",
|
|
60
|
+
style: { width: "100%" }
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"input-otp": {
|
|
64
|
+
injectionKey: Symbol(""),
|
|
65
|
+
default: {}
|
|
66
|
+
},
|
|
67
|
+
"auto-complete": {
|
|
68
|
+
injectionKey: Symbol(""),
|
|
69
|
+
default: { allowClear: true, placeholder: "请选择", getPopupContainer }
|
|
70
|
+
},
|
|
71
|
+
select: {
|
|
72
|
+
injectionKey: Symbol(""),
|
|
73
|
+
default: { allowClear: true, placeholder: "请选择", getPopupContainer }
|
|
74
|
+
},
|
|
75
|
+
cascader: {
|
|
76
|
+
injectionKey: Symbol(""),
|
|
77
|
+
default: { allowClear: true, placeholder: "请选择", getPopupContainer }
|
|
78
|
+
},
|
|
79
|
+
"date-picker": {
|
|
80
|
+
injectionKey: Symbol(""),
|
|
81
|
+
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
82
|
+
},
|
|
83
|
+
"date-picker.date": {
|
|
84
|
+
injectionKey: Symbol(""),
|
|
85
|
+
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
86
|
+
},
|
|
87
|
+
"date-picker.week": {
|
|
88
|
+
injectionKey: Symbol(""),
|
|
89
|
+
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
90
|
+
},
|
|
91
|
+
"date-picker.month": {
|
|
92
|
+
injectionKey: Symbol(""),
|
|
93
|
+
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
94
|
+
},
|
|
95
|
+
"date-picker.year": {
|
|
96
|
+
injectionKey: Symbol(""),
|
|
97
|
+
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
98
|
+
},
|
|
99
|
+
"date-picker.quarter": {
|
|
100
|
+
injectionKey: Symbol(""),
|
|
101
|
+
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
102
|
+
},
|
|
103
|
+
"range-picker": {
|
|
104
|
+
injectionKey: Symbol(""),
|
|
105
|
+
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
106
|
+
},
|
|
107
|
+
"time-picker": {
|
|
108
|
+
injectionKey: Symbol(""),
|
|
109
|
+
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
110
|
+
},
|
|
111
|
+
"time-range-picker": {
|
|
112
|
+
injectionKey: Symbol(""),
|
|
113
|
+
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
114
|
+
},
|
|
115
|
+
"checkbox-group": {
|
|
116
|
+
injectionKey: Symbol(""),
|
|
117
|
+
default: {}
|
|
118
|
+
},
|
|
119
|
+
"radio-group": {
|
|
120
|
+
injectionKey: Symbol(""),
|
|
121
|
+
default: {}
|
|
122
|
+
},
|
|
123
|
+
switch: {
|
|
124
|
+
injectionKey: Symbol(""),
|
|
125
|
+
default: { modelProp: "checked" }
|
|
126
|
+
},
|
|
127
|
+
slider: {
|
|
128
|
+
injectionKey: Symbol(""),
|
|
129
|
+
default: {}
|
|
130
|
+
},
|
|
131
|
+
"tree-select": {
|
|
132
|
+
injectionKey: Symbol(""),
|
|
133
|
+
default: {}
|
|
134
|
+
},
|
|
135
|
+
transfer: {
|
|
136
|
+
injectionKey: Symbol(""),
|
|
137
|
+
default: {}
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
const INJECT_COMPONENTS = Symbol("INJECT_COMPONENTS");
|
|
141
|
+
const DYNAMIC_INJECT_CONFIG = /* @__PURE__ */ Object.create(null);
|
|
142
|
+
const getInjectConfig = (key) => {
|
|
143
|
+
return INJECT_CONFIG[key] || DYNAMIC_INJECT_CONFIG[key];
|
|
144
|
+
};
|
|
145
|
+
const ensureInjectConfig = (key) => {
|
|
146
|
+
const existing = getInjectConfig(key);
|
|
147
|
+
if (existing) return existing;
|
|
148
|
+
const created = {
|
|
149
|
+
injectionKey: Symbol(`dynamic:${key}`),
|
|
150
|
+
default: {}
|
|
151
|
+
};
|
|
152
|
+
DYNAMIC_INJECT_CONFIG[key] = created;
|
|
153
|
+
return created;
|
|
154
|
+
};
|
|
155
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
156
|
+
...{
|
|
157
|
+
name: "ProComponentProvider",
|
|
158
|
+
inheritAttrs: false
|
|
159
|
+
},
|
|
160
|
+
__name: "index",
|
|
161
|
+
props: {
|
|
162
|
+
componentVars: {},
|
|
163
|
+
componentMap: {}
|
|
164
|
+
},
|
|
165
|
+
setup(__props) {
|
|
166
|
+
const props = __props;
|
|
167
|
+
if (props.componentVars) {
|
|
168
|
+
Object.entries(props.componentVars).forEach(([key, val]) => {
|
|
169
|
+
const config = ensureInjectConfig(key);
|
|
170
|
+
provide(config.injectionKey, { ...config.default, ...getObject(val) });
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
if (props.componentMap) {
|
|
174
|
+
provide(INJECT_COMPONENTS, props.componentMap);
|
|
175
|
+
}
|
|
176
|
+
return (_ctx, _cache) => {
|
|
177
|
+
return renderSlot(_ctx.$slots, "default");
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
export {
|
|
182
|
+
INJECT_CONFIG as I,
|
|
183
|
+
_sfc_main as _,
|
|
184
|
+
INJECT_COMPONENTS as a,
|
|
185
|
+
getInjectConfig as g
|
|
186
|
+
};
|
|
@@ -1,186 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { g as getObject } from "../core/index-C98RSrpN.js";
|
|
3
|
-
const getPopupContainer = (triggerNode) => triggerNode.closest("form[class*='-form']");
|
|
4
|
-
const INJECT_CONFIG = {
|
|
5
|
-
"pro-table": {
|
|
6
|
-
injectionKey: Symbol(""),
|
|
7
|
-
default: {
|
|
8
|
-
pagination: {
|
|
9
|
-
showTotal: (total) => `共 ${total} 条`,
|
|
10
|
-
showSizeChanger: true,
|
|
11
|
-
pageSizeOptions: ["10", "20", "30", "40", "50", "100"],
|
|
12
|
-
showQuickJumper: true
|
|
13
|
-
},
|
|
14
|
-
searchFormConfig: {
|
|
15
|
-
layout: "grid",
|
|
16
|
-
expand: { minExpandRows: 2, expandStatus: false }
|
|
17
|
-
},
|
|
18
|
-
control: true,
|
|
19
|
-
addIndexColumn: true
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"pro-form": {
|
|
23
|
-
injectionKey: Symbol(""),
|
|
24
|
-
default: { grid: { gutter: { xs: 8, sm: 16, md: 16, lg: 24 } } }
|
|
25
|
-
},
|
|
26
|
-
"pro-form-item": {
|
|
27
|
-
injectionKey: Symbol(""),
|
|
28
|
-
default: { validateFirst: true, span: 8 }
|
|
29
|
-
},
|
|
30
|
-
// field
|
|
31
|
-
input: {
|
|
32
|
-
injectionKey: Symbol(""),
|
|
33
|
-
default: { maxlength: 100, allowClear: true, placeholder: "请输入" }
|
|
34
|
-
},
|
|
35
|
-
textarea: {
|
|
36
|
-
injectionKey: Symbol(""),
|
|
37
|
-
default: {
|
|
38
|
-
maxlength: 200,
|
|
39
|
-
autoSize: { minRows: 3, maxRows: 6 },
|
|
40
|
-
showCount: true,
|
|
41
|
-
allowClear: true,
|
|
42
|
-
placeholder: "请输入"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"input-password": {
|
|
46
|
-
injectionKey: Symbol(""),
|
|
47
|
-
default: { maxlength: 100, allowClear: true, placeholder: "请输入" }
|
|
48
|
-
},
|
|
49
|
-
"input-search": {
|
|
50
|
-
injectionKey: Symbol(""),
|
|
51
|
-
default: {}
|
|
52
|
-
},
|
|
53
|
-
"input-number": {
|
|
54
|
-
injectionKey: Symbol(""),
|
|
55
|
-
default: {
|
|
56
|
-
max: 10 ** 15 - 1,
|
|
57
|
-
min: -1000000000000001,
|
|
58
|
-
controls: false,
|
|
59
|
-
placeholder: "请输入",
|
|
60
|
-
style: { width: "100%" }
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
"input-otp": {
|
|
64
|
-
injectionKey: Symbol(""),
|
|
65
|
-
default: {}
|
|
66
|
-
},
|
|
67
|
-
"auto-complete": {
|
|
68
|
-
injectionKey: Symbol(""),
|
|
69
|
-
default: { allowClear: true, placeholder: "请选择", getPopupContainer }
|
|
70
|
-
},
|
|
71
|
-
select: {
|
|
72
|
-
injectionKey: Symbol(""),
|
|
73
|
-
default: { allowClear: true, placeholder: "请选择", getPopupContainer }
|
|
74
|
-
},
|
|
75
|
-
cascader: {
|
|
76
|
-
injectionKey: Symbol(""),
|
|
77
|
-
default: { allowClear: true, placeholder: "请选择", getPopupContainer }
|
|
78
|
-
},
|
|
79
|
-
"date-picker": {
|
|
80
|
-
injectionKey: Symbol(""),
|
|
81
|
-
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
82
|
-
},
|
|
83
|
-
"date-picker.date": {
|
|
84
|
-
injectionKey: Symbol(""),
|
|
85
|
-
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
86
|
-
},
|
|
87
|
-
"date-picker.week": {
|
|
88
|
-
injectionKey: Symbol(""),
|
|
89
|
-
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
90
|
-
},
|
|
91
|
-
"date-picker.month": {
|
|
92
|
-
injectionKey: Symbol(""),
|
|
93
|
-
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
94
|
-
},
|
|
95
|
-
"date-picker.year": {
|
|
96
|
-
injectionKey: Symbol(""),
|
|
97
|
-
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
98
|
-
},
|
|
99
|
-
"date-picker.quarter": {
|
|
100
|
-
injectionKey: Symbol(""),
|
|
101
|
-
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
102
|
-
},
|
|
103
|
-
"range-picker": {
|
|
104
|
-
injectionKey: Symbol(""),
|
|
105
|
-
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
106
|
-
},
|
|
107
|
-
"time-picker": {
|
|
108
|
-
injectionKey: Symbol(""),
|
|
109
|
-
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
110
|
-
},
|
|
111
|
-
"time-range-picker": {
|
|
112
|
-
injectionKey: Symbol(""),
|
|
113
|
-
default: { allowClear: true, getPopupContainer, style: { width: "100%" } }
|
|
114
|
-
},
|
|
115
|
-
"checkbox-group": {
|
|
116
|
-
injectionKey: Symbol(""),
|
|
117
|
-
default: {}
|
|
118
|
-
},
|
|
119
|
-
"radio-group": {
|
|
120
|
-
injectionKey: Symbol(""),
|
|
121
|
-
default: {}
|
|
122
|
-
},
|
|
123
|
-
switch: {
|
|
124
|
-
injectionKey: Symbol(""),
|
|
125
|
-
default: { modelProp: "checked" }
|
|
126
|
-
},
|
|
127
|
-
slider: {
|
|
128
|
-
injectionKey: Symbol(""),
|
|
129
|
-
default: {}
|
|
130
|
-
},
|
|
131
|
-
"tree-select": {
|
|
132
|
-
injectionKey: Symbol(""),
|
|
133
|
-
default: {}
|
|
134
|
-
},
|
|
135
|
-
transfer: {
|
|
136
|
-
injectionKey: Symbol(""),
|
|
137
|
-
default: {}
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
const INJECT_COMPONENTS = Symbol("INJECT_COMPONENTS");
|
|
141
|
-
const DYNAMIC_INJECT_CONFIG = /* @__PURE__ */ Object.create(null);
|
|
142
|
-
const getInjectConfig = (key) => {
|
|
143
|
-
return INJECT_CONFIG[key] || DYNAMIC_INJECT_CONFIG[key];
|
|
144
|
-
};
|
|
145
|
-
const ensureInjectConfig = (key) => {
|
|
146
|
-
const existing = getInjectConfig(key);
|
|
147
|
-
if (existing) return existing;
|
|
148
|
-
const created = {
|
|
149
|
-
injectionKey: Symbol(`dynamic:${key}`),
|
|
150
|
-
default: {}
|
|
151
|
-
};
|
|
152
|
-
DYNAMIC_INJECT_CONFIG[key] = created;
|
|
153
|
-
return created;
|
|
154
|
-
};
|
|
155
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
156
|
-
...{
|
|
157
|
-
inheritAttrs: false
|
|
158
|
-
},
|
|
159
|
-
__name: "index",
|
|
160
|
-
props: {
|
|
161
|
-
componentVars: {},
|
|
162
|
-
componentMap: {}
|
|
163
|
-
},
|
|
164
|
-
setup(__props) {
|
|
165
|
-
const props = __props;
|
|
166
|
-
if (props.componentVars) {
|
|
167
|
-
Object.entries(props.componentVars).forEach(([key, val]) => {
|
|
168
|
-
const config = ensureInjectConfig(key);
|
|
169
|
-
provide(config.injectionKey, { ...config.default, ...getObject(val) });
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
if (props.componentMap) {
|
|
173
|
-
provide(INJECT_COMPONENTS, props.componentMap);
|
|
174
|
-
}
|
|
175
|
-
return (_ctx, _cache) => {
|
|
176
|
-
return renderSlot(_ctx.$slots, "default");
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
});
|
|
1
|
+
import { _ } from "./index-Daiw7IxY.js";
|
|
180
2
|
export {
|
|
181
|
-
|
|
182
|
-
INJECT_CONFIG,
|
|
183
|
-
_sfc_main as default,
|
|
184
|
-
ensureInjectConfig,
|
|
185
|
-
getInjectConfig
|
|
3
|
+
_ as default
|
|
186
4
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { inject,
|
|
2
|
-
import {
|
|
1
|
+
import { inject, ref, reactive, provide, toValue, camelize } from "vue";
|
|
2
|
+
import { c as cloneDeep, i as isPlainObject, s as set, g as get, p as pick, t as toPath } from "../vendor/utils/lodash-es-p6jau26B.js";
|
|
3
3
|
const InjectionFormKey = Symbol("form");
|
|
4
4
|
const InjectionPathKey = Symbol("path");
|
|
5
5
|
function getObject(val) {
|
|
@@ -109,23 +109,6 @@ const useFields = (initFields) => {
|
|
|
109
109
|
options
|
|
110
110
|
);
|
|
111
111
|
}
|
|
112
|
-
function addFields(path, newFields, options, placement) {
|
|
113
|
-
if (newFields.length === 0) return;
|
|
114
|
-
if (path) {
|
|
115
|
-
updaterMatch(
|
|
116
|
-
path,
|
|
117
|
-
({ fieldIndex, parentField }) => {
|
|
118
|
-
const index = placement === "after" ? fieldIndex + 1 : fieldIndex;
|
|
119
|
-
parentField.fields.splice(index, 0, ...newFields);
|
|
120
|
-
},
|
|
121
|
-
options
|
|
122
|
-
);
|
|
123
|
-
} else if (placement === "after") {
|
|
124
|
-
fields.value.push(...newFields);
|
|
125
|
-
} else {
|
|
126
|
-
fields.value.unshift(...newFields);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
112
|
function appendField(path, field, options) {
|
|
130
113
|
const newFields = Array.isArray(field) ? field : [field];
|
|
131
114
|
addFields(path, newFields, options, "after");
|
|
@@ -146,6 +129,23 @@ const useFields = (initFields) => {
|
|
|
146
129
|
);
|
|
147
130
|
return (options == null ? void 0 : options.all) ? res : res[0];
|
|
148
131
|
}
|
|
132
|
+
function addFields(path, newFields, options, placement) {
|
|
133
|
+
if (newFields.length === 0) return;
|
|
134
|
+
if (path) {
|
|
135
|
+
updaterMatch(
|
|
136
|
+
path,
|
|
137
|
+
({ fieldIndex, parentField }) => {
|
|
138
|
+
const index = placement === "after" ? fieldIndex + 1 : fieldIndex;
|
|
139
|
+
parentField.fields.splice(index, 0, ...newFields);
|
|
140
|
+
},
|
|
141
|
+
options
|
|
142
|
+
);
|
|
143
|
+
} else if (placement === "after") {
|
|
144
|
+
fields.value.push(...newFields);
|
|
145
|
+
} else {
|
|
146
|
+
fields.value.unshift(...newFields);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
149
|
return {
|
|
150
150
|
fields,
|
|
151
151
|
getField,
|
|
@@ -309,6 +309,14 @@ const useTable = (params) => {
|
|
|
309
309
|
options
|
|
310
310
|
);
|
|
311
311
|
}
|
|
312
|
+
function appendColumn(path, column, options) {
|
|
313
|
+
const newColumns = Array.isArray(column) ? column : [column];
|
|
314
|
+
addColumns(path, newColumns, options, "after");
|
|
315
|
+
}
|
|
316
|
+
function prependColumn(path, column, options) {
|
|
317
|
+
const newColumns = Array.isArray(column) ? column : [column];
|
|
318
|
+
addColumns(path, newColumns, options, "before");
|
|
319
|
+
}
|
|
312
320
|
function addColumns(path, newColumns, options, placement) {
|
|
313
321
|
if (newColumns.length === 0) return;
|
|
314
322
|
if (path) {
|
|
@@ -326,14 +334,6 @@ const useTable = (params) => {
|
|
|
326
334
|
columns.value.unshift(...newColumns);
|
|
327
335
|
}
|
|
328
336
|
}
|
|
329
|
-
function appendColumn(path, column, options) {
|
|
330
|
-
const newColumns = Array.isArray(column) ? column : [column];
|
|
331
|
-
addColumns(path, newColumns, options, "after");
|
|
332
|
-
}
|
|
333
|
-
function prependColumn(path, column, options) {
|
|
334
|
-
const newColumns = Array.isArray(column) ? column : [column];
|
|
335
|
-
addColumns(path, newColumns, options, "before");
|
|
336
|
-
}
|
|
337
337
|
return {
|
|
338
338
|
columns,
|
|
339
339
|
dataSource,
|
|
@@ -348,8 +348,8 @@ const useTable = (params) => {
|
|
|
348
348
|
};
|
|
349
349
|
};
|
|
350
350
|
export {
|
|
351
|
-
|
|
352
|
-
|
|
351
|
+
InjectionPathKey as I,
|
|
352
|
+
InjectionFormKey as a,
|
|
353
353
|
useFields as b,
|
|
354
354
|
camelizeProperties as c,
|
|
355
355
|
useFormRef as d,
|