@veltra/desktop 1.2.20 → 1.2.21

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 (35) hide show
  1. package/dist/components/action/action-group.vue.d.ts +2 -2
  2. package/dist/components/action/action.vue.d.ts +1 -1
  3. package/dist/components/auto-complete/auto-complete.vue.d.ts +2 -2
  4. package/dist/components/cascade/cascade.vue.d.ts +5 -5
  5. package/dist/components/checkbox/checkbox-button.vue.d.ts +2 -2
  6. package/dist/components/checkbox/checkbox.vue.d.ts +1 -1
  7. package/dist/components/checkbox-group/checkbox-group.vue.d.ts +2 -2
  8. package/dist/components/code-editor/code-editor.vue.d.ts +1 -1
  9. package/dist/components/date-panel/date-panel.vue.d.ts +1 -1
  10. package/dist/components/date-picker/date-picker.vue.d.ts +3 -3
  11. package/dist/components/date-range-picker/date-range-picker.vue.d.ts +3 -3
  12. package/dist/components/empty/empty.vue.d.ts +1 -1
  13. package/dist/components/file-picker/file-picker.vue.d.ts +1 -1
  14. package/dist/components/form/form.js.map +1 -1
  15. package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js +1 -0
  16. package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js.map +1 -1
  17. package/dist/components/form-item/style2.css +1 -0
  18. package/dist/components/input/input.vue.d.ts +2 -2
  19. package/dist/components/multi-select/multi-select.vue.d.ts +4 -4
  20. package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +4 -4
  21. package/dist/components/number-input/number-input.vue.d.ts +2 -2
  22. package/dist/components/number-range-input/number-range-input.vue.d.ts +2 -2
  23. package/dist/components/palette/palette.vue.d.ts +1 -1
  24. package/dist/components/password-input/password-input.vue.d.ts +2 -2
  25. package/dist/components/radio-group/radio-group.vue.d.ts +2 -2
  26. package/dist/components/rich-text-editor/rich-text-editor.vue.d.ts +2 -2
  27. package/dist/components/select/select.vue.d.ts +4 -4
  28. package/dist/components/steps/steps.vue.d.ts +2 -2
  29. package/dist/components/switch/switch.vue.d.ts +1 -1
  30. package/dist/components/textarea/textarea.vue.d.ts +2 -2
  31. package/dist/components/tree-select/tree-select.vue.d.ts +4 -4
  32. package/dist/components/watermark/watermark.vue.d.ts +1 -1
  33. package/package.json +6 -6
  34. package/src/components/form/form.vue +1 -0
  35. package/src/components/form-item/style.scss +1 -0
@@ -6,11 +6,11 @@ type __VLS_Slots = {
6
6
  default?: () => VNode[];
7
7
  };
8
8
  declare const __VLS_base: import("vue").DefineComponent<ActionGroupProps, _ActionGroupExposed, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ActionGroupProps> & Readonly<{}>, {
9
+ size: "small" | "default" | "large";
9
10
  type: import("@veltra/utils").ColorType;
10
11
  text: boolean;
11
- size: "small" | "default" | "large";
12
- circle: boolean;
13
12
  max: number;
13
+ circle: boolean;
14
14
  loading: boolean;
15
15
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
16
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -12,9 +12,9 @@ declare const __VLS_base: import("vue").DefineComponent<ActionProps, {}, {}, {},
12
12
  }, string, import("vue").PublicProps, Readonly<ActionProps> & Readonly<{
13
13
  onRun?: (() => any) | undefined;
14
14
  }>, {
15
+ size: import("@veltra/utils").ComponentSize;
15
16
  type: ButtonType;
16
17
  text: boolean;
17
- size: import("@veltra/utils").ComponentSize;
18
18
  circle: boolean;
19
19
  loading: boolean;
20
20
  inDropdown: boolean;
@@ -22,10 +22,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, _Auto
22
22
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
23
23
  onSelect?: ((value: string) => any) | undefined;
24
24
  }>, {
25
+ readonly: boolean;
26
+ disabled: boolean;
25
27
  placeholder: string;
26
28
  clearable: boolean;
27
- disabled: boolean;
28
- readonly: boolean;
29
29
  allowCustom: boolean;
30
30
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
31
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -11,17 +11,17 @@ declare const __VLS_export: import("vue").DefineComponent<CascadeProps, {}, {},
11
11
  onChange?: ((...args: [item?: Record<string, any> | undefined] | [items: Record<string, any>[]]) => any) | undefined;
12
12
  "onUpdate:label"?: ((label?: string | string[] | undefined) => any) | undefined;
13
13
  }>, {
14
+ readonly: boolean;
15
+ disabled: boolean;
16
+ placeholder: string;
17
+ clearable: boolean;
14
18
  labelKey: string;
15
19
  valueKey: string;
16
20
  childrenKey: string;
17
21
  data: Record<string, any>[];
18
- placeholder: string;
19
- clearable: boolean;
20
22
  filterable: boolean;
21
- disabled: boolean;
22
- readonly: boolean;
23
- visibilityLimit: number;
24
23
  separator: string;
24
+ visibilityLimit: number;
25
25
  showFullPath: boolean;
26
26
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
27
  declare const _default: typeof __VLS_export;
@@ -17,9 +17,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
17
17
  "onUpdate:modelValue"?: ((checked: boolean) => any) | undefined;
18
18
  onChange?: ((checked: boolean) => any) | undefined;
19
19
  }>, {
20
- type: import("@veltra/utils").ColorType;
21
- disabled: boolean;
22
20
  readonly: boolean;
21
+ disabled: boolean;
22
+ type: import("@veltra/utils").ColorType;
23
23
  round: boolean;
24
24
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
25
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -18,8 +18,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
18
18
  "onUpdate:modelValue"?: ((checked: boolean) => any) | undefined;
19
19
  onChange?: ((checked: boolean, e: MouseEvent) => any) | undefined;
20
20
  }>, {
21
- disabled: boolean;
22
21
  readonly: boolean;
22
+ disabled: boolean;
23
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
24
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
25
25
  declare const _default: typeof __VLS_export;
@@ -12,10 +12,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
12
12
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
13
  "onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
14
14
  }>, {
15
+ readonly: boolean;
16
+ disabled: boolean;
15
17
  labelKey: string;
16
18
  valueKey: string;
17
- disabled: boolean;
18
- readonly: boolean;
19
19
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
20
  declare const _default: typeof __VLS_export;
21
21
  //#endregion
@@ -10,8 +10,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
10
10
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
11
11
  "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
12
12
  }>, {
13
- disabled: boolean;
14
13
  readonly: boolean;
14
+ disabled: boolean;
15
15
  dark: boolean;
16
16
  defaultLines: number;
17
17
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -7,8 +7,8 @@ declare const __VLS_export: import("vue").DefineComponent<DatePanelProps, {}, {}
7
7
  "onSelect:range-date"?: ((rangeDate?: [import("@cat-kit/core").Dater, import("@cat-kit/core").Dater] | undefined) => any) | undefined;
8
8
  "onSelect:date"?: ((date: import("@cat-kit/core").Dater) => any) | undefined;
9
9
  }>, {
10
- type: "date" | "month" | "year";
11
10
  size: import("@veltra/utils").ComponentSize;
11
+ type: "date" | "month" | "year";
12
12
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
13
  declare const _default: typeof __VLS_export;
14
14
  //#endregion
@@ -5,11 +5,11 @@ declare const __VLS_export: import("vue").DefineComponent<DatePickerProps, {}, {
5
5
  }, string, import("vue").PublicProps, Readonly<DatePickerProps> & Readonly<{
6
6
  "onUpdate:modelValue"?: ((value?: string | number | Date | undefined) => any) | undefined;
7
7
  }>, {
8
- type: "date" | "month" | "year";
8
+ readonly: boolean;
9
+ disabled: boolean;
9
10
  placeholder: string;
11
+ type: "date" | "month" | "year";
10
12
  clearable: boolean;
11
- disabled: boolean;
12
- readonly: boolean;
13
13
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
14
  declare const _default: typeof __VLS_export;
15
15
  //#endregion
@@ -5,11 +5,11 @@ declare const __VLS_export: import("vue").DefineComponent<DateRangePickerProps,
5
5
  }, string, import("vue").PublicProps, Readonly<DateRangePickerProps> & Readonly<{
6
6
  "onUpdate:modelValue"?: ((value?: [string, string] | undefined) => any) | undefined;
7
7
  }>, {
8
- type: "date" | "month" | "year";
8
+ readonly: boolean;
9
+ disabled: boolean;
9
10
  placeholder: [string, string];
11
+ type: "date" | "month" | "year";
10
12
  clearable: boolean;
11
- disabled: boolean;
12
- readonly: boolean;
13
13
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
14
  declare const _default: typeof __VLS_export;
15
15
  //#endregion
@@ -1,8 +1,8 @@
1
1
  import { EmptyProps } from "../../types/empty.js";
2
2
  //#region src/components/empty/empty.vue.d.ts
3
3
  declare const __VLS_export: import("vue").DefineComponent<EmptyProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<EmptyProps> & Readonly<{}>, {
4
- text: string;
5
4
  size: number;
5
+ text: string;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  //#endregion
@@ -11,8 +11,8 @@ declare const __VLS_base: import("vue").DefineComponent<UploaderProps, {}, {}, {
11
11
  }, string, import("vue").PublicProps, Readonly<UploaderProps> & Readonly<{
12
12
  onPick?: ((files: File[]) => any) | undefined;
13
13
  }>, {
14
- tag: string;
15
14
  multiple: boolean;
15
+ tag: string;
16
16
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
17
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
18
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"form.js","names":[],"sources":["../../../src/components/form/form.vue"],"sourcesContent":["<template>\n <u-grid\n tag=\"form\"\n ref=\"grid\"\n @submit.prevent\n :cols=\"cols || breakpointCols\"\n :class=\"[cls.b, bem.is('readonly', readonly)]\"\n >\n <template\n v-for=\"{ node, isFormItem, formItemProps, field, modelValue } of getSlotsNodes()\"\n :key=\"node.key\"\n >\n <u-form-item v-if=\"!isFormItem && field\" v-bind=\"formItemProps\">\n <component\n :is=\"node\"\n :model-value=\"modelValue ?? o(model ?? {}).get(field)\"\n @update:model-value=\"handleUpdateValue(field, $event)\"\n />\n </u-form-item>\n\n <component v-else :is=\"node\" />\n </template>\n </u-grid>\n</template>\n\n<script lang=\"tsx\" setup>\nimport { o } from '@cat-kit/core'\nimport { bem } from '@veltra/utils'\nimport { provideFormContext } from '@veltra/utils'\nimport { nextTick, toRef, useTemplateRef } from 'vue'\n\nimport type { BreakCols, FormProps, _FormExposed, FormEmits } from '../../types'\nimport { UFormItem } from '../form-item'\nimport { UGrid } from '../grid'\nimport { useFormFields } from './use-form-fields'\nimport { useNodeInterceptor } from './use-node-interceptor'\n\ndefineOptions({ name: 'UForm' })\n\nconst props = defineProps<FormProps>()\n\nconst emit = defineEmits<FormEmits>()\n\ndefineSlots<{ default(props?: { data: Record<string, any> | undefined }): any }>()\n\nconst cls = bem('form')\nconst formItemCls = bem('form-item')\nconst gridRef = useTemplateRef('grid')\n\nconst breakpointCols: BreakCols = { xs: 1, md: 2, lg: 3, xl: 4, default: 4 }\n\nconst {\n validate: runValidate,\n clearValidate,\n reset,\n registerField,\n unregisterField,\n shouldValidate\n} = useFormFields({ props })\n\nasync function validate(keys?: string[]) {\n const valid = await runValidate(keys)\n if (!valid) {\n await nextTick()\n\n gridRef.value?.el\n ?.querySelector(`.${formItemCls.e('error-text')}`)\n ?.scrollIntoView({ block: 'center' })\n }\n return valid\n}\n\nfunction handleFieldChange(field: string, value: any) {\n emit('field:change', field, value)\n}\n\nprovideFormContext({\n formProps: props,\n registerField,\n unregisterField,\n validateFields: validate,\n shouldValidate,\n handleFieldChange\n})\n\nconst { getSlotsNodes } = useNodeInterceptor()\n\nfunction handleUpdateValue(field: string, value: any) {\n if (!props.model) return\n o(props.model).set(field, value)\n}\n\ndefineExpose<_FormExposed>({ el: toRef(() => gridRef.value?.el), validate, clearValidate, reset })\n</script>\n"],"mappings":""}
1
+ {"version":3,"file":"form.js","names":[],"sources":["../../../src/components/form/form.vue"],"sourcesContent":["<template>\n <u-grid\n tag=\"form\"\n ref=\"grid\"\n @submit.prevent\n gap=\"0 12px\"\n :cols=\"cols || breakpointCols\"\n :class=\"[cls.b, bem.is('readonly', readonly)]\"\n >\n <template\n v-for=\"{ node, isFormItem, formItemProps, field, modelValue } of getSlotsNodes()\"\n :key=\"node.key\"\n >\n <u-form-item v-if=\"!isFormItem && field\" v-bind=\"formItemProps\">\n <component\n :is=\"node\"\n :model-value=\"modelValue ?? o(model ?? {}).get(field)\"\n @update:model-value=\"handleUpdateValue(field, $event)\"\n />\n </u-form-item>\n\n <component v-else :is=\"node\" />\n </template>\n </u-grid>\n</template>\n\n<script lang=\"tsx\" setup>\nimport { o } from '@cat-kit/core'\nimport { bem } from '@veltra/utils'\nimport { provideFormContext } from '@veltra/utils'\nimport { nextTick, toRef, useTemplateRef } from 'vue'\n\nimport type { BreakCols, FormProps, _FormExposed, FormEmits } from '../../types'\nimport { UFormItem } from '../form-item'\nimport { UGrid } from '../grid'\nimport { useFormFields } from './use-form-fields'\nimport { useNodeInterceptor } from './use-node-interceptor'\n\ndefineOptions({ name: 'UForm' })\n\nconst props = defineProps<FormProps>()\n\nconst emit = defineEmits<FormEmits>()\n\ndefineSlots<{ default(props?: { data: Record<string, any> | undefined }): any }>()\n\nconst cls = bem('form')\nconst formItemCls = bem('form-item')\nconst gridRef = useTemplateRef('grid')\n\nconst breakpointCols: BreakCols = { xs: 1, md: 2, lg: 3, xl: 4, default: 4 }\n\nconst {\n validate: runValidate,\n clearValidate,\n reset,\n registerField,\n unregisterField,\n shouldValidate\n} = useFormFields({ props })\n\nasync function validate(keys?: string[]) {\n const valid = await runValidate(keys)\n if (!valid) {\n await nextTick()\n\n gridRef.value?.el\n ?.querySelector(`.${formItemCls.e('error-text')}`)\n ?.scrollIntoView({ block: 'center' })\n }\n return valid\n}\n\nfunction handleFieldChange(field: string, value: any) {\n emit('field:change', field, value)\n}\n\nprovideFormContext({\n formProps: props,\n registerField,\n unregisterField,\n validateFields: validate,\n shouldValidate,\n handleFieldChange\n})\n\nconst { getSlotsNodes } = useNodeInterceptor()\n\nfunction handleUpdateValue(field: string, value: any) {\n if (!props.model) return\n o(props.model).set(field, value)\n}\n\ndefineExpose<_FormExposed>({ el: toRef(() => gridRef.value?.el), validate, clearValidate, reset })\n</script>\n"],"mappings":""}
@@ -69,6 +69,7 @@ var form_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
69
69
  tag: "form",
70
70
  ref: "grid",
71
71
  onSubmit: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"])),
72
+ gap: "0 12px",
72
73
  cols: __props.cols || breakpointCols,
73
74
  class: normalizeClass([unref(cls).b, unref(bem).is("readonly", __props.readonly)])
74
75
  }, {
@@ -1 +1 @@
1
- {"version":3,"file":"form.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/form/form.vue"],"sourcesContent":["<template>\n <u-grid\n tag=\"form\"\n ref=\"grid\"\n @submit.prevent\n :cols=\"cols || breakpointCols\"\n :class=\"[cls.b, bem.is('readonly', readonly)]\"\n >\n <template\n v-for=\"{ node, isFormItem, formItemProps, field, modelValue } of getSlotsNodes()\"\n :key=\"node.key\"\n >\n <u-form-item v-if=\"!isFormItem && field\" v-bind=\"formItemProps\">\n <component\n :is=\"node\"\n :model-value=\"modelValue ?? o(model ?? {}).get(field)\"\n @update:model-value=\"handleUpdateValue(field, $event)\"\n />\n </u-form-item>\n\n <component v-else :is=\"node\" />\n </template>\n </u-grid>\n</template>\n\n<script lang=\"tsx\" setup>\nimport { o } from '@cat-kit/core'\nimport { bem } from '@veltra/utils'\nimport { provideFormContext } from '@veltra/utils'\nimport { nextTick, toRef, useTemplateRef } from 'vue'\n\nimport type { BreakCols, FormProps, _FormExposed, FormEmits } from '../../types'\nimport { UFormItem } from '../form-item'\nimport { UGrid } from '../grid'\nimport { useFormFields } from './use-form-fields'\nimport { useNodeInterceptor } from './use-node-interceptor'\n\ndefineOptions({ name: 'UForm' })\n\nconst props = defineProps<FormProps>()\n\nconst emit = defineEmits<FormEmits>()\n\ndefineSlots<{ default(props?: { data: Record<string, any> | undefined }): any }>()\n\nconst cls = bem('form')\nconst formItemCls = bem('form-item')\nconst gridRef = useTemplateRef('grid')\n\nconst breakpointCols: BreakCols = { xs: 1, md: 2, lg: 3, xl: 4, default: 4 }\n\nconst {\n validate: runValidate,\n clearValidate,\n reset,\n registerField,\n unregisterField,\n shouldValidate\n} = useFormFields({ props })\n\nasync function validate(keys?: string[]) {\n const valid = await runValidate(keys)\n if (!valid) {\n await nextTick()\n\n gridRef.value?.el\n ?.querySelector(`.${formItemCls.e('error-text')}`)\n ?.scrollIntoView({ block: 'center' })\n }\n return valid\n}\n\nfunction handleFieldChange(field: string, value: any) {\n emit('field:change', field, value)\n}\n\nprovideFormContext({\n formProps: props,\n registerField,\n unregisterField,\n validateFields: validate,\n shouldValidate,\n handleFieldChange\n})\n\nconst { getSlotsNodes } = useNodeInterceptor()\n\nfunction handleUpdateValue(field: string, value: any) {\n if (!props.model) return\n o(props.model).set(field, value)\n}\n\ndefineExpose<_FormExposed>({ el: toRef(() => gridRef.value?.el), validate, clearValidate, reset })\n</script>\n"],"mappings":";;;;;;;;;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W,UAAA,MAAA,WAZwD,MAAA,aAAA,CAAa,CAAA,IAAA,EAArE,MAAM,YAAY,eAAe,OAAO,iBAAU;6DACrD,KAAK,IAAA,GAAA,CAAA,CAES,cAAc,SAAA,UAAA,GAAlC,YAMc,MAAA,iBAAA,GANd,WAMc;;;QANmC,aAAa,GAAA;6BAK1D,EAAA,UAAA,GAJF,YAIE,wBAHK,IAAI,GAAA;OACR,eAAa,cAAc,MAAA,CAAA,CAAC,CAAC,QAAA,SAAK,CAAA,CAAA,CAAA,CAAQ,IAAI,KAAK;OACnD,wBAAkB,WAAE,kBAAkB,OAAO,MAAM;;;+BAIxD,YAA+B,wBAAR,IAAI,GAAA,EAAA,KAAA,EAAA,CAAA,EAAA,GAAA,EAAA"}
1
+ {"version":3,"file":"form.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/form/form.vue"],"sourcesContent":["<template>\n <u-grid\n tag=\"form\"\n ref=\"grid\"\n @submit.prevent\n gap=\"0 12px\"\n :cols=\"cols || breakpointCols\"\n :class=\"[cls.b, bem.is('readonly', readonly)]\"\n >\n <template\n v-for=\"{ node, isFormItem, formItemProps, field, modelValue } of getSlotsNodes()\"\n :key=\"node.key\"\n >\n <u-form-item v-if=\"!isFormItem && field\" v-bind=\"formItemProps\">\n <component\n :is=\"node\"\n :model-value=\"modelValue ?? o(model ?? {}).get(field)\"\n @update:model-value=\"handleUpdateValue(field, $event)\"\n />\n </u-form-item>\n\n <component v-else :is=\"node\" />\n </template>\n </u-grid>\n</template>\n\n<script lang=\"tsx\" setup>\nimport { o } from '@cat-kit/core'\nimport { bem } from '@veltra/utils'\nimport { provideFormContext } from '@veltra/utils'\nimport { nextTick, toRef, useTemplateRef } from 'vue'\n\nimport type { BreakCols, FormProps, _FormExposed, FormEmits } from '../../types'\nimport { UFormItem } from '../form-item'\nimport { UGrid } from '../grid'\nimport { useFormFields } from './use-form-fields'\nimport { useNodeInterceptor } from './use-node-interceptor'\n\ndefineOptions({ name: 'UForm' })\n\nconst props = defineProps<FormProps>()\n\nconst emit = defineEmits<FormEmits>()\n\ndefineSlots<{ default(props?: { data: Record<string, any> | undefined }): any }>()\n\nconst cls = bem('form')\nconst formItemCls = bem('form-item')\nconst gridRef = useTemplateRef('grid')\n\nconst breakpointCols: BreakCols = { xs: 1, md: 2, lg: 3, xl: 4, default: 4 }\n\nconst {\n validate: runValidate,\n clearValidate,\n reset,\n registerField,\n unregisterField,\n shouldValidate\n} = useFormFields({ props })\n\nasync function validate(keys?: string[]) {\n const valid = await runValidate(keys)\n if (!valid) {\n await nextTick()\n\n gridRef.value?.el\n ?.querySelector(`.${formItemCls.e('error-text')}`)\n ?.scrollIntoView({ block: 'center' })\n }\n return valid\n}\n\nfunction handleFieldChange(field: string, value: any) {\n emit('field:change', field, value)\n}\n\nprovideFormContext({\n formProps: props,\n registerField,\n unregisterField,\n validateFields: validate,\n shouldValidate,\n handleFieldChange\n})\n\nconst { getSlotsNodes } = useNodeInterceptor()\n\nfunction handleUpdateValue(field: string, value: any) {\n if (!props.model) return\n o(props.model).set(field, value)\n}\n\ndefineExpose<_FormExposed>({ el: toRef(() => gridRef.value?.el), validate, clearValidate, reset })\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAwCA,MAAM,QAAQ;EAEd,MAAM,OAAO;EAIb,MAAM,MAAM,IAAI,MAAM;EACtB,MAAM,cAAc,IAAI,WAAW;EACnC,MAAM,UAAU,eAAe,MAAM;EAErC,MAAM,iBAA4B;GAAE,IAAI;GAAG,IAAI;GAAG,IAAI;GAAG,IAAI;GAAG,SAAS;EAAE;EAE3E,MAAM,EACJ,UAAU,aACV,eACA,OACA,eACA,iBACA,mBACE,cAAc,EAAE,MAAM,CAAC;EAE3B,eAAe,SAAS,MAAiB;GACvC,MAAM,QAAQ,MAAM,YAAY,IAAI;GACpC,IAAI,CAAC,OAAO;IACV,MAAM,SAAS;IAEf,QAAQ,OAAO,IACX,cAAc,IAAI,YAAY,EAAE,YAAY,GAAG,CA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-71,6 +71,7 @@
71
71
  }
72
72
  .u-form-item__label.is-required::before {
73
73
  content: "*";
74
+ padding-right: 2px;
74
75
  color: var(--u-color-danger);
75
76
  }
76
77
  .u-form-item__wrapper {
@@ -32,10 +32,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, _Inpu
32
32
  onBlur?: ((value?: string | undefined) => any) | undefined;
33
33
  "onNative:input"?: ((ev: Event) => any) | undefined;
34
34
  }>, {
35
+ readonly: boolean;
36
+ disabled: boolean;
35
37
  placeholder: string;
36
38
  clearable: boolean;
37
- disabled: boolean;
38
- readonly: boolean;
39
39
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
40
40
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
41
41
  declare const _default: typeof __VLS_export;
@@ -26,13 +26,13 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
26
26
  "onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
27
27
  onChange?: ((options: Record<string, any>[]) => any) | undefined;
28
28
  }>, {
29
- labelKey: string;
30
- valueKey: string;
29
+ readonly: boolean;
30
+ disabled: boolean;
31
31
  placeholder: string;
32
32
  clearable: boolean;
33
+ labelKey: string;
34
+ valueKey: string;
33
35
  minWidth: string;
34
- disabled: boolean;
35
- readonly: boolean;
36
36
  visibilityLimit: number;
37
37
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
38
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -21,15 +21,15 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
21
21
  onClear?: (() => any) | undefined;
22
22
  onChange?: ((checked: Record<string, any>[]) => any) | undefined;
23
23
  }>, {
24
+ readonly: boolean;
25
+ disabled: boolean;
26
+ placeholder: string;
27
+ clearable: boolean;
24
28
  expandAll: boolean;
25
29
  labelKey: string;
26
30
  valueKey: string;
27
- placeholder: string;
28
- clearable: boolean;
29
31
  filterable: boolean;
30
32
  minWidth: string;
31
- disabled: boolean;
32
- readonly: boolean;
33
33
  visibilityLimit: number;
34
34
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
35
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -20,10 +20,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
20
20
  onClear?: (() => any) | undefined;
21
21
  onChange?: ((value?: number | undefined) => any) | undefined;
22
22
  }>, {
23
+ readonly: boolean;
24
+ disabled: boolean;
23
25
  placeholder: string;
24
26
  clearable: boolean;
25
- disabled: boolean;
26
- readonly: boolean;
27
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
28
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
29
  declare const _default: typeof __VLS_export;
@@ -22,9 +22,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
22
22
  "onUpdate:start"?: ((value: number | undefined) => any) | undefined;
23
23
  "onUpdate:end"?: ((value: number | undefined) => any) | undefined;
24
24
  }>, {
25
- clearable: boolean;
26
- disabled: boolean;
27
25
  readonly: boolean;
26
+ disabled: boolean;
27
+ clearable: boolean;
28
28
  startPlaceholder: string;
29
29
  endPlaceholder: string;
30
30
  separator: string;
@@ -10,8 +10,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
10
10
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
11
11
  "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
12
12
  }>, {
13
- disabled: boolean;
14
13
  readonly: boolean;
14
+ disabled: boolean;
15
15
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
16
  declare const _default: typeof __VLS_export;
17
17
  //#endregion
@@ -13,9 +13,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
13
13
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
14
14
  "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
15
15
  }>, {
16
- clearable: boolean;
17
- disabled: boolean;
18
16
  readonly: boolean;
17
+ disabled: boolean;
18
+ clearable: boolean;
19
19
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
20
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
21
21
  declare const _default: typeof __VLS_export;
@@ -14,10 +14,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
14
14
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
15
15
  onChange?: ((item: Record<string, any>) => any) | undefined;
16
16
  }>, {
17
+ readonly: boolean;
18
+ disabled: boolean;
17
19
  labelKey: string;
18
20
  valueKey: string;
19
- disabled: boolean;
20
- readonly: boolean;
21
21
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
22
  declare const _default: typeof __VLS_export;
23
23
  //#endregion
@@ -10,9 +10,9 @@ declare const __VLS_export: import("vue").DefineComponent<RichTextEditorProps &
10
10
  }> & Readonly<{
11
11
  "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
12
12
  }>, {
13
- placeholder: string;
14
- disabled: boolean;
15
13
  readonly: boolean;
14
+ disabled: boolean;
15
+ placeholder: string;
16
16
  format: RichTextFormat;
17
17
  toolbar: ToolbarItem[];
18
18
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -24,12 +24,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
24
24
  "onUpdate:text"?: ((value: any) => any) | undefined;
25
25
  "onUpdate:label"?: ((label?: string | undefined) => any) | undefined;
26
26
  }>, {
27
- labelKey: string;
28
- valueKey: string;
27
+ readonly: boolean;
28
+ disabled: boolean;
29
29
  placeholder: string;
30
30
  clearable: boolean;
31
- disabled: boolean;
32
- readonly: boolean;
31
+ labelKey: string;
32
+ valueKey: string;
33
33
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
34
34
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
35
35
  declare const _default: typeof __VLS_export;
@@ -6,11 +6,11 @@ type __VLS_Slots = {
6
6
  tip?: (scope: StepsSlotScope) => any;
7
7
  };
8
8
  declare const __VLS_base: import("vue").DefineComponent<StepsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
- "update:current": (value?: string | number | undefined) => any;
10
9
  "item-click": (item: Record<string, any>, index: number) => any;
10
+ "update:current": (value?: string | number | undefined) => any;
11
11
  }, string, import("vue").PublicProps, Readonly<StepsProps> & Readonly<{
12
- "onUpdate:current"?: ((value?: string | number | undefined) => any) | undefined;
13
12
  "onItem-click"?: ((item: Record<string, any>, index: number) => any) | undefined;
13
+ "onUpdate:current"?: ((value?: string | number | undefined) => any) | undefined;
14
14
  }>, {
15
15
  labelKey: string;
16
16
  direction: "horizontal" | "vertical";
@@ -14,8 +14,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
14
14
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
15
15
  onChange?: ((value: boolean) => any) | undefined;
16
16
  }>, {
17
- disabled: boolean;
18
17
  readonly: boolean;
18
+ disabled: boolean;
19
19
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
20
  declare const _default: typeof __VLS_export;
21
21
  //#endregion
@@ -20,10 +20,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
20
20
  onFocus?: (() => any) | undefined;
21
21
  onBlur?: (() => any) | undefined;
22
22
  }>, {
23
+ readonly: boolean;
24
+ disabled: boolean;
23
25
  placeholder: string;
24
26
  clearable: boolean;
25
- disabled: boolean;
26
- readonly: boolean;
27
27
  resize: boolean;
28
28
  autosize: boolean;
29
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -24,15 +24,15 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
24
24
  onChange?: ((selectedData?: Record<string, any> | undefined) => any) | undefined;
25
25
  "onUpdate:text"?: ((text?: string | undefined) => any) | undefined;
26
26
  }>, {
27
+ readonly: boolean;
28
+ disabled: boolean;
29
+ placeholder: string;
30
+ clearable: boolean;
27
31
  expandAll: boolean;
28
32
  labelKey: string;
29
33
  valueKey: string;
30
- placeholder: string;
31
- clearable: boolean;
32
34
  filterable: boolean;
33
35
  minWidth: string;
34
- disabled: boolean;
35
- readonly: boolean;
36
36
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
37
37
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
38
38
  declare const _default: typeof __VLS_export;
@@ -5,8 +5,8 @@ type __VLS_Slots = {} & {
5
5
  default?: (props: typeof __VLS_7) => any;
6
6
  };
7
7
  declare const __VLS_base: import("vue").DefineComponent<WatermarkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<WatermarkProps> & Readonly<{}>, {
8
- route: number;
9
8
  fontSize: number;
9
+ route: number;
10
10
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
11
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
12
  declare const _default: typeof __VLS_export;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltra/desktop",
3
- "version": "1.2.20",
3
+ "version": "1.2.21",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -57,11 +57,11 @@
57
57
  "@cat-kit/core": ">=1.1.8",
58
58
  "@cat-kit/excel": ">=1.0.0",
59
59
  "@cat-kit/fe": "^1.1.8",
60
- "@veltra/compositions": "1.2.20",
61
- "@veltra/directives": "1.2.20",
62
- "@veltra/icons": "1.2.20",
63
- "@veltra/styles": "1.2.20",
64
- "@veltra/utils": "1.2.20",
60
+ "@veltra/compositions": "1.2.21",
61
+ "@veltra/directives": "1.2.21",
62
+ "@veltra/icons": "1.2.21",
63
+ "@veltra/styles": "1.2.21",
64
+ "@veltra/utils": "1.2.21",
65
65
  "vue": ">=3.5.39"
66
66
  },
67
67
  "devDependencies": {
@@ -3,6 +3,7 @@
3
3
  tag="form"
4
4
  ref="grid"
5
5
  @submit.prevent
6
+ gap="0 12px"
6
7
  :cols="cols || breakpointCols"
7
8
  :class="[cls.b, bem.is('readonly', readonly)]"
8
9
  >
@@ -39,6 +39,7 @@ $root-name: form-item;
39
39
  @include m.is(required) {
40
40
  &::before {
41
41
  content: '*';
42
+ padding-right: 2px;
42
43
  color: fn.use-var(color, danger);
43
44
  }
44
45
  }