@vunk/form 1.4.10 → 1.4.11

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.
@@ -133,7 +133,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
133
133
  ref: _ctx.elRef,
134
134
  class: ["vkf-form-item", {
135
135
  "is-readonly": _ctx.readonly,
136
- "vkf-form-item--inline": _ctx.inline
136
+ "vkf-form-item--inline": _ctx.inline,
137
+ "is-empty-label": !_ctx.label
137
138
  }],
138
139
  size: _ctx.formItemSize,
139
140
  rules: _ctx.rules
@@ -162,7 +163,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
162
163
  _: 2
163
164
  /* DYNAMIC */
164
165
  }, [
165
- !_ctx.formItemSlots?.label ? {
166
+ !_ctx.formItemSlots?.label && (_ctx.label || _ctx.labelTip) ? {
166
167
  name: "label",
167
168
  fn: vue.withCtx(() => [
168
169
  vue.createElementVNode(
@@ -177,9 +178,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
177
178
  content: _ctx.labelTip
178
179
  }, {
179
180
  default: vue.withCtx(() => [
180
- vue.createVNode(_component_ElButton, { type: "text" }, {
181
+ vue.createVNode(_component_ElButton, {
182
+ text: "",
183
+ class: "vkf-form-item-label-tip-button"
184
+ }, {
181
185
  default: vue.withCtx(() => [
182
- vue.createVNode(_component_ElIcon, { class: "vkf-form-item-label-tip-icon" }, {
186
+ vue.createVNode(_component_ElIcon, null, {
183
187
  default: vue.withCtx(() => [
184
188
  vue.createVNode(_component_Warning)
185
189
  ]),
@@ -4,12 +4,16 @@
4
4
  .vkf-form-item__tip {
5
5
  color: var(--el-text-color-secondary);
6
6
  }
7
- .vkf-form-item-label-tip-icon{
8
- color: var(--el-text-color-secondary);
9
- cursor: pointer;
10
- margin-left: 5px;
11
- margin-top: -.18em;
12
- }
13
- .vkf-form-item-label-tip-icon:hover{
7
+ .vkf-form-item-label-tip-button:hover .el-icon {
14
8
  color: var(--el-color-primary);
15
9
  }
10
+ .vkf-form-item-label-tip-button .el-icon {
11
+ margin-top: -0.18em;
12
+ }
13
+ .vkf-form-item-label-tip-button.el-button{
14
+ margin-left: 4px;
15
+ padding: 4px;
16
+ }
17
+ .vkf-form-item.is-empty-label .el-form-item__label:before{
18
+ display: none;
19
+ }
@@ -129,7 +129,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
129
129
  ref: _ctx.elRef,
130
130
  class: ["vkf-form-item", {
131
131
  "is-readonly": _ctx.readonly,
132
- "vkf-form-item--inline": _ctx.inline
132
+ "vkf-form-item--inline": _ctx.inline,
133
+ "is-empty-label": !_ctx.label
133
134
  }],
134
135
  size: _ctx.formItemSize,
135
136
  rules: _ctx.rules
@@ -158,7 +159,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
158
159
  _: 2
159
160
  /* DYNAMIC */
160
161
  }, [
161
- !_ctx.formItemSlots?.label ? {
162
+ !_ctx.formItemSlots?.label && (_ctx.label || _ctx.labelTip) ? {
162
163
  name: "label",
163
164
  fn: withCtx(() => [
164
165
  createElementVNode(
@@ -173,9 +174,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
173
174
  content: _ctx.labelTip
174
175
  }, {
175
176
  default: withCtx(() => [
176
- createVNode(_component_ElButton, { type: "text" }, {
177
+ createVNode(_component_ElButton, {
178
+ text: "",
179
+ class: "vkf-form-item-label-tip-button"
180
+ }, {
177
181
  default: withCtx(() => [
178
- createVNode(_component_ElIcon, { class: "vkf-form-item-label-tip-icon" }, {
182
+ createVNode(_component_ElIcon, null, {
179
183
  default: withCtx(() => [
180
184
  createVNode(_component_Warning)
181
185
  ]),
package/index.css CHANGED
@@ -166,15 +166,19 @@
166
166
  .vkf-form-item__tip {
167
167
  color: var(--el-text-color-secondary);
168
168
  }
169
- .vkf-form-item-label-tip-icon{
170
- color: var(--el-text-color-secondary);
171
- cursor: pointer;
172
- margin-left: 5px;
173
- margin-top: -.18em;
174
- }
175
- .vkf-form-item-label-tip-icon:hover{
169
+ .vkf-form-item-label-tip-button:hover .el-icon {
176
170
  color: var(--el-color-primary);
177
171
  }
172
+ .vkf-form-item-label-tip-button .el-icon {
173
+ margin-top: -0.18em;
174
+ }
175
+ .vkf-form-item-label-tip-button.el-button{
176
+ margin-left: 4px;
177
+ padding: 4px;
178
+ }
179
+ .vkf-form-item.is-empty-label .el-form-item__label:before{
180
+ display: none;
181
+ }
178
182
 
179
183
  .vk-geoinput-read-x{
180
184
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "1.4.10",
3
+ "version": "1.4.11",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {