@94ai/nf-form-item 6.1.1 → 6.1.7

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 CHANGED
@@ -23,13 +23,23 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
23
23
  isExpand: boolean;
24
24
  initExpand: boolean;
25
25
  } & import("vue/types/v3-component-options").ExtractComputedReturns<import("vue-demi").ComponentComputedOptions & {
26
- unpackDesc(): any;
27
- unpackIcon(): any;
26
+ expandBtnTooltipDesc(): any;
27
+ shrinkBtnTooltipDesc(): any;
28
+ downIcon(): any;
29
+ upIcon(): any;
28
30
  isCollapse(): any;
29
31
  labelPosition(): any;
30
32
  inline(): any;
31
33
  columns(): any;
32
- showBtn(): any;
34
+ expandBtnType(): any;
35
+ expandBtnIcon(): any;
36
+ expandBtnPlain(): any;
37
+ expandBtnSize(): any;
38
+ expandBtnRound(): any;
39
+ expandBtnCircle(): any;
40
+ expandBtnLoading(): any;
41
+ expandBtnDisabled(): any;
42
+ showBtn(): boolean;
33
43
  isLastItem(): any;
34
44
  }> & import("vue-demi").ComponentMethodOptions & import("vue-demi").ComponentCustomProperties & Readonly<import("vue-demi").ExtractPropTypes<{
35
45
  hidden: {
@@ -45,13 +55,23 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
45
55
  isExpand: boolean;
46
56
  initExpand: boolean;
47
57
  }, {
48
- unpackDesc(): any;
49
- unpackIcon(): any;
58
+ expandBtnTooltipDesc(): any;
59
+ shrinkBtnTooltipDesc(): any;
60
+ downIcon(): any;
61
+ upIcon(): any;
50
62
  isCollapse(): any;
51
63
  labelPosition(): any;
52
64
  inline(): any;
53
65
  columns(): any;
54
- showBtn(): any;
66
+ expandBtnType(): any;
67
+ expandBtnIcon(): any;
68
+ expandBtnPlain(): any;
69
+ expandBtnSize(): any;
70
+ expandBtnRound(): any;
71
+ expandBtnCircle(): any;
72
+ expandBtnLoading(): any;
73
+ expandBtnDisabled(): any;
74
+ showBtn(): boolean;
55
75
  isLastItem(): any;
56
76
  }, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, typeof import("element-ui").FormItem, {}, string, {
57
77
  hidden: boolean;
@@ -55,17 +55,21 @@ const _sfc_main = vueDemi.defineComponent({
55
55
  });
56
56
  },
57
57
  computed: {
58
- // 展开收起文案
59
- unpackDesc() {
60
- if (!this.form)
61
- return "";
62
- return this.isExpand ? this.form.shrinkBtnTooltipDesc : this.form.expandBtnTooltipDesc;
63
- },
64
- // 展开收起icon
65
- unpackIcon() {
66
- if (!this.form)
67
- return null;
68
- return this.isExpand ? this.form.upIcon : this.form.downIcon;
58
+ expandBtnTooltipDesc() {
59
+ var _a;
60
+ return (_a = this.form) == null ? void 0 : _a.expandBtnTooltipDesc;
61
+ },
62
+ shrinkBtnTooltipDesc() {
63
+ var _a;
64
+ return (_a = this.form) == null ? void 0 : _a.shrinkBtnTooltipDesc;
65
+ },
66
+ downIcon() {
67
+ var _a;
68
+ return (_a = this.form) == null ? void 0 : _a.downIcon;
69
+ },
70
+ upIcon() {
71
+ var _a;
72
+ return (_a = this.form) == null ? void 0 : _a.upIcon;
69
73
  },
70
74
  isCollapse() {
71
75
  var _a;
@@ -83,6 +87,38 @@ const _sfc_main = vueDemi.defineComponent({
83
87
  var _a;
84
88
  return (_a = this.form) == null ? void 0 : _a.columns;
85
89
  },
90
+ expandBtnType() {
91
+ var _a;
92
+ return (_a = this.form) == null ? void 0 : _a.expandBtnType;
93
+ },
94
+ expandBtnIcon() {
95
+ var _a;
96
+ return (_a = this.form) == null ? void 0 : _a.expandBtnIcon;
97
+ },
98
+ expandBtnPlain() {
99
+ var _a;
100
+ return (_a = this.form) == null ? void 0 : _a.expandBtnPlain;
101
+ },
102
+ expandBtnSize() {
103
+ var _a;
104
+ return (_a = this.form) == null ? void 0 : _a.expandBtnSize;
105
+ },
106
+ expandBtnRound() {
107
+ var _a;
108
+ return (_a = this.form) == null ? void 0 : _a.expandBtnRound;
109
+ },
110
+ expandBtnCircle() {
111
+ var _a;
112
+ return (_a = this.form) == null ? void 0 : _a.expandBtnCircle;
113
+ },
114
+ expandBtnLoading() {
115
+ var _a;
116
+ return (_a = this.form) == null ? void 0 : _a.expandBtnLoading;
117
+ },
118
+ expandBtnDisabled() {
119
+ var _a;
120
+ return (_a = this.form) == null ? void 0 : _a.expandBtnDisabled;
121
+ },
86
122
  showBtn() {
87
123
  var _a, _b;
88
124
  if (this.hidden)
@@ -132,7 +168,6 @@ const _sfc_main = vueDemi.defineComponent({
132
168
  }
133
169
  });
134
170
  var _sfc_render = function render() {
135
- var _a, _b, _c2, _d, _e, _f, _g, _h, _i;
136
171
  var _vm = this, _c = _vm._self._c;
137
172
  _vm._self._setupProxy;
138
173
  return _c("div", {
@@ -147,7 +182,7 @@ var _sfc_render = function render() {
147
182
  }, _vm.sizeClass ? "el-form-item--" + _vm.sizeClass : ""]
148
183
  }, [_c("label-wrap", {
149
184
  attrs: {
150
- "is-auto-width": ((_a = _vm.labelStyle) == null ? void 0 : _a.width) === "auto",
185
+ "is-auto-width": _vm.labelStyle && _vm.labelStyle.width === "auto",
151
186
  "update-all": _vm.form.labelWidth === "auto"
152
187
  }
153
188
  }, [_vm.label || _vm.$slots.label ? _c("label", {
@@ -167,27 +202,27 @@ var _sfc_render = function render() {
167
202
  staticClass: "nf-ml10"
168
203
  }, [_c("el-tooltip", {
169
204
  attrs: {
170
- "content": _vm.unpackDesc,
205
+ "content": _vm.isExpand ? _vm.shrinkBtnTooltipDesc : _vm.expandBtnTooltipDesc,
171
206
  "placement": "top"
172
207
  }
173
208
  }, [_c("nf-button", {
174
209
  staticClass: "nf-pointer",
175
210
  attrs: {
176
- "type": (_b = _vm.form) == null ? void 0 : _b.expandBtnType,
177
- "icon": (_c2 = _vm.form) == null ? void 0 : _c2.expandBtnIcon,
178
- "plain": (_d = _vm.form) == null ? void 0 : _d.expandBtnPlain,
179
- "size": (_e = _vm.form) == null ? void 0 : _e.expandBtnSize,
180
- "round": (_f = _vm.form) == null ? void 0 : _f.expandBtnRound,
181
- "circle": (_g = _vm.form) == null ? void 0 : _g.expandBtnCircle,
182
- "loading": (_h = _vm.form) == null ? void 0 : _h.expandBtnLoading,
183
- "disabled": (_i = _vm.form) == null ? void 0 : _i.expandBtnDisabled
211
+ "type": _vm.expandBtnType,
212
+ "icon": _vm.expandBtnIcon,
213
+ "plain": _vm.expandBtnPlain,
214
+ "size": _vm.expandBtnSize,
215
+ "round": _vm.expandBtnRound,
216
+ "circle": _vm.expandBtnCircle,
217
+ "loading": _vm.expandBtnLoading,
218
+ "disabled": _vm.expandBtnDisabled
184
219
  },
185
220
  on: {
186
221
  "click": _vm.switchMode
187
222
  }
188
223
  }, [_c("i", {
189
224
  staticClass: "iconfont nf-fs12",
190
- class: _vm.unpackIcon
225
+ class: _vm.isExpand ? _vm.upIcon : _vm.downIcon
191
226
  })])], 1)], 1) : _vm._e()], 2) : _vm._t("default"), _c("transition", {
192
227
  attrs: {
193
228
  "name": "el-zoom-in-top"
@@ -53,17 +53,21 @@ const _sfc_main = defineComponent({
53
53
  });
54
54
  },
55
55
  computed: {
56
- // 展开收起文案
57
- unpackDesc() {
58
- if (!this.form)
59
- return "";
60
- return this.isExpand ? this.form.shrinkBtnTooltipDesc : this.form.expandBtnTooltipDesc;
61
- },
62
- // 展开收起icon
63
- unpackIcon() {
64
- if (!this.form)
65
- return null;
66
- return this.isExpand ? this.form.upIcon : this.form.downIcon;
56
+ expandBtnTooltipDesc() {
57
+ var _a;
58
+ return (_a = this.form) == null ? void 0 : _a.expandBtnTooltipDesc;
59
+ },
60
+ shrinkBtnTooltipDesc() {
61
+ var _a;
62
+ return (_a = this.form) == null ? void 0 : _a.shrinkBtnTooltipDesc;
63
+ },
64
+ downIcon() {
65
+ var _a;
66
+ return (_a = this.form) == null ? void 0 : _a.downIcon;
67
+ },
68
+ upIcon() {
69
+ var _a;
70
+ return (_a = this.form) == null ? void 0 : _a.upIcon;
67
71
  },
68
72
  isCollapse() {
69
73
  var _a;
@@ -81,6 +85,38 @@ const _sfc_main = defineComponent({
81
85
  var _a;
82
86
  return (_a = this.form) == null ? void 0 : _a.columns;
83
87
  },
88
+ expandBtnType() {
89
+ var _a;
90
+ return (_a = this.form) == null ? void 0 : _a.expandBtnType;
91
+ },
92
+ expandBtnIcon() {
93
+ var _a;
94
+ return (_a = this.form) == null ? void 0 : _a.expandBtnIcon;
95
+ },
96
+ expandBtnPlain() {
97
+ var _a;
98
+ return (_a = this.form) == null ? void 0 : _a.expandBtnPlain;
99
+ },
100
+ expandBtnSize() {
101
+ var _a;
102
+ return (_a = this.form) == null ? void 0 : _a.expandBtnSize;
103
+ },
104
+ expandBtnRound() {
105
+ var _a;
106
+ return (_a = this.form) == null ? void 0 : _a.expandBtnRound;
107
+ },
108
+ expandBtnCircle() {
109
+ var _a;
110
+ return (_a = this.form) == null ? void 0 : _a.expandBtnCircle;
111
+ },
112
+ expandBtnLoading() {
113
+ var _a;
114
+ return (_a = this.form) == null ? void 0 : _a.expandBtnLoading;
115
+ },
116
+ expandBtnDisabled() {
117
+ var _a;
118
+ return (_a = this.form) == null ? void 0 : _a.expandBtnDisabled;
119
+ },
84
120
  showBtn() {
85
121
  var _a, _b;
86
122
  if (this.hidden)
@@ -130,7 +166,6 @@ const _sfc_main = defineComponent({
130
166
  }
131
167
  });
132
168
  var _sfc_render = function render() {
133
- var _a, _b, _c2, _d, _e, _f, _g, _h, _i;
134
169
  var _vm = this, _c = _vm._self._c;
135
170
  _vm._self._setupProxy;
136
171
  return _c("div", {
@@ -145,7 +180,7 @@ var _sfc_render = function render() {
145
180
  }, _vm.sizeClass ? "el-form-item--" + _vm.sizeClass : ""]
146
181
  }, [_c("label-wrap", {
147
182
  attrs: {
148
- "is-auto-width": ((_a = _vm.labelStyle) == null ? void 0 : _a.width) === "auto",
183
+ "is-auto-width": _vm.labelStyle && _vm.labelStyle.width === "auto",
149
184
  "update-all": _vm.form.labelWidth === "auto"
150
185
  }
151
186
  }, [_vm.label || _vm.$slots.label ? _c("label", {
@@ -165,27 +200,27 @@ var _sfc_render = function render() {
165
200
  staticClass: "nf-ml10"
166
201
  }, [_c("el-tooltip", {
167
202
  attrs: {
168
- "content": _vm.unpackDesc,
203
+ "content": _vm.isExpand ? _vm.shrinkBtnTooltipDesc : _vm.expandBtnTooltipDesc,
169
204
  "placement": "top"
170
205
  }
171
206
  }, [_c("nf-button", {
172
207
  staticClass: "nf-pointer",
173
208
  attrs: {
174
- "type": (_b = _vm.form) == null ? void 0 : _b.expandBtnType,
175
- "icon": (_c2 = _vm.form) == null ? void 0 : _c2.expandBtnIcon,
176
- "plain": (_d = _vm.form) == null ? void 0 : _d.expandBtnPlain,
177
- "size": (_e = _vm.form) == null ? void 0 : _e.expandBtnSize,
178
- "round": (_f = _vm.form) == null ? void 0 : _f.expandBtnRound,
179
- "circle": (_g = _vm.form) == null ? void 0 : _g.expandBtnCircle,
180
- "loading": (_h = _vm.form) == null ? void 0 : _h.expandBtnLoading,
181
- "disabled": (_i = _vm.form) == null ? void 0 : _i.expandBtnDisabled
209
+ "type": _vm.expandBtnType,
210
+ "icon": _vm.expandBtnIcon,
211
+ "plain": _vm.expandBtnPlain,
212
+ "size": _vm.expandBtnSize,
213
+ "round": _vm.expandBtnRound,
214
+ "circle": _vm.expandBtnCircle,
215
+ "loading": _vm.expandBtnLoading,
216
+ "disabled": _vm.expandBtnDisabled
182
217
  },
183
218
  on: {
184
219
  "click": _vm.switchMode
185
220
  }
186
221
  }, [_c("i", {
187
222
  staticClass: "iconfont nf-fs12",
188
- class: _vm.unpackIcon
223
+ class: _vm.isExpand ? _vm.upIcon : _vm.downIcon
189
224
  })])], 1)], 1) : _vm._e()], 2) : _vm._t("default"), _c("transition", {
190
225
  attrs: {
191
226
  "name": "el-zoom-in-top"
@@ -8,13 +8,23 @@ declare const _default: import("vue-demi").DefineComponent<{
8
8
  isExpand: boolean;
9
9
  initExpand: boolean;
10
10
  }, {
11
- unpackDesc(): any;
12
- unpackIcon(): any;
11
+ expandBtnTooltipDesc(): any;
12
+ shrinkBtnTooltipDesc(): any;
13
+ downIcon(): any;
14
+ upIcon(): any;
13
15
  isCollapse(): any;
14
16
  labelPosition(): any;
15
17
  inline(): any;
16
18
  columns(): any;
17
- showBtn(): any;
19
+ expandBtnType(): any;
20
+ expandBtnIcon(): any;
21
+ expandBtnPlain(): any;
22
+ expandBtnSize(): any;
23
+ expandBtnRound(): any;
24
+ expandBtnCircle(): any;
25
+ expandBtnLoading(): any;
26
+ expandBtnDisabled(): any;
27
+ showBtn(): boolean;
18
28
  isLastItem(): any;
19
29
  }, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, typeof FormItem, {}, string, Readonly<import("vue-demi").ExtractPropTypes<{
20
30
  hidden: {
@@ -14,7 +14,7 @@
14
14
  ]"
15
15
  >
16
16
  <label-wrap
17
- :is-auto-width="labelStyle?.width === 'auto'"
17
+ :is-auto-width="labelStyle && labelStyle.width === 'auto'"
18
18
  :update-all="form.labelWidth === 'auto'"
19
19
  >
20
20
  <label v-if="label || $slots.label" :for="labelFor" class="el-form-item__label" :style="labelStyle">
@@ -25,22 +25,22 @@
25
25
  <div v-if="isLastItem" class="nf-flex">
26
26
  <slot />
27
27
  <div v-if="showBtn" class="nf-ml10">
28
- <el-tooltip :content="unpackDesc" placement="top">
28
+ <el-tooltip :content="isExpand ? shrinkBtnTooltipDesc : expandBtnTooltipDesc" placement="top">
29
29
  <nf-button
30
30
  class="nf-pointer"
31
31
  @click="switchMode"
32
- :type="form?.expandBtnType"
33
- :icon="form?.expandBtnIcon"
34
- :plain="form?.expandBtnPlain"
35
- :size="form?.expandBtnSize"
36
- :round="form?.expandBtnRound"
37
- :circle="form?.expandBtnCircle"
38
- :loading="form?.expandBtnLoading"
39
- :disabled="form?.expandBtnDisabled"
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
40
  >
41
- <i class="iconfont nf-fs12" :class="unpackIcon" />
41
+ <i class="iconfont nf-fs12" :class="isExpand ? upIcon : downIcon" />
42
42
  </nf-button>
43
- </el-tooltip>
43
+ </el-tooltip>
44
44
  </div>
45
45
  </div>
46
46
  <slot v-else />
@@ -121,15 +121,17 @@ export default defineComponent({
121
121
  })
122
122
  },
123
123
  computed: {
124
- // 展开收起文案
125
- unpackDesc() {
126
- if (!this.form) return ''
127
- return this.isExpand ? this.form.shrinkBtnTooltipDesc : this.form.expandBtnTooltipDesc
124
+ expandBtnTooltipDesc() {
125
+ return this.form?.expandBtnTooltipDesc
128
126
  },
129
- // 展开收起icon
130
- unpackIcon() {
131
- if (!this.form) return null
132
- return this.isExpand ? this.form.upIcon : this.form.downIcon
127
+ shrinkBtnTooltipDesc() {
128
+ return this.form?.shrinkBtnTooltipDesc
129
+ },
130
+ downIcon() {
131
+ return this.form?.downIcon
132
+ },
133
+ upIcon() {
134
+ return this.form?.upIcon
133
135
  },
134
136
  isCollapse() {
135
137
  return this.form?.isCollapse
@@ -143,6 +145,30 @@ export default defineComponent({
143
145
  columns() {
144
146
  return this.form?.columns
145
147
  },
148
+ expandBtnType() {
149
+ return this.form?.expandBtnType
150
+ },
151
+ expandBtnIcon() {
152
+ return this.form?.expandBtnIcon
153
+ },
154
+ expandBtnPlain() {
155
+ return this.form?.expandBtnPlain
156
+ },
157
+ expandBtnSize() {
158
+ return this.form?.expandBtnSize
159
+ },
160
+ expandBtnRound() {
161
+ return this.form?.expandBtnRound
162
+ },
163
+ expandBtnCircle() {
164
+ return this.form?.expandBtnCircle
165
+ },
166
+ expandBtnLoading() {
167
+ return this.form?.expandBtnLoading
168
+ },
169
+ expandBtnDisabled() {
170
+ return this.form?.expandBtnDisabled
171
+ },
146
172
  showBtn() {
147
173
  if (this.hidden) return false
148
174
  if (!this.form?.showBtn) return false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-form-item",
3
- "version": "6.1.1",
3
+ "version": "6.1.7",
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": "^6.1.1",
17
+ "@94ai/nf-theme-chalk": "^6.1.7",
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": "8cf48ea7eb7ec9a63f472fa4f5f738f624e18c54"
33
+ "gitHead": "630af26f57c39b084142f1bfb899c176b3c3ef80"
34
34
  }