@94ai/nf-form-item 3.2.4 → 3.2.21
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/lib/index.d.ts +16 -208
- package/lib/nf-form-item.cjs.js +47 -37
- package/lib/nf-form-item.esm-bundler.js +47 -37
- package/lib/nf-form-item.vue.d.ts +8 -72
- package/package/nf-form-item.vue +52 -78
- package/package.json +3 -3
package/lib/index.d.ts
CHANGED
|
@@ -7,122 +7,18 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
7
7
|
type: BooleanConstructor;
|
|
8
8
|
default: boolean;
|
|
9
9
|
};
|
|
10
|
-
expandBtnType: {
|
|
11
|
-
type: StringConstructor;
|
|
12
|
-
default: string;
|
|
13
|
-
};
|
|
14
|
-
expandBtnIcon: {
|
|
15
|
-
type: StringConstructor;
|
|
16
|
-
default: undefined;
|
|
17
|
-
};
|
|
18
|
-
expandBtnPlain: {
|
|
19
|
-
type: BooleanConstructor;
|
|
20
|
-
default: boolean;
|
|
21
|
-
};
|
|
22
|
-
expandBtnSize: {
|
|
23
|
-
type: StringConstructor;
|
|
24
|
-
default: string;
|
|
25
|
-
};
|
|
26
|
-
expandBtnRound: {
|
|
27
|
-
type: BooleanConstructor;
|
|
28
|
-
default: boolean;
|
|
29
|
-
};
|
|
30
|
-
expandBtnCircle: {
|
|
31
|
-
type: BooleanConstructor;
|
|
32
|
-
default: boolean;
|
|
33
|
-
};
|
|
34
|
-
expandBtnLoading: {
|
|
35
|
-
type: BooleanConstructor;
|
|
36
|
-
default: boolean;
|
|
37
|
-
};
|
|
38
|
-
expandBtnDisabled: {
|
|
39
|
-
type: BooleanConstructor;
|
|
40
|
-
default: boolean;
|
|
41
|
-
};
|
|
42
10
|
}>>, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
43
11
|
hidden: {
|
|
44
12
|
type: BooleanConstructor;
|
|
45
13
|
default: boolean;
|
|
46
14
|
};
|
|
47
|
-
expandBtnType: {
|
|
48
|
-
type: StringConstructor;
|
|
49
|
-
default: string;
|
|
50
|
-
};
|
|
51
|
-
expandBtnIcon: {
|
|
52
|
-
type: StringConstructor;
|
|
53
|
-
default: undefined;
|
|
54
|
-
};
|
|
55
|
-
expandBtnPlain: {
|
|
56
|
-
type: BooleanConstructor;
|
|
57
|
-
default: boolean;
|
|
58
|
-
};
|
|
59
|
-
expandBtnSize: {
|
|
60
|
-
type: StringConstructor;
|
|
61
|
-
default: string;
|
|
62
|
-
};
|
|
63
|
-
expandBtnRound: {
|
|
64
|
-
type: BooleanConstructor;
|
|
65
|
-
default: boolean;
|
|
66
|
-
};
|
|
67
|
-
expandBtnCircle: {
|
|
68
|
-
type: BooleanConstructor;
|
|
69
|
-
default: boolean;
|
|
70
|
-
};
|
|
71
|
-
expandBtnLoading: {
|
|
72
|
-
type: BooleanConstructor;
|
|
73
|
-
default: boolean;
|
|
74
|
-
};
|
|
75
|
-
expandBtnDisabled: {
|
|
76
|
-
type: BooleanConstructor;
|
|
77
|
-
default: boolean;
|
|
78
|
-
};
|
|
79
15
|
}>>, {}, {
|
|
80
16
|
hidden: boolean;
|
|
81
|
-
expandBtnType: string;
|
|
82
|
-
expandBtnIcon: string;
|
|
83
|
-
expandBtnPlain: boolean;
|
|
84
|
-
expandBtnSize: string;
|
|
85
|
-
expandBtnRound: boolean;
|
|
86
|
-
expandBtnCircle: boolean;
|
|
87
|
-
expandBtnLoading: boolean;
|
|
88
|
-
expandBtnDisabled: boolean;
|
|
89
17
|
}, true, import("vue/types/v3-component-options").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<import("vue-demi").ExtractPropTypes<{
|
|
90
18
|
hidden: {
|
|
91
19
|
type: BooleanConstructor;
|
|
92
20
|
default: boolean;
|
|
93
21
|
};
|
|
94
|
-
expandBtnType: {
|
|
95
|
-
type: StringConstructor;
|
|
96
|
-
default: string;
|
|
97
|
-
};
|
|
98
|
-
expandBtnIcon: {
|
|
99
|
-
type: StringConstructor;
|
|
100
|
-
default: undefined;
|
|
101
|
-
};
|
|
102
|
-
expandBtnPlain: {
|
|
103
|
-
type: BooleanConstructor;
|
|
104
|
-
default: boolean;
|
|
105
|
-
};
|
|
106
|
-
expandBtnSize: {
|
|
107
|
-
type: StringConstructor;
|
|
108
|
-
default: string;
|
|
109
|
-
};
|
|
110
|
-
expandBtnRound: {
|
|
111
|
-
type: BooleanConstructor;
|
|
112
|
-
default: boolean;
|
|
113
|
-
};
|
|
114
|
-
expandBtnCircle: {
|
|
115
|
-
type: BooleanConstructor;
|
|
116
|
-
default: boolean;
|
|
117
|
-
};
|
|
118
|
-
expandBtnLoading: {
|
|
119
|
-
type: BooleanConstructor;
|
|
120
|
-
default: boolean;
|
|
121
|
-
};
|
|
122
|
-
expandBtnDisabled: {
|
|
123
|
-
type: BooleanConstructor;
|
|
124
|
-
default: boolean;
|
|
125
|
-
};
|
|
126
22
|
}>>> & import("vue-demi").ShallowUnwrapRef<{}> & {
|
|
127
23
|
isExpand: boolean;
|
|
128
24
|
initExpand: boolean;
|
|
@@ -133,6 +29,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
133
29
|
labelPosition(): any;
|
|
134
30
|
inline(): any;
|
|
135
31
|
columns(): any;
|
|
32
|
+
expandBtnType(): any;
|
|
33
|
+
expandBtnIcon(): any;
|
|
34
|
+
expandBtnPlain(): any;
|
|
35
|
+
expandBtnSize(): any;
|
|
36
|
+
expandBtnRound(): any;
|
|
37
|
+
expandBtnCircle(): any;
|
|
38
|
+
expandBtnLoading(): any;
|
|
39
|
+
expandBtnDisabled(): any;
|
|
136
40
|
showBtn(): boolean;
|
|
137
41
|
isLastItem(): boolean;
|
|
138
42
|
}> & import("vue-demi").ComponentMethodOptions & import("vue-demi").ComponentCustomProperties & Readonly<import("vue-demi").ExtractPropTypes<{
|
|
@@ -140,75 +44,11 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
140
44
|
type: BooleanConstructor;
|
|
141
45
|
default: boolean;
|
|
142
46
|
};
|
|
143
|
-
expandBtnType: {
|
|
144
|
-
type: StringConstructor;
|
|
145
|
-
default: string;
|
|
146
|
-
};
|
|
147
|
-
expandBtnIcon: {
|
|
148
|
-
type: StringConstructor;
|
|
149
|
-
default: undefined;
|
|
150
|
-
};
|
|
151
|
-
expandBtnPlain: {
|
|
152
|
-
type: BooleanConstructor;
|
|
153
|
-
default: boolean;
|
|
154
|
-
};
|
|
155
|
-
expandBtnSize: {
|
|
156
|
-
type: StringConstructor;
|
|
157
|
-
default: string;
|
|
158
|
-
};
|
|
159
|
-
expandBtnRound: {
|
|
160
|
-
type: BooleanConstructor;
|
|
161
|
-
default: boolean;
|
|
162
|
-
};
|
|
163
|
-
expandBtnCircle: {
|
|
164
|
-
type: BooleanConstructor;
|
|
165
|
-
default: boolean;
|
|
166
|
-
};
|
|
167
|
-
expandBtnLoading: {
|
|
168
|
-
type: BooleanConstructor;
|
|
169
|
-
default: boolean;
|
|
170
|
-
};
|
|
171
|
-
expandBtnDisabled: {
|
|
172
|
-
type: BooleanConstructor;
|
|
173
|
-
default: boolean;
|
|
174
|
-
};
|
|
175
47
|
}>>, any, any, any, import("vue-demi").ComponentComputedOptions, import("vue-demi").ComponentMethodOptions> & import("vue/types/v3-component-options").ComponentOptionsBase<Readonly<import("vue-demi").ExtractPropTypes<{
|
|
176
48
|
hidden: {
|
|
177
49
|
type: BooleanConstructor;
|
|
178
50
|
default: boolean;
|
|
179
51
|
};
|
|
180
|
-
expandBtnType: {
|
|
181
|
-
type: StringConstructor;
|
|
182
|
-
default: string;
|
|
183
|
-
};
|
|
184
|
-
expandBtnIcon: {
|
|
185
|
-
type: StringConstructor;
|
|
186
|
-
default: undefined;
|
|
187
|
-
};
|
|
188
|
-
expandBtnPlain: {
|
|
189
|
-
type: BooleanConstructor;
|
|
190
|
-
default: boolean;
|
|
191
|
-
};
|
|
192
|
-
expandBtnSize: {
|
|
193
|
-
type: StringConstructor;
|
|
194
|
-
default: string;
|
|
195
|
-
};
|
|
196
|
-
expandBtnRound: {
|
|
197
|
-
type: BooleanConstructor;
|
|
198
|
-
default: boolean;
|
|
199
|
-
};
|
|
200
|
-
expandBtnCircle: {
|
|
201
|
-
type: BooleanConstructor;
|
|
202
|
-
default: boolean;
|
|
203
|
-
};
|
|
204
|
-
expandBtnLoading: {
|
|
205
|
-
type: BooleanConstructor;
|
|
206
|
-
default: boolean;
|
|
207
|
-
};
|
|
208
|
-
expandBtnDisabled: {
|
|
209
|
-
type: BooleanConstructor;
|
|
210
|
-
default: boolean;
|
|
211
|
-
};
|
|
212
52
|
}>>, {}, {
|
|
213
53
|
isExpand: boolean;
|
|
214
54
|
initExpand: boolean;
|
|
@@ -219,56 +59,24 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
219
59
|
labelPosition(): any;
|
|
220
60
|
inline(): any;
|
|
221
61
|
columns(): any;
|
|
62
|
+
expandBtnType(): any;
|
|
63
|
+
expandBtnIcon(): any;
|
|
64
|
+
expandBtnPlain(): any;
|
|
65
|
+
expandBtnSize(): any;
|
|
66
|
+
expandBtnRound(): any;
|
|
67
|
+
expandBtnCircle(): any;
|
|
68
|
+
expandBtnLoading(): any;
|
|
69
|
+
expandBtnDisabled(): any;
|
|
222
70
|
showBtn(): boolean;
|
|
223
71
|
isLastItem(): boolean;
|
|
224
72
|
}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, typeof import("element-ui").FormItem, {}, string, {
|
|
225
73
|
hidden: boolean;
|
|
226
|
-
expandBtnType: string;
|
|
227
|
-
expandBtnIcon: string;
|
|
228
|
-
expandBtnPlain: boolean;
|
|
229
|
-
expandBtnSize: string;
|
|
230
|
-
expandBtnRound: boolean;
|
|
231
|
-
expandBtnCircle: boolean;
|
|
232
|
-
expandBtnLoading: boolean;
|
|
233
|
-
expandBtnDisabled: boolean;
|
|
234
74
|
}> & {
|
|
235
75
|
props: {
|
|
236
76
|
hidden: {
|
|
237
77
|
type: BooleanConstructor;
|
|
238
78
|
default: boolean;
|
|
239
79
|
};
|
|
240
|
-
expandBtnType: {
|
|
241
|
-
type: StringConstructor;
|
|
242
|
-
default: string;
|
|
243
|
-
};
|
|
244
|
-
expandBtnIcon: {
|
|
245
|
-
type: StringConstructor;
|
|
246
|
-
default: undefined;
|
|
247
|
-
};
|
|
248
|
-
expandBtnPlain: {
|
|
249
|
-
type: BooleanConstructor;
|
|
250
|
-
default: boolean;
|
|
251
|
-
};
|
|
252
|
-
expandBtnSize: {
|
|
253
|
-
type: StringConstructor;
|
|
254
|
-
default: string;
|
|
255
|
-
};
|
|
256
|
-
expandBtnRound: {
|
|
257
|
-
type: BooleanConstructor;
|
|
258
|
-
default: boolean;
|
|
259
|
-
};
|
|
260
|
-
expandBtnCircle: {
|
|
261
|
-
type: BooleanConstructor;
|
|
262
|
-
default: boolean;
|
|
263
|
-
};
|
|
264
|
-
expandBtnLoading: {
|
|
265
|
-
type: BooleanConstructor;
|
|
266
|
-
default: boolean;
|
|
267
|
-
};
|
|
268
|
-
expandBtnDisabled: {
|
|
269
|
-
type: BooleanConstructor;
|
|
270
|
-
default: boolean;
|
|
271
|
-
};
|
|
272
80
|
};
|
|
273
81
|
} & PluginObject<undefined>;
|
|
274
82
|
export default _default;
|
package/lib/nf-form-item.cjs.js
CHANGED
|
@@ -10,38 +10,6 @@ const _sfc_main = vueDemi.defineComponent({
|
|
|
10
10
|
hidden: {
|
|
11
11
|
type: Boolean,
|
|
12
12
|
default: false
|
|
13
|
-
},
|
|
14
|
-
expandBtnType: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: "default"
|
|
17
|
-
},
|
|
18
|
-
expandBtnIcon: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: void 0
|
|
21
|
-
},
|
|
22
|
-
expandBtnPlain: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: false
|
|
25
|
-
},
|
|
26
|
-
expandBtnSize: {
|
|
27
|
-
type: String,
|
|
28
|
-
default: "mini"
|
|
29
|
-
},
|
|
30
|
-
expandBtnRound: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: false
|
|
33
|
-
},
|
|
34
|
-
expandBtnCircle: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: false
|
|
37
|
-
},
|
|
38
|
-
expandBtnLoading: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
default: false
|
|
41
|
-
},
|
|
42
|
-
expandBtnDisabled: {
|
|
43
|
-
type: Boolean,
|
|
44
|
-
default: false
|
|
45
13
|
}
|
|
46
14
|
},
|
|
47
15
|
data() {
|
|
@@ -111,6 +79,38 @@ const _sfc_main = vueDemi.defineComponent({
|
|
|
111
79
|
var _a;
|
|
112
80
|
return (_a = this.form) == null ? void 0 : _a.columns;
|
|
113
81
|
},
|
|
82
|
+
expandBtnType() {
|
|
83
|
+
var _a;
|
|
84
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnType;
|
|
85
|
+
},
|
|
86
|
+
expandBtnIcon() {
|
|
87
|
+
var _a;
|
|
88
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnIcon;
|
|
89
|
+
},
|
|
90
|
+
expandBtnPlain() {
|
|
91
|
+
var _a;
|
|
92
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnPlain;
|
|
93
|
+
},
|
|
94
|
+
expandBtnSize() {
|
|
95
|
+
var _a;
|
|
96
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnSize;
|
|
97
|
+
},
|
|
98
|
+
expandBtnRound() {
|
|
99
|
+
var _a;
|
|
100
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnRound;
|
|
101
|
+
},
|
|
102
|
+
expandBtnCircle() {
|
|
103
|
+
var _a;
|
|
104
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnCircle;
|
|
105
|
+
},
|
|
106
|
+
expandBtnLoading() {
|
|
107
|
+
var _a;
|
|
108
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnLoading;
|
|
109
|
+
},
|
|
110
|
+
expandBtnDisabled() {
|
|
111
|
+
var _a;
|
|
112
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnDisabled;
|
|
113
|
+
},
|
|
114
114
|
showBtn() {
|
|
115
115
|
var _a, _b;
|
|
116
116
|
if (this.hidden)
|
|
@@ -144,8 +144,15 @@ const _sfc_main = vueDemi.defineComponent({
|
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
146
|
// 切换显示模式
|
|
147
|
-
switchMode() {
|
|
147
|
+
switchMode(e) {
|
|
148
148
|
var _a;
|
|
149
|
+
let target = event.target;
|
|
150
|
+
if (target.nodeName == "SPAN") {
|
|
151
|
+
target = event.target.parentNode;
|
|
152
|
+
} else if (target.nodeName == "I") {
|
|
153
|
+
target = event.target.parentNode.parentNode;
|
|
154
|
+
}
|
|
155
|
+
target.blur();
|
|
149
156
|
this.isExpand = !this.isExpand;
|
|
150
157
|
(_a = this.form) == null ? void 0 : _a.$emit("isCollapseChange", this.isExpand);
|
|
151
158
|
this.refreshButtonList();
|
|
@@ -185,6 +192,11 @@ var _sfc_render = function render() {
|
|
|
185
192
|
staticClass: "nf-flex"
|
|
186
193
|
}, [_vm._t("default"), _vm.showBtn ? _c("div", {
|
|
187
194
|
staticClass: "nf-ml10"
|
|
195
|
+
}, [_c("el-tooltip", {
|
|
196
|
+
attrs: {
|
|
197
|
+
"content": _vm.isExpand ? "收起" : "展开",
|
|
198
|
+
"placement": "top"
|
|
199
|
+
}
|
|
188
200
|
}, [_c("el-button", {
|
|
189
201
|
staticClass: "nf-pointer",
|
|
190
202
|
attrs: {
|
|
@@ -198,14 +210,12 @@ var _sfc_render = function render() {
|
|
|
198
210
|
"disabled": _vm.expandBtnDisabled
|
|
199
211
|
},
|
|
200
212
|
on: {
|
|
201
|
-
"click":
|
|
202
|
-
return _vm.switchMode();
|
|
203
|
-
}
|
|
213
|
+
"click": _vm.switchMode
|
|
204
214
|
}
|
|
205
215
|
}, [_c("i", {
|
|
206
216
|
staticClass: "iconfont nf-fs12",
|
|
207
217
|
class: _vm.isExpand ? _vm.upIcon : _vm.downIcon
|
|
208
|
-
})])], 1) : _vm._e()], 2) : _vm._t("default"), _c("transition", {
|
|
218
|
+
})])], 1)], 1) : _vm._e()], 2) : _vm._t("default"), _c("transition", {
|
|
209
219
|
attrs: {
|
|
210
220
|
"name": "el-zoom-in-top"
|
|
211
221
|
}
|
|
@@ -8,38 +8,6 @@ const _sfc_main = defineComponent({
|
|
|
8
8
|
hidden: {
|
|
9
9
|
type: Boolean,
|
|
10
10
|
default: false
|
|
11
|
-
},
|
|
12
|
-
expandBtnType: {
|
|
13
|
-
type: String,
|
|
14
|
-
default: "default"
|
|
15
|
-
},
|
|
16
|
-
expandBtnIcon: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: void 0
|
|
19
|
-
},
|
|
20
|
-
expandBtnPlain: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: false
|
|
23
|
-
},
|
|
24
|
-
expandBtnSize: {
|
|
25
|
-
type: String,
|
|
26
|
-
default: "mini"
|
|
27
|
-
},
|
|
28
|
-
expandBtnRound: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: false
|
|
31
|
-
},
|
|
32
|
-
expandBtnCircle: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: false
|
|
35
|
-
},
|
|
36
|
-
expandBtnLoading: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
default: false
|
|
39
|
-
},
|
|
40
|
-
expandBtnDisabled: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: false
|
|
43
11
|
}
|
|
44
12
|
},
|
|
45
13
|
data() {
|
|
@@ -109,6 +77,38 @@ const _sfc_main = defineComponent({
|
|
|
109
77
|
var _a;
|
|
110
78
|
return (_a = this.form) == null ? void 0 : _a.columns;
|
|
111
79
|
},
|
|
80
|
+
expandBtnType() {
|
|
81
|
+
var _a;
|
|
82
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnType;
|
|
83
|
+
},
|
|
84
|
+
expandBtnIcon() {
|
|
85
|
+
var _a;
|
|
86
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnIcon;
|
|
87
|
+
},
|
|
88
|
+
expandBtnPlain() {
|
|
89
|
+
var _a;
|
|
90
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnPlain;
|
|
91
|
+
},
|
|
92
|
+
expandBtnSize() {
|
|
93
|
+
var _a;
|
|
94
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnSize;
|
|
95
|
+
},
|
|
96
|
+
expandBtnRound() {
|
|
97
|
+
var _a;
|
|
98
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnRound;
|
|
99
|
+
},
|
|
100
|
+
expandBtnCircle() {
|
|
101
|
+
var _a;
|
|
102
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnCircle;
|
|
103
|
+
},
|
|
104
|
+
expandBtnLoading() {
|
|
105
|
+
var _a;
|
|
106
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnLoading;
|
|
107
|
+
},
|
|
108
|
+
expandBtnDisabled() {
|
|
109
|
+
var _a;
|
|
110
|
+
return (_a = this.form) == null ? void 0 : _a.expandBtnDisabled;
|
|
111
|
+
},
|
|
112
112
|
showBtn() {
|
|
113
113
|
var _a, _b;
|
|
114
114
|
if (this.hidden)
|
|
@@ -142,8 +142,15 @@ const _sfc_main = defineComponent({
|
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
144
|
// 切换显示模式
|
|
145
|
-
switchMode() {
|
|
145
|
+
switchMode(e) {
|
|
146
146
|
var _a;
|
|
147
|
+
let target = event.target;
|
|
148
|
+
if (target.nodeName == "SPAN") {
|
|
149
|
+
target = event.target.parentNode;
|
|
150
|
+
} else if (target.nodeName == "I") {
|
|
151
|
+
target = event.target.parentNode.parentNode;
|
|
152
|
+
}
|
|
153
|
+
target.blur();
|
|
147
154
|
this.isExpand = !this.isExpand;
|
|
148
155
|
(_a = this.form) == null ? void 0 : _a.$emit("isCollapseChange", this.isExpand);
|
|
149
156
|
this.refreshButtonList();
|
|
@@ -183,6 +190,11 @@ var _sfc_render = function render() {
|
|
|
183
190
|
staticClass: "nf-flex"
|
|
184
191
|
}, [_vm._t("default"), _vm.showBtn ? _c("div", {
|
|
185
192
|
staticClass: "nf-ml10"
|
|
193
|
+
}, [_c("el-tooltip", {
|
|
194
|
+
attrs: {
|
|
195
|
+
"content": _vm.isExpand ? "收起" : "展开",
|
|
196
|
+
"placement": "top"
|
|
197
|
+
}
|
|
186
198
|
}, [_c("el-button", {
|
|
187
199
|
staticClass: "nf-pointer",
|
|
188
200
|
attrs: {
|
|
@@ -196,14 +208,12 @@ var _sfc_render = function render() {
|
|
|
196
208
|
"disabled": _vm.expandBtnDisabled
|
|
197
209
|
},
|
|
198
210
|
on: {
|
|
199
|
-
"click":
|
|
200
|
-
return _vm.switchMode();
|
|
201
|
-
}
|
|
211
|
+
"click": _vm.switchMode
|
|
202
212
|
}
|
|
203
213
|
}, [_c("i", {
|
|
204
214
|
staticClass: "iconfont nf-fs12",
|
|
205
215
|
class: _vm.isExpand ? _vm.upIcon : _vm.downIcon
|
|
206
|
-
})])], 1) : _vm._e()], 2) : _vm._t("default"), _c("transition", {
|
|
216
|
+
})])], 1)], 1) : _vm._e()], 2) : _vm._t("default"), _c("transition", {
|
|
207
217
|
attrs: {
|
|
208
218
|
"name": "el-zoom-in-top"
|
|
209
219
|
}
|
|
@@ -4,38 +4,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
4
4
|
type: BooleanConstructor;
|
|
5
5
|
default: boolean;
|
|
6
6
|
};
|
|
7
|
-
expandBtnType: {
|
|
8
|
-
type: StringConstructor;
|
|
9
|
-
default: string;
|
|
10
|
-
};
|
|
11
|
-
expandBtnIcon: {
|
|
12
|
-
type: StringConstructor;
|
|
13
|
-
default: undefined;
|
|
14
|
-
};
|
|
15
|
-
expandBtnPlain: {
|
|
16
|
-
type: BooleanConstructor;
|
|
17
|
-
default: boolean;
|
|
18
|
-
};
|
|
19
|
-
expandBtnSize: {
|
|
20
|
-
type: StringConstructor;
|
|
21
|
-
default: string;
|
|
22
|
-
};
|
|
23
|
-
expandBtnRound: {
|
|
24
|
-
type: BooleanConstructor;
|
|
25
|
-
default: boolean;
|
|
26
|
-
};
|
|
27
|
-
expandBtnCircle: {
|
|
28
|
-
type: BooleanConstructor;
|
|
29
|
-
default: boolean;
|
|
30
|
-
};
|
|
31
|
-
expandBtnLoading: {
|
|
32
|
-
type: BooleanConstructor;
|
|
33
|
-
default: boolean;
|
|
34
|
-
};
|
|
35
|
-
expandBtnDisabled: {
|
|
36
|
-
type: BooleanConstructor;
|
|
37
|
-
default: boolean;
|
|
38
|
-
};
|
|
39
7
|
}, {}, {
|
|
40
8
|
isExpand: boolean;
|
|
41
9
|
initExpand: boolean;
|
|
@@ -46,6 +14,14 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
46
14
|
labelPosition(): any;
|
|
47
15
|
inline(): any;
|
|
48
16
|
columns(): any;
|
|
17
|
+
expandBtnType(): any;
|
|
18
|
+
expandBtnIcon(): any;
|
|
19
|
+
expandBtnPlain(): any;
|
|
20
|
+
expandBtnSize(): any;
|
|
21
|
+
expandBtnRound(): any;
|
|
22
|
+
expandBtnCircle(): any;
|
|
23
|
+
expandBtnLoading(): any;
|
|
24
|
+
expandBtnDisabled(): any;
|
|
49
25
|
showBtn(): boolean;
|
|
50
26
|
isLastItem(): boolean;
|
|
51
27
|
}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, typeof FormItem, {}, string, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
@@ -53,47 +29,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
53
29
|
type: BooleanConstructor;
|
|
54
30
|
default: boolean;
|
|
55
31
|
};
|
|
56
|
-
expandBtnType: {
|
|
57
|
-
type: StringConstructor;
|
|
58
|
-
default: string;
|
|
59
|
-
};
|
|
60
|
-
expandBtnIcon: {
|
|
61
|
-
type: StringConstructor;
|
|
62
|
-
default: undefined;
|
|
63
|
-
};
|
|
64
|
-
expandBtnPlain: {
|
|
65
|
-
type: BooleanConstructor;
|
|
66
|
-
default: boolean;
|
|
67
|
-
};
|
|
68
|
-
expandBtnSize: {
|
|
69
|
-
type: StringConstructor;
|
|
70
|
-
default: string;
|
|
71
|
-
};
|
|
72
|
-
expandBtnRound: {
|
|
73
|
-
type: BooleanConstructor;
|
|
74
|
-
default: boolean;
|
|
75
|
-
};
|
|
76
|
-
expandBtnCircle: {
|
|
77
|
-
type: BooleanConstructor;
|
|
78
|
-
default: boolean;
|
|
79
|
-
};
|
|
80
|
-
expandBtnLoading: {
|
|
81
|
-
type: BooleanConstructor;
|
|
82
|
-
default: boolean;
|
|
83
|
-
};
|
|
84
|
-
expandBtnDisabled: {
|
|
85
|
-
type: BooleanConstructor;
|
|
86
|
-
default: boolean;
|
|
87
|
-
};
|
|
88
32
|
}>>, {
|
|
89
33
|
hidden: boolean;
|
|
90
|
-
expandBtnType: string;
|
|
91
|
-
expandBtnIcon: string;
|
|
92
|
-
expandBtnPlain: boolean;
|
|
93
|
-
expandBtnSize: string;
|
|
94
|
-
expandBtnRound: boolean;
|
|
95
|
-
expandBtnCircle: boolean;
|
|
96
|
-
expandBtnLoading: boolean;
|
|
97
|
-
expandBtnDisabled: boolean;
|
|
98
34
|
}>;
|
|
99
35
|
export default _default;
|
package/package/nf-form-item.vue
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
<template>
|
|
2
3
|
<div
|
|
3
4
|
class="el-form-item nf-form-item"
|
|
@@ -24,20 +25,22 @@
|
|
|
24
25
|
<div v-if="isLastItem" class="nf-flex">
|
|
25
26
|
<slot />
|
|
26
27
|
<div v-if="showBtn" class="nf-ml10">
|
|
27
|
-
<el-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
<el-tooltip :content="isExpand ? '收起' : '展开'" placement="top">
|
|
29
|
+
<el-button
|
|
30
|
+
class="nf-pointer"
|
|
31
|
+
@click="switchMode"
|
|
32
|
+
:type="expandBtnType"
|
|
33
|
+
:icon="expandBtnIcon"
|
|
34
|
+
:plain="expandBtnPlain"
|
|
35
|
+
:size="expandBtnSize"
|
|
36
|
+
:round="expandBtnRound"
|
|
37
|
+
:circle="expandBtnCircle"
|
|
38
|
+
:loading="expandBtnLoading"
|
|
39
|
+
:disabled="expandBtnDisabled"
|
|
40
|
+
>
|
|
41
|
+
<i class="iconfont nf-fs12" :class="isExpand ? upIcon : downIcon" />
|
|
42
|
+
</el-button>
|
|
43
|
+
</el-tooltip>
|
|
41
44
|
</div>
|
|
42
45
|
</div>
|
|
43
46
|
<slot v-else />
|
|
@@ -64,9 +67,11 @@
|
|
|
64
67
|
</template>
|
|
65
68
|
|
|
66
69
|
<script lang="ts">
|
|
70
|
+
// @ts-nocheck
|
|
67
71
|
import { defineComponent, nextTick } from 'vue-demi'
|
|
68
72
|
import { FormItem } from 'element-ui'
|
|
69
73
|
|
|
74
|
+
|
|
70
75
|
export default defineComponent({
|
|
71
76
|
name: 'NfFormItem',
|
|
72
77
|
extends: FormItem,
|
|
@@ -75,38 +80,6 @@ export default defineComponent({
|
|
|
75
80
|
type: Boolean,
|
|
76
81
|
default: false
|
|
77
82
|
},
|
|
78
|
-
expandBtnType: {
|
|
79
|
-
type: String,
|
|
80
|
-
default: 'default'
|
|
81
|
-
},
|
|
82
|
-
expandBtnIcon: {
|
|
83
|
-
type: String,
|
|
84
|
-
default: undefined
|
|
85
|
-
},
|
|
86
|
-
expandBtnPlain: {
|
|
87
|
-
type: Boolean,
|
|
88
|
-
default: false
|
|
89
|
-
},
|
|
90
|
-
expandBtnSize: {
|
|
91
|
-
type: String,
|
|
92
|
-
default: 'mini'
|
|
93
|
-
},
|
|
94
|
-
expandBtnRound: {
|
|
95
|
-
type: Boolean,
|
|
96
|
-
default: false
|
|
97
|
-
},
|
|
98
|
-
expandBtnCircle: {
|
|
99
|
-
type: Boolean,
|
|
100
|
-
default: false
|
|
101
|
-
},
|
|
102
|
-
expandBtnLoading: {
|
|
103
|
-
type: Boolean,
|
|
104
|
-
default: false
|
|
105
|
-
},
|
|
106
|
-
expandBtnDisabled: {
|
|
107
|
-
type: Boolean,
|
|
108
|
-
default: false
|
|
109
|
-
},
|
|
110
83
|
},
|
|
111
84
|
data() {
|
|
112
85
|
return {
|
|
@@ -116,111 +89,107 @@ export default defineComponent({
|
|
|
116
89
|
},
|
|
117
90
|
watch: {
|
|
118
91
|
labelPosition() {
|
|
119
|
-
// @ts-ignore
|
|
120
92
|
this.refreshButtonList()
|
|
121
93
|
},
|
|
122
94
|
columns() {
|
|
123
|
-
// @ts-ignore
|
|
124
95
|
this.refreshButtonList()
|
|
125
96
|
},
|
|
126
97
|
inline() {
|
|
127
|
-
// @ts-ignore
|
|
128
98
|
this.refreshButtonList()
|
|
129
99
|
},
|
|
130
100
|
isCollapse() {
|
|
131
|
-
// @ts-ignore
|
|
132
101
|
this.isExpand = !this.form?.isCollapse
|
|
133
|
-
// @ts-ignore
|
|
134
102
|
if (this.initExpand) {
|
|
135
|
-
// @ts-ignore
|
|
136
103
|
this.switchMode()
|
|
137
104
|
}
|
|
138
105
|
},
|
|
139
106
|
},
|
|
140
107
|
mounted() {
|
|
141
|
-
// @ts-ignore
|
|
142
108
|
if (this.form?.init) {
|
|
143
|
-
// @ts-ignore
|
|
144
109
|
this.form?.getFormItems()
|
|
145
110
|
}
|
|
146
111
|
nextTick(() => {
|
|
147
112
|
if (!this.initExpand) {
|
|
148
|
-
// @ts-ignore
|
|
149
113
|
this.isExpand = !this.form?.isCollapse
|
|
150
114
|
if (!this.isExpand) {
|
|
151
|
-
// @ts-ignore
|
|
152
115
|
this.refreshButtonList()
|
|
153
116
|
}
|
|
154
117
|
this.initExpand = true
|
|
155
118
|
} else {
|
|
156
|
-
// @ts-ignore
|
|
157
119
|
this.refreshButtonList()
|
|
158
120
|
}
|
|
159
121
|
})
|
|
160
122
|
},
|
|
161
123
|
computed: {
|
|
162
124
|
downIcon() {
|
|
163
|
-
// @ts-ignore
|
|
164
125
|
return this.form?.downIcon
|
|
165
126
|
},
|
|
166
127
|
upIcon() {
|
|
167
|
-
// @ts-ignore
|
|
168
128
|
return this.form?.upIcon
|
|
169
129
|
},
|
|
170
130
|
isCollapse() {
|
|
171
|
-
// @ts-ignore
|
|
172
131
|
return this.form?.isCollapse
|
|
173
132
|
},
|
|
174
133
|
labelPosition() {
|
|
175
|
-
// @ts-ignore
|
|
176
134
|
return this.form?.labelPosition
|
|
177
135
|
},
|
|
178
136
|
inline() {
|
|
179
|
-
// @ts-ignore
|
|
180
137
|
return this.form?.inline
|
|
181
138
|
},
|
|
182
139
|
columns() {
|
|
183
|
-
// @ts-ignore
|
|
184
140
|
return this.form?.columns
|
|
185
141
|
},
|
|
142
|
+
expandBtnType() {
|
|
143
|
+
return this.form?.expandBtnType
|
|
144
|
+
},
|
|
145
|
+
expandBtnIcon() {
|
|
146
|
+
return this.form?.expandBtnIcon
|
|
147
|
+
},
|
|
148
|
+
expandBtnPlain() {
|
|
149
|
+
return this.form?.expandBtnPlain
|
|
150
|
+
},
|
|
151
|
+
expandBtnSize() {
|
|
152
|
+
return this.form?.expandBtnSize
|
|
153
|
+
},
|
|
154
|
+
expandBtnRound() {
|
|
155
|
+
return this.form?.expandBtnRound
|
|
156
|
+
},
|
|
157
|
+
expandBtnCircle() {
|
|
158
|
+
return this.form?.expandBtnCircle
|
|
159
|
+
},
|
|
160
|
+
expandBtnLoading() {
|
|
161
|
+
return this.form?.expandBtnLoading
|
|
162
|
+
},
|
|
163
|
+
expandBtnDisabled() {
|
|
164
|
+
return this.form?.expandBtnDisabled
|
|
165
|
+
},
|
|
186
166
|
showBtn() {
|
|
187
167
|
if (this.hidden) return false
|
|
188
|
-
// @ts-ignore
|
|
189
168
|
if (!this.form?.showBtn) return false
|
|
190
|
-
// @ts-ignore
|
|
191
169
|
return this.form?.formItems.length > this.columns
|
|
192
170
|
},
|
|
193
171
|
isLastItem() {
|
|
194
|
-
// @ts-ignore
|
|
195
172
|
if (!this.showBtn) return false
|
|
196
173
|
// const uIds = []
|
|
197
|
-
// // @ts-ignore
|
|
198
174
|
// this.form?.formItems.forEach(item => {
|
|
199
|
-
// // @ts-ignore
|
|
200
175
|
// uIds.push(item._uid)
|
|
201
176
|
// })
|
|
202
177
|
// // 取最大值
|
|
203
178
|
// const max = Math.max(...uIds)
|
|
204
179
|
// return this._uid === max
|
|
205
|
-
// @ts-ignore
|
|
206
180
|
const items = this.form?.formItems
|
|
207
181
|
return this._uid === items?.[items?.length - 1]?._uid
|
|
208
182
|
},
|
|
209
183
|
},
|
|
210
184
|
methods: {
|
|
211
185
|
refreshButtonList() {
|
|
212
|
-
// @ts-ignore
|
|
213
186
|
if (this.form?.showBtn) {
|
|
214
|
-
// @ts-ignore
|
|
215
187
|
this.form?.formItems.forEach((item, index) => {
|
|
216
188
|
const idx = index + 1
|
|
217
189
|
// getComputedStyle(item.$el).display
|
|
218
|
-
// @ts-ignore
|
|
219
190
|
item.$el.style.display = this.form?.inline ? 'inline-block' : 'block'
|
|
220
|
-
// @ts-ignore
|
|
221
191
|
if (idx > this.columns - 1 && idx < this.form?.formItems.length) {
|
|
222
192
|
if (!this.isExpand) {
|
|
223
|
-
// @ts-ignore
|
|
224
193
|
item.$el.style.display = 'none'
|
|
225
194
|
}
|
|
226
195
|
}
|
|
@@ -228,12 +197,17 @@ export default defineComponent({
|
|
|
228
197
|
}
|
|
229
198
|
},
|
|
230
199
|
// 切换显示模式
|
|
231
|
-
switchMode() {
|
|
232
|
-
|
|
200
|
+
switchMode(e) {
|
|
201
|
+
let target = event.target
|
|
202
|
+
// 点击的是i、span、button中的哪一个
|
|
203
|
+
if (target.nodeName == 'SPAN') {
|
|
204
|
+
target = event.target.parentNode
|
|
205
|
+
} else if (target.nodeName == 'I') {
|
|
206
|
+
target = event.target.parentNode.parentNode
|
|
207
|
+
}
|
|
208
|
+
target.blur()
|
|
233
209
|
this.isExpand = !this.isExpand
|
|
234
|
-
// @ts-ignore
|
|
235
210
|
this.form?.$emit('isCollapseChange', this.isExpand)
|
|
236
|
-
// @ts-ignore
|
|
237
211
|
this.refreshButtonList()
|
|
238
212
|
},
|
|
239
213
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@94ai/nf-form-item",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.21",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "zoujiahe <zoujiahe@94ai.com>",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@94ai/nf-theme-chalk": "^3.2.
|
|
17
|
+
"@94ai/nf-theme-chalk": "^3.2.21",
|
|
18
18
|
"vue-demi": "^0.14.5"
|
|
19
19
|
},
|
|
20
20
|
"peerDependenciesMeta": {
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"types": "lib/index.d.ts",
|
|
31
31
|
"main": "lib/nf-form-item.cjs.js",
|
|
32
32
|
"module": "lib/nf-form-item.esm-bundler.js",
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "8da3362ffe37c1c3114c8bca6c0fe24ac21c0c78"
|
|
34
34
|
}
|