@vunk/form 1.1.18 → 1.1.20

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,6 +22,7 @@ var __spreadValues = (a, b) => {
22
22
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
23
  const props = __spreadProps(__spreadValues(__spreadValues({}, _VkfFormItemCtx.props), switchProps), {
24
24
  modelValue: {
25
+ type: [],
25
26
  default: void 0
26
27
  },
27
28
  defaultModelValue: {
@@ -1,5 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<{
2
2
  modelValue: {
3
+ type: import("vue").PropType<any>;
3
4
  default: undefined;
4
5
  };
5
6
  defaultModelValue: {
@@ -151,6 +152,7 @@ declare const _default: import("vue").DefineComponent<{
151
152
  input: (val: string | number | boolean) => boolean;
152
153
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
153
154
  modelValue: {
155
+ type: import("vue").PropType<any>;
154
156
  default: undefined;
155
157
  };
156
158
  defaultModelValue: {
@@ -268,7 +270,7 @@ declare const _default: import("vue").DefineComponent<{
268
270
  value: import("element-plus/es/utils").EpPropMergeType<readonly [BooleanConstructor, StringConstructor, NumberConstructor], unknown, unknown>;
269
271
  disabled: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
270
272
  loading: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
271
- modelValue: undefined;
273
+ modelValue: any;
272
274
  validateEvent: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
273
275
  width: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
274
276
  inlinePrompt: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
@@ -15,6 +15,7 @@ import { VkfColorPicker } from '@vunk/form/components/color-picker';
15
15
  import { VkfButton } from '@vunk/form/components/button';
16
16
  import { VkfCascader } from '@vunk/form/components/cascader';
17
17
  import { VkfInputLink } from '@vunk/form/components/input-link';
18
+ import { VkfSlider } from '@vunk/form/components/slider';
18
19
 
19
20
  const createIntoUndefined = () => NOOP;
20
21
  const props = {
@@ -54,7 +55,8 @@ const _sfc_main = defineComponent({
54
55
  VkfColorPicker,
55
56
  VkfButton,
56
57
  VkfCascader,
57
- VkfInputLink
58
+ VkfInputLink,
59
+ VkfSlider
58
60
  },
59
61
  emits,
60
62
  props,
@@ -87,6 +89,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
87
89
  const _component_VkfInputNumber = resolveComponent("VkfInputNumber");
88
90
  const _component_VkfCascader = resolveComponent("VkfCascader");
89
91
  const _component_VkfInputLink = resolveComponent("VkfInputLink");
92
+ const _component_VkfSlider = resolveComponent("VkfSlider");
90
93
  return openBlock(), createElementBlock(Fragment, null, [
91
94
  createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfButton" }, {
92
95
  default: withCtx(({ data: sourceData, templateIf }) => [
@@ -224,6 +227,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
224
227
  ]),
225
228
  _: 1
226
229
  }),
230
+ createCommentVNode(" VkfInputLink "),
227
231
  createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfInputLink" }, {
228
232
  default: withCtx(({ data: sourceData, templateIf, raw }) => [
229
233
  templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfInputLink, mergeProps({
@@ -237,6 +241,20 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
237
241
  ]),
238
242
  _: 1
239
243
  }),
244
+ createCommentVNode(" VkfSlider "),
245
+ createVNode(_component_VkfFormItemRendererTemplate, { type: "VkfSlider" }, {
246
+ default: withCtx(({ data: sourceData, templateIf, raw }) => [
247
+ templateIf(_ctx.data) ? (openBlock(), createBlock(_component_VkfSlider, mergeProps({
248
+ key: 0,
249
+ modelValue: _ctx.getFormDataValue(raw),
250
+ "onUpdate:modelValue": ($event) => _ctx.$emit("setData", {
251
+ k: sourceData.prop,
252
+ v: $event
253
+ })
254
+ }, sourceData), null, 16, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
255
+ ]),
256
+ _: 1
257
+ }),
240
258
  createVNode(_component_VkfFormItemRendererTemplate, { type: "Component" }, {
241
259
  default: withCtx(({ data, raw, templateIf }) => [
242
260
  templateIf(data) ? (openBlock(), createBlock(resolveDynamicComponent(typeof data.is === "function" ? data.is(raw) : data.is), normalizeProps(mergeProps({ key: 0 }, _ctx.pickObject(data, { excludes: ["is"] }))), null, 16)) : createCommentVNode("v-if", true)
@@ -11,6 +11,7 @@ import { __VkfUpload } from '@vunk/form/components/upload';
11
11
  import { __VkfColorPicker } from '@vunk/form/components/color-picker';
12
12
  import { __VkfCascader } from '@vunk/form/components/cascader';
13
13
  import { __VkfInputLink } from '@vunk/form/components/input-link';
14
+ import { __VkfSlider } from '@vunk/form/components/slider';
14
15
  import { IntoUndefined, Func } from '@vunk/core';
15
16
  export declare type VkfButtonSource<P extends string = string> = __VkfButton.Source<P>;
16
17
  export declare type VkfInputSource<P extends string = string> = __VkfInput.Source<P>;
@@ -24,11 +25,12 @@ export declare type VkfUploadSource<P extends string = string> = __VkfUpload.Sou
24
25
  export declare type VkfColorPickerSource<P extends string = string> = __VkfColorPicker.Source<P>;
25
26
  export declare type VkfCascaderSource<P extends string = string> = __VkfCascader.Source<P>;
26
27
  export declare type VkfInputLinkSource<P extends string = string> = __VkfInputLink.Source<P>;
28
+ export declare type VkfSliderSource<P extends string = string> = __VkfSlider.Source<P>;
27
29
  export interface ComponentSource extends BasicSource {
28
30
  templateType: 'Component';
29
31
  is: any;
30
32
  }
31
- export declare type CoreSource<P extends string = string> = VkfInputSource<P> | VkfSwitchSource<P> | VkfSelectSource<P> | VkfDatePickerSource<P> | VkfInputNumberSource<P> | VkfRadioSource<P> | VkfCheckboxSource<P> | VkfUploadSource<P> | VkfColorPickerSource<P> | VkfButtonSource<P> | VkfCascaderSource<P> | VkfInputLinkSource<P>;
33
+ export declare type CoreSource<P extends string = string> = VkfInputSource<P> | VkfSwitchSource<P> | VkfSelectSource<P> | VkfDatePickerSource<P> | VkfInputNumberSource<P> | VkfRadioSource<P> | VkfCheckboxSource<P> | VkfUploadSource<P> | VkfColorPickerSource<P> | VkfButtonSource<P> | VkfCascaderSource<P> | VkfInputLinkSource<P> | VkfSliderSource<P>;
32
34
  export declare type Source<P extends string = string> = CoreSource<P> | ComponentSource;
33
35
  /**
34
36
  * @example
@@ -1,5 +1,5 @@
1
1
  import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
2
- import { openBlock, createElementBlock, createElementVNode, defineComponent, reactive, ref, computed, resolveComponent, createBlock, mergeProps, withCtx, createVNode, normalizeClass, createCommentVNode, Fragment, renderList, normalizeStyle, createTextVNode } from 'vue';
2
+ import { openBlock, createElementBlock, createElementVNode, defineComponent, reactive, ref, computed, watchEffect, resolveComponent, createBlock, mergeProps, withCtx, createVNode, normalizeClass, createCommentVNode, Fragment, renderList, normalizeStyle, createTextVNode } from 'vue';
3
3
  import { ElInput, ElButtonGroup, ElButton, ElIcon } from 'element-plus';
4
4
  import { createFileChunk, calculateFileHashSample } from '@vunk/form/shared/upload';
5
5
  import { RestFetch } from '@vunk/core/shared/utils-fetch';
@@ -31,6 +31,10 @@ const props = __spreadProps(__spreadValues({}, _VkfFormItemCtx.props), {
31
31
  dictId: {
32
32
  type: String,
33
33
  default: ""
34
+ },
35
+ url: {
36
+ type: String,
37
+ default: ""
34
38
  }
35
39
  });
36
40
  const emits = {};
@@ -237,6 +241,10 @@ const _sfc_main = defineComponent({
237
241
  }
238
242
  return upload_filled_default;
239
243
  });
244
+ watchEffect(() => {
245
+ if (props2.url)
246
+ restFetch.baseURL = props2.url;
247
+ });
240
248
  const handleFileChange = (e) => {
241
249
  const target = e.target;
242
250
  const file = target.files?.[0];
@@ -10,6 +10,10 @@ export declare const props: {
10
10
  type: StringConstructor;
11
11
  default: string;
12
12
  };
13
+ url: {
14
+ type: StringConstructor;
15
+ default: string;
16
+ };
13
17
  required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
14
18
  label: StringConstructor;
15
19
  labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
@@ -27,6 +27,10 @@ const props = __spreadProps(__spreadValues({}, _VkfFormItemCtx.props), {
27
27
  dictId: {
28
28
  type: String,
29
29
  default: ""
30
+ },
31
+ url: {
32
+ type: String,
33
+ default: ""
30
34
  }
31
35
  });
32
36
  const emits = {};
@@ -8,6 +8,10 @@ declare const _default: import("vue").DefineComponent<{
8
8
  type: StringConstructor;
9
9
  default: string;
10
10
  };
11
+ url: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
11
15
  required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
12
16
  label: StringConstructor;
13
17
  labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
@@ -108,6 +112,10 @@ declare const _default: import("vue").DefineComponent<{
108
112
  type: StringConstructor;
109
113
  default: string;
110
114
  };
115
+ url: {
116
+ type: StringConstructor;
117
+ default: string;
118
+ };
111
119
  required: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
112
120
  label: StringConstructor;
113
121
  labelWidth: import("element-plus/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
@@ -168,6 +176,7 @@ declare const _default: import("vue").DefineComponent<{
168
176
  inline: boolean;
169
177
  readonly: boolean;
170
178
  labelPosition: "right";
179
+ url: string;
171
180
  dictId: string;
172
181
  }>;
173
182
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "1.1.18",
3
+ "version": "1.1.20",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {
@@ -84,3 +84,9 @@ export declare const createCascaderOnEmits: <T2 extends import("@vunk/core").Any
84
84
  expandChange: (...e: import("@vunk/core").RestParameters<T2>) => void;
85
85
  removeTag: (...e: import("@vunk/core").RestParameters<T2>) => void;
86
86
  }[P]; };
87
+ export declare const createSliderBindProps: <T2 extends import("@vunk/core").NormalObject, EX extends (Extract<"size", keyof T2> | Extract<"label", keyof T2> | Extract<"placement", keyof T2> | Extract<"id", keyof T2> | Extract<"disabled", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"validateEvent", keyof T2> | Extract<"vertical", keyof T2> | Extract<"step", keyof T2> | Extract<"max", keyof T2> | Extract<"min", keyof T2> | Extract<"debounce", keyof T2> | Extract<"showInput", keyof T2> | Extract<"showInputControls", keyof T2> | Extract<"inputSize", keyof T2> | Extract<"showStops", keyof T2> | Extract<"showTooltip", keyof T2> | Extract<"formatTooltip", keyof T2> | Extract<"range", keyof T2> | Extract<"height", keyof T2> | Extract<"rangeStartLabel", keyof T2> | Extract<"rangeEndLabel", keyof T2> | Extract<"formatValueText", keyof T2> | Extract<"tooltipClass", keyof T2> | Extract<"marks", keyof T2>)[] | undefined>(propsArg: T2, excludes?: EX | undefined) => import("vue").ComputedRef<{ [P in EX extends (infer KE)[] ? Exclude<Extract<"size", keyof T2>, KE> | Exclude<Extract<"label", keyof T2>, KE> | Exclude<Extract<"placement", keyof T2>, KE> | Exclude<Extract<"id", keyof T2>, KE> | Exclude<Extract<"disabled", keyof T2>, KE> | Exclude<Extract<"modelValue", keyof T2>, KE> | Exclude<Extract<"validateEvent", keyof T2>, KE> | Exclude<Extract<"vertical", keyof T2>, KE> | Exclude<Extract<"step", keyof T2>, KE> | Exclude<Extract<"max", keyof T2>, KE> | Exclude<Extract<"min", keyof T2>, KE> | Exclude<Extract<"debounce", keyof T2>, KE> | Exclude<Extract<"showInput", keyof T2>, KE> | Exclude<Extract<"showInputControls", keyof T2>, KE> | Exclude<Extract<"inputSize", keyof T2>, KE> | Exclude<Extract<"showStops", keyof T2>, KE> | Exclude<Extract<"showTooltip", keyof T2>, KE> | Exclude<Extract<"formatTooltip", keyof T2>, KE> | Exclude<Extract<"range", keyof T2>, KE> | Exclude<Extract<"height", keyof T2>, KE> | Exclude<Extract<"rangeStartLabel", keyof T2>, KE> | Exclude<Extract<"rangeEndLabel", keyof T2>, KE> | Exclude<Extract<"formatValueText", keyof T2>, KE> | Exclude<Extract<"tooltipClass", keyof T2>, KE> | Exclude<Extract<"marks", keyof T2>, KE> : Extract<"size", keyof T2> | Extract<"label", keyof T2> | Extract<"placement", keyof T2> | Extract<"id", keyof T2> | Extract<"disabled", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"validateEvent", keyof T2> | Extract<"vertical", keyof T2> | Extract<"step", keyof T2> | Extract<"max", keyof T2> | Extract<"min", keyof T2> | Extract<"debounce", keyof T2> | Extract<"showInput", keyof T2> | Extract<"showInputControls", keyof T2> | Extract<"inputSize", keyof T2> | Extract<"showStops", keyof T2> | Extract<"showTooltip", keyof T2> | Extract<"formatTooltip", keyof T2> | Extract<"range", keyof T2> | Extract<"height", keyof T2> | Extract<"rangeStartLabel", keyof T2> | Extract<"rangeEndLabel", keyof T2> | Extract<"formatValueText", keyof T2> | Extract<"tooltipClass", keyof T2> | Extract<"marks", keyof T2>]: { [k in Extract<"size", keyof T2> | Extract<"label", keyof T2> | Extract<"placement", keyof T2> | Extract<"id", keyof T2> | Extract<"disabled", keyof T2> | Extract<"modelValue", keyof T2> | Extract<"validateEvent", keyof T2> | Extract<"vertical", keyof T2> | Extract<"step", keyof T2> | Extract<"max", keyof T2> | Extract<"min", keyof T2> | Extract<"debounce", keyof T2> | Extract<"showInput", keyof T2> | Extract<"showInputControls", keyof T2> | Extract<"inputSize", keyof T2> | Extract<"showStops", keyof T2> | Extract<"showTooltip", keyof T2> | Extract<"formatTooltip", keyof T2> | Extract<"range", keyof T2> | Extract<"height", keyof T2> | Extract<"rangeStartLabel", keyof T2> | Extract<"rangeEndLabel", keyof T2> | Extract<"formatValueText", keyof T2> | Extract<"tooltipClass", keyof T2> | Extract<"marks", keyof T2>]: T2[k]; }[P]; }>;
88
+ export declare const createSliderOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("update:modelValue" | "input" | "change")[] | undefined>(emit: T2, excludes?: EX | undefined) => { [P in EX extends (infer KE)[] ? Exclude<"update:modelValue", KE> | Exclude<"input", KE> | Exclude<"change", KE> : "update:modelValue" | "input" | "change"]: {
89
+ "update:modelValue": (...e: import("@vunk/core").RestParameters<T2>) => void;
90
+ input: (...e: import("@vunk/core").RestParameters<T2>) => void;
91
+ change: (...e: import("@vunk/core").RestParameters<T2>) => void;
92
+ }[P]; };
@@ -1,4 +1,4 @@
1
- import { useTooltipContentProps, tagProps, timePickerDefaultProps, inputProps, inputEmits, formProps, formEmits, formItemProps, switchProps, switchEmits, inputNumberProps, inputNumberEmits, radioGroupProps, radioGroupEmits, checkboxGroupProps, checkboxGroupEmits, uploadProps, colorPickerProps, colorPickerEmits, buttonProps, buttonEmits, cascaderProps, cascaderEmits } from 'element-plus';
1
+ import { useTooltipContentProps, tagProps, timePickerDefaultProps, inputProps, inputEmits, formProps, formEmits, formItemProps, switchProps, switchEmits, inputNumberProps, inputNumberEmits, radioGroupProps, radioGroupEmits, checkboxGroupProps, checkboxGroupEmits, uploadProps, colorPickerProps, colorPickerEmits, buttonProps, buttonEmits, cascaderProps, cascaderEmits, sliderProps, sliderEmits } from 'element-plus';
2
2
  import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
3
3
  import { openBlock, createElementBlock, createElementVNode } from 'vue';
4
4
 
@@ -214,5 +214,7 @@ const createButtonBindProps = bindPropsFactory(buttonProps);
214
214
  const createButtonOnEmits = onEmitsFactory(buttonEmits);
215
215
  const createCascaderBindProps = bindPropsFactory(cascaderProps);
216
216
  const createCascaderOnEmits = onEmitsFactory(cascaderEmits);
217
+ const createSliderBindProps = bindPropsFactory(sliderProps);
218
+ const createSliderOnEmits = onEmitsFactory(sliderEmits);
217
219
 
218
- export { createButtonBindProps, createButtonOnEmits, createCascaderBindProps, createCascaderOnEmits, createCheckboxGroupBindProps, createCheckboxGroupOnEmits, createColorPickerBindProps, createColorPickerOnEmits, createDatePickerBindProps, createDatePickerOnEmits, createFormBindProps, createFormItemBindProps, createFormOnEmits, createInputBindProps, createInputNumberBindProps, createInputNumberOnEmits, createInputOnEmits, createRadioGroupBindProps, createRadioGroupOnEmits, createSelectBindProps, createSelectOnEmits, createSwitchBindProps, createSwitchOnEmits, createUploadBindProps, datePickerEmits, datePickerProps, selectEmits, selectProps };
220
+ export { createButtonBindProps, createButtonOnEmits, createCascaderBindProps, createCascaderOnEmits, createCheckboxGroupBindProps, createCheckboxGroupOnEmits, createColorPickerBindProps, createColorPickerOnEmits, createDatePickerBindProps, createDatePickerOnEmits, createFormBindProps, createFormItemBindProps, createFormOnEmits, createInputBindProps, createInputNumberBindProps, createInputNumberOnEmits, createInputOnEmits, createRadioGroupBindProps, createRadioGroupOnEmits, createSelectBindProps, createSelectOnEmits, createSliderBindProps, createSliderOnEmits, createSwitchBindProps, createSwitchOnEmits, createUploadBindProps, datePickerEmits, datePickerProps, selectEmits, selectProps };