@94ai/nf-form-item 3.2.4 → 3.2.20

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.
@@ -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": function($event) {
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
  }
@@ -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": function($event) {
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
  }
@@ -24,20 +24,22 @@
24
24
  <div v-if="isLastItem" class="nf-flex">
25
25
  <slot />
26
26
  <div v-if="showBtn" class="nf-ml10">
27
- <el-button
28
- class="nf-pointer"
29
- @click="switchMode()"
30
- :type="expandBtnType"
31
- :icon="expandBtnIcon"
32
- :plain="expandBtnPlain"
33
- :size="expandBtnSize"
34
- :round="expandBtnRound"
35
- :circle="expandBtnCircle"
36
- :loading="expandBtnLoading"
37
- :disabled="expandBtnDisabled"
38
- >
39
- <i class="iconfont nf-fs12" :class="isExpand ? upIcon : downIcon" />
40
- </el-button>
27
+ <el-tooltip :content="isExpand ? '收起' : '展开'" placement="top">
28
+ <el-button
29
+ class="nf-pointer"
30
+ @click="switchMode"
31
+ :type="expandBtnType"
32
+ :icon="expandBtnIcon"
33
+ :plain="expandBtnPlain"
34
+ :size="expandBtnSize"
35
+ :round="expandBtnRound"
36
+ :circle="expandBtnCircle"
37
+ :loading="expandBtnLoading"
38
+ :disabled="expandBtnDisabled"
39
+ >
40
+ <i class="iconfont nf-fs12" :class="isExpand ? upIcon : downIcon" />
41
+ </el-button>
42
+ </el-tooltip>
41
43
  </div>
42
44
  </div>
43
45
  <slot v-else />
@@ -228,7 +230,21 @@ export default defineComponent({
228
230
  }
229
231
  },
230
232
  // 切换显示模式
231
- switchMode() {
233
+ switchMode(e) {
234
+ // @ts-ignore
235
+ let target = event.target
236
+ // 点击的是i、span、button中的哪一个
237
+ // @ts-ignore
238
+ if (target.nodeName == 'SPAN') {
239
+ // @ts-ignore
240
+ target = event.target.parentNode
241
+ // @ts-ignore
242
+ } else if (target.nodeName == 'I') {
243
+ // @ts-ignore
244
+ target = event.target.parentNode.parentNode
245
+ }
246
+ // @ts-ignore
247
+ target.blur()
232
248
  // @ts-ignore
233
249
  this.isExpand = !this.isExpand
234
250
  // @ts-ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-form-item",
3
- "version": "3.2.4",
3
+ "version": "3.2.20",
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.4",
17
+ "@94ai/nf-theme-chalk": "^3.2.20",
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": "9518f3ee1354378e844b825d6d850d18ec14f71a"
33
+ "gitHead": "60e08cb237f842c3fc38168cbd911ec3a4c9d440"
34
34
  }