@vunk/form 1.4.7 → 1.4.9

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.
@@ -449,13 +449,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
449
449
  __epPropKey: true;
450
450
  };
451
451
  readonly id: {
452
- readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | [string, string]) | (() => import("element-plus/es/components/time-picker").SingleOrRange<string>) | ((new (...args: any[]) => string | [string, string]) | (() => import("element-plus/es/components/time-picker").SingleOrRange<string>))[], unknown, unknown>>;
452
+ readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | [string, string]) | (() => import("element-plus").SingleOrRange<string>) | ((new (...args: any[]) => string | [string, string]) | (() => import("element-plus").SingleOrRange<string>))[], unknown, unknown>>;
453
453
  readonly required: false;
454
454
  readonly validator: ((val: unknown) => boolean) | undefined;
455
455
  __epPropKey: true;
456
456
  };
457
457
  readonly name: {
458
- readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | [string, string]) | (() => import("element-plus/es/components/time-picker").SingleOrRange<string>) | ((new (...args: any[]) => string | [string, string]) | (() => import("element-plus/es/components/time-picker").SingleOrRange<string>))[], unknown, unknown>>;
458
+ readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | [string, string]) | (() => import("element-plus").SingleOrRange<string>) | ((new (...args: any[]) => string | [string, string]) | (() => import("element-plus").SingleOrRange<string>))[], unknown, unknown>>;
459
459
  readonly required: false;
460
460
  readonly validator: ((val: unknown) => boolean) | undefined;
461
461
  __epPropKey: true;
@@ -489,13 +489,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
489
489
  readonly startPlaceholder: StringConstructor;
490
490
  readonly endPlaceholder: StringConstructor;
491
491
  readonly defaultValue: {
492
- readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => Date | [Date, Date]) | (() => import("element-plus/es/components/time-picker").SingleOrRange<Date>) | ((new (...args: any[]) => Date | [Date, Date]) | (() => import("element-plus/es/components/time-picker").SingleOrRange<Date>))[], unknown, unknown>>;
492
+ readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => Date | [Date, Date]) | (() => import("element-plus").SingleOrRange<Date>) | ((new (...args: any[]) => Date | [Date, Date]) | (() => import("element-plus").SingleOrRange<Date>))[], unknown, unknown>>;
493
493
  readonly required: false;
494
494
  readonly validator: ((val: unknown) => boolean) | undefined;
495
495
  __epPropKey: true;
496
496
  };
497
497
  readonly defaultTime: {
498
- readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => Date | [Date, Date]) | (() => import("element-plus/es/components/time-picker").SingleOrRange<Date>) | ((new (...args: any[]) => Date | [Date, Date]) | (() => import("element-plus/es/components/time-picker").SingleOrRange<Date>))[], unknown, unknown>>;
498
+ readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => Date | [Date, Date]) | (() => import("element-plus").SingleOrRange<Date>) | ((new (...args: any[]) => Date | [Date, Date]) | (() => import("element-plus").SingleOrRange<Date>))[], unknown, unknown>>;
499
499
  readonly required: false;
500
500
  readonly validator: ((val: unknown) => boolean) | undefined;
501
501
  __epPropKey: true;
@@ -632,7 +632,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
632
632
  textareaStyle: import("vue").ComputedRef<import("vue").StyleValue>;
633
633
  autosize: import("vue").Ref<import("element-plus").InputAutoSize>;
634
634
  isComposing: import("vue").Ref<boolean>;
635
- focus: () => Promise<void>;
635
+ focus: () => void | undefined;
636
636
  blur: () => void | undefined;
637
637
  select: () => void;
638
638
  clear: () => void;
@@ -778,7 +778,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
778
778
  textareaStyle: import("vue").ComputedRef<import("vue").StyleValue>;
779
779
  autosize: import("vue").Ref<import("element-plus").InputAutoSize>;
780
780
  isComposing: import("vue").Ref<boolean>;
781
- focus: () => Promise<void>;
781
+ focus: () => void | undefined;
782
782
  blur: () => void | undefined;
783
783
  select: () => void;
784
784
  clear: () => void;
@@ -908,7 +908,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
908
908
  textareaStyle: import("vue").ComputedRef<import("vue").StyleValue>;
909
909
  autosize: import("vue").Ref<import("element-plus").InputAutoSize>;
910
910
  isComposing: import("vue").Ref<boolean>;
911
- focus: () => Promise<void>;
911
+ focus: () => void | undefined;
912
912
  blur: () => void | undefined;
913
913
  select: () => void;
914
914
  clear: () => void;
@@ -458,7 +458,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
458
458
  textareaStyle: import("vue").ComputedRef<import("vue").StyleValue>;
459
459
  autosize: import("vue").Ref<import("element-plus").InputAutoSize>;
460
460
  isComposing: import("vue").Ref<boolean>;
461
- focus: () => Promise<void>;
461
+ focus: () => void | undefined;
462
462
  blur: () => void | undefined;
463
463
  select: () => void;
464
464
  clear: () => void;
@@ -604,7 +604,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
604
604
  textareaStyle: import("vue").ComputedRef<import("vue").StyleValue>;
605
605
  autosize: import("vue").Ref<import("element-plus").InputAutoSize>;
606
606
  isComposing: import("vue").Ref<boolean>;
607
- focus: () => Promise<void>;
607
+ focus: () => void | undefined;
608
608
  blur: () => void | undefined;
609
609
  select: () => void;
610
610
  clear: () => void;
@@ -734,7 +734,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
734
734
  textareaStyle: import("vue").ComputedRef<import("vue").StyleValue>;
735
735
  autosize: import("vue").Ref<import("element-plus").InputAutoSize>;
736
736
  isComposing: import("vue").Ref<boolean>;
737
- focus: () => Promise<void>;
737
+ focus: () => void | undefined;
738
738
  blur: () => void | undefined;
739
739
  select: () => void;
740
740
  clear: () => void;
@@ -315,7 +315,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
315
315
  scrollTo: (options: ScrollToOptions | number, yCoord?: number) => void;
316
316
  setScrollLeft: (left?: number) => void;
317
317
  setScrollTop: (top?: number) => void;
318
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "select-all" | "expand-change" | "current-change" | "selection-change" | "cell-mouse-enter" | "cell-mouse-leave" | "cell-contextmenu" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick" | "header-click" | "header-contextmenu" | "sort-change" | "filter-change" | "header-dragend")[], "select" | "select-all" | "expand-change" | "current-change" | "selection-change" | "cell-mouse-enter" | "cell-mouse-leave" | "cell-contextmenu" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick" | "header-click" | "header-contextmenu" | "sort-change" | "filter-change" | "header-dragend", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
318
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("scroll" | "select" | "select-all" | "expand-change" | "current-change" | "selection-change" | "cell-mouse-enter" | "cell-mouse-leave" | "cell-contextmenu" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick" | "header-click" | "header-contextmenu" | "sort-change" | "filter-change" | "header-dragend")[], "scroll" | "select" | "select-all" | "expand-change" | "current-change" | "selection-change" | "cell-mouse-enter" | "cell-mouse-leave" | "cell-contextmenu" | "cell-click" | "cell-dblclick" | "row-click" | "row-contextmenu" | "row-dblclick" | "header-click" | "header-contextmenu" | "sort-change" | "filter-change" | "header-dragend", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
319
319
  data: {
320
320
  type: import("vue").PropType<import("element-plus/es/components/table/src/table/defaults").DefaultRow[]>;
321
321
  default: () => never[];
@@ -399,6 +399,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
399
399
  default: undefined;
400
400
  };
401
401
  }>> & {
402
+ onScroll?: ((...args: any[]) => any) | undefined;
402
403
  onSelect?: ((...args: any[]) => any) | undefined;
403
404
  "onExpand-change"?: ((...args: any[]) => any) | undefined;
404
405
  "onCurrent-change"?: ((...args: any[]) => any) | undefined;
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var vue = require('vue');
5
6
  var formItem = require('@vunk/form/components/form-item');
6
7
  var utilsVue = require('@vunk/core/shared/utils-vue');
7
8
  var elementPlus = require('element-plus');
8
- var vue = require('vue');
9
9
  var elementPlus$1 = require('@vunk/form/shared/element-plus');
10
10
  var composables = require('@vunk/form/composables');
11
11
  var _pluginVue_exportHelper = require('../_plugin-vue_export-helper.cjs');
@@ -20,6 +20,10 @@ const props = {
20
20
  unit: {
21
21
  type: String,
22
22
  default: ""
23
+ },
24
+ inputNumberSlots: {
25
+ type: Object,
26
+ default: void 0
23
27
  }
24
28
  };
25
29
  utilsVue.bindPropsFactory(props);
@@ -28,7 +32,7 @@ const emits = {
28
32
  };
29
33
  utilsVue.onEmitsFactory(emits);
30
34
 
31
- var _sfc_main = vue.defineComponent({
35
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
32
36
  name: "VkfInputNumber",
33
37
  components: {
34
38
  VkfFormItem: formItem.VkfFormItem,
@@ -36,24 +40,34 @@ var _sfc_main = vue.defineComponent({
36
40
  },
37
41
  props,
38
42
  emits,
39
- setup(props2, { emit }) {
43
+ setup(props2, {
44
+ emit
45
+ }) {
40
46
  const iBindProps = elementPlus$1.createInputNumberBindProps(props2, ["disabled", "readonly"]);
41
47
  const iOnEmits = elementPlus$1.createInputNumberOnEmits(emit);
42
48
  const formItemBindProps = formItem._VkfFormItemCtx.createBindProps(props2);
43
49
  const readonly = composables.useComputedReadonly(props2);
50
+ const theInputNumberSlots = vue.computed(() => {
51
+ if (
52
+ // if there is no suffix slot and there is a unit
53
+ !props2.inputNumberSlots?.suffix && props2.unit) {
54
+ return {
55
+ ...props2.inputNumberSlots,
56
+ suffix: () => vue.createVNode("span", null, [props2.unit])
57
+ };
58
+ }
59
+ return props2.inputNumberSlots;
60
+ });
44
61
  return {
45
62
  formItemBindProps,
46
63
  iBindProps,
47
64
  iOnEmits,
48
- readonly
65
+ readonly,
66
+ theInputNumberSlots
49
67
  };
50
68
  }
51
69
  });
52
70
 
53
- const _hoisted_1 = {
54
- key: 0,
55
- class: "vkf-input-number-unit"
56
- };
57
71
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
58
72
  const _component_ElInputNumber = vue.resolveComponent("ElInputNumber");
59
73
  const _component_VkfFormItem = vue.resolveComponent("VkfFormItem");
@@ -69,14 +83,19 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
69
83
  }, _ctx.iBindProps, {
70
84
  readonly: _ctx.readonly,
71
85
  disabled: _ctx.readonly || _ctx.disabled
72
- }, vue.toHandlers(_ctx.iOnEmits)), null, 16, ["class", "readonly", "disabled"]),
73
- _ctx.unit ? (vue.openBlock(), vue.createElementBlock(
74
- "span",
75
- _hoisted_1,
76
- vue.toDisplayString(_ctx.unit),
77
- 1
78
- /* TEXT */
79
- )) : vue.createCommentVNode("v-if", true)
86
+ }, vue.toHandlers(_ctx.iOnEmits)), vue.createSlots({
87
+ _: 2
88
+ /* DYNAMIC */
89
+ }, [
90
+ vue.renderList(_ctx.theInputNumberSlots, (item, key) => {
91
+ return {
92
+ name: key,
93
+ fn: vue.withCtx((e) => [
94
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item?.(e))))
95
+ ])
96
+ };
97
+ })
98
+ ]), 1040, ["class", "readonly", "disabled"])
80
99
  ]),
81
100
  _: 1
82
101
  /* STABLE */
@@ -1,6 +1,3 @@
1
- .vkf-input-number-unit{
2
- margin-left: 6px;
3
- }
4
1
  .el-input-number.is-readonly{
5
2
  --el-readonly-cursor: text;
6
3
  --el-disabled-bg-color: initial;
@@ -1,7 +1,7 @@
1
+ import { defineComponent, computed, createVNode, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, mergeProps, toHandlers, createSlots, renderList, resolveDynamicComponent } from 'vue';
1
2
  import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
2
3
  import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
3
4
  import { inputNumberProps, inputNumberEmits, ElInputNumber } from 'element-plus';
4
- import { defineComponent, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, createVNode, mergeProps, toHandlers, createElementBlock, toDisplayString, createCommentVNode } from 'vue';
5
5
  import { createInputNumberBindProps, createInputNumberOnEmits } from '@vunk/form/shared/element-plus';
6
6
  import { useComputedReadonly } from '@vunk/form/composables';
7
7
  import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
@@ -16,6 +16,10 @@ const props = {
16
16
  unit: {
17
17
  type: String,
18
18
  default: ""
19
+ },
20
+ inputNumberSlots: {
21
+ type: Object,
22
+ default: void 0
19
23
  }
20
24
  };
21
25
  bindPropsFactory(props);
@@ -24,7 +28,7 @@ const emits = {
24
28
  };
25
29
  onEmitsFactory(emits);
26
30
 
27
- var _sfc_main = defineComponent({
31
+ var _sfc_main = /* @__PURE__ */ defineComponent({
28
32
  name: "VkfInputNumber",
29
33
  components: {
30
34
  VkfFormItem,
@@ -32,24 +36,34 @@ var _sfc_main = defineComponent({
32
36
  },
33
37
  props,
34
38
  emits,
35
- setup(props2, { emit }) {
39
+ setup(props2, {
40
+ emit
41
+ }) {
36
42
  const iBindProps = createInputNumberBindProps(props2, ["disabled", "readonly"]);
37
43
  const iOnEmits = createInputNumberOnEmits(emit);
38
44
  const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
39
45
  const readonly = useComputedReadonly(props2);
46
+ const theInputNumberSlots = computed(() => {
47
+ if (
48
+ // if there is no suffix slot and there is a unit
49
+ !props2.inputNumberSlots?.suffix && props2.unit) {
50
+ return {
51
+ ...props2.inputNumberSlots,
52
+ suffix: () => createVNode("span", null, [props2.unit])
53
+ };
54
+ }
55
+ return props2.inputNumberSlots;
56
+ });
40
57
  return {
41
58
  formItemBindProps,
42
59
  iBindProps,
43
60
  iOnEmits,
44
- readonly
61
+ readonly,
62
+ theInputNumberSlots
45
63
  };
46
64
  }
47
65
  });
48
66
 
49
- const _hoisted_1 = {
50
- key: 0,
51
- class: "vkf-input-number-unit"
52
- };
53
67
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
54
68
  const _component_ElInputNumber = resolveComponent("ElInputNumber");
55
69
  const _component_VkfFormItem = resolveComponent("VkfFormItem");
@@ -65,14 +79,19 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
65
79
  }, _ctx.iBindProps, {
66
80
  readonly: _ctx.readonly,
67
81
  disabled: _ctx.readonly || _ctx.disabled
68
- }, toHandlers(_ctx.iOnEmits)), null, 16, ["class", "readonly", "disabled"]),
69
- _ctx.unit ? (openBlock(), createElementBlock(
70
- "span",
71
- _hoisted_1,
72
- toDisplayString(_ctx.unit),
73
- 1
74
- /* TEXT */
75
- )) : createCommentVNode("v-if", true)
82
+ }, toHandlers(_ctx.iOnEmits)), createSlots({
83
+ _: 2
84
+ /* DYNAMIC */
85
+ }, [
86
+ renderList(_ctx.theInputNumberSlots, (item, key) => {
87
+ return {
88
+ name: key,
89
+ fn: withCtx((e) => [
90
+ (openBlock(), createBlock(resolveDynamicComponent(item?.(e))))
91
+ ])
92
+ };
93
+ })
94
+ ]), 1040, ["class", "readonly", "disabled"])
76
95
  ]),
77
96
  _: 1
78
97
  /* STABLE */
@@ -1,3 +1,5 @@
1
+ import { PropType } from 'vue';
2
+ import { InputNumberSlots } from './types';
1
3
  export declare const props: {
2
4
  readonly: {
3
5
  type: BooleanConstructor;
@@ -7,6 +9,10 @@ export declare const props: {
7
9
  type: StringConstructor;
8
10
  default: string;
9
11
  };
12
+ inputNumberSlots: {
13
+ type: PropType<InputNumberSlots>;
14
+ default: any;
15
+ };
10
16
  ariaLabel: StringConstructor;
11
17
  id: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
12
18
  step: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
@@ -35,15 +41,15 @@ export declare const props: {
35
41
  validateEvent: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
36
42
  required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
37
43
  formItemSize: {
38
- type: import("vue").PropType<"default" | "small" | "large">;
44
+ type: PropType<"default" | "small" | "large">;
39
45
  default: "default" | "small" | "large";
40
46
  };
41
47
  formItemSlots: {
42
- type: import("vue").PropType<import("@vunk/form/components/form-item/src/types").FormItemSlots>;
48
+ type: PropType<import("@vunk/form/components/form-item/src/types").FormItemSlots>;
43
49
  default: any;
44
50
  };
45
51
  elRef: {
46
- type: import("vue").PropType<any>;
52
+ type: PropType<any>;
47
53
  required: boolean;
48
54
  };
49
55
  inline: {
@@ -51,7 +57,7 @@ export declare const props: {
51
57
  default: boolean;
52
58
  };
53
59
  labelPosition: {
54
- type: import("vue").PropType<"right">;
60
+ type: PropType<"right">;
55
61
  default: string;
56
62
  };
57
63
  label: StringConstructor;
@@ -79,7 +85,7 @@ export declare const props: {
79
85
  inlineMessage: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, BooleanConstructor], unknown, unknown, "", boolean>;
80
86
  showMessage: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
81
87
  };
82
- export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"size", keyof T2> | Extract<"disabled", keyof T2> | Extract<"required", keyof T2> | Extract<"name", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"prop", keyof T2> | Extract<"rules", keyof T2> | Extract<"error", keyof T2> | Extract<"validateStatus", keyof T2> | Extract<"for", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"min", keyof T2> | Extract<"max", keyof T2> | Extract<"id", keyof T2> | Extract<"valueOnClear", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"validateEvent", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"ariaLabel", keyof T2> | Extract<"step", keyof T2> | Extract<"controls", keyof T2> | Extract<"stepStrictly", keyof T2> | Extract<"controlsPosition", keyof T2> | Extract<"precision", keyof T2> | Extract<"unit", keyof T2>)[]>(propsArg: T2, excludes?: EX) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"size" | "disabled" | "required" | "name" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "labelPosition" | "label" | "labelWidth" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "min" | "max" | "id" | "valueOnClear" | "placeholder" | "validateEvent" | "modelValue" | "ariaLabel" | "step" | "controls" | "stepStrictly" | "controlsPosition" | "precision" | "unit", keyof T2>, KE> : Extract<"size" | "disabled" | "required" | "name" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "labelPosition" | "label" | "labelWidth" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "min" | "max" | "id" | "valueOnClear" | "placeholder" | "validateEvent" | "modelValue" | "ariaLabel" | "step" | "controls" | "stepStrictly" | "controlsPosition" | "precision" | "unit", keyof T2>]: { [k in Extract<"size" | "disabled" | "required" | "name" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "labelPosition" | "label" | "labelWidth" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "min" | "max" | "id" | "valueOnClear" | "placeholder" | "validateEvent" | "modelValue" | "ariaLabel" | "step" | "controls" | "stepStrictly" | "controlsPosition" | "precision" | "unit", keyof T2>]: T2[k]; }[P]; }>;
88
+ export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"size", keyof T2> | Extract<"disabled", keyof T2> | Extract<"required", keyof T2> | Extract<"name", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"labelPosition", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"prop", keyof T2> | Extract<"rules", keyof T2> | Extract<"error", keyof T2> | Extract<"validateStatus", keyof T2> | Extract<"for", keyof T2> | Extract<"inlineMessage", keyof T2> | Extract<"showMessage", keyof T2> | Extract<"min", keyof T2> | Extract<"max", keyof T2> | Extract<"id", keyof T2> | Extract<"valueOnClear", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"validateEvent", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"ariaLabel", keyof T2> | Extract<"step", keyof T2> | Extract<"controls", keyof T2> | Extract<"stepStrictly", keyof T2> | Extract<"controlsPosition", keyof T2> | Extract<"precision", keyof T2> | Extract<"unit", keyof T2> | Extract<"inputNumberSlots", keyof T2>)[]>(propsArg: T2, excludes?: EX) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"size" | "disabled" | "required" | "name" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "labelPosition" | "label" | "labelWidth" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "min" | "max" | "id" | "valueOnClear" | "placeholder" | "validateEvent" | "modelValue" | "ariaLabel" | "step" | "controls" | "stepStrictly" | "controlsPosition" | "precision" | "unit" | "inputNumberSlots", keyof T2>, KE> : Extract<"size" | "disabled" | "required" | "name" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "labelPosition" | "label" | "labelWidth" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "min" | "max" | "id" | "valueOnClear" | "placeholder" | "validateEvent" | "modelValue" | "ariaLabel" | "step" | "controls" | "stepStrictly" | "controlsPosition" | "precision" | "unit" | "inputNumberSlots", keyof T2>]: { [k in Extract<"size" | "disabled" | "required" | "name" | "formItemSize" | "formItemSlots" | "elRef" | "inline" | "readonly" | "labelPosition" | "label" | "labelWidth" | "prop" | "rules" | "error" | "validateStatus" | "for" | "inlineMessage" | "showMessage" | "min" | "max" | "id" | "valueOnClear" | "placeholder" | "validateEvent" | "modelValue" | "ariaLabel" | "step" | "controls" | "stepStrictly" | "controlsPosition" | "precision" | "unit" | "inputNumberSlots", keyof T2>]: T2[k]; }[P]; }>;
83
89
  export declare const emits: {
84
90
  change: (cur: number | undefined, prev: number | undefined) => boolean;
85
91
  blur: (e: FocusEvent) => boolean;
@@ -7,6 +7,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
7
7
  type: StringConstructor;
8
8
  default: string;
9
9
  };
10
+ inputNumberSlots: {
11
+ type: import("vue").PropType<import("./types").InputNumberSlots>;
12
+ default: any;
13
+ };
10
14
  ariaLabel: StringConstructor;
11
15
  id: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
12
16
  step: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
@@ -99,6 +103,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
99
103
  }>;
100
104
  iOnEmits: {};
101
105
  readonly: import("vue").ComputedRef<boolean>;
106
+ theInputNumberSlots: import("vue").ComputedRef<import("./types").InputNumberSlots>;
102
107
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
103
108
  change: (cur: number | undefined, prev: number | undefined) => boolean;
104
109
  blur: (e: FocusEvent) => boolean;
@@ -114,6 +119,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
114
119
  type: StringConstructor;
115
120
  default: string;
116
121
  };
122
+ inputNumberSlots: {
123
+ type: import("vue").PropType<import("./types").InputNumberSlots>;
124
+ default: any;
125
+ };
117
126
  ariaLabel: StringConstructor;
118
127
  id: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
119
128
  step: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
@@ -212,6 +221,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
212
221
  stepStrictly: boolean;
213
222
  controlsPosition: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "right", unknown>;
214
223
  unit: string;
224
+ inputNumberSlots: import("./types").InputNumberSlots;
215
225
  }, {}, {
216
226
  VkfFormItem: {
217
227
  new (...args: any[]): any;
@@ -1,8 +1,12 @@
1
1
  import { BasicSource } from '@vunk/form/shared';
2
- import { VueComponentPropsType } from '@vunk/core';
2
+ import { Func, VueComponentPropsType } from '@vunk/core';
3
3
  import VkfInputNumber from './index.vue';
4
4
  export interface Source<P extends string = string> extends VueComponentPropsType<typeof VkfInputNumber>, BasicSource {
5
5
  prop: P;
6
6
  templateType: 'VkfInputNumber';
7
7
  }
8
+ export type InputNumberSlots = {
9
+ prefix?: Func;
10
+ suffix?: Func;
11
+ };
8
12
  export {};
@@ -25,7 +25,14 @@ const props = {
25
25
  type: String,
26
26
  default: ""
27
27
  },
28
- defaultModelValue: null
28
+ defaultModelValue: null,
29
+ /**
30
+ * multiple模式下,是否将选中的值转为字符串
31
+ */
32
+ stringify: {
33
+ type: Boolean,
34
+ default: false
35
+ }
29
36
  };
30
37
  const emits = {
31
38
  ...elementPlus.selectEmits
@@ -43,8 +50,32 @@ var _sfc_main = vue.defineComponent({
43
50
  setup(props2, { emit }) {
44
51
  const formItemBindProps = formItem._VkfFormItemCtx.createBindProps(props2);
45
52
  const selectBindProps = elementPlus.createSelectBindProps(props2, ["disabled", "modelValue"]);
46
- const selectOnEmits = elementPlus.createSelectOnEmits(emit);
53
+ const selectOnEmits = elementPlus.createSelectOnEmits(emit, ["update:modelValue"]);
47
54
  const readonly = composables.useComputedReadonly(props2);
55
+ const theModelValue = vue.computed({
56
+ get: () => {
57
+ if (props2.multiple && props2.stringify && typeof props2.modelValue === "string") {
58
+ return props2.modelValue ? props2.modelValue.split(",") : [];
59
+ }
60
+ return props2.modelValue ?? props2.defaultModelValue;
61
+ },
62
+ set: (modelValue) => {
63
+ if (props2.multiple && props2.stringify && Array.isArray(modelValue)) {
64
+ const value = modelValue.reduce((a, v) => {
65
+ if (typeof v === "string") {
66
+ a.push(v);
67
+ } else if (utilsObject.isNotEmptyObject(v) && v[props2.valueKey] !== void 0) {
68
+ a.push(v[props2.valueKey]);
69
+ }
70
+ return a;
71
+ }, []).join(",");
72
+ emit("update:modelValue", value);
73
+ return;
74
+ }
75
+ emit("update:modelValue", modelValue);
76
+ }
77
+ });
78
+ props2.modelValue === void 0 && props2.defaultModelValue && theModelValue.value === props2.defaultModelValue;
48
79
  const optionsFromUrl = vue.ref([]);
49
80
  const rUrlOptions = (url) => {
50
81
  if (url) {
@@ -89,7 +120,8 @@ var _sfc_main = vue.defineComponent({
89
120
  selectOnEmits,
90
121
  selectOptions,
91
122
  reshow,
92
- readonly
123
+ readonly,
124
+ theModelValue
93
125
  };
94
126
  }
95
127
  });
@@ -104,7 +136,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
104
136
  {
105
137
  default: vue.withCtx(() => [
106
138
  _ctx.reshow ? (vue.openBlock(), vue.createBlock(_component_ElSelect, vue.mergeProps({ key: 0 }, _ctx.selectBindProps, {
107
- "model-value": _ctx.defaultModelValue ?? _ctx.modelValue,
139
+ modelValue: _ctx.theModelValue,
140
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.theModelValue = $event),
108
141
  disabled: _ctx.readonly || _ctx.disabled,
109
142
  class: {
110
143
  "is-readonly": _ctx.readonly
@@ -140,7 +173,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
140
173
  ])
141
174
  };
142
175
  })
143
- ]), 1040, ["model-value", "disabled", "class"])) : vue.createCommentVNode("v-if", true),
176
+ ]), 1040, ["modelValue", "disabled", "class"])) : vue.createCommentVNode("v-if", true),
144
177
  vue.renderSlot(_ctx.$slots, "default")
145
178
  ]),
146
179
  _: 3
@@ -1,8 +1,8 @@
1
1
  import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
2
2
  import { selectProps, selectEmits, createSelectBindProps, createSelectOnEmits } from '@vunk/form/shared/element-plus';
3
- import { defineComponent, ref, watch, computed, nextTick, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, mergeProps, toHandlers, createSlots, createElementBlock, Fragment, renderList, resolveDynamicComponent, createCommentVNode, renderSlot } from 'vue';
3
+ import { defineComponent, computed, ref, watch, nextTick, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, mergeProps, toHandlers, createSlots, createElementBlock, Fragment, renderList, resolveDynamicComponent, createCommentVNode, renderSlot } from 'vue';
4
4
  import { ElSelect, ElOption } from 'element-plus';
5
- import { isPlainObject } from '@vunk/core/shared/utils-object';
5
+ import { isNotEmptyObject, isPlainObject } from '@vunk/core/shared/utils-object';
6
6
  import { useComputedReadonly } from '@vunk/form/composables';
7
7
  import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
8
8
 
@@ -21,7 +21,14 @@ const props = {
21
21
  type: String,
22
22
  default: ""
23
23
  },
24
- defaultModelValue: null
24
+ defaultModelValue: null,
25
+ /**
26
+ * multiple模式下,是否将选中的值转为字符串
27
+ */
28
+ stringify: {
29
+ type: Boolean,
30
+ default: false
31
+ }
25
32
  };
26
33
  const emits = {
27
34
  ...selectEmits
@@ -39,8 +46,32 @@ var _sfc_main = defineComponent({
39
46
  setup(props2, { emit }) {
40
47
  const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
41
48
  const selectBindProps = createSelectBindProps(props2, ["disabled", "modelValue"]);
42
- const selectOnEmits = createSelectOnEmits(emit);
49
+ const selectOnEmits = createSelectOnEmits(emit, ["update:modelValue"]);
43
50
  const readonly = useComputedReadonly(props2);
51
+ const theModelValue = computed({
52
+ get: () => {
53
+ if (props2.multiple && props2.stringify && typeof props2.modelValue === "string") {
54
+ return props2.modelValue ? props2.modelValue.split(",") : [];
55
+ }
56
+ return props2.modelValue ?? props2.defaultModelValue;
57
+ },
58
+ set: (modelValue) => {
59
+ if (props2.multiple && props2.stringify && Array.isArray(modelValue)) {
60
+ const value = modelValue.reduce((a, v) => {
61
+ if (typeof v === "string") {
62
+ a.push(v);
63
+ } else if (isNotEmptyObject(v) && v[props2.valueKey] !== void 0) {
64
+ a.push(v[props2.valueKey]);
65
+ }
66
+ return a;
67
+ }, []).join(",");
68
+ emit("update:modelValue", value);
69
+ return;
70
+ }
71
+ emit("update:modelValue", modelValue);
72
+ }
73
+ });
74
+ props2.modelValue === void 0 && props2.defaultModelValue && theModelValue.value === props2.defaultModelValue;
44
75
  const optionsFromUrl = ref([]);
45
76
  const rUrlOptions = (url) => {
46
77
  if (url) {
@@ -85,7 +116,8 @@ var _sfc_main = defineComponent({
85
116
  selectOnEmits,
86
117
  selectOptions,
87
118
  reshow,
88
- readonly
119
+ readonly,
120
+ theModelValue
89
121
  };
90
122
  }
91
123
  });
@@ -100,7 +132,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
100
132
  {
101
133
  default: withCtx(() => [
102
134
  _ctx.reshow ? (openBlock(), createBlock(_component_ElSelect, mergeProps({ key: 0 }, _ctx.selectBindProps, {
103
- "model-value": _ctx.defaultModelValue ?? _ctx.modelValue,
135
+ modelValue: _ctx.theModelValue,
136
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.theModelValue = $event),
104
137
  disabled: _ctx.readonly || _ctx.disabled,
105
138
  class: {
106
139
  "is-readonly": _ctx.readonly
@@ -136,7 +169,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
136
169
  ])
137
170
  };
138
171
  })
139
- ]), 1040, ["model-value", "disabled", "class"])) : createCommentVNode("v-if", true),
172
+ ]), 1040, ["modelValue", "disabled", "class"])) : createCommentVNode("v-if", true),
140
173
  renderSlot(_ctx.$slots, "default")
141
174
  ]),
142
175
  _: 3
@@ -16,6 +16,13 @@ export declare const props: {
16
16
  default: string;
17
17
  };
18
18
  defaultModelValue: any;
19
+ /**
20
+ * multiple模式下,是否将选中的值转为字符串
21
+ */
22
+ stringify: {
23
+ type: BooleanConstructor;
24
+ default: boolean;
25
+ };
19
26
  name: StringConstructor;
20
27
  id: StringConstructor;
21
28
  modelValue: {