@94ai/nf-form-item 8.3.23 → 10.0.0

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.
@@ -43,23 +43,20 @@ const _sfc_main = vueDemi.defineComponent({
43
43
  }
44
44
  vueDemi.nextTick(() => {
45
45
  var _a2;
46
- if (!this.initExpand) {
47
- this.isExpand = !((_a2 = this.form) == null ? void 0 : _a2.isCollapse);
48
- if (!this.isExpand) {
49
- this.refreshButtonList();
50
- }
51
- this.initExpand = true;
52
- } else {
46
+ this.isExpand = !((_a2 = this.form) == null ? void 0 : _a2.isCollapse);
47
+ if (!this.isExpand) {
53
48
  this.refreshButtonList();
54
49
  }
50
+ this.initExpand = true;
55
51
  });
56
52
  },
57
53
  computed: {
58
54
  // 展开收起文案
59
55
  unpackDesc() {
56
+ var _a, _b, _c, _d;
60
57
  if (!this.form)
61
58
  return "";
62
- return this.isExpand ? this.form.shrinkBtnTooltipDesc : this.form.expandBtnTooltipDesc;
59
+ return this.isExpand ? (_b = (_a = this.form.localeText) == null ? void 0 : _a.shrinkBtnTooltipDesc) != null ? _b : this.form.shrinkBtnTooltipDesc : (_d = (_c = this.form.localeText) == null ? void 0 : _c.expandBtnTooltipDesc) != null ? _d : this.form.expandBtnTooltipDesc;
63
60
  },
64
61
  // 展开收起icon
65
62
  unpackIcon() {
@@ -117,16 +114,16 @@ const _sfc_main = vueDemi.defineComponent({
117
114
  },
118
115
  // 切换显示模式
119
116
  switchMode(e) {
120
- var _a;
121
- let target = event.target;
122
- if (target.nodeName == "SPAN") {
123
- target = event.target.parentNode;
124
- } else if (target.nodeName == "I") {
125
- target = event.target.parentNode.parentNode;
117
+ var _a, _b;
118
+ let target = e == null ? void 0 : e.target;
119
+ if ((target == null ? void 0 : target.nodeName) == "SPAN") {
120
+ target = target.parentNode;
121
+ } else if ((target == null ? void 0 : target.nodeName) == "I") {
122
+ target = target.parentNode.parentNode;
126
123
  }
127
- target.blur();
124
+ (_a = target == null ? void 0 : target.blur) == null ? void 0 : _a.call(target);
128
125
  this.isExpand = !this.isExpand;
129
- (_a = this.form) == null ? void 0 : _a.$emit("isCollapseChange", this.isExpand);
126
+ (_b = this.form) == null ? void 0 : _b.$emit("isCollapseChange", this.isExpand);
130
127
  this.refreshButtonList();
131
128
  }
132
129
  }
@@ -41,23 +41,20 @@ const _sfc_main = defineComponent({
41
41
  }
42
42
  nextTick(() => {
43
43
  var _a2;
44
- if (!this.initExpand) {
45
- this.isExpand = !((_a2 = this.form) == null ? void 0 : _a2.isCollapse);
46
- if (!this.isExpand) {
47
- this.refreshButtonList();
48
- }
49
- this.initExpand = true;
50
- } else {
44
+ this.isExpand = !((_a2 = this.form) == null ? void 0 : _a2.isCollapse);
45
+ if (!this.isExpand) {
51
46
  this.refreshButtonList();
52
47
  }
48
+ this.initExpand = true;
53
49
  });
54
50
  },
55
51
  computed: {
56
52
  // 展开收起文案
57
53
  unpackDesc() {
54
+ var _a, _b, _c, _d;
58
55
  if (!this.form)
59
56
  return "";
60
- return this.isExpand ? this.form.shrinkBtnTooltipDesc : this.form.expandBtnTooltipDesc;
57
+ return this.isExpand ? (_b = (_a = this.form.localeText) == null ? void 0 : _a.shrinkBtnTooltipDesc) != null ? _b : this.form.shrinkBtnTooltipDesc : (_d = (_c = this.form.localeText) == null ? void 0 : _c.expandBtnTooltipDesc) != null ? _d : this.form.expandBtnTooltipDesc;
61
58
  },
62
59
  // 展开收起icon
63
60
  unpackIcon() {
@@ -115,16 +112,16 @@ const _sfc_main = defineComponent({
115
112
  },
116
113
  // 切换显示模式
117
114
  switchMode(e) {
118
- var _a;
119
- let target = event.target;
120
- if (target.nodeName == "SPAN") {
121
- target = event.target.parentNode;
122
- } else if (target.nodeName == "I") {
123
- target = event.target.parentNode.parentNode;
115
+ var _a, _b;
116
+ let target = e == null ? void 0 : e.target;
117
+ if ((target == null ? void 0 : target.nodeName) == "SPAN") {
118
+ target = target.parentNode;
119
+ } else if ((target == null ? void 0 : target.nodeName) == "I") {
120
+ target = target.parentNode.parentNode;
124
121
  }
125
- target.blur();
122
+ (_a = target == null ? void 0 : target.blur) == null ? void 0 : _a.call(target);
126
123
  this.isExpand = !this.isExpand;
127
- (_a = this.form) == null ? void 0 : _a.$emit("isCollapseChange", this.isExpand);
124
+ (_b = this.form) == null ? void 0 : _b.$emit("isCollapseChange", this.isExpand);
128
125
  this.refreshButtonList();
129
126
  }
130
127
  }
@@ -109,22 +109,20 @@ export default defineComponent({
109
109
  this.form?.getFormItems()
110
110
  }
111
111
  nextTick(() => {
112
- if (!this.initExpand) {
113
- this.isExpand = !this.form?.isCollapse
114
- if (!this.isExpand) {
115
- this.refreshButtonList()
116
- }
117
- this.initExpand = true
118
- } else {
112
+ this.isExpand = !this.form?.isCollapse
113
+ if (!this.isExpand) {
119
114
  this.refreshButtonList()
120
115
  }
116
+ this.initExpand = true
121
117
  })
122
118
  },
123
119
  computed: {
124
120
  // 展开收起文案
125
121
  unpackDesc() {
126
122
  if (!this.form) return ''
127
- return this.isExpand ? this.form.shrinkBtnTooltipDesc : this.form.expandBtnTooltipDesc
123
+ return this.isExpand
124
+ ? (this.form.localeText?.shrinkBtnTooltipDesc ?? this.form.shrinkBtnTooltipDesc)
125
+ : (this.form.localeText?.expandBtnTooltipDesc ?? this.form.expandBtnTooltipDesc)
128
126
  },
129
127
  // 展开收起icon
130
128
  unpackIcon() {
@@ -178,14 +176,14 @@ export default defineComponent({
178
176
  },
179
177
  // 切换显示模式
180
178
  switchMode(e) {
181
- let target = event.target
179
+ let target = e?.target
182
180
  // 点击的是i、span、button中的哪一个
183
- if (target.nodeName == 'SPAN') {
184
- target = event.target.parentNode
185
- } else if (target.nodeName == 'I') {
186
- target = event.target.parentNode.parentNode
181
+ if (target?.nodeName == 'SPAN') {
182
+ target = target.parentNode
183
+ } else if (target?.nodeName == 'I') {
184
+ target = target.parentNode.parentNode
187
185
  }
188
- target.blur()
186
+ target?.blur?.()
189
187
  this.isExpand = !this.isExpand
190
188
  this.form?.$emit('isCollapseChange', this.isExpand)
191
189
  this.refreshButtonList()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-form-item",
3
- "version": "8.3.23",
3
+ "version": "10.0.0",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "zoujiahe <zoujiahe@94ai.com>",
@@ -11,11 +11,12 @@
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
14
+ "url": "http://gitlab.94ai.pro/zoujiahe/common-ui.git"
15
15
  },
16
16
  "dependencies": {
17
- "@94ai/nf-theme-chalk": "^8.3.23",
18
- "vue-demi": "^0.14.5"
17
+ "@94ai/nf-theme-chalk": "^10.0.0",
18
+ "vue-demi": "^0.14.5",
19
+ "@94ai/vue2-runtime-helpers": "1.0.1"
19
20
  },
20
21
  "peerDependenciesMeta": {
21
22
  "@vue/composition-api": {
@@ -24,11 +25,10 @@
24
25
  },
25
26
  "peerDependencies": {
26
27
  "@vue/composition-api": "^1.0.0-rc.1",
27
- "element-ui": ">=2.13.2",
28
- "vue": "^2.0.0 || >=3.0.0"
28
+ "vue": "^2.0.0 || >=3.0.0",
29
+ "element-ui": ">=2.13.2"
29
30
  },
30
31
  "types": "lib/index.d.ts",
31
32
  "main": "lib/nf-form-item.cjs.js",
32
- "module": "lib/nf-form-item.esm-bundler.js",
33
- "gitHead": "74e871c7972dc4576480bee02b1dc61a3eafc6ba"
33
+ "module": "lib/nf-form-item.esm-bundler.js"
34
34
  }