@veltra/desktop 1.2.0 → 1.2.2

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.
Files changed (114) hide show
  1. package/dist/components/auto-complete/auto-complete.js +1 -1
  2. package/dist/components/auto-complete/auto-complete.vue.d.ts +2 -2
  3. package/dist/components/cascade/cascade.js +1 -1
  4. package/dist/components/cascade/cascade.vue.d.ts +4 -4
  5. package/dist/components/checkbox/checkbox-button.js +1 -1
  6. package/dist/components/checkbox/checkbox-button.vue.d.ts +1 -1
  7. package/dist/components/checkbox/checkbox.js +1 -1
  8. package/dist/components/checkbox/checkbox.vue.d.ts +1 -1
  9. package/dist/components/checkbox-group/checkbox-group.js +1 -1
  10. package/dist/components/checkbox-group/checkbox-group.vue.d.ts +1 -1
  11. package/dist/components/code-editor/code-editor.js +2 -2
  12. package/dist/components/code-editor/code-editor.vue.d.ts +1 -1
  13. package/dist/components/date-picker/date-picker.js +1 -1
  14. package/dist/components/date-picker/date-picker.vue.d.ts +3 -3
  15. package/dist/components/date-range-picker/date-range-picker.js +1 -1
  16. package/dist/components/date-range-picker/date-range-picker.vue.d.ts +3 -3
  17. package/dist/components/expression-editor/expression-editor.js +1 -1
  18. package/dist/components/file-picker/file-picker.js +1 -1
  19. package/dist/components/form/form.js.map +1 -1
  20. package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js +13 -5
  21. package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js.map +1 -1
  22. package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js +1 -1
  23. package/dist/components/form-item/helper.js.map +1 -1
  24. package/dist/components/form-item/validate.js.map +1 -1
  25. package/dist/components/group-input/group-input.js +1 -1
  26. package/dist/components/input/input.vue.d.ts +2 -2
  27. package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js +1 -1
  28. package/dist/components/multi-select/multi-select.js +1 -1
  29. package/dist/components/multi-select/multi-select.vue.d.ts +4 -4
  30. package/dist/components/multi-tree-select/multi-tree-select.js +1 -1
  31. package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +4 -4
  32. package/dist/components/number/number.vue.d.ts +1 -1
  33. package/dist/components/number-input/number-input.js +1 -1
  34. package/dist/components/number-input/number-input.vue.d.ts +2 -2
  35. package/dist/components/number-range-input/number-range-input.js +1 -1
  36. package/dist/components/number-range-input/number-range-input.vue.d.ts +2 -2
  37. package/dist/components/palette/palette.js +1 -1
  38. package/dist/components/palette/palette.vue.d.ts +1 -1
  39. package/dist/components/password-input/password-input.js +1 -1
  40. package/dist/components/password-input/password-input.vue.d.ts +2 -2
  41. package/dist/components/radio/radio.js +1 -1
  42. package/dist/components/radio-group/radio-group.js +1 -1
  43. package/dist/components/radio-group/radio-group.vue.d.ts +1 -1
  44. package/dist/components/rich-text-editor/rich-text-editor.js +1 -1
  45. package/dist/components/rich-text-editor/rich-text-editor.vue.d.ts +2 -2
  46. package/dist/components/select/select.js +1 -1
  47. package/dist/components/select/select.vue.d.ts +3 -3
  48. package/dist/components/slider/slider.js +1 -1
  49. package/dist/components/steps/steps.vue.d.ts +1 -1
  50. package/dist/components/switch/switch.js +1 -1
  51. package/dist/components/switch/switch.vue.d.ts +1 -1
  52. package/dist/components/textarea/textarea.js +1 -1
  53. package/dist/components/textarea/textarea.vue.d.ts +2 -2
  54. package/dist/components/tip/tip.vue.d.ts +1 -1
  55. package/dist/components/tree-select/tree-select.js +1 -1
  56. package/dist/components/tree-select/tree-select.vue.d.ts +4 -4
  57. package/dist/index.d.ts +2 -4
  58. package/dist/types/auto-complete.d.ts +2 -3
  59. package/dist/types/cascade.d.ts +2 -3
  60. package/dist/types/checkbox-group.d.ts +2 -2
  61. package/dist/types/checkbox.d.ts +3 -4
  62. package/dist/types/code-editor.d.ts +2 -3
  63. package/dist/types/date-picker.d.ts +2 -3
  64. package/dist/types/date-range-picker.d.ts +2 -3
  65. package/dist/types/expression-editor.d.ts +2 -3
  66. package/dist/types/file-picker.d.ts +2 -3
  67. package/dist/types/form-item.d.ts +2 -2
  68. package/dist/types/group-input.d.ts +2 -3
  69. package/dist/types/index.d.ts +1 -3
  70. package/dist/types/input.d.ts +2 -3
  71. package/dist/types/multi-select.d.ts +2 -3
  72. package/dist/types/multi-tree-select.d.ts +2 -3
  73. package/dist/types/palette.d.ts +2 -3
  74. package/dist/types/radio-group.d.ts +2 -3
  75. package/dist/types/radio.d.ts +2 -3
  76. package/dist/types/rich-text-editor.d.ts +2 -3
  77. package/dist/types/select.d.ts +2 -3
  78. package/dist/types/slider.d.ts +2 -3
  79. package/dist/types/switch.d.ts +2 -3
  80. package/dist/types/text-editor.d.ts +2 -3
  81. package/dist/types/textarea.d.ts +2 -3
  82. package/dist/types/tree-select.d.ts +2 -3
  83. package/package.json +6 -6
  84. package/src/components/form/form.vue +24 -6
  85. package/src/components/form-item/helper.ts +4 -6
  86. package/src/components/form-item/validate.ts +1 -25
  87. package/src/types/auto-complete.ts +2 -4
  88. package/src/types/cascade.ts +2 -4
  89. package/src/types/checkbox-group.ts +2 -2
  90. package/src/types/checkbox.ts +3 -5
  91. package/src/types/code-editor.ts +2 -4
  92. package/src/types/date-picker.ts +2 -4
  93. package/src/types/date-range-picker.ts +2 -4
  94. package/src/types/expression-editor.ts +2 -4
  95. package/src/types/file-picker.ts +2 -4
  96. package/src/types/form-item.ts +2 -2
  97. package/src/types/group-input.ts +2 -4
  98. package/src/types/index.ts +0 -1
  99. package/src/types/input.ts +2 -4
  100. package/src/types/multi-select.ts +2 -4
  101. package/src/types/multi-tree-select.ts +2 -5
  102. package/src/types/palette.ts +2 -4
  103. package/src/types/radio-group.ts +2 -3
  104. package/src/types/radio.ts +2 -3
  105. package/src/types/rich-text-editor.ts +2 -4
  106. package/src/types/select.ts +2 -4
  107. package/src/types/slider.ts +2 -4
  108. package/src/types/switch.ts +2 -4
  109. package/src/types/text-editor.ts +2 -4
  110. package/src/types/textarea.ts +2 -4
  111. package/src/types/tree-select.ts +2 -5
  112. package/dist/components/form-item/validate.d.ts +0 -26
  113. package/dist/types/form-field.d.ts +0 -12
  114. package/src/types/form-field.ts +0 -11
@@ -1,5 +1,4 @@
1
- import { FormFieldComponentProps } from "./form-field.js";
2
- import { DeconstructValue } from "@veltra/utils";
1
+ import { DeconstructValue, FormComponentProps } from "@veltra/utils";
3
2
 
4
3
  //#region src/types/palette.d.ts
5
4
  /** 色调 */
@@ -17,7 +16,7 @@ interface PaletteHSV {
17
16
  /** 调色盘组件颜色类型 */
18
17
  type PaletteColorType = 'HEX' | 'RGB';
19
18
  /** 调色盘组件属性 */
20
- interface PaletteProps extends FormFieldComponentProps {
19
+ interface PaletteProps extends FormComponentProps {
21
20
  modelValue?: string;
22
21
  disabled?: boolean;
23
22
  readonly?: boolean;
@@ -1,9 +1,8 @@
1
- import { FormFieldComponentProps } from "./form-field.js";
2
- import { DeconstructValue } from "@veltra/utils";
1
+ import { DeconstructValue, FormComponentProps } from "@veltra/utils";
3
2
 
4
3
  //#region src/types/radio-group.d.ts
5
4
  /** 单选框默认父组件组件属性 */
6
- interface RadioGroupProps extends FormFieldComponentProps {
5
+ interface RadioGroupProps extends FormComponentProps {
7
6
  /** 值 */
8
7
  modelValue?: any;
9
8
  /** 单选框项 */
@@ -1,9 +1,8 @@
1
- import { FormFieldComponentProps } from "./form-field.js";
2
- import { DeconstructValue } from "@veltra/utils";
1
+ import { DeconstructValue, FormComponentProps } from "@veltra/utils";
3
2
 
4
3
  //#region src/types/radio.d.ts
5
4
  /** 单选框组件属性 */
6
- interface RadioProps extends FormFieldComponentProps {
5
+ interface RadioProps extends FormComponentProps {
7
6
  /** 单选框值 */
8
7
  value?: any;
9
8
  /** 文本 */
@@ -1,5 +1,4 @@
1
- import { FormFieldComponentProps } from "./form-field.js";
2
- import { DeconstructValue } from "@veltra/utils";
1
+ import { DeconstructValue, FormComponentProps } from "@veltra/utils";
3
2
 
4
3
  //#region src/types/rich-text-editor.d.ts
5
4
  /** 富文本数据格式 */
@@ -7,7 +6,7 @@ type RichTextFormat = 'html' | 'json';
7
6
  /** 工具栏项 */
8
7
  type ToolbarItem = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'heading' | 'bullet-list' | 'ordered-list' | 'blockquote' | 'code-block' | 'link' | 'undo' | 'redo' | '|';
9
8
  /** 富文本编辑器组件属性 */
10
- interface RichTextEditorProps extends FormFieldComponentProps {
9
+ interface RichTextEditorProps extends FormComponentProps {
11
10
  modelValue?: string;
12
11
  /** 数据格式:html 或 json */
13
12
  format?: RichTextFormat;
@@ -1,10 +1,9 @@
1
- import { FormFieldComponentProps } from "./form-field.js";
2
1
  import { CSSProperties, ShallowRef } from "vue";
3
- import { DeconstructValue } from "@veltra/utils";
2
+ import { DeconstructValue, FormComponentProps } from "@veltra/utils";
4
3
 
5
4
  //#region src/types/select.d.ts
6
5
  /** 选择器组件属性 */
7
- interface SelectProps extends FormFieldComponentProps {
6
+ interface SelectProps extends FormComponentProps {
8
7
  /** 绑定值 */
9
8
  modelValue?: any;
10
9
  /** 文本内容 */
@@ -1,9 +1,8 @@
1
- import { FormFieldComponentProps } from "./form-field.js";
2
- import { DeconstructValue } from "@veltra/utils";
1
+ import { DeconstructValue, FormComponentProps } from "@veltra/utils";
3
2
 
4
3
  //#region src/types/slider.d.ts
5
4
  /** 滑块组件属性 */
6
- interface SliderProps<T extends number | [number, number]> extends FormFieldComponentProps {
5
+ interface SliderProps<T extends number | [number, number]> extends FormComponentProps {
7
6
  modelValue?: T;
8
7
  /**
9
8
  * 最小值
@@ -1,9 +1,8 @@
1
- import { FormFieldComponentProps } from "./form-field.js";
2
- import { DeconstructValue } from "@veltra/utils";
1
+ import { DeconstructValue, FormComponentProps } from "@veltra/utils";
3
2
 
4
3
  //#region src/types/switch.d.ts
5
4
  /** 开关组件属性 */
6
- interface SwitchProps extends FormFieldComponentProps {
5
+ interface SwitchProps extends FormComponentProps {
7
6
  /** 开关状态 */
8
7
  modelValue?: boolean;
9
8
  /** 打开时显示的文字 */
@@ -1,5 +1,4 @@
1
- import { FormFieldComponentProps } from "./form-field.js";
2
- import { DeconstructValue } from "@veltra/utils";
1
+ import { DeconstructValue, FormComponentProps } from "@veltra/utils";
3
2
 
4
3
  //#region src/types/text-editor.d.ts
5
4
  /** text-editor组件属性 */
@@ -7,7 +6,7 @@ interface BarType {
7
6
  content: string;
8
7
  bar: string;
9
8
  }
10
- interface TextEditorProps extends FormFieldComponentProps {
9
+ interface TextEditorProps extends FormComponentProps {
11
10
  modelValue?: string;
12
11
  placeholder?: string;
13
12
  toolbar?: BarType[];
@@ -1,9 +1,8 @@
1
- import { FormFieldComponentProps } from "./form-field.js";
2
- import { DeconstructValue } from "@veltra/utils";
1
+ import { DeconstructValue, FormComponentProps } from "@veltra/utils";
3
2
 
4
3
  //#region src/types/textarea.d.ts
5
4
  /** textarea组件属性 */
6
- interface TextareaProps extends FormFieldComponentProps {
5
+ interface TextareaProps extends FormComponentProps {
7
6
  /**
8
7
  * 文本域的值
9
8
  */
@@ -1,11 +1,10 @@
1
- import { FormFieldComponentProps } from "./form-field.js";
2
1
  import { TreeProps } from "./tree.js";
3
2
  import { CSSProperties } from "vue";
4
- import { DeconstructValue } from "@veltra/utils";
3
+ import { DeconstructValue, FormComponentProps } from "@veltra/utils";
5
4
 
6
5
  //#region src/types/tree-select.d.ts
7
6
  /** 树形选择器组件属性 */
8
- interface TreeSelectProps extends FormFieldComponentProps, Omit<TreeProps, 'selected' | 'checked' | 'selectable' | 'checkable'> {
7
+ interface TreeSelectProps extends FormComponentProps, Omit<TreeProps, 'selected' | 'checked' | 'selectable' | 'checkable'> {
9
8
  modelValue?: string | number;
10
9
  /** 自定义占位文字 */
11
10
  placeholder?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltra/desktop",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -68,11 +68,11 @@
68
68
  "@cat-kit/core": ">=1.1.6",
69
69
  "@cat-kit/excel": ">=1.0.0",
70
70
  "@cat-kit/fe": "^1.1.6",
71
- "@veltra/compositions": "1.2.0",
72
- "@veltra/directives": "1.2.0",
73
- "@veltra/icons": "1.2.0",
74
- "@veltra/styles": "1.2.0",
75
- "@veltra/utils": "1.2.0",
71
+ "@veltra/compositions": "1.2.2",
72
+ "@veltra/directives": "1.2.2",
73
+ "@veltra/icons": "1.2.2",
74
+ "@veltra/styles": "1.2.2",
75
+ "@veltra/utils": "1.2.2",
76
76
  "vue": ">=3.5.0"
77
77
  }
78
78
  }
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <u-grid
3
3
  tag="form"
4
- ref="gridRef"
4
+ ref="grid"
5
5
  @submit.prevent
6
6
  :cols="cols || breakpointCols"
7
7
  :class="[cls.b, bem.is('readonly', readonly)]"
@@ -27,7 +27,7 @@
27
27
  import { o } from '@cat-kit/core'
28
28
  import { bem } from '@veltra/utils'
29
29
  import { provideFormContext } from '@veltra/utils'
30
- import { shallowRef, toRef } from 'vue'
30
+ import { nextTick, shallowRef, toRef, useTemplateRef } from 'vue'
31
31
 
32
32
  import type { BreakCols, GridExposed, FormProps, _FormExposed } from '../../types'
33
33
  import { UFormItem } from '../form-item'
@@ -42,11 +42,31 @@ const props = defineProps<FormProps>()
42
42
  defineSlots<{ default(props?: { data: Record<string, any> | undefined }): any }>()
43
43
 
44
44
  const cls = bem('form')
45
+ const formItemCls = bem('form-item')
46
+ const gridRef = useTemplateRef('grid')
45
47
 
46
48
  const breakpointCols: BreakCols = { xs: 1, md: 2, lg: 3, xl: 4, default: 4 }
47
49
 
48
- const { validate, clearValidate, reset, registerField, unregisterField, shouldValidate } =
49
- useFormFields({ props })
50
+ const {
51
+ validate: runValidate,
52
+ clearValidate,
53
+ reset,
54
+ registerField,
55
+ unregisterField,
56
+ shouldValidate
57
+ } = useFormFields({ props })
58
+
59
+ async function validate(keys?: string[]) {
60
+ const valid = await runValidate(keys)
61
+ if (!valid) {
62
+ await nextTick()
63
+
64
+ gridRef.value?.el
65
+ ?.querySelector(`.${formItemCls.e('error-text')}`)
66
+ ?.scrollIntoView({ block: 'center' })
67
+ }
68
+ return valid
69
+ }
50
70
 
51
71
  provideFormContext({
52
72
  formProps: props,
@@ -63,7 +83,5 @@ function handleUpdateValue(field: string, value: any) {
63
83
  o(props.model).set(field, value)
64
84
  }
65
85
 
66
- const gridRef = shallowRef<GridExposed>()
67
-
68
86
  defineExpose<_FormExposed>({ el: toRef(() => gridRef.value?.el), validate, clearValidate, reset })
69
87
  </script>
@@ -1,7 +1,5 @@
1
1
  import { o } from '@cat-kit/core'
2
- import { bem, type BEM, type FormFieldItem } from '@veltra/utils'
3
-
4
- import type { FormFieldComponentProps } from '../../types/form-field'
2
+ import { bem, type BEM, type FormComponentProps, type FormFieldItem } from '@veltra/utils'
5
3
 
6
4
  /**
7
5
  * 获取表单项的属性
@@ -9,10 +7,10 @@ import type { FormFieldComponentProps } from '../../types/form-field'
9
7
  * @returns
10
8
  */
11
9
  export function getFormItemProps(
12
- props: FormFieldComponentProps
13
- ): Pick<FormFieldComponentProps, 'label' | 'field' | 'readonly' | 'span' | 'tips'> {
10
+ props: FormComponentProps
11
+ ): Pick<FormComponentProps, 'label' | 'field' | 'readonly' | 'span' | 'tips'> {
14
12
  return o(props).pick(['label', 'field', 'readonly', 'span', 'tips']) as Pick<
15
- FormFieldComponentProps,
13
+ FormComponentProps,
16
14
  'label' | 'field' | 'readonly' | 'span' | 'tips'
17
15
  >
18
16
  }
@@ -1,29 +1,5 @@
1
1
  import { isEmpty, o } from '@cat-kit/core'
2
- import type { Undef } from '@veltra/utils'
3
-
4
- export type PresetRule = 'email' | 'phone' | 'num' | 'url' | 'idCard'
5
-
6
- /** 字段校验规则 */
7
- export interface ValidateRule {
8
- /** 是否必填 */
9
- required?: boolean | string
10
- /** 长度单位 */
11
- length?: number | [number, string]
12
- /** 最小值 */
13
- min?: number | [number, string]
14
- /** 最大值 */
15
- max?: number | [number, string]
16
- /** 最小长度 */
17
- minLen?: number | [number, string]
18
- /** 最大长度 */
19
- maxLen?: number | [number, string]
20
- /** 匹配 */
21
- match?: RegExp | [RegExp, string] | string
22
- /** 预设 */
23
- preset?: PresetRule
24
- /** 自定义校验 */
25
- validator?: (value: any, data: Record<string, any>) => Promise<string> | string
26
- }
2
+ import type { PresetRule, Undef, ValidateRule } from '@veltra/utils'
27
3
 
28
4
  const presetRules: Record<PresetRule, (value: string) => string | undefined> = {
29
5
  email(v) {
@@ -1,9 +1,7 @@
1
- import type { DeconstructValue } from '@veltra/utils'
2
-
3
- import type { FormFieldComponentProps } from './form-field'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
4
2
 
5
3
  /** 自动补全组件组件属性 */
6
- export interface AutoCompleteProps extends FormFieldComponentProps {
4
+ export interface AutoCompleteProps extends FormComponentProps {
7
5
  modelValue?: string
8
6
  /** 占位符 */
9
7
  placeholder?: string
@@ -1,7 +1,5 @@
1
1
  import type { TreeNode } from '@cat-kit/core'
2
- import type { DeconstructValue } from '@veltra/utils'
3
-
4
- import type { FormFieldComponentProps } from './form-field'
2
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
5
3
 
6
4
  export interface CascadeNode<
7
5
  Data extends Record<string, any> = Record<string, any>
@@ -12,7 +10,7 @@ export interface CascadeNode<
12
10
  }
13
11
 
14
12
  /** 级联选择器组件属性 */
15
- export interface CascadeProps extends FormFieldComponentProps {
13
+ export interface CascadeProps extends FormComponentProps {
16
14
  /**
17
15
  * 分隔符
18
16
  * @default '/'
@@ -1,7 +1,7 @@
1
- import type { FormFieldComponentProps } from './form-field'
1
+ import type { FormComponentProps } from '@veltra/utils'
2
2
 
3
3
  /** 复选框组, 用来选择一组数据组件属性 */
4
- export interface CheckboxGroupProps extends FormFieldComponentProps {
4
+ export interface CheckboxGroupProps extends FormComponentProps {
5
5
  /** 值 */
6
6
  modelValue?: Array<any>
7
7
  /** 复选框项 */
@@ -1,16 +1,14 @@
1
- import type { ColorType } from '@veltra/utils'
2
-
3
- import type { FormFieldComponentProps } from './form-field'
1
+ import type { ColorType, FormComponentProps } from '@veltra/utils'
4
2
 
5
3
  /** 复选框组件属性 */
6
- export interface CheckboxProps extends FormFieldComponentProps {
4
+ export interface CheckboxProps extends FormComponentProps {
7
5
  /** 部分选中 */
8
6
  indeterminate?: boolean
9
7
  /** 是否选中 */
10
8
  modelValue?: boolean
11
9
  }
12
10
 
13
- export interface CheckboxButtonProps extends FormFieldComponentProps {
11
+ export interface CheckboxButtonProps extends FormComponentProps {
14
12
  /** 是否选中 */
15
13
  modelValue?: boolean
16
14
  /** 是否圆角 */
@@ -1,11 +1,9 @@
1
- import type { DeconstructValue } from '@veltra/utils'
2
-
3
- import type { FormFieldComponentProps } from './form-field'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
4
2
 
5
3
  export type CodeEditorLang = 'js' | 'sql' | 'java' | 'json'
6
4
 
7
5
  /** 代码编辑器组件属性(不支持 `size`) */
8
- export interface CodeEditorProps extends Omit<FormFieldComponentProps, 'size'> {
6
+ export interface CodeEditorProps extends Omit<FormComponentProps, 'size'> {
9
7
  modelValue?: string
10
8
  /** 定义语言 */
11
9
  language?: CodeEditorLang
@@ -1,10 +1,8 @@
1
1
  import type { Dater } from '@cat-kit/core'
2
- import type { DeconstructValue } from '@veltra/utils'
3
-
4
- import type { FormFieldComponentProps } from './form-field'
2
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
5
3
 
6
4
  /** date-picker组件属性 */
7
- export interface DatePickerProps extends FormFieldComponentProps {
5
+ export interface DatePickerProps extends FormComponentProps {
8
6
  modelValue?: string | number | Date
9
7
  /** 占位 */
10
8
  placeholder?: string
@@ -1,10 +1,8 @@
1
1
  import type { Dater } from '@cat-kit/core'
2
- import type { DeconstructValue } from '@veltra/utils'
3
-
4
- import type { FormFieldComponentProps } from './form-field'
2
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
5
3
 
6
4
  /** date-range-picker组件属性 */
7
- export interface DateRangePickerProps extends FormFieldComponentProps {
5
+ export interface DateRangePickerProps extends FormComponentProps {
8
6
  modelValue?: [string, string]
9
7
  /** 占位 */
10
8
  placeholder?: [string, string]
@@ -1,6 +1,4 @@
1
- import type { DeconstructValue } from '@veltra/utils'
2
-
3
- import type { FormFieldComponentProps } from './form-field'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
4
2
 
5
3
  export interface VariableItem {
6
4
  label: string
@@ -15,7 +13,7 @@ export interface VariableItem {
15
13
  export type ExpressionSelectableLevels = 'leaf' | 'any'
16
14
 
17
15
  /** 表达式编辑器组件属性 */
18
- export interface ExpressionEditorProps extends FormFieldComponentProps {
16
+ export interface ExpressionEditorProps extends FormComponentProps {
19
17
  modelValue?: string
20
18
  placeholder?: string
21
19
  /** 变量列表 */
@@ -1,9 +1,7 @@
1
- import type { DeconstructValue } from '@veltra/utils'
2
-
3
- import type { FormFieldComponentProps } from './form-field'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
4
2
 
5
3
  /** 文件上传器组件属性 */
6
- export interface UploaderProps extends FormFieldComponentProps {
4
+ export interface UploaderProps extends FormComponentProps {
7
5
  /** 渲染标签 */
8
6
  tag?: string
9
7
  /** 允许上传的文件类型 */
@@ -1,7 +1,7 @@
1
- import type { FormFieldComponentProps } from './form-field'
1
+ import type { FormComponentProps } from '@veltra/utils'
2
2
 
3
3
  /** 组件项组件属性 */
4
- export interface FormItemProps extends FormFieldComponentProps {
4
+ export interface FormItemProps extends FormComponentProps {
5
5
  /** 标签宽度 */
6
6
  labelWidth?: string | number
7
7
  }
@@ -1,12 +1,10 @@
1
- import type { DeconstructValue } from '@veltra/utils'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
2
2
  import type { StyleValue } from 'vue'
3
3
 
4
- import type { FormFieldComponentProps } from './form-field'
5
-
6
4
  /** 分组输入组件属性 */
7
5
  export interface GroupInputProps<
8
6
  GroupItem extends Record<string, any> = Record<string, any>
9
- > extends FormFieldComponentProps {
7
+ > extends FormComponentProps {
10
8
  modelValue?: GroupItem[]
11
9
  /** 最大数量 */
12
10
  max?: number
@@ -63,7 +63,6 @@ export * from './number-range-input'
63
63
  export * from './theme'
64
64
  export * from './loading'
65
65
  export * from './badge'
66
- export * from './form-field'
67
66
  export * from './form-item'
68
67
  export * from './group-input'
69
68
  export * from './paginator'
@@ -1,10 +1,8 @@
1
- import type { DeconstructValue } from '@veltra/utils'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
2
2
  import type { ShallowRef } from 'vue'
3
3
 
4
- import type { FormFieldComponentProps } from './form-field'
5
-
6
4
  /** 输入框组件属性 */
7
- export interface InputProps extends FormFieldComponentProps {
5
+ export interface InputProps extends FormComponentProps {
8
6
  /** modelValue */
9
7
  modelValue?: string
10
8
  /** 占位符 */
@@ -1,10 +1,8 @@
1
- import type { DeconstructValue } from '@veltra/utils'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
2
2
  import type { CSSProperties } from 'vue'
3
3
 
4
- import type { FormFieldComponentProps } from './form-field'
5
-
6
4
  /** multi-select组件属性 */
7
- export interface MultiSelectProps extends FormFieldComponentProps {
5
+ export interface MultiSelectProps extends FormComponentProps {
8
6
  /** 绑定值 */
9
7
  modelValue?: Array<any>
10
8
  /** 列表选项 */
@@ -1,13 +1,10 @@
1
- import type { DeconstructValue } from '@veltra/utils'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
2
2
  import type { CSSProperties } from 'vue'
3
3
 
4
- import type { FormFieldComponentProps } from './form-field'
5
4
  import type { TreeProps } from './tree'
6
5
  /** 树形多选组件组件属性 */
7
6
  export interface MultiTreeSelectProps
8
- extends
9
- FormFieldComponentProps,
10
- Omit<TreeProps, 'selected' | 'checked' | 'selectable' | 'checkable'> {
7
+ extends FormComponentProps, Omit<TreeProps, 'selected' | 'checked' | 'selectable' | 'checkable'> {
11
8
  modelValue?: (string | number)[]
12
9
 
13
10
  /**自定义占位文字 */
@@ -1,6 +1,4 @@
1
- import type { DeconstructValue } from '@veltra/utils'
2
-
3
- import type { FormFieldComponentProps } from './form-field'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
4
2
 
5
3
  /** 色调 */
6
4
  export interface PaletteRGB {
@@ -20,7 +18,7 @@ export interface PaletteHSV {
20
18
  export type PaletteColorType = 'HEX' | 'RGB'
21
19
 
22
20
  /** 调色盘组件属性 */
23
- export interface PaletteProps extends FormFieldComponentProps {
21
+ export interface PaletteProps extends FormComponentProps {
24
22
  modelValue?: string
25
23
  disabled?: boolean
26
24
  readonly?: boolean
@@ -1,8 +1,7 @@
1
- import type { DeconstructValue } from '@veltra/utils'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
2
2
 
3
- import type { FormFieldComponentProps } from './form-field'
4
3
  /** 单选框默认父组件组件属性 */
5
- export interface RadioGroupProps extends FormFieldComponentProps {
4
+ export interface RadioGroupProps extends FormComponentProps {
6
5
  /** 值 */
7
6
  modelValue?: any
8
7
  /** 单选框项 */
@@ -1,8 +1,7 @@
1
- import type { DeconstructValue } from '@veltra/utils'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
2
2
 
3
- import type { FormFieldComponentProps } from './form-field'
4
3
  /** 单选框组件属性 */
5
- export interface RadioProps extends FormFieldComponentProps {
4
+ export interface RadioProps extends FormComponentProps {
6
5
  /** 单选框值 */
7
6
  value?: any
8
7
  /** 文本 */
@@ -1,6 +1,4 @@
1
- import type { DeconstructValue } from '@veltra/utils'
2
-
3
- import type { FormFieldComponentProps } from './form-field'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
4
2
 
5
3
  /** 富文本数据格式 */
6
4
  export type RichTextFormat = 'html' | 'json'
@@ -23,7 +21,7 @@ export type ToolbarItem =
23
21
  | '|'
24
22
 
25
23
  /** 富文本编辑器组件属性 */
26
- export interface RichTextEditorProps extends FormFieldComponentProps {
24
+ export interface RichTextEditorProps extends FormComponentProps {
27
25
  modelValue?: string
28
26
  /** 数据格式:html 或 json */
29
27
  format?: RichTextFormat
@@ -1,10 +1,8 @@
1
- import type { DeconstructValue } from '@veltra/utils'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
2
2
  import type { CSSProperties, ShallowRef } from 'vue'
3
3
 
4
- import type { FormFieldComponentProps } from './form-field'
5
-
6
4
  /** 选择器组件属性 */
7
- export interface SelectProps extends FormFieldComponentProps {
5
+ export interface SelectProps extends FormComponentProps {
8
6
  /** 绑定值 */
9
7
  modelValue?: any
10
8
  /** 文本内容 */
@@ -1,9 +1,7 @@
1
- import type { DeconstructValue } from '@veltra/utils'
2
-
3
- import type { FormFieldComponentProps } from './form-field'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
4
2
 
5
3
  /** 滑块组件属性 */
6
- export interface SliderProps<T extends number | [number, number]> extends FormFieldComponentProps {
4
+ export interface SliderProps<T extends number | [number, number]> extends FormComponentProps {
7
5
  modelValue?: T
8
6
  /**
9
7
  * 最小值
@@ -1,9 +1,7 @@
1
- import type { DeconstructValue } from '@veltra/utils'
2
-
3
- import type { FormFieldComponentProps } from './form-field'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
4
2
 
5
3
  /** 开关组件属性 */
6
- export interface SwitchProps extends FormFieldComponentProps {
4
+ export interface SwitchProps extends FormComponentProps {
7
5
  /** 开关状态 */
8
6
  modelValue?: boolean
9
7
  /** 打开时显示的文字 */
@@ -1,6 +1,4 @@
1
- import type { DeconstructValue } from '@veltra/utils'
2
-
3
- import type { FormFieldComponentProps } from './form-field'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
4
2
 
5
3
  /** text-editor组件属性 */
6
4
  export interface BarType {
@@ -8,7 +6,7 @@ export interface BarType {
8
6
  bar: string
9
7
  }
10
8
 
11
- export interface TextEditorProps extends FormFieldComponentProps {
9
+ export interface TextEditorProps extends FormComponentProps {
12
10
  modelValue?: string
13
11
  placeholder?: string
14
12
  toolbar?: BarType[]
@@ -1,9 +1,7 @@
1
- import type { DeconstructValue } from '@veltra/utils'
2
-
3
- import type { FormFieldComponentProps } from './form-field'
1
+ import type { DeconstructValue, FormComponentProps } from '@veltra/utils'
4
2
 
5
3
  /** textarea组件属性 */
6
- export interface TextareaProps extends FormFieldComponentProps {
4
+ export interface TextareaProps extends FormComponentProps {
7
5
  /**
8
6
  * 文本域的值
9
7
  */