@veltra/desktop 1.2.29 → 1.2.30

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 (27) hide show
  1. package/dist/components/action/action-group.vue.d.ts +1 -1
  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 +3 -3
  5. package/dist/components/checkbox-group/checkbox-group.vue.d.ts +2 -2
  6. package/dist/components/date-picker/date-picker.vue.d.ts +2 -2
  7. package/dist/components/date-range-picker/date-range-picker.vue.d.ts +2 -2
  8. package/dist/components/empty/empty.vue.d.ts +1 -1
  9. package/dist/components/file-picker/file-picker.vue.d.ts +1 -1
  10. package/dist/components/grid-input/grid-input.js +19 -2
  11. package/dist/components/grid-input/grid-input.js.map +1 -1
  12. package/dist/components/input/input.vue.d.ts +6 -6
  13. package/dist/components/multi-select/multi-select.vue.d.ts +3 -3
  14. package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +3 -3
  15. package/dist/components/number/number.vue.d.ts +1 -1
  16. package/dist/components/number-input/number-input.vue.d.ts +2 -2
  17. package/dist/components/number-range-input/number-range-input.vue.d.ts +1 -1
  18. package/dist/components/password-input/password-input.vue.d.ts +1 -1
  19. package/dist/components/radio-group/radio-group.vue.d.ts +2 -2
  20. package/dist/components/rich-text-editor/rich-text-editor.vue.d.ts +1 -1
  21. package/dist/components/select/select.vue.d.ts +2 -2
  22. package/dist/components/steps/steps.vue.d.ts +2 -2
  23. package/dist/components/textarea/textarea.vue.d.ts +2 -2
  24. package/dist/components/tree-select/tree-select.vue.d.ts +3 -3
  25. package/dist/components/watermark/watermark.vue.d.ts +1 -1
  26. package/package.json +6 -6
  27. package/src/components/grid-input/grid-input.vue +24 -2
@@ -7,8 +7,8 @@ type __VLS_Slots = {
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
9
  type: import("@veltra/utils").ColorType;
10
- size: "small" | "default" | "large";
11
10
  text: boolean;
11
+ size: "small" | "default" | "large";
12
12
  max: number;
13
13
  circle: boolean;
14
14
  loading: boolean;
@@ -13,8 +13,8 @@ declare const __VLS_base: import("vue").DefineComponent<ActionProps, {}, {}, {},
13
13
  onRun?: (() => any) | undefined;
14
14
  }>, {
15
15
  type: ButtonType;
16
- size: import("@veltra/utils").ComponentSize;
17
16
  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
- disabled: boolean;
26
- readonly: boolean;
27
25
  placeholder: string;
28
26
  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,8 +11,6 @@ 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
- disabled: boolean;
15
- readonly: boolean;
16
14
  labelKey: string;
17
15
  valueKey: string;
18
16
  childrenKey: string;
@@ -20,9 +18,11 @@ declare const __VLS_export: import("vue").DefineComponent<CascadeProps, {}, {},
20
18
  placeholder: string;
21
19
  clearable: boolean;
22
20
  filterable: boolean;
21
+ disabled: boolean;
22
+ readonly: boolean;
23
23
  separator: string;
24
- visibilityLimit: number;
25
24
  showFullPath: boolean;
25
+ visibilityLimit: number;
26
26
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
27
  declare const _default: typeof __VLS_export;
28
28
  //#endregion
@@ -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
- disabled: boolean;
16
- readonly: boolean;
17
15
  labelKey: string;
18
16
  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
@@ -6,10 +6,10 @@ declare const __VLS_export: import("vue").DefineComponent<DatePickerProps, {}, {
6
6
  "onUpdate:modelValue"?: ((value?: string | number | Date | undefined) => any) | undefined;
7
7
  }>, {
8
8
  type: "date" | "month" | "year";
9
- disabled: boolean;
10
- readonly: boolean;
11
9
  placeholder: string;
12
10
  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
@@ -6,10 +6,10 @@ declare const __VLS_export: import("vue").DefineComponent<DateRangePickerProps,
6
6
  "onUpdate:modelValue"?: ((value?: [string, string] | undefined) => any) | undefined;
7
7
  }>, {
8
8
  type: "date" | "month" | "year";
9
- disabled: boolean;
10
- readonly: boolean;
11
9
  placeholder: [string, string];
12
10
  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
- size: number;
5
4
  text: string;
5
+ size: number;
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
- multiple: boolean;
15
14
  tag: string;
15
+ multiple: boolean;
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,4 +1,4 @@
1
- import { Fragment, computed, createCommentVNode, createElementBlock, defineComponent, getCurrentInstance, normalizeClass, openBlock, ref, renderList, toDisplayString, unref } from "vue";
1
+ import { Fragment, computed, createCommentVNode, createElementBlock, defineComponent, getCurrentInstance, normalizeClass, openBlock, ref, renderList, toDisplayString, unref, watch } from "vue";
2
2
  import { useFallbackProps } from "@veltra/compositions";
3
3
  import { bem } from "@veltra/utils";
4
4
  //#region src/components/grid-input/grid-input.vue
@@ -30,8 +30,25 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
30
30
  const position = ref(-1);
31
31
  const blur = ref(false);
32
32
  const instance = getCurrentInstance();
33
+ /** 将格子数组拼成对外 modelValue */
34
+ const joinValue = (cells) => cells.join(props.separator);
35
+ /** 按分隔符解析 modelValue 为格子内容 */
36
+ const parseValue = (value) => {
37
+ if (!value) return [];
38
+ const sep = props.separator;
39
+ return (sep === "" ? Array.from(value) : value.split(sep)).filter((part) => part !== "").slice(0, props.length);
40
+ };
41
+ watch(() => [
42
+ props.modelValue,
43
+ props.separator,
44
+ props.length
45
+ ], () => {
46
+ const next = parseValue(props.modelValue);
47
+ if (joinValue(next) === joinValue(valueArray.value)) return;
48
+ valueArray.value = next;
49
+ }, { immediate: true });
33
50
  const emitValue = () => {
34
- const value = valueArray.value.join(props.separator);
51
+ const value = joinValue(valueArray.value);
35
52
  emit("input", value);
36
53
  emit("update:modelValue", value);
37
54
  };
@@ -1 +1 @@
1
- {"version":3,"file":"grid-input.js","names":[],"sources":["../../../src/components/grid-input/grid-input.vue"],"sourcesContent":["<template>\n <ul :class=\"[cls.b, cls.m(size)]\">\n <li\n v-for=\"(_, index) in length\"\n :key=\"index\"\n tabindex=\"0\"\n @keydown=\"onKeydown($event, valueArray[index]!, index)\"\n @focus=\"focus(index)\"\n @blur=\"index === position && (blur = true)\"\n ref=\"items\"\n :class=\"[cls.e('item'), bem.is('focus', index === position && !blur)]\"\n >\n <span :class=\"cls.em('item', 'text')\" v-if=\"index < valueArray.length\">\n {{ valueArray[index] }}\n </span>\n\n <span :class=\"cls.em('item', 'cursor')\" v-else-if=\"index === position\"></span>\n </li>\n </ul>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useFallbackProps } from '@veltra/compositions'\nimport { bem } from '@veltra/utils'\nimport { computed, ref, getCurrentInstance } from 'vue'\n\nimport type { GridInputProps, GridInputEmits, GridInputExposed } from '../../types'\n\ndefineOptions({ name: 'UGridInput' })\n\nconst emit = defineEmits<GridInputEmits>()\n\nconst props = withDefaults(defineProps<GridInputProps>(), {\n length: 6,\n zero: false,\n separator: '-'\n})\n\nconst { size } = useFallbackProps([props], { size: 'default' })\n\nconst cls = bem('grid-input')\n\nconst numberReg = computed(() => (props.zero ? /^[0-9]$/ : /^[1-9]$/))\n\nconst valueArray = ref<string[]>([])\n\nconst position = ref<number>(-1)\n\nconst blur = ref<boolean>(false)\n\nconst instance = getCurrentInstance()\n\nconst emitValue = () => {\n const value = valueArray.value.join(props.separator)\n emit('input', value)\n emit('update:modelValue', value)\n}\n\nconst focus = async (index?: number) => {\n if (index === undefined) {\n focus(position.value)\n return\n }\n if (index !== 0 && index > valueArray.value.length) {\n index = valueArray.value.length\n }\n position.value = index\n const items = (instance?.refs as { items?: unknown })?.items as any\n let dom = items?.[index]\n dom?.focus()\n blur.value = false\n}\n\nconst changeValue = (value: string, index: number) => {\n if (position.value === props.length) return\n\n if (index < valueArray.value.length) {\n valueArray.value.splice(index, 1, value)\n } else if (index === valueArray.value.length) {\n valueArray.value.push(value)\n } else {\n return\n }\n position.value++\n focus()\n\n emitValue()\n}\n\nconst baseOperation: Record<string, (value: string, index: number) => void> = {\n Backspace: (_value: string, index: number) => {\n if (index < valueArray.value.length) {\n valueArray.value.splice(index, 1)\n } else if (index - 1 >= 0) {\n valueArray.value.splice(index - 1, 1)\n }\n if (index !== 0) {\n focus(index - 1)\n }\n emitValue()\n },\n ArrowLeft: (_value: string, index: number) => {\n if (index === 0) return\n focus(index - 1)\n },\n ArrowRight: (_value: string, index: number) => {\n if (index === valueArray.value.length) return\n focus(index + 1)\n }\n}\n\nconst onKeydown = (e: KeyboardEvent, value: string, index: number) => {\n if (numberReg.value.test(e.key)) {\n changeValue(e.key, index)\n return\n }\n baseOperation[e.key]?.(value, index)\n}\n\nconst clear = () => {\n valueArray.value = []\n position.value = -1\n}\n\ndefineExpose<GridInputExposed>({ clear })\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EA8BA,MAAM,OAAO;EAEb,MAAM,QAAQ;EAMd,MAAM,EAAE,SAAS,iBAAiB,CAAC,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;EAE9D,MAAM,MAAM,IAAI,YAAY;EAE5B,MAAM,YAAY,eAAgB,MAAM,OAAO,YAAY,SAAU;EAErE,MAAM,aAAa,IAAc,CAAC,CAAC;EAEnC,MAAM,WAAW,IAAY,EAAE;EAE/B,MAAM,OAAO,IAAa,KAAK;EAE/B,MAAM,WA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c,EAAE,IAAI,GAAG,OAAO,KAAK;EACrC;EAEA,MAAM,cAAc;GAClB,WAAW,QAAQ,CAAC;GACpB,SAAS,QAAQ;EACnB;EAEA,SAA+B,EAAE,MAAM,CAAC;;uBA3HtC,mBAiBK,MAAA,EAjBA,OAAK,eAAA,CAAG,MAAA,GAAA,CAAG,CAAC,GAAG,MAAA,GAAA,CAAG,CAAC,EAAE,MAAA,IAAA,CAAI,CAAA,CAAA,EAAA,GAAA,EAAA,UAAA,IAAA,GAC5B,mBAeK,UAAA,MAAA,WAdkB,QAAA,SAAb,GAAG,UAAK;wBADlB,mBAeK,MAAA;KAbF,KAAK;KACN,UAAS;KACR,YAAO,WAAE,UAAU,QAAQ,WAAA,MAAW,QAAS,KAAK;KACpD,UAAK,WAAE,MAAM,KAAK;KAClB,SAAI,WAAE,UAAU,SAAA,UAAa,KAAA,QAAI;;KAClC,KAAI;KACH,OAAK,eAAA,CAAG,MAAA,GAAA,CAAG,CAAC,EAAC,MAAA,GAAU,MAAA,GAAA,CAAG,CAAC,GAAE,SAAU,UAAU,SAAA,SAAQ,CAAK,KAAA,KAAI,CAAA,CAAA;QAEvB,QAAQ,WAAA,MAAW,UAAA,UAAA,GAA/D,mBAEO,QAAA;;KAFA,OAAK,eAAE,MAAA,GAAA,CAAG,CAAC,GAAE,QAAA,MAAA,CAAA;uBACf,WAAA,MAAW,MAAK,GAAA,CAAA,KAG8B,UAAU,SAAA,SAAA,UAAA,GAA7D,mBAA8E,QAAA;;KAAvE,OAAK,eAAE,MAAA,GAAA,CAAG,CAAC,GAAE,QAAA,QAAA,CAAA"}
1
+ {"version":3,"file":"grid-input.js","names":[],"sources":["../../../src/components/grid-input/grid-input.vue"],"sourcesContent":["<template>\n <ul :class=\"[cls.b, cls.m(size)]\">\n <li\n v-for=\"(_, index) in length\"\n :key=\"index\"\n tabindex=\"0\"\n @keydown=\"onKeydown($event, valueArray[index]!, index)\"\n @focus=\"focus(index)\"\n @blur=\"index === position && (blur = true)\"\n ref=\"items\"\n :class=\"[cls.e('item'), bem.is('focus', index === position && !blur)]\"\n >\n <span :class=\"cls.em('item', 'text')\" v-if=\"index < valueArray.length\">\n {{ valueArray[index] }}\n </span>\n\n <span :class=\"cls.em('item', 'cursor')\" v-else-if=\"index === position\"></span>\n </li>\n </ul>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useFallbackProps } from '@veltra/compositions'\nimport { bem } from '@veltra/utils'\nimport { computed, ref, getCurrentInstance, watch } from 'vue'\n\nimport type { GridInputProps, GridInputEmits, GridInputExposed } from '../../types'\n\ndefineOptions({ name: 'UGridInput' })\n\nconst emit = defineEmits<GridInputEmits>()\n\nconst props = withDefaults(defineProps<GridInputProps>(), {\n length: 6,\n zero: false,\n separator: '-'\n})\n\nconst { size } = useFallbackProps([props], { size: 'default' })\n\nconst cls = bem('grid-input')\n\nconst numberReg = computed(() => (props.zero ? /^[0-9]$/ : /^[1-9]$/))\n\nconst valueArray = ref<string[]>([])\n\nconst position = ref<number>(-1)\n\nconst blur = ref<boolean>(false)\n\nconst instance = getCurrentInstance()\n\n/** 将格子数组拼成对外 modelValue */\nconst joinValue = (cells: string[]) => cells.join(props.separator)\n\n/** 按分隔符解析 modelValue 为格子内容 */\nconst parseValue = (value?: string): string[] => {\n if (!value) return []\n const sep = props.separator\n const parts = sep === '' ? Array.from(value) : value.split(sep)\n return parts.filter((part) => part !== '').slice(0, props.length)\n}\n\n// 外部 modelValue / 分隔符变化时回填格子(支持初始值与回显)\nwatch(\n () => [props.modelValue, props.separator, props.length] as const,\n () => {\n const next = parseValue(props.modelValue)\n if (joinValue(next) === joinValue(valueArray.value)) return\n valueArray.value = next\n },\n { immediate: true }\n)\n\nconst emitValue = () => {\n const value = joinValue(valueArray.value)\n emit('input', value)\n emit('update:modelValue', value)\n}\n\nconst focus = async (index?: number) => {\n if (index === undefined) {\n focus(position.value)\n return\n }\n if (index !== 0 && index > valueArray.value.length) {\n index = valueArray.value.length\n }\n position.value = index\n const items = (instance?.refs as { items?: unknown })?.items as any\n let dom = items?.[index]\n dom?.focus()\n blur.value = false\n}\n\nconst changeValue = (value: string, index: number) => {\n if (position.value === props.length) return\n\n if (index < valueArray.value.length) {\n valueArray.value.splice(index, 1, value)\n } else if (index === valueArray.value.length) {\n valueArray.value.push(value)\n } else {\n return\n }\n position.value++\n focus()\n\n emitValue()\n}\n\nconst baseOperation: Record<string, (value: string, index: number) => void> = {\n Backspace: (_value: string, index: number) => {\n if (index < valueArray.value.length) {\n valueArray.value.splice(index, 1)\n } else if (index - 1 >= 0) {\n valueArray.value.splice(index - 1, 1)\n }\n if (index !== 0) {\n focus(index - 1)\n }\n emitValue()\n },\n ArrowLeft: (_value: string, index: number) => {\n if (index === 0) return\n focus(index - 1)\n },\n ArrowRight: (_value: string, index: number) => {\n if (index === valueArray.value.length) return\n focus(index + 1)\n }\n}\n\nconst onKeydown = (e: KeyboardEvent, value: string, index: number) => {\n if (numberReg.value.test(e.key)) {\n changeValue(e.key, index)\n return\n }\n baseOperation[e.key]?.(value, index)\n}\n\nconst clear = () => {\n valueArray.value = []\n position.value = -1\n}\n\ndefineExpose<GridInputExposed>({ clear })\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EA8BA,MAAM,OAAO;EAEb,MAAM,QAAQ;EAMd,MAAM,EAAE,SAAS,iBAAiB,CAAC,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;EAE9D,MAAM,MAAM,IAAI,YAAY;EAE5B,MAAM,YAAY,eAAgB,MAAM,OAAO,YAAY,SAAU;EAErE,MAAM,aAAa,IAAc,CAAC,CAAC;EAEnC,MAAM,WAAW,IAAY,EAAE;EAE/B,MAAM,OAAO,IAAa,KAAK;EAE/B,MAAM,WAAW,mBAAmB;;EAGpC,MAAM,aAAa,UAAoB,MAAM,KAAK,MAAM,SAAS;;EAGjE,MAAM,cAAc,UAA6B;GAC/C,IAAI,CAAC,OAAO,OAAO,CAAC;GACpB,MAAM,MAAM,MAAM;GAElB,QADc,QAAQ,K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vE,OAAK,eAAE,MAAA,GAAA,CAAG,CAAC,GAAE,QAAA,QAAA,CAAA"}
@@ -17,25 +17,25 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, _Inpu
17
17
  "update:modelValue": (value: string) => any;
18
18
  clear: () => any;
19
19
  change: (value: string) => any;
20
- "suffix:click": (value?: string | undefined) => any;
21
- "prefix:click": (value?: string | undefined) => any;
22
20
  focus: (value?: string | undefined) => any;
23
21
  blur: (value?: string | undefined) => any;
22
+ "suffix:click": (value?: string | undefined) => any;
23
+ "prefix:click": (value?: string | undefined) => any;
24
24
  "native:input": (ev: Event) => any;
25
25
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
26
26
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
27
27
  onClear?: (() => any) | undefined;
28
28
  onChange?: ((value: string) => any) | undefined;
29
- "onSuffix:click"?: ((value?: string | undefined) => any) | undefined;
30
- "onPrefix:click"?: ((value?: string | undefined) => any) | undefined;
31
29
  onFocus?: ((value?: string | undefined) => any) | undefined;
32
30
  onBlur?: ((value?: string | undefined) => any) | undefined;
31
+ "onSuffix:click"?: ((value?: string | undefined) => any) | undefined;
32
+ "onPrefix:click"?: ((value?: string | undefined) => any) | undefined;
33
33
  "onNative:input"?: ((ev: Event) => any) | undefined;
34
34
  }>, {
35
- disabled: boolean;
36
- readonly: boolean;
37
35
  placeholder: string;
38
36
  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
- disabled: boolean;
30
- readonly: boolean;
31
- minWidth: string;
32
29
  labelKey: string;
33
30
  valueKey: string;
34
31
  placeholder: string;
35
32
  clearable: boolean;
33
+ 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
- disabled: boolean;
25
- readonly: boolean;
26
- minWidth: string;
27
24
  expandAll: boolean;
28
25
  labelKey: string;
29
26
  valueKey: string;
30
27
  placeholder: string;
31
28
  clearable: boolean;
32
29
  filterable: boolean;
30
+ 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>;
@@ -1,8 +1,8 @@
1
1
  import { NumberProps } from "../../types/number.js";
2
2
  //#region src/components/number/number.vue.d.ts
3
3
  declare const __VLS_export: import("vue").DefineComponent<NumberProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NumberProps> & Readonly<{}>, {
4
- duration: number;
5
4
  format: "currency" | "percent" | "decimal";
5
+ duration: number;
6
6
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const _default: typeof __VLS_export;
8
8
  //#endregion
@@ -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
- disabled: boolean;
24
- readonly: boolean;
25
23
  placeholder: string;
26
24
  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;
25
26
  disabled: boolean;
26
27
  readonly: boolean;
27
- clearable: boolean;
28
28
  startPlaceholder: string;
29
29
  endPlaceholder: string;
30
30
  separator: string;
@@ -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;
16
17
  disabled: boolean;
17
18
  readonly: 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
- disabled: boolean;
18
- readonly: boolean;
19
17
  labelKey: string;
20
18
  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;
13
14
  disabled: boolean;
14
15
  readonly: 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
- disabled: boolean;
28
- readonly: boolean;
29
27
  labelKey: string;
30
28
  valueKey: string;
31
29
  placeholder: string;
32
30
  clearable: boolean;
31
+ disabled: boolean;
32
+ readonly: boolean;
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
- "item-click": (item: Record<string, any>, index: number) => any;
10
9
  "update:current": (value?: string | number | undefined) => any;
10
+ "item-click": (item: Record<string, any>, index: number) => any;
11
11
  }, string, import("vue").PublicProps, Readonly<StepsProps> & Readonly<{
12
- "onItem-click"?: ((item: Record<string, any>, index: number) => any) | undefined;
13
12
  "onUpdate:current"?: ((value?: string | number | undefined) => any) | undefined;
13
+ "onItem-click"?: ((item: Record<string, any>, index: number) => any) | undefined;
14
14
  }>, {
15
15
  direction: "horizontal" | "vertical";
16
16
  labelKey: string;
@@ -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
- disabled: boolean;
24
- readonly: boolean;
25
23
  placeholder: string;
26
24
  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
- disabled: boolean;
28
- readonly: boolean;
29
- minWidth: string;
30
27
  expandAll: boolean;
31
28
  labelKey: string;
32
29
  valueKey: string;
33
30
  placeholder: string;
34
31
  clearable: boolean;
35
32
  filterable: boolean;
33
+ 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
- fontSize: number;
9
8
  route: number;
9
+ fontSize: 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.29",
3
+ "version": "1.2.30",
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.29",
61
- "@veltra/directives": "1.2.29",
62
- "@veltra/icons": "1.2.29",
63
- "@veltra/styles": "1.2.29",
64
- "@veltra/utils": "1.2.29",
60
+ "@veltra/compositions": "1.2.30",
61
+ "@veltra/directives": "1.2.30",
62
+ "@veltra/icons": "1.2.30",
63
+ "@veltra/styles": "1.2.30",
64
+ "@veltra/utils": "1.2.30",
65
65
  "vue": ">=3.5.39"
66
66
  },
67
67
  "devDependencies": {
@@ -22,7 +22,7 @@
22
22
  <script lang="ts" setup>
23
23
  import { useFallbackProps } from '@veltra/compositions'
24
24
  import { bem } from '@veltra/utils'
25
- import { computed, ref, getCurrentInstance } from 'vue'
25
+ import { computed, ref, getCurrentInstance, watch } from 'vue'
26
26
 
27
27
  import type { GridInputProps, GridInputEmits, GridInputExposed } from '../../types'
28
28
 
@@ -50,8 +50,30 @@ const blur = ref<boolean>(false)
50
50
 
51
51
  const instance = getCurrentInstance()
52
52
 
53
+ /** 将格子数组拼成对外 modelValue */
54
+ const joinValue = (cells: string[]) => cells.join(props.separator)
55
+
56
+ /** 按分隔符解析 modelValue 为格子内容 */
57
+ const parseValue = (value?: string): string[] => {
58
+ if (!value) return []
59
+ const sep = props.separator
60
+ const parts = sep === '' ? Array.from(value) : value.split(sep)
61
+ return parts.filter((part) => part !== '').slice(0, props.length)
62
+ }
63
+
64
+ // 外部 modelValue / 分隔符变化时回填格子(支持初始值与回显)
65
+ watch(
66
+ () => [props.modelValue, props.separator, props.length] as const,
67
+ () => {
68
+ const next = parseValue(props.modelValue)
69
+ if (joinValue(next) === joinValue(valueArray.value)) return
70
+ valueArray.value = next
71
+ },
72
+ { immediate: true }
73
+ )
74
+
53
75
  const emitValue = () => {
54
- const value = valueArray.value.join(props.separator)
76
+ const value = joinValue(valueArray.value)
55
77
  emit('input', value)
56
78
  emit('update:modelValue', value)
57
79
  }