@shwfed/config 3.0.9 → 3.0.11

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 (63) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/actions/buttons/2026-04-21/com.shwfed.actions.button.navigation/runtime.vue +3 -2
  3. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/config.d.vue.ts +18 -18
  4. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/config.vue.d.ts +18 -18
  5. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/runtime.d.vue.ts +18 -18
  6. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/runtime.vue.d.ts +18 -18
  7. package/dist/runtime/components/config/index.d.vue.ts +2 -2
  8. package/dist/runtime/components/config/index.vue.d.ts +2 -2
  9. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.d.vue.ts +16 -16
  10. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.vue.d.ts +16 -16
  11. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.d.vue.ts +16 -16
  12. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.vue.d.ts +16 -16
  13. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +26 -26
  14. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +26 -26
  15. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.d.vue.ts +16 -16
  16. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue.d.ts +16 -16
  17. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +26 -26
  18. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +26 -26
  19. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +26 -26
  20. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +26 -26
  21. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +26 -26
  22. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +26 -26
  23. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +26 -26
  24. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +26 -26
  25. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +26 -26
  26. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +26 -26
  27. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +26 -26
  28. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +26 -26
  29. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/config.d.vue.ts +34 -0
  30. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/config.vue +109 -1
  31. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/config.vue.d.ts +34 -0
  32. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/prompt.md +7 -0
  33. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/runtime.vue +66 -22
  34. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/schema.d.ts +23 -0
  35. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/schema.js +26 -0
  36. package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.navigation/runtime.js +3 -2
  37. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +10 -10
  38. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +10 -10
  39. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +10 -10
  40. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +10 -10
  41. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +10 -10
  42. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +10 -10
  43. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +10 -10
  44. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +10 -10
  45. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +10 -10
  46. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +10 -10
  47. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +10 -10
  48. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +10 -10
  49. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/config.d.vue.ts +10 -0
  50. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/config.vue +1004 -0
  51. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/config.vue.d.ts +10 -0
  52. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/prompt.md +19 -0
  53. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/runtime.d.vue.ts +9 -0
  54. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/runtime.vue +503 -0
  55. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/runtime.vue.d.ts +9 -0
  56. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/schema.d.ts +138 -0
  57. package/dist/runtime/components/table/columns/2026-07-16/com.shwfed.table.column.upload/schema.js +181 -0
  58. package/dist/runtime/share/navigation.d.ts +23 -0
  59. package/dist/runtime/share/navigation.js +15 -0
  60. package/dist/runtime/vendor/cel-js/CLAUDE.md +3 -1
  61. package/dist/runtime/vendor/cel-js/PROMPT.md +13 -0
  62. package/dist/runtime/vendor/cel-js/lib/macros.js +64 -1
  63. package/package.json +2 -1
@@ -37,15 +37,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
37
37
  readonly displayName?: string | undefined;
38
38
  readonly compatibilityDate: "2026-05-28";
39
39
  readonly readonly?: string | undefined;
40
- readonly dataSource: {
41
- readonly data: string;
42
- readonly request?: string | undefined;
43
- };
44
40
  readonly binding?: string | undefined;
45
41
  readonly derived?: {
46
42
  readonly mode: "formula" | "prefill";
47
43
  readonly expression: string;
48
44
  } | undefined;
45
+ readonly dataSource: {
46
+ readonly data: string;
47
+ readonly request?: string | undefined;
48
+ };
49
49
  readonly nodeKey: string;
50
50
  readonly nodeChildren: string;
51
51
  readonly nodeLabel: readonly [{
@@ -56,15 +56,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
56
56
  readonly message: string;
57
57
  }[]];
58
58
  readonly cascade: "independent" | "cascade-down" | "cascade-both";
59
- readonly nodeTooltip?: readonly [{
60
- readonly locale: "zh";
61
- readonly message: string;
62
- }, ...{
63
- readonly locale: "en" | "ja" | "ko";
64
- readonly message: string;
65
- }[]] | undefined;
66
- readonly nodeSelectable?: string | undefined;
67
- readonly expandAll: boolean;
68
59
  readonly validations?: readonly {
69
60
  readonly message: readonly [{
70
61
  readonly locale: "zh";
@@ -76,6 +67,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
76
67
  readonly warning?: boolean | undefined;
77
68
  readonly when: string;
78
69
  }[] | undefined;
70
+ readonly nodeTooltip?: readonly [{
71
+ readonly locale: "zh";
72
+ readonly message: string;
73
+ }, ...{
74
+ readonly locale: "en" | "ja" | "ko";
75
+ readonly message: string;
76
+ }[]] | undefined;
77
+ readonly nodeSelectable?: string | undefined;
78
+ readonly expandAll: boolean;
79
79
  }) => any;
80
80
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
81
81
  "onUpdate:modelValue"?: ((value: {
@@ -112,15 +112,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
112
112
  readonly displayName?: string | undefined;
113
113
  readonly compatibilityDate: "2026-05-28";
114
114
  readonly readonly?: string | undefined;
115
- readonly dataSource: {
116
- readonly data: string;
117
- readonly request?: string | undefined;
118
- };
119
115
  readonly binding?: string | undefined;
120
116
  readonly derived?: {
121
117
  readonly mode: "formula" | "prefill";
122
118
  readonly expression: string;
123
119
  } | undefined;
120
+ readonly dataSource: {
121
+ readonly data: string;
122
+ readonly request?: string | undefined;
123
+ };
124
124
  readonly nodeKey: string;
125
125
  readonly nodeChildren: string;
126
126
  readonly nodeLabel: readonly [{
@@ -131,15 +131,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
131
131
  readonly message: string;
132
132
  }[]];
133
133
  readonly cascade: "independent" | "cascade-down" | "cascade-both";
134
- readonly nodeTooltip?: readonly [{
135
- readonly locale: "zh";
136
- readonly message: string;
137
- }, ...{
138
- readonly locale: "en" | "ja" | "ko";
139
- readonly message: string;
140
- }[]] | undefined;
141
- readonly nodeSelectable?: string | undefined;
142
- readonly expandAll: boolean;
143
134
  readonly validations?: readonly {
144
135
  readonly message: readonly [{
145
136
  readonly locale: "zh";
@@ -151,6 +142,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
151
142
  readonly warning?: boolean | undefined;
152
143
  readonly when: string;
153
144
  }[] | undefined;
145
+ readonly nodeTooltip?: readonly [{
146
+ readonly locale: "zh";
147
+ readonly message: string;
148
+ }, ...{
149
+ readonly locale: "en" | "ja" | "ko";
150
+ readonly message: string;
151
+ }[]] | undefined;
152
+ readonly nodeSelectable?: string | undefined;
153
+ readonly expandAll: boolean;
154
154
  }) => any) | undefined;
155
155
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
156
156
  declare const _default: typeof __VLS_export;
@@ -37,15 +37,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
37
37
  readonly displayName?: string | undefined;
38
38
  readonly compatibilityDate: "2026-05-28";
39
39
  readonly readonly?: string | undefined;
40
- readonly dataSource: {
41
- readonly data: string;
42
- readonly request?: string | undefined;
43
- };
44
40
  readonly binding?: string | undefined;
45
41
  readonly derived?: {
46
42
  readonly mode: "formula" | "prefill";
47
43
  readonly expression: string;
48
44
  } | undefined;
45
+ readonly dataSource: {
46
+ readonly data: string;
47
+ readonly request?: string | undefined;
48
+ };
49
49
  readonly nodeKey: string;
50
50
  readonly nodeChildren: string;
51
51
  readonly nodeLabel: readonly [{
@@ -55,15 +55,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
55
55
  readonly locale: "en" | "ja" | "ko";
56
56
  readonly message: string;
57
57
  }[]];
58
- readonly nodeTooltip?: readonly [{
59
- readonly locale: "zh";
60
- readonly message: string;
61
- }, ...{
62
- readonly locale: "en" | "ja" | "ko";
63
- readonly message: string;
64
- }[]] | undefined;
65
- readonly nodeSelectable?: string | undefined;
66
- readonly expandAll: boolean;
67
58
  readonly validations?: readonly {
68
59
  readonly message: readonly [{
69
60
  readonly locale: "zh";
@@ -75,6 +66,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
75
66
  readonly warning?: boolean | undefined;
76
67
  readonly when: string;
77
68
  }[] | undefined;
69
+ readonly nodeTooltip?: readonly [{
70
+ readonly locale: "zh";
71
+ readonly message: string;
72
+ }, ...{
73
+ readonly locale: "en" | "ja" | "ko";
74
+ readonly message: string;
75
+ }[]] | undefined;
76
+ readonly nodeSelectable?: string | undefined;
77
+ readonly expandAll: boolean;
78
78
  }) => any;
79
79
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
80
80
  "onUpdate:modelValue"?: ((value: {
@@ -111,15 +111,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
111
111
  readonly displayName?: string | undefined;
112
112
  readonly compatibilityDate: "2026-05-28";
113
113
  readonly readonly?: string | undefined;
114
- readonly dataSource: {
115
- readonly data: string;
116
- readonly request?: string | undefined;
117
- };
118
114
  readonly binding?: string | undefined;
119
115
  readonly derived?: {
120
116
  readonly mode: "formula" | "prefill";
121
117
  readonly expression: string;
122
118
  } | undefined;
119
+ readonly dataSource: {
120
+ readonly data: string;
121
+ readonly request?: string | undefined;
122
+ };
123
123
  readonly nodeKey: string;
124
124
  readonly nodeChildren: string;
125
125
  readonly nodeLabel: readonly [{
@@ -129,15 +129,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
129
129
  readonly locale: "en" | "ja" | "ko";
130
130
  readonly message: string;
131
131
  }[]];
132
- readonly nodeTooltip?: readonly [{
133
- readonly locale: "zh";
134
- readonly message: string;
135
- }, ...{
136
- readonly locale: "en" | "ja" | "ko";
137
- readonly message: string;
138
- }[]] | undefined;
139
- readonly nodeSelectable?: string | undefined;
140
- readonly expandAll: boolean;
141
132
  readonly validations?: readonly {
142
133
  readonly message: readonly [{
143
134
  readonly locale: "zh";
@@ -149,6 +140,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
149
140
  readonly warning?: boolean | undefined;
150
141
  readonly when: string;
151
142
  }[] | undefined;
143
+ readonly nodeTooltip?: readonly [{
144
+ readonly locale: "zh";
145
+ readonly message: string;
146
+ }, ...{
147
+ readonly locale: "en" | "ja" | "ko";
148
+ readonly message: string;
149
+ }[]] | undefined;
150
+ readonly nodeSelectable?: string | undefined;
151
+ readonly expandAll: boolean;
152
152
  }) => any) | undefined;
153
153
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
154
154
  declare const _default: typeof __VLS_export;
@@ -37,15 +37,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
37
37
  readonly displayName?: string | undefined;
38
38
  readonly compatibilityDate: "2026-05-28";
39
39
  readonly readonly?: string | undefined;
40
- readonly dataSource: {
41
- readonly data: string;
42
- readonly request?: string | undefined;
43
- };
44
40
  readonly binding?: string | undefined;
45
41
  readonly derived?: {
46
42
  readonly mode: "formula" | "prefill";
47
43
  readonly expression: string;
48
44
  } | undefined;
45
+ readonly dataSource: {
46
+ readonly data: string;
47
+ readonly request?: string | undefined;
48
+ };
49
49
  readonly nodeKey: string;
50
50
  readonly nodeChildren: string;
51
51
  readonly nodeLabel: readonly [{
@@ -55,15 +55,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
55
55
  readonly locale: "en" | "ja" | "ko";
56
56
  readonly message: string;
57
57
  }[]];
58
- readonly nodeTooltip?: readonly [{
59
- readonly locale: "zh";
60
- readonly message: string;
61
- }, ...{
62
- readonly locale: "en" | "ja" | "ko";
63
- readonly message: string;
64
- }[]] | undefined;
65
- readonly nodeSelectable?: string | undefined;
66
- readonly expandAll: boolean;
67
58
  readonly validations?: readonly {
68
59
  readonly message: readonly [{
69
60
  readonly locale: "zh";
@@ -75,6 +66,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
75
66
  readonly warning?: boolean | undefined;
76
67
  readonly when: string;
77
68
  }[] | undefined;
69
+ readonly nodeTooltip?: readonly [{
70
+ readonly locale: "zh";
71
+ readonly message: string;
72
+ }, ...{
73
+ readonly locale: "en" | "ja" | "ko";
74
+ readonly message: string;
75
+ }[]] | undefined;
76
+ readonly nodeSelectable?: string | undefined;
77
+ readonly expandAll: boolean;
78
78
  }) => any;
79
79
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
80
80
  "onUpdate:modelValue"?: ((value: {
@@ -111,15 +111,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
111
111
  readonly displayName?: string | undefined;
112
112
  readonly compatibilityDate: "2026-05-28";
113
113
  readonly readonly?: string | undefined;
114
- readonly dataSource: {
115
- readonly data: string;
116
- readonly request?: string | undefined;
117
- };
118
114
  readonly binding?: string | undefined;
119
115
  readonly derived?: {
120
116
  readonly mode: "formula" | "prefill";
121
117
  readonly expression: string;
122
118
  } | undefined;
119
+ readonly dataSource: {
120
+ readonly data: string;
121
+ readonly request?: string | undefined;
122
+ };
123
123
  readonly nodeKey: string;
124
124
  readonly nodeChildren: string;
125
125
  readonly nodeLabel: readonly [{
@@ -129,15 +129,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
129
129
  readonly locale: "en" | "ja" | "ko";
130
130
  readonly message: string;
131
131
  }[]];
132
- readonly nodeTooltip?: readonly [{
133
- readonly locale: "zh";
134
- readonly message: string;
135
- }, ...{
136
- readonly locale: "en" | "ja" | "ko";
137
- readonly message: string;
138
- }[]] | undefined;
139
- readonly nodeSelectable?: string | undefined;
140
- readonly expandAll: boolean;
141
132
  readonly validations?: readonly {
142
133
  readonly message: readonly [{
143
134
  readonly locale: "zh";
@@ -149,6 +140,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
149
140
  readonly warning?: boolean | undefined;
150
141
  readonly when: string;
151
142
  }[] | undefined;
143
+ readonly nodeTooltip?: readonly [{
144
+ readonly locale: "zh";
145
+ readonly message: string;
146
+ }, ...{
147
+ readonly locale: "en" | "ja" | "ko";
148
+ readonly message: string;
149
+ }[]] | undefined;
150
+ readonly nodeSelectable?: string | undefined;
151
+ readonly expandAll: boolean;
152
152
  }) => any) | undefined;
153
153
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
154
154
  declare const _default: typeof __VLS_export;
@@ -32,6 +32,23 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
32
32
  }[]] | undefined;
33
33
  readonly required?: string | undefined;
34
34
  readonly displayName?: string | undefined;
35
+ readonly download?: {
36
+ readonly label?: readonly [{
37
+ readonly locale: "zh";
38
+ readonly message: string;
39
+ }, ...{
40
+ readonly locale: "en" | "ja" | "ko";
41
+ readonly message: string;
42
+ }[]] | undefined;
43
+ readonly icon?: string | undefined;
44
+ readonly operations: readonly {
45
+ readonly id?: string | undefined;
46
+ readonly params?: unknown;
47
+ readonly compatibilityDate?: string | undefined;
48
+ readonly target: string;
49
+ readonly operation: string;
50
+ }[];
51
+ } | undefined;
35
52
  readonly compatibilityDate: "2026-06-09";
36
53
  readonly orientation?: "vertical" | "floating" | undefined;
37
54
  readonly placeholder?: readonly [{
@@ -106,6 +123,23 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
106
123
  }[]] | undefined;
107
124
  readonly required?: string | undefined;
108
125
  readonly displayName?: string | undefined;
126
+ readonly download?: {
127
+ readonly label?: readonly [{
128
+ readonly locale: "zh";
129
+ readonly message: string;
130
+ }, ...{
131
+ readonly locale: "en" | "ja" | "ko";
132
+ readonly message: string;
133
+ }[]] | undefined;
134
+ readonly icon?: string | undefined;
135
+ readonly operations: readonly {
136
+ readonly id?: string | undefined;
137
+ readonly params?: unknown;
138
+ readonly compatibilityDate?: string | undefined;
139
+ readonly target: string;
140
+ readonly operation: string;
141
+ }[];
142
+ } | undefined;
109
143
  readonly compatibilityDate: "2026-06-09";
110
144
  readonly orientation?: "vertical" | "floating" | undefined;
111
145
  readonly placeholder?: readonly [{
@@ -1,9 +1,11 @@
1
1
  <script setup>
2
2
  import { Icon } from "@iconify/vue";
3
- import { computed, ref, watch } from "vue";
3
+ import { computed, defineComponent, ref, watch } from "vue";
4
4
  import {
5
5
  useTreeDnd
6
6
  } from "../../../../../composables/useTreeDnd";
7
+ import TriggersField from "../../../../actions/components/triggers-field.vue";
8
+ import { provideCELContext } from "../../../../../utils/cel-context";
7
9
  import {
8
10
  DropdownMenu,
9
11
  DropdownMenuContent,
@@ -273,6 +275,52 @@ function setMultiple(v) {
273
275
  value.value = { ...value.value, multiple: true };
274
276
  }
275
277
  }
278
+ const downloadEnabled = computed(() => value.value.download != null);
279
+ function setDownloadEnabled(on) {
280
+ if (on) {
281
+ if (value.value.download) return;
282
+ value.value = { ...value.value, download: { operations: [] } };
283
+ } else {
284
+ const { download: _omit, ...rest } = value.value;
285
+ value.value = rest;
286
+ }
287
+ }
288
+ const downloadOperations = computed(() => value.value.download?.operations ?? []);
289
+ function updateDownloadOperations(next) {
290
+ const current = value.value.download;
291
+ if (!current) return;
292
+ value.value = { ...value.value, download: { ...current, operations: next } };
293
+ }
294
+ function updateDownloadIcon(icon) {
295
+ const current = value.value.download;
296
+ if (!current) return;
297
+ const trimmed = icon.trim();
298
+ if (trimmed.length === 0) {
299
+ const { icon: _omit, ...rest } = current;
300
+ value.value = { ...value.value, download: rest };
301
+ } else {
302
+ value.value = { ...value.value, download: { ...current, icon: trimmed } };
303
+ }
304
+ }
305
+ function updateDownloadLabel(label) {
306
+ const current = value.value.download;
307
+ if (!current) return;
308
+ if (label == null || label.length === 0) {
309
+ const { label: _omit, ...rest } = current;
310
+ value.value = { ...value.value, download: rest };
311
+ } else {
312
+ value.value = { ...value.value, download: { ...current, label } };
313
+ }
314
+ }
315
+ const DownloadScope = defineComponent({
316
+ name: "ShwfedUploadDownloadScope",
317
+ setup(_, { slots }) {
318
+ provideCELContext({
319
+ file: { type: FILE_VAR.type, label: FILE_VAR.label, description: FILE_VAR.description, value: () => void 0 }
320
+ });
321
+ return () => slots.default?.();
322
+ }
323
+ });
276
324
  </script>
277
325
 
278
326
  <template>
@@ -693,6 +741,66 @@ function setMultiple(v) {
693
741
  </Field>
694
742
  </div>
695
743
 
744
+ <!-- Per-file download -->
745
+ <div class="flex items-center gap-2">
746
+ <h3 class="text-xs font-medium text-zinc-500">
747
+ {{ fieldTitle("download") }}
748
+ </h3>
749
+ <Switch
750
+ size="sm"
751
+ :model-value="downloadEnabled"
752
+ aria-label="启用文件下载"
753
+ @update:model-value="setDownloadEnabled"
754
+ />
755
+ </div>
756
+
757
+ <div
758
+ v-if="downloadEnabled"
759
+ class="flex flex-col gap-3"
760
+ >
761
+ <div class="grid grid-cols-2 gap-3">
762
+ <Field orientation="vertical">
763
+ <FieldLabel class="text-xs text-zinc-500">
764
+ 下载按钮图标
765
+ </FieldLabel>
766
+ <IconPicker
767
+ :model-value="value.download?.icon ?? ''"
768
+ @update:model-value="updateDownloadIcon"
769
+ />
770
+ </Field>
771
+
772
+ <Field orientation="vertical">
773
+ <FieldLabel class="text-xs text-zinc-500">
774
+ 下载按钮文本
775
+ </FieldLabel>
776
+ <LocaleField
777
+ translate-hint="file download button label"
778
+ :model-value="value.download?.label"
779
+ @update:model-value="updateDownloadLabel"
780
+ />
781
+ </Field>
782
+ </div>
783
+
784
+ <Field orientation="vertical">
785
+ <FieldLabel class="text-xs text-zinc-500">
786
+ <template #tooltip>
787
+ <Markdown
788
+ source="点击文件项的下载按钮时按顺序执行的操作;可用 `file` 引用该文件项。尚未上传的本地文件会直接从内存下载,不经过此列表"
789
+ block
790
+ class="prose prose-sm prose-zinc"
791
+ />
792
+ </template>
793
+ 触发操作
794
+ </FieldLabel>
795
+ <DownloadScope>
796
+ <TriggersField
797
+ :triggers="downloadOperations"
798
+ @update:triggers="updateDownloadOperations"
799
+ />
800
+ </DownloadScope>
801
+ </Field>
802
+ </div>
803
+
696
804
  <!-- Download templates -->
697
805
  <Field orientation="vertical">
698
806
  <FieldLabel class="text-xs text-zinc-500">
@@ -32,6 +32,23 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
32
32
  }[]] | undefined;
33
33
  readonly required?: string | undefined;
34
34
  readonly displayName?: string | undefined;
35
+ readonly download?: {
36
+ readonly label?: readonly [{
37
+ readonly locale: "zh";
38
+ readonly message: string;
39
+ }, ...{
40
+ readonly locale: "en" | "ja" | "ko";
41
+ readonly message: string;
42
+ }[]] | undefined;
43
+ readonly icon?: string | undefined;
44
+ readonly operations: readonly {
45
+ readonly id?: string | undefined;
46
+ readonly params?: unknown;
47
+ readonly compatibilityDate?: string | undefined;
48
+ readonly target: string;
49
+ readonly operation: string;
50
+ }[];
51
+ } | undefined;
35
52
  readonly compatibilityDate: "2026-06-09";
36
53
  readonly orientation?: "vertical" | "floating" | undefined;
37
54
  readonly placeholder?: readonly [{
@@ -106,6 +123,23 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
106
123
  }[]] | undefined;
107
124
  readonly required?: string | undefined;
108
125
  readonly displayName?: string | undefined;
126
+ readonly download?: {
127
+ readonly label?: readonly [{
128
+ readonly locale: "zh";
129
+ readonly message: string;
130
+ }, ...{
131
+ readonly locale: "en" | "ja" | "ko";
132
+ readonly message: string;
133
+ }[]] | undefined;
134
+ readonly icon?: string | undefined;
135
+ readonly operations: readonly {
136
+ readonly id?: string | undefined;
137
+ readonly params?: unknown;
138
+ readonly compatibilityDate?: string | undefined;
139
+ readonly target: string;
140
+ readonly operation: string;
141
+ }[];
142
+ } | undefined;
109
143
  readonly compatibilityDate: "2026-06-09";
110
144
  readonly orientation?: "vertical" | "floating" | undefined;
111
145
  readonly placeholder?: readonly [{
@@ -9,4 +9,11 @@
9
9
 
10
10
  `templates` 在上传区旁渲染「下载模板」按钮:只配 `request` 则直接下载其响应;再配 `download` 则是两步式——第二步经 `json` 引用第一步响应(如用 `json.data.key` 拼真正的下载地址)。
11
11
 
12
+ `download`(文件下载)给每个**文件项**渲染一个下载按钮,点击时执行一条「触发操作」列表(复用 actions 的操作子系统,与 state.write 同款),列表里的表达式可用 `file` 引用被点击的那一项。分两种情况:
13
+
14
+ - **已上传/回填的对象项**(即时上传结果,或编辑时服务端回填的记录):走操作列表,如放一个 `http.download` 操作、请求写 `http.get('/api/file').query('key', file.cacheKey)`;或两步式——先一个 `发送请求` 行取凭据、再一个 `下载文件` 行经 `steps[?"<步骤标识>"]` 引用其响应。凡下载要用到的字段,都必须已由 `upload.handle` 落进文件项(原始上传 `json` 在 `handle` 之后即失效,只有落进项里的字段才随保存/回填留存,从而让本会话上传的与编辑回填的文件项行为一致)。
15
+ - **尚未上传的本地文件**(延迟模式刚选中的原始 `File`):内存里没有服务端标识、也没有能表达“存这个本地 blob”的操作,故绕过列表、直接从 blob 下载。
16
+
17
+ 下载按钮在只读表单里仍显示(查看已提交记录并下载附件是主要场景)。`download.icon` / `download.label` 定制按钮图标与无障碍文本。
18
+
12
19
  约束类字段(`accept` / `maxFileSize` / `maxTotalSize` / `maxFiles` / `multiple`)按需设置即可。
@@ -6,7 +6,8 @@ import { computed, ref } from "vue";
6
6
  import { useI18n } from "vue-i18n";
7
7
  import { toast } from "vue-sonner";
8
8
  import { cel as _rawCel } from "../../../../../utils/cel";
9
- import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
9
+ import { celBindings, celScope, injectCELContext } from "../../../../../utils/cel-context";
10
+ import { dispatchTriggers, useEventChannel } from "../../../../../share/event-bus";
10
11
  import { getLocalizedText } from "../../../../../share/locale";
11
12
  import { interpolateMarkdown } from "../../../../table/utils/runtime";
12
13
  import { Button } from "../../../../ui/button";
@@ -112,6 +113,7 @@ const { locale, t } = useI18n({
112
113
  });
113
114
  const { getAt, setAt } = useFormState();
114
115
  const formScope = useFormScope();
116
+ const eventChannel = useEventChannel();
115
117
  const inherited = injectCELContext();
116
118
  const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
117
119
  const labelText = computed(
@@ -304,6 +306,16 @@ function onDelete(index) {
304
306
  next.splice(index, 1);
305
307
  entries.value = next;
306
308
  }
309
+ function saveFile(file) {
310
+ const url = URL.createObjectURL(file);
311
+ const a = document.createElement("a");
312
+ a.href = url;
313
+ a.download = file.name;
314
+ document.body.appendChild(a);
315
+ a.click();
316
+ a.remove();
317
+ URL.revokeObjectURL(url);
318
+ }
307
319
  const templates = computed(() => props.config.templates ?? []);
308
320
  function templateIcon(template) {
309
321
  return template.icon ?? "fluent:arrow-download-20-regular";
@@ -328,18 +340,36 @@ async function onDownloadTemplate(template) {
328
340
  console.error(`[shwfed-form] template request for ${props.fieldId} did not produce a File`);
329
341
  return;
330
342
  }
331
- const url = URL.createObjectURL(file);
332
- const a = document.createElement("a");
333
- a.href = url;
334
- a.download = file.name;
335
- document.body.appendChild(a);
336
- a.click();
337
- a.remove();
338
- URL.revokeObjectURL(url);
343
+ saveFile(file);
339
344
  } catch (err) {
340
345
  console.error(`[shwfed-form] failed to download template for ${props.fieldId}:`, err);
341
346
  }
342
347
  }
348
+ const downloadEnabled = computed(() => props.config.download != null);
349
+ const downloadIcon = computed(() => props.config.download?.icon ?? "fluent:arrow-download-20-regular");
350
+ const downloadLabel = computed(
351
+ () => (props.config.download?.label ? getLocalizedText(props.config.download.label, locale.value) : void 0) ?? "\u4E0B\u8F7D"
352
+ );
353
+ function canDownload(entry) {
354
+ if (!downloadEnabled.value) return false;
355
+ if (entry instanceof File) return true;
356
+ return (props.config.download?.operations.length ?? 0) > 0;
357
+ }
358
+ async function onDownloadEntry(entry) {
359
+ if (!downloadEnabled.value) return;
360
+ if (entry instanceof File) {
361
+ saveFile(entry);
362
+ return;
363
+ }
364
+ const download = props.config.download;
365
+ if (!download || download.operations.length === 0) return;
366
+ const triggerCel = (expression, context) => _rawCel(expression, celScope(inherited, { form: formScope.state.value ?? {}, file: entry, ...context }));
367
+ try {
368
+ await Effect.runPromise(dispatchTriggers(eventChannel, download.operations, triggerCel));
369
+ } catch (err) {
370
+ if (import.meta.dev) console.warn(`[shwfed-form] download operations halted for ${props.fieldId}:`, err);
371
+ }
372
+ }
343
373
  </script>
344
374
 
345
375
  <template>
@@ -446,19 +476,33 @@ async function onDownloadTemplate(template) {
446
476
  />
447
477
  <span class="truncate text-zinc-700">{{ entryName(entry) }}</span>
448
478
  </span>
449
- <Button
450
- v-if="!isDisabled && !isReadonly"
451
- type="button"
452
- variant="ghost"
453
- size="sm"
454
- data-slot="upload-zone-delete"
455
- class="size-6 p-0 text-zinc-500 hover:bg-red-50 hover:text-red-600"
456
- :disabled="uploading"
457
- :aria-label="`\u5220\u9664\uFF1A${entryName(entry)}`"
458
- @click="onDelete(index)"
459
- >
460
- <Icon icon="fluent:delete-20-regular" />
461
- </Button>
479
+ <span class="flex shrink-0 items-center gap-0.5">
480
+ <Button
481
+ v-if="canDownload(entry)"
482
+ type="button"
483
+ variant="ghost"
484
+ size="sm"
485
+ data-slot="upload-zone-download"
486
+ class="size-6 p-0 text-zinc-500 hover:bg-zinc-100 hover:text-zinc-700"
487
+ :aria-label="`${downloadLabel}\uFF1A${entryName(entry)}`"
488
+ @click="onDownloadEntry(entry)"
489
+ >
490
+ <Icon :icon="downloadIcon" />
491
+ </Button>
492
+ <Button
493
+ v-if="!isDisabled && !isReadonly"
494
+ type="button"
495
+ variant="ghost"
496
+ size="sm"
497
+ data-slot="upload-zone-delete"
498
+ class="size-6 p-0 text-zinc-500 hover:bg-red-50 hover:text-red-600"
499
+ :disabled="uploading"
500
+ :aria-label="`\u5220\u9664\uFF1A${entryName(entry)}`"
501
+ @click="onDelete(index)"
502
+ >
503
+ <Icon icon="fluent:delete-20-regular" />
504
+ </Button>
505
+ </span>
462
506
  </li>
463
507
  </ul>
464
508