@shwfed/config 2.9.13 → 2.10.1

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 (156) hide show
  1. package/dist/mcp.mjs +5020 -3637
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/{FieldGroup.vue_vue_type_script_setup_true_lang-DZ_H-YRf.js → FieldGroup.vue_vue_type_script_setup_true_lang-CuFusz5A.js} +1 -1
  4. package/dist/preview/assets/{badge-DoNuZh0A.js → badge-D5FPHSix.js} +1 -1
  5. package/dist/preview/assets/{config-DTEJOYqA.js → config-BHPiQ1lB.js} +1 -1
  6. package/dist/preview/assets/{config-C6Cm7DWx.js → config-BWC-Zw21.js} +1 -1
  7. package/dist/preview/assets/{config-YGBoSq6x.js → config-Bg94Z7XN.js} +1 -1
  8. package/dist/preview/assets/{config-CLsjWZz2.js → config-BqSL4UAL.js} +1 -1
  9. package/dist/preview/assets/{config-ugF_BOWz.js → config-CeRBpZbE.js} +1 -1
  10. package/dist/preview/assets/{config-BDDuqAht.js → config-CfjcFb_E.js} +1 -1
  11. package/dist/preview/assets/{config-Bhc_Vu67.js → config-DNUKa3lN.js} +1 -1
  12. package/dist/preview/assets/{config-D4rFsdGO.js → config-DVjZmomc.js} +1 -1
  13. package/dist/preview/assets/{config-tdZMdIN3.js → config-Djv6EQBY.js} +1 -1
  14. package/dist/preview/assets/{config-CIYui2J_.js → config-PNpa6ENz.js} +1 -1
  15. package/dist/preview/assets/{config-Cla0Qngs.js → config-ucxtM3wX.js} +1 -1
  16. package/dist/preview/assets/{config-BrNZsgV0.js → config-urZuasV7.js} +1 -1
  17. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-CgNXv26P.js → definition.vue_vue_type_script_setup_true_lang-BzryfjdG.js} +1 -1
  18. package/dist/preview/assets/index-BE9O1XgB.js +1 -0
  19. package/dist/preview/assets/{index-CzzwZ7bp.css → index-BnJ5p1Mx.css} +1 -1
  20. package/dist/preview/assets/{index-C3FdepLE.js → index-DCRQGu0g.js} +1 -1
  21. package/dist/preview/assets/index-yvElpEK3.js +743 -0
  22. package/dist/preview/assets/{item-DecwNzYq.js → item-CTkdtkvl.js} +1 -1
  23. package/dist/preview/assets/{runtime-DtP98Km5.js → runtime-3rajYvjp.js} +1 -1
  24. package/dist/preview/assets/{runtime-C8Ufkmiw.js → runtime-4A3oiig9.js} +1 -1
  25. package/dist/preview/assets/{runtime-blb90Fhv.js → runtime-BOGZFWxF.js} +1 -1
  26. package/dist/preview/assets/{runtime-BK7KNEyN.js → runtime-BqroTX7H.js} +1 -1
  27. package/dist/preview/assets/{runtime-DSUjc0Pk.js → runtime-CBBae0-H.js} +1 -1
  28. package/dist/preview/assets/{runtime-CYpXd7Pq.js → runtime-CBuV3vwL.js} +1 -1
  29. package/dist/preview/assets/{runtime-CjPtRd-T.js → runtime-CI8yzwXd.js} +1 -1
  30. package/dist/preview/assets/{runtime-C5hqSHRW.js → runtime-CcyhgOum.js} +1 -1
  31. package/dist/preview/assets/{runtime-C3dmOj9s.js → runtime-CkQ-mNoH.js} +1 -1
  32. package/dist/preview/assets/{runtime-DZ_AwduQ.js → runtime-DmxKfudS.js} +1 -1
  33. package/dist/preview/assets/{schema-meta-DWUHNP8E.js → schema-meta-BFzIzGiN.js} +1 -1
  34. package/dist/preview/index.html +2 -2
  35. package/dist/runtime/components/actions/components/triggers-field.vue +12 -12
  36. package/dist/runtime/components/config/use-editor.js +1 -1
  37. package/dist/runtime/components/config/utils/validation-error.d.ts +1 -1
  38. package/dist/runtime/components/config/utils/validation-error.js +40 -7
  39. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.markdown/runtime.vue +3 -3
  40. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/runtime.vue +6 -5
  41. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/runtime.vue +6 -5
  42. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/runtime.vue +10 -8
  43. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/runtime.vue +8 -6
  44. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/runtime.vue +10 -8
  45. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/runtime.vue +8 -6
  46. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/runtime.vue +10 -8
  47. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/runtime.vue +7 -5
  48. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/runtime.vue +8 -6
  49. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/runtime.vue +7 -6
  50. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/runtime.vue +9 -7
  51. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/runtime.vue +4 -3
  52. package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/runtime.vue +8 -6
  53. package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/runtime.vue +5 -4
  54. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/runtime.vue +12 -10
  55. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/runtime.vue +5 -4
  56. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/runtime.vue +9 -7
  57. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/runtime.vue +9 -7
  58. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.vue +13 -15
  59. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/runtime.vue +8 -6
  60. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/runtime.vue +10 -8
  61. package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/runtime.vue +10 -8
  62. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/runtime.vue +13 -14
  63. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/runtime.vue +13 -14
  64. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue +14 -12
  65. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue +14 -12
  66. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue +13 -14
  67. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue +13 -14
  68. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue +13 -15
  69. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue +15 -16
  70. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/runtime.vue +8 -7
  71. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/config.d.vue.ts +175 -0
  72. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/config.vue +782 -0
  73. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/config.vue.d.ts +175 -0
  74. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/runtime.d.vue.ts +8 -0
  75. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/runtime.vue +413 -0
  76. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/runtime.vue.d.ts +8 -0
  77. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/schema.d.ts +214 -0
  78. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/schema.js +191 -0
  79. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/config.d.vue.ts +175 -0
  80. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/config.vue +782 -0
  81. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/config.vue.d.ts +175 -0
  82. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/runtime.d.vue.ts +8 -0
  83. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/runtime.vue +426 -0
  84. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/runtime.vue.d.ts +8 -0
  85. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/schema.d.ts +214 -0
  86. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/schema.js +191 -0
  87. package/dist/runtime/components/form/fields/2026-06-14/combobox-migrate.d.ts +18 -0
  88. package/dist/runtime/components/form/fields/2026-06-14/combobox-migrate.js +36 -0
  89. package/dist/runtime/components/form/utils/state.d.ts +11 -0
  90. package/dist/runtime/components/form/utils/state.js +5 -0
  91. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/runtime.vue +5 -1
  92. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/runtime.vue +16 -3
  93. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/runtime.vue +5 -1
  94. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/runtime.vue +5 -1
  95. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/runtime.vue +17 -3
  96. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/runtime.vue +5 -1
  97. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/runtime.vue +5 -1
  98. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.vue +5 -1
  99. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.vue +5 -1
  100. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/runtime.vue +5 -1
  101. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/runtime.vue +5 -1
  102. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.vue +5 -1
  103. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/runtime.vue +5 -1
  104. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/runtime.vue +5 -1
  105. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/runtime.vue +5 -1
  106. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/runtime.vue +5 -1
  107. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/runtime.vue +5 -1
  108. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.vue +5 -1
  109. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/runtime.vue +5 -1
  110. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/runtime.vue +5 -1
  111. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.d.vue.ts +179 -0
  112. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue +942 -0
  113. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue.d.ts +179 -0
  114. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/runtime.d.vue.ts +9 -0
  115. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/runtime.vue +499 -0
  116. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/runtime.vue.d.ts +9 -0
  117. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/schema.d.ts +223 -0
  118. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/schema.js +276 -0
  119. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.d.vue.ts +179 -0
  120. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue +942 -0
  121. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue.d.ts +179 -0
  122. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/runtime.d.vue.ts +9 -0
  123. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/runtime.vue +438 -0
  124. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/runtime.vue.d.ts +9 -0
  125. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/schema.d.ts +223 -0
  126. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/schema.js +276 -0
  127. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +123 -0
  128. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue +646 -0
  129. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +123 -0
  130. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/runtime.d.vue.ts +9 -0
  131. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/runtime.vue +500 -0
  132. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/runtime.vue.d.ts +9 -0
  133. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +83 -0
  134. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/schema.js +179 -0
  135. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +121 -0
  136. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue +577 -0
  137. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +121 -0
  138. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/runtime.d.vue.ts +9 -0
  139. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/runtime.vue +465 -0
  140. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/runtime.vue.d.ts +9 -0
  141. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/schema.d.ts +80 -0
  142. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/schema.js +171 -0
  143. package/dist/runtime/components/table/columns/2026-06-14/combobox-migrate.d.ts +18 -0
  144. package/dist/runtime/components/table/columns/2026-06-14/combobox-migrate.js +36 -0
  145. package/dist/runtime/components/table/columns/2026-06-14/tree-combobox-shared.d.ts +35 -0
  146. package/dist/runtime/components/table/columns/2026-06-14/tree-combobox-shared.js +31 -0
  147. package/dist/runtime/components/table/index.d.vue.ts +2 -0
  148. package/dist/runtime/components/table/index.vue +24 -0
  149. package/dist/runtime/components/table/index.vue.d.ts +2 -0
  150. package/dist/runtime/components/table/utils/shared.d.ts +1 -0
  151. package/dist/runtime/components/table/utils/shared.js +7 -13
  152. package/dist/runtime/components/ui/input-group/InputGroupNumberField.vue +1 -1
  153. package/dist/runtime/share/expression.js +1 -0
  154. package/package.json +1 -1
  155. package/dist/preview/assets/index-B-QhiviS.js +0 -1
  156. package/dist/preview/assets/index-CWMhB7z4.js +0 -735
@@ -0,0 +1,646 @@
1
+ <script setup>
2
+ import { computed, ref, watch } from "vue";
3
+ import { Icon } from "@iconify/vue";
4
+ import { ExpressionEditor } from "../../../../ui/expression-editor";
5
+ import { Field, FieldLabel } from "../../../../ui/field";
6
+ import {
7
+ InputGroup,
8
+ InputGroupAddon,
9
+ InputGroupButton,
10
+ InputGroupInput,
11
+ InputGroupNumberField
12
+ } from "../../../../ui/input-group";
13
+ import { Locale as LocaleField } from "../../../../ui/locale";
14
+ import { Markdown } from "../../../../ui/markdown";
15
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../../../ui/select";
16
+ import { Separator } from "../../../../ui/separator";
17
+ import { Switch } from "../../../../ui/switch";
18
+ import DerivedValueEditor from "../../../../form/DerivedValueEditor.vue";
19
+ import { DataSource } from "../../../schema";
20
+ import { getStructFieldDescription, getStructFieldTitle } from "../../../utils/schema-meta";
21
+ import { schema } from "./schema";
22
+ defineOptions({ name: "ShwfedTableTreeComboboxMultiRendererConfig" });
23
+ const value = defineModel({ type: null, ...{ required: true } });
24
+ const fieldSchema = schema(() => {
25
+ });
26
+ const fieldTitle = (f) => getStructFieldTitle(fieldSchema, f) ?? f;
27
+ const fieldDescription = (f) => getStructFieldDescription(fieldSchema, f);
28
+ const dataSourceSchema = DataSource(() => {
29
+ });
30
+ const dataSourceFieldTitle = (f) => getStructFieldTitle(dataSourceSchema, f) ?? f;
31
+ const dataSourceFieldDescription = (f) => getStructFieldDescription(dataSourceSchema, f);
32
+ const ROW_VARS = {
33
+ row: { type: "dyn", label: "\u5F53\u524D\u884C\u6570\u636E" },
34
+ index: { type: "number", label: "\u884C\u7D22\u5F15" }
35
+ };
36
+ const ROW_NODE_VARS = {
37
+ ...ROW_VARS,
38
+ node: {
39
+ type: "dyn",
40
+ label: "\u5F53\u524D\u8282\u70B9",
41
+ description: "\u7531 `\u6570\u636E` \u8868\u8FBE\u5F0F\u8FD4\u56DE\u7684\u6BCF\u4E00\u9879\uFF1B\u7C7B\u578B\u5728\u914D\u7F6E\u65F6\u672A\u77E5\uFF08`dyn`\uFF09"
42
+ }
43
+ };
44
+ const ROW_JSON_VARS = {
45
+ ...ROW_VARS,
46
+ json: {
47
+ type: "optional<dyn>",
48
+ label: "HTTP \u54CD\u5E94\u4F53",
49
+ description: "\u5DF2\u89E3\u6790\u7684 JSON \u54CD\u5E94\uFF1B\u672A\u914D\u7F6E `request` \u65F6\u4E3A `none`"
50
+ }
51
+ };
52
+ const CASCADE_OPTIONS = [
53
+ {
54
+ value: "independent",
55
+ label: "\u72EC\u7ACB",
56
+ description: "\u52FE\u9009 / \u53D6\u6D88\u53EA\u4F5C\u7528\u4E8E\u5F53\u524D\u8282\u70B9\uFF1B\u7236\u5B50\u4E92\u4E0D\u5F71\u54CD"
57
+ },
58
+ {
59
+ value: "cascade-down",
60
+ label: "\u5411\u4E0B\u7EA7\u8054",
61
+ description: "\u52FE\u9009\u7236\u8282\u70B9\u81EA\u52A8\u52FE\u9009\u5176\u5168\u90E8\u53EF\u9009\u540E\u4EE3\uFF1B\u53D6\u6D88\u65F6\u540C\u7406\u3002\u7236\u8282\u70B9\u7684\u52FE\u9009\u72B6\u6001\u72EC\u7ACB\u8FFD\u8E2A"
62
+ },
63
+ {
64
+ value: "cascade-both",
65
+ label: "\u53CC\u5411\u7EA7\u8054",
66
+ description: "\u5728\u5411\u4E0B\u7EA7\u8054\u57FA\u7840\u4E0A\uFF0C\u7236\u8282\u70B9\u53CD\u6620\u540E\u4EE3\u52FE\u9009\u72B6\u6001\uFF08\u5168\u9009\u2192\u9009\u4E2D\u3001\u90E8\u5206\u2192\u534A\u9009\u3001\u5168\u4E0D\u9009\u2192\u672A\u9009\uFF09"
67
+ }
68
+ ];
69
+ const cascadeOpen = ref(false);
70
+ const hoveredCascade = ref(null);
71
+ watch(cascadeOpen, (isOpen) => {
72
+ hoveredCascade.value = isOpen ? value.value.cascade ?? "independent" : null;
73
+ });
74
+ const hoveredCascadeDescription = computed(
75
+ () => CASCADE_OPTIONS.find((o) => o.value === hoveredCascade.value)?.description
76
+ );
77
+ const bindingText = computed({
78
+ get: () => value.value.binding ?? "",
79
+ set: (v) => {
80
+ const trimmed = v.trim();
81
+ if (trimmed === "") {
82
+ const { binding: _omit, ...rest } = value.value;
83
+ value.value = rest;
84
+ } else {
85
+ value.value = { ...value.value, binding: trimmed };
86
+ }
87
+ }
88
+ });
89
+ function setOptionalExpression(key, next) {
90
+ if (next.length === 0) {
91
+ const { [key]: _omit, ...rest } = value.value;
92
+ value.value = rest;
93
+ } else {
94
+ value.value = { ...value.value, [key]: next };
95
+ }
96
+ }
97
+ function setDataSourceData(next) {
98
+ value.value = {
99
+ ...value.value,
100
+ dataSource: { ...value.value.dataSource, data: next }
101
+ };
102
+ }
103
+ function setDataSourceRequest(next) {
104
+ const trimmed = next.trim();
105
+ if (trimmed.length === 0) {
106
+ const { request: _omit, ...rest } = value.value.dataSource;
107
+ value.value = { ...value.value, dataSource: rest };
108
+ } else {
109
+ value.value = {
110
+ ...value.value,
111
+ dataSource: { ...value.value.dataSource, request: next }
112
+ };
113
+ }
114
+ }
115
+ const derivedModel = computed({
116
+ get: () => value.value.derived,
117
+ set: (v) => {
118
+ if (v == null) {
119
+ const { derived: _omit, ...rest } = value.value;
120
+ value.value = rest;
121
+ } else {
122
+ value.value = { ...value.value, derived: v };
123
+ }
124
+ }
125
+ });
126
+ </script>
127
+
128
+ <template>
129
+ <div class="space-y-5">
130
+ <!-- Identity: title + binding + placeholder + size -->
131
+ <div class="grid grid-cols-2 gap-x-6 gap-y-4">
132
+ <Field orientation="vertical">
133
+ <FieldLabel class="text-xs text-zinc-500">
134
+ <template
135
+ v-if="fieldDescription('title')"
136
+ #tooltip
137
+ >
138
+ <Markdown
139
+ :source="fieldDescription('title')"
140
+ block
141
+ class="prose prose-sm prose-zinc"
142
+ />
143
+ </template>
144
+ {{ fieldTitle("title") }}
145
+ </FieldLabel>
146
+ <LocaleField v-model="value.title" />
147
+ </Field>
148
+ <Field orientation="vertical">
149
+ <FieldLabel class="text-xs text-zinc-500">
150
+ <template
151
+ v-if="fieldDescription('tooltip')"
152
+ #tooltip
153
+ >
154
+ <Markdown
155
+ :source="fieldDescription('tooltip')"
156
+ block
157
+ class="prose prose-sm prose-zinc"
158
+ />
159
+ </template>
160
+ {{ fieldTitle("tooltip") }}
161
+ </FieldLabel>
162
+ <LocaleField
163
+ v-model="value.tooltip"
164
+ markdown
165
+ />
166
+ </Field>
167
+ </div>
168
+ <div class="grid grid-cols-2 gap-x-6 gap-y-4">
169
+ <Field orientation="vertical">
170
+ <FieldLabel class="text-xs text-zinc-500">
171
+ <template
172
+ v-if="fieldDescription('binding')"
173
+ #tooltip
174
+ >
175
+ <Markdown
176
+ :source="fieldDescription('binding')"
177
+ block
178
+ class="prose prose-sm prose-zinc"
179
+ />
180
+ </template>
181
+ {{ fieldTitle("binding") }}
182
+ </FieldLabel>
183
+ <InputGroup>
184
+ <InputGroupInput
185
+ v-model="bindingText"
186
+ placeholder="例:user.departmentIds"
187
+ class="font-mono"
188
+ />
189
+ </InputGroup>
190
+ </Field>
191
+ <Field orientation="vertical">
192
+ <FieldLabel class="text-xs text-zinc-500">
193
+ <template
194
+ v-if="fieldDescription('placeholder')"
195
+ #tooltip
196
+ >
197
+ <Markdown
198
+ :source="fieldDescription('placeholder')"
199
+ block
200
+ class="prose prose-sm prose-zinc"
201
+ />
202
+ </template>
203
+ {{ fieldTitle("placeholder") }}
204
+ </FieldLabel>
205
+ <LocaleField v-model="value.placeholder" />
206
+ </Field>
207
+ <Field orientation="vertical">
208
+ <FieldLabel class="text-xs text-zinc-500">
209
+ <template
210
+ v-if="fieldDescription('size')"
211
+ #tooltip
212
+ >
213
+ <Markdown
214
+ :source="fieldDescription('size')"
215
+ block
216
+ class="prose prose-sm prose-zinc"
217
+ />
218
+ </template>
219
+ {{ fieldTitle("size") }}
220
+ </FieldLabel>
221
+ <InputGroup>
222
+ <InputGroupNumberField
223
+ :model-value="value.size"
224
+ :disabled="value.grow"
225
+ :min="0"
226
+ @update:model-value="(v) => value = { ...value, size: v }"
227
+ />
228
+ <InputGroupAddon align="inline-end">
229
+ <InputGroupButton
230
+ :variant="value.grow ? 'primary' : 'ghost'"
231
+ size="xs"
232
+ @click="value = { ...value, grow: !value.grow }"
233
+ >
234
+ <Icon :icon="value.grow ? 'fluent:lock-closed-20-regular' : 'fluent:arrow-autofit-width-20-regular'" />
235
+ {{ fieldTitle("grow") }}
236
+ </InputGroupButton>
237
+ </InputGroupAddon>
238
+ </InputGroup>
239
+ </Field>
240
+ </div>
241
+
242
+ <!-- 数据源 -->
243
+ <h3 class="text-xs font-medium text-zinc-500">
244
+ {{ fieldTitle("dataSource") }}
245
+ </h3>
246
+
247
+ <Field orientation="vertical">
248
+ <FieldLabel class="text-xs text-zinc-500">
249
+ <template
250
+ v-if="dataSourceFieldDescription('request')"
251
+ #tooltip
252
+ >
253
+ <Markdown
254
+ :source="dataSourceFieldDescription('request')"
255
+ block
256
+ class="prose prose-sm prose-zinc"
257
+ />
258
+ </template>
259
+ {{ dataSourceFieldTitle("request") }}
260
+ </FieldLabel>
261
+ <ExpressionEditor
262
+ :model-value="value.dataSource.request ?? ''"
263
+ placeholder="如 http.get('/api/departments/tree')"
264
+ result-type="HttpRequest"
265
+ :extra-vars="ROW_VARS"
266
+ multiline
267
+ class="min-h-20"
268
+ @update:model-value="setDataSourceRequest"
269
+ />
270
+ </Field>
271
+
272
+ <Field orientation="vertical">
273
+ <FieldLabel class="text-xs text-zinc-500">
274
+ <template
275
+ v-if="dataSourceFieldDescription('data')"
276
+ #tooltip
277
+ >
278
+ <Markdown
279
+ :source="dataSourceFieldDescription('data')"
280
+ block
281
+ class="prose prose-sm prose-zinc"
282
+ />
283
+ </template>
284
+ {{ dataSourceFieldTitle("data") }}
285
+ </FieldLabel>
286
+ <ExpressionEditor
287
+ :model-value="value.dataSource.data"
288
+ placeholder="如 json.?value.roots.orValue([])"
289
+ result-type="list"
290
+ :extra-vars="ROW_JSON_VARS"
291
+ @update:model-value="setDataSourceData"
292
+ />
293
+ </Field>
294
+
295
+ <!-- 节点 -->
296
+ <h3 class="text-xs font-medium text-zinc-500">
297
+ 节点
298
+ </h3>
299
+
300
+ <div class="grid grid-cols-2 gap-3">
301
+ <Field orientation="vertical">
302
+ <FieldLabel class="text-xs text-zinc-500">
303
+ <template
304
+ v-if="fieldDescription('nodeKey')"
305
+ #tooltip
306
+ >
307
+ <Markdown
308
+ :source="fieldDescription('nodeKey')"
309
+ block
310
+ class="prose prose-sm prose-zinc"
311
+ />
312
+ </template>
313
+ {{ fieldTitle("nodeKey") }}
314
+ </FieldLabel>
315
+ <ExpressionEditor
316
+ :model-value="value.nodeKey"
317
+ placeholder="例:string(node.id)"
318
+ :result-type="['string', 'number', 'dyn']"
319
+ :extra-vars="ROW_NODE_VARS"
320
+ class="min-h-10"
321
+ @update:model-value="(v) => value = { ...value, nodeKey: v }"
322
+ />
323
+ </Field>
324
+
325
+ <Field orientation="vertical">
326
+ <FieldLabel class="text-xs text-zinc-500">
327
+ <template
328
+ v-if="fieldDescription('nodeChildren')"
329
+ #tooltip
330
+ >
331
+ <Markdown
332
+ :source="fieldDescription('nodeChildren')"
333
+ block
334
+ class="prose prose-sm prose-zinc"
335
+ />
336
+ </template>
337
+ {{ fieldTitle("nodeChildren") }}
338
+ </FieldLabel>
339
+ <ExpressionEditor
340
+ :model-value="value.nodeChildren"
341
+ placeholder="例:has(node.children) ? node.children : null"
342
+ result-type="list"
343
+ :extra-vars="ROW_NODE_VARS"
344
+ class="min-h-10"
345
+ @update:model-value="(v) => value = { ...value, nodeChildren: v }"
346
+ />
347
+ </Field>
348
+ </div>
349
+
350
+ <div class="grid grid-cols-2 gap-3">
351
+ <Field orientation="vertical">
352
+ <FieldLabel class="text-xs text-zinc-500">
353
+ <template
354
+ v-if="fieldDescription('nodeLabel')"
355
+ #tooltip
356
+ >
357
+ <Markdown
358
+ :source="fieldDescription('nodeLabel')"
359
+ block
360
+ class="prose prose-sm prose-zinc"
361
+ />
362
+ </template>
363
+ {{ fieldTitle("nodeLabel") }}
364
+ </FieldLabel>
365
+ <ExpressionEditor
366
+ :model-value="value.nodeLabel"
367
+ placeholder="如 node.label"
368
+ result-type="dyn"
369
+ :extra-vars="ROW_NODE_VARS"
370
+ @update:model-value="(v) => value = { ...value, nodeLabel: v }"
371
+ />
372
+ </Field>
373
+
374
+ <Field orientation="vertical">
375
+ <FieldLabel class="text-xs text-zinc-500">
376
+ <template
377
+ v-if="fieldDescription('nodeTooltip')"
378
+ #tooltip
379
+ >
380
+ <Markdown
381
+ :source="fieldDescription('nodeTooltip')"
382
+ block
383
+ class="prose prose-sm prose-zinc"
384
+ />
385
+ </template>
386
+ {{ fieldTitle("nodeTooltip") }}
387
+ </FieldLabel>
388
+ <LocaleField
389
+ markdown
390
+ translate-hint="tree node tooltip"
391
+ :model-value="value.nodeTooltip"
392
+ @update:model-value="(v) => value = { ...value, nodeTooltip: v }"
393
+ />
394
+ </Field>
395
+ </div>
396
+
397
+ <!-- 搜索: 额外关键词(节点作用域,返回字符串列表) -->
398
+ <Field orientation="vertical">
399
+ <FieldLabel class="text-xs text-zinc-500">
400
+ <template
401
+ v-if="fieldDescription('keywords')"
402
+ #tooltip
403
+ >
404
+ <Markdown
405
+ :source="fieldDescription('keywords')"
406
+ block
407
+ class="prose prose-sm prose-zinc"
408
+ />
409
+ </template>
410
+ {{ fieldTitle("keywords") }}
411
+ </FieldLabel>
412
+ <ExpressionEditor
413
+ :model-value="value.keywords ?? ''"
414
+ placeholder="例:[node.code, node.pinyin]"
415
+ result-type="list"
416
+ :extra-vars="ROW_NODE_VARS"
417
+ class="min-h-10"
418
+ @update:model-value="(v) => setOptionalExpression('keywords', v)"
419
+ />
420
+ </Field>
421
+
422
+ <!-- 行为: 节点可选条件 + 级联模式 + 默认全部展开 -->
423
+ <div class="grid grid-cols-3 gap-3">
424
+ <Field orientation="vertical">
425
+ <FieldLabel class="text-xs text-zinc-500">
426
+ <template
427
+ v-if="fieldDescription('nodeSelectable')"
428
+ #tooltip
429
+ >
430
+ <Markdown
431
+ :source="fieldDescription('nodeSelectable')"
432
+ block
433
+ class="prose prose-sm prose-zinc"
434
+ />
435
+ </template>
436
+ {{ fieldTitle("nodeSelectable") }}
437
+ </FieldLabel>
438
+ <ExpressionEditor
439
+ :model-value="value.nodeSelectable ?? ''"
440
+ placeholder="例:!has(node.disabled) || !node.disabled"
441
+ result-type="bool"
442
+ :extra-vars="ROW_NODE_VARS"
443
+ class="min-h-10"
444
+ @update:model-value="(v) => setOptionalExpression('nodeSelectable', v)"
445
+ />
446
+ </Field>
447
+
448
+ <Field orientation="vertical">
449
+ <FieldLabel class="text-xs text-zinc-500">
450
+ <template
451
+ v-if="fieldDescription('cascade')"
452
+ #tooltip
453
+ >
454
+ <Markdown
455
+ :source="fieldDescription('cascade')"
456
+ block
457
+ class="prose prose-sm prose-zinc"
458
+ />
459
+ </template>
460
+ {{ fieldTitle("cascade") }}
461
+ </FieldLabel>
462
+ <Select
463
+ v-model:open="cascadeOpen"
464
+ :model-value="value.cascade ?? 'independent'"
465
+ @update:model-value="(v) => value = { ...value, cascade: v }"
466
+ >
467
+ <SelectTrigger class="w-full">
468
+ <SelectValue />
469
+ </SelectTrigger>
470
+ <SelectContent>
471
+ <SelectItem
472
+ v-for="opt in CASCADE_OPTIONS"
473
+ :key="opt.value"
474
+ :value="opt.value"
475
+ @mouseenter="hoveredCascade = opt.value"
476
+ @focus="hoveredCascade = opt.value"
477
+ >
478
+ {{ opt.label }}
479
+ </SelectItem>
480
+ <div
481
+ v-if="hoveredCascadeDescription"
482
+ data-slot="cascade-description"
483
+ class="mt-1 border-t border-zinc-200 px-2 py-1.5 text-xs text-zinc-500"
484
+ >
485
+ {{ hoveredCascadeDescription }}
486
+ </div>
487
+ </SelectContent>
488
+ </Select>
489
+ </Field>
490
+
491
+ <Field orientation="vertical">
492
+ <FieldLabel class="text-xs text-zinc-500">
493
+ <template
494
+ v-if="fieldDescription('expandAll')"
495
+ #tooltip
496
+ >
497
+ <Markdown
498
+ :source="fieldDescription('expandAll')"
499
+ block
500
+ class="prose prose-sm prose-zinc"
501
+ />
502
+ </template>
503
+ {{ fieldTitle("expandAll") }}
504
+ </FieldLabel>
505
+ <div>
506
+ <Switch
507
+ :model-value="value.expandAll ?? false"
508
+ @update:model-value="(v) => value = { ...value, expandAll: v }"
509
+ />
510
+ </div>
511
+ </Field>
512
+ </div>
513
+
514
+ <!-- 通用: 隐藏 / 禁用 / 只读 + 派生值 -->
515
+ <div class="grid grid-cols-2 gap-x-6 gap-y-4">
516
+ <Field orientation="vertical">
517
+ <FieldLabel class="text-xs text-zinc-500">
518
+ <template
519
+ v-if="fieldDescription('hidden')"
520
+ #tooltip
521
+ >
522
+ <Markdown
523
+ :source="fieldDescription('hidden')"
524
+ block
525
+ class="prose prose-sm prose-zinc"
526
+ />
527
+ </template>
528
+ {{ fieldTitle("hidden") }}
529
+ </FieldLabel>
530
+ <ExpressionEditor
531
+ :model-value="value.hidden ?? ''"
532
+ placeholder="例:row.archived"
533
+ result-type="bool"
534
+ :extra-vars="ROW_VARS"
535
+ @update:model-value="(v) => setOptionalExpression('hidden', v)"
536
+ />
537
+ </Field>
538
+ <Field orientation="vertical">
539
+ <FieldLabel class="text-xs text-zinc-500">
540
+ <template
541
+ v-if="fieldDescription('disabled')"
542
+ #tooltip
543
+ >
544
+ <Markdown
545
+ :source="fieldDescription('disabled')"
546
+ block
547
+ class="prose prose-sm prose-zinc"
548
+ />
549
+ </template>
550
+ {{ fieldTitle("disabled") }}
551
+ </FieldLabel>
552
+ <ExpressionEditor
553
+ :model-value="value.disabled ?? ''"
554
+ placeholder="例:row.locked"
555
+ result-type="bool"
556
+ :extra-vars="ROW_VARS"
557
+ @update:model-value="(v) => setOptionalExpression('disabled', v)"
558
+ />
559
+ </Field>
560
+ <Field orientation="vertical">
561
+ <FieldLabel class="text-xs text-zinc-500">
562
+ <template
563
+ v-if="fieldDescription('readonly')"
564
+ #tooltip
565
+ >
566
+ <Markdown
567
+ :source="fieldDescription('readonly')"
568
+ block
569
+ class="prose prose-sm prose-zinc"
570
+ />
571
+ </template>
572
+ {{ fieldTitle("readonly") }}
573
+ </FieldLabel>
574
+ <ExpressionEditor
575
+ :model-value="value.readonly ?? ''"
576
+ placeholder="例:row.id != null"
577
+ result-type="bool"
578
+ :extra-vars="ROW_VARS"
579
+ @update:model-value="(v) => setOptionalExpression('readonly', v)"
580
+ />
581
+ </Field>
582
+ <Field
583
+ orientation="vertical"
584
+ class="col-span-2"
585
+ >
586
+ <FieldLabel class="text-xs text-zinc-500">
587
+ <template
588
+ v-if="fieldDescription('derived')"
589
+ #tooltip
590
+ >
591
+ <Markdown
592
+ :source="fieldDescription('derived')"
593
+ block
594
+ class="prose prose-sm prose-zinc"
595
+ />
596
+ </template>
597
+ {{ fieldTitle("derived") }}
598
+ </FieldLabel>
599
+ <DerivedValueEditor
600
+ v-model="derivedModel"
601
+ result-type="list"
602
+ placeholder="例:row.defaultIds"
603
+ />
604
+ </Field>
605
+ </div>
606
+
607
+ <Separator />
608
+ <div class="flex flex-wrap gap-x-8 gap-y-3">
609
+ <Field
610
+ orientation="vertical"
611
+ class="w-full max-w-xs"
612
+ >
613
+ <FieldLabel class="text-xs text-zinc-500">
614
+ <template
615
+ v-if="fieldDescription('enableSorting')"
616
+ #tooltip
617
+ >
618
+ <Markdown
619
+ :source="fieldDescription('enableSorting')"
620
+ block
621
+ class="prose prose-sm prose-zinc"
622
+ />
623
+ </template>
624
+ {{ fieldTitle("enableSorting") }}
625
+ </FieldLabel>
626
+ <InputGroup>
627
+ <InputGroupInput
628
+ :model-value="value.sortKey"
629
+ placeholder="例:created_at"
630
+ @update:model-value="(v) => value = { ...value, sortKey: v || void 0 }"
631
+ />
632
+ <InputGroupAddon align="inline-end">
633
+ <InputGroupButton
634
+ :variant="value.enableSorting ? 'primary' : 'ghost'"
635
+ size="xs"
636
+ @click="value = { ...value, enableSorting: !value.enableSorting }"
637
+ >
638
+ <Icon :icon="value.enableSorting ? 'fluent:arrow-sort-up-16-regular' : 'fluent:arrow-sort-16-regular'" />
639
+ {{ fieldTitle("enableSorting") }}
640
+ </InputGroupButton>
641
+ </InputGroupAddon>
642
+ </InputGroup>
643
+ </Field>
644
+ </div>
645
+ </div>
646
+ </template>