@vunk/form 2.16.0 → 2.16.1

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.
@@ -22,7 +22,13 @@ const props = {
22
22
  type: Object,
23
23
  default: void 0
24
24
  },
25
+ /**
26
+ * @description el组件实例ref
27
+ */
25
28
  selectRef: null,
29
+ /**
30
+ * @description a url which's response is options
31
+ */
26
32
  optionsUrl: {
27
33
  type: String,
28
34
  default: ""
@@ -34,7 +40,17 @@ const props = {
34
40
  type: Boolean,
35
41
  default: false
36
42
  },
37
- slots: null
43
+ /**
44
+ * @description 同插槽
45
+ */
46
+ slots: null,
47
+ /**
48
+ * @description 若 option中含有该字段内容,则渲染为 Group
49
+ */
50
+ optionChildrenProp: {
51
+ type: String,
52
+ default: ""
53
+ }
38
54
  };
39
55
  const createBindProps = utilsVue.bindPropsFactory(props);
40
56
  const emits = {
@@ -50,12 +66,56 @@ var ctx = /*#__PURE__*/Object.freeze({
50
66
  props: props
51
67
  });
52
68
 
69
+ function _isSlot(s) {
70
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
71
+ }
72
+ var _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
73
+ props: {
74
+ data: {
75
+ type: Array,
76
+ required: true
77
+ },
78
+ optionChildrenProp: {
79
+ type: String,
80
+ default: ""
81
+ }
82
+ },
83
+ setup(props, {
84
+ slots
85
+ }) {
86
+ const ItemView = item => {
87
+ let _slot;
88
+ const isGroup = props.optionChildrenProp && Array.isArray(item[props.optionChildrenProp]) && item[props.optionChildrenProp].length > 0;
89
+ return isGroup ? vue.createVNode(elementPlus$1.ElOptionGroup, {
90
+ "label": item.label,
91
+ "key": item.value || item.label,
92
+ "disabled": item.disabled
93
+ }, _isSlot(_slot = item[props.optionChildrenProp].map(childOption => vue.createVNode(ItemView, vue.mergeProps({
94
+ "key": childOption.value
95
+ }, childOption), null))) ? _slot : {
96
+ default: () => [_slot]
97
+ }) : vue.createVNode(elementPlus$1.ElOption, vue.mergeProps({
98
+ "key": item.value,
99
+ "value": item.value
100
+ }, item), {
101
+ default: () => slots.option ? slots.option(item) : item.label
102
+ });
103
+ };
104
+ return () => {
105
+ return props.data.map(item => ItemView(item));
106
+ };
107
+ }
108
+ });
109
+
110
+ var Options = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$2, [["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/select/src/options.vue"]]);
111
+
53
112
  var _sfc_main$1 = vue.defineComponent({
54
113
  name: "VkfSelect",
55
114
  components: {
56
115
  VkfFormItem: formItem.VkfFormItem,
57
116
  ElSelect: elementPlus$1.ElSelect,
58
- ElOption: elementPlus$1.ElOption
117
+ ElOption: elementPlus$1.ElOption,
118
+ Options
59
119
  },
60
120
  props,
61
121
  emits,
@@ -138,7 +198,7 @@ var _sfc_main$1 = vue.defineComponent({
138
198
  });
139
199
 
140
200
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
141
- const _component_ElOption = vue.resolveComponent("ElOption");
201
+ const _component_Options = vue.resolveComponent("Options");
142
202
  const _component_ElSelect = vue.resolveComponent("ElSelect");
143
203
  const _component_VkfFormItem = vue.resolveComponent("VkfFormItem");
144
204
  return vue.openBlock(), vue.createBlock(
@@ -156,29 +216,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
156
216
  }
157
217
  }, vue.toHandlers(_ctx.selectOnEmits)), vue.createSlots({
158
218
  default: vue.withCtx(() => [
159
- (vue.openBlock(true), vue.createElementBlock(
160
- vue.Fragment,
161
- null,
162
- vue.renderList(_ctx.selectOptions, (item) => {
163
- return vue.openBlock(), vue.createBlock(
164
- _component_ElOption,
165
- vue.mergeProps({ ref_for: true }, item, {
166
- key: item.key
167
- }),
168
- {
169
- default: vue.withCtx(() => [
170
- vue.renderSlot(_ctx.$slots, "option", vue.mergeProps({ ref_for: true }, item))
171
- ]),
172
- _: 2
173
- /* DYNAMIC */
174
- },
175
- 1040
176
- /* FULL_PROPS, DYNAMIC_SLOTS */
177
- );
178
- }),
179
- 128
180
- /* KEYED_FRAGMENT */
181
- ))
219
+ vue.createVNode(_component_Options, {
220
+ data: _ctx.selectOptions,
221
+ "option-children-prop": _ctx.optionChildrenProp
222
+ }, {
223
+ option: vue.withCtx((e) => [
224
+ vue.renderSlot(_ctx.$slots, "option", vue.normalizeProps(vue.guardReactiveProps(e)))
225
+ ]),
226
+ _: 3
227
+ /* FORWARDED */
228
+ }, 8, ["data", "option-children-prop"]),
229
+ vue.renderSlot(_ctx.$slots, "footer")
182
230
  ]),
183
231
  _: 2
184
232
  /* DYNAMIC */
@@ -1,8 +1,8 @@
1
- import { defineComponent, computed, ref, watch, nextTick, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, mergeProps, toHandlers, createSlots, createElementBlock, Fragment, renderList, renderSlot, resolveDynamicComponent, createCommentVNode, h } from 'vue';
1
+ import { defineComponent, createVNode, mergeProps, isVNode, computed, ref, watch, nextTick, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, toHandlers, createSlots, renderSlot, renderList, resolveDynamicComponent, createCommentVNode, h } from 'vue';
2
2
  import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
3
3
  import { selectProps, selectEmits, createSelectBindProps, createSelectOnEmits } from '@vunk/form/shared/element-plus';
4
4
  import { bindPropsFactory, onEmitsFactory, vOn } from '@vunk/core/shared/utils-vue';
5
- import { ElSelect, ElOption } from 'element-plus';
5
+ import { ElOptionGroup, ElOption, ElSelect } from 'element-plus';
6
6
  import { isNotEmptyObject, isPlainObject } from '@vunk/core/shared/utils-object';
7
7
  import { useComputedReadonly } from '@vunk/form/composables';
8
8
  import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
@@ -18,7 +18,13 @@ const props = {
18
18
  type: Object,
19
19
  default: void 0
20
20
  },
21
+ /**
22
+ * @description el组件实例ref
23
+ */
21
24
  selectRef: null,
25
+ /**
26
+ * @description a url which's response is options
27
+ */
22
28
  optionsUrl: {
23
29
  type: String,
24
30
  default: ""
@@ -30,7 +36,17 @@ const props = {
30
36
  type: Boolean,
31
37
  default: false
32
38
  },
33
- slots: null
39
+ /**
40
+ * @description 同插槽
41
+ */
42
+ slots: null,
43
+ /**
44
+ * @description 若 option中含有该字段内容,则渲染为 Group
45
+ */
46
+ optionChildrenProp: {
47
+ type: String,
48
+ default: ""
49
+ }
34
50
  };
35
51
  const createBindProps = bindPropsFactory(props);
36
52
  const emits = {
@@ -46,12 +62,56 @@ var ctx = /*#__PURE__*/Object.freeze({
46
62
  props: props
47
63
  });
48
64
 
65
+ function _isSlot(s) {
66
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
67
+ }
68
+ var _sfc_main$2 = /* @__PURE__ */ defineComponent({
69
+ props: {
70
+ data: {
71
+ type: Array,
72
+ required: true
73
+ },
74
+ optionChildrenProp: {
75
+ type: String,
76
+ default: ""
77
+ }
78
+ },
79
+ setup(props, {
80
+ slots
81
+ }) {
82
+ const ItemView = item => {
83
+ let _slot;
84
+ const isGroup = props.optionChildrenProp && Array.isArray(item[props.optionChildrenProp]) && item[props.optionChildrenProp].length > 0;
85
+ return isGroup ? createVNode(ElOptionGroup, {
86
+ "label": item.label,
87
+ "key": item.value || item.label,
88
+ "disabled": item.disabled
89
+ }, _isSlot(_slot = item[props.optionChildrenProp].map(childOption => createVNode(ItemView, mergeProps({
90
+ "key": childOption.value
91
+ }, childOption), null))) ? _slot : {
92
+ default: () => [_slot]
93
+ }) : createVNode(ElOption, mergeProps({
94
+ "key": item.value,
95
+ "value": item.value
96
+ }, item), {
97
+ default: () => slots.option ? slots.option(item) : item.label
98
+ });
99
+ };
100
+ return () => {
101
+ return props.data.map(item => ItemView(item));
102
+ };
103
+ }
104
+ });
105
+
106
+ var Options = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/select/src/options.vue"]]);
107
+
49
108
  var _sfc_main$1 = defineComponent({
50
109
  name: "VkfSelect",
51
110
  components: {
52
111
  VkfFormItem,
53
112
  ElSelect,
54
- ElOption
113
+ ElOption,
114
+ Options
55
115
  },
56
116
  props,
57
117
  emits,
@@ -134,7 +194,7 @@ var _sfc_main$1 = defineComponent({
134
194
  });
135
195
 
136
196
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
137
- const _component_ElOption = resolveComponent("ElOption");
197
+ const _component_Options = resolveComponent("Options");
138
198
  const _component_ElSelect = resolveComponent("ElSelect");
139
199
  const _component_VkfFormItem = resolveComponent("VkfFormItem");
140
200
  return openBlock(), createBlock(
@@ -152,29 +212,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
152
212
  }
153
213
  }, toHandlers(_ctx.selectOnEmits)), createSlots({
154
214
  default: withCtx(() => [
155
- (openBlock(true), createElementBlock(
156
- Fragment,
157
- null,
158
- renderList(_ctx.selectOptions, (item) => {
159
- return openBlock(), createBlock(
160
- _component_ElOption,
161
- mergeProps({ ref_for: true }, item, {
162
- key: item.key
163
- }),
164
- {
165
- default: withCtx(() => [
166
- renderSlot(_ctx.$slots, "option", mergeProps({ ref_for: true }, item))
167
- ]),
168
- _: 2
169
- /* DYNAMIC */
170
- },
171
- 1040
172
- /* FULL_PROPS, DYNAMIC_SLOTS */
173
- );
174
- }),
175
- 128
176
- /* KEYED_FRAGMENT */
177
- ))
215
+ createVNode(_component_Options, {
216
+ data: _ctx.selectOptions,
217
+ "option-children-prop": _ctx.optionChildrenProp
218
+ }, {
219
+ option: withCtx((e) => [
220
+ renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps(e)))
221
+ ]),
222
+ _: 3
223
+ /* FORWARDED */
224
+ }, 8, ["data", "option-children-prop"]),
225
+ renderSlot(_ctx.$slots, "footer")
178
226
  ]),
179
227
  _: 2
180
228
  /* DYNAMIC */
@@ -18,6 +18,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
18
18
  default: boolean;
19
19
  };
20
20
  slots: any;
21
+ optionChildrenProp: {
22
+ type: StringConstructor;
23
+ default: string;
24
+ };
21
25
  name: StringConstructor;
22
26
  id: StringConstructor;
23
27
  modelValue: {
@@ -444,6 +448,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
444
448
  default: boolean;
445
449
  };
446
450
  slots: any;
451
+ optionChildrenProp: {
452
+ type: StringConstructor;
453
+ default: string;
454
+ };
447
455
  name: StringConstructor;
448
456
  id: StringConstructor;
449
457
  modelValue: {
@@ -848,6 +856,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
848
856
  selectSlots: import("./types").SelectSlots;
849
857
  selectRef: any;
850
858
  optionsUrl: string;
859
+ optionChildrenProp: string;
851
860
  }, {}, {
852
861
  VkfFormItem: {
853
862
  new (...args: any[]): any;
@@ -1036,5 +1045,26 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1036
1045
  disabled: boolean;
1037
1046
  created: boolean;
1038
1047
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
1048
+ Options: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
1049
+ data: {
1050
+ type: import("vue").PropType<import("@vunk/shared").NormalObject[]>;
1051
+ required: true;
1052
+ };
1053
+ optionChildrenProp: {
1054
+ type: StringConstructor;
1055
+ default: string;
1056
+ };
1057
+ }>, () => JSX.Element[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
1058
+ data: {
1059
+ type: import("vue").PropType<import("@vunk/shared").NormalObject[]>;
1060
+ required: true;
1061
+ };
1062
+ optionChildrenProp: {
1063
+ type: StringConstructor;
1064
+ default: string;
1065
+ };
1066
+ }>> & Readonly<{}>, {
1067
+ optionChildrenProp: string;
1068
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1039
1069
  }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1040
1070
  export default _default;
@@ -11,7 +11,13 @@ export declare const props: {
11
11
  type: PropType<SelectSlots>;
12
12
  default: any;
13
13
  };
14
+ /**
15
+ * @description el组件实例ref
16
+ */
14
17
  selectRef: any;
18
+ /**
19
+ * @description a url which's response is options
20
+ */
15
21
  optionsUrl: {
16
22
  type: StringConstructor;
17
23
  default: string;
@@ -23,7 +29,17 @@ export declare const props: {
23
29
  type: BooleanConstructor;
24
30
  default: boolean;
25
31
  };
32
+ /**
33
+ * @description 同插槽
34
+ */
26
35
  slots: any;
36
+ /**
37
+ * @description 若 option中含有该字段内容,则渲染为 Group
38
+ */
39
+ optionChildrenProp: {
40
+ type: StringConstructor;
41
+ default: string;
42
+ };
27
43
  name: StringConstructor;
28
44
  id: StringConstructor;
29
45
  modelValue: {
@@ -201,7 +217,7 @@ export declare const props: {
201
217
  readonly default: true;
202
218
  };
203
219
  };
204
- export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"required", keyof T2> | Extract<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"information", keyof T2> | Extract<"prop", keyof T2> | Extract<"defaultModelValue", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", 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<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"persistent", keyof T2> | Extract<"teleported", keyof T2> | Extract<"effect", keyof T2> | Extract<"popperClass", keyof T2> | Extract<"name", keyof T2> | Extract<"slots", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"clearable", keyof T2> | Extract<"multiple", keyof T2> | Extract<"stringify", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"filterMethod", keyof T2> | Extract<"loading", keyof T2> | Extract<"options", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"clearIcon", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"automaticDropdown", keyof T2> | Extract<"filterable", keyof T2> | Extract<"allowCreate", keyof T2> | Extract<"remote", keyof T2> | Extract<"loadingText", keyof T2> | Extract<"noMatchText", keyof T2> | Extract<"noDataText", keyof T2> | Extract<"remoteMethod", keyof T2> | Extract<"multipleLimit", keyof T2> | Extract<"defaultFirstOption", keyof T2> | Extract<"reserveKeyword", keyof T2> | Extract<"valueKey", keyof T2> | Extract<"collapseTags", keyof T2> | Extract<"collapseTagsTooltip", keyof T2> | Extract<"fitInputWidth", keyof T2> | Extract<"tagType", keyof T2> | Extract<"selectSlots", keyof T2> | Extract<"selectRef", keyof T2> | Extract<"optionsUrl", keyof T2>)[]>(propsArg: T2, excludes?: EX) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"required", keyof T2>, KE> | Exclude<Extract<"size", keyof T2>, KE> | Exclude<Extract<"formItemSize", keyof T2>, KE> | Exclude<Extract<"formItemSlots", keyof T2>, KE> | Exclude<Extract<"elRef", keyof T2>, KE> | Exclude<Extract<"inline", keyof T2>, KE> | Exclude<Extract<"readonly", keyof T2>, KE> | Exclude<Extract<"formItemTip", keyof T2>, KE> | Exclude<Extract<"formItemTipClass", keyof T2>, KE> | Exclude<Extract<"labelTip", keyof T2>, KE> | Exclude<Extract<"information", keyof T2>, KE> | Exclude<Extract<"prop", keyof T2>, KE> | Exclude<Extract<"defaultModelValue", keyof T2>, KE> | Exclude<Extract<"label", keyof T2>, KE> | Exclude<Extract<"labelWidth", keyof T2>, KE> | Exclude<Extract<"labelPosition", keyof T2>, KE> | Exclude<Extract<"rules", keyof T2>, KE> | Exclude<Extract<"error", keyof T2>, KE> | Exclude<Extract<"validateStatus", keyof T2>, KE> | Exclude<Extract<"for", keyof T2>, KE> | Exclude<Extract<"inlineMessage", keyof T2>, KE> | Exclude<Extract<"showMessage", keyof T2>, KE> | Exclude<Extract<"disabled", keyof T2>, KE> | Exclude<Extract<"id", keyof T2>, KE> | Exclude<Extract<"persistent", keyof T2>, KE> | Exclude<Extract<"teleported", keyof T2>, KE> | Exclude<Extract<"effect", keyof T2>, KE> | Exclude<Extract<"popperClass", keyof T2>, KE> | Exclude<Extract<"name", keyof T2>, KE> | Exclude<Extract<"slots", keyof T2>, KE> | Exclude<Extract<"modelValue", keyof T2>, KE> | Exclude<Extract<"clearable", keyof T2>, KE> | Exclude<Extract<"multiple", keyof T2>, KE> | Exclude<Extract<"stringify", keyof T2>, KE> | Exclude<Extract<"placeholder", keyof T2>, KE> | Exclude<Extract<"filterMethod", keyof T2>, KE> | Exclude<Extract<"loading", keyof T2>, KE> | Exclude<Extract<"options", keyof T2>, KE> | Exclude<Extract<"autocomplete", keyof T2>, KE> | Exclude<Extract<"clearIcon", keyof T2>, KE> | Exclude<Extract<"suffixIcon", keyof T2>, KE> | Exclude<Extract<"automaticDropdown", keyof T2>, KE> | Exclude<Extract<"filterable", keyof T2>, KE> | Exclude<Extract<"allowCreate", keyof T2>, KE> | Exclude<Extract<"remote", keyof T2>, KE> | Exclude<Extract<"loadingText", keyof T2>, KE> | Exclude<Extract<"noMatchText", keyof T2>, KE> | Exclude<Extract<"noDataText", keyof T2>, KE> | Exclude<Extract<"remoteMethod", keyof T2>, KE> | Exclude<Extract<"multipleLimit", keyof T2>, KE> | Exclude<Extract<"defaultFirstOption", keyof T2>, KE> | Exclude<Extract<"reserveKeyword", keyof T2>, KE> | Exclude<Extract<"valueKey", keyof T2>, KE> | Exclude<Extract<"collapseTags", keyof T2>, KE> | Exclude<Extract<"collapseTagsTooltip", keyof T2>, KE> | Exclude<Extract<"fitInputWidth", keyof T2>, KE> | Exclude<Extract<"tagType", keyof T2>, KE> | Exclude<Extract<"selectSlots", keyof T2>, KE> | Exclude<Extract<"selectRef", keyof T2>, KE> | Exclude<Extract<"optionsUrl", keyof T2>, KE> : Extract<"required", keyof T2> | Extract<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"information", keyof T2> | Extract<"prop", keyof T2> | Extract<"defaultModelValue", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", 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<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"persistent", keyof T2> | Extract<"teleported", keyof T2> | Extract<"effect", keyof T2> | Extract<"popperClass", keyof T2> | Extract<"name", keyof T2> | Extract<"slots", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"clearable", keyof T2> | Extract<"multiple", keyof T2> | Extract<"stringify", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"filterMethod", keyof T2> | Extract<"loading", keyof T2> | Extract<"options", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"clearIcon", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"automaticDropdown", keyof T2> | Extract<"filterable", keyof T2> | Extract<"allowCreate", keyof T2> | Extract<"remote", keyof T2> | Extract<"loadingText", keyof T2> | Extract<"noMatchText", keyof T2> | Extract<"noDataText", keyof T2> | Extract<"remoteMethod", keyof T2> | Extract<"multipleLimit", keyof T2> | Extract<"defaultFirstOption", keyof T2> | Extract<"reserveKeyword", keyof T2> | Extract<"valueKey", keyof T2> | Extract<"collapseTags", keyof T2> | Extract<"collapseTagsTooltip", keyof T2> | Extract<"fitInputWidth", keyof T2> | Extract<"tagType", keyof T2> | Extract<"selectSlots", keyof T2> | Extract<"selectRef", keyof T2> | Extract<"optionsUrl", keyof T2>]: { [k in Extract<"required", keyof T2> | Extract<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"information", keyof T2> | Extract<"prop", keyof T2> | Extract<"defaultModelValue", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", 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<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"persistent", keyof T2> | Extract<"teleported", keyof T2> | Extract<"effect", keyof T2> | Extract<"popperClass", keyof T2> | Extract<"name", keyof T2> | Extract<"slots", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"clearable", keyof T2> | Extract<"multiple", keyof T2> | Extract<"stringify", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"filterMethod", keyof T2> | Extract<"loading", keyof T2> | Extract<"options", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"clearIcon", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"automaticDropdown", keyof T2> | Extract<"filterable", keyof T2> | Extract<"allowCreate", keyof T2> | Extract<"remote", keyof T2> | Extract<"loadingText", keyof T2> | Extract<"noMatchText", keyof T2> | Extract<"noDataText", keyof T2> | Extract<"remoteMethod", keyof T2> | Extract<"multipleLimit", keyof T2> | Extract<"defaultFirstOption", keyof T2> | Extract<"reserveKeyword", keyof T2> | Extract<"valueKey", keyof T2> | Extract<"collapseTags", keyof T2> | Extract<"collapseTagsTooltip", keyof T2> | Extract<"fitInputWidth", keyof T2> | Extract<"tagType", keyof T2> | Extract<"selectSlots", keyof T2> | Extract<"selectRef", keyof T2> | Extract<"optionsUrl", keyof T2>]: T2[k]; }[P]; }>;
220
+ export declare const createBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"required", keyof T2> | Extract<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"information", keyof T2> | Extract<"prop", keyof T2> | Extract<"defaultModelValue", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", 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<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"persistent", keyof T2> | Extract<"teleported", keyof T2> | Extract<"effect", keyof T2> | Extract<"popperClass", keyof T2> | Extract<"name", keyof T2> | Extract<"slots", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"clearable", keyof T2> | Extract<"multiple", keyof T2> | Extract<"stringify", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"filterMethod", keyof T2> | Extract<"loading", keyof T2> | Extract<"options", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"clearIcon", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"automaticDropdown", keyof T2> | Extract<"filterable", keyof T2> | Extract<"allowCreate", keyof T2> | Extract<"remote", keyof T2> | Extract<"loadingText", keyof T2> | Extract<"noMatchText", keyof T2> | Extract<"noDataText", keyof T2> | Extract<"remoteMethod", keyof T2> | Extract<"multipleLimit", keyof T2> | Extract<"defaultFirstOption", keyof T2> | Extract<"reserveKeyword", keyof T2> | Extract<"valueKey", keyof T2> | Extract<"collapseTags", keyof T2> | Extract<"collapseTagsTooltip", keyof T2> | Extract<"fitInputWidth", keyof T2> | Extract<"tagType", keyof T2> | Extract<"selectSlots", keyof T2> | Extract<"selectRef", keyof T2> | Extract<"optionsUrl", keyof T2> | Extract<"optionChildrenProp", keyof T2>)[]>(propsArg: T2, excludes?: EX) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"required", keyof T2>, KE> | Exclude<Extract<"size", keyof T2>, KE> | Exclude<Extract<"formItemSize", keyof T2>, KE> | Exclude<Extract<"formItemSlots", keyof T2>, KE> | Exclude<Extract<"elRef", keyof T2>, KE> | Exclude<Extract<"inline", keyof T2>, KE> | Exclude<Extract<"readonly", keyof T2>, KE> | Exclude<Extract<"formItemTip", keyof T2>, KE> | Exclude<Extract<"formItemTipClass", keyof T2>, KE> | Exclude<Extract<"labelTip", keyof T2>, KE> | Exclude<Extract<"information", keyof T2>, KE> | Exclude<Extract<"prop", keyof T2>, KE> | Exclude<Extract<"defaultModelValue", keyof T2>, KE> | Exclude<Extract<"label", keyof T2>, KE> | Exclude<Extract<"labelWidth", keyof T2>, KE> | Exclude<Extract<"labelPosition", keyof T2>, KE> | Exclude<Extract<"rules", keyof T2>, KE> | Exclude<Extract<"error", keyof T2>, KE> | Exclude<Extract<"validateStatus", keyof T2>, KE> | Exclude<Extract<"for", keyof T2>, KE> | Exclude<Extract<"inlineMessage", keyof T2>, KE> | Exclude<Extract<"showMessage", keyof T2>, KE> | Exclude<Extract<"disabled", keyof T2>, KE> | Exclude<Extract<"id", keyof T2>, KE> | Exclude<Extract<"persistent", keyof T2>, KE> | Exclude<Extract<"teleported", keyof T2>, KE> | Exclude<Extract<"effect", keyof T2>, KE> | Exclude<Extract<"popperClass", keyof T2>, KE> | Exclude<Extract<"name", keyof T2>, KE> | Exclude<Extract<"slots", keyof T2>, KE> | Exclude<Extract<"modelValue", keyof T2>, KE> | Exclude<Extract<"clearable", keyof T2>, KE> | Exclude<Extract<"multiple", keyof T2>, KE> | Exclude<Extract<"stringify", keyof T2>, KE> | Exclude<Extract<"placeholder", keyof T2>, KE> | Exclude<Extract<"filterMethod", keyof T2>, KE> | Exclude<Extract<"loading", keyof T2>, KE> | Exclude<Extract<"options", keyof T2>, KE> | Exclude<Extract<"autocomplete", keyof T2>, KE> | Exclude<Extract<"clearIcon", keyof T2>, KE> | Exclude<Extract<"suffixIcon", keyof T2>, KE> | Exclude<Extract<"automaticDropdown", keyof T2>, KE> | Exclude<Extract<"filterable", keyof T2>, KE> | Exclude<Extract<"allowCreate", keyof T2>, KE> | Exclude<Extract<"remote", keyof T2>, KE> | Exclude<Extract<"loadingText", keyof T2>, KE> | Exclude<Extract<"noMatchText", keyof T2>, KE> | Exclude<Extract<"noDataText", keyof T2>, KE> | Exclude<Extract<"remoteMethod", keyof T2>, KE> | Exclude<Extract<"multipleLimit", keyof T2>, KE> | Exclude<Extract<"defaultFirstOption", keyof T2>, KE> | Exclude<Extract<"reserveKeyword", keyof T2>, KE> | Exclude<Extract<"valueKey", keyof T2>, KE> | Exclude<Extract<"collapseTags", keyof T2>, KE> | Exclude<Extract<"collapseTagsTooltip", keyof T2>, KE> | Exclude<Extract<"fitInputWidth", keyof T2>, KE> | Exclude<Extract<"tagType", keyof T2>, KE> | Exclude<Extract<"selectSlots", keyof T2>, KE> | Exclude<Extract<"selectRef", keyof T2>, KE> | Exclude<Extract<"optionsUrl", keyof T2>, KE> | Exclude<Extract<"optionChildrenProp", keyof T2>, KE> : Extract<"required", keyof T2> | Extract<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"information", keyof T2> | Extract<"prop", keyof T2> | Extract<"defaultModelValue", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", 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<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"persistent", keyof T2> | Extract<"teleported", keyof T2> | Extract<"effect", keyof T2> | Extract<"popperClass", keyof T2> | Extract<"name", keyof T2> | Extract<"slots", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"clearable", keyof T2> | Extract<"multiple", keyof T2> | Extract<"stringify", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"filterMethod", keyof T2> | Extract<"loading", keyof T2> | Extract<"options", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"clearIcon", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"automaticDropdown", keyof T2> | Extract<"filterable", keyof T2> | Extract<"allowCreate", keyof T2> | Extract<"remote", keyof T2> | Extract<"loadingText", keyof T2> | Extract<"noMatchText", keyof T2> | Extract<"noDataText", keyof T2> | Extract<"remoteMethod", keyof T2> | Extract<"multipleLimit", keyof T2> | Extract<"defaultFirstOption", keyof T2> | Extract<"reserveKeyword", keyof T2> | Extract<"valueKey", keyof T2> | Extract<"collapseTags", keyof T2> | Extract<"collapseTagsTooltip", keyof T2> | Extract<"fitInputWidth", keyof T2> | Extract<"tagType", keyof T2> | Extract<"selectSlots", keyof T2> | Extract<"selectRef", keyof T2> | Extract<"optionsUrl", keyof T2> | Extract<"optionChildrenProp", keyof T2>]: { [k in Extract<"required", keyof T2> | Extract<"size", keyof T2> | Extract<"formItemSize", keyof T2> | Extract<"formItemSlots", keyof T2> | Extract<"elRef", keyof T2> | Extract<"inline", keyof T2> | Extract<"readonly", keyof T2> | Extract<"formItemTip", keyof T2> | Extract<"formItemTipClass", keyof T2> | Extract<"labelTip", keyof T2> | Extract<"information", keyof T2> | Extract<"prop", keyof T2> | Extract<"defaultModelValue", keyof T2> | Extract<"label", keyof T2> | Extract<"labelWidth", keyof T2> | Extract<"labelPosition", 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<"disabled", keyof T2> | Extract<"id", keyof T2> | Extract<"persistent", keyof T2> | Extract<"teleported", keyof T2> | Extract<"effect", keyof T2> | Extract<"popperClass", keyof T2> | Extract<"name", keyof T2> | Extract<"slots", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"clearable", keyof T2> | Extract<"multiple", keyof T2> | Extract<"stringify", keyof T2> | Extract<"placeholder", keyof T2> | Extract<"filterMethod", keyof T2> | Extract<"loading", keyof T2> | Extract<"options", keyof T2> | Extract<"autocomplete", keyof T2> | Extract<"clearIcon", keyof T2> | Extract<"suffixIcon", keyof T2> | Extract<"automaticDropdown", keyof T2> | Extract<"filterable", keyof T2> | Extract<"allowCreate", keyof T2> | Extract<"remote", keyof T2> | Extract<"loadingText", keyof T2> | Extract<"noMatchText", keyof T2> | Extract<"noDataText", keyof T2> | Extract<"remoteMethod", keyof T2> | Extract<"multipleLimit", keyof T2> | Extract<"defaultFirstOption", keyof T2> | Extract<"reserveKeyword", keyof T2> | Extract<"valueKey", keyof T2> | Extract<"collapseTags", keyof T2> | Extract<"collapseTagsTooltip", keyof T2> | Extract<"fitInputWidth", keyof T2> | Extract<"tagType", keyof T2> | Extract<"selectSlots", keyof T2> | Extract<"selectRef", keyof T2> | Extract<"optionsUrl", keyof T2> | Extract<"optionChildrenProp", keyof T2>]: T2[k]; }[P]; }>;
205
221
  export declare const emits: {
206
222
  'update:modelValue': any;
207
223
  change: any;
@@ -17,6 +17,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
17
17
  default: boolean;
18
18
  };
19
19
  slots: any;
20
+ optionChildrenProp: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
20
24
  name: StringConstructor;
21
25
  id: StringConstructor;
22
26
  modelValue: {
@@ -222,6 +226,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
222
226
  default: boolean;
223
227
  };
224
228
  slots: any;
229
+ optionChildrenProp: {
230
+ type: StringConstructor;
231
+ default: string;
232
+ };
225
233
  name: StringConstructor;
226
234
  id: StringConstructor;
227
235
  modelValue: {
@@ -626,5 +634,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
626
634
  selectSlots: import("./types").SelectSlots;
627
635
  selectRef: any;
628
636
  optionsUrl: string;
637
+ optionChildrenProp: string;
629
638
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
630
639
  export default _default;
@@ -0,0 +1,24 @@
1
+ import { NormalObject } from '@vunk/shared';
2
+ import { PropType } from 'vue';
3
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ data: {
5
+ type: PropType<NormalObject[]>;
6
+ required: true;
7
+ };
8
+ optionChildrenProp: {
9
+ type: StringConstructor;
10
+ default: string;
11
+ };
12
+ }>, () => JSX.Element[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
+ data: {
14
+ type: PropType<NormalObject[]>;
15
+ required: true;
16
+ };
17
+ optionChildrenProp: {
18
+ type: StringConstructor;
19
+ default: string;
20
+ };
21
+ }>> & Readonly<{}>, {
22
+ optionChildrenProp: string;
23
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
24
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "2.16.0",
3
+ "version": "2.16.1",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {