@vunk/form 2.10.3 → 2.10.5

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.
@@ -61,7 +61,8 @@ const emits = {
61
61
 
62
62
  var _sfc_main = /* @__PURE__ */vue.defineComponent({
63
63
  ...{
64
- name: "VkfEditableText"
64
+ name: "VkfEditableText",
65
+ inheritAttrs: false
65
66
  },
66
67
  __name: "index",
67
68
  props: props,
@@ -91,6 +92,14 @@ var _sfc_main = /* @__PURE__ */vue.defineComponent({
91
92
  ...formItemBindProps.value,
92
93
  inline: true,
93
94
  onBlur: handleCheck,
95
+ onKeydown: e => {
96
+ if (e.key === "Enter") {
97
+ handleCheck();
98
+ } else if (e.key === "Escape") {
99
+ handleCancel();
100
+ }
101
+ e.stopPropagation();
102
+ },
94
103
  ...props.edit,
95
104
  prop: prop.value,
96
105
  elRef: e => {
@@ -193,7 +202,10 @@ const _hoisted_1 = { class: "vkf-editable-text-actions" };
193
202
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
194
203
  return $setup.readonly || !$setup.editable ? (vue.openBlock(), vue.createBlock(
195
204
  $setup["VkfFormItem"],
196
- vue.normalizeProps(vue.mergeProps({ key: 0 }, $setup.formItemBindProps)),
205
+ vue.normalizeProps(vue.mergeProps({ key: 0 }, {
206
+ ...$setup.formItemBindProps,
207
+ ..._ctx.$attrs
208
+ })),
197
209
  {
198
210
  default: vue.withCtx(() => [
199
211
  vue.renderSlot(_ctx.$slots, "text", { handleEdit: $setup.handleEdit }, () => [
@@ -229,7 +241,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
229
241
  default: vue.withCtx(() => [
230
242
  vue.createVNode(
231
243
  $setup["VkfFormItem"],
232
- { ref: "formItemContainerRef" },
244
+ vue.mergeProps({
245
+ ref: "formItemContainerRef",
246
+ class: "vk-editable-text-edit-x"
247
+ }, _ctx.$attrs),
233
248
  {
234
249
  default: vue.withCtx(() => [
235
250
  vue.createVNode($setup["VkfFormItemRenderer"], { source: $setup.editSource }, {
@@ -257,8 +272,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
257
272
  _: 1
258
273
  /* STABLE */
259
274
  },
260
- 512
261
- /* NEED_PATCH */
275
+ 16
276
+ /* FULL_PROPS */
262
277
  )
263
278
  ]),
264
279
  _: 1
@@ -4,3 +4,6 @@
4
4
  .vkf-editable-text-actions .el-avatar {
5
5
  cursor: pointer;
6
6
  }
7
+ .vk-editable-text-edit-x .el-form-item__content {
8
+ flex-wrap: nowrap;
9
+ }
@@ -57,7 +57,8 @@ const emits = {
57
57
 
58
58
  var _sfc_main = /* @__PURE__ */defineComponent({
59
59
  ...{
60
- name: "VkfEditableText"
60
+ name: "VkfEditableText",
61
+ inheritAttrs: false
61
62
  },
62
63
  __name: "index",
63
64
  props: props,
@@ -87,6 +88,14 @@ var _sfc_main = /* @__PURE__ */defineComponent({
87
88
  ...formItemBindProps.value,
88
89
  inline: true,
89
90
  onBlur: handleCheck,
91
+ onKeydown: e => {
92
+ if (e.key === "Enter") {
93
+ handleCheck();
94
+ } else if (e.key === "Escape") {
95
+ handleCancel();
96
+ }
97
+ e.stopPropagation();
98
+ },
90
99
  ...props.edit,
91
100
  prop: prop.value,
92
101
  elRef: e => {
@@ -189,7 +198,10 @@ const _hoisted_1 = { class: "vkf-editable-text-actions" };
189
198
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
190
199
  return $setup.readonly || !$setup.editable ? (openBlock(), createBlock(
191
200
  $setup["VkfFormItem"],
192
- normalizeProps(mergeProps({ key: 0 }, $setup.formItemBindProps)),
201
+ normalizeProps(mergeProps({ key: 0 }, {
202
+ ...$setup.formItemBindProps,
203
+ ..._ctx.$attrs
204
+ })),
193
205
  {
194
206
  default: withCtx(() => [
195
207
  renderSlot(_ctx.$slots, "text", { handleEdit: $setup.handleEdit }, () => [
@@ -225,7 +237,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
225
237
  default: withCtx(() => [
226
238
  createVNode(
227
239
  $setup["VkfFormItem"],
228
- { ref: "formItemContainerRef" },
240
+ mergeProps({
241
+ ref: "formItemContainerRef",
242
+ class: "vk-editable-text-edit-x"
243
+ }, _ctx.$attrs),
229
244
  {
230
245
  default: withCtx(() => [
231
246
  createVNode($setup["VkfFormItemRenderer"], { source: $setup.editSource }, {
@@ -253,8 +268,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
253
268
  _: 1
254
269
  /* STABLE */
255
270
  },
256
- 512
257
- /* NEED_PATCH */
271
+ 16
272
+ /* FULL_PROPS */
258
273
  )
259
274
  ]),
260
275
  _: 1
package/index.css CHANGED
@@ -155,6 +155,9 @@
155
155
  .vkf-editable-text-actions .el-avatar {
156
156
  cursor: pointer;
157
157
  }
158
+ .vk-editable-text-edit-x .el-form-item__content {
159
+ flex-wrap: nowrap;
160
+ }
158
161
 
159
162
  .el-button.vkf-esri-input-geojson__upload{
160
163
  border-color: transparent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "2.10.3",
3
+ "version": "2.10.5",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {