@shwfed/config 2.12.1 → 2.12.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 (126) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +10 -0
  3. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +68 -68
  4. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +68 -68
  5. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +68 -68
  6. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +68 -68
  7. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +34 -34
  8. package/dist/runtime/components/form/config.vue +17 -6
  9. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.d.vue.ts +2 -2
  10. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.vue.d.ts +2 -2
  11. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.d.vue.ts +2 -2
  12. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.vue.d.ts +2 -2
  13. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/row.vue +8 -1
  14. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +24 -24
  15. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +24 -24
  16. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.d.vue.ts +2 -2
  17. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue.d.ts +2 -2
  18. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +24 -24
  19. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +24 -24
  20. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +22 -22
  21. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +22 -22
  22. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.d.vue.ts +32 -32
  23. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.vue.d.ts +32 -32
  24. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue +9 -1
  25. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.d.vue.ts +32 -32
  26. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.vue.d.ts +32 -32
  27. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue +9 -1
  28. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +24 -24
  29. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +24 -24
  30. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue +19 -1
  31. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +22 -22
  32. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +22 -22
  33. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue +19 -1
  34. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +24 -24
  35. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +24 -24
  36. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue +20 -1
  37. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +22 -22
  38. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +22 -22
  39. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue +20 -1
  40. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/config.d.vue.ts +32 -32
  41. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/config.vue.d.ts +32 -32
  42. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/runtime.vue +9 -1
  43. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/config.d.vue.ts +32 -32
  44. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/config.vue.d.ts +32 -32
  45. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/runtime.vue +9 -1
  46. package/dist/runtime/components/form/index.vue +6 -3
  47. package/dist/runtime/components/form/utils/form-vars.js +2 -1
  48. package/dist/runtime/components/head.d.vue.ts +13 -0
  49. package/dist/runtime/components/head.vue +69 -0
  50. package/dist/runtime/components/head.vue.d.ts +13 -0
  51. package/dist/runtime/components/sidebar/config.d.vue.ts +7 -0
  52. package/dist/runtime/components/sidebar/config.vue +302 -0
  53. package/dist/runtime/components/sidebar/config.vue.d.ts +7 -0
  54. package/dist/runtime/components/sidebar/favorites.d.ts +18 -0
  55. package/dist/runtime/components/sidebar/favorites.js +20 -0
  56. package/dist/runtime/components/sidebar/footer.d.vue.ts +11 -0
  57. package/dist/runtime/components/sidebar/footer.vue +49 -0
  58. package/dist/runtime/components/sidebar/footer.vue.d.ts +11 -0
  59. package/dist/runtime/components/sidebar/index.d.vue.ts +50 -0
  60. package/dist/runtime/components/sidebar/index.vue +100 -0
  61. package/dist/runtime/components/sidebar/index.vue.d.ts +50 -0
  62. package/dist/runtime/components/sidebar/node.d.vue.ts +9 -0
  63. package/dist/runtime/components/sidebar/node.vue +102 -0
  64. package/dist/runtime/components/sidebar/node.vue.d.ts +9 -0
  65. package/dist/runtime/components/sidebar/schema.d.ts +72 -0
  66. package/dist/runtime/components/sidebar/schema.js +84 -0
  67. package/dist/runtime/components/sidebar/tree.d.vue.ts +10 -0
  68. package/dist/runtime/components/sidebar/tree.vue +260 -0
  69. package/dist/runtime/components/sidebar/tree.vue.d.ts +10 -0
  70. package/dist/runtime/components/sidebar/types.d.ts +19 -0
  71. package/dist/runtime/components/sidebar/types.js +0 -0
  72. package/dist/runtime/components/sidebar/use-editor.d.ts +18 -0
  73. package/dist/runtime/components/sidebar/use-editor.js +43 -0
  74. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +2 -2
  75. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +2 -2
  76. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +2 -2
  77. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +2 -2
  78. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.d.vue.ts +36 -36
  79. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue.d.ts +36 -36
  80. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +40 -40
  81. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +40 -40
  82. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.d.vue.ts +36 -36
  83. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue.d.ts +36 -36
  84. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +40 -40
  85. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +40 -40
  86. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +4 -4
  87. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +4 -4
  88. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  89. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  90. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +26 -26
  91. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +26 -26
  92. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +26 -26
  93. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +26 -26
  94. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +4 -4
  95. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +4 -4
  96. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  97. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  98. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.d.vue.ts +26 -26
  99. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue.d.ts +26 -26
  100. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.d.vue.ts +26 -26
  101. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue.d.ts +26 -26
  102. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +4 -4
  103. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +4 -4
  104. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  105. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  106. package/dist/runtime/components/table/schema.d.ts +68 -68
  107. package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.d.vue.ts +1 -0
  108. package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.vue +8 -0
  109. package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.vue.d.ts +1 -0
  110. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.d.vue.ts +3 -2
  111. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue +51 -9
  112. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue.d.ts +3 -2
  113. package/dist/runtime/components/ui/expression-editor/option-chip-extension.d.ts +4 -0
  114. package/dist/runtime/components/ui/expression-editor/option-chip-extension.js +119 -0
  115. package/dist/runtime/components/ui/expression-editor/option-refs.d.ts +6 -0
  116. package/dist/runtime/components/ui/expression-editor/option-refs.js +24 -0
  117. package/dist/runtime/components/ui/expression-editor/picker-entries.d.ts +2 -1
  118. package/dist/runtime/components/ui/expression-editor/picker-entries.js +12 -2
  119. package/dist/runtime/utils/cel-context.d.ts +1 -0
  120. package/dist/runtime/utils/cel-context.js +1 -0
  121. package/dist/runtime/utils/selections-registry.d.ts +40 -6
  122. package/dist/runtime/utils/selections-registry.js +19 -4
  123. package/dist/runtime/vendor/cel-js/CLAUDE.md +2 -0
  124. package/dist/runtime/vendor/cel-js/PROMPT.md +2 -0
  125. package/dist/runtime/vendor/cel-js/lib/functions.js +33 -0
  126. package/package.json +1 -1
@@ -45,11 +45,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
45
45
  readonly data: string;
46
46
  readonly request?: string | undefined;
47
47
  };
48
- readonly enableSorting?: boolean | undefined;
49
- readonly cascade: "independent" | "cascade-down" | "cascade-both";
50
48
  readonly nodeKey: string;
51
49
  readonly nodeChildren: string;
52
50
  readonly nodeLabel: string;
51
+ readonly enableSorting?: boolean | undefined;
52
+ readonly cascade: "independent" | "cascade-down" | "cascade-both";
53
53
  readonly nodeTooltip?: readonly [{
54
54
  readonly locale: "zh";
55
55
  readonly message: string;
@@ -104,11 +104,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
104
104
  readonly data: string;
105
105
  readonly request?: string | undefined;
106
106
  };
107
- readonly enableSorting?: boolean | undefined;
108
- readonly cascade: "independent" | "cascade-down" | "cascade-both";
109
107
  readonly nodeKey: string;
110
108
  readonly nodeChildren: string;
111
109
  readonly nodeLabel: string;
110
+ readonly enableSorting?: boolean | undefined;
111
+ readonly cascade: "independent" | "cascade-down" | "cascade-both";
112
112
  readonly nodeTooltip?: readonly [{
113
113
  readonly locale: "zh";
114
114
  readonly message: string;
@@ -45,10 +45,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
45
45
  readonly data: string;
46
46
  readonly request?: string | undefined;
47
47
  };
48
- readonly enableSorting?: boolean | undefined;
49
48
  readonly nodeKey: string;
50
49
  readonly nodeChildren: string;
51
50
  readonly nodeLabel: string;
51
+ readonly enableSorting?: boolean | undefined;
52
52
  readonly nodeTooltip?: readonly [{
53
53
  readonly locale: "zh";
54
54
  readonly message: string;
@@ -103,10 +103,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
103
103
  readonly data: string;
104
104
  readonly request?: string | undefined;
105
105
  };
106
- readonly enableSorting?: boolean | undefined;
107
106
  readonly nodeKey: string;
108
107
  readonly nodeChildren: string;
109
108
  readonly nodeLabel: string;
109
+ readonly enableSorting?: boolean | undefined;
110
110
  readonly nodeTooltip?: readonly [{
111
111
  readonly locale: "zh";
112
112
  readonly message: string;
@@ -45,10 +45,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
45
45
  readonly data: string;
46
46
  readonly request?: string | undefined;
47
47
  };
48
- readonly enableSorting?: boolean | undefined;
49
48
  readonly nodeKey: string;
50
49
  readonly nodeChildren: string;
51
50
  readonly nodeLabel: string;
51
+ readonly enableSorting?: boolean | undefined;
52
52
  readonly nodeTooltip?: readonly [{
53
53
  readonly locale: "zh";
54
54
  readonly message: string;
@@ -103,10 +103,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
103
103
  readonly data: string;
104
104
  readonly request?: string | undefined;
105
105
  };
106
- readonly enableSorting?: boolean | undefined;
107
106
  readonly nodeKey: string;
108
107
  readonly nodeChildren: string;
109
108
  readonly nodeLabel: string;
109
+ readonly enableSorting?: boolean | undefined;
110
110
  readonly nodeTooltip?: readonly [{
111
111
  readonly locale: "zh";
112
112
  readonly message: string;
@@ -157,6 +157,40 @@ export declare function TableConfig(configure: (env: Environment) => void): Sche
157
157
  readonly message: string;
158
158
  }[]] | undefined;
159
159
  }[];
160
+ readonly query?: {
161
+ readonly style?: string | undefined;
162
+ readonly id?: string | undefined;
163
+ readonly initial?: {
164
+ readonly data: string;
165
+ readonly request?: string | undefined;
166
+ } | undefined;
167
+ readonly displayName?: string | undefined;
168
+ readonly kind: "shwfed.component.form";
169
+ readonly fields: readonly any[];
170
+ readonly layouts: readonly {
171
+ readonly name: string;
172
+ readonly layout: {
173
+ readonly style?: string | undefined;
174
+ readonly columns: number;
175
+ readonly gap?: number | undefined;
176
+ readonly rows?: number | undefined;
177
+ readonly placements: {
178
+ readonly [x: string]: {
179
+ readonly area: readonly [readonly [number, number], readonly [number, number]];
180
+ readonly v?: "stretch" | "center" | "end" | "start" | undefined;
181
+ readonly h?: "stretch" | "center" | "end" | "start" | undefined;
182
+ };
183
+ };
184
+ };
185
+ readonly media?: string | undefined;
186
+ }[];
187
+ readonly readonly?: string | undefined;
188
+ } | undefined;
189
+ readonly dataSource?: {
190
+ readonly data: string;
191
+ readonly total?: string | undefined;
192
+ readonly request?: string | undefined;
193
+ } | undefined;
160
194
  readonly actions?: {
161
195
  readonly size: "default" | "sm" | "xs";
162
196
  readonly style?: string | undefined;
@@ -224,40 +258,6 @@ export declare function TableConfig(configure: (env: Environment) => void): Sche
224
258
  readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
225
259
  }[];
226
260
  } | undefined;
227
- readonly query?: {
228
- readonly style?: string | undefined;
229
- readonly id?: string | undefined;
230
- readonly initial?: {
231
- readonly data: string;
232
- readonly request?: string | undefined;
233
- } | undefined;
234
- readonly displayName?: string | undefined;
235
- readonly kind: "shwfed.component.form";
236
- readonly fields: readonly any[];
237
- readonly layouts: readonly {
238
- readonly name: string;
239
- readonly layout: {
240
- readonly style?: string | undefined;
241
- readonly columns: number;
242
- readonly gap?: number | undefined;
243
- readonly rows?: number | undefined;
244
- readonly placements: {
245
- readonly [x: string]: {
246
- readonly area: readonly [readonly [number, number], readonly [number, number]];
247
- readonly v?: "stretch" | "center" | "end" | "start" | undefined;
248
- readonly h?: "stretch" | "center" | "end" | "start" | undefined;
249
- };
250
- };
251
- };
252
- readonly media?: string | undefined;
253
- }[];
254
- readonly readonly?: string | undefined;
255
- } | undefined;
256
- readonly dataSource?: {
257
- readonly data: string;
258
- readonly total?: string | undefined;
259
- readonly request?: string | undefined;
260
- } | undefined;
261
261
  readonly bottomActions?: {
262
262
  readonly size: "default" | "sm" | "xs";
263
263
  readonly style?: string | undefined;
@@ -826,6 +826,40 @@ export declare function createTableConfig(body: Omit<Schema.Schema.Type<ReturnTy
826
826
  readonly message: string;
827
827
  }[]] | undefined;
828
828
  }[];
829
+ query?: {
830
+ readonly style?: string | undefined;
831
+ readonly id?: string | undefined;
832
+ readonly initial?: {
833
+ readonly data: string;
834
+ readonly request?: string | undefined;
835
+ } | undefined;
836
+ readonly displayName?: string | undefined;
837
+ readonly kind: "shwfed.component.form";
838
+ readonly fields: readonly any[];
839
+ readonly layouts: readonly {
840
+ readonly name: string;
841
+ readonly layout: {
842
+ readonly style?: string | undefined;
843
+ readonly columns: number;
844
+ readonly gap?: number | undefined;
845
+ readonly rows?: number | undefined;
846
+ readonly placements: {
847
+ readonly [x: string]: {
848
+ readonly area: readonly [readonly [number, number], readonly [number, number]];
849
+ readonly v?: "stretch" | "center" | "end" | "start" | undefined;
850
+ readonly h?: "stretch" | "center" | "end" | "start" | undefined;
851
+ };
852
+ };
853
+ };
854
+ readonly media?: string | undefined;
855
+ }[];
856
+ readonly readonly?: string | undefined;
857
+ } | undefined;
858
+ dataSource?: {
859
+ readonly data: string;
860
+ readonly total?: string | undefined;
861
+ readonly request?: string | undefined;
862
+ } | undefined;
829
863
  actions?: {
830
864
  readonly size: "default" | "sm" | "xs";
831
865
  readonly style?: string | undefined;
@@ -893,40 +927,6 @@ export declare function createTableConfig(body: Omit<Schema.Schema.Type<ReturnTy
893
927
  readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
894
928
  }[];
895
929
  } | undefined;
896
- query?: {
897
- readonly style?: string | undefined;
898
- readonly id?: string | undefined;
899
- readonly initial?: {
900
- readonly data: string;
901
- readonly request?: string | undefined;
902
- } | undefined;
903
- readonly displayName?: string | undefined;
904
- readonly kind: "shwfed.component.form";
905
- readonly fields: readonly any[];
906
- readonly layouts: readonly {
907
- readonly name: string;
908
- readonly layout: {
909
- readonly style?: string | undefined;
910
- readonly columns: number;
911
- readonly gap?: number | undefined;
912
- readonly rows?: number | undefined;
913
- readonly placements: {
914
- readonly [x: string]: {
915
- readonly area: readonly [readonly [number, number], readonly [number, number]];
916
- readonly v?: "stretch" | "center" | "end" | "start" | undefined;
917
- readonly h?: "stretch" | "center" | "end" | "start" | undefined;
918
- };
919
- };
920
- };
921
- readonly media?: string | undefined;
922
- }[];
923
- readonly readonly?: string | undefined;
924
- } | undefined;
925
- dataSource?: {
926
- readonly data: string;
927
- readonly total?: string | undefined;
928
- readonly request?: string | undefined;
929
- } | undefined;
930
930
  bottomActions?: {
931
931
  readonly size: "default" | "sm" | "xs";
932
932
  readonly style?: string | undefined;
@@ -9,6 +9,7 @@ type __VLS_Props = {
9
9
  placeholder?: string;
10
10
  scopeLookup: Map<string, ScopeInfo>;
11
11
  selectionLookup: Map<string, string>;
12
+ optionLookup: Map<string, string>;
12
13
  stepLookup: Map<string, StepChipInfo>;
13
14
  };
14
15
  declare function insertAtSelection(text: string): void;
@@ -6,6 +6,7 @@ import { onBeforeUnmount, onMounted, useTemplateRef, watch } from "vue";
6
6
  import { cn } from "../../../utils/cn";
7
7
  import { celHighlighting } from "./cel-language";
8
8
  import { scopeChips, scopeLookupFacet } from "./chip-extension";
9
+ import { optionChips, optionLookupFacet } from "./option-chip-extension";
9
10
  import { selectionChips, selectionLookupFacet } from "./selection-chip-extension";
10
11
  import { stepChips, stepLookupFacet } from "./step-chip-extension";
11
12
  defineOptions({ name: "UiCodeMirrorInput" });
@@ -17,6 +18,7 @@ const props = defineProps({
17
18
  placeholder: { type: String, required: false },
18
19
  scopeLookup: { type: Map, required: true },
19
20
  selectionLookup: { type: Map, required: true },
21
+ optionLookup: { type: Map, required: true },
20
22
  stepLookup: { type: Map, required: true }
21
23
  });
22
24
  const emits = defineEmits(["update:modelValue"]);
@@ -24,6 +26,7 @@ const host = useTemplateRef("host");
24
26
  let view = null;
25
27
  const lookupCompartment = new Compartment();
26
28
  const selectionLookupCompartment = new Compartment();
29
+ const optionLookupCompartment = new Compartment();
27
30
  const stepLookupCompartment = new Compartment();
28
31
  const modeCompartment = new Compartment();
29
32
  let applyingExternal = false;
@@ -80,6 +83,7 @@ function makeState(doc) {
80
83
  cmPlaceholder(props.placeholder ?? ""),
81
84
  lookupCompartment.of(scopeLookupFacet.of(props.scopeLookup)),
82
85
  selectionLookupCompartment.of(selectionLookupFacet.of(props.selectionLookup)),
86
+ optionLookupCompartment.of(optionLookupFacet.of(props.optionLookup)),
83
87
  stepLookupCompartment.of(stepLookupFacet.of(props.stepLookup)),
84
88
  modeCompartment.of(modeExtension(!!props.multiline)),
85
89
  editorTheme,
@@ -89,6 +93,7 @@ function makeState(doc) {
89
93
  celHighlighting(),
90
94
  scopeChips(),
91
95
  selectionChips(),
96
+ optionChips(),
92
97
  stepChips(),
93
98
  EditorView.contentAttributes.of({ "aria-label": props.placeholder ?? "Expression" }),
94
99
  EditorView.updateListener.of((update) => {
@@ -123,6 +128,9 @@ watch(() => props.scopeLookup, (lookup) => {
123
128
  watch(() => props.selectionLookup, (lookup) => {
124
129
  view?.dispatch({ effects: selectionLookupCompartment.reconfigure(selectionLookupFacet.of(lookup)) });
125
130
  });
131
+ watch(() => props.optionLookup, (lookup) => {
132
+ view?.dispatch({ effects: optionLookupCompartment.reconfigure(optionLookupFacet.of(lookup)) });
133
+ });
126
134
  watch(() => props.stepLookup, (lookup) => {
127
135
  view?.dispatch({ effects: stepLookupCompartment.reconfigure(stepLookupFacet.of(lookup)) });
128
136
  });
@@ -9,6 +9,7 @@ type __VLS_Props = {
9
9
  placeholder?: string;
10
10
  scopeLookup: Map<string, ScopeInfo>;
11
11
  selectionLookup: Map<string, string>;
12
+ optionLookup: Map<string, string>;
12
13
  stepLookup: Map<string, StepChipInfo>;
13
14
  };
14
15
  declare function insertAtSelection(text: string): void;
@@ -13,12 +13,13 @@ type __VLS_Props = {
13
13
  resultType?: string | string[];
14
14
  extraVars?: Record<string, VarSpec>;
15
15
  unlistedVarsAreDyn?: boolean;
16
+ excludeVars?: string[];
16
17
  };
17
- declare var __VLS_13: {}, __VLS_171: {};
18
+ declare var __VLS_13: {}, __VLS_192: {};
18
19
  type __VLS_Slots = {} & {
19
20
  leading?: (props: typeof __VLS_13) => any;
20
21
  } & {
21
- trailing?: (props: typeof __VLS_171) => any;
22
+ trailing?: (props: typeof __VLS_192) => any;
22
23
  };
23
24
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
24
25
  "update:modelValue": (payload: string) => any;
@@ -2,13 +2,13 @@
2
2
  import { Icon } from "@iconify/vue";
3
3
  import { computed, ref, useSlots, useTemplateRef, watch } from "vue";
4
4
  import { buildCheckEnvironment, evaluateExpression } from "../../../share/expression";
5
- import { injectCELContext, useScopeAncestry, useSelectionRoster, useStepRoster } from "../../../utils/cel-context";
5
+ import { OPTIONS_VAR, SELECTIONS_VAR, injectCELContext, useScopeAncestry, useSelectionRoster, useStepRoster } from "../../../utils/cel-context";
6
6
  import { Markdown } from "../markdown";
7
7
  import CodeMirrorInput from "./CodeMirrorInput.vue";
8
8
  import { buildScopeLookup } from "./scope-refs";
9
9
  import { buildSelectionLookup } from "./selection-refs";
10
10
  import { buildStepLookup } from "./step-refs";
11
- import { buildScopeEntries, buildSelectionEntries, buildStepEntries, buildVarEntries, selectShadowedScopes } from "./picker-entries";
11
+ import { buildOptionEntries, buildScopeEntries, buildSelectionEntries, buildStepEntries, buildVarEntries, selectShadowedScopes } from "./picker-entries";
12
12
  import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "../command";
13
13
  import { InputGroup, InputGroupAddon, InputGroupButton } from "../input-group";
14
14
  import { Popover, PopoverContent, PopoverTrigger } from "../popover";
@@ -21,24 +21,41 @@ const props = defineProps({
21
21
  placeholder: { type: String, required: false },
22
22
  resultType: { type: [String, Array], required: false },
23
23
  extraVars: { type: Object, required: false },
24
- unlistedVarsAreDyn: { type: Boolean, required: false }
24
+ unlistedVarsAreDyn: { type: Boolean, required: false },
25
+ excludeVars: { type: Array, required: false }
25
26
  });
26
27
  const emits = defineEmits(["update:modelValue"]);
27
28
  const celContext = injectCELContext();
28
29
  const scopeAncestry = useScopeAncestry();
29
30
  const selectionRoster = useSelectionRoster();
30
31
  const stepRoster = useStepRoster();
31
- const varEntries = computed(() => buildVarEntries(celContext, props.extraVars));
32
+ const excludedVars = computed(() => new Set(props.excludeVars ?? []));
33
+ const varEntries = computed(
34
+ () => buildVarEntries(celContext, props.extraVars).filter((e) => !excludedVars.value.has(e.id))
35
+ );
32
36
  const scopeEntries = computed(() => buildScopeEntries(selectShadowedScopes(scopeAncestry.value)));
33
- const selectionEntries = computed(() => buildSelectionEntries(selectionRoster.value));
37
+ const selectionEntries = computed(
38
+ () => excludedVars.value.has(SELECTIONS_VAR) ? [] : buildSelectionEntries(selectionRoster.value)
39
+ );
40
+ const optionEntries = computed(
41
+ () => excludedVars.value.has(OPTIONS_VAR) ? [] : buildOptionEntries(selectionRoster.value)
42
+ );
34
43
  const stepEntries = computed(() => buildStepEntries(stepRoster.value));
35
44
  const scopeLookup = computed(() => buildScopeLookup(scopeAncestry.value));
36
- const selectionLookup = computed(() => buildSelectionLookup(selectionRoster.value));
45
+ const selectionLookup = computed(
46
+ () => excludedVars.value.has(SELECTIONS_VAR) ? /* @__PURE__ */ new Map() : buildSelectionLookup(selectionRoster.value)
47
+ );
48
+ const optionLookup = computed(
49
+ () => excludedVars.value.has(OPTIONS_VAR) ? /* @__PURE__ */ new Map() : buildSelectionLookup(selectionRoster.value)
50
+ );
37
51
  const stepLookup = computed(() => buildStepLookup(stepRoster.value));
38
- const hasVars = computed(() => varEntries.value.length > 0 || scopeEntries.value.length > 0 || selectionEntries.value.length > 0 || stepEntries.value.length > 0);
52
+ const hasVars = computed(() => varEntries.value.length > 0 || scopeEntries.value.length > 0 || selectionEntries.value.length > 0 || optionEntries.value.length > 0 || stepEntries.value.length > 0);
39
53
  const checkEnvironment = computed(() => {
40
54
  const vars = /* @__PURE__ */ new Map();
41
- for (const [name, entry] of Object.entries(celContext)) vars.set(name, entry.type);
55
+ for (const [name, entry] of Object.entries(celContext)) {
56
+ if (excludedVars.value.has(name)) continue;
57
+ vars.set(name, entry.type);
58
+ }
42
59
  for (const [name, spec] of Object.entries(props.extraVars ?? {})) vars.set(name, spec.type);
43
60
  return buildCheckEnvironment(
44
61
  [...vars].map(([name, type]) => ({ name, type })),
@@ -55,6 +72,7 @@ const entries = ref([]);
55
72
  const shownVars = computed(() => entries.value.filter((e) => e.group === "var"));
56
73
  const shownScopes = computed(() => entries.value.filter((e) => e.group === "scope"));
57
74
  const shownSelections = computed(() => entries.value.filter((e) => e.group === "selection"));
75
+ const shownOptions = computed(() => entries.value.filter((e) => e.group === "option"));
58
76
  const shownSteps = computed(() => entries.value.filter((e) => e.group === "step"));
59
77
  const hoveredName = ref(null);
60
78
  const editorRef = useTemplateRef("editor");
@@ -64,7 +82,7 @@ function insertVariable(text) {
64
82
  }
65
83
  watch(open, (v) => {
66
84
  if (v) {
67
- entries.value = [...varEntries.value, ...selectionEntries.value, ...stepEntries.value, ...scopeEntries.value];
85
+ entries.value = [...varEntries.value, ...selectionEntries.value, ...optionEntries.value, ...stepEntries.value, ...scopeEntries.value];
68
86
  hoveredName.value = entries.value[0]?.id ?? null;
69
87
  }
70
88
  });
@@ -102,6 +120,7 @@ const addonAlign = computed(
102
120
  :multiline="props.multiline"
103
121
  :scope-lookup="scopeLookup"
104
122
  :selection-lookup="selectionLookup"
123
+ :option-lookup="optionLookup"
105
124
  :step-lookup="stepLookup"
106
125
  :class="props.class"
107
126
  @update:model-value="(v) => emits('update:modelValue', v)"
@@ -176,6 +195,29 @@ const addonAlign = computed(
176
195
  </span>
177
196
  </CommandItem>
178
197
  </CommandGroup>
198
+ <CommandGroup
199
+ v-if="shownOptions.length > 0"
200
+ heading="全部选项"
201
+ >
202
+ <CommandItem
203
+ v-for="entry in shownOptions"
204
+ :key="entry.id"
205
+ :value="`${entry.display} ${entry.id}`"
206
+ class="cursor-pointer gap-2"
207
+ @select="insertVariable(entry.insert)"
208
+ @mouseenter="hoveredName = entry.id"
209
+ @focus="hoveredName = entry.id"
210
+ >
211
+ <Icon
212
+ icon="fluent:list-20-regular"
213
+ class="size-3.5 shrink-0 text-amber-500"
214
+ />
215
+ <span class="flex-1 truncate text-xs text-zinc-700">{{ entry.display }}</span>
216
+ <span class="rounded bg-amber-100 px-1.5 py-0.5 font-mono text-[10px] leading-none text-amber-700 select-none">
217
+ {{ entry.type }}
218
+ </span>
219
+ </CommandItem>
220
+ </CommandGroup>
179
221
  <CommandGroup
180
222
  v-if="shownSteps.length > 0"
181
223
  heading="前序步骤"
@@ -13,12 +13,13 @@ type __VLS_Props = {
13
13
  resultType?: string | string[];
14
14
  extraVars?: Record<string, VarSpec>;
15
15
  unlistedVarsAreDyn?: boolean;
16
+ excludeVars?: string[];
16
17
  };
17
- declare var __VLS_13: {}, __VLS_171: {};
18
+ declare var __VLS_13: {}, __VLS_192: {};
18
19
  type __VLS_Slots = {} & {
19
20
  leading?: (props: typeof __VLS_13) => any;
20
21
  } & {
21
- trailing?: (props: typeof __VLS_171) => any;
22
+ trailing?: (props: typeof __VLS_192) => any;
22
23
  };
23
24
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
24
25
  "update:modelValue": (payload: string) => any;
@@ -0,0 +1,4 @@
1
+ import { type Extension, Facet } from '@codemirror/state';
2
+ export declare const optionLookupFacet: Facet<Map<string, string>, Map<string, string>>;
3
+ /** The full option inline-chip extension: decoration plugin + theme. */
4
+ export declare function optionChips(): Extension;
@@ -0,0 +1,119 @@
1
+ import { Facet, RangeSetBuilder } from "@codemirror/state";
2
+ import {
3
+ Decoration,
4
+ EditorView,
5
+ ViewPlugin,
6
+ WidgetType
7
+ } from "@codemirror/view";
8
+ import { scanOptionRefs } from "./option-refs.js";
9
+ export const optionLookupFacet = Facet.define({
10
+ combine: (values) => values.length > 0 ? values[values.length - 1] : /* @__PURE__ */ new Map()
11
+ });
12
+ class OptionChipWidget extends WidgetType {
13
+ constructor(id, name) {
14
+ super();
15
+ this.id = id;
16
+ this.name = name;
17
+ }
18
+ eq(other) {
19
+ return other.id === this.id && other.name === this.name;
20
+ }
21
+ toDOM() {
22
+ const chip = document.createElement("span");
23
+ chip.className = "cm-option-chip";
24
+ chip.setAttribute("data-option-id", this.id);
25
+ const tag = document.createElement("span");
26
+ tag.className = "cm-option-chip-tag";
27
+ tag.textContent = "\u5168\u90E8\u9009\u9879";
28
+ chip.appendChild(tag);
29
+ const text = document.createElement("span");
30
+ text.className = "cm-option-chip-label";
31
+ if (this.name !== null) {
32
+ text.textContent = this.name;
33
+ chip.title = `\u5168\u90E8\u9009\u9879 \xB7 ${this.name}`;
34
+ } else {
35
+ chip.classList.add("cm-option-chip-dangling");
36
+ const short = this.id.length > 8 ? `${this.id.slice(0, 8)}\u2026` : this.id;
37
+ text.textContent = short;
38
+ chip.title = `\u672A\u77E5\u5B57\u6BB5 ${this.id}`;
39
+ }
40
+ chip.appendChild(text);
41
+ return chip;
42
+ }
43
+ ignoreEvent() {
44
+ return false;
45
+ }
46
+ }
47
+ function buildChips(view) {
48
+ const lookup = view.state.facet(optionLookupFacet);
49
+ const builder = new RangeSetBuilder();
50
+ for (const ref of scanOptionRefs(view.state.doc.toString())) {
51
+ const name = lookup.get(ref.id) ?? null;
52
+ builder.add(
53
+ ref.from,
54
+ ref.to,
55
+ Decoration.replace({ widget: new OptionChipWidget(ref.id, name) })
56
+ );
57
+ }
58
+ return builder.finish();
59
+ }
60
+ const chipPlugin = ViewPlugin.fromClass(
61
+ class {
62
+ decorations;
63
+ constructor(view) {
64
+ this.decorations = buildChips(view);
65
+ }
66
+ update(update) {
67
+ if (update.docChanged || update.viewportChanged || update.startState.facet(optionLookupFacet) !== update.state.facet(optionLookupFacet)) {
68
+ this.decorations = buildChips(update.view);
69
+ }
70
+ }
71
+ },
72
+ {
73
+ decorations: (plugin) => plugin.decorations,
74
+ // Atomic so the caret steps over a chip and Backspace removes the whole
75
+ // `options["id"]` at once — matching the selection chip's delete-as-unit feel.
76
+ provide: (plugin) => EditorView.atomicRanges.of((view) => view.plugin(plugin)?.decorations ?? Decoration.none)
77
+ }
78
+ );
79
+ const chipTheme = EditorView.theme({
80
+ ".cm-option-chip": {
81
+ display: "inline-flex",
82
+ alignItems: "center",
83
+ gap: "0.25rem",
84
+ margin: "0 1px",
85
+ padding: "0.125rem 0.25rem",
86
+ borderRadius: "0.25rem",
87
+ background: "#fffbeb",
88
+ border: "1px solid #fde68a",
89
+ color: "#b45309",
90
+ fontFamily: "ui-sans-serif, system-ui, sans-serif",
91
+ verticalAlign: "baseline",
92
+ cursor: "default",
93
+ whiteSpace: "nowrap"
94
+ },
95
+ ".cm-option-chip-dangling": {
96
+ background: "#fef2f2",
97
+ borderColor: "#fecaca",
98
+ color: "#b91c1c"
99
+ },
100
+ ".cm-option-chip-tag": {
101
+ borderRadius: "0.125rem",
102
+ background: "#fef3c7",
103
+ padding: "0.05rem 0.2rem",
104
+ fontSize: "9px",
105
+ lineHeight: "1",
106
+ color: "#d97706"
107
+ },
108
+ ".cm-option-chip-dangling .cm-option-chip-tag": {
109
+ background: "#fee2e2",
110
+ color: "#b91c1c"
111
+ },
112
+ ".cm-option-chip-label": {
113
+ fontSize: "0.75rem",
114
+ lineHeight: "1.1"
115
+ }
116
+ });
117
+ export function optionChips() {
118
+ return [chipPlugin, chipTheme];
119
+ }
@@ -0,0 +1,6 @@
1
+ export type OptionRef = {
2
+ from: number;
3
+ to: number;
4
+ id: string;
5
+ };
6
+ export declare function scanOptionRefs(text: string): OptionRef[];
@@ -0,0 +1,24 @@
1
+ import { OPTIONS_VAR } from "../../../utils/cel-context.js";
2
+ const OPTION_REF_RE = new RegExp(
3
+ `(?<![\\w$.])${OPTIONS_VAR}\\[\\??("(?:[^"\\\\]|\\\\.)*")\\]`,
4
+ "g"
5
+ );
6
+ export function scanOptionRefs(text) {
7
+ const out = [];
8
+ OPTION_REF_RE.lastIndex = 0;
9
+ let match;
10
+ while ((match = OPTION_REF_RE.exec(text)) !== null) {
11
+ let id;
12
+ try {
13
+ id = JSON.parse(match[1]);
14
+ } catch {
15
+ continue;
16
+ }
17
+ out.push({
18
+ from: match.index,
19
+ to: match.index + match[0].length,
20
+ id
21
+ });
22
+ }
23
+ return out;
24
+ }
@@ -1,7 +1,7 @@
1
1
  import { type ScopeAncestor, type SelectionFieldRef, type StepRef } from '../../../utils/cel-context.js';
2
2
  export type PickEntry = {
3
3
  id: string;
4
- group: 'var' | 'scope' | 'selection' | 'step';
4
+ group: 'var' | 'scope' | 'selection' | 'option' | 'step';
5
5
  insert: string;
6
6
  display: string;
7
7
  label: string;
@@ -15,6 +15,7 @@ export type PickVarMeta = {
15
15
  };
16
16
  export declare function buildVarEntries(celContext: Record<string, PickVarMeta>, extraVars?: Record<string, PickVarMeta>): PickEntry[];
17
17
  export declare function buildSelectionEntries(roster: ReadonlyArray<SelectionFieldRef>): PickEntry[];
18
+ export declare function buildOptionEntries(roster: ReadonlyArray<SelectionFieldRef>): PickEntry[];
18
19
  export declare function buildStepEntries(roster: ReadonlyArray<StepRef>): PickEntry[];
19
20
  export declare function selectShadowedScopes(ancestry: ReadonlyArray<ScopeAncestor>): ScopeAncestor[];
20
21
  export declare function buildScopeEntries(ancestry: ReadonlyArray<ScopeAncestor>): PickEntry[];
@@ -1,6 +1,6 @@
1
- import { SCOPE_ADDRESS_VAR, SELECTIONS_VAR, STEPS_VAR } from "../../../utils/cel-context.js";
1
+ import { OPTIONS_VAR, SCOPE_ADDRESS_VAR, SELECTIONS_VAR, STEPS_VAR } from "../../../utils/cel-context.js";
2
2
  import { scopeOrigin } from "./scope-refs.js";
3
- const SUPPRESSED_VARS = /* @__PURE__ */ new Set([SCOPE_ADDRESS_VAR, SELECTIONS_VAR, STEPS_VAR]);
3
+ const SUPPRESSED_VARS = /* @__PURE__ */ new Set([SCOPE_ADDRESS_VAR, SELECTIONS_VAR, OPTIONS_VAR, STEPS_VAR]);
4
4
  export function buildVarEntries(celContext, extraVars) {
5
5
  const out = [];
6
6
  const seen = /* @__PURE__ */ new Set();
@@ -25,6 +25,16 @@ export function buildSelectionEntries(roster) {
25
25
  type: "dyn"
26
26
  }));
27
27
  }
28
+ export function buildOptionEntries(roster) {
29
+ return roster.map((field) => ({
30
+ id: `option:${field.id}`,
31
+ group: "option",
32
+ insert: `${OPTIONS_VAR}[?${JSON.stringify(field.id)}]`,
33
+ display: field.name,
34
+ label: "\u5168\u90E8\u9009\u9879",
35
+ type: "dyn"
36
+ }));
37
+ }
28
38
  export function buildStepEntries(roster) {
29
39
  return roster.filter((step) => step.valid).map((step) => ({
30
40
  id: `step:${step.id}`,