@vunk/form 2.16.9 → 2.16.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.
@@ -6,7 +6,7 @@ var vue = require('vue');
6
6
  var tablesSelect = require('@vunk/form/components/tables-select');
7
7
  var object = require('@vunk/shared/object');
8
8
  var form = require('@vunk/form');
9
- var core = require('@vunk/core');
9
+ var composables = require('@vunk/core/composables');
10
10
  var isObject = require('../isObject.cjs');
11
11
  var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
12
12
 
@@ -42,10 +42,15 @@ const props = {
42
42
  queryItems: {
43
43
  type: Array,
44
44
  default: () => []
45
+ },
46
+ query: {
47
+ type: Object,
48
+ default: void 0
45
49
  }
46
50
  };
47
51
  const emits = {
48
- ...tablesSelect._VkfTablesSelectCtx.emits
52
+ ...tablesSelect._VkfTablesSelectCtx.emits,
53
+ "setData:query": null
49
54
  };
50
55
 
51
56
  /** `Object#toString` result references. */
@@ -386,7 +391,10 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
386
391
  const debounceRead = debounce(read, 300);
387
392
  const coreProps = tablesSelect._VkfTablesSelectCtx.createBindProps(props, ["getRows"]);
388
393
  const coreEmits = tablesSelect._VkfTablesSelectCtx.createOnEmits(emit);
389
- const queryData = vue.ref({});
394
+ const [queryData, setQueryData] = composables.useDataComputed({
395
+ default: {},
396
+ key: "query"
397
+ }, props, emit);
390
398
  const tableState = vue.reactive({
391
399
  data: [],
392
400
  total: 0
@@ -411,12 +419,10 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
411
419
  });
412
420
  return rows;
413
421
  };
414
- const __returned__ = { props, emit, debounceRead, coreProps, coreEmits, queryData, tableState, pagination, read, defaultGetRows, get VkfTablesSelect() {
422
+ const __returned__ = { props, emit, debounceRead, coreProps, coreEmits, queryData, setQueryData, tableState, pagination, read, defaultGetRows, get VkfTablesSelect() {
415
423
  return tablesSelect.VkfTablesSelect;
416
424
  }, get VkfForm() {
417
425
  return form.VkfForm;
418
- }, get setData() {
419
- return core.setData;
420
426
  } };
421
427
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
422
428
  return __returned__;
@@ -426,9 +432,9 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
426
432
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
427
433
  return vue.openBlock(), vue.createBlock($setup["VkfTablesSelect"], vue.mergeProps({
428
434
  start: $setup.pagination.start,
429
- "onUpdate:start": _cache[1] || (_cache[1] = ($event) => $setup.pagination.start = $event),
435
+ "onUpdate:start": _cache[0] || (_cache[0] = ($event) => $setup.pagination.start = $event),
430
436
  "page-size": $setup.pagination.pageSize,
431
- "onUpdate:pageSize": _cache[2] || (_cache[2] = ($event) => $setup.pagination.pageSize = $event),
437
+ "onUpdate:pageSize": _cache[1] || (_cache[1] = ($event) => $setup.pagination.pageSize = $event),
432
438
  data: $setup.tableState.data,
433
439
  total: $setup.tableState.total,
434
440
  "get-rows": _ctx.getRows || $setup.defaultGetRows
@@ -438,8 +444,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
438
444
  "form-items": _ctx.queryItems,
439
445
  inline: true,
440
446
  data: $setup.queryData,
441
- onSetData: _cache[0] || (_cache[0] = ($event) => $setup.setData($setup.queryData, $event))
442
- }, null, 8, ["form-items", "data"]),
447
+ onSetData: $setup.setQueryData
448
+ }, null, 8, ["form-items", "data", "onSetData"]),
443
449
  vue.renderSlot(_ctx.$slots, "dialog")
444
450
  ]),
445
451
  _: 3
@@ -1,8 +1,8 @@
1
- import { defineComponent, ref, reactive, watch, openBlock, createBlock, mergeProps, toHandlers, withCtx, createVNode, renderSlot } from 'vue';
1
+ import { defineComponent, reactive, ref, watch, openBlock, createBlock, mergeProps, toHandlers, withCtx, createVNode, renderSlot } from 'vue';
2
2
  import { _VkfTablesSelectCtx, VkfTablesSelect } from '@vunk/form/components/tables-select';
3
3
  import { pickObject } from '@vunk/shared/object';
4
4
  import { VkfForm } from '@vunk/form';
5
- import { setData } from '@vunk/core';
5
+ import { useDataComputed } from '@vunk/core/composables';
6
6
  import { i as isObjectLike, b as baseGetTag, a as isObject, r as root } from '../isObject.mjs';
7
7
  import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
8
8
 
@@ -38,10 +38,15 @@ const props = {
38
38
  queryItems: {
39
39
  type: Array,
40
40
  default: () => []
41
+ },
42
+ query: {
43
+ type: Object,
44
+ default: void 0
41
45
  }
42
46
  };
43
47
  const emits = {
44
- ..._VkfTablesSelectCtx.emits
48
+ ..._VkfTablesSelectCtx.emits,
49
+ "setData:query": null
45
50
  };
46
51
 
47
52
  /** `Object#toString` result references. */
@@ -382,7 +387,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
382
387
  const debounceRead = debounce(read, 300);
383
388
  const coreProps = _VkfTablesSelectCtx.createBindProps(props, ["getRows"]);
384
389
  const coreEmits = _VkfTablesSelectCtx.createOnEmits(emit);
385
- const queryData = ref({});
390
+ const [queryData, setQueryData] = useDataComputed({
391
+ default: {},
392
+ key: "query"
393
+ }, props, emit);
386
394
  const tableState = reactive({
387
395
  data: [],
388
396
  total: 0
@@ -407,12 +415,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
407
415
  });
408
416
  return rows;
409
417
  };
410
- const __returned__ = { props, emit, debounceRead, coreProps, coreEmits, queryData, tableState, pagination, read, defaultGetRows, get VkfTablesSelect() {
418
+ const __returned__ = { props, emit, debounceRead, coreProps, coreEmits, queryData, setQueryData, tableState, pagination, read, defaultGetRows, get VkfTablesSelect() {
411
419
  return VkfTablesSelect;
412
420
  }, get VkfForm() {
413
421
  return VkfForm;
414
- }, get setData() {
415
- return setData;
416
422
  } };
417
423
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
418
424
  return __returned__;
@@ -422,9 +428,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
422
428
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
423
429
  return openBlock(), createBlock($setup["VkfTablesSelect"], mergeProps({
424
430
  start: $setup.pagination.start,
425
- "onUpdate:start": _cache[1] || (_cache[1] = ($event) => $setup.pagination.start = $event),
431
+ "onUpdate:start": _cache[0] || (_cache[0] = ($event) => $setup.pagination.start = $event),
426
432
  "page-size": $setup.pagination.pageSize,
427
- "onUpdate:pageSize": _cache[2] || (_cache[2] = ($event) => $setup.pagination.pageSize = $event),
433
+ "onUpdate:pageSize": _cache[1] || (_cache[1] = ($event) => $setup.pagination.pageSize = $event),
428
434
  data: $setup.tableState.data,
429
435
  total: $setup.tableState.total,
430
436
  "get-rows": _ctx.getRows || $setup.defaultGetRows
@@ -434,8 +440,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
434
440
  "form-items": _ctx.queryItems,
435
441
  inline: true,
436
442
  data: $setup.queryData,
437
- onSetData: _cache[0] || (_cache[0] = ($event) => $setup.setData($setup.queryData, $event))
438
- }, null, 8, ["form-items", "data"]),
443
+ onSetData: $setup.setQueryData
444
+ }, null, 8, ["form-items", "data", "onSetData"]),
439
445
  renderSlot(_ctx.$slots, "dialog")
440
446
  ]),
441
447
  _: 3
@@ -27,6 +27,10 @@ export declare const props: {
27
27
  type: PropType<any[]>;
28
28
  default: () => any[];
29
29
  };
30
+ query: {
31
+ type: ObjectConstructor;
32
+ default: any;
33
+ };
30
34
  type: {
31
35
  type: StringConstructor;
32
36
  default: string;
@@ -345,6 +349,7 @@ export declare const props: {
345
349
  };
346
350
  };
347
351
  export declare const emits: {
352
+ 'setData:query': any;
348
353
  'update:modelValue': any;
349
354
  'update:start': (val: number) => boolean;
350
355
  select: null;
@@ -15,6 +15,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
15
15
  type: import("vue").PropType<any[]>;
16
16
  default: () => any[];
17
17
  };
18
+ query: {
19
+ type: ObjectConstructor;
20
+ default: any;
21
+ };
18
22
  type: {
19
23
  type: StringConstructor;
20
24
  default: string;
@@ -348,6 +352,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
348
352
  type: import("vue").PropType<any[]>;
349
353
  default: () => any[];
350
354
  };
355
+ query: {
356
+ type: ObjectConstructor;
357
+ default: any;
358
+ };
351
359
  type: {
352
360
  type: StringConstructor;
353
361
  default: string;
@@ -665,6 +673,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
665
673
  validator: (val: ("ascending" | "descending" | null)[]) => boolean;
666
674
  };
667
675
  }>> & Readonly<{
676
+ "onSetData:query"?: (...args: any[] | unknown[]) => any;
668
677
  "onUpdate:modelValue"?: (...args: any[] | unknown[]) => any;
669
678
  "onUpdate:start"?: (val: number) => any;
670
679
  onSelect?: (...args: unknown[]) => any;
@@ -693,7 +702,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
693
702
  "onPrev-click"?: (val: number) => any;
694
703
  "onNext-click"?: (val: number) => any;
695
704
  }> & {}>;
696
- emit: ((event: "update:modelValue", ...args: unknown[]) => void) & ((event: "update:modelValue", ...args: any) => void) & ((event: "update:modelValue", ...args: any[]) => void) & ((event: "update:start", val: number) => void) & ((event: "select", ...args: unknown[]) => void) & ((event: "select-all", ...args: unknown[]) => void) & ((event: "selection-change", ...args: unknown[]) => void) & ((event: "cell-mouse-enter", ...args: unknown[]) => void) & ((event: "cell-mouse-leave", ...args: unknown[]) => void) & ((event: "cell-contextmenu", ...args: unknown[]) => void) & ((event: "cell-click", ...args: unknown[]) => void) & ((event: "cell-dblclick", ...args: unknown[]) => void) & ((event: "row-click", ...args: unknown[]) => void) & ((event: "row-contextmenu", ...args: unknown[]) => void) & ((event: "row-dblclick", ...args: unknown[]) => void) & ((event: "header-click", ...args: unknown[]) => void) & ((event: "header-contextmenu", ...args: unknown[]) => void) & ((event: "sort-change", ...args: unknown[]) => void) & ((event: "filter-change", ...args: unknown[]) => void) & ((event: "current-change", ...args: unknown[]) => void) & ((event: "header-dragend", ...args: unknown[]) => void) & ((event: "expand-change", ...args: unknown[]) => void) & ((event: "scroll", ...args: unknown[]) => void) & ((event: "update:current-page", val: number) => void) & ((event: "update:page-size", val: number) => void) & ((event: "size-change", val: number) => void) & ((event: "change", currentPage: number, pageSize: number) => void) & ((event: "prev-click", val: number) => void) & ((event: "next-click", val: number) => void);
705
+ emit: ((event: "setData:query", ...args: unknown[]) => void) & ((event: "setData:query", ...args: any) => void) & ((event: "setData:query", ...args: any[]) => void) & ((event: "update:modelValue", ...args: unknown[]) => void) & ((event: "update:modelValue", ...args: any) => void) & ((event: "update:modelValue", ...args: any[]) => void) & ((event: "update:start", val: number) => void) & ((event: "select", ...args: unknown[]) => void) & ((event: "select-all", ...args: unknown[]) => void) & ((event: "selection-change", ...args: unknown[]) => void) & ((event: "cell-mouse-enter", ...args: unknown[]) => void) & ((event: "cell-mouse-leave", ...args: unknown[]) => void) & ((event: "cell-contextmenu", ...args: unknown[]) => void) & ((event: "cell-click", ...args: unknown[]) => void) & ((event: "cell-dblclick", ...args: unknown[]) => void) & ((event: "row-click", ...args: unknown[]) => void) & ((event: "row-contextmenu", ...args: unknown[]) => void) & ((event: "row-dblclick", ...args: unknown[]) => void) & ((event: "header-click", ...args: unknown[]) => void) & ((event: "header-contextmenu", ...args: unknown[]) => void) & ((event: "sort-change", ...args: unknown[]) => void) & ((event: "filter-change", ...args: unknown[]) => void) & ((event: "current-change", ...args: unknown[]) => void) & ((event: "header-dragend", ...args: unknown[]) => void) & ((event: "expand-change", ...args: unknown[]) => void) & ((event: "scroll", ...args: unknown[]) => void) & ((event: "update:current-page", val: number) => void) & ((event: "update:page-size", val: number) => void) & ((event: "size-change", val: number) => void) & ((event: "change", currentPage: number, pageSize: number) => void) & ((event: "prev-click", val: number) => void) & ((event: "next-click", val: number) => void);
697
706
  debounceRead: import("lodash").DebouncedFunc<() => Promise<void>>;
698
707
  coreProps: import("vue").ComputedRef<{
699
708
  type: string;
@@ -833,7 +842,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
833
842
  sortOrders: ("ascending" | "descending")[];
834
843
  }>;
835
844
  coreEmits: {};
836
- queryData: import("vue").Ref<NormalObject, NormalObject>;
845
+ queryData: import("vue").ComputedRef<{}>;
846
+ setQueryData: (e: import("@vunk/core").SetDataEvent) => void;
837
847
  tableState: {
838
848
  data: NormalObject[];
839
849
  total: number;
@@ -872,8 +882,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
872
882
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
873
883
  install(app: import("vue").App): void;
874
884
  };
875
- readonly setData: (obj: any, e: import("@vunk/core").SetDataEvent) => void;
876
885
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
886
+ 'setData:query': any;
877
887
  'update:modelValue': any;
878
888
  'update:start': (val: number) => boolean;
879
889
  select: null;
@@ -917,6 +927,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
917
927
  type: import("vue").PropType<any[]>;
918
928
  default: () => any[];
919
929
  };
930
+ query: {
931
+ type: ObjectConstructor;
932
+ default: any;
933
+ };
920
934
  type: {
921
935
  type: StringConstructor;
922
936
  default: string;
@@ -1234,6 +1248,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1234
1248
  validator: (val: ("ascending" | "descending" | null)[]) => boolean;
1235
1249
  };
1236
1250
  }>> & Readonly<{
1251
+ "onSetData:query"?: (...args: any[] | unknown[]) => any;
1237
1252
  "onUpdate:modelValue"?: (...args: any[] | unknown[]) => any;
1238
1253
  "onUpdate:start"?: (val: number) => any;
1239
1254
  onSelect?: (...args: unknown[]) => any;
@@ -1336,5 +1351,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1336
1351
  sortOrders: ("ascending" | "descending")[];
1337
1352
  readApi: import("./types").ReadApi;
1338
1353
  queryItems: any[];
1354
+ query: Record<string, any>;
1339
1355
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1340
1356
  export default _default;
@@ -72,10 +72,18 @@ const props = {
72
72
  modules: {
73
73
  type: Array,
74
74
  default: () => ["operations:add"]
75
+ },
76
+ /**
77
+ * @description 正在编辑的 dialog 表单数据
78
+ */
79
+ formdata: {
80
+ type: Object,
81
+ default: void 0
75
82
  }
76
83
  };
77
84
  const emits = {
78
- "update:modelValue": null
85
+ "update:modelValue": null,
86
+ "update:formdata": null
79
87
  };
80
88
 
81
89
  var _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
@@ -108,14 +116,18 @@ var _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
108
116
  validateCatch: {
109
117
  type: Function,
110
118
  default: form.validateCatch
111
- }
119
+ },
120
+ formdata: null
112
121
  },
113
- emits: ["update:modelValue", "update:visible", "change"],
122
+ emits: ["update:modelValue", "update:visible", "change", "update:formdata"],
114
123
  setup(__props, { expose: __expose, emit: __emit }) {
115
124
  __expose();
116
125
  const props = __props;
117
126
  const emit = __emit;
118
- const formData = vue.ref(props.modelValue);
127
+ const formData = composables.useModelComputed({
128
+ key: "formdata",
129
+ default: {}
130
+ }, props, emit);
119
131
  const formDef = composables.useDeferred();
120
132
  formDef.promise.then((form) => {
121
133
  props.dialogFormProps.elRef?.(form);
@@ -492,11 +504,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
492
504
  type: "primary",
493
505
  onClick: _cache[1] || (_cache[1] = ($event) => $setup.handlePlus(-1))
494
506
  }, {
495
- default: vue.withCtx(() => _cache[5] || (_cache[5] = [
507
+ default: vue.withCtx(() => _cache[6] || (_cache[6] = [
496
508
  vue.createTextVNode(" \u6DFB\u52A0 ")
497
509
  ])),
498
510
  _: 1,
499
- __: [5]
511
+ __: [6]
500
512
  })
501
513
  ])) : vue.createCommentVNode("v-if", true),
502
514
  vue.createVNode($setup["ElTable"], {
@@ -523,11 +535,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
523
535
  icon: $setup.Plus,
524
536
  onClick: _cache[0] || (_cache[0] = ($event) => $setup.handlePlus(-1))
525
537
  }, {
526
- default: vue.withCtx(() => _cache[4] || (_cache[4] = [
538
+ default: vue.withCtx(() => _cache[5] || (_cache[5] = [
527
539
  vue.createTextVNode(" \u6DFB\u52A0 ")
528
540
  ])),
529
541
  _: 1,
530
- __: [4]
542
+ __: [5]
531
543
  }, 8, ["icon"])) : vue.createCommentVNode("v-if", true)
532
544
  ]),
533
545
  key: "0"
@@ -541,9 +553,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
541
553
  "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => $setup.cuState.dialogVisible = $event),
542
554
  modelValue: $setup.cuState.data,
543
555
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.cuState.data = $event),
556
+ formdata: _ctx.formdata,
544
557
  "form-items": $setup.cuFormItems,
545
558
  "dialog-form-props": _ctx.dialogFormProps,
546
559
  "validate-catch": _ctx.validateCatch,
560
+ "onUpdate:formdata": _cache[4] || (_cache[4] = ($event) => _ctx.$emit("update:formdata", $event)),
547
561
  onChange: $setup.handleDialogFormChange
548
562
  }, {
549
563
  header: vue.withCtx(() => [
@@ -562,7 +576,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
562
576
  ]),
563
577
  _: 1
564
578
  /* STABLE */
565
- }, 8, ["visible", "modelValue", "form-items", "dialog-form-props", "validate-catch"])
579
+ }, 8, ["visible", "modelValue", "formdata", "form-items", "dialog-form-props", "validate-catch"])
566
580
  ]),
567
581
  _: 3
568
582
  /* FORWARDED */
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, watch, resolveComponent, openBlock, createBlock, withCtx, renderSlot, createVNode, createTextVNode, mergeProps, computed, Fragment, reactive, createElementBlock, normalizeProps, guardReactiveProps, createSlots, createCommentVNode, createElementVNode, toDisplayString } from 'vue';
1
+ import { defineComponent, watch, resolveComponent, openBlock, createBlock, withCtx, renderSlot, createVNode, createTextVNode, mergeProps, computed, Fragment, reactive, createElementBlock, normalizeProps, guardReactiveProps, createSlots, createCommentVNode, createElementVNode, toDisplayString } from 'vue';
2
2
  import { p as plus_default, e as edit_default, d as delete_default } from '../index.mjs';
3
3
  import { setData, ensetData, getValue } from '@vunk/core';
4
4
  import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
@@ -9,7 +9,7 @@ import { VkTableColumns } from '@vunk/plus/components/table-columns';
9
9
  import { CRUD } from '@vunk/shared/enum';
10
10
  import { isCallable } from '@vunk/shared/function';
11
11
  import { ElDialog, ElButton, ElPopconfirm, ElTable } from 'element-plus';
12
- import { useDeferred } from '@vunk/core/composables';
12
+ import { useModelComputed, useDeferred } from '@vunk/core/composables';
13
13
  import { VkfForm } from '@vunk/form/components/form';
14
14
  import { validateCatch } from '@vunk/form/shared/form';
15
15
  import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
@@ -68,10 +68,18 @@ const props = {
68
68
  modules: {
69
69
  type: Array,
70
70
  default: () => ["operations:add"]
71
+ },
72
+ /**
73
+ * @description 正在编辑的 dialog 表单数据
74
+ */
75
+ formdata: {
76
+ type: Object,
77
+ default: void 0
71
78
  }
72
79
  };
73
80
  const emits = {
74
- "update:modelValue": null
81
+ "update:modelValue": null,
82
+ "update:formdata": null
75
83
  };
76
84
 
77
85
  var _sfc_main$2 = /* @__PURE__ */ defineComponent({
@@ -104,14 +112,18 @@ var _sfc_main$2 = /* @__PURE__ */ defineComponent({
104
112
  validateCatch: {
105
113
  type: Function,
106
114
  default: validateCatch
107
- }
115
+ },
116
+ formdata: null
108
117
  },
109
- emits: ["update:modelValue", "update:visible", "change"],
118
+ emits: ["update:modelValue", "update:visible", "change", "update:formdata"],
110
119
  setup(__props, { expose: __expose, emit: __emit }) {
111
120
  __expose();
112
121
  const props = __props;
113
122
  const emit = __emit;
114
- const formData = ref(props.modelValue);
123
+ const formData = useModelComputed({
124
+ key: "formdata",
125
+ default: {}
126
+ }, props, emit);
115
127
  const formDef = useDeferred();
116
128
  formDef.promise.then((form) => {
117
129
  props.dialogFormProps.elRef?.(form);
@@ -488,11 +500,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
488
500
  type: "primary",
489
501
  onClick: _cache[1] || (_cache[1] = ($event) => $setup.handlePlus(-1))
490
502
  }, {
491
- default: withCtx(() => _cache[5] || (_cache[5] = [
503
+ default: withCtx(() => _cache[6] || (_cache[6] = [
492
504
  createTextVNode(" \u6DFB\u52A0 ")
493
505
  ])),
494
506
  _: 1,
495
- __: [5]
507
+ __: [6]
496
508
  })
497
509
  ])) : createCommentVNode("v-if", true),
498
510
  createVNode($setup["ElTable"], {
@@ -519,11 +531,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
519
531
  icon: $setup.Plus,
520
532
  onClick: _cache[0] || (_cache[0] = ($event) => $setup.handlePlus(-1))
521
533
  }, {
522
- default: withCtx(() => _cache[4] || (_cache[4] = [
534
+ default: withCtx(() => _cache[5] || (_cache[5] = [
523
535
  createTextVNode(" \u6DFB\u52A0 ")
524
536
  ])),
525
537
  _: 1,
526
- __: [4]
538
+ __: [5]
527
539
  }, 8, ["icon"])) : createCommentVNode("v-if", true)
528
540
  ]),
529
541
  key: "0"
@@ -537,9 +549,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
537
549
  "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => $setup.cuState.dialogVisible = $event),
538
550
  modelValue: $setup.cuState.data,
539
551
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.cuState.data = $event),
552
+ formdata: _ctx.formdata,
540
553
  "form-items": $setup.cuFormItems,
541
554
  "dialog-form-props": _ctx.dialogFormProps,
542
555
  "validate-catch": _ctx.validateCatch,
556
+ "onUpdate:formdata": _cache[4] || (_cache[4] = ($event) => _ctx.$emit("update:formdata", $event)),
543
557
  onChange: $setup.handleDialogFormChange
544
558
  }, {
545
559
  header: withCtx(() => [
@@ -558,7 +572,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
558
572
  ]),
559
573
  _: 1
560
574
  /* STABLE */
561
- }, 8, ["visible", "modelValue", "form-items", "dialog-form-props", "validate-catch"])
575
+ }, 8, ["visible", "modelValue", "formdata", "form-items", "dialog-form-props", "validate-catch"])
562
576
  ]),
563
577
  _: 3
564
578
  /* FORWARDED */
@@ -49,6 +49,13 @@ export declare const props: {
49
49
  type: PropType<Modules[]>;
50
50
  default: () => string[];
51
51
  };
52
+ /**
53
+ * @description 正在编辑的 dialog 表单数据
54
+ */
55
+ formdata: {
56
+ type: PropType<NormalObject>;
57
+ default: any;
58
+ };
52
59
  required: {
53
60
  readonly type: PropType<boolean>;
54
61
  readonly required: false;
@@ -138,4 +145,5 @@ export declare const props: {
138
145
  };
139
146
  export declare const emits: {
140
147
  'update:modelValue': any;
148
+ 'update:formdata': any;
141
149
  };
@@ -32,6 +32,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
32
32
  suffix?: string;
33
33
  }) => void;
34
34
  };
35
+ formdata: any;
35
36
  }>, {
36
37
  props: import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
37
38
  title: {
@@ -65,13 +66,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
65
66
  suffix?: string;
66
67
  }) => void;
67
68
  };
69
+ formdata: any;
68
70
  }>> & Readonly<{
69
71
  "onUpdate:visible"?: (...args: any[]) => any;
70
72
  "onUpdate:modelValue"?: (...args: any[]) => any;
71
73
  onChange?: (...args: any[]) => any;
74
+ "onUpdate:formdata"?: (...args: any[]) => any;
72
75
  }> & {}>;
73
- emit: (event: "update:modelValue" | "change" | "update:visible", ...args: any[]) => void;
74
- formData: import("vue").Ref<Record<string, any>, Record<string, any>>;
76
+ emit: (event: "update:modelValue" | "change" | "update:formdata" | "update:visible", ...args: any[]) => void;
77
+ formData: import("vue").WritableComputedRef<{}, {}>;
75
78
  formDef: {
76
79
  _ref: import("vue").ShallowRef<{
77
80
  $: import("vue").ComponentInternalInstance;
@@ -6382,7 +6385,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
6382
6385
  footer?(_: {}): any;
6383
6386
  };
6384
6387
  }) & import("vue").Plugin;
6385
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "update:visible")[], "update:modelValue" | "change" | "update:visible", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
6388
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "update:formdata" | "update:visible")[], "update:modelValue" | "change" | "update:formdata" | "update:visible", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
6386
6389
  title: {
6387
6390
  type: StringConstructor;
6388
6391
  default: string;
@@ -6414,14 +6417,17 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
6414
6417
  suffix?: string;
6415
6418
  }) => void;
6416
6419
  };
6420
+ formdata: any;
6417
6421
  }>> & Readonly<{
6418
6422
  "onUpdate:visible"?: (...args: any[]) => any;
6419
6423
  "onUpdate:modelValue"?: (...args: any[]) => any;
6420
6424
  onChange?: (...args: any[]) => any;
6425
+ "onUpdate:formdata"?: (...args: any[]) => any;
6421
6426
  }>, {
6422
6427
  visible: boolean;
6423
6428
  modelValue: Record<string, any>;
6424
6429
  formItems: unknown[];
6430
+ formdata: any;
6425
6431
  title: string;
6426
6432
  dialogFormProps: Record<string, any>;
6427
6433
  validateCatch: AnyFunc;
@@ -38,6 +38,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
38
38
  type: import("vue").PropType<import("./types").Modules[]>;
39
39
  default: () => string[];
40
40
  };
41
+ formdata: {
42
+ type: import("vue").PropType<NormalObject>;
43
+ default: any;
44
+ };
41
45
  required: {
42
46
  readonly type: import("vue").PropType<boolean>;
43
47
  readonly required: false;
@@ -161,6 +165,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
161
165
  type: import("vue").PropType<import("./types").Modules[]>;
162
166
  default: () => string[];
163
167
  };
168
+ formdata: {
169
+ type: import("vue").PropType<NormalObject>;
170
+ default: any;
171
+ };
164
172
  required: {
165
173
  readonly type: import("vue").PropType<boolean>;
166
174
  readonly required: false;
@@ -249,8 +257,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
249
257
  };
250
258
  }>> & Readonly<{
251
259
  "onUpdate:modelValue"?: (...args: any[] | unknown[]) => any;
260
+ "onUpdate:formdata"?: (...args: any[] | unknown[]) => any;
252
261
  }> & {}>;
253
- emit: ((event: "update:modelValue", ...args: unknown[]) => void) & ((event: "update:modelValue", ...args: any) => void) & ((event: "update:modelValue", ...args: any[]) => void);
262
+ emit: ((event: "update:modelValue", ...args: unknown[]) => void) & ((event: "update:modelValue", ...args: any) => void) & ((event: "update:modelValue", ...args: any[]) => void) & ((event: "update:formdata", ...args: unknown[]) => void) & ((event: "update:formdata", ...args: any) => void) & ((event: "update:formdata", ...args: any[]) => void);
254
263
  ElTable: never;
255
264
  hasColAdd: import("vue").ComputedRef<boolean>;
256
265
  formItemBindProps: import("vue").ComputedRef<{}>;
@@ -1141,6 +1150,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1141
1150
  suffix?: string;
1142
1151
  }) => void;
1143
1152
  };
1153
+ formdata: any;
1144
1154
  }>, {
1145
1155
  props: import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
1146
1156
  title: {
@@ -1174,13 +1184,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1174
1184
  suffix?: string;
1175
1185
  }) => void;
1176
1186
  };
1187
+ formdata: any;
1177
1188
  }>> & Readonly<{
1178
1189
  "onUpdate:visible"?: (...args: any[]) => any;
1179
1190
  "onUpdate:modelValue"?: (...args: any[]) => any;
1180
1191
  onChange?: (...args: any[]) => any;
1192
+ "onUpdate:formdata"?: (...args: any[]) => any;
1181
1193
  }> & {}>;
1182
- emit: (event: "update:modelValue" | "change" | "update:visible", ...args: any[]) => void;
1183
- formData: import("vue").Ref<Record<string, any>, Record<string, any>>;
1194
+ emit: (event: "update:modelValue" | "change" | "update:formdata" | "update:visible", ...args: any[]) => void;
1195
+ formData: import("vue").WritableComputedRef<{}, {}>;
1184
1196
  formDef: {
1185
1197
  _ref: import("vue").ShallowRef<{
1186
1198
  $: import("vue").ComponentInternalInstance;
@@ -7491,7 +7503,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
7491
7503
  footer?(_: {}): any;
7492
7504
  };
7493
7505
  }) & import("vue").Plugin;
7494
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "update:visible")[], "update:modelValue" | "change" | "update:visible", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
7506
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "update:formdata" | "update:visible")[], "update:modelValue" | "change" | "update:formdata" | "update:visible", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
7495
7507
  title: {
7496
7508
  type: StringConstructor;
7497
7509
  default: string;
@@ -7523,14 +7535,17 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
7523
7535
  suffix?: string;
7524
7536
  }) => void;
7525
7537
  };
7538
+ formdata: any;
7526
7539
  }>> & Readonly<{
7527
7540
  "onUpdate:visible"?: (...args: any[]) => any;
7528
7541
  "onUpdate:modelValue"?: (...args: any[]) => any;
7529
7542
  onChange?: (...args: any[]) => any;
7543
+ "onUpdate:formdata"?: (...args: any[]) => any;
7530
7544
  }>, {
7531
7545
  visible: boolean;
7532
7546
  modelValue: Record<string, any>;
7533
7547
  formItems: unknown[];
7548
+ formdata: any;
7534
7549
  title: string;
7535
7550
  dialogFormProps: Record<string, any>;
7536
7551
  validateCatch: import("@vunk/shared").AnyFunc;
@@ -7622,6 +7637,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
7622
7637
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
7623
7638
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7624
7639
  'update:modelValue': any;
7640
+ 'update:formdata': any;
7625
7641
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
7626
7642
  columns: {
7627
7643
  type: import("vue").PropType<any[]>;
@@ -7658,6 +7674,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
7658
7674
  type: import("vue").PropType<import("./types").Modules[]>;
7659
7675
  default: () => string[];
7660
7676
  };
7677
+ formdata: {
7678
+ type: import("vue").PropType<NormalObject>;
7679
+ default: any;
7680
+ };
7661
7681
  required: {
7662
7682
  readonly type: import("vue").PropType<boolean>;
7663
7683
  readonly required: false;
@@ -7746,6 +7766,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
7746
7766
  };
7747
7767
  }>> & Readonly<{
7748
7768
  "onUpdate:modelValue"?: (...args: any[] | unknown[]) => any;
7769
+ "onUpdate:formdata"?: (...args: any[] | unknown[]) => any;
7749
7770
  }>, {
7750
7771
  required: boolean;
7751
7772
  formItemSize: "default" | "small" | "large";
@@ -7768,6 +7789,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
7768
7789
  labelActions: boolean;
7769
7790
  splicable: boolean;
7770
7791
  defaultItemValue: {};
7792
+ formdata: NormalObject;
7771
7793
  dialogFormProps: Record<string, any>;
7772
7794
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
7773
7795
  export default _default;
@@ -132,7 +132,7 @@ export declare const emits: {
132
132
  validate: any;
133
133
  submit: any;
134
134
  };
135
- export declare const createOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("submit" | "setData" | "validate")[]>(emit: T2, excludes?: EX) => { [P in EX extends (infer KE)[] ? Exclude<"submit", KE> | Exclude<"setData", KE> | Exclude<"validate", KE> : "submit" | "setData" | "validate"]: {
135
+ export declare const createOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("submit" | "validate" | "setData")[]>(emit: T2, excludes?: EX) => { [P in EX extends (infer KE)[] ? Exclude<"submit", KE> | Exclude<"validate", KE> | Exclude<"setData", KE> : "submit" | "validate" | "setData"]: {
136
136
  setData: (...e: import("@vunk/core").RestParameters<T2>) => void;
137
137
  validate: (...e: import("@vunk/core").RestParameters<T2>) => void;
138
138
  submit: (...e: import("@vunk/core").RestParameters<T2>) => void;
@@ -244,8 +244,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
244
244
  disabled: BooleanConstructor;
245
245
  }>> & Readonly<{
246
246
  onSubmit?: (...args: any[] | unknown[]) => any;
247
- onSetData?: (e: import("@vunk/core").SetDataEvent) => any;
248
247
  onValidate?: (...args: any[] | unknown[]) => any;
248
+ onSetData?: (e: import("@vunk/core").SetDataEvent) => any;
249
249
  }>, {
250
250
  elRef: import("@vunk/shared").AnyFunc;
251
251
  inline: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "2.16.9",
3
+ "version": "2.16.11",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {