@shwfed/config 2.1.0 → 2.1.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 (67) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/form/ai/fields-button.d.vue.ts +13 -0
  3. package/dist/runtime/components/form/ai/fields-button.vue +458 -0
  4. package/dist/runtime/components/form/ai/fields-button.vue.d.ts +13 -0
  5. package/dist/runtime/components/form/ai/fields-task.md +71 -0
  6. package/dist/runtime/components/form/config.d.vue.ts +1 -1
  7. package/dist/runtime/components/form/config.vue +4 -36
  8. package/dist/runtime/components/form/config.vue.d.ts +1 -1
  9. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +18 -18
  10. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +18 -18
  11. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +4 -4
  12. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +4 -4
  13. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +22 -22
  14. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +22 -22
  15. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.d.vue.ts +2 -2
  16. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.vue.d.ts +2 -2
  17. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +4 -4
  18. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +4 -4
  19. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +12 -12
  20. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue +87 -11
  21. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +12 -12
  22. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/runtime.vue +18 -6
  23. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.d.ts +1 -1
  24. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.js +11 -4
  25. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.d.vue.ts +10 -10
  26. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.vue.d.ts +10 -10
  27. package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/config.d.vue.ts +12 -12
  28. package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/config.vue.d.ts +12 -12
  29. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.d.vue.ts +16 -2
  30. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue +37 -0
  31. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue.d.ts +16 -2
  32. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/row.d.vue.ts +1 -0
  33. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/row.vue +13 -4
  34. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/row.vue.d.ts +1 -0
  35. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/runtime.vue +111 -22
  36. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.d.ts +15 -1
  37. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.js +9 -1
  38. package/dist/runtime/components/form/index.vue +5 -4
  39. package/dist/runtime/components/form/unit-config.d.vue.ts +16 -0
  40. package/dist/runtime/components/form/unit-config.vue +30 -3
  41. package/dist/runtime/components/form/unit-config.vue.d.ts +16 -0
  42. package/dist/runtime/components/form/utils/cel-scope.d.ts +13 -0
  43. package/dist/runtime/components/form/utils/cel-scope.js +32 -0
  44. package/dist/runtime/components/form/utils/schema-meta.d.ts +13 -0
  45. package/dist/runtime/components/form/utils/schema-meta.js +15 -0
  46. package/dist/runtime/components/table/ai/columns-task.md +10 -1
  47. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/config.vue +2 -2
  48. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/runtime.vue +14 -4
  49. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/schema.js +3 -2
  50. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/config.vue +2 -2
  51. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/runtime.vue +14 -4
  52. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/schema.js +3 -2
  53. package/dist/runtime/components/table/utils/shared.d.ts +2 -1
  54. package/dist/runtime/components/ui/date-range-picker/DateRangePickerDateTimePanel.d.vue.ts +1 -1
  55. package/dist/runtime/components/ui/date-range-picker/DateRangePickerDateTimePanel.vue.d.ts +1 -1
  56. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +1 -1
  57. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +1 -1
  58. package/dist/runtime/share/expression.d.ts +1 -2
  59. package/dist/runtime/share/slot-renderer.vue +7 -6
  60. package/dist/runtime/utils/interpolate.d.ts +1 -0
  61. package/dist/runtime/utils/interpolate.js +7 -0
  62. package/dist/runtime/vendor/cel-js/CLAUDE.md +1 -1
  63. package/dist/runtime/vendor/cel-js/PROMPT.md +6 -1
  64. package/dist/runtime/vendor/cel-js/lib/http-builder.d.ts +3 -2
  65. package/dist/runtime/vendor/cel-js/lib/http-builtins.d.ts +4 -3
  66. package/dist/runtime/vendor/cel-js/lib/http-builtins.js +4 -0
  67. package/package.json +1 -1
@@ -16,7 +16,8 @@ import {
16
16
  InputGroupAddon,
17
17
  InputGroupButton,
18
18
  InputGroupInput,
19
- InputGroupNumberField
19
+ InputGroupNumberField,
20
+ InputGroupText
20
21
  } from "../../../../ui/input-group";
21
22
  import { Locale as LocaleField } from "../../../../ui/locale";
22
23
  import { Markdown } from "../../../../ui/markdown";
@@ -41,8 +42,11 @@ const ROUNDING_MODE_OPTIONS = [
41
42
  { value: "floor", label: "\u5411\u4E0B\u53D6\u6574" },
42
43
  { value: "ceil", label: "\u5411\u4E0A\u53D6\u6574" }
43
44
  ];
44
- const pathText = computed({
45
- get: () => value.value.binding ?? "",
45
+ const bindingMode = computed(
46
+ () => Array.isArray(value.value.binding) ? "split" : "single"
47
+ );
48
+ const singlePathText = computed({
49
+ get: () => typeof value.value.binding === "string" ? value.value.binding : "",
46
50
  set: (next) => {
47
51
  const trimmed = next.trim();
48
52
  if (trimmed.length === 0) {
@@ -53,6 +57,28 @@ const pathText = computed({
53
57
  }
54
58
  }
55
59
  });
60
+ const splitStartText = computed(
61
+ () => Array.isArray(value.value.binding) ? value.value.binding[0] : ""
62
+ );
63
+ const splitEndText = computed(
64
+ () => Array.isArray(value.value.binding) ? value.value.binding[1] : ""
65
+ );
66
+ function setSplitStart(next) {
67
+ const cur = Array.isArray(value.value.binding) ? value.value.binding : ["", ""];
68
+ value.value = { ...value.value, binding: [next.trim(), cur[1]] };
69
+ }
70
+ function setSplitEnd(next) {
71
+ const cur = Array.isArray(value.value.binding) ? value.value.binding : ["", ""];
72
+ value.value = { ...value.value, binding: [cur[0], next.trim()] };
73
+ }
74
+ function toggleBindingMode() {
75
+ if (bindingMode.value === "single") {
76
+ value.value = { ...value.value, binding: ["", ""] };
77
+ } else {
78
+ const { binding: _omit, ...rest } = value.value;
79
+ value.value = rest;
80
+ }
81
+ }
56
82
  const currentRoundingModeLabel = computed(
57
83
  () => ROUNDING_MODE_OPTIONS.find((o) => o.value === (value.value.roundingMode ?? "round"))?.label
58
84
  );
@@ -121,20 +147,70 @@ function setSeparatorIcon(next) {
121
147
  <FieldLabel class="text-xs text-zinc-500">
122
148
  <template #tooltip>
123
149
  <Markdown
124
- source="写入表单状态的嵌套键路径,使用 `.` 分隔;写入值为 `[start, end]` 数值数组"
150
+ source="写入表单状态的嵌套键路径,使用 `.` 分隔。单路径模式写入 `[start, end]` 数值数组;拆分模式分别写入起始与结束两端"
125
151
  block
126
152
  class="prose prose-sm prose-zinc"
127
153
  />
128
154
  </template>
129
155
  {{ fieldTitle("binding") }}
130
156
  </FieldLabel>
131
- <InputGroup>
132
- <InputGroupInput
133
- v-model="pathText"
134
- placeholder="例:score.range"
135
- class="font-mono"
136
- />
137
- </InputGroup>
157
+ <template v-if="bindingMode === 'single'">
158
+ <InputGroup>
159
+ <InputGroupInput
160
+ v-model="singlePathText"
161
+ placeholder="例:score.range"
162
+ class="font-mono"
163
+ />
164
+ <InputGroupAddon align="inline-end">
165
+ <InputGroupButton
166
+ size="icon-xs"
167
+ aria-label="拆分起止绑定路径"
168
+ @click="toggleBindingMode"
169
+ >
170
+ <Icon icon="fluent:split-horizontal-20-regular" />
171
+ </InputGroupButton>
172
+ </InputGroupAddon>
173
+ </InputGroup>
174
+ </template>
175
+ <template v-else>
176
+ <div class="grid grid-cols-2 gap-2">
177
+ <InputGroup>
178
+ <InputGroupAddon align="inline-start">
179
+ <InputGroupText class="text-xs text-zinc-400">
180
+
181
+ </InputGroupText>
182
+ </InputGroupAddon>
183
+ <InputGroupInput
184
+ :model-value="splitStartText"
185
+ placeholder="例:score.start"
186
+ class="font-mono"
187
+ @update:model-value="(v) => setSplitStart(String(v ?? ''))"
188
+ />
189
+ </InputGroup>
190
+ <InputGroup>
191
+ <InputGroupAddon align="inline-start">
192
+ <InputGroupText class="text-xs text-zinc-400">
193
+
194
+ </InputGroupText>
195
+ </InputGroupAddon>
196
+ <InputGroupInput
197
+ :model-value="splitEndText"
198
+ placeholder="例:score.end"
199
+ class="font-mono"
200
+ @update:model-value="(v) => setSplitEnd(String(v ?? ''))"
201
+ />
202
+ <InputGroupAddon align="inline-end">
203
+ <InputGroupButton
204
+ size="icon-xs"
205
+ aria-label="合并起止绑定路径"
206
+ @click="toggleBindingMode"
207
+ >
208
+ <Icon icon="fluent:merge-vertical-20-regular" />
209
+ </InputGroupButton>
210
+ </InputGroupAddon>
211
+ </InputGroup>
212
+ </div>
213
+ </template>
138
214
  </Field>
139
215
  </div>
140
216
 
@@ -29,12 +29,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
29
29
  readonly max?: string | undefined;
30
30
  readonly step?: number | undefined;
31
31
  readonly readonly?: string | undefined;
32
- readonly binding?: string | undefined;
33
- readonly derived?: {
34
- readonly mode: "formula" | "prefill";
35
- readonly expression: string;
36
- } | undefined;
37
- readonly rangeSeparatorIcon?: string | undefined;
38
32
  readonly startPlaceholder?: readonly [{
39
33
  readonly locale: "zh";
40
34
  readonly message: string;
@@ -49,8 +43,14 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
49
43
  readonly locale: "en" | "ja" | "ko";
50
44
  readonly message: string;
51
45
  }[]] | undefined;
46
+ readonly binding?: string | readonly [string, string] | undefined;
47
+ readonly derived?: {
48
+ readonly mode: "formula" | "prefill";
49
+ readonly expression: string;
50
+ } | undefined;
52
51
  readonly precision?: number | undefined;
53
52
  readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
53
+ readonly rangeSeparatorIcon?: string | undefined;
54
54
  }) => any;
55
55
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
56
56
  "onUpdate:modelValue"?: ((value: {
@@ -79,12 +79,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
79
79
  readonly max?: string | undefined;
80
80
  readonly step?: number | undefined;
81
81
  readonly readonly?: string | undefined;
82
- readonly binding?: string | undefined;
83
- readonly derived?: {
84
- readonly mode: "formula" | "prefill";
85
- readonly expression: string;
86
- } | undefined;
87
- readonly rangeSeparatorIcon?: string | undefined;
88
82
  readonly startPlaceholder?: readonly [{
89
83
  readonly locale: "zh";
90
84
  readonly message: string;
@@ -99,8 +93,14 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
99
93
  readonly locale: "en" | "ja" | "ko";
100
94
  readonly message: string;
101
95
  }[]] | undefined;
96
+ readonly binding?: string | readonly [string, string] | undefined;
97
+ readonly derived?: {
98
+ readonly mode: "formula" | "prefill";
99
+ readonly expression: string;
100
+ } | undefined;
102
101
  readonly precision?: number | undefined;
103
102
  readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
103
+ readonly rangeSeparatorIcon?: string | undefined;
104
104
  }) => any) | undefined;
105
105
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
106
106
  declare const _default: typeof __VLS_export;
@@ -70,20 +70,32 @@ function asRange(raw) {
70
70
  if (!Number.isFinite(a) || !Number.isFinite(b)) return void 0;
71
71
  return [a, b];
72
72
  }
73
+ function asNumber(raw) {
74
+ return typeof raw === "number" && Number.isFinite(raw) ? raw : void 0;
75
+ }
73
76
  const uncontrolled = ref(void 0);
74
77
  const model = computed({
75
78
  get: () => {
76
- const path = props.config.binding;
77
- if (path == null) return uncontrolled.value;
78
- return asRange(getAt(path));
79
+ const binding = props.config.binding;
80
+ if (binding == null) return uncontrolled.value;
81
+ if (typeof binding === "string") return asRange(getAt(binding));
82
+ const a = asNumber(getAt(binding[0]));
83
+ const b = asNumber(getAt(binding[1]));
84
+ if (a == null || b == null) return void 0;
85
+ return [a, b];
79
86
  },
80
87
  set: (next) => {
81
- const path = props.config.binding;
82
- if (path == null) {
88
+ const binding = props.config.binding;
89
+ if (binding == null) {
83
90
  uncontrolled.value = next;
84
91
  return;
85
92
  }
86
- setAt(path, next ?? null);
93
+ if (typeof binding === "string") {
94
+ setAt(binding, next ?? null);
95
+ return;
96
+ }
97
+ setAt(binding[0], next?.[0] ?? null);
98
+ setAt(binding[1], next?.[1] ?? null);
87
99
  }
88
100
  });
89
101
  const localStart = ref(model.value?.[0]);
@@ -46,7 +46,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
46
46
  message: Schema.SchemaClass<string, string, never>;
47
47
  }>]>>;
48
48
  orientation: Schema.optional<Schema.Literal<["vertical", "floating"]>>;
49
- binding: Schema.optional<Schema.refine<string, typeof Schema.String>>;
49
+ binding: Schema.optional<Schema.Union<[Schema.filter<typeof Schema.String>, Schema.filter<Schema.Tuple2<Schema.filter<typeof Schema.String>, Schema.filter<typeof Schema.String>>>]>>;
50
50
  disabled: Schema.optional<Schema.Schema<string, string, never>>;
51
51
  readonly: Schema.optional<Schema.Schema<string, string, never>>;
52
52
  derived: Schema.optional<Schema.Struct<{
@@ -4,6 +4,16 @@ import { Locale } from "../../../../../share/locale.js";
4
4
  import { commonFieldFields, derivedField, FieldOrientationSchema } from "../../../utils/common.js";
5
5
  export const type = "com.shwfed.form.field.numberrange";
6
6
  export const compatibilityDate = "2026-04-28";
7
+ const BindingPath = Schema.String.pipe(Schema.minLength(1));
8
+ const SplitBinding = Schema.Tuple(BindingPath, BindingPath).pipe(
9
+ Schema.filter(([a, b]) => a !== b, {
10
+ message: () => "\u8D77\u59CB\u4E0E\u7ED3\u675F\u7ED1\u5B9A\u8DEF\u5F84\u4E0D\u80FD\u76F8\u540C"
11
+ })
12
+ );
13
+ const bindingSchema = Schema.Union(BindingPath, SplitBinding).annotations({
14
+ title: "\u7ED1\u5B9A\u8DEF\u5F84",
15
+ description: "\u5199\u5165\u8868\u5355\u72B6\u6001\u7684 `dot-prop` \u8DEF\u5F84\uFF1B\u586B\u5199\u5355\u4E2A\u8DEF\u5F84\u65F6\u5199\u5165 `[start, end]` \u6570\u503C\u6570\u7EC4\uFF0C\u4F8B\u5982 `score.range`\uFF1B\u586B\u5199 `[\u8D77\u59CB\u8DEF\u5F84, \u7ED3\u675F\u8DEF\u5F84]` \u5143\u7EC4\u65F6\u5206\u522B\u5199\u5165\u4E24\u7AEF\uFF1B\u7559\u7A7A\u5219\u4E3A\u975E\u53D7\u63A7\u5B57\u6BB5"
16
+ });
7
17
  export const metadata = {
8
18
  name: "\u6570\u503C\u8303\u56F4",
9
19
  icon: "fluent:arrow-bidirectional-left-right-20-regular",
@@ -34,10 +44,7 @@ export function schema(configure) {
34
44
  description: "\u9F20\u6807\u60AC\u505C\u5728\u6807\u7B7E\u4E0A\u65F6\u5C55\u793A\u7684\u8BF4\u660E"
35
45
  })),
36
46
  orientation: Schema.optional(FieldOrientationSchema),
37
- binding: Schema.optional(Schema.String.pipe(Schema.minLength(1)).annotations({
38
- title: "\u7ED1\u5B9A\u8DEF\u5F84",
39
- description: "\u5199\u5165\u8868\u5355\u72B6\u6001\u7684 `dot-prop` \u8DEF\u5F84\uFF0C\u4F8B\u5982 `score.range`\uFF1B\u5199\u5165\u503C\u4E3A `[start, end]` \u6570\u503C\u6570\u7EC4\uFF1B\u7559\u7A7A\u5219\u4E3A\u975E\u53D7\u63A7\u5B57\u6BB5"
40
- })),
47
+ binding: Schema.optional(bindingSchema),
41
48
  disabled: Schema.optional(CelBool.annotations({
42
49
  title: "\u7981\u7528\u6761\u4EF6",
43
50
  description: "\u8FD4\u56DE `true` \u65F6\u8F93\u5165\u6846\u4ECD\u7136\u6E32\u67D3\u4F46\u4E0D\u53EF\u7F16\u8F91"
@@ -25,11 +25,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
25
25
  readonly displayName?: string | undefined;
26
26
  readonly compatibilityDate: "2026-04-28";
27
27
  readonly readonly?: string | undefined;
28
- readonly binding?: string | undefined;
29
- readonly derived?: {
30
- readonly mode: "formula" | "prefill";
31
- readonly expression: string;
32
- } | undefined;
33
28
  readonly trueLabel?: readonly [{
34
29
  readonly locale: "zh";
35
30
  readonly message: string;
@@ -44,6 +39,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
44
39
  readonly locale: "en" | "ja" | "ko";
45
40
  readonly message: string;
46
41
  }[]] | undefined;
42
+ readonly binding?: string | undefined;
43
+ readonly derived?: {
44
+ readonly mode: "formula" | "prefill";
45
+ readonly expression: string;
46
+ } | undefined;
47
47
  }) => any;
48
48
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
49
49
  "onUpdate:modelValue"?: ((value: {
@@ -68,11 +68,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
68
68
  readonly displayName?: string | undefined;
69
69
  readonly compatibilityDate: "2026-04-28";
70
70
  readonly readonly?: string | undefined;
71
- readonly binding?: string | undefined;
72
- readonly derived?: {
73
- readonly mode: "formula" | "prefill";
74
- readonly expression: string;
75
- } | undefined;
76
71
  readonly trueLabel?: readonly [{
77
72
  readonly locale: "zh";
78
73
  readonly message: string;
@@ -87,6 +82,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
87
82
  readonly locale: "en" | "ja" | "ko";
88
83
  readonly message: string;
89
84
  }[]] | undefined;
85
+ readonly binding?: string | undefined;
86
+ readonly derived?: {
87
+ readonly mode: "formula" | "prefill";
88
+ readonly expression: string;
89
+ } | undefined;
90
90
  }) => any) | undefined;
91
91
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
92
92
  declare const _default: typeof __VLS_export;
@@ -25,11 +25,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
25
25
  readonly displayName?: string | undefined;
26
26
  readonly compatibilityDate: "2026-04-28";
27
27
  readonly readonly?: string | undefined;
28
- readonly binding?: string | undefined;
29
- readonly derived?: {
30
- readonly mode: "formula" | "prefill";
31
- readonly expression: string;
32
- } | undefined;
33
28
  readonly trueLabel?: readonly [{
34
29
  readonly locale: "zh";
35
30
  readonly message: string;
@@ -44,6 +39,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
44
39
  readonly locale: "en" | "ja" | "ko";
45
40
  readonly message: string;
46
41
  }[]] | undefined;
42
+ readonly binding?: string | undefined;
43
+ readonly derived?: {
44
+ readonly mode: "formula" | "prefill";
45
+ readonly expression: string;
46
+ } | undefined;
47
47
  }) => any;
48
48
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
49
49
  "onUpdate:modelValue"?: ((value: {
@@ -68,11 +68,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
68
68
  readonly displayName?: string | undefined;
69
69
  readonly compatibilityDate: "2026-04-28";
70
70
  readonly readonly?: string | undefined;
71
- readonly binding?: string | undefined;
72
- readonly derived?: {
73
- readonly mode: "formula" | "prefill";
74
- readonly expression: string;
75
- } | undefined;
76
71
  readonly trueLabel?: readonly [{
77
72
  readonly locale: "zh";
78
73
  readonly message: string;
@@ -87,6 +82,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
87
82
  readonly locale: "en" | "ja" | "ko";
88
83
  readonly message: string;
89
84
  }[]] | undefined;
85
+ readonly binding?: string | undefined;
86
+ readonly derived?: {
87
+ readonly mode: "formula" | "prefill";
88
+ readonly expression: string;
89
+ } | undefined;
90
90
  }) => any) | undefined;
91
91
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
92
92
  declare const _default: typeof __VLS_export;
@@ -42,12 +42,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
42
42
  readonly message: string;
43
43
  }[]] | undefined;
44
44
  readonly readonly?: string | undefined;
45
- readonly binding?: string | undefined;
46
- readonly accept?: readonly string[] | undefined;
47
- readonly maxFileSize?: number | undefined;
48
- readonly maxTotalSize?: number | undefined;
49
- readonly maxFiles?: number | undefined;
50
- readonly templateIcon?: string | undefined;
51
45
  readonly templateLabel?: readonly [{
52
46
  readonly locale: "zh";
53
47
  readonly message: string;
@@ -55,6 +49,12 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
55
49
  readonly locale: "en" | "ja" | "ko";
56
50
  readonly message: string;
57
51
  }[]] | undefined;
52
+ readonly binding?: string | undefined;
53
+ readonly accept?: readonly string[] | undefined;
54
+ readonly maxFileSize?: number | undefined;
55
+ readonly maxTotalSize?: number | undefined;
56
+ readonly maxFiles?: number | undefined;
57
+ readonly templateIcon?: string | undefined;
58
58
  }) => any;
59
59
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
60
60
  "onUpdate:modelValue"?: ((value: {
@@ -96,12 +96,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
96
96
  readonly message: string;
97
97
  }[]] | undefined;
98
98
  readonly readonly?: string | undefined;
99
- readonly binding?: string | undefined;
100
- readonly accept?: readonly string[] | undefined;
101
- readonly maxFileSize?: number | undefined;
102
- readonly maxTotalSize?: number | undefined;
103
- readonly maxFiles?: number | undefined;
104
- readonly templateIcon?: string | undefined;
105
99
  readonly templateLabel?: readonly [{
106
100
  readonly locale: "zh";
107
101
  readonly message: string;
@@ -109,6 +103,12 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
109
103
  readonly locale: "en" | "ja" | "ko";
110
104
  readonly message: string;
111
105
  }[]] | undefined;
106
+ readonly binding?: string | undefined;
107
+ readonly accept?: readonly string[] | undefined;
108
+ readonly maxFileSize?: number | undefined;
109
+ readonly maxTotalSize?: number | undefined;
110
+ readonly maxFiles?: number | undefined;
111
+ readonly templateIcon?: string | undefined;
112
112
  }) => any) | undefined;
113
113
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
114
114
  declare const _default: typeof __VLS_export;
@@ -42,12 +42,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
42
42
  readonly message: string;
43
43
  }[]] | undefined;
44
44
  readonly readonly?: string | undefined;
45
- readonly binding?: string | undefined;
46
- readonly accept?: readonly string[] | undefined;
47
- readonly maxFileSize?: number | undefined;
48
- readonly maxTotalSize?: number | undefined;
49
- readonly maxFiles?: number | undefined;
50
- readonly templateIcon?: string | undefined;
51
45
  readonly templateLabel?: readonly [{
52
46
  readonly locale: "zh";
53
47
  readonly message: string;
@@ -55,6 +49,12 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
55
49
  readonly locale: "en" | "ja" | "ko";
56
50
  readonly message: string;
57
51
  }[]] | undefined;
52
+ readonly binding?: string | undefined;
53
+ readonly accept?: readonly string[] | undefined;
54
+ readonly maxFileSize?: number | undefined;
55
+ readonly maxTotalSize?: number | undefined;
56
+ readonly maxFiles?: number | undefined;
57
+ readonly templateIcon?: string | undefined;
58
58
  }) => any;
59
59
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
60
60
  "onUpdate:modelValue"?: ((value: {
@@ -96,12 +96,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
96
96
  readonly message: string;
97
97
  }[]] | undefined;
98
98
  readonly readonly?: string | undefined;
99
- readonly binding?: string | undefined;
100
- readonly accept?: readonly string[] | undefined;
101
- readonly maxFileSize?: number | undefined;
102
- readonly maxTotalSize?: number | undefined;
103
- readonly maxFiles?: number | undefined;
104
- readonly templateIcon?: string | undefined;
105
99
  readonly templateLabel?: readonly [{
106
100
  readonly locale: "zh";
107
101
  readonly message: string;
@@ -109,6 +103,12 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
109
103
  readonly locale: "en" | "ja" | "ko";
110
104
  readonly message: string;
111
105
  }[]] | undefined;
106
+ readonly binding?: string | undefined;
107
+ readonly accept?: readonly string[] | undefined;
108
+ readonly maxFileSize?: number | undefined;
109
+ readonly maxTotalSize?: number | undefined;
110
+ readonly maxFiles?: number | undefined;
111
+ readonly templateIcon?: string | undefined;
112
112
  }) => any) | undefined;
113
113
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
114
114
  declare const _default: typeof __VLS_export;
@@ -22,10 +22,18 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
22
22
  readonly locale: "en" | "ja" | "ko";
23
23
  readonly message: string;
24
24
  }[]] | undefined;
25
+ readonly locale?: readonly [{
26
+ readonly locale: "zh";
27
+ readonly message: string;
28
+ }, ...{
29
+ readonly locale: "en" | "ja" | "ko";
30
+ readonly message: string;
31
+ }[]] | undefined;
25
32
  readonly displayName?: string | undefined;
26
33
  readonly compatibilityDate: "2026-05-13";
27
34
  readonly min?: number | undefined;
28
35
  readonly max?: number | undefined;
36
+ readonly binding?: string | undefined;
29
37
  readonly unit: Readonly<{
30
38
  fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
31
39
  layouts: readonly Readonly<{
@@ -34,7 +42,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
34
42
  layout: import("../../../schema.js").LayoutValue;
35
43
  }>[];
36
44
  }>;
37
- readonly binding?: string | undefined;
38
45
  readonly addLabel?: readonly [{
39
46
  readonly locale: "zh";
40
47
  readonly message: string;
@@ -71,10 +78,18 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
71
78
  readonly locale: "en" | "ja" | "ko";
72
79
  readonly message: string;
73
80
  }[]] | undefined;
81
+ readonly locale?: readonly [{
82
+ readonly locale: "zh";
83
+ readonly message: string;
84
+ }, ...{
85
+ readonly locale: "en" | "ja" | "ko";
86
+ readonly message: string;
87
+ }[]] | undefined;
74
88
  readonly displayName?: string | undefined;
75
89
  readonly compatibilityDate: "2026-05-13";
76
90
  readonly min?: number | undefined;
77
91
  readonly max?: number | undefined;
92
+ readonly binding?: string | undefined;
78
93
  readonly unit: Readonly<{
79
94
  fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
80
95
  layouts: readonly Readonly<{
@@ -83,7 +98,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
83
98
  layout: import("../../../schema.js").LayoutValue;
84
99
  }>[];
85
100
  }>;
86
- readonly binding?: string | undefined;
87
101
  readonly addLabel?: readonly [{
88
102
  readonly locale: "zh";
89
103
  readonly message: string;
@@ -40,6 +40,20 @@ const unitModel = computed({
40
40
  const EXTRAS = [
41
41
  { id: "general", label: "\u901A\u7528\u914D\u7F6E", icon: "fluent:settings-20-regular" }
42
42
  ];
43
+ const FIELD_CEL_SCOPE = {
44
+ item: {
45
+ type: "dyn",
46
+ label: "item",
47
+ description: "\u5F53\u524D\u5217\u8868\u9879",
48
+ value: void 0
49
+ },
50
+ index: {
51
+ type: "number",
52
+ label: "index",
53
+ description: "\u5F53\u524D\u5217\u8868\u9879\u7D22\u5F15\uFF0C\u4ECE 0 \u5F00\u59CB",
54
+ value: void 0
55
+ }
56
+ };
43
57
  const selection = ref({ kind: "extras", id: "general" });
44
58
  const pathText = computed({
45
59
  get: () => value.value.binding ?? "",
@@ -79,6 +93,7 @@ const reorderable = computed({
79
93
  v-model="unitModel"
80
94
  v-model:selection="selection"
81
95
  :extras="EXTRAS"
96
+ :field-cel-scope="FIELD_CEL_SCOPE"
82
97
  >
83
98
  <template #extras-pane>
84
99
  <div class="flex flex-col gap-3 p-6">
@@ -218,6 +233,28 @@ const reorderable = computed({
218
233
  </Field>
219
234
  </div>
220
235
 
236
+ <Field orientation="vertical">
237
+ <FieldLabel class="text-xs text-zinc-500">
238
+ <template
239
+ v-if="fieldDescription('locale')"
240
+ #tooltip
241
+ >
242
+ <Markdown
243
+ :source="fieldDescription('locale')"
244
+ block
245
+ class="prose prose-sm prose-zinc"
246
+ />
247
+ </template>
248
+ {{ fieldTitle("locale") }}
249
+ </FieldLabel>
250
+ <LocaleField
251
+ markdown
252
+ translate-hint="列表项折叠摘要,Markdown 文本,保留表达式插值占位符不要翻译"
253
+ :model-value="value.locale"
254
+ @update:model-value="(v) => value = { ...value, locale: v }"
255
+ />
256
+ </Field>
257
+
221
258
  <div class="grid grid-cols-3 gap-3">
222
259
  <Field orientation="vertical">
223
260
  <FieldLabel class="text-xs text-zinc-500">
@@ -22,10 +22,18 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
22
22
  readonly locale: "en" | "ja" | "ko";
23
23
  readonly message: string;
24
24
  }[]] | undefined;
25
+ readonly locale?: readonly [{
26
+ readonly locale: "zh";
27
+ readonly message: string;
28
+ }, ...{
29
+ readonly locale: "en" | "ja" | "ko";
30
+ readonly message: string;
31
+ }[]] | undefined;
25
32
  readonly displayName?: string | undefined;
26
33
  readonly compatibilityDate: "2026-05-13";
27
34
  readonly min?: number | undefined;
28
35
  readonly max?: number | undefined;
36
+ readonly binding?: string | undefined;
29
37
  readonly unit: Readonly<{
30
38
  fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
31
39
  layouts: readonly Readonly<{
@@ -34,7 +42,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
34
42
  layout: import("../../../schema.js").LayoutValue;
35
43
  }>[];
36
44
  }>;
37
- readonly binding?: string | undefined;
38
45
  readonly addLabel?: readonly [{
39
46
  readonly locale: "zh";
40
47
  readonly message: string;
@@ -71,10 +78,18 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
71
78
  readonly locale: "en" | "ja" | "ko";
72
79
  readonly message: string;
73
80
  }[]] | undefined;
81
+ readonly locale?: readonly [{
82
+ readonly locale: "zh";
83
+ readonly message: string;
84
+ }, ...{
85
+ readonly locale: "en" | "ja" | "ko";
86
+ readonly message: string;
87
+ }[]] | undefined;
74
88
  readonly displayName?: string | undefined;
75
89
  readonly compatibilityDate: "2026-05-13";
76
90
  readonly min?: number | undefined;
77
91
  readonly max?: number | undefined;
92
+ readonly binding?: string | undefined;
78
93
  readonly unit: Readonly<{
79
94
  fields: ReadonlyArray<import("../../../schema.js").FieldValue>;
80
95
  layouts: readonly Readonly<{
@@ -83,7 +98,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
83
98
  layout: import("../../../schema.js").LayoutValue;
84
99
  }>[];
85
100
  }>;
86
- readonly binding?: string | undefined;
87
101
  readonly addLabel?: readonly [{
88
102
  readonly locale: "zh";
89
103
  readonly message: string;
@@ -2,6 +2,7 @@ import type { FormUnitValue } from '../../../schema.js';
2
2
  import { type FormState } from '../../../utils/state.js';
3
3
  type __VLS_Props = {
4
4
  unit: FormUnitValue;
5
+ index: number;
5
6
  };
6
7
  type __VLS_ModelProps = {
7
8
  modelValue: FormState;